agentleFS
shinprshinpr/codex-workflows/.agents/skills/recipe-update-doc/SKILL.md

recipe-update-doc

Skill39 starsChanged 11 days agoMITView on GitHub

Update existing design documents (Design Doc / PRD / ADR) with review and consistency verification.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before loading required skills, use wc -c to size the files and set both exec_command.max_output_tokens and the outer // @exec: …

    line 8
  2. Very specific:

    Invocation rule: Start each named agent with spawn_agent and fork_turns="none".

    line 14
  3. Distinctive:

    Ask for missing change intent only when it cannot be recovered from the request and target document

    line 28
  4. Distinctive:

    Document update with appropriate agent (update mode)

    line 52
  5. Distinctive:

    Document review with document-reviewer

    line 53
  6. Very specific:

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

    line 64
  7. Distinctive:

    Read the document and determine its layer from content signals:

    line 86
  8. Distinctive:

    No conflicts -> Finalize the update below

    line 135

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:
    • Identify target -> Clarify changes -> Update document -> Review -> Consistency check
    • Ask for missing change intent only when it cannot be recovered from the request and target document
  3. 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:

  • Existing document identification and selection
  • Change content clarification with user
  • Document update with appropriate agent (update mode)
  • Document review with document-reviewer
  • Consistency verification with design-sync (Design Doc only)

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:

SituationAction
$ARGUMENTS specifies a pathUse specified document
$ARGUMENTS describes a topicSearch documents matching the topic
Multiple candidates foundPresent options to user
No documents foundReport 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 PatternTypeUpdate AgentNotes
docs/design/*.mdDesign Doctechnical-designer or technical-designer-frontendSee layer detection below
docs/prd/*.mdPRDprd-creator-
docs/adr/*.mdADRtechnical-designer or technical-designer-frontendSee layer detection below

Layer detection (for Design Doc and ADR): Read the document and determine its layer from content signals:

  • Frontend (-> technical-designer-frontend): Document title/scope mentions React, components, UI, frontend; or file contains component hierarchy, state management, UI interactions
  • Backend (-> technical-designer): All other cases (API, data layer, business logic, infrastructure)

ADR Update Guidance:

  • Minor changes (clarification, typo fix, small scope adjustment): Update the existing ADR file
  • Major changes (decision reversal, significant scope change): Create a new ADR that supersedes the original

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:

  • pass -> proceed to Step 6
  • needs_revision -> Apply Review Resolution with the update agent, then review the updated document
  • rejected -> Apply Orchestrator Escalation Resolution. Continue after self-resolution; ask the user only when that procedure reaches a user-decision condition

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:

  • No conflicts -> Finalize the update below
  • Conflicts detected -> Apply Orchestrator Escalation Resolution using both governing documents. Return affected sources to their responsible authors, including previously passed technical decisions; ask the user only when required outcomes, explicit constraints, or execution authority must change

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

ErrorAction
Target document not foundReport that the requested update target does not exist and end
Sub-agent update fails or returns an unusable resultApply Orchestrator Escalation Resolution
Review Resolution requires a user-owned decisionApply Orchestrator Escalation Resolution
design-sync detects conflictsApply Orchestrator Escalation Resolution against the governing sources

Completion Criteria

  • Identified target document
  • Resolved change content from the request and target document, asking only when material intent was missing
  • Built the current requirement_context from the target document and the requested changes
  • Updated document via appropriate agent (update mode)
  • Applied Review Resolution to code-verifier discrepancies before document-reviewer for Design Doc updates
  • Invoked document-reviewer and addressed feedback
  • Invoked design-sync for consistency verification (Design Doc only)
  • Finalized the update under Step 6

Output Example

Document update completed.

  • Updated document: docs/design/[document-name].md
  • Continuation: [returned to calling workflow / user confirmation received]

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.