discovery
Investigate a topic, then decompose it into backlog tickets grouped by epic. Ends at tickets, not a spec. Needs a topic argument — without one, use dev.
- License 许可
- MIT
- 最近更新
- 2026-10-28
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- discovery
- description
- Investigate a topic, then decompose it into backlog tickets grouped by epic. Ends at tickets, not a spec. Needs a topic argument — without one, use dev.
- argument-hint
- <topic>
02 资源文件 4
- 参考文档references/clarify.md2.4 KB
- 参考文档references/decompose.md3.9 KB
- 参考文档references/research.md3.0 KB
- 参考文档references/size-pin.txt5 B
03 SKILL.md 正文
Discovery
Topic: $ARGUMENTS — required. Empty → stop with "discovery requires a topic argument; for 'what should I work on' or 'next task' routing, use /cortex-core:dev instead." Directory: cortex/research/{{topic}}/, lowercase-kebab.
Step 1: Resolve the phase
- No directory → clarify.
research.mdwithoutdecomposed.md→ decompose.decomposed.mdpresent → complete. Offer a re-run or an update.
Report the phase and offer to continue or restart earlier. If several cortex/research/*/ lack decomposed.md, list them and ask which.
A re-run from scratch never overwrites. Use slug {{topic}}-N (smallest unused N ≥2). Open the new research.md with superseded: naming the artifact just before it. Leave the old directory as a record. Repointing discovery_source: or archiving is the user's call.
Step 2: Execute the phase
| Phase | Reference | Artifact |
|---|---|---|
| Clarify | clarify.md | none (conversation only) |
| Research | research.md | cortex/research/{{topic}}/research.md |
| Decompose | decompose.md | Epic + backlog tickets |
Read only the current phase's reference. ${CLAUDE_SKILL_DIR} resolves only here. Where a reference names a sibling, use the absolute path: fanout → ${CLAUDE_SKILL_DIR}/../research/references/fanout.md; orchestrator-review → ${CLAUDE_SKILL_DIR}/../build/references/orchestrator-review.md.
After each phase, commit cortex/research/{{topic}}/, summarize, and go on without asking — except at the gate below.
Step 3: Research → Decompose gate
One question the user must answer, reached by finishing Research or resuming into Decompose. No decompose work starts until it is answered.
cortex-discovery generate-brief --research-md cortex/research/<topic>/research.md \
--persist-to cortex/research/<topic>/brief.md
Non-zero exit, missing file, or failed validation → show the full ## Architecture section with a warning that names the failure (brief_generation_failed: <reason>). Over the advisory word cap → show the brief anyway with a one-line note.
approve— go to Decompose.revise— free-text changes to Architecture only. Rework it against the template inreferences/research.md§3, rewrite### Piecesthen### How they connect, show it again, and add one torevision_round. Repeat untilapproveordrop.drop— a neutral end: the research is enough and needs no tickets, or the user abandons it. Write nothing tocortex/backlog/. The artifact stays.promote-sub-topic— the user names a sub-topic. Compose a body via/backlog-author composewith a## Promoted fromsection reading exactly## Promoted from\n\nDiscovery: cortex/research/<current-topic>/. That section is the only link — no frontmatter pointer, no nested discovery. Create oneneeds-discoveryticket per the backend routing below, then return to this gate.
Log one event per response:
cortex-discovery emit-checkpoint-response --topic <topic> --checkpoint research-decompose \
--response <approve|revise|drop|promote-sub-topic> --revision-round <int>
Backend routing
Before a phase creates tickets, run cortex-read-backlog-backend (no arguments):
cortex-backlog→ create normally.none→ create nothing. Keep the titles and bodies incortex/research/{topic}/decomposed.mdwith a one-line note. Write nothing tocortex/backlog/.- Anything else → file as best you can per
backlog.instructions. If filing fails, show the bodies inline.
Every ticket created carries discovery_source: pointing at the research artifact; /cortex-core:refine loads it as background.
04 同仓库更多 Skills
over-cap-no-marker
Synthetic fixture with 501 lines and no size-budget marker.
invalid-marker
Synthetic fixture exercising the invalid-marker failure path.
boundary-29-char-reason
Synthetic fixture with marker rationale at the regex boundary (29 chars, just under min).
valid-with-inputs
A skill that declares one input variable and uses it in the body.
valid-minimal
A minimal skill with only the required fields present.
invalid-undeclared-variable
A skill whose body uses a variable not declared in inputs.