Framework-agnostic architecture documentation skill β Automatically sync your API modules, endpoints, Docker topology, SQL queries, permissions, and Swagger spec into a beautiful interactive HTML dashboard.
Turn any backend codebase into an interactive architecture wiki that both developers and AI coding assistants can use.
arch-wiki is an AI skill (agent instruction set) that keeps your living architecture documentation in perfect sync with your codebase. Every time you add a module, endpoint, permission, SQL query, or Docker service β you invoke the skill, and it:
- Reads your
architecture.jsonmanifest - Scans the changed source files
- Updates the JSON manifest with new entries
- Regenerates a fully interactive HTML dashboard
The output is a single self-contained HTML file with:
- π Overview stats dashboard
- π System Prerequisites & Setup Pipeline
- π¦ API Modules catalog with all endpoints & 1-click AI Analysis Prompts
- π€ Interactive Senior Developer Analysis Prompts modal for every API endpoint
- ποΈ System Architecture diagram with pan/zoom & hand cursor (Mermaid)
- π Docker Topology diagram with pan/zoom & hand cursor (Mermaid)
- π¨ Async Messaging & Event Topology (Kafka, RabbitMQ, JMS, SQS)
- π One-click PDF Export (exports all 11 sections into a single formatted PDF document)
- β‘ Interactive Swagger UI (try-it-out enabled with polished dark mode theme)
- π Permissions & RBAC mapping (including SpEL object-level security)
- ποΈ SQL & JPQL Queries catalog with syntax highlighting
- π₯οΈ Infrastructure services catalog with environment-inferred edges
- π‘οΈ Core Layer & Request Pipeline docs
Beyond serving as an interactive dashboard, architecture.json acts as a machine-readable context index specifically designed for AI coding assistants (Antigravity, Claude Code, Cursor, Codex, OpenCode, etc.):
- β‘ Fast Code Reading: AI tools can read
docs/architecture/architecture.jsonin a single file view to immediately understand all API modules, endpoints, database queries, RBAC permissions, and container topologies. - πͺ Massive Token Savings: Eliminates the need for AI agents to make dozens of
grepor file-reading calls across hundreds of source files, saving thousands of prompt tokens and drastically lowering API context consumption. - π― Pinpoint Navigation: Every endpoint and SQL query in
architecture.jsonlinks directly to its underlying file path (controller.ts,router.py,repository.ts), allowing AI agents to navigate straight to relevant files without scanning the entire repo. - π§ Living System Blueprint: Gives AI models a structured, top-down mental model of your architecture that persists across chat sessions.
arch-wiki/
βββ SKILL.md β AI skill definition
βββ README.md β This file
βββ templates/
βββ build_html.py β HTML dashboard generator + architecture.json initialiser (~83 KB)
architecture.jsonis automatically generated on first run bybuild_html.py --initvia a zero-dependency codebase scanner. It automatically scans yourdocker-compose.yml, route files (*.routes.ts,routers/*.py), andpackage.jsonto populate endpoints, services, workspaces, permissions, prerequisites, and SQL queries without manual setup! Built-in deduplication automatically filters out build directories (dist/,build/,node_modules/) to prevent duplicate route definitions.
In your target project, the architecture setup is simple:
your-project/
βββ docs/
βββ architecture/
βββ architecture.json β Generated on first run (AI keeps updated)
βββ build_html.py β Generator (copied from arch-wiki/templates/)
βββ architecture.html β Generated output (never edit manually)
npx github:your-username/arch-wiki# Point npx to your local folder:
npx ./path/to/arch-wiki
# OR run the installer directly with node:
node ./path/to/arch-wiki/bin/install.js
# OR use npm link for a global 'arch-wiki' command:
cd path/to/arch-wiki && npm linknpx arch-wikiThis automatically registers the arch-wiki skill into your AI assistant environment (Antigravity, Claude Code, Cursor, etc.).
Copy SKILL.md into your AI tool's skills folder:
# Antigravity AI Agent
mkdir -p ~/.gemini/antigravity/skills/arch-wiki
cp SKILL.md ~/.gemini/antigravity/skills/arch-wiki/SKILL.md
# Claude Code
mkdir -p ~/.claude/skills/arch-wiki
cp SKILL.md ~/.claude/skills/arch-wiki/SKILL.mdOnce installed, you never need to run python scripts manually. Simply open your AI coding assistant and ask:
π¬ "Run the
arch-wikiskill on this project"
The AI Assistant will autonomously:
- Copy the codebase scanner engine into
docs/architecture/build_html.py. - Scan Docker services (
docker-compose.yml), API endpoints (*.routes.ts,routers/*.py), permissions, prerequisites, and SQL queries. - Create/Sync
docs/architecture/architecture.json. - Generate the interactive dashboard at
docs/architecture/architecture.html.
Copy SKILL.md into your Antigravity skills directory:
# Option A: Copy as a named skill
cp arch-wiki/SKILL.md ~/.gemini/antigravity/skills/arch-wiki/SKILL.md
# Option B: Use directly from any project folder
# Just ensure the AI can access this SKILL.md fileThen invoke it by referencing the skill in your prompt:
Use the arch-wiki skill. I just added a new [module/endpoint/service].
Add SKILL.md to your project as a context file. You can either:
Option A: Add to .claude/ directory (Claude Code)
mkdir -p your-project/.claude
cp arch-wiki/SKILL.md your-project/.claude/arch-wiki.mdOption B: Add to .cursor/rules/ (Cursor)
mkdir -p your-project/.cursor/rules
cp arch-wiki/SKILL.md your-project/.cursor/rules/arch-wiki.mdThen prompt your AI:
Follow the instructions in .claude/arch-wiki.md / .cursor/rules/arch-wiki.md.
I just added a new module called [X].
Add the skill as a system instruction or paste it into the Codex context window:
# Print the skill content to paste into Codex
cat arch-wiki/SKILL.mdOr reference it as a file in your project and tell Codex:
Read and follow the instructions in arch-wiki/SKILL.md to update
my architecture documentation.
Add SKILL.md to your OpenCode project context:
cp arch-wiki/SKILL.md your-project/arch-wiki.mdThen in your OpenCode session:
Read arch-wiki.md and follow its instructions to update docs/architecture/
after my recent changes to [module/service/endpoint].
The skill is a plain Markdown file. Any AI assistant that can:
- Read files (
view_file/read_file) - Edit JSON files
- Execute shell commands (
python docs/architecture/build_html.py)
...can use this skill. Simply provide the contents of SKILL.md as the system/context instruction.
Because arch-wiki has a zero-dependency codebase scanner, you don't need to write long prompts or manually list your endpoints. Just tell your AI:
π¬ "Run
@arch-wikito generate architecture documentation for this project."
π¬ "Run
@arch-wikito sync my architecture documentation with recent changes."
The AI assistant will automatically run the codebase scanner, detect any new or updated endpoints, permissions, SQL queries, or Docker containers, and re-render architecture.html.
Clicking on any API endpoint in the API Modules view (or using its π Prompt button) opens an interactive modal with a tailor-made Senior Developer Analysis Prompt.
The prompt is dynamically formatted for the selected endpoint (e.g. POST /api/v1/orders), instructing an AI coding assistant to:
- Act as a senior developer joining the project.
- Analyze the endpoint using
architecture.json,arch-wikidocumentation, and project source code. - Discover the actual implementation flow and generate accurate Mermaid sequence and flowchart diagrams.
- Adhere to strict boundaries (only include components and interactions that actually exist in code, do not infer missing components, do not modify code).
Includes a 1-click π Copy to Clipboard button directly on every endpoint card and inside the modal for instant integration with AI assistants.
| Section | Purpose |
|---|---|
meta |
Project name, version, generated date, tech stack |
prerequisites |
Required runtime engines, infrastructure tools, databases, and setup steps |
workspaces |
Monorepo apps/packages (backend, frontend, packages) |
infrastructure |
Docker services (database, cache, queue, proxy, etc.) |
dockerDiagram |
Container topology nodes & edges for Mermaid diagram |
systemArchitectureDiagram |
Software component diagram nodes & edges |
swaggerSchemas |
OpenAPI spec metadata, servers, security scheme, schemas |
modules |
API modules with endpoints, permissions, file lists |
systemEndpoints |
Health/telemetry endpoints outside module structure |
coreLayer |
Middleware, core services, guards |
dataFlow |
Request pipeline steps (for the Request Pipeline view) |
permissions |
RBAC catalog (slugs list + detailed endpoint/page mappings) |
sqlQueries |
SQL query catalog with function, tables, purpose, endpoints |
The skill is designed to work with any backend framework. The AI adapts the source file scanning paths based on your stack:
| Framework | Route Files | Repository/Query Files |
|---|---|---|
| Express / NestJS | src/modules/<name>/<name>.routes.ts |
src/modules/<name>/<name>.repository.ts |
| FastAPI | app/routers/<name>.py |
app/crud/<name>.py |
| Django | <app>/urls.py + views.py |
<app>/models.py |
| Rails | config/routes.rb + app/controllers/ |
app/models/ |
| Laravel | routes/api.php + app/Http/Controllers/ |
app/Models/ |
| Spring Boot | src/.../controller/ |
src/.../repository/ |
| Go (Gin/Echo) | internal/handler/ |
internal/repository/ |
The generated architecture.html includes 11 navigation sections:
| Section | Description |
|---|---|
| π Overview | Stats cards + workspace list + system endpoints |
| π Prerequisites | Developer tools, database runtimes, & step-by-step setup commands |
| π¦ API Modules | Searchable module cards with all endpoints & 1-click Senior Developer AI analysis prompt modals |
| ποΈ System Architecture | Mermaid component diagram with pan/zoom toolbar & hand cursor |
| π Docker Topology | Mermaid container dependency graph with pan/zoom toolbar & hand cursor |
| β‘ Swagger & OpenAPI | Live Swagger UI (Dark Theme), API catalog with cURL snippets, & OpenAPI JSON spec |
| π Permissions & Scopes | RBAC catalog, system scope fallbacks (authenticated/public), & scope-to-endpoint mapping |
| ποΈ SQL Queries | Query catalog with SQL syntax highlighting |
| π₯οΈ Infrastructure | Docker service cards with feature tags |
| π‘οΈ Core Layer | Middleware and core service documentation |
| π Request Pipeline | Step-by-step request flow visualization |
| π PDF Export | 1-click PDF generator that forces pre-rendering of diagrams, Swagger views, and scope mappings |
The benchmark compares the same software understanding tasks using two approaches:
- Direct AI exploration of the repository.
- AI using
arch-wikiandarchitecture.json.
The goal is not to measure token consumption only. The main goal is to evaluate whether arch-wiki can reduce repository exploration while producing a more accurate and useful architecture understanding.
| # | Task | Prompt |
|---|---|---|
| 1 | General Architecture | Understand this project and explain: 1. Main architecture 2. Main modules 3. How an Order request flows through the system 4. Database interaction 5. External services. Do not modify anything. |
| 2 | General Architecture with arch-wiki | Same prompt, with: Use arch-wiki and architecture.json. Do not modify anything. |
| 3 | Authentication Understanding | You are joining this project as a new senior developer. You need to understand how authentication works. Explain: 1. Login flow 2. JWT generation 3. Refresh token flow 4. Database interaction 5. Redis interaction 6. Relevant files. |
| 4 | Authentication with arch-wiki | Same prompt, with: Use arch-wiki and architecture.json. |
| 5 | Change Impact Analysis | You need to add a new authentication feature. Find where this functionality should be implemented and explain which files would need to change and why. Do not modify anything. |
| 6 | Change Impact Analysis with arch-wiki | Same prompt, with: Use arch-wiki and architecture.json. Do not modify anything. |
| # | Approach | Exploration | Time | Result |
|---|---|---|---|---|
| 1 | Direct repository exploration | 17 files / 14 folders | ~2 min | Detailed architecture analysis with strong source-level details, but some conclusions were inaccurate or inferred. |
| 2 | arch-wiki + architecture.json |
1 file / 3 folders | ~1 min | Much faster and significantly less exploration. Produced a comprehensive architecture overview, but some details were inferred incorrectly. |
| 3 | Direct repository exploration | 7 files / 10 folders | ~1 min | Strong authentication analysis with detailed login, JWT, refresh token, DB and Redis flows. |
| 4 | arch-wiki + architecture.json |
7 files / 7 folders | ~1 min | Similar quality to direct exploration while using the architecture documentation to guide the investigation. |
| 5 | Direct repository exploration | 11 files / 20 folders | ~1 min | Good change impact analysis, but explored a relatively large part of the repository for an authentication-related task. |
| 6 | arch-wiki + architecture.json |
1 file / 6 folders | ~1 min | Much more focused exploration and produced a useful change-impact map based on the existing architecture. |
| # | Task | Opinion |
|---|---|---|
| 1 vs 2 | General Architecture | Major improvement. arch-wiki reduced exploration from 17 files / 14 folders to 1 file / 3 folders while still producing a comprehensive architecture overview. The main weakness is that the AI may trust documented information too much and infer details that are not actually present in the source code. |
| 3 vs 4 | Authentication | Very similar quality. The direct approach explored 7 files / 10 folders, while the arch-wiki approach explored 7 files / 7 folders. This shows that the generated architecture information can guide the AI without sacrificing much accuracy. |
| 5 vs 6 | Change Impact | Strong improvement. The direct approach explored 11 files / 20 folders, while the arch-wiki approach explored only 1 file / 6 folders. The architecture manifest helped the AI identify the relevant architectural boundaries and affected files much faster. |
The most interesting result is not simply that arch-wiki makes the AI faster.
The important observation is:
The AI can use a pre-generated architecture representation as a map of the system instead of rediscovering the architecture from scratch for every question.
In the tested scenarios, arch-wiki significantly reduced repository exploration, especially for high-level architecture and change-impact questions.
The benchmark also exposed an important limitation:
Architecture documentation must be accurate. If
architecture.jsoncontains incorrect or inferred information, the AI can propagate those mistakes instead of discovering the truth directly from the source code.
Therefore, the next step is to measure accuracy, not just exploration reduction.
Release v1.1.0 represents a major architectural hardening release, bringing full enterprise Spring Boot & Gradle Kotlin DSL (KTS) support, AST-accurate lexer parsing, and robust real-world codebase discovery:
- Full Kotlin DSL (
build.gradle.kts,settings.gradle.kts) & Version Catalogs: Extracts modules, dependencies, and Java toolchain versions fromlibs.versions.tomland Gradle scripts. - Maven Multi-Module & Java 21+: Deep inspection of root and child
pom.xmlfiles with compiler release tracking and parent pom inheritance. - Actuator Endpoint Detection: Auto-discovers enabled Spring Actuator endpoints (
/actuator/health,/actuator/info,/actuator/prometheus).
- Replaces fragile regular expressions with a state-machine Java lexer.
- Supports class-level Γ method-level Cartesian product route expansion (
@RequestMapping,@GetMapping,@PostMapping,@PutMapping,@DeleteMapping). - Handles Java comments, raw strings, multiline blocks, and mixed path arrays (
value = {"/api", "/v1"}).
- Automatically indexes repository
public static final Stringconstants. - Resolves constant references across classes and packages for Kafka/messaging topic names and REST route path segments (e.g.
AppConstants.ORDERS_TOPIC->"orders").
- Extracts explicit SQL and JPQL from
@Queryannotations, text blocks, andJdbcTemplatecalls. - Chained CTE Isolation: Correctly isolates and excludes chained Common Table Expressions (
WITH a AS (...), b AS (...)), ensuring CTE aliases never leak into the database table catalog. - JPQL
JOIN FETCHProtection: Explicitly filters outFETCHkeywords from JPQL association joins.
- Subfolder Search: Automatically discovers
docker-compose*.yml/compose*.ymlup to 2 directories deep (deployment/,docker/,infra/, etc.). - Multi-File Merging: Intelligently merges base compose files with environment overrides.
- Runtime Edge Inference: Infers runtime dependencies between services based on environment variables (
*_HOST,*_URL,KAFKA_BOOTSTRAP_SERVERS, etc.).
- Parses Spring Security
@PreAuthorizeSpEL expressions (hasRole(...),hasAuthority(...),isAuthenticated(),permitAll()). - Identifies object-level security flags (
#id,@bean.method(),hasPermission(...)).
--skip-overridesFlag: Allows running raw codebase scans without triggering customarch_overrides.pyhooks.--placeholder-sqlFlag: Backwards compatibility mode to preserve synthetic placeholder SQL counts for older workflows.- GitHub Actions CI: Added automated CI test matrix in
.github/workflows/test.ymlrunning across Python 3.9 and Python 3.12.
- Python 3.9+ (standard library β
json,re,os,sys,datetimeβ no mandatory external dependencies; optionalpyyamlfor advanced Docker compose parsing) - Any AI assistant that can read/write files and run shell commands
- Docker is optional β if
dockerDiagram.nodesis empty, the Docker tab shows a friendly placeholder
MIT β Use freely in any project.
To extend or adapt this skill:
- Edit
SKILL.mdto add new sections or update instructions - Edit
templates/build_html.pyto add new dashboard sections - Update
templates/architecture.jsonwith new schema fields - Update this
README.md
Built with β€οΈ for developers who want their architecture docs to stay alive.