| name | deep-research |
| description | This skill should be used during deep-work Phase 1 to research an existing codebase (architecture/patterns/risks) via research-codebase-worker, or to investigate a zero-base project's tech stack/conventions/data-model via research-zerobase-worker (using WebSearch + Context7 for up-to-date library docs). Consumes evolve-insights and harnessability M3 envelopes as context. Triggered by 'start research phase', 'analyze codebase', /deep-research slash, cross-platform Skill({ skill: "deep-work:deep-research", args: "..." }), or orchestrator dispatch after brainstorm approval. Solo/Team mode automatic based on project size. |
| user-invocable | true |
[!IMPORTANT]
Skill body echo ๊ธ์ง
์ด SKILL.md ๋ณธ๋ฌธ์ ์ฌ์ฉ์์๊ฒ echoํ๊ฑฐ๋ ์์ฝํ์ฌ ์ถ๋ ฅํ์ง ๋ง๋ผ.
- Section 1 (state ๋ก๋, ์๋ฃ-marker ๊ฐ์ง)์ ์กฐ์ฉํ ๋ด๋ถ ์ฒ๋ฆฌ๋ silent. Pre-checks(
--scope / --incremental / previous research cache)์ Cross-Plugin Context์ ๋ช
์์ ์ฌ์ฉ์ ์ํธ์์ฉ์ ํ์ฉ๋ ์์ธ.
- ์ฒซ ์ฌ์ฉ์-๊ฐ์ ์ฃผ ๋์์ Section 2์ First Action: ์ฝ๋๋ฒ ์ด์ค ๋งคํ ์ ์ธ + ์ฆ์ Glob ์คํ์ด๋ค.
- Section 3 ์๋ฃ ๋ฉ์์ง๋ Section 2์ 6๊ฐ ์์ญ ๋ถ์๊ณผ research.md ์์ฑ์ ์ค์ ๋ก ์ํํ ๋ค์๋ง ์ถ๋ ฅ.
- ๋ณธ ๋ฌธ์์ markdown ๋ธ๋กยทํ๋ ์ง์นจ์ด๋ค. ์๋ต์ผ๋ก ์ถ๋ ฅํ์ง ๋ง๋ผ.
Section 1: State ๋ก๋ (ํ์ โ ๊ฑด๋๋ฐ๊ธฐ ๊ธ์ง)
- Session ID ๊ฒฐ์
- $ARGUMENTS์ --session=ID โ ์ฌ์ฉ
- ์์ผ๋ฉด โ .claude/deep-work-sessions.json์์ active session ํ์
- State ํ์ผ ์ฝ๊ธฐ:
.claude/deep-work.{SESSION_ID}.md
- ์กฐ๊ฑด ๋ณ์ ํ์ธ:
- worktree_path โ $ARGUMENTS ์ฐ์ , ์์ผ๋ฉด state์์
- team_mode โ $ARGUMENTS ์ฐ์ , ์์ผ๋ฉด state์์ (์์ผ๋ฉด solo)
- cross_model โ $ARGUMENTS ์ฐ์ , ์์ผ๋ฉด state์์
work_dir, task_description, project_type ์ถ์ถ โ $WORK_DIR ์ค์ (๊ธฐ๋ณธ: deep-work)
current_phase๊ฐ "research"์ธ์ง ํ์ธ โ ์๋๋ฉด ์ค๋ฅ
research_started_at ๊ธฐ๋ก (ISO timestamp)
์๋ฃ-Marker ๊ฐ์ง (resume ๊ฒฝ๋ก โ F1, NC1, NW5)
research_approved: true ํ๋๊ฐ state์ ์ด๋ฏธ ์๊ณ $ARGUMENTS์ --force-rerun / --scope= / --incremental์ด ์์ผ๋ฉด paused-after-approval ๋ณต๊ท ํ๋ณด ๊ฒฝ๋ก์ด๋ค. ๋จ, Orchestrator ยง3-2๊ฐ ์ด๋ฏธ integrity check(sha256 ๋น๊ต)๋ฅผ ์ํํ์ฌ stale approval ์ skill์ ์ง์ ์ฌํธ์ถํ๋ฏ๋ก, ๋ณธ branch๋ Orchestrator dispatch๋ฅผ ํตํ ์ ์ ๊ฒฝ๋ก ์ด์ธ์๋ ๋๋ฌํ์ง ์๋๋ค. ์ง์
์:
- "Phase 1 (Research)๋ ์ด๋ฏธ ์น์ธยท์๋ฃ๋์์ต๋๋ค. Exit Gate๋ฅผ ์ฌํ์ํฉ๋๋ค." ์ถ๋ ฅ
- Orchestrator ยง3-2๋ก ์ ์ด ๋ฐํ (review+approval ๊ฑฐ์น์ง ์๊ณ ๋ฐ๋ก Exit Gate ์ฌ์คํ)
- Section 2/3 ์ง์
๊ธ์ง
์ค์ (NC1): research_completed_at / research_complete: true๋ง ์๊ณ research_approved๊ฐ ์์ผ๋ฉด ์ด branch๋ฅผ ๋ฐ๋์ํค์ง ๋ง ๊ฒ โ skill completion๊ณผ review+approval ์ฌ์ด์ ์ธ์
์ด ์ค๋จ๋ ์ํ์ด๋ฉฐ, resume ์ review+approval์ ๋ค์ ๊ฑฐ์ณ์ผ ํ๋ค.
์ค์ (NW5): Resume fast-path์ integrity check๋ Orchestrator ยง3-2๊ฐ ์ฐ์ ๋ด๋น. ๋ณธ branch๋ research_approved: true๋ง ๊ฐ์งํ๋, Orchestrator๊ฐ hash ๋ถ์ผ์น ๊ฐ์ง ์ approval์ invalidateํ๊ณ skill์ --force-rerun๊ณผ ํจ๊ป ํธ์ถํ๋ฏ๋ก ์ด branch๋ out-of-band ํธ์ง ์ผ์ด์ค์์ ์ฐํ๋จ.
Critical Constraints
- DO NOT write any code or modify source files
- ONLY research, analyze, and document findings in
$WORK_DIR/
Pre-checks
Partial re-run (--scope)
$ARGUMENTS์ --scope= ํฌํจ ์: ๊ธฐ์กด research.md์ ์ง์ ์์ญ๋ง ์ฌ๋ถ์ โ Section 3์ผ๋ก ๊ฑด๋๋.
Valid scopes: architecture, patterns, data, api, infrastructure, dependencies
Incremental mode (--incremental)
$ARGUMENTS์ --incremental ํฌํจ ์: last_research_commit ๊ธฐ์ค git diff โ ๋ณ๊ฒฝ ์์ญ๋ง ์ฌ๋ถ์.
--scope๊ฐ --incremental๋ณด๋ค ์ฐ์ .
Previous research cache
.deep-work/ ๋ด ์ด์ ์ธ์
research.md ๋ฐ๊ฒฌ ์ โ ๋ฒ ์ด์ค๋ผ์ธ ํ์ฉ ์ฌ๋ถ๋ฅผ ์ฌ์ฉ์์๊ฒ ์ง๋ฌธ.
Cross-Plugin Context
Phase 1 Research ์์ ์ ์ธ๋ถ ํ๋ฌ๊ทธ์ธ ๋ฐ์ดํฐ๋ฅผ ์ฐธ์กฐํ๋ค. ์ด ๋ฐ์ดํฐ๋ "์ฐธ๊ณ " ์์ค์ด๋ฉฐ, ํ์ฌ ์์
๊ณผ ๊ด๋ จ ์์ผ๋ฉด ๋ฌด์ํ๋ค.
Harnessability Context (envelope-aware v6.5.0)
.deep-dashboard/harnessability-report.json์ด ์กด์ฌํ๋ฉด:
- ํ์ผ ์ฝ๊ธฐ ๋ฐ envelope ๊ฐ์ง:
- ํ์ผ์ด M3 envelope ํํ(
{schema_version: "1.0", envelope: {...}, payload: {...}})์ด๋ฉด identity guard๋ฅผ ์ ์ฉ:
envelope.producer === "deep-dashboard" โง envelope.artifact_kind === "harnessability-report" โง envelope.schema.name === envelope.artifact_kind ๊ฐ ๋ชจ๋ ์ฐธ์ธ ๊ฒฝ์ฐ์๋ง payload๋ฅผ ์ฌ์ฉ. ํ๋๋ผ๋ ์ด๊ธ๋๋ฉด "foreign envelope at harnessability-report path โ skip" ๊ฒฝ๊ณ ํ ๊ฑด๋๋.
- Legacy(non-envelope) ํ์ผ์ด๋ฉด root ๊ฐ์ฒด๋ฅผ ๊ทธ๋๋ก ์ฌ์ฉ (forward-compat).
- Freshness ํ์ธ (envelope์ด๋ฉด
envelope.generated_at์ ์ฐ์ , ์์ผ๋ฉด payload root์ generated_at):
- 7์ผ ์ด์ ๊ฒฝ๊ณผํ ๋ฆฌํฌํธ๋ "stale harnessability report โ skip" ๊ฒฝ๊ณ ํ ๊ฑด๋๋
generated_at ํ๋๊ฐ ์์ผ๋ฉด ๊ทธ๋๋ก ์ฌ์ฉ (ํ์ ํธํ)
- ์ ์๊ฐ ๋ฎ์ ์ฐจ์(< 5.0)์ research context์ ํฌํจ โ
dimensions[] / total ๋ฑ์ ํ๋๋ envelope ๋ชจ๋/legacy ๋ชจ๋ ๋ชจ๋์์ ๋์ผํ๊ฒ payload root ๋๋ ๊ฐ์ฒด root์์ ์ฝ๋๋ค:
์ด ํ๋ก์ ํธ์ harnessability ์ง๋จ ๊ฒฐ๊ณผ:
- <dimension>: <score>/10 โ <suggestion>
์ด ์์
์์ ๊ด๋ จ ์์ญ์ ๊ฐ์ ํ ์ ์์ผ๋ฉด ํจ๊ป ๊ณ ๋ ค.
- ์ด ์ ๋ณด๋ ์ดํ Section 2์ Topology Detection์์ ์ฐธ์กฐ ๊ฐ๋ฅ. ์ฌ๊ธฐ์๋ research context์ ํ
์คํธ๋ก๋ง ํฌํจ.
Evolve Insights Context (envelope-aware v6.5.0)
.deep-evolve/evolve-insights.json(๋๋ .deep-evolve/<session>/evolve-insights.json)์ด ์กด์ฌํ๋ฉด:
- ํ์ผ ์ฝ๊ธฐ ๋ฐ envelope ๊ฐ์ง:
- M3 envelope ์ด๋ฉด
envelope.producer === "deep-evolve" โง envelope.artifact_kind === "evolve-insights" โง envelope.schema.name === envelope.artifact_kind ๊ฒ์ฆ ํ payload๋ฅผ ์ฌ์ฉ. mismatch๋ skip.
- Legacy ํ์ผ์ด๋ฉด root ๊ฐ์ฒด ๊ทธ๋๋ก ์ฌ์ฉ.
insights_for_deep_work ํญ๋ชฉ์ research context์ ํฌํจ (envelope ๋ชจ๋/legacy ๋ชจ๋ ๋ชจ๋ payload/root ์์ ์ง์ ์ ๊ทผ):
deep-evolve ๋ฉํ ์์นด์ด๋ธ ๊ธฐ๋ฐ ์ธ์ฌ์ดํธ:
- <pattern>: <evidence> โ <suggestion>
- ์ด ์ธ์ฌ์ดํธ๋ "์ฐธ๊ณ " ์์ค โ ํ์ฌ ์์
๊ณผ ๊ด๋ จ ์์ผ๋ฉด ๋ฌด์
- ํฅํ (Phase 5 deep-integrate) ์์ session-receipt ์
envelope.parent_run_id ๊ฐ ์ด evolve-insights ์ envelope.run_id ๋ก ์ฑ์์ง๋ค (cross-plugin chain).
Deep-Memory Brief Context (v6.9.0+, consumer of deep-memory plugin)
.deep-memory/latest-brief.md๊ฐ ํ๋ก์ ํธ ๋ฃจํธ(git rev-parse --show-toplevel์ $WORK_DIR์์ ์คํํ ๊ฒฐ๊ณผ โ non-git worktree์์๋ $WORK_DIR์ ๊ฐ์ฅ ๊ฐ๊น์ด ancestor ์ค .git/ ๋๋ ํ ๋ฆฌ๊ฐ ์๋ ์์น โ R1-I2)์ ์กด์ฌํ๋ฉด cross-project semantic operational memory๋ฅผ Research ์ปจํ
์คํธ๋ก ์ธ์ฉํ๋ค. ์๋ ํธ์ถ ๊ธ์ง โ brief ํ์ผ์ด ์ด๋ฏธ materialize ๋์ด ์๋ ๊ฒฝ์ฐ(์ฌ์ฉ์๊ฐ ๋ช
์์ ์ผ๋ก /deep-memory-brief๋ฅผ ํธ์ถํ ๊ฒฐ๊ณผ)์๋ง ์ธ์ฉํ๋ค. ์์ธํ spec์ docs/deep-memory-integration-handoff.md ยง2 ์ฐธ์กฐ.
์ฒ๋ฆฌ ์์:
- ์กด์ฌ ํ์ธ โ
.deep-memory/latest-brief.md ํ์ผ stat. ๋ถ์ฌ ์ research.md์ ์๋ฌด๊ฒ๋ ์ฐ์ง ์๋๋ค โ research artifact ๋ brief ๊ฐ ์์ ๋๋ง deep-memory ์ธ์งํ๊ฒ ํ๋ค (R1-Y2 โ opt-in ์๋ ์ฌ์ฉ์์ artifact์ deep-memory ๊ถ์ ๊ฐ leak ๋์ง ์๋๋ก). ๋จ runtime Research context ์๋ ํ ์ค ์๋ด๋ง emit: "No .deep-memory/latest-brief.md found. Run /deep-memory-brief \"<task>\" first if you want cross-project recall." ์ดํ ยง5 State ํ๋๋ ๋ชจ๋ ๋ถ์ฌ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ฑ์ฐ๊ณ ์ข
๋ฃ.
- Stale ๊ฐ๋ โ ํ์ผ mtime์ด ํ์ฌ ์๊ฐ๋ณด๋ค 14์ผ ์ด์ ์ค๋๋๋ฉด "brief is stale โ re-run /deep-memory-brief" ๊ฒฝ๊ณ ๋ฅผ ํจ๊ป ์ถ๋ ฅํ๋ ์ธ์ฉ์ ๊ณ์ ์งํํ๋ค (์ฌ์ฉ์๊ฐ brief๋ฅผ materializeํ ์์ ์ ์ด๋ฏธ opt-in ํ ๊ฒ์ด๋ฏ๋ก ์ฐจ๋จํ์ง ์์).
- Verbatim ์ธ์ฉ โ brief markdown ๋ณธ๋ฌธ ์ ์ฒด๋ฅผ
research.md์ ์ ## Cross-project Memory ์น์
(์ด๋ ๋น๋ก์ ์์ฑ) ์๋์ ๊ทธ๋๋ก ์ฝ์
ํ๋ค. brief์ heading hierarchy๋ ๋ ๋จ๊ณ ๋ค์ฌ์ด๋ค (# Deep-Memory Brief โ ... โ ### Deep-Memory Brief โ ..., ## <idx>. <type> โ ... โ #### <idx>. ...). ์ด๋ deep-memory์ redaction(3-pass) + ํฌ๋งทํ
์ ๋ณด์กดํ๊ธฐ ์ํจ์ด๋ค โ re-rendering ๊ธ์ง.
- Provenance ์ถ์ถ โ brief markdown ๋ณธ๋ฌธ์์ ์ ๊ท์
/\bmem-[0-9A-HJKMNP-TV-Z]{26}\b/g (Crockford base32 ULID, uppercase-only โ I/L/O/U ์ ์ธ; deep-memory์ memory_id ๋ uppercase ๋ง emit. ํฅํ lowercase ๋์
์ provenance silently drop ๋์ง ์๋๋ก ๋ช
์ โ R1-I1) ์ผ๋ก ๋ชจ๋ memory_id ํ ํฐ์ ์ถ์ถํ์ฌ state์ cross_project_memory.cited_memory_ids ๋ฐฐ์ด๋ก ๊ธฐ๋กํ๋ค. ๋น ๋ฐฐ์ด๋ ์ ํจ (์ธ์ฉ ์์ฒด๊ฐ ๋น brief์ผ ์ ์์).
- State ํ๋ (frontmatter, ๋ถ์ฌ ์ ๋ชจ๋ null/[]):
cross_project_memory.brief_path โ .deep-memory/latest-brief.md ๋๋ null
cross_project_memory.brief_mtime โ ISO 8601 ๋๋ null
cross_project_memory.brief_stale โ boolean (mtime ๊ธฐ์ค > 14d)
cross_project_memory.cited_memory_ids โ mem-<ULID> ๋ฐฐ์ด
Privacy ๋ถ๋ณ์:
- ๋ณธ skill์
/deep-memory-brief๋ฅผ ํธ์ถํ์ง ์๋๋ค. ์ค์ง ์ด๋ฏธ ์กด์ฌํ๋ brief ํ์ผ์ ์ฝ๊ธฐ๋ง ํ๋ค.
- ๋ณธ skill์
.deep-memory/ ํ์์ ์ฐ์ง ์๋๋ค. brief ํ์ผ์ read-only.
- ์ธ์ฉ ํ feedback hook(memory ํ๊ฐ)์ ํฅํ Phase 4+ PR์์ ์์ชฝ ๋์ ๋์
โ ํ์ฌ PR์ spec๋ง ๋ช
์ (
docs/deep-memory-integration-handoff.md ยง4).
Section 2: Phase ์คํ
First Action (์ฆ์ ์คํ โ ๊ฑด๋๋ฐ๊ธฐ ๊ธ์ง)
Section 1 state ๋ก๋์ ์๋ฃ-marker ๊ฐ์ง๊ฐ ๋๋๋ฉด ์ฆ์ ๋ค์ ๋ฉ์์ง๋ฅผ ์ถ๋ ฅํ ๋ค ๋ณ๋ ํ์ธ ์์ด Glob ์คํ์ผ๋ก ์ง์
ํ๋ค:
"์ฝ๋๋ฒ ์ด์ค ๋ถ์์ ์์ํฉ๋๋ค. ์ฃผ์ ๋๋ ํ ๋ฆฌ๋ถํฐ ๋งคํํฉ๋๋ค."
์ด์ด์ Glob ๋๊ตฌ๋ก **/*.{md,json,ts,tsx,js,py,sh,go,rs} ๋ฑ ํ๋ก์ ํธ ์ฃผ์ ํ์ฅ์ ๋๋ topology-detector ๊ฒฐ๊ณผ์ ๋ฐ๋ฅธ ๋๋ ํ ๋ฆฌ ๋งคํ์ ์ํํ๋ค. "์์ํ ๊น์?" ๊ฐ์ ์ถ๊ฐ ํ์ธ ๊ธ์ง โ Exit Gate๋ Section 3 ์๋ฃ ํ Orchestrator๊ฐ ์ฒ๋ฆฌ.
๊ธ์ง: ์ด ์ ์ธ๊ณผ Glob ํธ์ถ ์ ์ template, ์๋ฃ ๋ฉ์์ง, 6๊ฐ ์์ญ bullet list๋ฅผ ์ฌ์ฉ์์๊ฒ ์ถ๋ ฅํ์ง ๋ง๋ผ.
Health Engine Preflight (๋ถ๋ชจ ์ธ์
์์ )
First Action์ ๋๋ ํ ๋ฆฌ ๋งคํ ์งํ, Agent ์์ ์ ์ ๋ถ๋ชจ ์ธ์
์ด Health Engine ์ง๋จ์ ์ํํ๋ค. ์ด ๋จ๊ณ๋ ์กฐ์ฉํ ์คํํ๊ณ , ๊ฒฐ๊ณผ๋ง research context์ state์ ๋ฐ์ํ๋ค.
- Topology ๊ฐ์ง:
node ${CLAUDE_PLUGIN_ROOT}/templates/topology-detector.js "$WORK_DIR" ๋๋ ๋๋ฑํ Node module ํธ์ถ๋ก topology๋ฅผ ๊ฐ์งํ๋ค.
- ๊ฐ์ง ๊ฒฐ๊ณผ๋ฅผ state frontmatter/body์
topology ํ๋์ ๊ธฐ๋กํ๋ค.
- Fitness rules ์ค๋น:
$WORK_DIR/.deep-review/fitness.json ์กด์ฌ ์ฌ๋ถ๋ฅผ ํ์ธํ๋ค.
- ์์ผ๋ฉด
health/fitness/fitness-generator.js์ generateFitnessRules($WORK_DIR)๋ก rules ํ๋ณด๋ฅผ ์์ฑํ๊ณ , ์๋ ์ ์ฉํ์ง ๋ง๊ณ research context์ "fitness.json proposal available" ๋๋ ๋ช
์์ skip ์ฌ์ ๋ฅผ ๊ธฐ๋กํ๋ค.
- ์์ผ๋ฉด ๊ทธ๋๋ก ์ฌ์ฉํ๋ค. CLI ๊ฒฝ๋ก์์๋
health/health-check.js --fitness "$WORK_DIR/.deep-review/fitness.json"์ ์ฌ์ฉํ ์ ์๋ค.
- Health Check ์คํ:
node ${CLAUDE_PLUGIN_ROOT}/health/health-check.js "$WORK_DIR" --skip-audit ๋๋ runHealthCheck($WORK_DIR, { fitnessPath }) ๋๋ฑ ํธ์ถ์ ์คํํ๋ค.
- ๊ฒฐ๊ณผ ์ ์ฒด๋ฅผ state์
health_report์ ๊ธฐ๋กํ๋ค.
- Phase 4 baseline ๊ธฐ๋ก:
fitness_baseline: health_report.fitness.required_missing, health_report.fitness.failed, health_report.fitness.violations์ Phase 1 snapshot.
unresolved_required_issues: health_report.fitness.required_missing ๋ฐ health_report.drift.dependency_vuln.critical/high์์ required gate๋ก ๋จ์ ํญ๋ชฉ ๋ชฉ๋ก ๋๋ count.
- Research context ์ฝ์
:
- Agent prompt์ context์
topology, health_report ์์ฝ, fitness_baseline, unresolved_required_issues๋ฅผ ํฌํจํ๋ค.
- Health Check ์คํ ์คํจ ์ ์คํจ ๋ฉ์์ง์ skip ์ฌ์ ๋ฅผ state์ ๋จ๊ธฐ๊ณ Research ์์ฒด๋ ๊ณ์ ์งํํ๋ค.
๋ชจ๋ ๋ถ๊ธฐ โ delegation ๊ธฐ๋ฐ (v6.4.0)
Research ๋จ๊ณ๋ ํญ์ subagent์ ์์ํ๋ค. ๋ฉ์ธ ์ธ์
์ ์ค์ผ์คํธ๋ ์ดํฐ ์ญํ ๋ง ์ํ.
project_type ํ์ธ:
zero-base โ deep-work:research-zerobase-worker
- ๊ทธ ์ธ โ
deep-work:research-codebase-worker
team_mode ํ์ธ:
solo โ ๋จ์ผ Agent() ํธ์ถ (area=full)
team โ 3๊ฐ Agent() ๋ณ๋ ฌ ํธ์ถ (area๋ project_type๋ณ๋ก ๋ค๋ฆ)
- ๋จผ์ Read(
../shared/references/model-routing-guide.md#model-routing-state-decode-v612)์
scalar-first ๊ท์น์ผ๋ก decodedRouting/decodedRoutingMeta๋ฅผ ๋ง๋ ๋ค. ๋ชจ๋ Agent ํธ์ถ์
model=decodedRouting.research call-site override๋ฅผ ์ ์ฉํ๋ค (spec ยง5.8).
Solo path (team_mode=solo)
Agent(
subagent_type="deep-work:research-{codebase|zerobase}-worker",
model=decodedRouting.research, // decode ์คํจ ์ default "sonnet"
prompt="area=full; work_dir=<$WORK_DIR>; task=<task_description>;" +
"re_run_area=<--scope value or null>;" +
"incremental_since=<--incremental value or null>"
)
Agent๊ฐ $WORK_DIR/research.md๋ฅผ ์ง์ ์์ฑํ๋ค. ๋ถ๋ชจ๋ refinement protocol์ ์ํํ์ง ์๋๋ค (spec ยง6.2).
Team path (team_mode=team)
3๊ฐ ์์ญ ์ ์ (project_type๋ณ):
- codebase:
architecture, patterns, risks
- zero-base:
tech-stack, conventions, data-model
๋จ์ผ ๋ฉ์์ง์ 3๊ฐ Agent ํธ์ถ์ parallelํ๊ฒ ์คํ. ๊ฐ ํธ์ถ์ Solo path์ ๋์ผํ prompt ๊ณ์ฝ์ ์ ์ง (area๋ง ๋ค๋ฆ). work_dir/task/re_run_area/incremental_since ๋ชจ๋ ์ ๋ฌ ํ์ โ ์๋ต ์ worker๊ฐ output path ๊ฒฐ์ ๋ถ๊ฐ (CA2 fix):
Agent(
subagent_type="deep-work:research-{codebase|zerobase}-worker",
model=decodedRouting.research,
prompt="area=architecture; work_dir=<$WORK_DIR>; task=<task_description>;" +
"re_run_area=<--scope value or null>;" +
"incremental_since=<--incremental value or null>"
)
Agent(
subagent_type="deep-work:research-{codebase|zerobase}-worker",
model=decodedRouting.research,
prompt="area=patterns; work_dir=<$WORK_DIR>; task=<task_description>;" +
"re_run_area=<--scope or null>; incremental_since=<--incremental or null>"
)
Agent(
subagent_type="deep-work:research-{codebase|zerobase}-worker",
model=decodedRouting.research,
prompt="area=risks; work_dir=<$WORK_DIR>; task=<task_description>;" +
"re_run_area=<--scope or null>; incremental_since=<--incremental or null>"
)
(zero-base ๊ฒฝ์ฐ area ๊ฐ์ tech-stack / conventions / data-model. subagent_type์ research-zerobase-worker.)
๊ฐ Agent๊ฐ $WORK_DIR/research-{area}.md ๋ถ๋ถ ํ์ผ์ ์์ฑ. ์๋ฃ ํ ๋ถ๋ชจ๊ฐ 3๊ฐ ํ์ผ์ Read โ Document Refinement Protocol (Apply / Deduplicate / Prune) โ $WORK_DIR/research.md ๋ก merge.
Parallel partial timeout (spec ยง7.1 W4)
3๊ฐ ์ค ์ผ๋ถ๋ง ์ฑ๊ณตํ๊ณ ์ผ๋ถ timeout/fail ์:
- AskUserQuestion: (a) ์คํจํ area๋ง ์ฌ์์ / (b) ์ ์ฒด ์ฌ์์ / (c) ์๋ ์์ / (d) abort
- ์ฑ๊ณตํ ๋ถ๋ถ ํ์ผ์ ๋ณด์กด (์ฌ์์ ์ agent๊ฐ overwrite)
TeamCreate / env var ๊ฒฝ๋ก ์ ๊ฑฐ
v6.3.x์ CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS precheck๊ณผ TeamCreate+TaskCreate+3 Agent ๋ถ๊ธฐ๋ ์ ๊ฑฐ. Agent tool์ parallel ํธ์ถ๋ก 3-way ๋ณ๋ ฌ์ ๋ฌ์ฑ.
Section 3: ์๋ฃ
์คํ ์์ ์์ ์ฅ์น: ์ด ์น์
์ Section 2์ Solo/Team/Zero-base mode ์ ์ฒด ์คํ๊ณผ research.md ์์ฑ์ ์ค์ ๋ก ์ํํ ๋ค์๋ง ์คํํ๋ค. Section 2๋ฅผ ๊ฑด๋๋ฐ๊ณ ์๋ฃ ๋ฉ์์ง๋ง ์ถ๋ ฅํ๋ ๊ฒ์ ์คํจ ๋ชจ๋์ด๋ค.
Document Refinement Protocol
์ฐ๊ตฌ ์
๋ฐ์ดํธ ์ ํญ์ ์ ์ฉ:
- Apply โ ์ ๋ถ์ ์ฝ์
- Deduplicate โ ์ค๋ณต ์ ๊ฑฐ
- Prune โ ๋ฌดํจํ๋ ๋ด์ฉ ์ ๊ฑฐ
- Refinement log ์ถ๊ฐ:
<!-- v[N]: [summary] โ deduped: N, pruned: M -->
Research Quality Checklist (์์ฒด ๊ฒ์ฆ)
Phase Review Gate
Read("../shared/references/phase-review-gate.md") โ ํ๋กํ ์ฝ ์คํ:
- Phase: research
- Document:
$WORK_DIR/research.md
- Self-review checklist โ project_type์ ๋ฐ๋ผ ๋ถ๊ธฐ (W-4.1 fix):
- ๊ธฐ์กด codebase (
project_type != zero-base): ์ํคํ
์ฒ ๋ถ์ ์์ฑ๋, ํจํด ์๋ณ, ๋ฆฌ์คํฌ ๋๋ฝ
- ์ ๊ท ํ๋ก์ ํธ (
project_type == zero-base): tech-stack ์ ์ ๊ทผ๊ฑฐ (๋์ ๋น๊ต + URL ์ถ์ฒ), conventions ์๊ฒฐ์ฑ, data-model ์ ์ ์ฑ
State ์
๋ฐ์ดํธ
research_complete: true
research_completed_at: ISO timestamp
last_research_commit: git rev-parse HEAD
review_state: completed
phase_review.research + review_results.research ์
๋ฐ์ดํธ
cross_project_memory: {brief_path, brief_mtime, brief_stale, cited_memory_ids[]} โ Cross-Plugin Context์ Deep-Memory Brief Context ์ฒ๋ฆฌ ๊ฒฐ๊ณผ (๋ถ์ฌ ์ {null, null, false, []})
Authoritative risk + adaptive ์ฌ๋ผ์ฐํ
(v6.12.0)
research.md ์์ฑ ์งํ Orchestrator ๋ณต๊ท ์ ์ ์ํํ๋ค. ๋ผ์ฐํ
carrier ์ถ์ถ์ CLI์
๊ฒฐ์ ๋ก extractRoutingState์ ์์ํ๊ณ , ์ด ์ ์ T9์ ์ ์ผํ state writer๋ก์ CLI
์ถ๋ ฅ์ ๋ณํฉํ๋ค. ์คํจ๋ ๊ฒฝ๊ณ ์ ๊ตฌ์กฐํ error๋ฅผ ๊ธฐ๋กํ๊ณ fail-openํ๋ค.
- research.md์์
changed_paths, keywords, side_effects, evidence_refs๋ฅผ ํฌํจํ
evidence JSON๊ณผ task_text, ๊ธฐ์กด provisional์ ๊ฐ๋ฆฌํค๋ prior_profile์ $RISK_IN์
์์ฑํ๋ค. routing/tiers/pinned๋ ์
๋ ฅ์ ๋ณต์ ํ์ง ์๋๋ค.
- canonical state ๊ฒฝ๋ก๋ฅผ CLI์ ์ ๋ฌํ๋ค:
PROJECT_ROOT="$(git -C "$WORK_DIR" rev-parse --show-toplevel 2>/dev/null || pwd)"
RISK_IN=$(mktemp)
RISK_OUT=$(node "${CLAUDE_PLUGIN_ROOT}/scripts/risk-profile-cli.js" \
--stage authoritative --root "$PROJECT_ROOT" --work-dir "$WORK_DIR" \
--input-file "$RISK_IN" --state-file "$STATE_FILE")
rm -f "$RISK_IN"
- ์ฑ๊ณตํ authoritative class๋ก ์ฌ๋ผ์ฐํ
ํ๋ค. ์ด๊ธฐ spawn์์ ์ด๋ฏธ
Read(
../shared/references/model-routing-guide.md#model-routing-state-decode-v612)๋ฅผ
์ํํ์ผ๋ฏ๋ก pin์ decodedRoutingMeta.pinned, runtime์ CLI ์๋ ๊ฐ์ง๋ฅผ ์ฌ์ฉํ๋ค.
methodology_policy_json.floors_effective๋ ์ง์ floor ์ ๋ณธ์ด๋ฉฐ JSON ํ ์ค ๊ทธ๋๋ก ๋๊ธด๋ค.
AUTH_CLASS=$(printf '%s' "$RISK_OUT" | node -e \
'const r=JSON.parse(require("fs").readFileSync(0,"utf8"));process.stdout.write(r.risk_profile?.class||"")')
FLOOR_BASELINE="<methodology_policy_json.floors_effective JSON>"
MR_OUT=$(node "${CLAUDE_PLUGIN_ROOT}/scripts/model-routing-cli.js" \
--root "$PROJECT_ROOT" --task "$TASK_TEXT" --difficulty "${REC_TASK_DIFFICULTY:-}" \
--pinned "<decodedRoutingMeta.pinned as phase=value CSV>" \
--risk-class "$AUTH_CLASS" --policy-mode "<methodology_policy_json.mode ๋๋ adaptive>" \
--floor-baseline "$FLOOR_BASELINE")
- state๋ฅผ ํ ๋ฒ์ atomic RMW๋ก ๊ฐฑ์ ํ๋ค.
risk_profile_json.authoritative์ profile/input_ref/evidence_refs๋ฅผ ๊ธฐ๋กํ๊ณ transition์
history์ appendํ๋ค. RISK_OUT.errors์ ๋ชจ๋ ํญ๋ชฉ์ ์ฑ๊ณต ์ฌ๋ถ์ ๋ฌด๊ดํ๊ฒ
risk_profile_json.errors์ {stage,code,message,at}๋ก ์์ํ๋ค. profile์ด null์ด๋ฉด
RISK_OUT.error๋ ๊ฐ์ ๋ฐฐ์ด์ ๊ธฐ๋กํ๋ค.
policy_shadow_json.authoritative์ RISK_OUT.policy_snapshot์ ๋ณํฉํ๋ provisional์
๋ณด์กดํ๋ค.
- ์ฌ๋ผ์ฐํ
์ฑ๊ณต ์
model_routing_json๊ณผ model_routing_meta_json์ ๊ฐ๊ฐ MR_OUT์
routing/meta JSON-string์ผ๋ก ๊ต์ฒดํ๊ณ , methodology_policy_json์ ์
floors_applied, floors_effective, floor_overridden_by_pin, efforts, class/profile,
mode, based_on:"authoritative", decided_at์ผ๋ก ๊ฐฑ์ ํ๋ค.
- high/critical์ด๊ณ
floor_overridden_by_pin์ด true์ธ phase๋ง๋ค
โ ๏ธ ์ฌ์ฉ์ pin์ด <phase> policy floor๋ณด๋ค ๋ฎ์ต๋๋ค๋ฅผ 1ํ ํ์ํ๋ค.
- ์์ฝ 1์ค:
Risk: <provisional class> โ <authoritative class> (policy: <profile>).
NOTE: current_phase๋ฅผ ๋ณ๊ฒฝํ์ง ์๋๋ค. Orchestrator๊ฐ ๋ฆฌ๋ทฐ+์น์ธ ํ ๋ณ๊ฒฝ.
์๋ฃ ๋ฉ์์ง
Research ๋จ๊ณ๊ฐ ์๋ฃ๋์์ต๋๋ค!
์ฐ๊ตฌ ๊ฒฐ๊ณผ: $WORK_DIR/research.md
๋ถ์ ์์ฝ: [3-5์ค]
Team ๋ชจ๋ ์ ๋ถ๋ถ ๊ฒฐ๊ณผ ํ์ผ๋ ํ์.