mcpField
D
document

document

github.com/webriqDevelopment044 installsUpdated 2w ago
Repository

About document

document is a documentation-focused agent skill for recording a task’s implementation, test findings, and pipeline gaps. It guides developers through updating feature docs, user guides, project conventions, and learning records, with separate auto and manual handoffs.

Key features

  1. 01Read task documents and test reports
  2. 02Compare changes against planned files
  3. 03Create or update feature docs and user guides
  4. 04Maintain CLAUDE.md and LEARNINGS.md
  5. 05Record retrospectives and update task status

Use cases

  1. 01Document a completed feature for developers and users
  2. 02Capture changes introduced during simplify or test retries
  3. 03Update project guidance after structural changes
  4. 04Prepare an approved task for the shipping step

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/webriq/webriq-workflow-skills --skill document

After installing, type/documentin Claude Code to confirm it loaded.

Details

From the project README

/document - Documentation Agent

Workflow

/document {ID}
       ↓
1. Resolve task ID → find task document
2. Read task document + test report (pipeline audit)
3. Run git diff — identify pipeline gaps
4. Create/update feature doc (docs/features/{feature}.md)
5. Create/update user guide if user-facing (docs/guides/{feature}.md)
6. Update CLAUDE.md if structural changes detected
7. Write retrospective → update LEARNINGS.md
8. Move task to "Approved" in TASKS.md
       ↓
┌─── Automation Mode? ───┐
│                        │
▼ Manual                 ▼ Auto
Notify user              Output SIGNAL, exit
Ready for /ship

Auto Mode Behavior

When task document has Automation: auto:

≡ SIGNAL
STAGE: document
STATUS: DONE
TASK: {ID}
SUMMARY: Feature doc created
REFERENCE: docs/features/{feature}.md
≡ END

Manual mode: Run /clear then /ship {ID}.


Step 1: Pre-Documentation Checklist — Full Pipeline Audit

Step 1A: Read primary sources
docs/task/{ID}-{task-name}.md        - What was planned + Implementation Notes from /simplify
docs/testing/{ID}-{task-name}.md     - Test results, failures, retry cycles
Step 1B: Get the actual file diff
git diff --name-only main...HEAD

Cross-reference against task doc's ## File Changes. Anything in diff but NOT in the task doc was added by /simplify or a /test retry — these are pipeline gaps to capture.

Step 1C: Classify pipeline gaps
File in diff but not in task docLikely sourceAction
Same file, significantly refactored/simplify quality fixesNote pattern changes in CLAUDE.md if new convention emerged
New helper/utility extracted/simplify single-responsibility fixAdd to CLAUDE.md Important File Locations if reusable
New test fixture or seed file/test setupNote in LEARNINGS.md if it reveals a testing pattern
Additional files changed in retry/test → /implement re-runDocument deviation; check if CLAUDE.md needs updating
Migration file added mid-cycleAny stepAlways add to CLAUDE.md — migrations are critical context

Do NOT do broad codebase exploration. Only open files in the gap list or explicitly needed to verify accuracy.

Step 1D: Read /simplify's Implementation Notes

In the task doc ## Implementation Notes:

  • "What was built" — may differ from original plan
  • "Deviations from plan" — medium or major deviations surface in documentation
  • "Standards check" — fixes may have introduced new patterns worth recording in CLAUDE.md
Step 1E: Check /test retry count

In docs/testing/{ID}-{task-name}.md:

  • 0 retries → note what worked well in LEARNINGS.md
  • 1+ retries → root cause of failure is a lesson; always capture in LEARNINGS.md
  • Multiple retries on same issue → add "Do Not" entry to CLAUDE.md

Step 2: Identify Documentation Needs

Change TypeDocumentation Needed
New featureFeature doc + User guide
EnhancementUpdate existing docs
Bug fixUpdate troubleshooting sections
API changeUpdate API reference
Pipeline gap (simplify/test added files)CLAUDE.md + LEARNINGS.md

Step 3: Documentation Output

Feature doc: docs/features/{FEATURE}.md — technical implementation details for developers. Include overview, user journey, architecture (file structure, schema, API endpoints), key components, technical notes.

User guide: docs/guides/{feature}.md — how to use the feature for end users. Include quick start, step-by-step instructions, tips, FAQ, troubleshooting.


Step 4: CLAUDE.md — Living Project Brain

Read → prune → update (in that order). Never just append.

Bar for an entry: A future agent would make a mistake without it, waste time discovering it, or re-open a decision already made.

Triggers for update after this task:

What happenedWhat to update
New directory createdProject Structure
File moved or renamedImportant File Locations
Database migration ranStack section, schema notes
New package installedStack section
/simplify caught a repeated violationDo Not
Architecture debate resolvedArchitecture Decisions
Convention violated and then fixedKey Conventions
Old pattern replacedRemove old entry, add new

Skip entirely if: pure logic fix, copy change, or styling tweak with no new files, directories, migrations, routes, or packages.

Never skip if: migration added, new directory created, file moved/renamed, new API route, new env variable required, or pattern replaced.

/implement should have already captured these — verify and fill any gaps.


Step 5: Retrospective & LEARNINGS.md

Task retrospective: docs/learnings/{ID}-{task-name}.md

Covers the entire pipeline — plan vs reality, quality gate findings, test failures, decisions made. Include:

  • Plan vs Reality (what was planned, what was committed, deviations, files outside plan)
  • What /simplify caught (patterns flagged and fixed)
  • What /test revealed (failures and root causes)
  • Key lessons (specific and actionable)

LEARNINGS.md (project root): Extract the most reusable insight and append to the relevant section.

Where the lesson came fromLEARNINGS.md section
/simplify caught a coding pattern violationCommon Mistakes to Avoid
/simplify extracted a reusable helperEstablished Coding Patterns
/test failed due to system behavior not in planTech Stack Notes
/test retry revealed an integration gapCommon Mistakes to Avoid
Files in diff not in planTech Stack Notes or Established Coding Patterns
Architecture decision made during pipelineArchitecture & Decisions

Rules for LEARNINGS.md entries:

  • One entry = one actionable lesson
  • Credit the pipeline step that caught it
  • Bold the key phrase, explain in one sentence
  • Never duplicate — check before appending
  • If LEARNINGS.md missing, create with sections: Architecture & Decisions, Established Coding Patterns, Common Mistakes to Avoid, Testing Patterns, Tech Stack Notes

Documentation Checklist

  • git diff --name-only main...HEAD run — full file list captured
  • Pipeline gaps identified and classified
  • /simplify Implementation Notes read — deviations noted
  • /test retry count checked — root cause of failures identified
  • Feature doc created/updated with accurate file paths
  • User guide created/updated (if user-facing)
  • CLAUDE.md read → pruned → updated (or skipped if no structural changes)
  • docs/learnings/{ID}-{task-name}.md written
  • Key lesson(s) appended to LEARNINGS.md
  • No duplicate entries in LEARNINGS.md
  • Task moved to "Approved" in TASKS.md

Update TASKS.md

Move task to "Approved":

IDTaskTask DocFeature DocTest ReportApproved

Handoff to /ship

Manual mode: Output summary of updated files, task moved to "Approved", next step /ship {ID}. Auto mode: Output SIGNAL and exit. The orchestrator handles routing. Do not spawn the next skill.

Comments

Markdown supported