OpenSpec Schemas (kmhalvin) — Prompts
Excerpt 1: subagent-spec-driven — research-proposal-prep instruction
From openspec/schemas/subagent-spec-driven/schema.yaml:
- id: research-proposal-prep
instruction: |
## Main Agent Instructions
Write detailed instructions for a subagent to research the codebase for this change.
Include:
- What to explore (directories, files, patterns)
- What patterns to find (similar features, conventions)
- Expected output format (file:line references, structured findings)
...
- CRITICAL: Read the XML comments in the template carefully. You MUST replace
`{ARTIFACT_ID}` and `{CHANGE_NAME}` with actual execution values, and provide
explicit absolute paths.
## REQUIRED: After Generating `.instructions/research-proposal.md`
Spawn a subagent to execute the next artifact. If your agent has a built-in
subagent tool (e.g. Task()), use it directly. Otherwise, read your provided
project context to find the configured subagent CLI command.
CRITICAL: Main Agent MUST replace `{CHANGE_NAME}` with the real change name
string before executing so the subagent has the correct context!
Pass the following prompt to the subagent:
"/opsx-continue Working on change: {CHANGE_NAME}\n\nExecute ONLY subagent
artifacts (research-*, draft-*). Do NOT execute *-prep artifacts."
Technique: Delegation-by-instruction — the main agent writes a file that becomes the subagent's context. The instruction enforces placeholder substitution before dispatch.
Excerpt 2: qrspi — draft-questions Context Drop instruction
From openspec/schemas/qrspi/schema.yaml:
- id: draft-questions
instruction: |
## Main Agent Instructions
Read the context, original ticket, and `.alignment/question-research.md`. The
Subagent has formulated detailed, codebase-specific technical questions inside
this document.
DO NOT immediately write `questions.md`. First, present these technical questions
to the user in this chat and work back and forth to resolve them.
ONLY ONCE the Subagent's technical questions are answered and resolved, formalize
the final summary and objective research directives into `questions.md`.
## REQUIRED: Context Drop
After creating `questions.md`, you MUST perform a Context Drop to clear your
session memory before research begins.
- If your configured agent framework supports starting new tasks autonomously
(e.g., via a `new_task` tool), use it to start a new task with the context:
`/opsx-continue.md`
- Otherwise, you MUST halt execution (e.g., using `attempt_completion` or
explicitly stopping) and instruct the human: "Please start a New Chat / Task,
then run `/opsx-continue.md`"
Technique: Mandatory conversational gate before document production, followed by forced context wipe. The "DO NOT immediately write" instruction prevents the common AI failure mode of skipping human alignment.
Excerpt 3: qrspi — research-codebase instruction (clean session)
- id: research-codebase
instruction: |
## Main Agent Instructions
Read the answered Q&A in `questions.md`. Deeply explore the codebase without
making architectural assumptions, and output objective facts into `codebase.md`.
Technique: Minimal instruction after a Context Drop — the agent reads only questions.md (no ticket history, no prior conversation). Stripped context forces objective analysis.