Skip to content

HeWhoRoams/AppDoc

Repository files navigation

appdoc

Overview

AppDoc provides automated documentation extraction, quality assessment, and improvement tools for codebases. The toolkit is implemented in PowerShell and outputs comprehensive reports and recommendations based on analysis of your codebase and generated documentation.

Note: The current workflow is local-first. Deterministic scripts generate technical artifacts, and readability enhancements are performed directly in your IDE chat session.

Prerequisites

  • PowerShell 7+ (required for all scripts)
  • Windows OS (tested)
  • VS Code + GitHub Copilot Chat (for /appdoc.begin, /appdoc.enhance, /appdoc.diagrams commands)
  • Target codebase path where docs/ output can be written

Core Scripts

Primary deterministic workflow:

  • .appdoc/scripts/powershell/run-all-generators.ps1 — end-to-end deterministic pipeline
  • .appdoc/scripts/powershell/run-appdoc-enrich.ps1 — bootstrap + semantic apply + enrichment gate orchestration
  • .appdoc/scripts/powershell/run-appdoc-semantic-enrich.ps1 — file-driven semantic input/output apply for enriched evidence
  • .appdoc/scripts/powershell/ci-enrichment-gate.ps1 — enrichment quality gate (Phase 2.5 checks)
  • .appdoc/scripts/powershell/appdoc.diagnose.ps1 — environment/readiness diagnostics
  • .appdoc/scripts/powershell/validate-documentation.ps1 — structured validation + scoring
  • .appdoc/scripts/powershell/remediate-generated-docs.ps1 — post-generation cleanup + evidence traceability

Key generators in current workflow include:

  • generate-overview.ps1, generate-start-here.ps1, generate-docs-index.ps1
  • generate-api-inventory.ps1, generate-data-model.ps1, generate-config-catalog.ps1
  • generate-build-cookbook.ps1, generate-test-catalog.ps1, generate-task-guides.ps1
  • generate-debt-register.ps1, generate-dependencies-catalog.ps1
  • generate-c4-mermaid-diagrams.ps1

Quick Start

  1. Download or clone the AppDoc repo into the root of the codebase you want documented.
  2. Open that repository in Visual Studio Code.
  3. Recommended: Generate workspace instructions or run an INIT command to have your AI investigate your codebase.
  4. Open the GitHub Copilot Chat and run /appdoc.begin to start the guided AppDoc workflow.
  5. Run pwsh ./.appdoc/scripts/powershell/run-appdoc-enrich.ps1 -RootPath <codebase-path> to bootstrap evidence, apply semantic enrichment, and validate gate checks.
  6. Run /appdoc.enhance to apply editorial polish after enrichment.

That's it — AppDoc will perform environment checks and walk you through analysis and generation.

Architecture Diagrams

AppDoc now generates Mermaid C4 diagrams in Markdown format under docs/diagrams/.

  • docs/diagrams/c4-context.md
  • docs/diagrams/c4-container.md
  • docs/diagrams/internal-flow.md
  • docs/diagrams/data-flow.md
  • docs/diagrams/critical-sequences.md
  • docs/diagrams/data-lineage-core.md (plus partition files when needed)
  • docs/diagrams/index.md

Use /appdoc.diagrams to AI-enhance those Mermaid diagrams in place.

Script Execution Modes

You can run deterministic generation directly with:

pwsh ./.appdoc/scripts/powershell/run-all-generators.ps1 -RootPath <codebase-path>

Useful flags:

  • -DryRun — previews which scripts and phases would run without generating artifacts.
  • -StrictValidation — fails the run when generated artifacts score below threshold.
  • -QualityThreshold <1-100> — sets strict validation cutoff (default: 80).
  • -SkipDiagrams — skips C4 diagram generation. Readability and narrative enhancements are handled directly in your IDE/chat AI session over local workspace context and generated evidence artifacts.

Enrichment bootstrap command:

pwsh ./.appdoc/scripts/powershell/run-appdoc-enrich.ps1 -RootPath <codebase-path>

Strict gate mode (fails when enrichment checks do not pass):

pwsh ./.appdoc/scripts/powershell/run-appdoc-enrich.ps1 -RootPath <codebase-path> -StrictGate

By default, semantic apply runs before the gate and writes:

  • docs/evidence/semantic/input/*.semantic.input.json (records requiring semantic values)
  • docs/evidence/semantic/output/*.semantic.output.json (optional external semantic responses)
  • docs/evidence/semantic/applied/*.semantic.applied.json (post-apply snapshots)

Use -SkipSemanticApply only when you intentionally want to gate existing enriched files as-is.

Run gate standalone:

pwsh ./.appdoc/scripts/powershell/ci-enrichment-gate.ps1 -RootPath <codebase-path>

Recommended sequence:

  1. run-all-generators.ps1
  2. run-appdoc-enrich.ps1
  3. /appdoc.enhance

Mermaid C4 diagrams can be generated directly with:

pwsh ./.appdoc/scripts/powershell/generate-c4-mermaid-diagrams.ps1 -RootPath <codebase-path> -OutputPath <codebase-path>/docs -DiagramLevels All

To AI-enhance generated Mermaid diagrams in place, run /appdoc.diagrams in Copilot Chat.

Diagnostics and validation commands:

  • pwsh ./.appdoc/scripts/powershell/appdoc.diagnose.ps1 -RootPath <codebase-path> -Fix
  • pwsh ./.appdoc/scripts/powershell/validate-documentation.ps1 -RootPath <codebase-path>
  • pwsh ./.appdoc/scripts/powershell/validate-documentation.ps1 -RootPath <codebase-path> -Strict -Threshold 80

Framework Support Matrix

Last updated: 2026-02-17

Supported Frameworks

Status Language Framework Version Range Coverage Notes
✅ Full C# ASP.NET Core 2.1+ 90% Controller/route detection, config extraction, model heuristics
⚠️ Partial C# ASP.NET MVC 5 5.x 75% Action detection supported; some attribute edge cases remain
⚠️ Partial JS/TS Express.js 4.x 60% Basic app.METHOD and router patterns; middleware chains limited
⚠️ Partial Python Flask 2.x+ 65% @app.route and common blueprint patterns supported
⚠️ Partial Python FastAPI 0.9+ 70% Decorator and response model heuristics supported
⚠️ Partial Python Django 3.x+ 55% URL pattern extraction supported; deep viewset inference limited
⚠️ Partial Java Spring Boot 2.x+ 60% @*Mapping and @RequestMapping scanning supported

Unsupported or Planned

Status Framework Planned
❌ Not supported Ruby on Rails Planned (TBD)
❌ Not supported Go (Gin/Echo) Planned (TBD)
❌ Not supported PHP (Laravel) Planned (TBD)

Detection Signals

  • C#: *.csproj, *.sln, [ApiController], [HttpGet], MapControllers
  • JS/TS: package.json dependencies (express) and app.get / router.get patterns
  • Python: requirements.txt / pyproject.toml deps (flask, fastapi, django), route decorators, urls.py
  • Java: pom.xml Spring dependencies, @RestController, @RequestMapping

Requesting New Framework Support

Open an issue with:

  1. Framework name and target version
  2. Minimal sample project or repo
  3. Expected artifacts (API inventory, data model, config catalog, etc.)
  4. Known route/config/model patterns used in your codebase

Output Files

Troubleshooting

  • Ensure all required scripts and modules are present in .appdoc/scripts/powershell/
  • Use PowerShell 7+ for compatibility
  • Check file paths for documentation output
  • Review error messages for missing files or permissions
  • Run pwsh ./.appdoc/scripts/powershell/appdoc.diagnose.ps1 -RootPath <codebase-path> -Fix to validate environment and script readiness

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

License file is not currently included in this repository. Add a LICENSE file before external distribution.

Support

For support, please open an issue on GitHub.


About

AppDoc is a series of prompts and scripts that inspect your local codebase and generate documentation about it. It leverages powershell and LLM integrations to create technically accurate and human readable artifacts.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors