一键导入
joycraft-research
Invoked by design/decompose or the human directly — produce objective codebase research by isolating question generation from fact-gathering
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Invoked by design/decompose or the human directly — produce objective codebase research by isolating question generation from fact-gathering
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Invoked by gather-context or the human after a knowledge gap surfaces — author one long-form reference doc and wire a pointer into AGENTS.md's Context Map
Invoked by session-end or the human after a fact surfaces — route it to the correct context document (production map, dangerous assumptions, decision log, institutional knowledge, troubleshooting)
Invoked at the design bookend by decompose's decision gate or the human directly — turn open questions into a decision dossier; every decision terminates clarified, backlogged, or discarded
Break a feature brief into atomic specs — small, testable, independently executable units
Design discussion before decomposition — produce a ~200-line design artifact for human review, catching wrong assumptions before they propagate into specs
Invoked by tune, optimize, or session-end to convert eligible boundary prose into machine-checked deny patterns — not a user entry point.
| name | joycraft-research |
| description | Invoked by design/decompose or the human directly — produce objective codebase research by isolating question generation from fact-gathering |
You are producing objective codebase research to inform a future spec or implementation. The key insight: the researching agent must never see the brief or ticket — only research questions. This prevents opinions from contaminating the facts.
Guard clause: If the user doesn't provide a brief path or inline description, ask: "What feature or change are you researching? Provide a brief path or describe it."
Before generating a single research question, run a bounded grep-first retrieval pass over the durable knowledge layer — a capped lookup, not a reading assignment:
docs/context/decision-log.md, docs/context/shipped.md, docs/discoveries/, remaining docs/context/*.md.Output contract: the research document MUST include a "Prior knowledge reused" section — a list citing each reused doc + row date/heading, or the explicit line "retrieval ran (terms: …), nothing relevant found."
Contradictions: if a retrieved decision or discovery contradicts the brief's direction, surface it explicitly in your handoff — never silently pick a side.
Read the brief and identify which zones of the codebase are relevant. Generate 5-10 research questions that are:
Output path:
docs/features/<slug>/brief.md, write to docs/features/<slug>/research.md (per-feature layout).docs/research/YYYY-MM-DD-feature-name.md (flat layout).Write the questions to docs/features/<slug>/.questions-tmp.md. Do NOT include any content from the brief.
Use the subagent tool with agent joycraft-researcher to perform the research. Pass ONLY the research questions — never the brief. Build the prompt from the questions file you just wrote.
Subagent prompt:
You are researching a codebase to answer specific questions. You have NO context about why these questions are being asked.
RULES:
- Answer each question with FACTS ONLY: file paths, function signatures, data flows, patterns, dependencies
- Do NOT recommend, suggest, or opine
- Do NOT speculate about what should be built
- If a question cannot be answered, say "No existing code found for this"
- Search the codebase and read files thoroughly
- Include code snippets only when essential evidence
QUESTIONS:
[INSERT_QUESTIONS_HERE]
OUTPUT FORMAT:
# Codebase Research
**Date:** [today]
**Questions answered:** [N/total]
---
## Q1: [question]
[Facts only]
## Q2: [question]
[Facts only]
Write the subagent's response to docs/features/<slug>/research.md, adding a "Prior knowledge reused" section at the top from Step 0's retrieval pass (or the line "retrieval ran (terms: …), nothing relevant found"). Delete the temporary questions file.
After writing the research document, update the parent brief with a back-reference:
docs/features/<slug>/brief.md> lines at the top), add or update:
> **Research:** docs/features/<slug>/research.md> **Research:** line already exists, replace it — do NOT add a duplicatePresent:
Research complete: docs/features/<slug>/research.md
This document contains objective facts — no opinions or recommendations.
Recommended next step:
- /skill:joycraft-design — translate research findings into architectural decisions before building
If the scope is simple (< 5 files, well-understood area, no architectural decisions):
- /skill:joycraft-decompose — skip design and break directly into atomic specs
Other options:
- /skill:joycraft-new-feature — formalize into a full Feature Brief first
- Read the research and add corrections manually
You've just written docs/features/<slug>/research.md. Before hand-off, the parent brief at docs/features/<slug>/brief.md may now disagree with what you discovered. Re-read it and check each of these sections:
| Brief section | What to look for |
|---|---|
| Vision | Did your findings refine or contradict the framing? |
| Hard Constraints | Are any constraints now obsolete, missing, or refined? |
| Out of Scope | Did your findings push something in or out of scope? |
| Decomposition | Are spec counts, names, or dependencies still accurate? |
| Test Strategy | Do your findings change what or how to test? |
| Success Criteria | Are the criteria still observable and still match the goal? |
For each section, choose one:
If you make changes, note them at the bottom of research.md under a "Brief updates" subsection. If the brief is already in sync, note: "Reconciliation checked, no changes required." If no parent brief exists (feature was described inline), note that and skip this step.
Why this step exists: the silent-drift gap. Without reconciliation, the brief and downstream artifacts diverge — and later decomposition is sized against the stale brief. This feature ("single-source-skills") hit exactly this: brief said "11 clean / 9 dirty" until the research re-audit forced a re-decomposition. Don't let it happen again.