supermind-claude 2.0.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/.env.example +5 -0
- package/README.md +77 -0
- package/airis/docker-compose.yml +76 -0
- package/airis/mcp-config.json +43 -0
- package/cli/commands/approve.js +72 -0
- package/cli/commands/doctor.js +101 -0
- package/cli/commands/install.js +85 -0
- package/cli/commands/uninstall.js +75 -0
- package/cli/commands/update.js +52 -0
- package/cli/index.js +69 -0
- package/cli/lib/hooks.js +66 -0
- package/cli/lib/logger.js +38 -0
- package/cli/lib/mcp.js +112 -0
- package/cli/lib/platform.js +31 -0
- package/cli/lib/plugins.js +19 -0
- package/cli/lib/settings.js +158 -0
- package/cli/lib/skills.js +70 -0
- package/cli/lib/templates.js +24 -0
- package/hooks/bash-permissions.js +430 -0
- package/hooks/cost-tracker.js +26 -0
- package/hooks/session-end.js +82 -0
- package/hooks/session-start.js +162 -0
- package/hooks/statusline-command.js +234 -0
- package/package.json +26 -0
- package/skills/supermind/SKILL.md +13 -0
- package/skills/supermind-init/SKILL.md +174 -0
- package/skills/supermind-init/architecture-template.md +48 -0
- package/skills/supermind-init/design-template.md +43 -0
- package/skills/supermind-living-docs/SKILL.md +55 -0
- package/templates/CLAUDE.md +100 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Claude Code status line — sleek terminal aesthetic
|
|
3
|
+
// Two-line display with box-drawing chars, context bar gradient, subagent tracking
|
|
4
|
+
|
|
5
|
+
const { execSync } = require("child_process");
|
|
6
|
+
const { readFileSync, statSync, openSync, readSync, closeSync } = require("fs");
|
|
7
|
+
const { join } = require("path");
|
|
8
|
+
|
|
9
|
+
let input = "";
|
|
10
|
+
process.stdin.setEncoding("utf8");
|
|
11
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
12
|
+
process.stdin.on("end", () => {
|
|
13
|
+
let data = {};
|
|
14
|
+
try { data = JSON.parse(input); } catch {}
|
|
15
|
+
|
|
16
|
+
// ─── Data collection ────────────────────────────────────────────────────
|
|
17
|
+
|
|
18
|
+
const user = process.env.USER || process.env.USERNAME || "user";
|
|
19
|
+
const host = process.env.HOSTNAME || process.env.COMPUTERNAME || "";
|
|
20
|
+
|
|
21
|
+
// Working directory (normalize to Unix slashes for display)
|
|
22
|
+
let cwd = data?.workspace?.current_dir || data?.cwd || process.cwd();
|
|
23
|
+
let cwdUnix = cwd.replace(/\\/g, "/");
|
|
24
|
+
const home = (process.env.HOME || process.env.USERPROFILE || "").replace(/\\/g, "/");
|
|
25
|
+
let cwdDisplay = cwdUnix;
|
|
26
|
+
if (home && cwdDisplay.startsWith(home)) cwdDisplay = "~" + cwdDisplay.slice(home.length);
|
|
27
|
+
|
|
28
|
+
const model = data?.model?.display_name || process.env.CLAUDE_MODEL_NAME || "";
|
|
29
|
+
|
|
30
|
+
// Git branch (symbolic-ref with short hash fallback)
|
|
31
|
+
let gitBranch = "";
|
|
32
|
+
try {
|
|
33
|
+
gitBranch = execSync("git symbolic-ref --short HEAD", {
|
|
34
|
+
cwd: cwdUnix, encoding: "utf8", timeout: 2000, stdio: ["pipe", "pipe", "pipe"],
|
|
35
|
+
}).trim();
|
|
36
|
+
} catch {
|
|
37
|
+
try {
|
|
38
|
+
gitBranch = execSync("git rev-parse --short HEAD", {
|
|
39
|
+
cwd: cwdUnix, encoding: "utf8", timeout: 2000, stdio: ["pipe", "pipe", "pipe"],
|
|
40
|
+
}).trim();
|
|
41
|
+
} catch {}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Thinking level from settings
|
|
45
|
+
let thinkingLevel = "";
|
|
46
|
+
try {
|
|
47
|
+
const sp = join(process.env.HOME || process.env.USERPROFILE, ".claude", "settings.json");
|
|
48
|
+
const s = JSON.parse(readFileSync(sp, "utf8"));
|
|
49
|
+
if (s.alwaysThinkingEnabled) thinkingLevel = s.effortLevel || "on";
|
|
50
|
+
} catch {}
|
|
51
|
+
|
|
52
|
+
// Supabase project ref from .mcp.json
|
|
53
|
+
let supabaseRef = "";
|
|
54
|
+
try {
|
|
55
|
+
const mcp = JSON.parse(readFileSync(join(cwdUnix, ".mcp.json"), "utf8"));
|
|
56
|
+
const url = mcp?.mcpServers?.supabase?.url || "";
|
|
57
|
+
const m = url.match(/project_ref=([a-z0-9]+)/);
|
|
58
|
+
if (m) supabaseRef = m[1];
|
|
59
|
+
} catch {}
|
|
60
|
+
|
|
61
|
+
// ─── Subagent detection (parse transcript tail) ─────────────────────────
|
|
62
|
+
|
|
63
|
+
let activeAgents = [];
|
|
64
|
+
try {
|
|
65
|
+
const tp = data?.transcript_path;
|
|
66
|
+
if (tp) {
|
|
67
|
+
const tpUnix = tp.replace(/\\/g, "/");
|
|
68
|
+
const stat = statSync(tpUnix);
|
|
69
|
+
const TAIL_BYTES = Math.min(stat.size, 128 * 1024); // read last 128KB
|
|
70
|
+
const buf = Buffer.alloc(TAIL_BYTES);
|
|
71
|
+
const fd = openSync(tpUnix, "r");
|
|
72
|
+
readSync(fd, buf, 0, TAIL_BYTES, stat.size - TAIL_BYTES);
|
|
73
|
+
closeSync(fd);
|
|
74
|
+
const tail = buf.toString("utf8");
|
|
75
|
+
|
|
76
|
+
// Split into lines, skip partial first line if we didn't read from start
|
|
77
|
+
const lines = tail.split("\n");
|
|
78
|
+
if (stat.size > TAIL_BYTES) lines.shift();
|
|
79
|
+
|
|
80
|
+
const agentCalls = new Map(); // tool_use id -> description
|
|
81
|
+
const completedIds = new Set();
|
|
82
|
+
|
|
83
|
+
for (const line of lines) {
|
|
84
|
+
if (!line) continue;
|
|
85
|
+
try {
|
|
86
|
+
const entry = JSON.parse(line);
|
|
87
|
+
// Find Agent tool_use in assistant messages
|
|
88
|
+
if (entry.type === "assistant" && entry.message?.content) {
|
|
89
|
+
for (const c of entry.message.content) {
|
|
90
|
+
if (c.type === "tool_use" && c.name === "Agent") {
|
|
91
|
+
agentCalls.set(c.id, c.input?.description || "agent");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Find tool_result matching agent calls
|
|
96
|
+
if (entry.type === "user" && entry.message?.content) {
|
|
97
|
+
const arr = Array.isArray(entry.message.content) ? entry.message.content : [];
|
|
98
|
+
for (const c of arr) {
|
|
99
|
+
if (c.type === "tool_result" && agentCalls.has(c.tool_use_id)) {
|
|
100
|
+
completedIds.add(c.tool_use_id);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
} catch {}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
for (const [id, desc] of agentCalls) {
|
|
108
|
+
if (!completedIds.has(id)) activeAgents.push(desc);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} catch {}
|
|
112
|
+
|
|
113
|
+
// ─── Context window + cost ──────────────────────────────────────────────
|
|
114
|
+
|
|
115
|
+
const usedPct = data?.context_window?.used_percentage;
|
|
116
|
+
const cu = data?.context_window?.current_usage || {};
|
|
117
|
+
const usedTokens =
|
|
118
|
+
(Number(cu.input_tokens || 0) +
|
|
119
|
+
Number(cu.output_tokens || 0) +
|
|
120
|
+
Number(cu.cache_creation_input_tokens || 0) +
|
|
121
|
+
Number(cu.cache_read_input_tokens || 0)) || null;
|
|
122
|
+
const windowSize = data?.context_window?.context_window_size;
|
|
123
|
+
const cost = process.env.CLAUDE_SESSION_COST_USD;
|
|
124
|
+
|
|
125
|
+
// ─── Helpers ────────────────────────────────────────────────────────────
|
|
126
|
+
|
|
127
|
+
function fmt(n) {
|
|
128
|
+
if (n == null || n === "") return "?";
|
|
129
|
+
n = Number(n);
|
|
130
|
+
if (isNaN(n)) return "?";
|
|
131
|
+
if (n >= 1000000) return (n / 1000000).toFixed(1) + "M";
|
|
132
|
+
if (n >= 100000) return Math.floor(n / 1000) + "k";
|
|
133
|
+
if (n >= 1000) return (n / 1000).toFixed(1) + "k";
|
|
134
|
+
return String(n);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// 256-color ANSI sequences
|
|
138
|
+
const c = (n) => `\x1b[38;5;${n}m`;
|
|
139
|
+
const bg = (n) => `\x1b[48;5;${n}m`;
|
|
140
|
+
const R = "\x1b[0m";
|
|
141
|
+
const BOLD = "\x1b[1m";
|
|
142
|
+
const DIM = "\x1b[2m";
|
|
143
|
+
|
|
144
|
+
// Palette
|
|
145
|
+
const TEAL = c(80); // user@host
|
|
146
|
+
const ROSE = c(204); // model
|
|
147
|
+
const AMBER = c(215); // path
|
|
148
|
+
const MINT = c(114); // branch
|
|
149
|
+
const SKY = c(117); // ctx bar filled
|
|
150
|
+
const SLATE = c(239); // ctx bar empty / separators
|
|
151
|
+
const LILAC = c(183); // thinking
|
|
152
|
+
const CORAL = c(209); // supabase
|
|
153
|
+
const GRAY = c(245); // labels
|
|
154
|
+
const WHITE = c(255); // bright text
|
|
155
|
+
const DKGRAY = c(237); // box chars
|
|
156
|
+
|
|
157
|
+
// ─── Progress bar (teal -> sky -> rose gradient at 75%) ─────────────────
|
|
158
|
+
|
|
159
|
+
function progressBar(pct, width = 20) {
|
|
160
|
+
const filled = Math.round((pct / 100) * width);
|
|
161
|
+
const empty = width - filled;
|
|
162
|
+
// Gradient: low=teal, mid=sky, high=rose
|
|
163
|
+
let barColor = SKY;
|
|
164
|
+
if (pct > 75) barColor = c(204);
|
|
165
|
+
else if (pct > 50) barColor = c(220);
|
|
166
|
+
|
|
167
|
+
const filledStr = barColor + "\u2501".repeat(filled);
|
|
168
|
+
const emptyStr = SLATE + "\u2501".repeat(empty);
|
|
169
|
+
return filledStr + emptyStr + R;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// ─── Separators ─────────────────────────────────────────────────────────
|
|
173
|
+
|
|
174
|
+
const SEP = `${DKGRAY} \u2502 ${R}`;
|
|
175
|
+
const DOT = `${DKGRAY} \u00b7 ${R}`;
|
|
176
|
+
|
|
177
|
+
// ─── Line 1: identity + location ────────────────────────────────────────
|
|
178
|
+
|
|
179
|
+
let line1 = `${DKGRAY}\u256d${R} `;
|
|
180
|
+
line1 += `${TEAL}${BOLD}${user}${R}${GRAY}@${R}${TEAL}${host}${R}`;
|
|
181
|
+
if (model) line1 += `${SEP}${ROSE}${model}${R}`;
|
|
182
|
+
line1 += `${SEP}${AMBER}${cwdDisplay}${R}`;
|
|
183
|
+
if (gitBranch) line1 += `${DOT}${MINT}${BOLD}${gitBranch}${R}`;
|
|
184
|
+
|
|
185
|
+
// ─── Line 2: metrics ───────────────────────────────────────────────────
|
|
186
|
+
|
|
187
|
+
let line2 = `${DKGRAY}\u2570${R} `;
|
|
188
|
+
const parts2 = [];
|
|
189
|
+
|
|
190
|
+
if (usedPct != null) {
|
|
191
|
+
const pct = Math.round(usedPct);
|
|
192
|
+
const bar = progressBar(pct);
|
|
193
|
+
parts2.push(
|
|
194
|
+
`${bar} ${WHITE}${BOLD}${pct}%${R}${GRAY} ctx${R}${DOT}${WHITE}${fmt(usedTokens)}${R}${GRAY}/${R}${WHITE}${fmt(windowSize)}${R}`,
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (thinkingLevel) {
|
|
199
|
+
const icon = thinkingLevel === "high" ? "\u25c6" : thinkingLevel === "low" ? "\u25c7" : "\u25c8";
|
|
200
|
+
parts2.push(`${LILAC}${icon} ${thinkingLevel}${R}`);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (supabaseRef) {
|
|
204
|
+
parts2.push(`${CORAL}\u25c8 ${R}${GRAY}sb:${R}${CORAL}${supabaseRef}${R}`);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (activeAgents.length) {
|
|
208
|
+
const CYAN = c(81);
|
|
209
|
+
const names = activeAgents
|
|
210
|
+
.map((d) => (d.length > 20 ? d.slice(0, 18) + ".." : d))
|
|
211
|
+
.join(", ");
|
|
212
|
+
const spinner =
|
|
213
|
+
["\u280b", "\u2819", "\u2839", "\u2838", "\u283c", "\u2834", "\u2826", "\u2827", "\u2807", "\u280f"][
|
|
214
|
+
Math.floor(Date.now() / 100) % 10
|
|
215
|
+
];
|
|
216
|
+
parts2.push(
|
|
217
|
+
`${CYAN}${spinner} ${activeAgents.length} agent${activeAgents.length > 1 ? "s" : ""}${R}${GRAY}: ${names}${R}`,
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (cost) {
|
|
222
|
+
parts2.push(`${GRAY}$${Number(cost).toFixed(2)}${R}`);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
line2 += parts2.join(`${SEP}`);
|
|
226
|
+
|
|
227
|
+
// ─── Output ─────────────────────────────────────────────────────────────
|
|
228
|
+
|
|
229
|
+
if (parts2.length) {
|
|
230
|
+
process.stdout.write(`${line1}\n${line2}`);
|
|
231
|
+
} else {
|
|
232
|
+
process.stdout.write(line1);
|
|
233
|
+
}
|
|
234
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "supermind-claude",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Complete, opinionated Claude Code setup — hooks, skills, status line, MCP servers, and living documentation",
|
|
5
|
+
"bin": {
|
|
6
|
+
"supermind-claude": "./cli/index.js",
|
|
7
|
+
"supermind": "./cli/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"cli/",
|
|
11
|
+
"hooks/",
|
|
12
|
+
"skills/",
|
|
13
|
+
"templates/",
|
|
14
|
+
"airis/",
|
|
15
|
+
".env.example"
|
|
16
|
+
],
|
|
17
|
+
"keywords": ["claude", "claude-code", "ai", "developer-tools", "mcp"],
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/steven-3/supermind"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: supermind
|
|
3
|
+
description: "Supermind — project initialization, living documentation, and configuration skills"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Supermind
|
|
7
|
+
|
|
8
|
+
Parent namespace for Supermind skills.
|
|
9
|
+
|
|
10
|
+
## Available Commands
|
|
11
|
+
|
|
12
|
+
- `/supermind-init` — Initialize a project: CLAUDE.md setup, ARCHITECTURE.md/DESIGN.md generation, health checks, and optional skill/MCP discovery
|
|
13
|
+
- `/supermind-living-docs` — Manually sync ARCHITECTURE.md and DESIGN.md with the current codebase
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: supermind-init
|
|
3
|
+
description: "Initialize a project with Supermind. Use when starting work in a new project, when ARCHITECTURE.md is missing, or when the user wants to set up CLAUDE.md, living documentation, and project health checks. Triggers on: new project setup, missing docs, /supermind-init"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Project Initialization
|
|
7
|
+
|
|
8
|
+
One command to fully set up a project: creates or updates CLAUDE.md, detects the tech stack, generates living documentation (ARCHITECTURE.md + optional DESIGN.md), and optionally checks project health and discovers relevant tools.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Phase 1: CLAUDE.md Management
|
|
13
|
+
|
|
14
|
+
Section-level merging preserves your project-specific customizations while keeping infrastructure sections up to date with the latest Supermind configuration.
|
|
15
|
+
|
|
16
|
+
### Section Ownership
|
|
17
|
+
|
|
18
|
+
**Project-specific** (preserved during merge — user content takes priority):
|
|
19
|
+
- Quick Reference
|
|
20
|
+
- Commands
|
|
21
|
+
- Tech Stack
|
|
22
|
+
- Project Structure
|
|
23
|
+
- Any custom section not listed below
|
|
24
|
+
|
|
25
|
+
**Infrastructure** (replaced from template on every run):
|
|
26
|
+
- Shell & Git Permissions
|
|
27
|
+
- Worktree Development Workflow
|
|
28
|
+
- MCP Servers
|
|
29
|
+
- UI Changes
|
|
30
|
+
- Living Documentation
|
|
31
|
+
|
|
32
|
+
### Steps
|
|
33
|
+
|
|
34
|
+
1. Read the template from `~/.claude/templates/CLAUDE.md`. If missing, tell the user to run `npx supermind-claude` first and stop.
|
|
35
|
+
|
|
36
|
+
2. Check if `CLAUDE.md` exists in the project root.
|
|
37
|
+
|
|
38
|
+
3. **No existing CLAUDE.md** — copy the template as-is, then proceed to step 5.
|
|
39
|
+
|
|
40
|
+
4. **Existing CLAUDE.md** — perform a section-level merge:
|
|
41
|
+
a. Parse both files into sections by splitting on `## ` headings. Content before the first `## ` is the preamble.
|
|
42
|
+
b. Keep the user's preamble intact.
|
|
43
|
+
c. **Project-specific sections**: keep the user's version if it contains real content (not just placeholder comments or "Fill as project grows"). If empty or placeholder, use the template's version.
|
|
44
|
+
d. **Infrastructure sections**: always replace with the template's version.
|
|
45
|
+
e. **Custom sections** (present in the user's file but not in either ownership list): preserve them, append at end.
|
|
46
|
+
f. Output in template section order, with custom sections last.
|
|
47
|
+
g. Show the user a summary: sections preserved / updated / added / kept as custom.
|
|
48
|
+
|
|
49
|
+
5. Auto-detect project context from manifest files:
|
|
50
|
+
- `package.json` — scripts for Commands, dependencies for Tech Stack
|
|
51
|
+
- `Cargo.toml` — workspace members, dependencies, build targets
|
|
52
|
+
- `go.mod` — module path, dependencies
|
|
53
|
+
- `requirements.txt` / `pyproject.toml` — Python dependencies, scripts
|
|
54
|
+
- `Gemfile` — Ruby dependencies
|
|
55
|
+
- Directory structure for Project Structure section
|
|
56
|
+
|
|
57
|
+
6. Fill empty or placeholder sections only (never overwrite user content):
|
|
58
|
+
- **Commands**: from package.json scripts, Makefile targets, Cargo commands, etc.
|
|
59
|
+
- **Tech Stack**: from dependencies and config files
|
|
60
|
+
- **Project Structure**: top 2 directory levels, skipping node_modules, dist, .git, .worktrees, build, target, vendor, __pycache__
|
|
61
|
+
|
|
62
|
+
7. Tell the user what was created or updated and what they should review.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Phase 2: Living Documentation
|
|
67
|
+
|
|
68
|
+
ARCHITECTURE.md uses tables-over-prose because it saves tokens — the AI reads the file index instead of scanning the entire project. This phase generates AI-optimized documentation from a deep codebase scan.
|
|
69
|
+
|
|
70
|
+
### Steps
|
|
71
|
+
|
|
72
|
+
8. **Determine if this is a UI project**:
|
|
73
|
+
- Auto-detect from dependencies: react, vue, svelte, angular, next, nuxt, solid, qwik, lit, stencil
|
|
74
|
+
- If not auto-detected, ask: "Does this project have a UI? (This determines whether a DESIGN.md is created)"
|
|
75
|
+
|
|
76
|
+
9. **Detect scope**:
|
|
77
|
+
- If not at git root: ask "Document just this subfolder, or the entire repo?"
|
|
78
|
+
- If monorepo indicators exist (`packages/`, `apps/`, `pnpm-workspace.yaml`, workspace configs): ask "Document entire repo, or a specific subfolder?"
|
|
79
|
+
- Otherwise: scan_root = working directory
|
|
80
|
+
|
|
81
|
+
10. **Check for existing ARCHITECTURE.md**:
|
|
82
|
+
- If found: ask "Keep as-is, or migrate to AI-optimized format?"
|
|
83
|
+
- Keep: skip architecture generation. Migrate: back up to `.bak`, map content into template sections.
|
|
84
|
+
|
|
85
|
+
11. **Check for existing DESIGN.md** (if UI project):
|
|
86
|
+
- Same keep/migrate flow as above.
|
|
87
|
+
|
|
88
|
+
12. **Generate files**:
|
|
89
|
+
|
|
90
|
+
Read the skeleton templates from this skill's directory before generating:
|
|
91
|
+
- `architecture-template.md` — section structure and table headers for ARCHITECTURE.md
|
|
92
|
+
- `design-template.md` — section structure and table headers for DESIGN.md
|
|
93
|
+
|
|
94
|
+
**Empty project** (fewer than 5 source files, excluding config, lock files, and dotfiles):
|
|
95
|
+
- Write from skeleton templates with placeholder comments.
|
|
96
|
+
|
|
97
|
+
**Existing project — Deep Scan**:
|
|
98
|
+
|
|
99
|
+
Scan exclusions: `node_modules/`, `dist/`, `build/`, `.git/`, `__pycache__/`, `target/`, `vendor/`, `.next/`, `coverage/`, gitignored paths
|
|
100
|
+
|
|
101
|
+
Scan limits:
|
|
102
|
+
- Cap File Index at 200 entries (shallower files first)
|
|
103
|
+
- Max 5 directory levels deep
|
|
104
|
+
- Priority order: File Index + Tech Stack, then API Contracts + Env Vars, then Dependencies & Data Flow
|
|
105
|
+
|
|
106
|
+
ARCHITECTURE.md scan targets:
|
|
107
|
+
|
|
108
|
+
| Scan | How | Section |
|
|
109
|
+
|------|-----|---------|
|
|
110
|
+
| Source files | Glob, read headers/exports | **File Index** |
|
|
111
|
+
| Tech stack | Read package.json, Cargo.toml, go.mod, etc. | **Tech Stack** |
|
|
112
|
+
| API routes | Find route/endpoint definitions | **API Contracts** |
|
|
113
|
+
| Env vars | Read .env.example, grep process.env / os.environ | **Environment Variables** |
|
|
114
|
+
| Import graph | Read import/require statements | **Dependencies & Data Flow** |
|
|
115
|
+
| Code patterns | Observe conventions (naming, error handling, state management) | **Key Patterns & Conventions** |
|
|
116
|
+
|
|
117
|
+
DESIGN.md scan targets (if UI project):
|
|
118
|
+
|
|
119
|
+
| Scan | How | Section |
|
|
120
|
+
|------|-----|---------|
|
|
121
|
+
| Colors | CSS custom properties, Tailwind config, theme files | **Color Tokens** |
|
|
122
|
+
| Typography | Font declarations, heading styles, text utilities | **Typography** |
|
|
123
|
+
| Spacing | CSS custom properties, Tailwind spacing config | **Spacing Scale** |
|
|
124
|
+
| Components | Component files, variants, props interfaces | **Component Patterns** |
|
|
125
|
+
| Layout | Grid systems, breakpoints, container max-widths | **Layout Conventions** |
|
|
126
|
+
| Animations | Transitions, keyframes, motion variants | **Animation Patterns** |
|
|
127
|
+
|
|
128
|
+
Leave unfilled sections with `<!-- No [X] detected -->`.
|
|
129
|
+
|
|
130
|
+
13. **Commit** generated or migrated docs:
|
|
131
|
+
- New project: `git commit -m "Initialize project (CLAUDE.md, ARCHITECTURE.md[, DESIGN.md])"`
|
|
132
|
+
- Migrated: `git commit -m "Migrate living documentation to AI-optimized format"`
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Phase 3: Project Health & Discovery
|
|
137
|
+
|
|
138
|
+
Different projects benefit from different tools. A database-heavy project might want a Postgres MCP, while a frontend project might want shadcn component search. This phase checks your setup and suggests relevant additions.
|
|
139
|
+
|
|
140
|
+
### Steps
|
|
141
|
+
|
|
142
|
+
14. Ask the user: "Would you like me to check your Supermind setup and research additional tools for this project?"
|
|
143
|
+
|
|
144
|
+
15. **If yes**:
|
|
145
|
+
|
|
146
|
+
a. **Verify session hooks are firing**:
|
|
147
|
+
- Check `~/.claude/sessions/` for recent session files
|
|
148
|
+
- If no recent files found, warn that session persistence may not be configured
|
|
149
|
+
|
|
150
|
+
b. **Check Serena configuration**:
|
|
151
|
+
- Look for `.serena/` directory in the project root
|
|
152
|
+
- If missing, suggest setting up Serena for semantic code navigation
|
|
153
|
+
|
|
154
|
+
c. **Research relevant tools**:
|
|
155
|
+
- Spawn a subagent to research skills and MCPs relevant to the detected tech stack
|
|
156
|
+
- Consider the project's language, framework, database, deployment target, and testing approach
|
|
157
|
+
- Look at available MCP servers and Superpowers skills that match
|
|
158
|
+
|
|
159
|
+
d. **Present findings**:
|
|
160
|
+
- Show suggestions as a list with brief explanations of why each tool is relevant
|
|
161
|
+
- Do not auto-install anything — let the user decide
|
|
162
|
+
- Group by category: code navigation, testing, deployment, UI, database, etc.
|
|
163
|
+
|
|
164
|
+
16. **If no**: skip this phase. Initialization is complete.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Template Reference
|
|
169
|
+
|
|
170
|
+
Skeleton templates are sibling files in this skill's directory:
|
|
171
|
+
- `architecture-template.md` — sections and table headers for ARCHITECTURE.md
|
|
172
|
+
- `design-template.md` — sections and table headers for DESIGN.md
|
|
173
|
+
|
|
174
|
+
Read these before generating files to match the expected format.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
<!-- One paragraph: what the project does and its core architecture pattern -->
|
|
6
|
+
|
|
7
|
+
## Tech Stack
|
|
8
|
+
|
|
9
|
+
| Category | Technology | Purpose |
|
|
10
|
+
|----------|-----------|---------|
|
|
11
|
+
<!-- Fill as project grows -->
|
|
12
|
+
|
|
13
|
+
## File Index
|
|
14
|
+
|
|
15
|
+
<!-- Source files only. No generated output, lock files, node_modules, or build artifacts. -->
|
|
16
|
+
<!-- Every row gets a one-line purpose description. -->
|
|
17
|
+
|
|
18
|
+
| Path | Purpose |
|
|
19
|
+
|------|---------|
|
|
20
|
+
<!-- Fill as project grows -->
|
|
21
|
+
|
|
22
|
+
## Dependencies & Data Flow
|
|
23
|
+
|
|
24
|
+
### Data Flow
|
|
25
|
+
|
|
26
|
+
<!-- ASCII diagram showing high-level request/data flow -->
|
|
27
|
+
|
|
28
|
+
### File Dependencies
|
|
29
|
+
|
|
30
|
+
| File | Depends On | Used By |
|
|
31
|
+
|------|-----------|---------|
|
|
32
|
+
<!-- Fill as project grows -->
|
|
33
|
+
|
|
34
|
+
## API Contracts
|
|
35
|
+
|
|
36
|
+
| Method | Route | Request | Response | Purpose |
|
|
37
|
+
|--------|-------|---------|----------|---------|
|
|
38
|
+
<!-- Fill as project grows -->
|
|
39
|
+
|
|
40
|
+
## Environment Variables
|
|
41
|
+
|
|
42
|
+
| Variable | Required | Purpose |
|
|
43
|
+
|----------|----------|---------|
|
|
44
|
+
<!-- Fill as project grows -->
|
|
45
|
+
|
|
46
|
+
## Key Patterns & Conventions
|
|
47
|
+
|
|
48
|
+
<!-- Document project conventions as they emerge -->
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Design System
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
<!-- One paragraph: visual identity and design language summary -->
|
|
6
|
+
|
|
7
|
+
## Color Tokens
|
|
8
|
+
|
|
9
|
+
| Token | Value | Usage |
|
|
10
|
+
|-------|-------|-------|
|
|
11
|
+
<!-- Fill as project grows -->
|
|
12
|
+
|
|
13
|
+
## Typography
|
|
14
|
+
|
|
15
|
+
| Role | Font | Size | Weight | Line Height |
|
|
16
|
+
|------|------|------|--------|-------------|
|
|
17
|
+
<!-- Fill as project grows -->
|
|
18
|
+
|
|
19
|
+
## Spacing Scale
|
|
20
|
+
|
|
21
|
+
| Token | Value | Usage |
|
|
22
|
+
|-------|-------|-------|
|
|
23
|
+
<!-- Fill as project grows -->
|
|
24
|
+
|
|
25
|
+
## Component Patterns
|
|
26
|
+
|
|
27
|
+
<!-- Per component: variants, sizes, file path -->
|
|
28
|
+
<!-- Example:
|
|
29
|
+
### Button
|
|
30
|
+
- Variants: primary, secondary, ghost, danger
|
|
31
|
+
- Sizes: sm, md, lg
|
|
32
|
+
- File: `src/components/ui/button.tsx`
|
|
33
|
+
-->
|
|
34
|
+
|
|
35
|
+
## Layout Conventions
|
|
36
|
+
|
|
37
|
+
<!-- Grid system, breakpoints, container max-widths -->
|
|
38
|
+
|
|
39
|
+
## Animation Patterns
|
|
40
|
+
|
|
41
|
+
| Name | Duration | Easing | Usage |
|
|
42
|
+
|------|----------|--------|-------|
|
|
43
|
+
<!-- Fill as project grows -->
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: supermind-living-docs
|
|
3
|
+
description: "Manually sync living documentation. Use when ARCHITECTURE.md or DESIGN.md need updating after code changes, when the user asks to update docs, or as a periodic check. Does not auto-trigger — this is the manual 'sync now' command."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Living Documentation — Manual Sync
|
|
7
|
+
|
|
8
|
+
Surgical edits preserve your existing formatting and avoid unnecessary diffs. This skill updates ARCHITECTURE.md and DESIGN.md to reflect the current state of the codebase without rewriting entire files.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Steps
|
|
13
|
+
|
|
14
|
+
1. **Read current documentation**:
|
|
15
|
+
- Read `ARCHITECTURE.md` from the project root (required — if missing, tell the user to run `/supermind-init` first)
|
|
16
|
+
- Read `DESIGN.md` from the project root (only if it exists — its presence means this is a UI project)
|
|
17
|
+
|
|
18
|
+
2. **Assess recent changes**:
|
|
19
|
+
- Run `git diff --name-only` to see which files changed
|
|
20
|
+
- Run `git diff --stat` to understand the scope of changes
|
|
21
|
+
- If working on uncommitted changes, also check `git diff --name-only HEAD` and `git status`
|
|
22
|
+
|
|
23
|
+
3. **Reason about what needs updating**:
|
|
24
|
+
- Files added, removed, or renamed — update **File Index**
|
|
25
|
+
- API routes changed — update **API Contracts**
|
|
26
|
+
- Dependencies added or removed — update **Tech Stack** and **Dependencies & Data Flow**
|
|
27
|
+
- Environment variables changed — update **Environment Variables**
|
|
28
|
+
- New patterns or conventions established — update **Key Patterns & Conventions**
|
|
29
|
+
- UI changes (only if DESIGN.md exists):
|
|
30
|
+
- Colors, fonts, spacing changed — update relevant design sections
|
|
31
|
+
- Components added or modified — update **Component Patterns**
|
|
32
|
+
- Layout or animation changes — update **Layout Conventions** or **Animation Patterns**
|
|
33
|
+
|
|
34
|
+
4. **If nothing meaningful changed**, say so and stop. Do not make edits for the sake of making edits.
|
|
35
|
+
|
|
36
|
+
5. **Make surgical edits**:
|
|
37
|
+
- Use the Edit tool to update only the sections that need changing
|
|
38
|
+
- Do NOT rewrite entire files — change only the rows, entries, or paragraphs that are affected
|
|
39
|
+
- Match the existing format and section structure exactly
|
|
40
|
+
- Keep content factual — document what IS, not what should be
|
|
41
|
+
- Always include file paths when referencing source files
|
|
42
|
+
|
|
43
|
+
6. **Commit** with a descriptive message:
|
|
44
|
+
- Example: `git commit -m "Update ARCHITECTURE.md: add new API routes, update file index"`
|
|
45
|
+
- If both files were updated: `git commit -m "Update living docs: [brief description of changes]"`
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Update Rules
|
|
50
|
+
|
|
51
|
+
- **Be surgical** — only update the sections that changed, never rewrite the whole doc
|
|
52
|
+
- **Use the Edit tool** — do not rewrite the entire file for a small change
|
|
53
|
+
- **Keep it factual** — document what IS, not what should be
|
|
54
|
+
- **Include file paths** — always reference the actual source files
|
|
55
|
+
- **Match the existing format** — follow the section structure already in the doc
|