|
| 1 | +--- |
| 2 | +name: doc-quality-guard |
| 3 | +description: > |
| 4 | + Use when the user says "check docs", "audit docs", "doc quality", "doc slop", |
| 5 | + "stale docs", or wants to verify documentation accuracy and tone against the |
| 6 | + actual codebase. |
| 7 | +argument-hint: "[path/to/docs or blank for full scan]" |
| 8 | +allowed-tools: Bash, Read, Glob, Grep, Agent |
| 9 | +--- |
| 10 | + |
| 11 | +# Doc Quality Guard |
| 12 | + |
| 13 | +Audits documentation for **accuracy** (code-doc sync, staleness) and **tone** (AI slop), then generates a fix spec and hands off to `/orchestrate`. |
| 14 | + |
| 15 | +**Announce at start:** "Using doc-quality-guard to audit documentation..." |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## Configuration |
| 20 | + |
| 21 | +| Setting | Default | Description | |
| 22 | +|---------|---------|-------------| |
| 23 | +| **Scope** | `$ARGUMENTS` or `docs/` + `README.md` files | Directory/files to scan | |
| 24 | +| **Spec output** | `dev-docs/superpowers/specs/YYYY-MM-DD-doc-quality-fixes-spec.md` | Where the fix spec is written | |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## Execution Flow |
| 29 | + |
| 30 | +### Step 1: Resolve Scope |
| 31 | + |
| 32 | +Parse `$ARGUMENTS`: |
| 33 | +- If a path is provided, scope scans to that directory/file |
| 34 | +- If empty, scan `docs/` and all `README.md` files in the repo |
| 35 | +- Collect all `.md` files in scope using Glob |
| 36 | + |
| 37 | +### Step 2: Dispatch Parallel Scanners |
| 38 | + |
| 39 | +Launch **up to 4 agents in parallel** using the Agent tool. Only dispatch agents whose scope overlaps with the resolved scan path. Each agent reads every doc file in its section, then cross-references against the corresponding source code. |
| 40 | + |
| 41 | +**Agent Assignment:** |
| 42 | + |
| 43 | +| Agent | Doc Scope | Source Code to Cross-Reference | |
| 44 | +|-------|-----------|-------------------------------| |
| 45 | +| **A: Providers** | `docs/providers/` | `packages/tarash-gateway/src/tarash/tarash_gateway/providers/` | |
| 46 | +| **B: Guides + Getting Started** | `docs/guides/`, `docs/getting-started/` | `packages/tarash-gateway/src/tarash/tarash_gateway/` (public API surface) | |
| 47 | +| **C: API Reference** | `docs/api-reference/` | `packages/tarash-gateway/src/tarash/tarash_gateway/` (all exports, models, exceptions) | |
| 48 | +| **D: READMEs + Top-level** | `README.md`, `docs/index.md`, `packages/*/README.md` | Entire repo (links, feature claims, install instructions) | |
| 49 | + |
| 50 | +**Each agent prompt must include:** |
| 51 | + |
| 52 | +1. The list of doc files to scan (resolved via Glob) |
| 53 | +2. The source code paths to cross-reference |
| 54 | +3. The accuracy checklist (see below) |
| 55 | +4. The AI slop pattern list (see below) |
| 56 | +5. The tone reference instructions (see below) |
| 57 | +6. The required output format (see below) |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +### Accuracy Checklist (include in every agent prompt) |
| 62 | + |
| 63 | +Each agent checks for: |
| 64 | + |
| 65 | +1. **Wrong API signatures** — doc shows method/function names, parameters, or return types that don't match actual source code |
| 66 | +2. **Removed features** — doc references providers, models, functions, or config options that no longer exist |
| 67 | +3. **Stale examples** — code examples use import paths, class names, or parameter names that have changed |
| 68 | +4. **Wrong parameter tables** — documented parameters don't match actual model fields |
| 69 | +5. **Dead links** — relative links to other doc pages or source files that don't resolve |
| 70 | +6. **Outdated install instructions** — pip extras, package names, or dependency requirements that changed |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +### AI Slop Patterns (include in every agent prompt) |
| 75 | + |
| 76 | +Flag these 8 patterns: |
| 77 | + |
| 78 | +| Pattern | Examples | |
| 79 | +|---------|---------| |
| 80 | +| AI vocabulary | "Additionally", "leverage", "delve", "landscape", "seamlessly" | |
| 81 | +| Promotional language | "breathtaking", "vibrant", "cutting-edge", "powerful" | |
| 82 | +| Filler phrases | "In order to", "It's worth noting that", "Due to the fact that" | |
| 83 | +| Chatbot tone | "Great question!", "I hope this helps!", "Let me know if..." | |
| 84 | +| Excessive hedging | "It should be noted that", "It's important to understand" | |
| 85 | +| Em dash overuse | Multiple `—` per paragraph | |
| 86 | +| Generic conclusions | "By following these steps, you'll be well on your way to..." | |
| 87 | +| Copula avoidance | "serves as" instead of "is", "functions as" instead of "does" | |
| 88 | + |
| 89 | +--- |
| 90 | + |
| 91 | +### Tone Reference (include in every agent prompt) |
| 92 | + |
| 93 | +The existing docs use a direct, factual, code-heavy style: |
| 94 | +- Short sentences, no adjectives |
| 95 | +- Tables for parameters |
| 96 | +- Examples over explanations |
| 97 | +- No filler, no fluff |
| 98 | + |
| 99 | +Reference files for tone: `docs/getting-started/quickstart.md` and `docs/providers/openai.md`. Flag anything that deviates from this established voice. |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +### Agent Output Format |
| 104 | + |
| 105 | +Each agent returns findings as structured text: |
| 106 | + |
| 107 | +``` |
| 108 | +file: docs/providers/fal.md |
| 109 | +issues: |
| 110 | + - type: accuracy |
| 111 | + severity: critical |
| 112 | + line: 42 |
| 113 | + description: "References `generate_video_async` but method is now `agenerate_video`" |
| 114 | + suggested_fix: "Replace method name with `agenerate_video`" |
| 115 | + - type: slop |
| 116 | + severity: medium |
| 117 | + line: 15 |
| 118 | + description: "AI vocabulary: 'Additionally' + 'seamlessly'" |
| 119 | + suggested_fix: "Rewrite to match direct tone of other provider docs" |
| 120 | +``` |
| 121 | + |
| 122 | +If an agent finds no issues in its section, it returns: `No issues found.` |
| 123 | + |
| 124 | +--- |
| 125 | + |
| 126 | +### Step 3: Aggregate & Classify |
| 127 | + |
| 128 | +Merge all agent results into a single list. Classify by severity: |
| 129 | + |
| 130 | +| Severity | What qualifies | |
| 131 | +|----------|---------------| |
| 132 | +| **Critical** | Wrong API signatures, references to removed features/providers, broken code examples | |
| 133 | +| **High** | Stale parameters, dead internal links, outdated install instructions | |
| 134 | +| **Medium** | AI slop patterns, tone deviations | |
| 135 | +| **Low** | Minor style inconsistencies | |
| 136 | + |
| 137 | +**Deduplication:** Same file + same line = keep highest severity. |
| 138 | + |
| 139 | +**If zero issues found:** Print "Docs are clean — no accuracy or tone issues detected." and **stop**. No spec, no orchestrate. |
| 140 | + |
| 141 | +### Step 4: Print Report to Terminal |
| 142 | + |
| 143 | +``` |
| 144 | +## Doc Quality Report — {scope} |
| 145 | +**Scanned:** {file_count} files | **Date:** {YYYY-MM-DD} |
| 146 | +**Findings:** {critical} critical, {high} high, {medium} medium, {low} low |
| 147 | +
|
| 148 | +### Critical ({count}) |
| 149 | +| File | Line | Issue | Suggested Fix | |
| 150 | +|------|------|-------|---------------| |
| 151 | +| ... | ... | ... | ... | |
| 152 | +
|
| 153 | +### High ({count}) |
| 154 | +| File | Line | Issue | Suggested Fix | |
| 155 | +|------|------|-------|---------------| |
| 156 | +| ... | ... | ... | ... | |
| 157 | +
|
| 158 | +### Medium ({count}) |
| 159 | +| File | Line | Issue | Suggested Fix | |
| 160 | +|------|------|-------|---------------| |
| 161 | +| ... | ... | ... | ... | |
| 162 | +
|
| 163 | +### Low ({count}) |
| 164 | +| File | Line | Issue | Suggested Fix | |
| 165 | +|------|------|-------|---------------| |
| 166 | +| ... | ... | ... | ... | |
| 167 | +``` |
| 168 | + |
| 169 | +### Step 5: Generate Fix Spec |
| 170 | + |
| 171 | +Write to `dev-docs/superpowers/specs/YYYY-MM-DD-doc-quality-fixes-spec.md`: |
| 172 | + |
| 173 | +```markdown |
| 174 | +# Doc Quality Fixes Spec |
| 175 | + |
| 176 | +## Goal |
| 177 | +Fix {N} documentation issues found by doc-quality-guard audit. |
| 178 | + |
| 179 | +## Context |
| 180 | +- Existing doc tone: direct, factual, code-heavy, no adjectives |
| 181 | +- Reference files for tone: docs/getting-started/quickstart.md, docs/providers/openai.md |
| 182 | +- All accuracy fixes must be verified against actual source code |
| 183 | + |
| 184 | +## Issues by File |
| 185 | + |
| 186 | +### {file_path} |
| 187 | +- **[critical]** Line {N}: {description} — Fix: {suggested_fix} |
| 188 | +- **[high]** Line {N}: {description} — Fix: {suggested_fix} |
| 189 | +- **[medium]** Line {N}: {description} — Fix: {suggested_fix} |
| 190 | + |
| 191 | +(repeat for each file with issues) |
| 192 | + |
| 193 | +## Acceptance Criteria |
| 194 | +- [ ] All critical issues resolved |
| 195 | +- [ ] All high issues resolved |
| 196 | +- [ ] Medium issues addressed where possible |
| 197 | +- [ ] No new AI slop introduced in fixes |
| 198 | +- [ ] Code examples verified to match current source |
| 199 | +``` |
| 200 | + |
| 201 | +### Step 6: Invoke Orchestrate |
| 202 | + |
| 203 | +Hand off to `/orchestrate` with: |
| 204 | + |
| 205 | +``` |
| 206 | +Run the spec at dev-docs/superpowers/specs/YYYY-MM-DD-doc-quality-fixes-spec.md |
| 207 | +
|
| 208 | +IMPORTANT: Skip brainstorm and QA stages — all context, file locations, and fix instructions are already in the spec. Go directly to planning. |
| 209 | +``` |
| 210 | + |
| 211 | +--- |
| 212 | + |
| 213 | +## Error Handling |
| 214 | + |
| 215 | +| Scenario | Action | |
| 216 | +|----------|--------| |
| 217 | +| Scope path doesn't exist | Report error and **stop** | |
| 218 | +| No `.md` files in scope | Report "no markdown files found" and **stop** | |
| 219 | +| An agent fails | Report partial results from successful agents. Note which scanner failed | |
| 220 | +| All agents find no issues | Print clean message and **stop** | |
| 221 | + |
| 222 | +--- |
| 223 | + |
| 224 | +## What This Skill Does NOT Do |
| 225 | + |
| 226 | +- Does not fix docs itself — delegates to `/orchestrate` |
| 227 | +- Does not check code quality — use `/tech-debt-finder` |
| 228 | +- Does not check test coverage — use `/coverage-guard` |
| 229 | +- Does not track quality over time — each run is a fresh scan |
| 230 | +- Does not check external links (only internal relative links) |
0 commit comments