mindforge-cc 11.5.0 → 11.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/mindforge/skill-tdd.md +53 -0
- package/.agent/mindforge/skills-index.md +118 -0
- package/.agent/mindforge/systematic-debug.md +60 -0
- package/.agent/skills/1password-skill/SKILL.md +156 -0
- package/.agent/skills/1password-skill/references/cli-examples.md +31 -0
- package/.agent/skills/1password-skill/references/get-started.md +21 -0
- package/.agent/skills/article-illustrator/SKILL.md +199 -0
- package/.agent/skills/article-illustrator/references/prompt-construction.md +426 -0
- package/.agent/skills/article-illustrator/references/style-presets.md +80 -0
- package/.agent/skills/article-illustrator/references/styles.md +224 -0
- package/.agent/skills/article-illustrator/references/usage.md +50 -0
- package/.agent/skills/article-illustrator/references/workflow.md +332 -0
- package/.agent/skills/arxiv/SKILL.md +275 -0
- package/.agent/skills/blogwatcher/SKILL.md +130 -0
- package/.agent/skills/code-wiki/SKILL.md +438 -0
- package/.agent/skills/code-wiki/templates/README.md +31 -0
- package/.agent/skills/code-wiki/templates/architecture.md +30 -0
- package/.agent/skills/code-wiki/templates/getting-started.md +47 -0
- package/.agent/skills/code-wiki/templates/module.md +38 -0
- package/.agent/skills/codebase-inspection/SKILL.md +109 -0
- package/.agent/skills/comic-creator/SKILL.md +240 -0
- package/.agent/skills/comic-creator/references/analysis-framework.md +176 -0
- package/.agent/skills/comic-creator/references/auto-selection.md +71 -0
- package/.agent/skills/comic-creator/references/base-prompt.md +98 -0
- package/.agent/skills/comic-creator/references/character-template.md +180 -0
- package/.agent/skills/comic-creator/references/ohmsha-guide.md +85 -0
- package/.agent/skills/comic-creator/references/partial-workflows.md +106 -0
- package/.agent/skills/comic-creator/references/storyboard-template.md +143 -0
- package/.agent/skills/comic-creator/references/workflow.md +401 -0
- package/.agent/skills/concept-diagrams/SKILL.md +355 -0
- package/.agent/skills/concept-diagrams/references/dashboard-patterns.md +43 -0
- package/.agent/skills/concept-diagrams/references/infrastructure-patterns.md +144 -0
- package/.agent/skills/concept-diagrams/references/physical-shape-cookbook.md +42 -0
- package/.agent/skills/creative-ideation/SKILL.md +144 -0
- package/.agent/skills/creative-ideation/references/full-prompt-library.md +110 -0
- package/.agent/skills/devops-cli/SKILL.md +149 -0
- package/.agent/skills/devops-cli/references/app-discovery.md +112 -0
- package/.agent/skills/devops-cli/references/authentication.md +59 -0
- package/.agent/skills/devops-cli/references/cli-reference.md +104 -0
- package/.agent/skills/devops-cli/references/running-apps.md +171 -0
- package/.agent/skills/devops-watchers/SKILL.md +103 -0
- package/.agent/skills/docker-management/SKILL.md +273 -0
- package/.agent/skills/domain-intel/SKILL.md +96 -0
- package/.agent/skills/duckduckgo-search/SKILL.md +230 -0
- package/.agent/skills/github-auth/SKILL.md +240 -0
- package/.agent/skills/github-code-review/SKILL.md +474 -0
- package/.agent/skills/github-code-review/references/review-output-template.md +74 -0
- package/.agent/skills/github-issues/SKILL.md +363 -0
- package/.agent/skills/github-issues/templates/bug-report.md +35 -0
- package/.agent/skills/github-issues/templates/feature-request.md +31 -0
- package/.agent/skills/github-pr-workflow/SKILL.md +360 -0
- package/.agent/skills/github-pr-workflow/references/ci-troubleshooting.md +183 -0
- package/.agent/skills/github-pr-workflow/references/conventional-commits.md +71 -0
- package/.agent/skills/github-pr-workflow/templates/pr-body-bugfix.md +35 -0
- package/.agent/skills/github-pr-workflow/templates/pr-body-feature.md +33 -0
- package/.agent/skills/github-repo-management/SKILL.md +509 -0
- package/.agent/skills/github-repo-management/references/github-api-cheatsheet.md +161 -0
- package/.agent/skills/godmode/SKILL.md +396 -0
- package/.agent/skills/godmode/references/jailbreak-templates.md +128 -0
- package/.agent/skills/godmode/references/refusal-detection.md +142 -0
- package/.agent/skills/hyperframes/SKILL.md +182 -0
- package/.agent/skills/hyperframes/references/cli.md +185 -0
- package/.agent/skills/hyperframes/references/composition.md +129 -0
- package/.agent/skills/hyperframes/references/features.md +289 -0
- package/.agent/skills/hyperframes/references/gsap.md +136 -0
- package/.agent/skills/hyperframes/references/troubleshooting.md +137 -0
- package/.agent/skills/hyperframes/references/website-to-video.md +145 -0
- package/.agent/skills/jupyter-live-kernel/SKILL.md +160 -0
- package/.agent/skills/kanban-orchestrator/SKILL.md +209 -0
- package/.agent/skills/kanban-worker/SKILL.md +188 -0
- package/.agent/skills/llm-wiki/SKILL.md +499 -0
- package/.agent/skills/meme-generation/SKILL.md +122 -0
- package/.agent/skills/node-inspect-debugger/SKILL.md +312 -0
- package/.agent/skills/obsidian/SKILL.md +60 -0
- package/.agent/skills/osint-investigation/SKILL.md +269 -0
- package/.agent/skills/osint-investigation/templates/source-template.md +59 -0
- package/.agent/skills/oss-forensics/SKILL.md +422 -0
- package/.agent/skills/oss-forensics/references/evidence-types.md +89 -0
- package/.agent/skills/oss-forensics/references/github-archive-guide.md +184 -0
- package/.agent/skills/oss-forensics/references/investigation-templates.md +131 -0
- package/.agent/skills/oss-forensics/references/recovery-techniques.md +164 -0
- package/.agent/skills/oss-forensics/templates/forensic-report.md +151 -0
- package/.agent/skills/oss-forensics/templates/malicious-package-report.md +43 -0
- package/.agent/skills/parallel-cli/SKILL.md +384 -0
- package/.agent/skills/pinggy-tunnel/SKILL.md +302 -0
- package/.agent/skills/pixel-art/SKILL.md +209 -0
- package/.agent/skills/pixel-art/references/palettes.md +49 -0
- package/.agent/skills/plan/SKILL.md +331 -0
- package/.agent/skills/polymarket/SKILL.md +75 -0
- package/.agent/skills/polymarket/references/api-endpoints.md +220 -0
- package/.agent/skills/python-debugpy/SKILL.md +368 -0
- package/.agent/skills/requesting-code-review/SKILL.md +273 -0
- package/.agent/skills/research-paper-writing/SKILL.md +2367 -0
- package/.agent/skills/research-paper-writing/references/autoreason-methodology.md +394 -0
- package/.agent/skills/research-paper-writing/references/checklists.md +434 -0
- package/.agent/skills/research-paper-writing/references/citation-workflow.md +563 -0
- package/.agent/skills/research-paper-writing/references/experiment-patterns.md +728 -0
- package/.agent/skills/research-paper-writing/references/human-evaluation.md +476 -0
- package/.agent/skills/research-paper-writing/references/paper-types.md +481 -0
- package/.agent/skills/research-paper-writing/references/reviewer-guidelines.md +433 -0
- package/.agent/skills/research-paper-writing/references/sources.md +191 -0
- package/.agent/skills/research-paper-writing/references/writing-guide.md +474 -0
- package/.agent/skills/research-paper-writing/templates/README.md +251 -0
- package/.agent/skills/rest-graphql-debug/SKILL.md +507 -0
- package/.agent/skills/s6-container-supervision/SKILL.md +171 -0
- package/.agent/skills/scrapling/SKILL.md +328 -0
- package/.agent/skills/sherlock/SKILL.md +186 -0
- package/.agent/skills/simplify-code/SKILL.md +168 -0
- package/.agent/skills/skill-authoring/SKILL.md +158 -0
- package/.agent/skills/spike/SKILL.md +190 -0
- package/.agent/skills/subagent-driven-development/SKILL.md +345 -0
- package/.agent/skills/subagent-driven-development/references/context-budget-discipline.md +53 -0
- package/.agent/skills/subagent-driven-development/references/gates-taxonomy.md +93 -0
- package/.agent/skills/systematic-debugging/SKILL.md +360 -0
- package/.agent/skills/test-driven-development/SKILL.md +336 -0
- package/.agent/skills/video-orchestrator/SKILL.md +194 -0
- package/.agent/skills/video-orchestrator/references/examples.md +227 -0
- package/.agent/skills/video-orchestrator/references/intake.md +166 -0
- package/.agent/skills/video-orchestrator/references/kanban-setup.md +278 -0
- package/.agent/skills/video-orchestrator/references/monitoring.md +180 -0
- package/.agent/skills/video-orchestrator/references/role-archetypes.md +298 -0
- package/.agent/skills/video-orchestrator/references/tool-matrix.md +317 -0
- package/.agent/skills/web-pentest/SKILL.md +332 -0
- package/.agent/skills/web-pentest/references/bypass-techniques.md +133 -0
- package/.agent/skills/web-pentest/references/exploitation-techniques.md +204 -0
- package/.agent/skills/web-pentest/references/scope-enforcement.md +110 -0
- package/.agent/skills/web-pentest/references/vuln-taxonomy.md +81 -0
- package/.agent/skills/web-pentest/templates/authorization.md +69 -0
- package/.agent/skills/web-pentest/templates/pentest-report.md +178 -0
- package/.claude/commands/mindforge/skill-tdd.md +53 -0
- package/.claude/commands/mindforge/skills-index.md +118 -0
- package/.claude/commands/mindforge/systematic-debug.md +60 -0
- package/.mindforge/config.json +2 -2
- package/.mindforge/memory/sync-manifest.json +1 -1
- package/.mindforge/skills/arxiv/SKILL.md +294 -0
- package/.mindforge/skills/blogwatcher/SKILL.md +147 -0
- package/.mindforge/skills/code-wiki/SKILL.md +457 -0
- package/.mindforge/skills/codebase-inspection/SKILL.md +126 -0
- package/.mindforge/skills/concept-diagrams/SKILL.md +373 -0
- package/.mindforge/skills/creative-ideation/SKILL.md +162 -0
- package/.mindforge/skills/domain-intel/SKILL.md +116 -0
- package/.mindforge/skills/duckduckgo-search/SKILL.md +249 -0
- package/.mindforge/skills/github-code-review/SKILL.md +493 -0
- package/.mindforge/skills/github-issues/SKILL.md +382 -0
- package/.mindforge/skills/github-pr-workflow/SKILL.md +379 -0
- package/.mindforge/skills/jupyter-live-kernel/SKILL.md +179 -0
- package/.mindforge/skills/kanban-orchestrator/SKILL.md +227 -0
- package/.mindforge/skills/kanban-worker/SKILL.md +206 -0
- package/.mindforge/skills/meme-generation/SKILL.md +141 -0
- package/.mindforge/skills/obsidian/SKILL.md +80 -0
- package/.mindforge/skills/osint-investigation/SKILL.md +288 -0
- package/.mindforge/skills/oss-forensics/SKILL.md +421 -0
- package/.mindforge/skills/pixel-art/SKILL.md +228 -0
- package/.mindforge/skills/plan/SKILL.md +350 -0
- package/.mindforge/skills/requesting-code-review/SKILL.md +292 -0
- package/.mindforge/skills/research-paper-writing/SKILL.md +2384 -0
- package/.mindforge/skills/scrapling/SKILL.md +345 -0
- package/.mindforge/skills/sherlock/SKILL.md +203 -0
- package/.mindforge/skills/simplify-code/SKILL.md +187 -0
- package/.mindforge/skills/spike/SKILL.md +209 -0
- package/.mindforge/skills/subagent-driven-development/SKILL.md +364 -0
- package/.mindforge/skills/systematic-debugging/SKILL.md +379 -0
- package/.mindforge/skills/test-driven-development/SKILL.md +355 -0
- package/.mindforge/skills/web-pentest/SKILL.md +327 -0
- package/CHANGELOG.md +88 -0
- package/MINDFORGE.md +3 -3
- package/README.md +38 -3
- package/RELEASENOTES.md +100 -0
- package/bin/dashboard/api-router.js +10 -1
- package/bin/governance/approve.js +5 -1
- package/bin/memory/federated-sync.js +11 -2
- package/bin/memory/knowledge-capture.js +10 -1
- package/bin/memory/pillar-health-tracker.js +9 -1
- package/bin/review/ads-engine.js +2 -2
- package/bin/security/trust-boundaries.js +5 -0
- package/docs/getting-started.md +42 -5
- package/package.json +1 -1
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-wiki
|
|
3
|
+
description: "Generate wiki docs + Mermaid diagrams for any codebase."
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code Wiki Skill
|
|
8
|
+
|
|
9
|
+
Generate a comprehensive wiki for any codebase — overview, architecture, per-module deep-dives, Mermaid class and sequence diagrams. Inspired by Google CodeWiki, but works on local repos, private repos, and any language. Uses only existing tools (`terminal`, `read_file`, `search_files`, `write_file`); no Docker, no external services, no extra dependencies.
|
|
10
|
+
|
|
11
|
+
This skill produces **reference documentation** (what/how). It does not produce strategic narrative (why — that's a different skill).
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- User says "document this codebase", "generate a wiki", "make architecture diagrams"
|
|
16
|
+
- Onboarding to an unfamiliar repo and wants a structured reference
|
|
17
|
+
- User points at a GitHub URL and asks for documentation
|
|
18
|
+
- Need a stable artifact (markdown + Mermaid) that renders on GitHub
|
|
19
|
+
|
|
20
|
+
Do NOT use this for:
|
|
21
|
+
- Single-file or single-function documentation — just answer directly
|
|
22
|
+
- API reference for one specific endpoint — use `read_file` and answer inline
|
|
23
|
+
- Strategic "why does this exist" narrative — different skill, different purpose
|
|
24
|
+
- Codebases the user is actively developing in this session — just answer questions as they come
|
|
25
|
+
|
|
26
|
+
## Prerequisites
|
|
27
|
+
|
|
28
|
+
- No env vars required.
|
|
29
|
+
- `git` on PATH for repo SHA tracking and remote clones.
|
|
30
|
+
- Optional: `pygount` for language-breakdown stats (see the `codebase-inspection` skill).
|
|
31
|
+
|
|
32
|
+
## How to Run
|
|
33
|
+
|
|
34
|
+
Invoke through the `terminal` tool from the target repo's root, then use `read_file` / `search_files` / `write_file` to produce the wiki. Default output location is `~/.agent/wikis/<repo-name>/`. Only write into the repo (`docs/wiki/`) when the user explicitly requests it.
|
|
35
|
+
|
|
36
|
+
## Quick Reference
|
|
37
|
+
|
|
38
|
+
| Step | Action |
|
|
39
|
+
|---|---|
|
|
40
|
+
| 1 | Resolve target — local cwd, given path, or `git clone --depth 50 <url>` to a temp dir |
|
|
41
|
+
| 2 | Scan structure — `ls`, `find -maxdepth 3`, manifest files, README |
|
|
42
|
+
| 3 | Pick 8–10 modules to document |
|
|
43
|
+
| 4 | Write `README.md` (overview + module map) |
|
|
44
|
+
| 5 | Write `architecture.md` with Mermaid flowchart |
|
|
45
|
+
| 6 | Write per-module docs in `modules/` |
|
|
46
|
+
| 7 | Write `diagrams/class-diagram.md` (Mermaid classDiagram) |
|
|
47
|
+
| 8 | Write `diagrams/sequences.md` (Mermaid sequenceDiagram, 2–4 workflows) |
|
|
48
|
+
| 9 | Write `getting-started.md` |
|
|
49
|
+
| 10 | Write `api.md` if applicable, else skip |
|
|
50
|
+
| 11 | Write `.codewiki-state.json` |
|
|
51
|
+
| 12 | Report paths to user |
|
|
52
|
+
|
|
53
|
+
## Procedure
|
|
54
|
+
|
|
55
|
+
### 1. Resolve the target
|
|
56
|
+
|
|
57
|
+
For a GitHub URL:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
WIKI_TMP=$(mktemp -d)
|
|
61
|
+
git clone --depth 50 <url> "$WIKI_TMP/repo"
|
|
62
|
+
cd "$WIKI_TMP/repo"
|
|
63
|
+
REPO_SHA=$(git rev-parse HEAD)
|
|
64
|
+
REPO_NAME=$(basename <url> .git)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
For a local path (or cwd if none given):
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cd <path>
|
|
71
|
+
REPO_SHA=$(git rev-parse HEAD 2>/dev/null || echo "uncommitted")
|
|
72
|
+
REPO_NAME=$(basename "$PWD")
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then set the output dir:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
OUTPUT_DIR="$HOME/.hermes/wikis/$REPO_NAME"
|
|
79
|
+
mkdir -p "$OUTPUT_DIR/modules" "$OUTPUT_DIR/diagrams"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 2. Scan repo structure
|
|
83
|
+
|
|
84
|
+
Use the `terminal` tool for the shell work, `read_file` for manifests:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Shallow tree first
|
|
88
|
+
ls -la
|
|
89
|
+
|
|
90
|
+
# Deeper tree, noise filtered
|
|
91
|
+
find . -type d \
|
|
92
|
+
-not -path '*/\.*' \
|
|
93
|
+
-not -path '*/node_modules*' \
|
|
94
|
+
-not -path '*/venv*' \
|
|
95
|
+
-not -path '*/__pycache__*' \
|
|
96
|
+
-not -path '*/dist*' \
|
|
97
|
+
-not -path '*/build*' \
|
|
98
|
+
-not -path '*/target*' \
|
|
99
|
+
-maxdepth 3 | sort
|
|
100
|
+
|
|
101
|
+
# Language breakdown (skip if pygount unavailable)
|
|
102
|
+
pygount --format=summary \
|
|
103
|
+
--folders-to-skip=".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,target" \
|
|
104
|
+
. 2>/dev/null || true
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Then `read_file` the relevant manifests (`package.json`, `pyproject.toml`, `setup.py`, `Cargo.toml`, `go.mod`, `pom.xml`, `build.gradle`) and the project README. Use `search_files target='files'` to find them rather than guessing names.
|
|
108
|
+
|
|
109
|
+
### 3. Pick modules to document
|
|
110
|
+
|
|
111
|
+
Cap initial pass at **8–10 modules**. Heuristics by language:
|
|
112
|
+
|
|
113
|
+
- Python: top-level packages (dirs with `__init__.py`), plus subsystem dirs
|
|
114
|
+
- JS/TS: `src/<subdir>`, top-level workspace dirs
|
|
115
|
+
- Rust: each crate in a workspace, or top-level `src/<module>` dirs
|
|
116
|
+
- Go: each top-level package directory
|
|
117
|
+
- Mixed/unfamiliar: top-level directories that contain source code (not config, not tests)
|
|
118
|
+
|
|
119
|
+
For very large repos, prioritize by:
|
|
120
|
+
1. Imported-from count (a module imported by many is core)
|
|
121
|
+
2. LOC (bigger modules usually warrant their own doc)
|
|
122
|
+
3. Mentions in README / top-level docs
|
|
123
|
+
|
|
124
|
+
State the module list to the user before generating per-module docs on big repos — gives them a chance to redirect.
|
|
125
|
+
|
|
126
|
+
### 4. Write `README.md`
|
|
127
|
+
|
|
128
|
+
`read_file` the actual project README plus the top 2–3 entry-point files. Then `write_file`:
|
|
129
|
+
|
|
130
|
+
````markdown
|
|
131
|
+
# <Project Name>
|
|
132
|
+
|
|
133
|
+
<One paragraph: what it is and what it's for. Self-contained — don't assume the
|
|
134
|
+
reader has the source README.>
|
|
135
|
+
|
|
136
|
+
## Key Concepts
|
|
137
|
+
|
|
138
|
+
- **<Concept 1>** — <one line>
|
|
139
|
+
- **<Concept 2>** — <one line>
|
|
140
|
+
|
|
141
|
+
## Entry Points
|
|
142
|
+
|
|
143
|
+
- [`path/to/main.py`](<link>) — <what runs when you start it>
|
|
144
|
+
- [`path/to/cli.py`](<link>) — <CLI surface>
|
|
145
|
+
|
|
146
|
+
## High-Level Architecture
|
|
147
|
+
|
|
148
|
+
<2-3 sentences. Detail goes in architecture.md.>
|
|
149
|
+
|
|
150
|
+
See [architecture.md](architecture.md).
|
|
151
|
+
|
|
152
|
+
## Module Map
|
|
153
|
+
|
|
154
|
+
| Module | Purpose |
|
|
155
|
+
|---|---|
|
|
156
|
+
| [`<module>`](modules/<module>.md) | <one-line purpose> |
|
|
157
|
+
|
|
158
|
+
## Getting Started
|
|
159
|
+
|
|
160
|
+
See [getting-started.md](getting-started.md).
|
|
161
|
+
````
|
|
162
|
+
|
|
163
|
+
For link targets in local mode use relative paths. For cloned repos use `https://github.com/<owner>/<repo>/blob/<sha>/<path>` so links survive future commits.
|
|
164
|
+
|
|
165
|
+
### 5. Write `architecture.md`
|
|
166
|
+
|
|
167
|
+
````markdown
|
|
168
|
+
# Architecture
|
|
169
|
+
|
|
170
|
+
<2-3 paragraphs: shape of the system. What talks to what. Where data enters,
|
|
171
|
+
where it exits, where state lives.>
|
|
172
|
+
|
|
173
|
+
## Components
|
|
174
|
+
|
|
175
|
+
- **<Component>** — <1-2 sentences>. See [`modules/<module>.md`](modules/<module>.md).
|
|
176
|
+
|
|
177
|
+
## System Diagram
|
|
178
|
+
|
|
179
|
+
```mermaid
|
|
180
|
+
flowchart TD
|
|
181
|
+
User([User]) --> Entry[Entry Point]
|
|
182
|
+
Entry --> Core[Core Engine]
|
|
183
|
+
Core --> StorageA[(Database)]
|
|
184
|
+
Core --> ExternalAPI{{External API}}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Data Flow
|
|
188
|
+
|
|
189
|
+
1. **<Step>** — [`<file>`](<link>)
|
|
190
|
+
2. **<Step>** — [`<file>`](<link>)
|
|
191
|
+
|
|
192
|
+
## Key Design Decisions
|
|
193
|
+
|
|
194
|
+
- <Anything load-bearing the reader should know>
|
|
195
|
+
````
|
|
196
|
+
|
|
197
|
+
**Mermaid shape semantics:**
|
|
198
|
+
- `[]` = component
|
|
199
|
+
- `[()]` = database / storage
|
|
200
|
+
- `{{}}` = external service
|
|
201
|
+
- `(())` = entry point or terminal
|
|
202
|
+
- `-->` = sync call, `-.->` = async/event
|
|
203
|
+
|
|
204
|
+
Cap at ~20 nodes per diagram. Split into sub-diagrams if larger.
|
|
205
|
+
|
|
206
|
+
### 6. Write per-module docs in `modules/`
|
|
207
|
+
|
|
208
|
+
For each selected module, inspect its layout with `ls`, identify 3–5 most important files (by size, by being named `core.py` / `main.py` / `__init__.py`, by being imported a lot), then `read_file` those files (use `offset` / `limit` to read only what you need; prefer `search_files` for specific symbols).
|
|
209
|
+
|
|
210
|
+
````markdown
|
|
211
|
+
# Module: `<module>`
|
|
212
|
+
|
|
213
|
+
<1-2 sentence purpose.>
|
|
214
|
+
|
|
215
|
+
## Responsibilities
|
|
216
|
+
|
|
217
|
+
- <bullet>
|
|
218
|
+
- <bullet>
|
|
219
|
+
|
|
220
|
+
## Key Files
|
|
221
|
+
|
|
222
|
+
- [`<module>/<file>`](<link>) — <what it does>
|
|
223
|
+
|
|
224
|
+
## Public API
|
|
225
|
+
|
|
226
|
+
<Functions/classes/constants other code uses. Group related items. Show
|
|
227
|
+
signatures, not full implementations.>
|
|
228
|
+
|
|
229
|
+
## Internal Structure
|
|
230
|
+
|
|
231
|
+
<How the module is organized internally. State management.>
|
|
232
|
+
|
|
233
|
+
## Dependencies
|
|
234
|
+
|
|
235
|
+
- **Used by:** <other modules>
|
|
236
|
+
- **Uses:** <other modules + external libs>
|
|
237
|
+
|
|
238
|
+
## Notable Patterns / Gotchas
|
|
239
|
+
|
|
240
|
+
- <Anything non-obvious>
|
|
241
|
+
````
|
|
242
|
+
|
|
243
|
+
### 7. Write `diagrams/class-diagram.md`
|
|
244
|
+
|
|
245
|
+
Pick the 5–10 most important classes/types. `read_file` them, then write:
|
|
246
|
+
|
|
247
|
+
````markdown
|
|
248
|
+
# Class Diagram
|
|
249
|
+
|
|
250
|
+
## Core Types
|
|
251
|
+
|
|
252
|
+
```mermaid
|
|
253
|
+
classDiagram
|
|
254
|
+
class Agent {
|
|
255
|
+
+string name
|
|
256
|
+
+list~Tool~ tools
|
|
257
|
+
+chat(message) string
|
|
258
|
+
}
|
|
259
|
+
class Tool {
|
|
260
|
+
<<interface>>
|
|
261
|
+
+name string
|
|
262
|
+
+execute(args) any
|
|
263
|
+
}
|
|
264
|
+
Agent --> Tool : uses
|
|
265
|
+
Tool <|-- TerminalTool
|
|
266
|
+
Tool <|-- WebTool
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Notes
|
|
270
|
+
|
|
271
|
+
<Anything the diagram can't express — lifecycle, threading, etc.>
|
|
272
|
+
````
|
|
273
|
+
|
|
274
|
+
For languages without classes (Go, C, Rust): use the diagram for struct relationships, or skip class-diagram.md and explain it in prose in architecture.md. Don't force-fit.
|
|
275
|
+
|
|
276
|
+
### 8. Write `diagrams/sequences.md`
|
|
277
|
+
|
|
278
|
+
Pick 2–4 of the most important workflows. Trace each call path through the code (read entry point, follow function calls), then:
|
|
279
|
+
|
|
280
|
+
````markdown
|
|
281
|
+
# Sequence Diagrams
|
|
282
|
+
|
|
283
|
+
## Workflow: <Name>
|
|
284
|
+
|
|
285
|
+
<1 sentence describing what this does and when it runs.>
|
|
286
|
+
|
|
287
|
+
```mermaid
|
|
288
|
+
sequenceDiagram
|
|
289
|
+
participant User
|
|
290
|
+
participant CLI
|
|
291
|
+
participant Agent
|
|
292
|
+
participant LLM
|
|
293
|
+
User->>CLI: types message
|
|
294
|
+
CLI->>Agent: chat(message)
|
|
295
|
+
Agent->>LLM: API call
|
|
296
|
+
LLM-->>Agent: response + tool_calls
|
|
297
|
+
Agent->>Agent: execute tools
|
|
298
|
+
Agent-->>CLI: final response
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Walkthrough
|
|
302
|
+
|
|
303
|
+
1. **User input** — [`cli.py:run_session`](<link>)
|
|
304
|
+
2. **Message dispatch** — [`run_agent.py:AIAgent.chat`](<link>)
|
|
305
|
+
````
|
|
306
|
+
|
|
307
|
+
Don't invent participants. Every box must correspond to a real component the reader can find in the code.
|
|
308
|
+
|
|
309
|
+
### 9. Write `getting-started.md`
|
|
310
|
+
|
|
311
|
+
````markdown
|
|
312
|
+
# Getting Started
|
|
313
|
+
|
|
314
|
+
## Prerequisites
|
|
315
|
+
|
|
316
|
+
<From manifest files + README. Be specific — versions if pinned.>
|
|
317
|
+
|
|
318
|
+
## Installation
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
<exact commands>
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
## First Run
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
<minimum command to see the system do something useful>
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
## Common Workflows
|
|
331
|
+
|
|
332
|
+
### <Workflow 1>
|
|
333
|
+
<commands>
|
|
334
|
+
|
|
335
|
+
## Configuration
|
|
336
|
+
|
|
337
|
+
- `<config-file>` — <what it controls>
|
|
338
|
+
- Env var `<VAR>` — <what it controls>
|
|
339
|
+
|
|
340
|
+
## Where to Go Next
|
|
341
|
+
|
|
342
|
+
- Architecture: [architecture.md](architecture.md)
|
|
343
|
+
- Module reference: [README.md#module-map](README.md#module-map)
|
|
344
|
+
````
|
|
345
|
+
|
|
346
|
+
### 10. Write `api.md` (skip if not applicable)
|
|
347
|
+
|
|
348
|
+
Only write this if the project is a library or API server. If it is:
|
|
349
|
+
|
|
350
|
+
- Find the public API surface (`__init__.py` exports, OpenAPI specs, route handlers, exported types)
|
|
351
|
+
- Document each public entry with signature, parameters, return type, one-line description
|
|
352
|
+
- Group by category
|
|
353
|
+
|
|
354
|
+
### 11. Write the state file
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
cat > "$OUTPUT_DIR/.codewiki-state.json" <<EOF
|
|
358
|
+
{
|
|
359
|
+
"repo_name": "$REPO_NAME",
|
|
360
|
+
"source_path": "$PWD",
|
|
361
|
+
"source_sha": "$REPO_SHA",
|
|
362
|
+
"generated_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
|
|
363
|
+
"generator": "
|
|
364
|
+
"modules_documented": []
|
|
365
|
+
}
|
|
366
|
+
EOF
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### 12. Report to user
|
|
370
|
+
|
|
371
|
+
State exactly what was generated and where:
|
|
372
|
+
|
|
373
|
+
```
|
|
374
|
+
Generated wiki at ~/.agent/wikis/<repo-name>/:
|
|
375
|
+
README.md project overview, module map
|
|
376
|
+
architecture.md system architecture + flowchart
|
|
377
|
+
getting-started.md setup, first run, workflows
|
|
378
|
+
modules/<N files> per-module deep-dives
|
|
379
|
+
diagrams/architecture.md Mermaid flowchart
|
|
380
|
+
diagrams/class-diagram.md Mermaid class diagram
|
|
381
|
+
diagrams/sequences.md Mermaid sequence diagrams
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
If you cloned to a temp dir, remind the user it can be removed (`rm -rf "$WIKI_TMP"`) after they've reviewed the wiki.
|
|
385
|
+
|
|
386
|
+
## Scope Control
|
|
387
|
+
|
|
388
|
+
Generating a full wiki for a 500K-LOC monorepo is wildly token-expensive. Default to bounded scope:
|
|
389
|
+
|
|
390
|
+
- Initial scan: max depth 3 directories
|
|
391
|
+
- Per-module docs: cap at 10 modules unless user expands scope
|
|
392
|
+
- Per-file reads: prefer `search_files` for symbols + `read_file` with `offset`/`limit` over full reads
|
|
393
|
+
- Skip vendored code (`vendor/`, `third_party/`, generated code, `_pb2.py`, `.min.js`)
|
|
394
|
+
|
|
395
|
+
If the user says "do the whole thing exhaustively", believe them — but ballpark the cost first: "this repo has ~340 source files, comprehensive coverage will be expensive — confirm?"
|
|
396
|
+
|
|
397
|
+
## Re-Run / Update
|
|
398
|
+
|
|
399
|
+
If `.codewiki-state.json` already exists at the target path:
|
|
400
|
+
|
|
401
|
+
- Read it for previous SHA and module list
|
|
402
|
+
- If source SHA matches: ask user if they want to regenerate or skip
|
|
403
|
+
- If SHA differs: offer to regenerate only modules with changed files (`git diff --name-only <old-sha> HEAD`)
|
|
404
|
+
|
|
405
|
+
Full incremental-regeneration is a future enhancement — for now, regenerating the whole thing is acceptable.
|
|
406
|
+
|
|
407
|
+
## Pitfalls
|
|
408
|
+
|
|
409
|
+
- **Fabricating components.** Every diagram node and claimed function call must be in the source. `read_file` before writing. The single biggest failure mode for auto-generated docs is plausible-sounding fabrication.
|
|
410
|
+
- **Generic AI prose.** "This module is responsible for..." is content-free. Say what the module actually does in domain-specific terms.
|
|
411
|
+
- **Restating code as prose.** A module doc that says "the `process` function processes things by calling `process_item` on each item" is worse than just linking to the function.
|
|
412
|
+
- **Mermaid > 50 nodes.** They don't render legibly. Split them.
|
|
413
|
+
- **Documenting tests, generated code, or vendored deps as if they were product code.** Skip them.
|
|
414
|
+
- **In-repo output without asking.** Default is `~/.agent/wikis/`. Only write into the repo when the user explicitly requests it.
|
|
415
|
+
- **Mermaid special chars need quotes:** `A["Tool / Agent"]` not `A[Tool / Agent]`. `<br>` for line breaks inside a node.
|
|
416
|
+
- **Nested code fences in SKILL.md.** When writing a markdown example that contains a Mermaid block, use 4-backtick outer fences so the 3-backtick inner ` ```mermaid ` doesn't close the outer. (This SKILL.md does it.)
|
|
417
|
+
- **classDiagram generics** render as `~T~` (e.g. `List~Tool~`), not `<T>`.
|
|
418
|
+
- **GitHub Mermaid theme is fixed** — don't include `%%{init: ...}%%` blocks; they're stripped on render.
|
|
419
|
+
|
|
420
|
+
## Verification
|
|
421
|
+
|
|
422
|
+
After writing, verify:
|
|
423
|
+
|
|
424
|
+
1. **Mermaid blocks balance** — opens equal closes per file:
|
|
425
|
+
```bash
|
|
426
|
+
for f in "$OUTPUT_DIR"/diagrams/*.md "$OUTPUT_DIR"/architecture.md; do
|
|
427
|
+
opens=$(grep -c '^```mermaid' "$f")
|
|
428
|
+
total=$(grep -c '^```' "$f")
|
|
429
|
+
echo "$f: $opens mermaid blocks, $total total fences (expect total = opens*2)"
|
|
430
|
+
done
|
|
431
|
+
```
|
|
432
|
+
2. **All expected files exist** —
|
|
433
|
+
```bash
|
|
434
|
+
ls "$OUTPUT_DIR"/{README.md,architecture.md,getting-started.md,.codewiki-state.json} \
|
|
435
|
+
"$OUTPUT_DIR"/modules/ "$OUTPUT_DIR"/diagrams/
|
|
436
|
+
```
|
|
437
|
+
3. **Module count matches what you intended** — `ls "$OUTPUT_DIR/modules" | wc -l` should equal the number of modules you committed to in Step 3.
|
|
438
|
+
4. **No fabricated paths** — sanity-check 2–3 source links resolve to real files.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
{{ONE_PARAGRAPH_DESCRIPTION}}
|
|
4
|
+
|
|
5
|
+
## Key Concepts
|
|
6
|
+
|
|
7
|
+
- **{{CONCEPT_1}}** — {{ONE_LINE}}
|
|
8
|
+
- **{{CONCEPT_2}}** — {{ONE_LINE}}
|
|
9
|
+
- **{{CONCEPT_3}}** — {{ONE_LINE}}
|
|
10
|
+
|
|
11
|
+
## Entry Points
|
|
12
|
+
|
|
13
|
+
- [`{{PATH_1}}`]({{LINK_1}}) — {{WHAT_IT_DOES}}
|
|
14
|
+
- [`{{PATH_2}}`]({{LINK_2}}) — {{WHAT_IT_DOES}}
|
|
15
|
+
|
|
16
|
+
## High-Level Architecture
|
|
17
|
+
|
|
18
|
+
{{TWO_TO_THREE_SENTENCES}}
|
|
19
|
+
|
|
20
|
+
See [architecture.md](architecture.md) for the full picture.
|
|
21
|
+
|
|
22
|
+
## Module Map
|
|
23
|
+
|
|
24
|
+
| Module | Purpose |
|
|
25
|
+
|---|---|
|
|
26
|
+
| [`{{MODULE_1}}`](modules/{{MODULE_1}}.md) | {{ONE_LINE_PURPOSE}} |
|
|
27
|
+
| [`{{MODULE_2}}`](modules/{{MODULE_2}}.md) | {{ONE_LINE_PURPOSE}} |
|
|
28
|
+
|
|
29
|
+
## Getting Started
|
|
30
|
+
|
|
31
|
+
See [getting-started.md](getting-started.md).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
{{TWO_TO_THREE_PARAGRAPHS_SHAPE_OF_SYSTEM}}
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
- **{{COMPONENT_1}}** — {{ONE_TO_TWO_SENTENCES}} See [`modules/{{MODULE}}.md`](modules/{{MODULE}}.md).
|
|
8
|
+
- **{{COMPONENT_2}}** — {{ONE_TO_TWO_SENTENCES}}
|
|
9
|
+
|
|
10
|
+
## System Diagram
|
|
11
|
+
|
|
12
|
+
```mermaid
|
|
13
|
+
flowchart TD
|
|
14
|
+
User([User]) --> Entry[Entry Point]
|
|
15
|
+
Entry --> Core[Core Engine]
|
|
16
|
+
Core --> StorageA[(Database)]
|
|
17
|
+
Core --> ExternalAPI{{External API}}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Data Flow
|
|
21
|
+
|
|
22
|
+
1. **{{STEP_1}}** — [`{{FILE}}`]({{LINK}})
|
|
23
|
+
2. **{{STEP_2}}** — [`{{FILE}}`]({{LINK}})
|
|
24
|
+
3. **{{STEP_3}}** — [`{{FILE}}`]({{LINK}})
|
|
25
|
+
|
|
26
|
+
## Key Design Decisions
|
|
27
|
+
|
|
28
|
+
- {{DECISION_1}}
|
|
29
|
+
- {{DECISION_2}}
|
|
30
|
+
- {{DECISION_3}}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
|
|
5
|
+
- {{LANGUAGE_RUNTIME_VERSION}}
|
|
6
|
+
- {{DEPENDENCY}}
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
{{INSTALL_COMMANDS}}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## First Run
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
{{FIRST_RUN_COMMAND}}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
You should see {{EXPECTED_OUTPUT}}.
|
|
21
|
+
|
|
22
|
+
## Common Workflows
|
|
23
|
+
|
|
24
|
+
### {{WORKFLOW_1}}
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
{{COMMANDS}}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### {{WORKFLOW_2}}
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
{{COMMANDS}}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Configuration
|
|
37
|
+
|
|
38
|
+
Key config files and settings:
|
|
39
|
+
|
|
40
|
+
- `{{CONFIG_FILE}}` — {{WHAT_IT_CONTROLS}}
|
|
41
|
+
- Env var `{{VAR}}` — {{WHAT_IT_CONTROLS}}
|
|
42
|
+
|
|
43
|
+
## Where to Go Next
|
|
44
|
+
|
|
45
|
+
- Architecture overview: [architecture.md](architecture.md)
|
|
46
|
+
- Module reference: [README.md#module-map](README.md#module-map)
|
|
47
|
+
- Diagrams: [diagrams/](diagrams/)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Module: `{{MODULE_NAME}}`
|
|
2
|
+
|
|
3
|
+
{{ONE_TO_TWO_SENTENCE_PURPOSE}}
|
|
4
|
+
|
|
5
|
+
## Responsibilities
|
|
6
|
+
|
|
7
|
+
- {{BULLET_1}}
|
|
8
|
+
- {{BULLET_2}}
|
|
9
|
+
- {{BULLET_3}}
|
|
10
|
+
|
|
11
|
+
## Key Files
|
|
12
|
+
|
|
13
|
+
- [`{{PATH_1}}`]({{LINK_1}}) — {{WHAT_IT_DOES}}
|
|
14
|
+
- [`{{PATH_2}}`]({{LINK_2}}) — {{WHAT_IT_DOES}}
|
|
15
|
+
|
|
16
|
+
## Public API
|
|
17
|
+
|
|
18
|
+
### `{{FUNCTION_NAME}}({{SIGNATURE}})`
|
|
19
|
+
|
|
20
|
+
{{ONE_LINE_DESCRIPTION}}
|
|
21
|
+
|
|
22
|
+
**Parameters:**
|
|
23
|
+
- `{{PARAM}}` ({{TYPE}}) — {{DESCRIPTION}}
|
|
24
|
+
|
|
25
|
+
**Returns:** {{TYPE}} — {{DESCRIPTION}}
|
|
26
|
+
|
|
27
|
+
## Internal Structure
|
|
28
|
+
|
|
29
|
+
{{HOW_THE_MODULE_IS_ORGANIZED}}
|
|
30
|
+
|
|
31
|
+
## Dependencies
|
|
32
|
+
|
|
33
|
+
- **Used by:** {{OTHER_MODULES}}
|
|
34
|
+
- **Uses:** {{OTHER_MODULES_AND_LIBS}}
|
|
35
|
+
|
|
36
|
+
## Notable Patterns / Gotchas
|
|
37
|
+
|
|
38
|
+
- {{ANYTHING_NON_OBVIOUS}}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codebase-inspection
|
|
3
|
+
description: "Inspect codebases w/ pygount: LOC, languages, ratios."
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
prerequisites:
|
|
6
|
+
commands: [pygount]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Codebase Inspection with pygount
|
|
10
|
+
|
|
11
|
+
Analyze repositories for lines of code, language breakdown, file counts, and code-vs-comment ratios using `pygount`.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- User asks for LOC (lines of code) count
|
|
16
|
+
- User wants a language breakdown of a repo
|
|
17
|
+
- User asks about codebase size or composition
|
|
18
|
+
- User wants code-vs-comment ratios
|
|
19
|
+
- General "how big is this repo" questions
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install --break-system-packages pygount 2>/dev/null || pip install pygount
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 1. Basic Summary (Most Common)
|
|
28
|
+
|
|
29
|
+
Get a full language breakdown with file counts, code lines, and comment lines:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
cd /path/to/repo
|
|
33
|
+
pygount --format=summary \
|
|
34
|
+
--folders-to-skip=".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,.next,.tox,.eggs,*.egg-info" \
|
|
35
|
+
.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**IMPORTANT:** Always use `--folders-to-skip` to exclude dependency/build directories, otherwise pygount will crawl them and take a very long time or hang.
|
|
39
|
+
|
|
40
|
+
## 2. Common Folder Exclusions
|
|
41
|
+
|
|
42
|
+
Adjust based on the project type:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Python projects
|
|
46
|
+
--folders-to-skip=".git,venv,.venv,__pycache__,.cache,dist,build,.tox,.eggs,.mypy_cache"
|
|
47
|
+
|
|
48
|
+
# JavaScript/TypeScript projects
|
|
49
|
+
--folders-to-skip=".git,node_modules,dist,build,.next,.cache,.turbo,coverage"
|
|
50
|
+
|
|
51
|
+
# General catch-all
|
|
52
|
+
--folders-to-skip=".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,.next,.tox,vendor,third_party"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 3. Filter by Specific Language
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Only count Python files
|
|
59
|
+
pygount --suffix=py --format=summary .
|
|
60
|
+
|
|
61
|
+
# Only count Python and YAML
|
|
62
|
+
pygount --suffix=py,yaml,yml --format=summary .
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 4. Detailed File-by-File Output
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Default format shows per-file breakdown
|
|
69
|
+
pygount --folders-to-skip=".git,node_modules,venv" .
|
|
70
|
+
|
|
71
|
+
# Sort by code lines (pipe through sort)
|
|
72
|
+
pygount --folders-to-skip=".git,node_modules,venv" . | sort -t$'\t' -k1 -nr | head -20
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 5. Output Formats
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Summary table (default recommendation)
|
|
79
|
+
pygount --format=summary .
|
|
80
|
+
|
|
81
|
+
# JSON output for programmatic use
|
|
82
|
+
pygount --format=json .
|
|
83
|
+
|
|
84
|
+
# Pipe-friendly: Language, file count, code, docs, empty, string
|
|
85
|
+
pygount --format=summary . 2>/dev/null
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 6. Interpreting Results
|
|
89
|
+
|
|
90
|
+
The summary table columns:
|
|
91
|
+
- **Language** — detected programming language
|
|
92
|
+
- **Files** — number of files of that language
|
|
93
|
+
- **Code** — lines of actual code (executable/declarative)
|
|
94
|
+
- **Comment** — lines that are comments or documentation
|
|
95
|
+
- **%** — percentage of total
|
|
96
|
+
|
|
97
|
+
Special pseudo-languages:
|
|
98
|
+
- `__empty__` — empty files
|
|
99
|
+
- `__binary__` — binary files (images, compiled, etc.)
|
|
100
|
+
- `__generated__` — auto-generated files (detected heuristically)
|
|
101
|
+
- `__duplicate__` — files with identical content
|
|
102
|
+
- `__unknown__` — unrecognized file types
|
|
103
|
+
|
|
104
|
+
## Pitfalls
|
|
105
|
+
|
|
106
|
+
1. **Always exclude .git, node_modules, venv** — without `--folders-to-skip`, pygount will crawl everything and may take minutes or hang on large dependency trees.
|
|
107
|
+
2. **Markdown shows 0 code lines** — pygount classifies all Markdown content as comments, not code. This is expected behavior.
|
|
108
|
+
3. **JSON files show low code counts** — pygount may count JSON lines conservatively. For accurate JSON line counts, use `wc -l` directly.
|
|
109
|
+
4. **Large monorepos** — for very large repos, consider using `--suffix` to target specific languages rather than scanning everything.
|