Analyze and validate documentation quality for PRDs, ADRs, PRPs, CLAUDE.md, and .claude/rules/ to ensure standards compliance and freshness
/plugin marketplace add laurigates/claude-plugins/plugin install code-quality-plugin@lgates-claude-pluginsThis skill is limited to using the following tools:
Expert analysis of technical documentation quality, structure, and maintenance for codebases using Blueprint Development methodology and Claude Code conventions.
Documentation quality is critical for:
This skill provides systematic analysis of:
Purpose: Guide AI assistants on working with the codebase
Required Elements:
---
created: YYYY-MM-DD
modified: YYYY-MM-DD
reviewed: YYYY-MM-DD
---
# Project Name
## Project Structure
[Directory layout and organization]
## Rules
[Key rules and conventions]
## Development Workflow
[Common tasks and patterns]
## Conventions
[Naming, structure, etc.]
Quality Indicators:
Purpose: Modular, reusable rule definitions
File Structure:
---
created: YYYY-MM-DD
modified: YYYY-MM-DD
reviewed: YYYY-MM-DD
---
# Rule Title
[Clear, specific guidance on a single concern]
Quality Indicators:
Common Rules:
plugin-structure.md - Plugin organizationrelease-please.md - Version managementskill-development.md - Skill creation patternsagentic-optimization.md - CLI optimization for AIcommand-naming.md - Command conventionsPurpose: Document significant architectural choices
Format: MADR (Markdown Architecture Decision Records)
Structure:
# ADR-NNNN: Title
**Date**: YYYY-MM
**Status**: Accepted | Superseded | Deprecated
**Deciders**: [who decided]
## Context
[Problem and constraints]
## Decision
[What was decided]
## Consequences
[Positive and negative outcomes]
Location: docs/adrs/ or docs/adr/
Naming: Sequential numbers, kebab-case titles
0001-plugin-based-architecture.md0002-domain-driven-organization.mdQuality Indicators:
Purpose: Define what needs to be built and why
Location: docs/prds/ or .claude/blueprints/prds/
Structure:
# Project/Feature Name - PRD
**Created**: YYYY-MM-DD
**Status**: Draft | Active | Implemented | Archived
**Version**: X.Y
## Executive Summary
- Problem Statement
- Proposed Solution
- Business Impact
## Stakeholders & Personas
[Who cares and who uses]
## Functional Requirements
[What the system must do]
## Non-Functional Requirements
[Performance, security, accessibility]
## Success Metrics
[How we measure success]
## Scope
- In Scope
- Out of Scope
## Technical Considerations
[Architecture, dependencies, integrations]
Quality Indicators:
Purpose: AI-executable feature specifications (Blueprint methodology)
Location: docs/prps/
Structure:
# [Feature Name] PRP
## Goal & Why
[One sentence goal + business justification]
## Success Criteria
[Specific, testable acceptance criteria]
## Context
- **Documentation References**: [URLs with sections]
- **ai_docs References**: [Curated context]
- **Codebase Intelligence**: [Files, patterns, snippets]
- **Known Gotchas**: [Warnings and mitigations]
## Implementation Blueprint
[Architecture decision + task breakdown + pseudocode]
## TDD Requirements
[Test strategy + critical test cases]
## Validation Gates
[Executable commands for quality gates]
## Confidence Score: X/10
- Context Completeness: X/10
- Implementation Clarity: X/10
- Gotchas Documented: X/10
- Validation Coverage: X/10
Quality Indicators:
# Check if file has required frontmatter
grep -A 5 "^---$" CLAUDE.md | grep -E "(created|modified|reviewed):"
# Find files missing frontmatter
for f in docs/adrs/*.md; do
grep -q "^---$" "$f" || echo "Missing frontmatter: $f"
done
# Check ADR naming convention (NNNN-title.md)
find docs/adrs -name "*.md" ! -name "README.md" ! -name "[0-9][0-9][0-9][0-9]-*.md"
# Check for sequential numbering
ls docs/adrs/[0-9]*.md | sort
# Find docs not modified in 6 months
find docs -name "*.md" -mtime +180
# Check git history for documentation
git log --since="6 months ago" --oneline -- docs/ .claude/ CLAUDE.md
# Last modification of specific doc
git log -1 --format="%ai %s" -- CLAUDE.md
# Check if ADR has required sections
grep -E "^## (Context|Decision|Consequences)" docs/adrs/0001-*.md
# Check PRD completeness
grep -E "^## (Executive Summary|Functional Requirements|Success Metrics)" docs/prds/*.md
# Documentation inventory
echo "CLAUDE.md: $(test -f CLAUDE.md && echo '✅' || echo '❌')"
echo "Rules: $(ls .claude/rules/*.md 2>/dev/null | wc -l) files"
echo "ADRs: $(ls docs/adrs/*.md 2>/dev/null | grep -v README | wc -l) files"
echo "PRDs: $(ls docs/prds/*.md 2>/dev/null | wc -l) files"
echo "PRPs: $(ls docs/prps/*.md 2>/dev/null | wc -l) files"
Calculate as average of five dimensions:
| Dimension | Score 9-10 | Score 7-8 | Score 5-6 | Score 3-4 | Score 0-2 |
|---|---|---|---|---|---|
| Structure | Perfect org, all conventions | Minor naming issues | Some disorganization | Poor structure | Missing/chaotic |
| Completeness | All sections present | 1-2 missing sections | Several gaps | Major gaps | Severely incomplete |
| Freshness | Updated <3mo | Updated <6mo | Updated <12mo | Stale >12mo | Abandoned >24mo |
| Standards | Perfect compliance | Minor deviations | Some non-compliance | Poor compliance | No standards |
| Content Quality | Excellent clarity | Good with minor issues | Acceptable | Unclear/vague | Unusable |
Structure (Organization & Naming):
Completeness (Required Elements):
Freshness (Currency):
modified dates recentStandards Compliance (Format Adherence):
Content Quality (Clarity & Usefulness):
| Issue | Detection | Fix |
|---|---|---|
| Missing CLAUDE.md | ! -f CLAUDE.md | Create using project template |
| No frontmatter | ! grep "^---$" | Add YAML frontmatter with dates |
| Completely outdated | modified >24mo | Review and update or archive |
| Broken structure | Missing required sections | Follow template structure |
| Invalid ADR naming | Not NNNN-title.md | Rename to follow convention |
| Issue | Detection | Fix |
|---|---|---|
| Stale docs | modified >6mo | Review and update modified date |
| Missing sections | Template mismatch | Add missing sections |
| No ADR index | No README in adrs/ | Create index file |
| Vague requirements | Review content | Add specificity and examples |
| Low confidence PRP | Score <7 | Research more context |
| Issue | Detection | Fix |
|---|---|---|
| Sparse rules | <3 rule files | Extract common patterns to rules |
| No PRPs | Empty prps/ dir | Create PRPs for planned features |
| Missing examples | Grep for code blocks | Add code examples |
| Poor cross-refs | Few markdown links | Link related documentation |
| No metrics | PRD without success criteria | Define measurable metrics |
Collect all documentation:
# List all documentation
find . -name "CLAUDE.md" -o -path "*/.claude/rules/*.md" -o -path "*/docs/adrs/*.md" -o -path "*/docs/prds/*.md" -o -path "*/docs/prps/*.md"
Create inventory:
For each document type:
Check currency:
# Git last modified
git log -1 --format="%ai" -- path/to/doc.md
# Compare frontmatter vs git
# (modified date should match recent git activity)
Flag stale documents:
6mo: Warning
12mo: Concern
24mo: Critical
Calculate scores:
Overall = Average of 5 dimensions
Generate report:
| Task | Optimized Approach |
|---|---|
| List docs | find with multiple -name patterns, single command |
| Check frontmatter | grep -l "^---$" *.md batch check |
| Validate names | Shell globbing [0-9][0-9][0-9][0-9]-*.md |
| Count files | Pipeline `ls |
| Git history | git log --since="6 months ago" --oneline |
| Batch validation | for loop over files, collect issues |
---
created: 2026-01-08
modified: 2026-01-08
reviewed: 2026-01-08
---
# ADR-NNNN: Title
**Date**: 2026-01
**Status**: Accepted
## Context
[Why this decision?]
## Decision
[What did we decide?]
## Consequences
✅ Pros: ...
❌ Cons: ...
/docs:quality-check - Run comprehensive analysis/blueprint:init - Initialize Blueprint Development/blueprint:prd - Generate PRD from project docs/blueprint:adr - Generate ADRs from codebase/blueprint:prp-create - Create PRP for featurereviewed date every 3 months# Safe directory checks
test -d docs/adrs && ls docs/adrs || echo "ADRs directory not found"
# Safe file reads with fallback
cat CLAUDE.md 2>/dev/null || echo "CLAUDE.md not found"
# Git-aware freshness (works without git)
git log -1 --format="%ai" -- CLAUDE.md 2>/dev/null || echo "No git history"
# Glob with no-match handling
shopt -s nullglob
for f in docs/adrs/*.md; do
echo "Processing $f"
done
.claude/rules/ - Project-specific documentation standardsThis skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.