generate-verified-docs
Generates audit-grade, hallucination-free documentation from codebase features with full traceability. Use when documenting features, creating technical specs, or generating verified documentation with code references.
Install
mkdir -p .claude/skills/generate-verified-docs && curl -L -o skill.zip "https://mcp.directory/api/skills/download/1574" && unzip -o skill.zip -d .claude/skills/generate-verified-docs && rm skill.zipInstalls to .claude/skills/generate-verified-docs
About this skill
Verified Documentation Generator
Generate audit-grade documentation from a codebase feature with full traceability and zero hallucination.
Arguments
$ARGUMENTS should be:
- Feature name and description (e.g., "User Registration", "Bookmark System", "Reading Progress")
Prerequisites
- Clear feature name and description from user
- Access to the codebase root directory
Hard Rules
- ❌ No assumptions or inferred behavior
- ❌ No undocumented states or transitions
- ✅ Every claim must link to file:line
- ✅ Unknowns must be explicitly reported
- ✅ Halt if verification fails
Stage 1: Scope Resolution
Goal: Define feature boundaries and reject ambiguous scopes.
- Parse the feature description to identify expected entry points (API routes, UI components, CLI commands)
- Search codebase for matching routes, exported functions/classes, and test files
- Validate at least one concrete code location exists
Gate:
- If no code locations found → HALT with failure report
- If scope is ambiguous → Ask user to narrow scope
- If confirmed → Proceed with
entry_point_candidateslist
Output: scope_definition, entry_point_candidates, scope_confidence
Stage 2: Codebase Discovery
Goal: Map all code artifacts related to the feature.
- Verify each entry point exists and classify as:
API|UI|JOB|EVENT|CLI - Trace dependencies (imports, injected dependencies, runtime-resolved modules)
- Build dependency graph (DAG)
- Classify artifacts: Controllers, Services, Repositories, Models, Utils, External
- Extract data models with types, relationships, and validation rules
Gate:
- Every entry point must be verifiable (
file_exists,line_exists,callable) - If no verifiable entry points → HALT
Output: entry_points, dependency_graph, artifacts_by_type, data_models,
external_integrations, discovery_gaps
Stage 3: Execution Flow Tracing
Goal: Trace complete execution paths from entry to exit.
- Synchronous paths: Follow function call chains, record decision branches, track variable transformations
- Async boundaries: Identify Promise/async-await, event emitters, message queues, webhooks
- Side effects: Catalog DATABASE_WRITE, DATABASE_READ, EXTERNAL_CALL, FILE_SYSTEM, CACHE_OP, EVENT_EMIT, LOGGING
- Flow enumeration: Build all paths, tag as
HAPPY_PATH|ERROR_PATH|EDGE_CASE
Gate:
- Every flow step must have a code reference
- If coverage below threshold → Ask user to accept partial or HALT
Output: execution_flows, async_boundaries, side_effects, flow_coverage,
untraced_branches
Stage 4: State & Transition Extraction
Goal: Extract explicit state machines; reject inferred states.
- Search for status/state enums, FSM patterns, status columns in schemas
- Map transitions:
STATE_A --[condition]--> STATE_B @ file:line - Verify each state value exists in code (enum, constant, or literal)
- Identify orphan states (no inbound) and terminal states (no outbound)
Gate:
- Every state must have a code reference
- Every transition must link verified states
- If undocumented states found → HALT with failure report
Output: states, transitions, state_machine, orphan_states, terminal_states
Stage 5: Failure & Edge Case Analysis
Goal: Identify error handling coverage and missing failure modes.
- Locate try/catch blocks, error callbacks, error boundaries, middleware handlers
- Trace exception propagation paths
- Detect edge cases: NULL_INPUT, EMPTY_ARRAY, BOUNDARY_VALUES, PERMISSION, TIMEOUT, CONFLICT
- Score risk:
LOW|MEDIUM|HIGH|CRITICAL
No hard gate – outputs are informational.
Output: handled_failures, unhandled_failures, silent_failures, edge_cases, risk_areas
Stage 6: Diagram Generation
Goal: Produce diagrams strictly matching verified flows.
- Generate State Diagram (Mermaid stateDiagram-v2) from
state_machine - Generate Sequence Diagrams (Mermaid sequenceDiagram) from
execution_flows - Generate Dependency Diagram (Mermaid flowchart) from
dependency_graph - Cross-check every diagram element against source stage outputs
Gate:
- Remove any unverified elements
- Log warnings for removed elements
Output: state_diagram, sequence_diagrams, dependency_diagram, diagram_verification_log
Stage 7: Documentation Assembly
Goal: Produce structured documentation.
Generate markdown with these sections:
# [Feature Name] Documentation
## Overview
## Entry Points
## Data Models
## Execution Flows
## State Machine
## Error Handling
## Known Gaps & Limitations
## Appendix: Code References
- Every claim gets
[ref: file:line]annotation - Build clickable traceability index
- Generate two views: Technical (full detail) and Non-Technical (simplified)
Output: documentation_technical, documentation_summary, traceability_index,
confidence_report
Stage 8: Verification & Validation
Goal: Cross-check all claims; fail if verification cannot pass.
- Extract all factual claims from documentation
- Verify each claim against
traceability_index:- File exists
- Line content matches claim basis
- Check diagram-flow consistency
- Verify all gaps appear in Known Limitations
- Hallucination detection: Flag claims without code references or contradicting code
Gate:
- If hallucination detected → HALT immediately
- If too many unverifiable claims → HALT
- If passed → Output final documentation
Output: verification_passed, verified_claims, failed_claims, hallucination_report,
final_documentation or failure_report
Failure Behavior
When any stage encounters a blocking failure:
- STOP execution immediately
- PRESERVE all partial outputs
- Generate failure report:
{ "stage_failed": "<stage_name>", "failure_type": "<failure_enum>", "failure_reason": "<explanation>", "partial_outputs": { ... }, "recovery_suggestions": [...] } - AWAIT user intervention
Example Usage
User: Generate documentation for the "User Registration" feature
Stage 1: Found POST /auth/register, /signup page
Stage 2: Traced AuthController → AuthService → UserRepository, EmailService
Stage 3: Mapped registration flow with email verification async boundary
Stage 4: Extracted UserStatus enum { PENDING, ACTIVE, SUSPENDED }
Stage 5: Identified missing timeout handling on EmailService
Stage 6: Generated state diagram and sequence diagram
Stage 7: Assembled full technical documentation
Stage 8: Verified 24/24 claims, no hallucinations → SUCCESS
More by quran
View all →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
rust-coding-skill
UtakataKyosui
Guides Claude in writing idiomatic, efficient, well-structured Rust code using proper data modeling, traits, impl organization, macros, and build-speed best practices.
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.