harness-prompt
Create and manage the system prompt entity in agent-harness, generating CLAUDE.md, AGENTS.md, and copilot-instructions.md from a single canonical source.
Best use case
harness-prompt is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Create and manage the system prompt entity in agent-harness, generating CLAUDE.md, AGENTS.md, and copilot-instructions.md from a single canonical source.
Teams using harness-prompt should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/harness-prompt/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How harness-prompt Compares
| Feature / Agent | harness-prompt | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Create and manage the system prompt entity in agent-harness, generating CLAUDE.md, AGENTS.md, and copilot-instructions.md from a single canonical source.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# harness-prompt You are helping the user create or manage the **system prompt entity** in their agent-harness workspace. This skill covers the full workflow: scaffolding, editing, and applying the prompt to generate provider-native instruction files. ## What the `prompt` entity is The `prompt` entity is the single, canonical system prompt for all AI coding providers. There can only be one, and its id is always `system`. It lives at: ``` .harness/src/prompts/system.md ``` The file is plain Markdown with optional YAML frontmatter. When you run `npx harness apply`, harness renders it into provider-native instruction files for every enabled provider. ## Provider output mapping | Provider | Output path | Format | Read at | |---|---|---|---| | Claude Code | `CLAUDE.md` | Markdown | Session start (every conversation) | | OpenAI Codex CLI | `AGENTS.md` | Markdown | Once per run, before task execution | | GitHub Copilot | `.github/copilot-instructions.md` | Markdown | Every relevant request | ### Claude Code — `CLAUDE.md` - Loaded in full into context at the start of every session as a user-role message (not as the system prompt itself). - Supports full Markdown: headers, bullets, code blocks, `@path/to/file` imports. - Target **under 200 lines** — longer files consume more context and reduce adherence. - Instructions must be specific and concrete to be reliably followed (e.g. "Run `pnpm test` before committing" rather than "test your changes"). - Can be placed at `./CLAUDE.md` or `./.claude/CLAUDE.md`; harness defaults to `CLAUDE.md`. - Official docs: https://code.claude.com/docs/en/memory ### OpenAI Codex CLI — `AGENTS.md` - Loaded once per run; injected as user-role messages near the top of conversation history, before the user prompt. - Supports full Markdown; structured sections with headers and bullets work best. - Default size cap: **32 KiB** combined across all discovered AGENTS.md files. - Codex also discovers AGENTS.md files in subdirectories (root → CWD, concatenated in order); the root-level file provides baseline instructions. - Official docs: https://developers.openai.com/codex/guides/agents-md ### GitHub Copilot — `.github/copilot-instructions.md` - Applied automatically to all relevant Copilot requests in the repository. - Supports Markdown; whitespace between instructions is ignored. - Keep to **no more than ~2 pages** (roughly 8,000 characters). Instructions must not be task-specific — they should be reusable guidance. - Recommended content: repo overview, build/test/lint commands, project layout, non-obvious dependencies. - Official docs: https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot ## Provider-specific differences | Concern | Claude Code | Codex CLI | Copilot | |---|---|---|---| | Size guidance | Under 200 lines | Under 32 KiB | ~2 pages / ~8 KB | | Rich markdown | Yes — headers, code blocks, imports | Yes | Yes, but keep concise | | Structured workflows | Works well | Works well | Stick to reusable context | | Task-specific steps | OK | OK | Avoid — use `.github/instructions/` for that | Content that works well everywhere: coding standards, project layout, build/test commands, naming conventions, language/framework preferences. ## Per-provider overrides To customize the output path or content for a specific provider without changing the canonical source, create a sidecar override YAML: ``` .harness/src/prompts/system.overrides.<provider>.yaml ``` Minimal path override example (`.harness/src/prompts/system.overrides.claude.yaml`): ```yaml version: 1 targetPath: ".claude/CLAUDE.md" ``` ## Harness CLI commands ```bash # Scaffold the source file (creates .harness/src/prompts/system.md) npx harness add prompt # Preview what will be written (dry run) npx harness plan # Generate provider artifacts (CLAUDE.md, AGENTS.md, .github/copilot-instructions.md) npx harness apply # Watch for changes and auto-apply npx harness watch # Remove the prompt entity and its source file npx harness remove prompt system ``` Enable providers before applying if you have not already: ```bash npx harness provider enable claude npx harness provider enable codex npx harness provider enable copilot ``` ## Example: well-structured `system.md` ```markdown --- # Optional frontmatter — reserved for future harness use; leave empty or omit --- # Project instructions This is a TypeScript monorepo using pnpm workspaces and Turborepo. ## Stack - Node >= 22, pnpm >= 9 - Biome for linting and formatting (2-space indent, double quotes, semicolons) - Node built-in test runner via `tsx` for unit tests ## Commands - `pnpm install` — install dependencies - `pnpm build` — build all packages (respects Turbo dependency order) - `pnpm test` — run unit tests (requires build) - `pnpm check:write` — lint + format with auto-fix - `pnpm typecheck` — type-check all packages ## Code conventions - ESM only (`"type": "module"`), NodeNext module resolution - Strict TypeScript: `noUncheckedIndexedAccess`, full `strict` mode - Never duplicate logic — extract shared helpers - Delete dead code; prefer concise expressions over boilerplate - All public API functions must have explicit return types ## Project layout - `packages/manifest-schema/` — Zod schemas and types (built first) - `packages/toolkit/` — CLI and core engine - `docs/` — documentation; update after any feature changes ## Git workflow - Commit messages: `type: description` (conventional commits) - Run `pnpm check:write && pnpm typecheck && pnpm test` before pushing ``` ## Workflow summary 1. `npx harness add prompt` — creates `.harness/src/prompts/system.md` 2. Edit `.harness/src/prompts/system.md` with your project instructions 3. `npx harness apply` — writes `CLAUDE.md`, `AGENTS.md`, `.github/copilot-instructions.md` 4. Commit all generated files alongside the source The generated files are owned by harness. Edit only the canonical source; re-run `apply` to propagate changes.
Related Skills
harness-subagent
Create and manage subagent entities in the agent-harness workspace. Invoke this skill when a user wants to define, scaffold, apply, or remove a subagent across Claude Code, OpenAI Codex, or GitHub Copilot.
harness-skill
Create and manage skill entities in the agent-harness workspace. Use when the user wants to add a new skill, understand how skills work across providers, or generate provider skill artifacts from a canonical source.
harness-settings
Configure provider-specific settings (permissions, model, features) for Claude Code, OpenAI Codex CLI, and GitHub Copilot using the harness settings entity.
harness-mcp
Create and manage MCP server config entities in the agent-harness workspace.
harness-hook
Create and manage lifecycle hook entities in the agent-harness workspace. Covers canonical event authoring, provider projection (Claude Code, GitHub Copilot, OpenAI Codex CLI, Cursor), mode behavior, handler types, the full event/provider support matrix, copy-paste recipes, and common diagnostics.
npm-workflow-release
Release agent-harness packages to npm and verify publication. Use when the user asks to cut a release, push a missing release tag, or troubleshoot why a version was not published.
world-sufficiency-prompt
First-interaction system prompt generator for Gemini, Codex, and Claude. Detects hierarchical user intent (implicit and explicit) and loads GF(3)-balanced skill triads to achieve World -> World' sufficiency before any model response. Bridges dynamic-sufficiency theory to concrete systemInstruction/system-message payloads across all three providers.
harness-writing
Writing effective fuzzing harnesses for security testing.
detecting-ai-model-prompt-injection-attacks
Detects prompt injection attacks targeting LLM-based applications using a multi-layered defense combining regex pattern matching for known attack signatures, heuristic scoring for structural anomalies, and transformer-based classification with DeBERTa models. The detector analyzes user inputs before they reach the LLM, flagging direct injections (system prompt overrides, role-play escapes, instruction hijacking) and indirect injections (encoded payloads, multi-language obfuscation, delimiter-based escapes). Based on the OWASP LLM Top 10 (LLM01:2025 Prompt Injection) and Simon Willison's prompt injection taxonomy. Activates for requests involving prompt injection detection, LLM input sanitization, AI security scanning, or prompt attack classification.
prompt-injection-defense
Defend the agent's instruction surface against adversarial content - hidden-Unicode prompt injection (Trojan Source bidi reordering, U+E0000 tag-block ASCII smuggling, zero-width text), homoglyph confusables, and poisoned context that a human reviewer can't see but the model obeys. Scan CLAUDE.md / AGENTS.md / SKILL.md / .cursorrules and MCP tool descriptions; sanitize fetched web pages, issue/PR bodies, and dependency READMEs before they enter context. Triggers on: prompt injection, hidden unicode, invisible characters, zero-width space, bidi override, Trojan Source, ASCII smuggling, tag characters, homoglyph, confusable, unicode steganography, poisoned CLAUDE.md, malicious tool description, MCP tool poisoning, instruction injection, jailbreak in file, is this file safe, sanitize untrusted content, scan for hidden text.
scenario-verification-harness
Applies the Robota scenario verification loop by checking scope, preserving canonical ownership, re-recording only when necessary, and stopping on strict-policy failures. Use when scenario files, example flows, or execution-path behavior changes.
pre-refactor-test-harness
Before modularizing or refactoring a package, analyze the code for extraction points, write characterization tests for current behavior, then modularize under test protection. Use when a package has monolithic files that need to be broken into testable modules.