Recipe update doc

From shinpr/codex-workflows · View interactive version

Recipe update doc is an AI agent skill from the GitHub repository shinpr/codex-workflows. Update existing design documents (Design Doc / PRD / ADR) with review and consistency verification.

How to use this skill

Skill file

Required Skills [LOAD BEFORE EXECUTION]

Before loading required skills, use wc -c to size the files and set both exec_command.max_output_tokens and the outer // @exec: {"max_output_tokens": N} budget to accommodate their contents, including the combined output of batched reads. Split oversized reads upfront; recover any truncated content before proceeding.

  1. [LOAD IF NOT ACTIVE] documentation-criteria — document creation rules and templates
  2. [LOAD IF NOT ACTIVE] subagents-orchestration-guide — agent coordination and workflow flows
  3. [LOAD IF NOT ACTIVE] llm-friendly-context — document update and review handoffs

Invocation rule: Start each named agent with spawn_agent and fork_turns="none". When invoking the same named agent again within this flow, use followup_task on its existing instance with the inputs specified for the current invocation.

Context: Dedicated to updating existing design documents.

Orchestrator Definition

Core Identity: Coordinate document updates, perform lightweight routing and status changes directly, and invoke document specialists for semantic authoring and review.

Execution Plan: Reuse the active execution plan. When the workflow has multiple dependent actions and no plan exists, create one that tracks them through final verification.

Execution Protocol:

  1. Invoke the named author and reviewer for document judgment; perform artifact selection, routing, explicit-answer application, and status updates directly
  2. Execute update flow:
  1. Scope: Return the reviewed update through Step 6

Execute document-reviewer before completion; Step 6 owns finalization.

Workflow Overview

Target document -> Clarify changes -> update agent
                                      |
                    [Design Doc: code-verifier -> Review Resolution]
                                      |
                              document-reviewer
                                      |
                         [Design Doc: design-sync]
                                      |
                        [Step 6: Finalize update]

Scope Boundaries

Included in this skill:

Responsibility Boundary: This skill completes with the reviewed update finalized under Step 6.

Target document: $ARGUMENTS

Execution Flow

Step 1: Target Document Identification

Check for existing documents in docs/design/, docs/prd/, docs/adr/.

Decision flow:

| Situation | Action |

|-----------|--------|

| $ARGUMENTS specifies a path | Use specified document |

| $ARGUMENTS describes a topic | Search documents matching the topic |

| Multiple candidates found | Present options to user |

| No documents found | Report that the requested update target does not exist and end |

Step 2: Document Type and Layer Determination

Determine type from document path, then determine the layer to select the correct update agent:

| Path Pattern | Type | Update Agent | Notes |

|-------------|------|--------------|-------|

| docs/design/*.md | Design Doc | technical-designer or technical-designer-frontend | See layer detection below |

| docs/prd/*.md | PRD | prd-creator | - |

| docs/adr/*.md | ADR | technical-designer or technical-designer-frontend | See layer detection below |

Layer detection (for Design Doc and ADR):

Read the document and determine its layer from content signals:

ADR Update Guidance:

Step 3: Change Content Clarification

Derive the sections, reason, and expected outcome from the user request and target document. Ask only for a missing item whose plausible interpretations would materially change the updated document.

For PRD or Design Doc updates, apply the requested changes to the target document's current outcome, requirements, and exclusions to form requirement_context; preserve fields the request does not change. Incorporate later user corrections or additions into the same context before the next update or review action. For ADR updates, use requirement_context: N/A — ADR update and carry the accepted decision plus the requested changes as governing context.

Step 4: Document Update

For PRD or Design Doc, invoke [Update Agent from Step 2]: "Operation Mode: update. Existing Document: [path from Step 1]. Changes Required: [the change request and Step 3 answers, as given]. requirement_context: [Step 3 current context]. Update the document to reflect the specified changes. Add change history entry."

For a minor ADR change, invoke the update agent with Operation Mode: update, the existing path, the requested changes, and requirement_context: N/A — ADR update. For a major ADR change, apply documentation-criteria's choice and durability filters. Update or retire an unnecessary choice in the existing record; create a superseding ADR only for a qualifying new decision. Existing execution authority remains valid for outcome-preserving technical reductions.

Step 5: Document Review

Review reception: Unnecessary repairs create lasting work. Before assigning a fix, use Review Resolution to judge no change, removal or narrowing, and reuse first; record why any retained or added mechanism is necessary.

For Design Doc updates, first verify the updated document against code:

Invoke code-verifier agent: "Verify the updated Design Doc against current code. doc_type: design-doc. document_path: [path from Step 1]. Focus especially on literal identifier referential integrity for concrete paths, endpoints, type names, config keys, and other exact identifiers changed in this update."

Apply Review Resolution to every discrepancy. Pass the apply discrepancies to the update agent, rerun code-verifier, and store the resolved summary, declines with reasons, and material limitations as $VERIFICATION_RESOLUTION after the apply set becomes empty.

For Design Doc updates:

Invoke document-reviewer agent: "Review the following updated document. doc_type: DesignDoc. review_context: update. target: [path from Step 1]. requirement_context: [Step 3 current context]. verification_resolution: $VERIFICATION_RESOLUTION. Focus on consistency of the updated sections, governing requirements, and change history."

For PRD updates, invoke document-reviewer with the target and requirement_context from Step 3. For minor ADR updates, use doc_type: ADRBatch, targets: [updated ADR path], and review_context: update; review the requested changes and their dependent consistency while carrying the accepted, unchanged decision content as governing context.

Store output as: $STEP_5_OUTPUT

On review result:

Step 6: Consistency Verification and Finalization

For PRD or ADR, proceed directly to finalization below.

For Design Doc, invoke design-sync agent: "Verify consistency of the updated Design Doc with other design documents. Updated document: [path from Step 1]"

On consistency result:

Finalize the update: Return an outcome-preserving technical correction to its calling workflow under existing authority. For a standalone update or a changed user-owned decision, present the reviewed result and obtain any confirmation still required by the shared Explicit Stop Points. Report whether the update returned to its caller or received that confirmation.

Error Handling

| Error | Action |

|-------|--------|

| Target document not found | Report that the requested update target does not exist and end |

| Sub-agent update fails or returns an unusable result | Apply Orchestrator Escalation Resolution |

| Review Resolution requires a user-owned decision | Apply Orchestrator Escalation Resolution |

| design-sync detects conflicts | Apply Orchestrator Escalation Resolution against the governing sources |

Completion Criteria

Output Example

Document update completed.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.