27 KiB
| name | description |
|---|---|
| plan | Analyze the current repository and write a detailed PLAN-{build_lane}-GNN.md for implementation work. Also writes the CODE_REVIEW-{review_lane}-GNN.md stub that the implementing agent will fill in after coding. Use for any feature, refactor, bug fix, or follow-up fix that should enter the plan-code-review loop. A separate implementing agent, or the same agent in an implementation pass, reads the plan file and does the coding. The code-review skill archives both files after review and moves PASS tasks under agent-task/archive/YYYY/MM/. |
Plan
Purpose
Create the planning artifacts for the implementation loop:
plan skill -> PLAN-{build_lane}-GNN.md + CODE_REVIEW-{review_lane}-GNN.md stub
implementation -> code changes + filled CODE_REVIEW-{review_lane}-GNN.md
code-review skill -> verdict + archive, complete.log, and PASS task-directory archive move or new follow-up plan/review files
Workflow Contract
This skill intentionally uses routed active files under an active task directory as the state protocol. Do not change this directory or filename contract unless the paired code-review skill is updated together.
Task path terms:
{task_group}is the top-level work category underagent-task/, using a short snake_case name such asrefactoring.{subtask_dir}is used only for split work and follows the existing indexed directory naming rules below, such as01_coreor02+01_db.{subtask_name}is the short snake_case name after the index or dependency prefix inside{subtask_dir}.{task_name}in headers and templates means the active task path relative toagent-task/: either{task_group}for a single-plan task or{task_group}/{subtask_dir}for a split subtask.- A single-plan task stores active files directly under
agent-task/{task_group}/. - Split work stores active files under
agent-task/{task_group}/{subtask_dir}/; the parentagent-task/{task_group}/is only the grouping folder and must not contain active plan/review files.
Filename rules:
- Plan file:
PLAN-{build_lane}-GNN.md - Review stub:
CODE_REVIEW-{review_lane}-GNN.md {lane}is onlylocalorcloud; never put model names in filenames.GNNis a two-digit capability grade fromG01toG10; the runtime maps lane+grade to current models externally.
Role boundary rules:
- Implementing agents fill implementation-owned
CODE_REVIEW-*-G??.mdsections, keep active files in place, and report ready for review. - Finalization (
코드리뷰 결과, log rename,complete.log, archive moves, review-only checklist) is code-review-skill only.
Split decision policy:
- Default to multiple subtask directories under one task group. Before writing any plan, decide whether the work has smaller independently reviewable implementation units.
- If there is any natural dependency boundary, ownership boundary, subsystem boundary, API-vs-call-site phase, test strategy split, or independently reviewable risk, write multiple subtask directories under one task group.
- A single plan is an exception. Use one only when all of these are true: the work is one coherent implementation unit, it has one primary ownership boundary, it has no prerequisite subtask, splitting would create artificial coordination overhead, and the whole change remains easy to review at once.
- When uncertain, split. Do not choose a single plan merely because it is shorter to write.
- Record the split decision in the plan. For a single plan, explicitly state why each applicable split boundary does not require a separate task. For multi-plan output, list the shared
{task_group}, each sibling{subtask_dir}, and its dependency relationship.
Split gates:
- Split when the work combines shared API/foundation changes with broad call-site rollout. Put the API/foundation in an earlier task and the rollout in dependent task(s).
- Split when the work touches multiple domains or ownership boundaries, unless the change is purely mechanical and trivially reviewable.
- Split when different parts can be verified with different focused tests or have different risk profiles.
- Split when a likely failure in one part would force rewriting unrelated parts of the plan.
- Split when one part can produce a useful
complete.logbefore another part starts.
Task directory naming rules:
- A single-plan task uses
agent-task/{task_group}/with a short snake_case category name, e.g.agent-task/refactoring/. - When split gates require decomposition, create one shared category folder and multiple subtask directories under it. Each subtask directory owns exactly one normal active plan file and one normal active review stub.
- Multi-plan output is a set of independent
PLAN-{build_lane}-GNN.md+CODE_REVIEW-{review_lane}-GNN.mdpairs acrossagent-task/{task_group}/{subtask_dir}/folders, not multiple plan files inside one folder. - Multi-plan subtask directory names must start with a stable two-digit task index. The index must increase across sibling subtask directories for sorting, but it is not a serial execution dependency.
- Use
NN_{subtask_name}for a task with no runtime dependencies, e.g.01_core,04_docs,05_ui. - Use
NN+PP[,QQ...]_{subtask_name}for a task that depends on earlier task indices, e.g.02+01_db,03+01,02_api,06+05_integration. - Valid independent pattern:
^[0-9]{2}_[a-z0-9_]+$. - Valid dependent pattern:
^[0-9]{2}\+[0-9]{2}(,[0-9]{2})*_[a-z0-9_]+$. NN,PP, andQQare two-digit indices. Every predecessor index after+must be lower thanNNand must refer to a sibling multi-plan subtask directory under the same{task_group}.- The first
_after the index or dependency list starts{subtask_name}.{subtask_name}stays short snake_case and may contain additional underscores. - Runtime scheduling reads only the
{subtask_dir}name:_meansdepends_on=[];+meansdepends_onis the comma-separated index list between+and the first_. - Subtask directory names are the source of truth for runtime dependencies. Do not hide extra dependencies only in the plan body, and do not create a bare
NN+{subtask_name}without predecessor indices. - Example: split a refactoring common core plus two app integrations under
agent-task/refactoring/as01_core,02+01_edge_integration,03+01_node_integration. Both integrations depend only on01_coreand may run in parallel after01_corehascomplete.log. - Example: split three sequential tasks under one task group as
01_schema,02+01_migration,03+02_api. - Example: split independent docs/UI plus an integration under one task group as
01_core,02+01_db,03+02_api,04_docs,05_ui,06+05_integration;01_core,04_docs, and05_uican start together, and06+05_integrationwaits only for05_ui. - Preserve task group and subtask directory names verbatim; do not normalize, reinterpret, or choose execution order by agent judgment.
Routing rules:
- Build defaults to
localwhen the plan is explicit, tests are runnable, and failure is review-detectable. - Use
cloudfor weak tests, broad API/call-site impact, ambiguity, storage/concurrency/protocol/auth risk, or prior local failure. - Use
cloud-G07or higher for terminal-agent work: shell/CLI workflow implementation, bin script orchestration, process control, stdout/stderr parsing, exit-status contracts, long-running command diagnosis, or terminal benchmark-style tasks. Merely running deterministic tests such asgo testdoes not make a task terminal-agent work. - Use
cloud-G07or higher when acceptance depends on a real interactive external tool, TUI, PTY, browser, screen repaint/cursor stream, or bin-level smoke output. This is mandatory when unit tests pass but the real smoke/integration command fails. - Use
cloud-G07or higher when a prior review found verification trust failure, reconstructed command output, or claimed stdout/stderr that does not match a rerun. - Keep high-risk design judgment on
cloudwith a higher grade; the runtime may mapcloud-GNNto frontier-class models. - Review may be
localfor narrow/low-risk checks andcloudfor multi-file/API/test-meaning reviews, security/auth, storage/migration, concurrency, protocol/schema, cross-domain, or repeated Required issues. - Raise
GNNwith scope, ambiguity, missing tests, irreversible behavior, and blast radius; keep grade model-independent.
Directory states:
| State | Meaning |
|---|---|
PLAN-*-G??.md only |
Invalid; plan skill always writes both active files |
PLAN-*-G??.md + CODE_REVIEW-*-G??.md stub |
Implementation is pending/in progress |
PLAN-*-G??.md + filled CODE_REVIEW-*-G??.md |
Ready for code-review skill |
complete.log + *.log files |
Task complete (PASS), before final task-directory archive move |
agent-task/archive/YYYY/MM/{task_name}/complete.log + *.log files |
Archived completed task path (PASS); not active |
Only *.log files (no complete.log) |
Task terminated mid-loop or abandoned |
Step 1 - Determine Task
If the user names the task explicitly, use that task group or task path.
Otherwise, find active plan files with both globs, excluding agent-task/archive/**:
agent-task/*/PLAN-*-G??.mdagent-task/*/*/PLAN-*-G??.md
| Result | Action |
|---|---|
| Exactly one | Continue that task |
| None | Create a new task only for a feature/refactor/fix/follow-up that belongs in this workflow |
| Multiple | If the user/runtime named a task group, task path, or subtask directory that identifies exactly one active plan, use it. Otherwise list paths and ask which task to use; do not choose by agent judgment. |
The routed plan file is the loop entry point. A missing active plan normally means only that no plan has been started for a new task; do not create task files for casual analysis, status, or review requests unless the user explicitly asks for a plan.
로드맵 게이트:
agent-ops/roadmap/current.md가 있으면 구현 계획 파일을 만들기 전에 읽고, 사용자 요청, 브랜치, 변경 경로를 기준으로 관련 Milestone을 선택한다.- 선택한 Milestone을 한 번 읽는다.
구현 잠금섹션이 없거나 상태가잠금이면PLAN-*-G??.md,CODE_REVIEW-*-G??.md를 만들지 않고 file/API/package 수준의 구현 단계도 작성하지 않는다. - "진행", "그냥 구현", "계획 작성" 같은 사용자 지시는 Milestone 잠금을 해제하지 않는다.
구현 잠금이 없거나 잠긴 Milestone을 보고하고, 먼저 roadmap update 흐름으로 Milestone 구체화 업데이트 또는 잠금 해제를 요청하게 한다. - roadmap/current 파일이 없으면 기존 task routing 규칙대로 진행한다.
Use short snake_case task group names, e.g. api_refactor.
Before choosing plan files or task directory names, apply the split decision policy above. When the policy allows a single plan, write active files directly under agent-task/{task_group}/ and record the exception rationale. When the policy requires multiple plans, choose one shared {task_group} and {subtask_dir} names using the task directory naming rules above. Do not put multiple active plan files in one active task directory, and do not mix split subtask directories with active plan/review files directly in the parent task group.
Step 2 - Analyze Before Writing
Complete all items below before creating any files. Work through them in order; do not proceed to the next step until every checkbox is done.
- Read all source files in full — read every source file the change will touch, whole file. No partial reads.
- Read all test files in full — read every test file that exercises the changed behavior.
- Assess test coverage — for each behavior change, explicitly record whether existing tests cover it.
- Assess split boundaries first — identify dependency boundaries, ownership boundaries, API-vs-call-site phases, test strategy splits, risk profile splits, and independently verifiable subwork before selecting plan files. If any split gate applies or the decision is uncertain, write multiple subtask directories under one task group instead of one plan.
- Grep all symbol references — for any renamed or removed symbol, find every call site and import chain.
- Check dependency manifests — before adding any new package, verify its presence in go.mod / package manifest.
- Pre-check compile issues — identify missing interface implementations, type mismatches, and broken imports.
- Verify verification commands — confirm that the final verification commands actually run in this repository layout.
- Stabilize fragile verification — for search or generated-output checks, choose deterministic commands up front, such as
rg --sort path, and decide whether cached test output is acceptable or-count=1is required.
Step 3 - Determine GXX Grade
GXX is an output of analysis, not an input. Determine lane and grade only after Step 2 is fully complete.
- Assess change scope — count affected files, interface impact, and call-site count.
- Check risk factors — mark any that apply: concurrency, storage/migration, protocol/schema, auth, irreversible behavior.
- Evaluate test confidence — judge whether existing tests sufficiently verify the changed behavior.
- Decide lane — use
localif the plan is explicit and tests are sufficient; usecloudif any of the following apply:- Tests are weak or do not cover the changed behavior
- Broad API/call-site impact
- Concurrency, storage, protocol, or auth risk
- Prior local build failure on this task
- Terminal-agent work: shell/CLI workflow implementation, bin script orchestration, process control, stdout/stderr parsing, exit-status contracts, long-running command diagnosis, or terminal benchmark-style tasks
- Real bin/smoke/integration verification failed after unit tests passed
- Interactive TUI/PTY/browser/external CLI automation or screen-rendered output is part of the success condition
- A prior review marked verification trust Fail/Warn because recorded command output did not match a rerun
- Decide GNN — assign a higher grade as scope, ambiguity, irreversibility, and blast radius increase. Grade is complexity-based, not model-name-based.
Step 4 - Archive Existing Active Files
Before writing new active files for the chosen active task directory:
- Count existing
agent-task/{task_name}/plan_*.log; call itN. IfPLAN-*-G??.mdexists in that same directory, renamePLAN-{build_lane}-GNN.mdtoplan_{build_lane}_GNN_N.log. - Count existing
agent-task/{task_name}/code_review_*.log; call itM. IfCODE_REVIEW-*-G??.mdexists in that same directory, renameCODE_REVIEW-{review_lane}-GNN.mdtocode_review_{review_lane}_GNN_M.log.
The new plan number is the count of plan_*.log after archiving.
Step 5 - Write Plan File
Header line must be exactly:
<!-- task={task_name} plan={N} tag={TAG} -->
Required sections:
- Title.
이 파일을 읽는 구현 에이전트에게: warn that filling implementation-ownedCODE_REVIEW-*-G??.mdsections is mandatory. Tell the implementer to run verification, fill actual notes/output, keep active files in place, and report ready for review; finalization is code-review-skill only.배경: 2-4 sentences explaining why the work is needed.분석 결과: record the findings from Step 2 and Step 3. This section is the written output of the analysis — not a summary, but the actual findings that justify the plan's scope and decisions. Must include all of the following subsections:읽은 파일: list every source and test file read during analysis, with path.테스트 커버리지 공백: list each behavior change and whether existing tests cover it; explicitly note gaps.심볼 참조: list renamed/removed symbols and every call site found, or state "none" if no symbols were changed.분할 판단: state that the split decision policy was evaluated before choosing plan files. For a single plan, explain why each relevant split gate does not apply and why single-plan coordination is safer than splitting. For multi-plan output, list the shared task group plus each sibling subtask directory and dependency relationship.범위 결정 근거: state which files or areas were explicitly excluded from this change and why. This is the boundary justification — the implementing agent must not silently expand scope beyond what is recorded here.빌드 등급: state the decided lane and GNN grade with a one-line rationale.
구현 체크리스트: a top-level checklist the implementing agent must follow while coding. Include one item per plan item, one item for all intermediate/final verification, and make the final item exactly:- [ ] CODE_REVIEW-*-G??.md의 구현 에이전트 소유 섹션을 실제 구현 내용과 검증 출력으로 채운다. 이 항목이 완료되기 전에는 구현이 완료된 것이 아니다.Copy this checklist into the review stub's구현 체크리스트section with the same item text and order.- One item per change:
### [TAG-1] Title,TAG-2, etc. 수정 파일 요약: table mapping files to item ids.최종 검증: runnable commands and expected outcome. Commands must be exact and deterministic enough for the reviewer to rerun; use stable ordering for searches and state whether cached test output is acceptable. The final line of this section must read exactly — "모든 코드 변경 완료 후 반드시CODE_REVIEW-*-G??.md의 구현 에이전트 소유 섹션을 채운다. 이 파일 작성이 구현의 마지막 단계다."
Each plan item must include:
문제: concrete problem with file:line references.해결 방법: exact approach and before/after code block for non-trivial changes.수정 파일 및 체크리스트: exhaustive file-level checklist.테스트 작성: explicit write/skip decision. If writing tests, include path, test name, assertion goal, and fixtures. If skipping, justify.중간 검증: runnable commands and expected result.
Include 의존 관계 및 구현 순서 only when order matters.
For split multi-plan work, the {subtask_dir} directory name is the runtime source of truth. If a plan has a NN+PP[,QQ...]_... subtask directory name, 의존 관계 및 구현 순서 must echo the decoded predecessor subtask directories under the same task group that must produce complete.log before implementation starts, and it must not add dependencies that are absent from the directory name.
Quality rules:
- Exact line numbers in every Before snippet.
- Use the language's required override annotation/keyword wherever an abstract method is implemented.
- Include full import statements for new packages.
- List all call sites for renamed/removed symbols.
- Never write "add tests as needed"; decide up front.
- Do not cite files you did not read.
- Be concise. Write the minimum words needed to convey the decision or fact. No preamble, no restatement of context already in the plan, no closing summaries.
Test policy:
| Change | Test requirement |
|---|---|
| Bug fix | Regression test required |
| New public API | Normal + boundary tests required |
| API rename | Existing test call-site updates usually enough |
| Internal refactor | Existing tests may be enough |
| Concurrency logic | Race/ordering test recommended |
Verification fidelity rules:
- Plan verification commands are a contract. The implementing agent must run them exactly as written.
- If a command must be changed, the implementing agent must record the replacement command and reason in
계획 대비 변경 사항, then paste the replacement command's actual stdout/stderr. - Before claiming a tool is unavailable, run and record
command -v <tool>or the project-equivalent check. - Do not download, generate, or leave verification tools inside the repository. Temporary tools belong outside the repo, such as under
/tmp, and must not become task artifacts. - For search commands whose output order may vary, specify deterministic options in the plan, for example
rg --sort path. 검증 결과must contain actual stdout/stderr, not summarized or reconstructed output. If output is too long, record the saved output file path and the exact command used to create it.- If the plan's pass condition says all leftovers must be intentional exceptions, any
변경 필요item forces FAIL until resolved or explicitly reclassified with evidence. - Decide in the plan whether Go test cache output is acceptable. If fresh execution matters, use
go test -count=1 ....
Step 6 - Write Review Stub
Use the template below exactly. Fill {…} placeholders from the plan; everything else is fixed and must not be changed by the implementing agent.
<!-- task={task_name} plan={N} tag={TAG} -->
# Code Review Reference - {TAG}
> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.**
> The task is NOT complete until every implementation-owned section below is filled in.
> Complete the `구현 체크리스트`; the final checklist item is mandatory before saving.
> Fill implementation-owned sections, then stop with active files in place and report ready for review.
> Finalization (`코드리뷰 결과`, log rename, `complete.log`, archive moves, `코드리뷰 전용 체크리스트`) is review-agent-only, even after compaction/resume.
> Follow the ownership table at the bottom of this file for which sections you own.
## 개요
date={YYYY-MM-DD}
task={task_name}, plan={N}, tag={TAG}
## 이 파일을 읽는 리뷰 에이전트에게
> **[REVIEW AGENT ONLY]** 아래 종결 절차는 코드리뷰 에이전트 전용이다. 구현 에이전트는 이 섹션을 실행하지 않는다.
각 항목의 구현을 실제 소스 파일과 대조하고, `검증 결과` 섹션의 출력이 코드와 일치하는지 확인하세요.
리뷰 완료는 아래 순서까지 끝난 상태를 의미합니다.
1. 판정을 append한다.
2. `CODE_REVIEW-{review_lane}-GNN.md` → `code_review_{review_lane}_GNN_N.log`, `PLAN-{build_lane}-GNN.md` → `plan_{build_lane}_GNN_M.log`로 아카이브한다.
3. PASS이면 `complete.log` 작성 후 active task 디렉터리를 `agent-task/archive/YYYY/MM/{task_name}/`로 이동한다. WARN/FAIL이면 다음 active plan/review 파일을 즉시 작성한다.
4. 적용 가능한 `코드리뷰 전용 체크리스트` 항목을 최종 `.log` 위치에서 체크한 뒤 보고한다.
---
## 구현 항목별 완료 여부
| 항목 | 완료 여부 |
|------|---------|
| [{TAG}-1] {item description} | [ ] |
| [{TAG}-2] {item description} | [ ] |
## 구현 체크리스트
{copy the plan's 구현 체크리스트 items exactly, preserving order and checkbox text}
## 코드리뷰 전용 체크리스트
> **[REVIEW AGENT ONLY]** 이 체크리스트는 코드리뷰 에이전트만 사용한다.
> 구현 에이전트는 이 섹션을 수정하거나 체크하지 않는다.
- [ ] `코드리뷰 결과`에 `PASS`, `WARN`, `FAIL` 중 하나의 판정을 append한다.
- [ ] 판정과 `차원별 평가`, Required/Suggested/Nit 분류가 서로 일치한다.
- [ ] active `CODE_REVIEW-*-G??.md`를 `code_review_{review_lane}_GNN_N.log`로 아카이브한다.
- [ ] active `PLAN-*-G??.md`를 `plan_{build_lane}_GNN_M.log`로 아카이브한다.
- [ ] PASS이면 `agent-ops/skills/common/code-review/templates/complete-log-template.md` 기준으로 `complete.log`를 작성하고 active `.md` 파일을 남기지 않는다.
- [ ] PASS이면 active task 디렉터리 `agent-task/{task_name}/`를 `agent-task/archive/YYYY/MM/{task_name}/`로 이동하고 최종 archive 경로에서 이 체크리스트를 갱신한다.
- [ ] PASS split 작업이면 이동 후 빈 active parent `agent-task/{task_group}/`를 제거하거나, 남은 sibling/file이 있어 유지했다고 확인한다.
- [ ] WARN/FAIL이면 다음 active `PLAN-{build_lane}-GNN.md`와 `CODE_REVIEW-{review_lane}-GNN.md`를 작성하고 `complete.log`를 작성하지 않는다.
## 계획 대비 변경 사항
_구현 에이전트가 계획과 다르게 구현한 부분을 이유와 함께 기록한다._
## 주요 설계 결정
_구현 에이전트가 주요 설계 결정 사항을 기록한다._
## 리뷰어를 위한 체크포인트
{pre-filled from plan — one bullet per review focus area}
## 검증 결과
_구현 에이전트가 각 중간 검증 및 최종 검증 명령 실행 후 출력을 여기에 붙여 넣는다._
필수 규칙:
- 검증 명령은 고정된 계약이다. 임의로 대체하지 않는다.
- 대체가 필요하면 `계획 대비 변경 사항`에 이유와 대체 명령을 기록한다.
- `검증 결과`에는 실제 stdout/stderr를 붙여 넣는다.
### {TAG}-1 중간 검증
$ {verification command from plan} (output)
### 최종 검증
$ {final verification command from plan} (output)
---
> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section: completion table, implementation checklist, changes from plan, design decisions, and verification output?**
> If anything is blank, go back and fill it in before saving this file.
> Leave review-agent-only sections unchanged.
Sections and their ownership:
| Section | Owner | Note |
|---|---|---|
| Header comment, 개요, 리뷰 에이전트 지시 | Fixed at stub creation | Implementing agent must not modify or execute these (archive, complete.log, and task-directory archive move are review-agent only) |
| 구현 항목별 완료 여부 (item names) | Fixed at stub creation | Implementing agent checks [ ] → [x] only |
| 구현 체크리스트 (item text/order) | Fixed at stub creation from plan | Implementing agent checks [ ] → [x] only; final checkbox is mandatory before saving |
| 코드리뷰 전용 체크리스트 | Review agent only | Implementing agent must not modify or check this section |
| 계획 대비 변경 사항, 주요 설계 결정 | Implementing agent | Replace placeholder text with actual content |
| 리뷰어를 위한 체크포인트 | Fixed at stub creation | Pre-filled from plan |
| 검증 결과 (section headings + commands) | Fixed at stub creation | Implementing agent fills in command output only; command changes require a 계획 대비 변경 사항 entry |
| 코드리뷰 결과 | Review agent appends | Not included in stub |
Naming
| Tag | Use for |
|---|---|
API |
Public API changes |
REFACTOR |
Internal refactoring |
TEST |
Test additions/fixes |
REVIEW_<TAG> |
Follow-up fixes after review |
Final Checklist
PLAN-{build_lane}-GNN.mdandCODE_REVIEW-{review_lane}-GNN.mdboth exist under the active task directoryagent-task/{task_name}/.- Single-plan work stores active files directly under
agent-task/{task_group}/. - Split work, if any, uses one shared
agent-task/{task_group}/parent and one subtask directory per plan/review pair with names like01_core,02+01_edge_integration,03+01_node_integration; dependency details live in the subtask directory name asNN+PP[,QQ...]_subtask_name. - Both first lines match
<!-- task={task_name} plan={N} tag={TAG} -->. - Previous active files, if any, were archived with correct numeric suffixes.
- Every plan item has problem, solution, checklist, test decision, and intermediate verification.
- The plan and review stub have matching
구현 체크리스트item text/order, and the final checkbox is the mandatoryCODE_REVIEW-*-G??.mdcompletion item. - The review stub has a clearly marked
코드리뷰 전용 체크리스트owned only by the review agent. - Routed review file completion table lists every plan item.