# ekuttan/codewiki architecture

> Architecture diagram of the GitHub repository ekuttan/codewiki, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ekuttan/codewiki
- Repository: https://github.com/ekuttan/codewiki

## Overview

1. **What this repository is**
   - This is not an application runtime; it is a **Claude Code skill package** named **CodeWiki**.
   - Its purpose is to guide Claude Code to scan another codebase and generate a structured knowledge base for that target project.

2. **Top-level composition**
   - The repo is intentionally small:
     - `SKILL.md` = the behavior/specification for the skill.
     - `templates/` = markdown templates for generated documentation.
     - `README.md` = product/usage documentation for humans.
     - `LICENSE` = MIT license.
   - There are no source modules, services, build scripts, or package manifests, which signals this is a **documentation/prompt repository** rather than a software system with executable components.

3. **Core control plane: `SKILL.md`**
   - `SKILL.md` is the heart of the repo.
   - It defines how Claude Code should run the `/codewiki` workflow: what to scan, what questions to ask, how to confirm findings, and how to write outputs.
   - Architecturally, this file is the **orchestrator**: it transforms the skill from static documentation into an interactive analysis pipeline.

4. **Template subsystem: `templates/`**
   - The `templates/` folder defines the shape of the generated knowledge base.
   - Each template corresponds to one documentation artifact:
     - `architecture.md`
     - `service-map.md`
     - `events.md`
     - `user-flow.md`
     - `readme.md`
     - `claude-md.md`
   - This is the repo’s main extensibility boundary: changing templates changes the output structure without changing the underlying scan behavior.

5. **Output model**
   - The skill does not store generated docs in this repository by default; it generates them in a target project under `codewiki/` and may also generate or merge `CLAUDE.md`.
   - So the repo’s architecture is a **generator definition**, while the actual knowledge base is a separate downstream artifact in the scanned project.

6. **Interaction model**
   - The user invokes `/codewiki` inside Claude Code against a target codebase.
   - The skill then follows an interactive flow: infer product context, scan the codebase, discover user flows, verify architecture, and generate docs.
   - This makes the system **LLM-driven and local**, not server-driven or event-driven in the traditional software sense.

7. **Multi-repo / large-system handling**
   - README describes a specific orchestration strategy for multi-repo products: scan sibling repos under a shared parent directory, inventory them, prioritize infrastructure and contracts, then scan apps and services one at a time.
   - The important architectural boundary here is **context management**: the skill is designed to carry forward compact summaries rather than full repo contents.
   - This is a key part of the system’s design, even though it is implemented as prompt behavior rather than code.

8. **Primary data flows**
   - Input: a target codebase, optional product context, and optional URLs provided by the user.
   - Processing: Claude Code reads source files, dependency manifests, routes, env vars, models, and configs from the target project.
   - Output: generated markdown knowledge base files and `CLAUDE.md`.
   - The repo itself does not persist application data; the only persistent outputs are documentation artifacts written to the user’s project.

9. **Security and trust boundary**
   - The skill runs locally inside Claude Code.
   - It explicitly avoids sending code to a backend or collecting telemetry.
   - The only external fetches mentioned are user-provided URLs during product-context gathering.
   - From an architecture diagram perspective, the trust boundary is between the local workspace and any explicit external docs URLs the user chooses to supply.

10. **Customization points**
   - `templates/` lets teams tailor the generated documentation sections and style.
   - `SKILL.md` lets teams change the scan and confirmation behavior.
   - This means the repo is designed to be adapted as a **documentation generation framework**, not a fixed product.

11. **What is intentionally missing**
   - There is no API, database, queue, web frontend, or worker infrastructure in this repository.
   - Those concepts appear only as things the skill can discover in other repos it scans.
   - So the architectural diagram for this repo should center on **prompt/spec files → Claude Code execution → generated docs**, not on runtime services.

12. **How to depict it**
   - A clear diagram would show:
     - the human/operator invoking `/codewiki`,
     - Claude Code consuming `SKILL.md` and `templates/`,
     - the target repository being scanned as input,
     - generated documentation written back to the target project,
     - optional external docs URLs as auxiliary input.
   - That accurately captures the repo as a **skill-based documentation generator** with no standalone runtime.

Main entry points: [`templates`](https://github.com/ekuttan/codewiki/tree/main/templates) (Templates), [`SKILL.md`](https://github.com/ekuttan/codewiki/blob/main/SKILL.md) (SKILL.md), [`README.md`](https://github.com/ekuttan/codewiki/blob/main/README.md) (README.md), [`LICENSE`](https://github.com/ekuttan/codewiki/tree/main/LICENSE) (LICENSE)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_repo["CodeWiki repo"]
  node_skill["SKILL.md<br/>skill spec<br/>[SKILL.md]"]
  node_readme["README.md<br/>usage docs<br/>[README.md]"]
  node_license["LICENSE"]
  node_templates_dir["Templates<br/>template set"]
  node_architecture_tpl["Architecture<br/>doc template<br/>[architecture.md]"]
  node_service_map_tpl["Service map<br/>doc template<br/>[service-map.md]"]
  node_events_tpl["Events<br/>doc template<br/>[events.md]"]
  node_user_flow_tpl["User flow<br/>doc template<br/>[user-flow.md]"]
  node_readme_tpl["Project readme<br/>doc template<br/>[readme.md]"]
  node_claude_tpl["CLAUDE.md<br/>doc template<br/>[claude-md.md]"]
end

subgraph group_runtime["Claude Code flow"]
  node_operator(("Operator<br/>human"))
  node_claude_code["Claude Code<br/>local executor"]
  node_target_repo["Target codebase<br/>scanned repo"]
  node_external_docs["External docs<br/>optional input"]
  node_scan_inputs["Code signals<br/>analysis inputs"]
  node_summary_context["Compact context<br/>working memory"]
end

subgraph group_outputs["Generated artifacts"]
  node_codewiki_out["codewiki/<br/>generated docs"]
  node_claude_out["CLAUDE.md<br/>generated guidance"]
end

node_operator -->|"invokes /codewiki"| node_claude_code
node_claude_code -->|"loads spec"| node_skill
node_claude_code -->|"loads templates"| node_templates_dir
node_templates_dir -->|"contains"| node_architecture_tpl
node_templates_dir -->|"contains"| node_service_map_tpl
node_templates_dir -->|"contains"| node_events_tpl
node_templates_dir -->|"contains"| node_user_flow_tpl
node_templates_dir -->|"contains"| node_readme_tpl
node_templates_dir -->|"contains"| node_claude_tpl
node_operator -->|"selects target"| node_target_repo
node_operator -->|"supplies optional URLs"| node_external_docs
node_claude_code -->|"reads"| node_scan_inputs
node_external_docs -.->|"context only"| node_claude_code
node_scan_inputs -->|"condenses"| node_summary_context
node_summary_context -->|"feeds follow-up"| node_claude_code
node_skill -->|"directs workflow"| node_claude_code
node_claude_code -->|"writes docs"| node_codewiki_out
node_claude_code -->|"writes guidance"| node_claude_out
node_target_repo -->|"provides"| node_scan_inputs
node_skill -->|"describes"| node_readme
node_skill -->|"governs"| node_license

click node_skill "https://github.com/ekuttan/codewiki/blob/main/SKILL.md"
click node_readme "https://github.com/ekuttan/codewiki/blob/main/README.md"
click node_license "https://github.com/ekuttan/codewiki/tree/main/LICENSE"
click node_templates_dir "https://github.com/ekuttan/codewiki/tree/main/templates"
click node_architecture_tpl "https://github.com/ekuttan/codewiki/blob/main/templates/architecture.md"
click node_service_map_tpl "https://github.com/ekuttan/codewiki/blob/main/templates/service-map.md"
click node_events_tpl "https://github.com/ekuttan/codewiki/blob/main/templates/events.md"
click node_user_flow_tpl "https://github.com/ekuttan/codewiki/blob/main/templates/user-flow.md"
click node_readme_tpl "https://github.com/ekuttan/codewiki/blob/main/templates/readme.md"
click node_claude_tpl "https://github.com/ekuttan/codewiki/blob/main/templates/claude-md.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_skill,node_readme,node_license,node_templates_dir,node_architecture_tpl,node_service_map_tpl,node_events_tpl,node_user_flow_tpl,node_readme_tpl,node_claude_tpl toneBlue
class node_operator,node_claude_code,node_target_repo,node_external_docs,node_scan_inputs,node_summary_context toneAmber
class node_codewiki_out,node_claude_out toneMint
```

## Components

### CodeWiki repo

Skill package and documentation for the CodeWiki workflow.

- [SKILL.md](https://github.com/ekuttan/codewiki/blob/main/SKILL.md): skill spec · Defines the /codewiki workflow, scan process, confirmation steps, and output rules. · `SKILL.md`
- [README.md](https://github.com/ekuttan/codewiki/blob/main/README.md): usage docs · Human-facing overview and multi-repo operating guidance. · `README.md`
- [LICENSE](https://github.com/ekuttan/codewiki/tree/main/LICENSE): license · MIT license for the skill package. · `LICENSE`
- [Templates](https://github.com/ekuttan/codewiki/tree/main/templates): template set · Markdown blueprints for the generated knowledge base. · `templates`
- [Architecture](https://github.com/ekuttan/codewiki/blob/main/templates/architecture.md): doc template · Template for architecture documentation. · `templates/architecture.md`
- [Service map](https://github.com/ekuttan/codewiki/blob/main/templates/service-map.md): doc template · Template for service and boundary mapping. · `templates/service-map.md`
- [Events](https://github.com/ekuttan/codewiki/blob/main/templates/events.md): doc template · Template for event and message documentation. · `templates/events.md`
- [User flow](https://github.com/ekuttan/codewiki/blob/main/templates/user-flow.md): doc template · Template for end-user journey documentation. · `templates/user-flow.md`
- [Project readme](https://github.com/ekuttan/codewiki/blob/main/templates/readme.md): doc template · Template for generated repository README output. · `templates/readme.md`
- [CLAUDE.md](https://github.com/ekuttan/codewiki/blob/main/templates/claude-md.md): doc template · Template for generated Claude guidance merged into the target project. · `templates/claude-md.md`

### Claude Code flow

Interactive local execution against a target codebase.

- **Operator**: human · Invokes /codewiki and supplies context, scope, and optional URLs.
- **Claude Code**: local executor · Runs the interactive analysis and documentation workflow inside the workspace.
- **Target codebase**: scanned repo · External project being analyzed for structure, flows, and contracts.
- **External docs**: optional input · User-provided URLs used only for context gathering when needed.
- **Code signals**: analysis inputs · Source files, manifests, routes, env vars, models, and configs read from the target project.
- **Compact context**: working memory · Summaries carried forward across large or multi-repo scans.

### Generated artifacts

Documentation written into the scanned project.

- **codewiki/**: generated docs · Knowledge base directory written into the target project.
- **CLAUDE.md**: generated guidance · Optional merged Claude guidance file written in the target project.

## Connections

- Operator → Claude Code: invokes /codewiki · Starts the local workflow with optional context and scope.
- Claude Code → SKILL.md: loads spec · Uses the skill definition as the workflow controller.
- Claude Code → Templates: loads templates · Uses templates to shape the generated documentation.
- Templates → Architecture: contains · Architecture template file.
- Templates → Service map: contains · Service map template file.
- Templates → Events: contains · Events template file.
- Templates → User flow: contains · User flow template file.
- Templates → Project readme: contains · Generated README template file.
- Templates → CLAUDE.md: contains · CLAUDE.md template file.
- Operator → Target codebase: selects target · Points the workflow at the repository to analyze.
- Operator → External docs: supplies optional URLs · Adds outside context when relevant.
- Claude Code → Code signals: reads · Collects source and configuration signals from the target project.
- External docs → Claude Code: context only · Optional auxiliary information for product understanding.
- Code signals → Compact context: condenses · Large repositories are reduced to compact summaries for continued analysis.
- Compact context → Claude Code: feeds follow-up · Supports iterative scanning and multi-repo orchestration.
- SKILL.md → Claude Code: directs workflow · Specifies scanning, confirmation, and generation behavior.
- Claude Code → codewiki/: writes docs · Generates structured documentation in the target project.
- Claude Code → CLAUDE.md: writes guidance · May generate or merge Claude guidance in the target project.
- Target codebase → Code signals: provides · The analyzed codebase is the source of truth for architecture and flows.
- SKILL.md → README.md: describes · Documents the skill’s usage and operating model.
- SKILL.md → LICENSE: governs · The package is distributed under MIT terms.
