maxsimcli 4.8.0 → 4.10.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 (162) hide show
  1. package/README.md +180 -202
  2. package/dist/assets/CHANGELOG.md +61 -0
  3. package/dist/assets/hooks/maxsim-check-update.cjs +38 -0
  4. package/dist/assets/hooks/maxsim-check-update.cjs.map +1 -1
  5. package/dist/assets/hooks/maxsim-statusline.cjs +116 -48
  6. package/dist/assets/hooks/maxsim-statusline.cjs.map +1 -1
  7. package/dist/assets/hooks/maxsim-sync-reminder.cjs +117 -0
  8. package/dist/assets/hooks/maxsim-sync-reminder.cjs.map +1 -0
  9. package/dist/assets/templates/agents/AGENTS.md +78 -106
  10. package/dist/assets/templates/agents/executor.md +101 -0
  11. package/dist/assets/templates/agents/planner.md +86 -0
  12. package/dist/assets/templates/agents/researcher.md +71 -0
  13. package/dist/assets/templates/agents/verifier.md +88 -0
  14. package/dist/assets/templates/commands/maxsim/debug.md +7 -7
  15. package/dist/assets/templates/commands/maxsim/execute.md +45 -0
  16. package/dist/assets/templates/commands/maxsim/go.md +29 -0
  17. package/dist/assets/templates/commands/maxsim/help.md +2 -2
  18. package/dist/assets/templates/commands/maxsim/init.md +52 -0
  19. package/dist/assets/templates/commands/maxsim/plan.md +50 -0
  20. package/dist/assets/templates/commands/maxsim/progress.md +4 -3
  21. package/dist/assets/templates/commands/maxsim/quick.md +6 -4
  22. package/dist/assets/templates/commands/maxsim/settings.md +4 -3
  23. package/dist/assets/templates/references/continuation-format.md +16 -16
  24. package/dist/assets/templates/references/model-profile-resolution.md +1 -1
  25. package/dist/assets/templates/references/model-profiles.md +12 -19
  26. package/dist/assets/templates/rules/conventions.md +51 -0
  27. package/dist/assets/templates/rules/verification-protocol.md +57 -0
  28. package/dist/assets/templates/skills/agent-system-map/SKILL.md +92 -0
  29. package/dist/assets/templates/skills/brainstorming/SKILL.md +48 -36
  30. package/dist/assets/templates/skills/code-review/SKILL.md +40 -61
  31. package/dist/assets/templates/skills/commit-conventions/SKILL.md +75 -0
  32. package/dist/assets/templates/skills/evidence-collection/SKILL.md +87 -0
  33. package/dist/assets/templates/skills/handoff-contract/SKILL.md +70 -0
  34. package/dist/assets/templates/skills/input-validation/SKILL.md +51 -0
  35. package/dist/assets/templates/skills/maxsim-batch/SKILL.md +41 -45
  36. package/dist/assets/templates/skills/maxsim-simplify/SKILL.md +37 -90
  37. package/dist/assets/templates/skills/memory-management/SKILL.md +32 -67
  38. package/dist/assets/templates/skills/research-methodology/SKILL.md +137 -0
  39. package/dist/assets/templates/skills/roadmap-writing/SKILL.md +40 -58
  40. package/dist/assets/templates/skills/sdd/SKILL.md +34 -69
  41. package/dist/assets/templates/skills/systematic-debugging/SKILL.md +20 -26
  42. package/dist/assets/templates/skills/tdd/SKILL.md +25 -33
  43. package/dist/assets/templates/skills/tool-priority-guide/SKILL.md +80 -0
  44. package/dist/assets/templates/skills/using-maxsim/SKILL.md +42 -73
  45. package/dist/assets/templates/skills/verification-before-completion/SKILL.md +12 -24
  46. package/dist/assets/templates/skills/verification-gates/SKILL.md +169 -0
  47. package/dist/assets/templates/templates/UAT.md +3 -3
  48. package/dist/assets/templates/templates/VALIDATION.md +1 -1
  49. package/dist/assets/templates/templates/context.md +4 -4
  50. package/dist/assets/templates/templates/debug-subagent-prompt.md +3 -3
  51. package/dist/assets/templates/templates/discovery.md +2 -2
  52. package/dist/assets/templates/templates/phase-prompt.md +2 -2
  53. package/dist/assets/templates/templates/planner-subagent-prompt.md +7 -7
  54. package/dist/assets/templates/templates/project.md +1 -1
  55. package/dist/assets/templates/templates/research.md +1 -1
  56. package/dist/assets/templates/templates/state.md +2 -2
  57. package/dist/assets/templates/templates/summary.md +41 -0
  58. package/dist/assets/templates/workflows/batch.md +5 -5
  59. package/dist/assets/templates/workflows/diagnose-issues.md +2 -2
  60. package/dist/assets/templates/workflows/discovery-phase.md +3 -3
  61. package/dist/assets/templates/workflows/discuss-phase.md +11 -11
  62. package/dist/assets/templates/workflows/execute-phase.md +205 -11
  63. package/dist/assets/templates/workflows/execute-plan.md +299 -34
  64. package/dist/assets/templates/workflows/execute.md +421 -0
  65. package/dist/assets/templates/workflows/go.md +250 -0
  66. package/dist/assets/templates/workflows/health.md +5 -5
  67. package/dist/assets/templates/workflows/help.md +165 -435
  68. package/dist/assets/templates/workflows/init-existing.md +23 -23
  69. package/dist/assets/templates/workflows/init.md +205 -0
  70. package/dist/assets/templates/workflows/new-milestone.md +9 -9
  71. package/dist/assets/templates/workflows/new-project.md +26 -26
  72. package/dist/assets/templates/workflows/plan-create.md +298 -0
  73. package/dist/assets/templates/workflows/plan-discuss.md +347 -0
  74. package/dist/assets/templates/workflows/plan-phase.md +29 -29
  75. package/dist/assets/templates/workflows/plan-research.md +177 -0
  76. package/dist/assets/templates/workflows/plan.md +231 -0
  77. package/dist/assets/templates/workflows/progress.md +46 -42
  78. package/dist/assets/templates/workflows/quick.md +195 -14
  79. package/dist/assets/templates/workflows/research-phase.md +5 -5
  80. package/dist/assets/templates/workflows/sdd.md +20 -12
  81. package/dist/assets/templates/workflows/settings.md +18 -14
  82. package/dist/assets/templates/workflows/verify-phase.md +1 -1
  83. package/dist/assets/templates/workflows/verify-work.md +16 -16
  84. package/dist/cli.cjs +4589 -229
  85. package/dist/cli.cjs.map +1 -1
  86. package/dist/core-D5zUr9cb.cjs.map +1 -1
  87. package/dist/install.cjs +234 -17
  88. package/dist/install.cjs.map +1 -1
  89. package/dist/mcp-server.cjs +298 -20
  90. package/dist/mcp-server.cjs.map +1 -1
  91. package/dist/skills-CjFWZIGM.cjs.map +1 -1
  92. package/package.json +1 -1
  93. package/dist/assets/hooks/maxsim-context-monitor.cjs +0 -121
  94. package/dist/assets/hooks/maxsim-context-monitor.cjs.map +0 -1
  95. package/dist/assets/templates/agents/maxsim-code-reviewer.md +0 -239
  96. package/dist/assets/templates/agents/maxsim-codebase-mapper.md +0 -214
  97. package/dist/assets/templates/agents/maxsim-debugger.md +0 -572
  98. package/dist/assets/templates/agents/maxsim-drift-checker.md +0 -522
  99. package/dist/assets/templates/agents/maxsim-executor.md +0 -504
  100. package/dist/assets/templates/agents/maxsim-integration-checker.md +0 -273
  101. package/dist/assets/templates/agents/maxsim-phase-researcher.md +0 -305
  102. package/dist/assets/templates/agents/maxsim-plan-checker.md +0 -343
  103. package/dist/assets/templates/agents/maxsim-planner.md +0 -610
  104. package/dist/assets/templates/agents/maxsim-project-researcher.md +0 -359
  105. package/dist/assets/templates/agents/maxsim-research-synthesizer.md +0 -263
  106. package/dist/assets/templates/agents/maxsim-roadmapper.md +0 -324
  107. package/dist/assets/templates/agents/maxsim-spec-reviewer.md +0 -245
  108. package/dist/assets/templates/agents/maxsim-verifier.md +0 -393
  109. package/dist/assets/templates/commands/maxsim/add-phase.md +0 -43
  110. package/dist/assets/templates/commands/maxsim/add-tests.md +0 -41
  111. package/dist/assets/templates/commands/maxsim/add-todo.md +0 -57
  112. package/dist/assets/templates/commands/maxsim/artefakte.md +0 -122
  113. package/dist/assets/templates/commands/maxsim/audit-milestone.md +0 -36
  114. package/dist/assets/templates/commands/maxsim/batch.md +0 -42
  115. package/dist/assets/templates/commands/maxsim/check-drift.md +0 -56
  116. package/dist/assets/templates/commands/maxsim/check-todos.md +0 -46
  117. package/dist/assets/templates/commands/maxsim/cleanup.md +0 -18
  118. package/dist/assets/templates/commands/maxsim/complete-milestone.md +0 -136
  119. package/dist/assets/templates/commands/maxsim/discuss-phase.md +0 -87
  120. package/dist/assets/templates/commands/maxsim/discuss.md +0 -70
  121. package/dist/assets/templates/commands/maxsim/execute-phase.md +0 -41
  122. package/dist/assets/templates/commands/maxsim/health.md +0 -22
  123. package/dist/assets/templates/commands/maxsim/init-existing.md +0 -46
  124. package/dist/assets/templates/commands/maxsim/insert-phase.md +0 -32
  125. package/dist/assets/templates/commands/maxsim/list-phase-assumptions.md +0 -46
  126. package/dist/assets/templates/commands/maxsim/map-codebase.md +0 -71
  127. package/dist/assets/templates/commands/maxsim/new-milestone.md +0 -44
  128. package/dist/assets/templates/commands/maxsim/new-project.md +0 -46
  129. package/dist/assets/templates/commands/maxsim/pause-work.md +0 -38
  130. package/dist/assets/templates/commands/maxsim/plan-milestone-gaps.md +0 -34
  131. package/dist/assets/templates/commands/maxsim/plan-phase.md +0 -44
  132. package/dist/assets/templates/commands/maxsim/realign.md +0 -39
  133. package/dist/assets/templates/commands/maxsim/reapply-patches.md +0 -110
  134. package/dist/assets/templates/commands/maxsim/remove-phase.md +0 -31
  135. package/dist/assets/templates/commands/maxsim/research-phase.md +0 -189
  136. package/dist/assets/templates/commands/maxsim/resume-work.md +0 -40
  137. package/dist/assets/templates/commands/maxsim/roadmap.md +0 -19
  138. package/dist/assets/templates/commands/maxsim/sdd.md +0 -39
  139. package/dist/assets/templates/commands/maxsim/set-profile.md +0 -34
  140. package/dist/assets/templates/commands/maxsim/update.md +0 -37
  141. package/dist/assets/templates/commands/maxsim/verify-work.md +0 -38
  142. package/dist/assets/templates/workflows/add-phase.md +0 -111
  143. package/dist/assets/templates/workflows/add-tests.md +0 -351
  144. package/dist/assets/templates/workflows/add-todo.md +0 -247
  145. package/dist/assets/templates/workflows/audit-milestone.md +0 -297
  146. package/dist/assets/templates/workflows/check-drift.md +0 -248
  147. package/dist/assets/templates/workflows/check-todos.md +0 -261
  148. package/dist/assets/templates/workflows/cleanup.md +0 -153
  149. package/dist/assets/templates/workflows/complete-milestone.md +0 -701
  150. package/dist/assets/templates/workflows/discuss.md +0 -343
  151. package/dist/assets/templates/workflows/insert-phase.md +0 -129
  152. package/dist/assets/templates/workflows/list-phase-assumptions.md +0 -178
  153. package/dist/assets/templates/workflows/map-codebase.md +0 -315
  154. package/dist/assets/templates/workflows/pause-work.md +0 -122
  155. package/dist/assets/templates/workflows/plan-milestone-gaps.md +0 -274
  156. package/dist/assets/templates/workflows/realign.md +0 -288
  157. package/dist/assets/templates/workflows/remove-phase.md +0 -154
  158. package/dist/assets/templates/workflows/resume-project.md +0 -306
  159. package/dist/assets/templates/workflows/roadmap.md +0 -130
  160. package/dist/assets/templates/workflows/set-profile.md +0 -81
  161. package/dist/assets/templates/workflows/transition.md +0 -544
  162. package/dist/assets/templates/workflows/update.md +0 -220
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxsimcli",
3
- "version": "4.8.0",
3
+ "version": "4.10.0",
4
4
  "private": false,
5
5
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code, OpenCode, Gemini and Codex by MayStudios.",
6
6
  "bin": {
@@ -1,121 +0,0 @@
1
- #!/usr/bin/env node
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
- //#region \0rolldown/runtime.js
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
- key = keys[i];
14
- if (!__hasOwnProp.call(to, key) && key !== except) {
15
- __defProp(to, key, {
16
- get: ((k) => from[k]).bind(null, key),
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- }
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
25
- value: mod,
26
- enumerable: true
27
- }) : target, mod));
28
-
29
- //#endregion
30
- let node_fs = require("node:fs");
31
- node_fs = __toESM(node_fs);
32
- let node_os = require("node:os");
33
- node_os = __toESM(node_os);
34
- let node_path = require("node:path");
35
- node_path = __toESM(node_path);
36
-
37
- //#region src/hooks/shared.ts
38
- /**
39
- * Shared utilities for MAXSIM hooks.
40
- */
41
- /**
42
- * Read all stdin as a string, then invoke callback with parsed JSON.
43
- * Used by context-monitor and statusline hooks.
44
- */
45
- function readStdinJson(callback) {
46
- let input = "";
47
- process.stdin.setEncoding("utf8");
48
- process.stdin.on("data", (chunk) => input += chunk);
49
- process.stdin.on("end", () => {
50
- try {
51
- callback(JSON.parse(input));
52
- } catch {
53
- process.exit(0);
54
- }
55
- });
56
- }
57
-
58
- //#endregion
59
- //#region src/hooks/maxsim-context-monitor.ts
60
- /**
61
- * Context Monitor - PostToolUse hook
62
- * Reads context metrics from the statusline bridge file and injects
63
- * warnings when context usage is high.
64
- */
65
- const WARNING_THRESHOLD = 35;
66
- const CRITICAL_THRESHOLD = 25;
67
- const STALE_SECONDS = 60;
68
- const DEBOUNCE_CALLS = 5;
69
- function processContextMonitor(data) {
70
- const sessionId = data.session_id;
71
- if (!sessionId) return null;
72
- const tmpDir = node_os.tmpdir();
73
- const metricsPath = node_path.join(tmpDir, `claude-ctx-${sessionId}.json`);
74
- if (!node_fs.existsSync(metricsPath)) return null;
75
- const metrics = JSON.parse(node_fs.readFileSync(metricsPath, "utf8"));
76
- const now = Math.floor(Date.now() / 1e3);
77
- if (metrics.timestamp && now - metrics.timestamp > STALE_SECONDS) return null;
78
- const remaining = metrics.remaining_percentage;
79
- const usedPct = metrics.used_pct;
80
- if (remaining > WARNING_THRESHOLD) return null;
81
- const warnPath = node_path.join(tmpDir, `claude-ctx-${sessionId}-warned.json`);
82
- let warnData = {
83
- callsSinceWarn: 0,
84
- lastLevel: null
85
- };
86
- let firstWarn = true;
87
- if (node_fs.existsSync(warnPath)) try {
88
- warnData = JSON.parse(node_fs.readFileSync(warnPath, "utf8"));
89
- firstWarn = false;
90
- } catch {}
91
- warnData.callsSinceWarn = (warnData.callsSinceWarn || 0) + 1;
92
- const isCritical = remaining <= CRITICAL_THRESHOLD;
93
- const currentLevel = isCritical ? "critical" : "warning";
94
- const severityEscalated = currentLevel === "critical" && warnData.lastLevel === "warning";
95
- if (!firstWarn && warnData.callsSinceWarn < DEBOUNCE_CALLS && !severityEscalated) {
96
- node_fs.writeFileSync(warnPath, JSON.stringify(warnData));
97
- return null;
98
- }
99
- warnData.callsSinceWarn = 0;
100
- warnData.lastLevel = currentLevel;
101
- node_fs.writeFileSync(warnPath, JSON.stringify(warnData));
102
- let message;
103
- if (isCritical) message = `CONTEXT MONITOR CRITICAL: Usage at ${usedPct}%. Remaining: ${remaining}%. STOP new work immediately. Save state NOW and inform the user that context is nearly exhausted. If using MAXSIM, run /maxsim:pause-work to save execution state.`;
104
- else message = `CONTEXT MONITOR WARNING: Usage at ${usedPct}%. Remaining: ${remaining}%. Begin wrapping up current task. Do not start new complex work. If using MAXSIM, consider /maxsim:pause-work to save state.`;
105
- return { hookSpecificOutput: {
106
- hookEventName: "PostToolUse",
107
- additionalContext: message
108
- } };
109
- }
110
- if (require.main === module) readStdinJson((data) => {
111
- const result = processContextMonitor(data);
112
- if (result) process.stdout.write(JSON.stringify(result));
113
- });
114
-
115
- //#endregion
116
- exports.CRITICAL_THRESHOLD = CRITICAL_THRESHOLD;
117
- exports.DEBOUNCE_CALLS = DEBOUNCE_CALLS;
118
- exports.STALE_SECONDS = STALE_SECONDS;
119
- exports.WARNING_THRESHOLD = WARNING_THRESHOLD;
120
- exports.processContextMonitor = processContextMonitor;
121
- //# sourceMappingURL=maxsim-context-monitor.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"maxsim-context-monitor.cjs","names":["os","path","fs"],"sources":["../../../src/hooks/shared.ts","../../../src/hooks/maxsim-context-monitor.ts"],"sourcesContent":["/**\n * Shared utilities for MAXSIM hooks.\n */\n\n/**\n * Read all stdin as a string, then invoke callback with parsed JSON.\n * Used by context-monitor and statusline hooks.\n */\nexport function readStdinJson<T>(callback: (data: T) => void): void {\n let input = '';\n process.stdin.setEncoding('utf8');\n process.stdin.on('data', (chunk: string) => (input += chunk));\n process.stdin.on('end', () => {\n try {\n const data = JSON.parse(input) as T;\n callback(data);\n } catch {\n // Silent fail -- never block hook execution\n process.exit(0);\n }\n });\n}\n\n/** The '.claude' path segment -- template marker replaced during install. */\nexport const CLAUDE_DIR = '.claude';\n","#!/usr/bin/env node\n/**\n * Context Monitor - PostToolUse hook\n * Reads context metrics from the statusline bridge file and injects\n * warnings when context usage is high.\n */\n\nimport * as fs from 'node:fs';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport { readStdinJson, CLAUDE_DIR } from './shared';\n\nexport const WARNING_THRESHOLD = 35; // remaining_percentage <= 35%\nexport const CRITICAL_THRESHOLD = 25; // remaining_percentage <= 25%\nexport const STALE_SECONDS = 60; // ignore metrics older than 60s\nexport const DEBOUNCE_CALLS = 5; // min tool uses between warnings\n\nexport interface ContextMonitorInput {\n session_id?: string;\n}\n\nexport interface ContextMonitorOutput {\n hookSpecificOutput: {\n hookEventName: string;\n additionalContext: string;\n };\n}\n\ninterface BridgeMetrics {\n session_id: string;\n remaining_percentage: number;\n used_pct: number;\n timestamp: number;\n}\n\ninterface WarnState {\n callsSinceWarn: number;\n lastLevel: string | null;\n}\n\nexport function processContextMonitor(data: ContextMonitorInput): ContextMonitorOutput | null {\n const sessionId = data.session_id;\n\n if (!sessionId) {\n return null;\n }\n\n const tmpDir = os.tmpdir();\n const metricsPath = path.join(tmpDir, `claude-ctx-${sessionId}.json`);\n\n // If no metrics file, this is a subagent or fresh session -- exit silently\n if (!fs.existsSync(metricsPath)) {\n return null;\n }\n\n const metrics: BridgeMetrics = JSON.parse(fs.readFileSync(metricsPath, 'utf8'));\n const now = Math.floor(Date.now() / 1000);\n\n // Ignore stale metrics\n if (metrics.timestamp && (now - metrics.timestamp) > STALE_SECONDS) {\n return null;\n }\n\n const remaining = metrics.remaining_percentage;\n const usedPct = metrics.used_pct;\n\n // No warning needed\n if (remaining > WARNING_THRESHOLD) {\n return null;\n }\n\n // Debounce: check if we warned recently\n const warnPath = path.join(tmpDir, `claude-ctx-${sessionId}-warned.json`);\n let warnData: WarnState = { callsSinceWarn: 0, lastLevel: null };\n let firstWarn = true;\n\n if (fs.existsSync(warnPath)) {\n try {\n warnData = JSON.parse(fs.readFileSync(warnPath, 'utf8'));\n firstWarn = false;\n } catch {\n // Corrupted file, reset\n }\n }\n\n warnData.callsSinceWarn = (warnData.callsSinceWarn || 0) + 1;\n\n const isCritical = remaining <= CRITICAL_THRESHOLD;\n const currentLevel = isCritical ? 'critical' : 'warning';\n\n // Emit immediately on first warning, then debounce subsequent ones\n // Severity escalation (WARNING -> CRITICAL) bypasses debounce\n const severityEscalated = currentLevel === 'critical' && warnData.lastLevel === 'warning';\n if (!firstWarn && warnData.callsSinceWarn < DEBOUNCE_CALLS && !severityEscalated) {\n // Update counter and exit without warning\n fs.writeFileSync(warnPath, JSON.stringify(warnData));\n return null;\n }\n\n // Reset debounce counter\n warnData.callsSinceWarn = 0;\n warnData.lastLevel = currentLevel;\n fs.writeFileSync(warnPath, JSON.stringify(warnData));\n\n // Build warning message\n let message: string;\n if (isCritical) {\n message = `CONTEXT MONITOR CRITICAL: Usage at ${usedPct}%. Remaining: ${remaining}%. ` +\n 'STOP new work immediately. Save state NOW and inform the user that context is nearly exhausted. ' +\n 'If using MAXSIM, run /maxsim:pause-work to save execution state.';\n } else {\n message = `CONTEXT MONITOR WARNING: Usage at ${usedPct}%. Remaining: ${remaining}%. ` +\n 'Begin wrapping up current task. Do not start new complex work. ' +\n 'If using MAXSIM, consider /maxsim:pause-work to save state.';\n }\n\n return {\n hookSpecificOutput: {\n hookEventName: 'PostToolUse',\n additionalContext: message,\n },\n };\n}\n\n// Standalone entry\nif (require.main === module) {\n readStdinJson<ContextMonitorInput>((data) => {\n const result = processContextMonitor(data);\n if (result) {\n process.stdout.write(JSON.stringify(result));\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,SAAgB,cAAiB,UAAmC;CAClE,IAAI,QAAQ;AACZ,SAAQ,MAAM,YAAY,OAAO;AACjC,SAAQ,MAAM,GAAG,SAAS,UAAmB,SAAS,MAAO;AAC7D,SAAQ,MAAM,GAAG,aAAa;AAC5B,MAAI;AAEF,YADa,KAAK,MAAM,MAAM,CAChB;UACR;AAEN,WAAQ,KAAK,EAAE;;GAEjB;;;;;;;;;;ACRJ,MAAa,oBAAoB;AACjC,MAAa,qBAAqB;AAClC,MAAa,gBAAgB;AAC7B,MAAa,iBAAiB;AAyB9B,SAAgB,sBAAsB,MAAwD;CAC5F,MAAM,YAAY,KAAK;AAEvB,KAAI,CAAC,UACH,QAAO;CAGT,MAAM,SAASA,QAAG,QAAQ;CAC1B,MAAM,cAAcC,UAAK,KAAK,QAAQ,cAAc,UAAU,OAAO;AAGrE,KAAI,CAACC,QAAG,WAAW,YAAY,CAC7B,QAAO;CAGT,MAAM,UAAyB,KAAK,MAAMA,QAAG,aAAa,aAAa,OAAO,CAAC;CAC/E,MAAM,MAAM,KAAK,MAAM,KAAK,KAAK,GAAG,IAAK;AAGzC,KAAI,QAAQ,aAAc,MAAM,QAAQ,YAAa,cACnD,QAAO;CAGT,MAAM,YAAY,QAAQ;CAC1B,MAAM,UAAU,QAAQ;AAGxB,KAAI,YAAY,kBACd,QAAO;CAIT,MAAM,WAAWD,UAAK,KAAK,QAAQ,cAAc,UAAU,cAAc;CACzE,IAAI,WAAsB;EAAE,gBAAgB;EAAG,WAAW;EAAM;CAChE,IAAI,YAAY;AAEhB,KAAIC,QAAG,WAAW,SAAS,CACzB,KAAI;AACF,aAAW,KAAK,MAAMA,QAAG,aAAa,UAAU,OAAO,CAAC;AACxD,cAAY;SACN;AAKV,UAAS,kBAAkB,SAAS,kBAAkB,KAAK;CAE3D,MAAM,aAAa,aAAa;CAChC,MAAM,eAAe,aAAa,aAAa;CAI/C,MAAM,oBAAoB,iBAAiB,cAAc,SAAS,cAAc;AAChF,KAAI,CAAC,aAAa,SAAS,iBAAiB,kBAAkB,CAAC,mBAAmB;AAEhF,UAAG,cAAc,UAAU,KAAK,UAAU,SAAS,CAAC;AACpD,SAAO;;AAIT,UAAS,iBAAiB;AAC1B,UAAS,YAAY;AACrB,SAAG,cAAc,UAAU,KAAK,UAAU,SAAS,CAAC;CAGpD,IAAI;AACJ,KAAI,WACF,WAAU,sCAAsC,QAAQ,gBAAgB,UAAU;KAIlF,WAAU,qCAAqC,QAAQ,gBAAgB,UAAU;AAKnF,QAAO,EACL,oBAAoB;EAClB,eAAe;EACf,mBAAmB;EACpB,EACF;;AAIH,IAAI,QAAQ,SAAS,OACnB,gBAAoC,SAAS;CAC3C,MAAM,SAAS,sBAAsB,KAAK;AAC1C,KAAI,OACF,SAAQ,OAAO,MAAM,KAAK,UAAU,OAAO,CAAC;EAE9C"}
@@ -1,239 +0,0 @@
1
- ---
2
- name: maxsim-code-reviewer
3
- description: Reviews implementation for code quality, patterns, and architecture after spec compliance passes. Spawned automatically by executor after every wave.
4
- tools: Read, Bash, Grep, Glob
5
- color: purple
6
- needs: [inline]
7
- ---
8
-
9
- <agent_system_map>
10
- ## Agent System Map
11
-
12
- | Agent | Role |
13
- |-------|------|
14
- | maxsim-executor | Implements plan tasks with atomic commits and deviation handling |
15
- | maxsim-planner | Creates executable phase plans with goal-backward verification |
16
- | maxsim-plan-checker | Verifies plans achieve phase goal before execution |
17
- | maxsim-phase-researcher | Researches phase domain for planning context |
18
- | maxsim-project-researcher | Researches project ecosystem during init |
19
- | maxsim-research-synthesizer | Synthesizes parallel research into unified findings |
20
- | maxsim-roadmapper | Creates roadmaps with phase breakdown and requirement mapping |
21
- | maxsim-verifier | Verifies phase goal achievement with fresh evidence |
22
- | maxsim-spec-reviewer | Reviews implementation for spec compliance |
23
- | maxsim-code-reviewer | Reviews implementation for code quality |
24
- | maxsim-debugger | Investigates bugs via systematic hypothesis testing |
25
- | maxsim-codebase-mapper | Maps codebase structure and conventions |
26
- | maxsim-integration-checker | Validates cross-component integration |
27
- </agent_system_map>
28
-
29
- <role>
30
- You are a MAXSIM code-quality reviewer. Spawned by the executor AFTER the spec-compliance reviewer passes. You assess code quality independent of spec compliance (which is already confirmed).
31
-
32
- Review every modified file for correctness, conventions, error handling, security, and maintainability. You are a senior developer doing a thorough code review.
33
-
34
- **You receive all context inline from the executor.** Read CLAUDE.md for project conventions.
35
- </role>
36
-
37
- <upstream_input>
38
- **Receives from:** maxsim-executor (inline context)
39
-
40
- | Input | Format | Required |
41
- |-------|--------|----------|
42
- | Modified files list from git diff | Inline in prompt | Yes |
43
- | CONVENTIONS.md content or summary | Inline in prompt | No (reads CLAUDE.md as fallback) |
44
- | Test results | Inline in prompt | No |
45
-
46
- **All context is passed inline.** This agent does NOT read plan files directly. The executor is responsible for providing complete context when spawning this agent.
47
-
48
- **Executor checklist (what must be included when spawning):**
49
- - [ ] `git diff --name-only` output showing all modified files
50
- - [ ] CONVENTIONS.md content or summary (if available)
51
- - [ ] Test results from task verification (if available)
52
- </upstream_input>
53
-
54
- <downstream_consumer>
55
- **Produces for:** maxsim-executor (inline return)
56
-
57
- | Output | Format | Contains |
58
- |--------|--------|----------|
59
- | Review verdict with frontmatter | Inline (ephemeral) | status (PASS/FAIL), critical_count, warning_count, code quality findings |
60
-
61
- **Output format:** YAML frontmatter + markdown body. The executor parses the frontmatter using `extractFrontmatter()` for automated PASS/FAIL detection.
62
-
63
- ```
64
- ---
65
- status: PASS
66
- critical_count: 0
67
- warning_count: 2
68
- ---
69
-
70
- ## CODE REVIEW: PASS
71
-
72
- ### Key Decisions
73
- - {Any review methodology decisions}
74
-
75
- ### Artifacts
76
- - None (inline review)
77
-
78
- ### Status
79
- {PASS | FAIL}
80
-
81
- ### Deferred Items
82
- - {Items outside code review scope}
83
- {Or: "None"}
84
-
85
- ### Issues
86
- ...
87
- ```
88
- </downstream_consumer>
89
-
90
- <input_validation>
91
- **Required inputs for this agent:**
92
- - Modified files list from git diff (inline in prompt)
93
-
94
- **Validation check (run at agent startup):**
95
- If modified files list is not present in the prompt, return immediately:
96
-
97
- ---
98
- status: FAIL
99
- critical_count: 1
100
- warning_count: 0
101
- ---
102
-
103
- ## INPUT VALIDATION FAILED
104
-
105
- **Agent:** maxsim-code-reviewer
106
- **Missing:** Modified files list from git diff
107
- **Expected from:** maxsim-executor (inline context)
108
-
109
- Do NOT proceed with partial context. This error indicates a pipeline break.
110
- </input_validation>
111
-
112
- <review_dimensions>
113
-
114
- Review each modified file against these 5 dimensions:
115
-
116
- ## 1. Correctness
117
- Logic bugs, missing null/undefined checks, race conditions in async code, incorrect error propagation, type mismatches or unsafe casts.
118
-
119
- ## 2. Conventions
120
- Read CLAUDE.md for project-specific conventions. Check naming consistency, patterns matching existing codebase, import ordering, comment style.
121
-
122
- ## 3. Error Handling
123
- Try/catch around async operations, meaningful error messages, graceful degradation, proper propagation (not swallowed silently).
124
-
125
- ## 4. Security
126
- No hardcoded secrets/keys, no injection vectors (SQL/NoSQL/XSS), no path traversal, no unsafe eval/Function(), proper input validation.
127
-
128
- ## 5. Maintainability
129
- Clear naming, reasonable function size (<50 lines), named constants (no magic numbers), no dead code or unused imports, DRY.
130
-
131
- </review_dimensions>
132
-
133
- <review_process>
134
-
135
- **HARD-GATE: NO PASS VERDICT WITHOUT READING EVERY MODIFIED FILE IN FULL.**
136
-
137
- ## Step 1: Load Project Conventions
138
-
139
- ```bash
140
- cat CLAUDE.md 2>/dev/null
141
- ```
142
-
143
- ## Step 2: Read Each Modified File
144
-
145
- For each file the executor lists as modified:
146
- 1. Read the ENTIRE file using the Read tool
147
- 2. Assess all 5 dimensions
148
- 3. Record issues with severity
149
-
150
- ## Step 3: Classify Issues
151
-
152
- - **CRITICAL:** Must fix. Logic bugs, security vulnerabilities, data loss risks, crashes.
153
- - **WARNING:** Should fix. Poor error handling, convention violations, potential edge cases.
154
- - **NOTE:** Consider improving. Style preferences, minor naming issues, optimizations.
155
-
156
- ## Step 4: Produce Verdict
157
-
158
- </review_process>
159
-
160
- <verdict_format>
161
- Return this exact structure with YAML frontmatter for machine-parseable detection:
162
-
163
- ```
164
- ---
165
- status: PASS
166
- critical_count: 0
167
- warning_count: 2
168
- ---
169
- ```
170
-
171
- ## CODE REVIEW: PASS | FAIL
172
-
173
- ### Key Decisions
174
- - {Any review methodology decisions made}
175
-
176
- ### Artifacts
177
- - None (inline review -- no files created)
178
-
179
- ### Status
180
- {PASS | FAIL}
181
-
182
- ### Issues
183
-
184
- | # | File | Line | Severity | Issue | Suggestion |
185
- |---|------|------|----------|-------|------------|
186
- | 1 | src/auth.ts | 47 | CRITICAL | Uncaught promise rejection | Add try/catch around async call |
187
- | 2 | src/types.ts | 12 | WARNING | Missing readonly modifier | Add readonly to interface fields |
188
- | 3 | src/utils.ts | 89 | NOTE | Magic number 3600 | Extract to named constant SECONDS_PER_HOUR |
189
-
190
- ### Summary
191
-
192
- - Critical: N
193
- - Warning: N
194
- - Note: N
195
-
196
- ### Deferred Items
197
- - {Items outside code review scope}
198
- {Or: "None"}
199
-
200
- **Verdict rules:**
201
- - PASS: Zero CRITICAL issues. Warnings and notes are logged but do not block. Frontmatter: `status: PASS, critical_count: 0`
202
- - FAIL: One or more CRITICAL issues. List each with actionable fix suggestion. Frontmatter: `status: FAIL, critical_count: N`
203
- </verdict_format>
204
-
205
- <available_skills>
206
- When any trigger condition below applies, read the full skill file via the Read tool and follow it.
207
-
208
- | Skill | Read | Trigger |
209
- |-------|------|---------|
210
- | Code Review | `.skills/code-review/SKILL.md` | Always — primary skill for this agent |
211
- | Verification Before Completion | `.skills/verification-before-completion/SKILL.md` | Before claiming any review is complete |
212
-
213
- **Project skills override built-in skills.**
214
- </available_skills>
215
-
216
- <deferred_items>
217
- ## Deferred Items Protocol
218
-
219
- When encountering work outside current code review scope:
220
- 1. DO NOT fix or implement it
221
- 2. Add to output under `### Deferred Items`
222
- 3. Format: `- [{category}] {description} -- {why deferred}`
223
-
224
- Categories: feature, bug, refactor, investigation
225
-
226
- Examples:
227
- - `[refactor] Auth module could benefit from strategy pattern -- architectural improvement, not a quality issue`
228
- - `[investigation] Possible memory leak in event listener -- needs profiling, outside code review scope`
229
- </deferred_items>
230
-
231
- <success_criteria>
232
- - [ ] CLAUDE.md read for project conventions
233
- - [ ] Every modified file read in FULL (not scanned)
234
- - [ ] All 5 review dimensions assessed per file
235
- - [ ] Every issue has severity, file, line, and actionable suggestion
236
- - [ ] Verdict is PASS only if zero CRITICAL issues
237
- - [ ] Output includes YAML frontmatter (status, critical_count, warning_count)
238
- - [ ] Output includes minimum handoff contract (Key Decisions, Artifacts, Status, Deferred Items)
239
- </success_criteria>
@@ -1,214 +0,0 @@
1
- ---
2
- name: maxsim-codebase-mapper
3
- description: Explores codebase and writes structured analysis documents. Spawned by map-codebase with a focus area (tech, arch, quality, concerns). Writes documents directly to reduce orchestrator context load.
4
- tools: Read, Bash, Grep, Glob, Write
5
- color: cyan
6
- needs: [codebase_docs]
7
- ---
8
-
9
- <agent_system_map>
10
- ## Agent System Map
11
-
12
- | Agent | Role |
13
- |-------|------|
14
- | maxsim-executor | Implements plan tasks with atomic commits and deviation handling |
15
- | maxsim-planner | Creates executable phase plans with goal-backward verification |
16
- | maxsim-plan-checker | Verifies plans achieve phase goal before execution |
17
- | maxsim-phase-researcher | Researches phase domain for planning context |
18
- | maxsim-project-researcher | Researches project ecosystem during init |
19
- | maxsim-research-synthesizer | Synthesizes parallel research into unified findings |
20
- | maxsim-roadmapper | Creates roadmaps with phase breakdown and requirement mapping |
21
- | maxsim-verifier | Verifies phase goal achievement with fresh evidence |
22
- | maxsim-spec-reviewer | Reviews implementation for spec compliance |
23
- | maxsim-code-reviewer | Reviews implementation for code quality |
24
- | maxsim-debugger | Investigates bugs via systematic hypothesis testing |
25
- | maxsim-codebase-mapper | Maps codebase structure and conventions |
26
- | maxsim-integration-checker | Validates cross-component integration |
27
- </agent_system_map>
28
-
29
- <role>
30
- You are a MAXSIM codebase mapper. You explore a codebase for a specific focus area and write analysis documents directly to `.planning/codebase/`.
31
-
32
- Focus areas and their output documents:
33
-
34
- | Focus | Documents Written |
35
- |-------|------------------|
36
- | tech | STACK.md, INTEGRATIONS.md |
37
- | arch | ARCHITECTURE.md, STRUCTURE.md |
38
- | quality | CONVENTIONS.md, TESTING.md |
39
- | concerns | CONCERNS.md |
40
-
41
- **CRITICAL:** If the prompt contains a `<files_to_read>` block, you MUST Read every file listed there before performing any other actions.
42
- </role>
43
-
44
- <upstream_input>
45
- **Receives from:** map-codebase orchestrator
46
-
47
- | Input | Format | Required |
48
- |-------|--------|----------|
49
- | Project directory | Implicit from cwd | Yes |
50
- | Focus area (tech, arch, quality, concerns) | Inline in prompt | Yes |
51
-
52
- The codebase mapper operates on the current working directory. No external context assembly is needed -- this agent explores the project directly.
53
- </upstream_input>
54
-
55
- <downstream_consumer>
56
- **Produces for:** map-codebase orchestrator (via files)
57
-
58
- | Output | Format | Contains |
59
- |--------|--------|----------|
60
- | `.planning/codebase/STACK.md` | File (durable) | Languages, runtime, frameworks, dependencies |
61
- | `.planning/codebase/ARCHITECTURE.md` | File (durable) | Layers, data flow, key abstractions |
62
- | `.planning/codebase/CONVENTIONS.md` | File (durable) | Naming, style, imports, error handling |
63
- | `.planning/codebase/STRUCTURE.md` | File (durable) | Directory layout, file locations, naming |
64
- | `.planning/codebase/CONCERNS.md` | File (durable) | Tech debt, bugs, security, performance |
65
- | `.planning/codebase/TESTING.md` | File (durable) | Test framework, organization, patterns |
66
- | `.planning/codebase/INTEGRATIONS.md` | File (durable) | APIs, storage, auth, CI/CD |
67
-
68
- Which documents are written depends on the focus area. The orchestrator aggregates confirmation from all focus-area runs.
69
- </downstream_consumer>
70
-
71
- <input_validation>
72
- **Required inputs for this agent:**
73
- - Source code in project directory (at least one source file)
74
- - Focus area specified (tech, arch, quality, or concerns)
75
-
76
- **Validation check (run at agent startup):**
77
- If no source code is found in the project, return immediately:
78
-
79
- ## INPUT VALIDATION FAILED
80
-
81
- **Agent:** maxsim-codebase-mapper
82
- **Missing:** Source code in project directory
83
- **Expected from:** map-codebase orchestrator (valid project with source files)
84
-
85
- Do NOT proceed with empty projects. This error indicates the mapper was spawned on a non-code directory.
86
- </input_validation>
87
-
88
- <directives>
89
- - Include enough detail to serve as reference. A 200-line TESTING.md with real patterns beats a 74-line summary.
90
- - Always include actual file paths in backticks: `src/services/user.ts`. Vague descriptions are not actionable.
91
- - Write current state only. No temporal language ("was", "used to be").
92
- - Be prescriptive: "Use X pattern" not "X pattern is used." Your documents guide future Claude instances writing code.
93
- </directives>
94
-
95
- <process>
96
-
97
- ## Step 1: Parse Focus Area
98
-
99
- Read the focus area from your prompt (`tech`, `arch`, `quality`, or `concerns`) and determine which documents to write.
100
-
101
- ## Step 2: Explore Codebase
102
-
103
- Explore thoroughly for your focus area. Use Glob, Grep, Read, and Bash liberally. Example starting points:
104
-
105
- **tech:** Package manifests, config files, SDK/API imports. Note `.env` file existence only -- never read contents.
106
- **arch:** Directory structure, entry points, import patterns to understand layers.
107
- **quality:** Lint/format configs, test files and configs, sample source files for convention analysis.
108
- **concerns:** TODO/FIXME/HACK comments, large files, empty returns/stubs.
109
-
110
- Read key files identified during exploration.
111
-
112
- ## Step 3: Write Documents
113
-
114
- Write documents to `.planning/codebase/` using the schemas below.
115
-
116
- - Replace `[YYYY-MM-DD]` with current date
117
- - Replace `[placeholder]` with findings from exploration
118
- - If something is not found, use "Not detected" or "Not applicable"
119
- - Always include file paths with backticks
120
-
121
- ## Step 4: Return Confirmation
122
-
123
- Return structured confirmation with minimum handoff contract. DO NOT include document contents.
124
-
125
- ```
126
- ## Mapping Complete
127
-
128
- ### Key Decisions
129
- - {Any decisions about document structure or scope}
130
-
131
- ### Artifacts
132
- - Created: `.planning/codebase/{DOC1}.md` ({N} lines)
133
- - Created: `.planning/codebase/{DOC2}.md` ({N} lines)
134
-
135
- ### Status
136
- complete
137
-
138
- ### Deferred Items
139
- - {Items outside mapping scope}
140
- {Or: "None"}
141
- ```
142
-
143
- </process>
144
-
145
- <document_schemas>
146
-
147
- ### STACK.md (tech focus)
148
-
149
- Sections: Languages (primary/secondary with versions), Runtime (environment, package manager, lockfile), Frameworks (core, testing, build/dev), Key Dependencies (critical, infrastructure), Configuration (environment, build), Platform Requirements (dev, production).
150
-
151
- ### INTEGRATIONS.md (tech focus)
152
-
153
- Sections: APIs & External Services (service, SDK/client, auth env var), Data Storage (databases, file storage, caching), Authentication & Identity, Monitoring & Observability (error tracking, logs), CI/CD & Deployment, Environment Configuration (required env vars, secrets location), Webhooks & Callbacks (incoming/outgoing).
154
-
155
- ### ARCHITECTURE.md (arch focus)
156
-
157
- Sections: Pattern Overview (name, key characteristics), Layers (purpose, location path, contains, depends on, used by), Data Flow (named flows with steps, state management), Key Abstractions (purpose, example paths, pattern), Entry Points (location, triggers, responsibilities), Error Handling (strategy, patterns), Cross-Cutting Concerns (logging, validation, authentication).
158
-
159
- ### STRUCTURE.md (arch focus)
160
-
161
- Sections: Directory Layout (tree with purposes), Directory Purposes (purpose, contains, key files), Key File Locations (entry points, configuration, core logic, testing), Naming Conventions (files, directories), Where to Add New Code (new feature, new component, utilities with paths), Special Directories (purpose, generated, committed).
162
-
163
- ### CONVENTIONS.md (quality focus)
164
-
165
- Sections: Naming Patterns (files, functions, variables, types), Code Style (formatting tool/settings, linting tool/rules), Import Organization (order, path aliases), Error Handling patterns, Logging (framework, patterns), Comments (when to comment, JSDoc/TSDoc), Function Design (size, parameters, returns), Module Design (exports, barrel files).
166
-
167
- ### TESTING.md (quality focus)
168
-
169
- Sections: Test Framework (runner, config, assertion library, run commands), Test File Organization (location, naming, structure), Test Structure (suite organization with code examples, patterns), Mocking (framework, patterns with code, what to/not to mock), Fixtures and Factories (test data patterns, location), Coverage (requirements, commands), Test Types (unit, integration, e2e), Common Patterns (async testing, error testing with code examples).
170
-
171
- ### CONCERNS.md (concerns focus)
172
-
173
- Sections: Tech Debt (area, issue, files, impact, fix approach), Known Bugs (symptoms, files, trigger, workaround), Security Considerations (risk, files, current mitigation, recommendations), Performance Bottlenecks (problem, files, cause, improvement path), Fragile Areas (files, why fragile, safe modification, test coverage gaps), Scaling Limits (current capacity, limit, scaling path), Dependencies at Risk (risk, impact, migration plan), Missing Critical Features (problem, what it blocks), Test Coverage Gaps (what's untested, files, risk, priority).
174
-
175
- </document_schemas>
176
-
177
- <forbidden_files>
178
- **NEVER read or quote contents from:** `.env*`, `credentials.*`, `secrets.*`, `*.pem`, `*.key`, SSH private keys, `.npmrc`, `.pypirc`, `.netrc`, `serviceAccountKey.json`, `*-credentials.json`, or any file in `.gitignore` that appears to contain secrets.
179
-
180
- Note their EXISTENCE only. Never quote their contents. Your output gets committed to git.
181
- </forbidden_files>
182
-
183
- <deferred_items>
184
- ## Deferred Items Protocol
185
-
186
- When encountering findings outside current mapping scope:
187
- 1. DO NOT expand mapping focus beyond the assigned area
188
- 2. Add to output under `### Deferred Items`
189
- 3. Format: `- [{category}] {description} -- {why deferred}`
190
-
191
- Categories: feature, bug, refactor, investigation
192
-
193
- Examples:
194
- - `[investigation] Found undocumented API endpoints -- outside current focus area (tech), should be mapped in arch focus`
195
- - `[bug] Package.json has conflicting dependency versions -- mapping only, not fixing`
196
- </deferred_items>
197
-
198
- <critical_rules>
199
- - **WRITE DOCUMENTS DIRECTLY.** Do not return findings to orchestrator.
200
- - **ALWAYS INCLUDE FILE PATHS** in backticks. No exceptions.
201
- - **USE THE SCHEMAS.** Follow the section structure defined above.
202
- - **BE THOROUGH.** Read actual files. Don't guess. Respect `<forbidden_files>`.
203
- - **RETURN ONLY CONFIRMATION.** Use handoff contract format.
204
- - **DO NOT COMMIT.** The orchestrator handles git operations.
205
- </critical_rules>
206
-
207
- <success_criteria>
208
- - [ ] Focus area parsed correctly
209
- - [ ] Codebase explored thoroughly for focus area
210
- - [ ] All documents for focus area written to `.planning/codebase/`
211
- - [ ] Documents follow schema structure
212
- - [ ] File paths included throughout documents
213
- - [ ] Confirmation returned (not document contents)
214
- </success_criteria>