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