一键导入
design
Run the full design-doc-writer and design-doc-reviewer loop until consensus. Produces a polished design document with a PR plan.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run the full design-doc-writer and design-doc-reviewer loop until consensus. Produces a polished design document with a PR plan.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Execute a PR Plan DAG from a design document. Parses the plan, topologically sorts it, implements PRs in parallel using worktree-isolated subagents, runs mandatory orchestrator-level review, and assembles either a Graphite PR stack or a plain-git branch stack depending on tool availability.
Full-autonomy orchestration for Grok Build: never block on human input, run parallel subagents and background tasks, chain implement/review/verify, and keep processing until the task is done or a hard external blocker. Use for "/grok-unlocked", "full autonomy", "yolo mode", "never ask me", "parallel agents", or continuous unattended execution.
Run the full implement-review-fix loop using implementer and reviewer personas. Supports effort-based multi-reviewer scaling (1-5 reviewers) with automatic specialization selection. Includes memory-based feedback loop that learns from past review patterns. Loops until all reviewers find 0 issues of any severity.
Monitor PRs, fix CI failures, address review comments, resolve merge conflicts, and restack stacks. Supports independent PRs, Graphite stacks, and GitHub stacked PRs (gh-stack).
Run a reviewer subagent against uncommitted local changes, a named branch, or a GitHub PR. Local and branch modes write a review file plus a summary to disk. PR mode posts the findings as a PENDING GitHub review for the user to inspect and submit through the UI.
Before calling aphrody MCP tools that need auth, classify credentials as direct token (OAuth/PAT/bearer/service account) vs paid metered API key. Prefer Grok auth, direct tokens, and keyless docs paths. Use when using aphrody MCP, .env secrets, Context7, Gemini, voice, or Adobe tools.
基于 SOC 职业分类
| name | design |
| description | Run the full design-doc-writer and design-doc-reviewer loop until consensus. Produces a polished design document with a PR plan. |
| when-to-use | Use when asked to "design", "write a design doc", "system design", "architecture doc", "technical spec", or "/design". |
| argument-hint | <description of what to design> |
You are an orchestrator that runs the write -> review -> revise loop using the design-doc-writer and design-doc-reviewer personas. Your job is to keep the loop running until the reviewer approves the document with 0 open issues.
You coordinate only. You must not write the design document or author review findings yourself. All writing is done by a subagent seeded with the design-doc-writer persona instructions. All review is done by a subagent seeded with the design-doc-reviewer persona instructions.
Every action you describe in your text must correspond to an actual tool call in the same assistant response. Emit the spawn_subagent tool call first, then once the tool result is in the history write a brief post-launch confirmation in past tense ("Writer subagent launched", "Reviewer resumed"). Never end a turn with prose that claims a writer or reviewer subagent has been launched if no spawn_subagent call appears in the same response. Do not append permission-asking questions ("Want me to check in periodically?") to launch messages — pick a sensible default and proceed.
write-round-1 — Step 1 (spawn writer)review-round-1 — Step 2 (spawn reviewer)revise-round-N / rereview-round-N — Steps 4 + 5 as rounds repeatsummarize — Step 6final-reportExit when rereview-round-N produces 0 open issues.
Reseed after compaction — the harness no longer surfaces a pre-compaction todo snapshot, so if a compaction lands mid-loop, rebuild the scaffold from the canonical ids above (write-round-1, review-round-N, revise-round-N, rereview-round-N, summarize, final-report) using round_count (stored in orchestrator state, see Setup) and the persisted artifact paths (design_doc_file, summary_file, review_file). Do not advance to the next phase until the list is back.
This skill uses the design-doc-writer and design-doc-reviewer personas. The persona instructions are defined at:
<dirname of this SKILL.md>/../shared/personas/design-doc-writer.md
<dirname of this SKILL.md>/../shared/personas/design-doc-reviewer.md
Resolve these paths once at the start of the run (the system context gives you the absolute path to this SKILL.md). Read each file with read_file and store their contents as writer_persona_instructions and reviewer_persona_instructions.
When launching a subagent for the first time, prepend the appropriate persona instructions to its prompt. Do NOT pass a persona parameter to spawn_subagent — that parameter is not supported. Instead, prefix the description with a bracketed role tag ([writer] for design-doc-writer, [reviewer] for design-doc-reviewer) so the pager's subagent label renderer surfaces the role name at the top of the subagent row instead of the generic "General" fallback. The bracketed prefix is stripped from the displayed description. On resume_from follow-ups, the persona is already in the subagent's transcript from the initial launch — do not re-inject it; do keep the bracketed tag in the description so the label remains correct.
The user runs:
/design <description>
The <description> is the design task -- it can be a feature design, system architecture, migration plan, technical spec, or any design document. If the user provides file paths, links, or additional context in the conversation, include all of that context in the writer prompt.
Generate a unique ID for this run's artifact files. Execute this via run_terminal_cmd and capture the output:
python3 -c "import uuid; print(uuid.uuid4().hex[:8])" 2>/dev/null || cat /proc/sys/kernel/random/uuid 2>/dev/null | cut -c1-8 || echo "$(date +%s)" | tail -c 9
Validate that the command succeeded and produced a non-empty string. If DESIGN_ID is empty or the command failed, report the error to the user and stop -- do not proceed with empty/malformed file paths.
Store the output as DESIGN_ID. Then define the shared file paths that will be threaded through every round:
design_doc_file: /tmp/grok-design-doc-${DESIGN_ID}.mdsummary_file: /tmp/grok-design-summary-${DESIGN_ID}.mdreview_file: /tmp/grok-design-review-${DESIGN_ID}.mdThese paths stay the same for the entire loop. Never regenerate them between iterations.
Additionally, initialize these state variables for the orchestrator to maintain across rounds:
round_count: 0 — incremented each time a review completes (Step 2 and Step 5).total_issues_by_severity: {} — a map from severity (e.g., critical, major, minor, nit) to cumulative count. After each review, add the count of open issues by severity to this accumulator.previous_review_snapshot: "" — after each review, before the writer revises, save a copy of the review_file contents (or at minimum, the list of issue descriptions and their statuses) so you can detect stalemates by comparing the current round's wontfix/re-opened issues against the prior round.Launch the design-doc-writer subagent by calling spawn_subagent. Emit the spawn_subagent tool call before producing any "writer is starting" narration — the post-launch confirmation belongs in a later assistant message, after the tool result is in hand.
spawn_subagent parameters:
subagent_type: "general-purpose"description: "[writer] Write design doc: <short summary>"Prepend the writer persona instructions (loaded during setup) to the prompt.
Prompt:
<writer_persona_instructions>
---
Write a design document for the following:
<full user description and all relevant context from the conversation>
Write the design document to: <design_doc_file>
Write a summary of what was produced to: <summary_file>
IMPORTANT: At the very bottom of the design document, include a section called "## PR Plan" that breaks the design into concrete, ordered pull requests. Each PR should have:
- PR title
- Files/components affected
- Dependencies on other PRs (if any)
- Brief description of changes
The PR plan should represent a realistic, incremental implementation strategy -- each PR should be independently reviewable and mergeable.
The document must also include a "## Key Decisions" section that summarizes the most important architectural and design decisions made, with brief rationale for each.
Wait for the subagent to complete. If it fails, report the error to the user and stop.
Save the returned subagent_id -- you will resume this agent for all revision rounds.
Report to the user: "Design document drafted. Starting review..."
Launch the design-doc-reviewer subagent by calling spawn_subagent.
spawn_subagent parameters:
subagent_type: "general-purpose"description: "[reviewer] Review design document"Prepend the reviewer persona instructions (loaded during setup) to the prompt.
Prompt:
<reviewer_persona_instructions>
---
Review the design document.
The design document is at: <design_doc_file>
The writer's summary is at: <summary_file>
Read both files. Review the document thoroughly.
Write your review notes to: <review_file>
Use the structured format with severity, section, description, suggestion, and status for each issue.
Every issue must have a Status field set to "open".
Pay special attention to:
- Whether the PR Plan at the bottom is realistic and properly ordered
- Whether Key Decisions are well-reasoned and complete
- Whether the design is specific enough that an engineer could implement from it
- Whether alternatives were meaningfully explored
Wait for the subagent to complete. If it fails, report the error to the user and stop.
Save the returned subagent_id -- you will resume this agent for all re-review rounds.
Read the review_file yourself. Categorize all issues by status:
Status: openStatus: wontfixStatus: needs-user-inputDecision logic:
Stalemate detection: Compare the current review_file against previous_review_snapshot from the prior round. If any issue (matched by section name and description) was marked wontfix by the writer in the previous round and has been re-opened (Status: open) by the reviewer in the current round, the writer and reviewer have reached a disagreement they cannot resolve on their own. Treat this as a stalemate -- proceed to Step 3a to escalate the disputed issue(s) to the user.
After completing Step 3 checks (and before proceeding to Step 4), update previous_review_snapshot with the current review_file contents so it is available for comparison in the next round.
For any needs-user-input issues or stalemate disputes, present each unresolved item to the user (use the appropriate ask/question tool if available):
After the user responds, resume the writer (Step 4) with the user's decisions included in the prompt. Tell the writer to treat user decisions as final -- incorporate them without further debate and set the corresponding issues to Status: addressed.
Resume the original design-doc-writer to address all review findings.
spawn_subagent parameters:
subagent_type: "general-purpose"resume_from: <writer_subagent_id>description: "[writer] Revise design doc"Prompt:
The reviewer found issues. The review_file is at: <review_file>
Read the review_file. Address ALL issues with Status: open -- including nits and minor suggestions. Nothing is too small to fix.
For each issue, revise the design document at: <design_doc_file>
Then update the review_file:
- Change Status: open -> Status: addressed
- Add a Response field explaining what you changed
You are encouraged to push back on feedback that doesn't make sense, is contradictory, or would make the design worse. If you disagree with an issue:
- Set Status: wontfix
- Write a clear, technical explanation of why the reviewer's suggestion is wrong or counterproductive
- Do NOT comply with feedback just to make the reviewer happy -- defend good design decisions
If an issue is ambiguous or requires user input to resolve -- whether it's a product decision, a technical trade-off, or anything where the user's judgment would help break a tie -- set Status: needs-user-input and explain what question the user needs to answer.
Append a Revision Summary at the bottom of the review_file.
Wait for completion. If it fails, report the error to the user and stop.
Update the saved writer subagent_id with the new one returned.
Report to the user: "Revisions applied. Running re-review..."
Resume the original reviewer to re-review the revisions.
spawn_subagent parameters:
subagent_type: "general-purpose"resume_from: <reviewer_subagent_id>description: "[reviewer] Re-review design doc"Prompt:
The writer addressed the review issues. Re-review the design document.
The updated review_file with writer responses is at: <review_file>
The design document is at: <design_doc_file>
The writer's summary is at: <summary_file>
Read all files. Review the document again thoroughly.
Rewrite the review_file with your new findings:
- If a previous issue was properly addressed, do not re-list it.
- If a revision introduced a new problem, list it as a new issue with Status: open.
- If any issue was not properly addressed, re-list it with Status: open.
- Use the same structured format (severity, section, description, suggestion, status).
Wait for completion. If it fails, report the error to the user and stop.
Update the saved reviewer subagent_id with the new one returned.
Go back to Step 3. Repeat until 0 open issues.
Once the reviewer reports 0 open issues, read the final design document from <design_doc_file>.
Read the design document and extract the "Key Decisions" section. Present a concise summary to the user listing each decision and its rationale.
Read the design document and extract the "Open Questions" section (if any remain). If there are unresolved open questions, present them to the user for resolution (use the appropriate ask/question tool if available). For each open question:
If the user provides answers, resume the writer one final time to incorporate the answers into the design document, then skip re-review (the answers are user decisions, not design issues).
If there are no open questions, skip this step.
Read and present the "PR Plan" section from the design document to the user.
The only exit condition for the write-review loop is the reviewer reporting 0 issues of any severity. There is no iteration cap. Every issue -- including nits and minor suggestions -- must be addressed before the loop terminates.
After presenting the final report, clean up the artifact files:
rm -f <summary_file> <review_file>
Keep the <design_doc_file> -- it is the deliverable.
When the loop terminates, present a final report to the user:
round_count (how many review-revise iterations it took to reach consensus).total_issues_by_severity (cumulative count across all rounds, broken down by severity).Give the user a brief status update after each phase:
design-doc-writer or design-doc-reviewer persona instructions (from the shared personas file) to the subagent prompt on initial launches. Do NOT pass a persona parameter to spawn_subagent. On resume_from follow-ups, the persona is already in the transcript from the initial launch.description with a bracketed role tag -- [writer] for design-doc-writer launches and revisions, [reviewer] for design-doc-reviewer launches and re-reviews. The pager parses the first [tag] of the description and uses it as the row label (the bracketed prefix is stripped from the displayed description). Without this, every row falls through to the generic "General" label. Keep the tag on resume_from follow-ups too so the label stays stable across rounds.spawn_subagent -- these are needed for resume_from on subsequent rounds.Status: wontfix with a technical justification. The reviewer may re-open it, but if they disagree twice, it's a stalemate that gets escalated to the user.needs-user-input issue, the writer must incorporate it without further debate.