@softspark/ai-toolkit 1.2.0 → 1.3.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 (142) hide show
  1. package/AGENTS.md +5 -29
  2. package/CHANGELOG.md +39 -0
  3. package/README.md +170 -27
  4. package/app/.claude-plugin/plugin.json +2 -2
  5. package/app/ARCHITECTURE.md +35 -19
  6. package/app/agents/ai-engineer.md +47 -5
  7. package/app/agents/fact-checker.md +1 -1
  8. package/app/agents/llm-ops-engineer.md +2 -2
  9. package/app/agents/{mcp-server-architect.md → mcp-specialist.md} +124 -18
  10. package/app/agents/mcp-testing-engineer.md +2 -2
  11. package/app/agents/nlp-engineer.md +1 -1
  12. package/app/agents/orchestrator.md +3 -4
  13. package/app/agents/project-planner.md +1 -1
  14. package/app/agents/technical-researcher.md +71 -21
  15. package/app/hooks/commit-quality.sh +53 -0
  16. package/app/hooks/governance-capture.sh +77 -0
  17. package/app/hooks/guard-config.sh +46 -0
  18. package/app/hooks/mcp-health.sh +53 -0
  19. package/app/hooks/pre-compact-save.sh +34 -0
  20. package/app/hooks/session-context.sh +60 -0
  21. package/app/hooks.json +60 -0
  22. package/app/mcp-templates/README.md +105 -0
  23. package/app/mcp-templates/brave-search.json +13 -0
  24. package/app/mcp-templates/cloudflare.json +14 -0
  25. package/app/mcp-templates/context7.json +10 -0
  26. package/app/mcp-templates/custom-template.json +13 -0
  27. package/app/mcp-templates/datadog.json +15 -0
  28. package/app/mcp-templates/docker.json +10 -0
  29. package/app/mcp-templates/fetch.json +10 -0
  30. package/app/mcp-templates/filesystem.json +10 -0
  31. package/app/mcp-templates/git.json +10 -0
  32. package/app/mcp-templates/github.json +13 -0
  33. package/app/mcp-templates/google-drive.json +15 -0
  34. package/app/mcp-templates/google-maps.json +13 -0
  35. package/app/mcp-templates/grafana.json +14 -0
  36. package/app/mcp-templates/linear.json +13 -0
  37. package/app/mcp-templates/memory.json +10 -0
  38. package/app/mcp-templates/notion.json +13 -0
  39. package/app/mcp-templates/postgres.json +10 -0
  40. package/app/mcp-templates/puppeteer.json +10 -0
  41. package/app/mcp-templates/redis.json +13 -0
  42. package/app/mcp-templates/sentry.json +14 -0
  43. package/app/mcp-templates/sequential-thinking.json +10 -0
  44. package/app/mcp-templates/slack.json +14 -0
  45. package/app/mcp-templates/sqlite.json +10 -0
  46. package/app/mcp-templates/supabase.json +14 -0
  47. package/app/mcp-templates/vercel.json +13 -0
  48. package/app/plugins/research-pack/README.md +1 -1
  49. package/app/plugins/research-pack/plugin.json +1 -1
  50. package/app/rules/claude-toolkit-rules.md +1 -1
  51. package/app/rules/common/coding-style.md +52 -0
  52. package/app/rules/common/git-workflow.md +45 -0
  53. package/app/rules/common/performance.md +49 -0
  54. package/app/rules/common/security.md +59 -0
  55. package/app/rules/common/testing.md +53 -0
  56. package/app/rules/cpp/coding-style.md +55 -0
  57. package/app/rules/cpp/frameworks.md +55 -0
  58. package/app/rules/cpp/patterns.md +57 -0
  59. package/app/rules/cpp/security.md +61 -0
  60. package/app/rules/cpp/testing.md +58 -0
  61. package/app/rules/csharp/coding-style.md +54 -0
  62. package/app/rules/csharp/frameworks.md +60 -0
  63. package/app/rules/csharp/patterns.md +61 -0
  64. package/app/rules/csharp/security.md +60 -0
  65. package/app/rules/csharp/testing.md +58 -0
  66. package/app/rules/dart/coding-style.md +61 -0
  67. package/app/rules/dart/frameworks.md +59 -0
  68. package/app/rules/dart/patterns.md +62 -0
  69. package/app/rules/dart/security.md +60 -0
  70. package/app/rules/dart/testing.md +60 -0
  71. package/app/rules/golang/coding-style.md +50 -0
  72. package/app/rules/golang/frameworks.md +56 -0
  73. package/app/rules/golang/patterns.md +52 -0
  74. package/app/rules/golang/security.md +61 -0
  75. package/app/rules/golang/testing.md +54 -0
  76. package/app/rules/java/coding-style.md +56 -0
  77. package/app/rules/java/frameworks.md +54 -0
  78. package/app/rules/java/patterns.md +59 -0
  79. package/app/rules/java/security.md +60 -0
  80. package/app/rules/java/testing.md +55 -0
  81. package/app/rules/kotlin/coding-style.md +56 -0
  82. package/app/rules/kotlin/frameworks.md +54 -0
  83. package/app/rules/kotlin/patterns.md +54 -0
  84. package/app/rules/kotlin/security.md +62 -0
  85. package/app/rules/kotlin/testing.md +56 -0
  86. package/app/rules/php/coding-style.md +53 -0
  87. package/app/rules/php/frameworks.md +57 -0
  88. package/app/rules/php/patterns.md +63 -0
  89. package/app/rules/php/security.md +61 -0
  90. package/app/rules/php/testing.md +60 -0
  91. package/app/rules/python/coding-style.md +52 -0
  92. package/app/rules/python/frameworks.md +53 -0
  93. package/app/rules/python/patterns.md +53 -0
  94. package/app/rules/python/security.md +58 -0
  95. package/app/rules/python/testing.md +52 -0
  96. package/app/rules/ruby/coding-style.md +56 -0
  97. package/app/rules/ruby/frameworks.md +56 -0
  98. package/app/rules/ruby/patterns.md +61 -0
  99. package/app/rules/ruby/security.md +61 -0
  100. package/app/rules/ruby/testing.md +63 -0
  101. package/app/rules/rust/coding-style.md +52 -0
  102. package/app/rules/rust/frameworks.md +59 -0
  103. package/app/rules/rust/patterns.md +58 -0
  104. package/app/rules/rust/security.md +64 -0
  105. package/app/rules/rust/testing.md +54 -0
  106. package/app/rules/swift/coding-style.md +55 -0
  107. package/app/rules/swift/frameworks.md +63 -0
  108. package/app/rules/swift/patterns.md +63 -0
  109. package/app/rules/swift/security.md +63 -0
  110. package/app/rules/swift/testing.md +60 -0
  111. package/app/rules/typescript/coding-style.md +51 -0
  112. package/app/rules/typescript/frameworks.md +51 -0
  113. package/app/rules/typescript/patterns.md +51 -0
  114. package/app/rules/typescript/security.md +55 -0
  115. package/app/rules/typescript/testing.md +52 -0
  116. package/app/skills/app-builder/SKILL.md +1 -1
  117. package/app/skills/brand-voice/SKILL.md +92 -0
  118. package/app/skills/council/SKILL.md +133 -0
  119. package/app/skills/introspect/SKILL.md +125 -0
  120. package/bin/ai-toolkit.js +103 -2
  121. package/kb/reference/agents-catalog.md +10 -13
  122. package/kb/reference/architecture-overview.md +29 -6
  123. package/kb/reference/commands-catalog.md +4 -4
  124. package/kb/reference/competitive-features-implementation.md +677 -0
  125. package/kb/reference/extension-api.md +175 -0
  126. package/kb/reference/hooks-catalog.md +90 -14
  127. package/kb/reference/language-rules.md +167 -0
  128. package/kb/reference/manifest-install.md +165 -0
  129. package/kb/reference/mcp-templates.md +110 -0
  130. package/kb/reference/skills-catalog.md +9 -6
  131. package/llms-full.txt +1511 -59
  132. package/llms.txt +8 -3
  133. package/package.json +2 -2
  134. package/scripts/inject_hook_cli.py +330 -0
  135. package/scripts/install.py +241 -7
  136. package/scripts/install_steps/ai_tools.py +63 -1
  137. package/scripts/install_steps/detect_language.py +50 -0
  138. package/scripts/install_steps/install_state.py +117 -0
  139. package/scripts/mcp_manager.py +206 -0
  140. package/app/agents/mcp-expert.md +0 -228
  141. package/app/agents/rag-engineer.md +0 -201
  142. package/app/agents/research-synthesizer.md +0 -138
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: council
3
+ description: "4-perspective decision evaluation for architecture choices. Use when user wants multi-angle analysis, needs to decide between alternatives, or mentions 'council', 'evaluate decision', 'pros cons'."
4
+ user-invocable: true
5
+ effort: high
6
+ argument-hint: "[decision question or proposal to evaluate]"
7
+ agent: orchestrator
8
+ context: fork
9
+ allowed-tools: Read, Grep, Glob, Bash, Agent
10
+ ---
11
+
12
+ # Decision Council
13
+
14
+ $ARGUMENTS
15
+
16
+ Evaluate a decision from 4 distinct perspectives using parallel sub-agents, then synthesize a weighted recommendation.
17
+
18
+ ## Usage
19
+
20
+ ```
21
+ /council [decision question or proposal to evaluate]
22
+ ```
23
+
24
+ ## What This Command Does
25
+
26
+ 1. **Parses** the decision question from user input
27
+ 2. **Gathers** codebase context relevant to the decision
28
+ 3. **Spawns** 4 parallel sub-agents — each analyzing from a different perspective
29
+ 4. **Synthesizes** all perspectives into a structured recommendation with decision matrix
30
+
31
+ ## MANDATORY: You MUST use the Agent tool
32
+
33
+ **DO NOT analyze the decision yourself.** Your job is to parse the question, spawn 4 sub-agents in parallel via the `Agent` tool, and synthesize their outputs. If you attempt to provide all perspectives inline, you have failed.
34
+
35
+ ## Process
36
+
37
+ ### 1. Parse the Decision
38
+
39
+ Extract from the user's input:
40
+
41
+ - **The proposal** — what is being considered
42
+ - **The alternatives** — what the options are (if not stated, infer the implicit alternative: status quo)
43
+ - **The context** — what project/codebase/situation this applies to
44
+
45
+ If the question is too vague to evaluate, ask ONE clarifying question before proceeding.
46
+
47
+ ### 2. Gather Context
48
+
49
+ Before spawning agents, quickly scan the codebase for relevant context:
50
+
51
+ - Current tech stack, dependencies, patterns in use
52
+ - Existing code related to the decision area
53
+ - Configuration, infrastructure, or architectural choices already made
54
+
55
+ Include this context in each sub-agent prompt so perspectives are grounded in reality.
56
+
57
+ ### 3. Spawn 4 Sub-Agents in Parallel (REQUIRED)
58
+
59
+ Call the `Agent` tool **4 times in a single response** — all agents MUST launch in the same message to run in parallel.
60
+
61
+ | Agent | Role | Directive |
62
+ |-------|------|-----------|
63
+ | **Advocate** | Case FOR | Present the strongest case FOR the proposal. Find evidence, benefits, success stories. Reference relevant code/patterns in the codebase. Be persuasive but honest. |
64
+ | **Critic** | Case AGAINST | Present the strongest case AGAINST. Find risks, hidden costs, failure modes, alternatives that might be better. Be thorough but fair. |
65
+ | **Pragmatist** | Trade-offs | Evaluate practical trade-offs: implementation cost, timeline, team capacity, maintenance burden, migration risk, operational complexity. Ground estimates in the actual codebase size and patterns. |
66
+ | **User-Proxy** | User impact | Consider end-user and customer impact: UX changes, downtime during migration, performance implications, breaking changes, adoption friction, documentation needs. |
67
+
68
+ Each agent prompt MUST include:
69
+
70
+ 1. The original decision question
71
+ 2. The codebase context gathered in step 2
72
+ 3. The specific perspective this agent owns
73
+ 4. Instruction to search the codebase for supporting evidence
74
+ 5. Constraint: 200-400 words, concrete evidence over abstract arguments
75
+
76
+ ### 4. Synthesize
77
+
78
+ After all 4 agents complete, combine their outputs into the structured format below. Do NOT simply concatenate — identify agreements, contradictions, and conditional factors across perspectives.
79
+
80
+ ## Output Format
81
+
82
+ ```markdown
83
+ ## Decision Council: [Question]
84
+
85
+ ### Advocate (FOR)
86
+ [Summary of arguments for — key benefits and evidence]
87
+
88
+ ### Critic (AGAINST)
89
+ [Summary of arguments against — key risks and alternatives]
90
+
91
+ ### Pragmatist (TRADE-OFFS)
92
+ [Practical considerations — cost, timeline, complexity]
93
+
94
+ ### User-Proxy (USER IMPACT)
95
+ [End-user perspective — UX, performance, breaking changes]
96
+
97
+ ### Synthesis
98
+ **Recommendation:** [FOR / AGAINST / CONDITIONAL]
99
+ **Confidence:** [HIGH / MEDIUM / LOW]
100
+ **Key condition:** [Primary factor that would change the recommendation]
101
+
102
+ **Where perspectives agree:** [Common ground across agents]
103
+ **Where perspectives conflict:** [Key disagreements and why]
104
+
105
+ ### Decision Matrix
106
+ | Factor | Weight | FOR score (1-5) | AGAINST score (1-5) |
107
+ |--------|--------|-----------------|---------------------|
108
+ | Technical merit | [H/M/L] | [score] | [score] |
109
+ | Risk | [H/M/L] | [score] | [score] |
110
+ | Cost | [H/M/L] | [score] | [score] |
111
+ | Timeline | [H/M/L] | [score] | [score] |
112
+ | User impact | [H/M/L] | [score] | [score] |
113
+ | **Weighted total** | | **[total]** | **[total]** |
114
+ ```
115
+
116
+ ## Rules
117
+
118
+ - Each sub-agent must search the codebase for relevant evidence — no purely abstract arguments
119
+ - Sub-agents must be honest within their role — the Advocate should acknowledge weaknesses, the Critic should acknowledge strengths
120
+ - Keep each perspective to 200-400 words — density over length
121
+ - The synthesis must add value beyond summarizing — identify the decisive factor
122
+ - If the decision is clearly one-sided after analysis, say so — don't manufacture false balance
123
+
124
+ ## Anti-Patterns
125
+
126
+ - Don't skip the codebase scan — ungrounded opinions are worthless
127
+ - Don't let all 4 perspectives say the same thing — enforce distinct angles
128
+ - Don't give a wishy-washy "it depends" synthesis — commit to a recommendation with conditions
129
+ - Don't ignore the status quo — "do nothing" is always an alternative
130
+
131
+ ## READ-ONLY
132
+
133
+ This skill evaluates decisions. It does NOT implement changes.
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: introspect
3
+ description: "Agent self-debugging and recovery. Use when stuck in loops, making repeated errors, or quality degrades. Triggers: introspect, self-debug, stuck, loop, why failing."
4
+ user-invocable: true
5
+ effort: low
6
+ argument-hint: "[symptom or 'stuck']"
7
+ agent: debugger
8
+ context: fork
9
+ allowed-tools: Read, Grep
10
+ ---
11
+
12
+ # Agent Self-Debugging
13
+
14
+ $ARGUMENTS
15
+
16
+ Structured self-analysis for when the agent is stuck, looping, or producing degraded output.
17
+
18
+ ---
19
+
20
+ ## Step 1: Capture Failure State
21
+
22
+ Before diagnosing, gather the facts. Answer each question concisely:
23
+
24
+ | Question | Answer |
25
+ |----------|--------|
26
+ | **Last goal/task** | What was the agent trying to accomplish? |
27
+ | **Actions taken** | List the last 3-5 actions in order |
28
+ | **Errors or unexpected results** | What went wrong? What was expected vs actual? |
29
+ | **Attempt count** | How many times has this been tried? |
30
+ | **Time spent** | Rough estimate of effort so far |
31
+
32
+ ---
33
+
34
+ ## Step 2: Classify the Failure Pattern
35
+
36
+ Identify which pattern matches the current situation:
37
+
38
+ | Pattern | Symptoms | Common Cause |
39
+ |---------|----------|--------------|
40
+ | **Loop** | Same action repeated 3+ times | Missing exit condition, wrong approach |
41
+ | **Drift** | Actions diverge from original goal | Lost context, scope creep |
42
+ | **Assumption Error** | Working with wrong mental model | Didn't read code, assumed behavior |
43
+ | **Tool Misuse** | Wrong tool for the job | Grep when should Read, Bash when should Edit |
44
+ | **Context Overflow** | Forgetting earlier findings | Too much context, need compaction |
45
+ | **Wrong Abstraction** | Over-engineering simple task | Premature abstraction, YAGNI violation |
46
+ | **Missing Information** | Can't proceed without data | Need to ask user, read more code |
47
+
48
+ Pick the **single best match**. If multiple apply, pick the root cause pattern (the one that, if fixed, would resolve the others).
49
+
50
+ ---
51
+
52
+ ## Step 3: Diagnose Root Cause
53
+
54
+ Answer these three questions:
55
+
56
+ 1. **What assumption was wrong?** — Identify the specific belief that led to failure.
57
+ 2. **What information was missing?** — What would have prevented the failure if known earlier?
58
+ 3. **What would a fresh start look like?** — If starting over with current knowledge, what would the first action be?
59
+
60
+ ---
61
+
62
+ ## Step 4: Select Recovery Action
63
+
64
+ Apply the **smallest possible fix** — do not restart from scratch unless absolutely necessary:
65
+
66
+ | Pattern | Recovery Action |
67
+ |---------|----------------|
68
+ | **Loop** | Stop. Change approach entirely — different tool, different strategy, different angle. |
69
+ | **Drift** | Re-read the original user request verbatim. Reset scope to exactly what was asked. |
70
+ | **Assumption Error** | Read the actual code, file, or docs. Do not guess. Verify the mental model. |
71
+ | **Tool Misuse** | Switch to the correct tool. Read instead of Grep for full context. Edit instead of Bash for file changes. |
72
+ | **Context Overflow** | Summarize all findings so far in 5 bullet points. Compact and continue. |
73
+ | **Wrong Abstraction** | Delete the abstraction. Do the simplest, most direct thing that works. |
74
+ | **Missing Information** | Ask the user exactly ONE specific question. Do not guess. |
75
+
76
+ ---
77
+
78
+ ## Step 5: Produce the Introspection Report
79
+
80
+ Output exactly this format:
81
+
82
+ ```markdown
83
+ ## Introspection Report
84
+
85
+ **Pattern:** [Loop|Drift|Assumption Error|Tool Misuse|Context Overflow|Wrong Abstraction|Missing Information]
86
+ **Root Cause:** [1-2 sentence diagnosis]
87
+ **Recovery Action:** [Specific next step]
88
+ **Confidence:** [HIGH|MEDIUM|LOW]
89
+
90
+ ### What happened
91
+ [Brief timeline of actions taken — 3-5 bullet points max]
92
+
93
+ ### What went wrong
94
+ [Specific diagnosis — what assumption failed, what was missed]
95
+
96
+ ### What to do next
97
+ [ONE concrete action — not a plan, a single next step]
98
+ ```
99
+
100
+ ---
101
+
102
+ ## Self-Correction Rules
103
+
104
+ These rules are non-negotiable during recovery:
105
+
106
+ 1. **Never retry the exact same action.** If it failed once, it will fail again. Change something.
107
+ 2. **Never continue a loop "hoping it will work this time."** Hope is not a strategy.
108
+ 3. **Prefer reading code over guessing behavior.** Open the file. Read the function. Check the types.
109
+ 4. **When in doubt, ask the user** rather than making assumptions. One specific question beats three wrong guesses.
110
+ 5. **A 2-line fix is better than a 50-line refactor.** Solve the immediate problem first.
111
+ 6. **Check if the goal is still correct** before optimizing the approach. Sometimes the task itself needs clarification.
112
+ 7. **If stuck for more than 3 attempts, escalate.** Tell the user what you tried, what failed, and what you need.
113
+
114
+ ---
115
+
116
+ ## Quick Self-Check (Use Before Retrying Anything)
117
+
118
+ Before taking the next action after introspection, answer:
119
+
120
+ - [ ] Is this action **different** from what I already tried?
121
+ - [ ] Am I working on the **original goal**, not a tangent?
122
+ - [ ] Do I have **enough information** to succeed, or am I guessing?
123
+ - [ ] Is this the **simplest** approach that could work?
124
+
125
+ If any answer is "no", stop and address that first.
package/bin/ai-toolkit.js CHANGED
@@ -35,7 +35,6 @@ const GENERATORS = {
35
35
  */
36
36
  const SCRIPT_COMMANDS = {
37
37
  'install': { script: 'install.py' },
38
- 'update': { script: 'install.py' },
39
38
  'uninstall': { script: 'uninstall.py' },
40
39
  'validate': { script: 'validate.py', toolkitCwd: true },
41
40
  'doctor': { script: 'doctor.py', toolkitCwd: true },
@@ -52,11 +51,14 @@ const SCRIPT_COMMANDS = {
52
51
  /** @type {Record<string, string>} */
53
52
  const COMMANDS = {
54
53
  install: 'First-time global install into ~/.claude/ (use --local to also set up project configs)',
55
- update: 'Re-apply toolkit after npm update (use --local to also refresh project configs)',
54
+ update: 'Re-apply toolkit with saved modules from state.json (use --local to also refresh project configs)',
55
+ status: 'Show installed modules, version, and profile from state.json',
56
56
  reset: 'Wipe and recreate project-local configs from scratch (requires --local)',
57
57
  uninstall: 'Remove ai-toolkit from ~/.claude/',
58
58
  'add-rule': 'Register a rule file in ~/.ai-toolkit/rules/ (applied on every install/update)',
59
59
  'remove-rule': 'Unregister a rule from ~/.ai-toolkit/rules/ and remove its block from CLAUDE.md',
60
+ 'inject-hook': 'Inject external hooks into ~/.claude/settings.json (tagged with _source for idempotent updates)',
61
+ 'remove-hook': 'Remove injected hooks by source name from ~/.claude/settings.json',
60
62
  validate: 'Verify toolkit integrity',
61
63
  doctor: 'Check install health, hooks, and artifact drift',
62
64
  eject: 'Export standalone config (no symlinks, no toolkit dependency)',
@@ -65,6 +67,7 @@ const COMMANDS = {
65
67
  evaluate: 'Run skill evaluation suite',
66
68
  stats: 'Show skill usage statistics (--reset to clear, --json for raw output)',
67
69
  create: 'Scaffold new skill from template (e.g. create skill my-lint --template=linter)',
70
+ mcp: 'Manage MCP server templates (list, show, add, remove)',
68
71
  plugin: 'Manage plugin packs (install, remove, update, clean, list, status)',
69
72
  sync: 'Sync config to/from GitHub Gist (--export, --push, --pull, --import)',
70
73
  'cursor-rules': 'Generate .cursorrules for Cursor IDE',
@@ -180,6 +183,8 @@ function showHelp() {
180
183
  console.log(' --skip <list> Skip listed components');
181
184
  console.log(' --local Also set up project-local configs (CLAUDE.md, settings, constitution, copilot, cline, roo, aider, git hooks)');
182
185
  console.log(' --profile <p> Install profile: minimal (agents+skills), standard (default), strict (all+git hooks)');
186
+ console.log(' --modules <list> Install specific modules (e.g. core,agents,rules-typescript)');
187
+ console.log(' --auto-detect Detect project languages and install matching rule modules');
183
188
  console.log(' --list, --dry-run Dry-run: show what would be applied');
184
189
  console.log('\nOptions for create:');
185
190
  console.log(' skill <name> --template=<type> Scaffold skill (types: linter, reviewer, generator, workflow, knowledge)');
@@ -194,6 +199,12 @@ function showHelp() {
194
199
  console.log('\nOptions for remove-rule:');
195
200
  console.log(' <rule-name> Name of rule to unregister (filename without .md)');
196
201
  console.log(' [target-dir] Target dir containing .claude/CLAUDE.md (default: $HOME)');
202
+ console.log('\nOptions for inject-hook:');
203
+ console.log(' <hooks-file> Path to JSON file with {"hooks": {"EventName": [...]}} format');
204
+ console.log(' [target-dir] Target dir containing .claude/settings.json (default: $HOME)');
205
+ console.log('\nOptions for remove-hook:');
206
+ console.log(' <source-name> Source tag to remove (derived from hooks filename stem)');
207
+ console.log(' [target-dir] Target dir containing .claude/settings.json (default: $HOME)');
197
208
  console.log('\nOptions for add-rule:');
198
209
  console.log(' <rule-file> Path to .md rule file to register globally');
199
210
  console.log(' [rule-name] Override rule name (default: filename without .md)');
@@ -207,6 +218,11 @@ function showHelp() {
207
218
  console.log(' remove --all Remove all installed plugins');
208
219
  console.log(' list Show available plugin packs with install status');
209
220
  console.log(' status Show currently installed plugins with data stats');
221
+ console.log('\nOptions for mcp:');
222
+ console.log(' list List available MCP templates');
223
+ console.log(' show <name> Show template details');
224
+ console.log(' add <name> [names..] [--target <path>] Add servers to .mcp.json');
225
+ console.log(' remove <name> Remove a server from .mcp.json');
210
226
  console.log('\nOptions for doctor:');
211
227
  console.log(' --fix Auto-repair detected issues');
212
228
  console.log('\nOptions for eject:');
@@ -300,6 +316,47 @@ function handleAddRule(args) {
300
316
  run(scriptPath('add_rule.py'), ruleName ? [absRuleFile, ruleName] : [absRuleFile]);
301
317
  }
302
318
 
319
+ /**
320
+ * Handle `ai-toolkit inject-hook` -- injects external hooks into settings.json.
321
+ * @param {string[]} args
322
+ */
323
+ function handleInjectHook(args) {
324
+ const hooksFile = args[0];
325
+ if (!hooksFile) {
326
+ console.error('Usage: ai-toolkit inject-hook <hooks-file.json> [target-dir]');
327
+ process.exit(1);
328
+ }
329
+ const absHooksFile = path.resolve(CWD, hooksFile);
330
+ const targetDir = args[1] || process.env.HOME;
331
+ run(scriptPath('inject_hook_cli.py'), [absHooksFile, targetDir]);
332
+ }
333
+
334
+ /**
335
+ * Handle `ai-toolkit remove-hook` -- removes injected hooks by source name.
336
+ * @param {string[]} args
337
+ */
338
+ function handleRemoveHook(args) {
339
+ const sourceName = args[0];
340
+ if (!sourceName) {
341
+ console.error('Usage: ai-toolkit remove-hook <hook-source-name> [target-dir]');
342
+ process.exit(1);
343
+ }
344
+ const targetDir = args[1] || process.env.HOME;
345
+ run(scriptPath('inject_hook_cli.py'), ['--remove', sourceName, targetDir]);
346
+ }
347
+
348
+ /**
349
+ * Handle `ai-toolkit mcp` -- delegates to mcp_manager.py with subcommand.
350
+ * @param {string[]} args
351
+ */
352
+ function handleMcp(args) {
353
+ if (args.length === 0) {
354
+ console.error('Usage: ai-toolkit mcp <list|show|add|remove> [args..]');
355
+ process.exit(1);
356
+ }
357
+ run(scriptPath('mcp_manager.py'), args);
358
+ }
359
+
303
360
  /**
304
361
  * Handle `ai-toolkit generate-all` -- runs every generator plus llms-txt.
305
362
  * @param {string[]} _args - Unused, kept for signature consistency
@@ -311,15 +368,59 @@ function handleGenerateAll(_args) {
311
368
  generateLlmsTxt();
312
369
  }
313
370
 
371
+ /**
372
+ * Handle `ai-toolkit status` -- shows installed modules from state.json.
373
+ * @param {string[]} _args
374
+ */
375
+ function handleStatus(_args) {
376
+ run(scriptPath('install.py'), ['--status']);
377
+ }
378
+
379
+ /**
380
+ * Handle `ai-toolkit update` -- re-runs install with saved state.
381
+ * Reads state.json to find previously installed modules and profile,
382
+ * then re-runs install.py with those flags to perform an incremental update.
383
+ * @param {string[]} args
384
+ */
385
+ function handleUpdate(args) {
386
+ const statePath = path.join(process.env.HOME, '.ai-toolkit', 'state.json');
387
+ let stateArgs = [];
388
+
389
+ if (fs.existsSync(statePath)) {
390
+ try {
391
+ const state = JSON.parse(fs.readFileSync(statePath, 'utf8'));
392
+ const modules = state.installed_modules;
393
+ const profile = state.profile;
394
+
395
+ // If we have recorded modules, pass them to install.py
396
+ if (Array.isArray(modules) && modules.length > 0) {
397
+ stateArgs.push('--modules', modules.join(','));
398
+ } else if (profile) {
399
+ stateArgs.push('--profile', profile);
400
+ }
401
+ } catch (_err) {
402
+ // State file is corrupt or unreadable -- fall through to plain install
403
+ }
404
+ }
405
+
406
+ // User-provided args override state-derived args
407
+ run(scriptPath('install.py'), [...stateArgs, ...args]);
408
+ }
409
+
314
410
  /** @type {Record<string, (args: string[]) => void>} */
315
411
  const SPECIAL_HANDLERS = {
412
+ 'status': handleStatus,
413
+ 'update': handleUpdate,
316
414
  'reset': handleReset,
317
415
  'benchmark': handleBenchmark,
318
416
  'create': handleCreate,
319
417
  'sync': handleSync,
418
+ 'mcp': handleMcp,
320
419
  'plugin': (args) => run(scriptPath('plugin.py'), args),
321
420
  'remove-rule': handleRemoveRule,
322
421
  'add-rule': handleAddRule,
422
+ 'inject-hook': handleInjectHook,
423
+ 'remove-hook': handleRemoveHook,
323
424
  'llms-txt': (_args) => generateLlmsTxt(),
324
425
  'generate-all': handleGenerateAll,
325
426
  };
@@ -6,10 +6,10 @@ tags: [agents, catalog, roles, ai-development]
6
6
  version: "2.0.0"
7
7
  created: "2026-03-23"
8
8
  last_updated: "2026-03-25"
9
- description: "Complete catalog of 47 specialized agents with roles, models, and use cases."
9
+ description: "Complete catalog of 44 specialized agents with roles, models, and use cases."
10
10
  ---
11
11
 
12
- # Agents Catalog (47 agents)
12
+ # Agents Catalog (44 agents)
13
13
 
14
14
  ## By Category
15
15
 
@@ -32,17 +32,16 @@ description: "Complete catalog of 47 specialized agents with roles, models, and
32
32
  | **game-developer** | opus | Unity, Godot, Unreal, Phaser, Three.js |
33
33
  | **database-architect** | opus | Schema design, migrations, query optimization, operations |
34
34
 
35
- ### AI/ML (7)
35
+ ### AI/ML (6)
36
36
 
37
37
  | Agent | Model | Use Case |
38
38
  |-------|-------|----------|
39
- | **ai-engineer** | opus | LLM integration, vector databases, RAG, agent orchestration |
39
+ | **ai-engineer** | opus | LLM integration, vector databases, RAG pipelines, agent orchestration |
40
40
  | **ml-engineer** | opus | Model training, MLOps, TensorFlow, PyTorch |
41
41
  | **nlp-engineer** | opus | NLP pipelines, NER, text classification, transformers |
42
42
  | **data-scientist** | opus | Statistics, visualization, EDA, hypothesis testing |
43
43
  | **data-analyst** | sonnet | SQL, analytics, reporting, dashboards |
44
44
  | **prompt-engineer** | opus | Prompt design, chain-of-thought, few-shot, optimization |
45
- | **rag-engineer** | opus | RAG pipelines, document indexing, retrieval optimization |
46
45
 
47
46
  ### Quality & Security (6)
48
47
 
@@ -66,23 +65,21 @@ description: "Complete catalog of 47 specialized agents with roles, models, and
66
65
  | **performance-optimizer** | opus | Profiling, bottleneck analysis, latency, scaling |
67
66
  | **llm-ops-engineer** | opus | LLM caching, fallback, cost optimization, observability |
68
67
 
69
- ### Research & Documentation (6)
68
+ ### Research & Documentation (5)
70
69
 
71
70
  | Agent | Model | Use Case |
72
71
  |-------|-------|----------|
73
72
  | **explorer-agent** | sonnet | Codebase discovery (READ-ONLY, never writes) |
74
- | **research-synthesizer** | opus | Research coordination, synthesis, report generation |
75
- | **technical-researcher** | opus | Deep technical investigation, feasibility studies |
73
+ | **technical-researcher** | opus | Deep technical investigation, research synthesis |
76
74
  | **search-specialist** | sonnet | Search optimization, relevance ranking |
77
75
  | **fact-checker** | sonnet | Claim verification, source validation |
78
76
  | **documenter** | sonnet | Documentation, KB management, SOPs, API docs, tutorials |
79
77
 
80
- ### MCP (3)
78
+ ### MCP (2)
81
79
 
82
80
  | Agent | Model | Use Case |
83
81
  |-------|-------|----------|
84
- | **mcp-expert** | opus | MCP protocol expertise, client configuration |
85
- | **mcp-server-architect** | opus | MCP server design, JSON-RPC, tool definitions |
82
+ | **mcp-specialist** | opus | MCP server design, client config, troubleshooting |
86
83
  | **mcp-testing-engineer** | sonnet | MCP protocol compliance, transport testing |
87
84
 
88
85
  ### Management & Evolution (4)
@@ -120,5 +117,5 @@ description: "Complete catalog of 47 specialized agents with roles, models, and
120
117
  | Security | security-auditor | security-architect | code-reviewer |
121
118
  | Architecture | infrastructure-architect | devops-implementer | security-auditor |
122
119
  | Documentation | documenter | explorer-agent | tech-lead |
123
- | AI/ML | ai-engineer | ml-engineer | rag-engineer |
124
- | Research | research-synthesizer | technical-researcher | fact-checker |
120
+ | AI/ML | ai-engineer | ml-engineer | data-scientist |
121
+ | Research | technical-researcher | search-specialist | fact-checker |
@@ -5,7 +5,7 @@ service: ai-toolkit
5
5
  tags: [architecture, overview, design, structure]
6
6
  version: "1.0.0"
7
7
  created: "2026-03-23"
8
- last_updated: "2026-04-02"
8
+ last_updated: "2026-04-07"
9
9
  description: "Architecture of ai-toolkit: directory layout, global install model, skill tiers, and integration with projects."
10
10
  ---
11
11
 
@@ -13,7 +13,7 @@ description: "Architecture of ai-toolkit: directory layout, global install model
13
13
 
14
14
  ## Purpose
15
15
 
16
- Shared, project-agnostic AI development toolkit for Claude Code (and compatible assistants like Cursor, Windsurf, Copilot, Gemini, Cline, Roo Code, Aider, and Augment). Provides 47 specialized agents, 87 skills (slash commands + knowledge), expanded lifecycle hooks, persona presets, and experimental opt-in plugin packs that teams can adopt separately from the default global install.
16
+ Shared, project-agnostic AI development toolkit for Claude Code (and compatible assistants like Cursor, Windsurf, Copilot, Gemini, Cline, Roo Code, Aider, and Augment). Provides 44 specialized agents, 90 skills (slash commands + knowledge), expanded lifecycle hooks, persona presets, and experimental opt-in plugin packs that teams can adopt separately from the default global install.
17
17
 
18
18
  ## Design Principles
19
19
 
@@ -30,8 +30,8 @@ ai-toolkit/
30
30
  bin/
31
31
  ai-toolkit.js # CLI entry point (install, init, add-rule, ...)
32
32
  app/ # All toolkit components
33
- agents/ # 47 agent definitions (.md + YAML frontmatter)
34
- skills/ # 87 skills: task, hybrid, knowledge
33
+ agents/ # 44 agent definitions (.md + YAML frontmatter)
34
+ skills/ # 90 skills: task, hybrid, knowledge
35
35
  rules/ # Rules auto-injected into ~/.claude/CLAUDE.md
36
36
  hooks/ # Hook scripts (copied to ~/.ai-toolkit/hooks/)
37
37
  hooks.json # Hook definitions (merged into ~/.claude/settings.json)
@@ -166,8 +166,8 @@ Three tiers determine how to approach a task:
166
166
  | Type | Field | Invocation | Count |
167
167
  |------|-------|-----------|-------|
168
168
  | Task | `disable-model-invocation: true` | User via `/skill` only | 28 |
169
- | Hybrid | (neither) | User via `/skill` + agent knowledge | 28 |
170
- | Knowledge | `user-invocable: false` | Claude auto-loads | 31 |
169
+ | Hybrid | (neither) | User via `/skill` + agent knowledge | 30 |
170
+ | Knowledge | `user-invocable: false` | Claude auto-loads | 32 |
171
171
 
172
172
  ## Multi-Agent Execution
173
173
 
@@ -195,14 +195,22 @@ Agents (code-reviewer, debugger, devops-implementer, ...)
195
195
 
196
196
  ## Quality Hooks
197
197
 
198
+ 21 entries across 12 lifecycle events. See [hooks-catalog.md](hooks-catalog.md) for full details.
199
+
198
200
  | Hook | Trigger | Script | Action |
199
201
  |------|---------|--------|--------|
200
202
  | SessionStart | Session start + compact | `session-start.sh` | MANDATORY rules reminder + session context + instincts |
203
+ | SessionStart | Session start | `mcp-health.sh` | Check MCP runtime availability |
204
+ | SessionStart | Session start | `session-context.sh` | Capture environment snapshot |
201
205
  | Notification | Claude waiting for input | *(inline)* | macOS desktop notification |
202
206
  | PreToolUse | Before Bash | `guard-destructive.sh` | Block destructive commands |
203
207
  | PreToolUse | Before file ops (Bash, Read, Edit, Write, MultiEdit, Glob, Grep, NotebookEdit, mcp\_filesystem) | `guard-path.sh` | Block wrong-user path hallucination |
208
+ | PreToolUse | Before Edit/Write/MultiEdit | `guard-config.sh` | Block config file edits without explicit acknowledgment |
209
+ | PreToolUse | Before Bash (git commit) | `commit-quality.sh` | Advisory Conventional Commits format check |
204
210
  | UserPromptSubmit | Before user prompt execution | `user-prompt-submit.sh` | Prompt governance reminder |
211
+ | UserPromptSubmit | Before user prompt execution | `track-usage.sh` | Record skill invocations to stats.json |
205
212
  | PostToolUse | After edit/write tools | `post-tool-use.sh` | Lightweight validation reminders |
213
+ | PostToolUse | After any tool | `governance-capture.sh` | Log security-sensitive operations |
206
214
  | Stop | After response | `quality-check.sh` | Multi-language lint |
207
215
  | Stop | After response | `save-session.sh` | Persist session context |
208
216
  | TaskCompleted | Agent Teams: task done | `quality-gate.sh` | Block completion on errors |
@@ -210,6 +218,7 @@ Agents (code-reviewer, debugger, devops-implementer, ...)
210
218
  | SubagentStart | Subagent spawn | `subagent-start.sh` | Scope reminder for subagents |
211
219
  | SubagentStop | Subagent completion | `subagent-stop.sh` | Handoff checklist for subagents |
212
220
  | PreCompact | Before compaction | `pre-compact.sh` | Save prioritized context: instincts > tasks > git state > decisions |
221
+ | PreCompact | Before compaction | `pre-compact-save.sh` | Timestamped context snapshot to audit trail |
213
222
  | SessionEnd | Session end | `session-end.sh` | Persist handoff note for the next session |
214
223
 
215
224
  Scripts at `~/.ai-toolkit/hooks/`. See [hooks-catalog.md](hooks-catalog.md) for details.
@@ -253,3 +262,17 @@ Severity levels: HIGH (blocks deployment), WARN (should fix), INFO (best practic
253
262
  |-------|---------|-------|
254
263
  | opus | Complex reasoning, code generation, security | 32 |
255
264
  | sonnet | Documentation, analysis, pattern-following | 15 |
265
+
266
+ ## Extension Points
267
+
268
+ ### MCP Templates
269
+ `app/plugins/mcp-templates/` contains 25 ready-to-use MCP server config templates. Opt-in via `ai-toolkit install --modules mcp-templates` or activated automatically with `--profile strict|full`.
270
+
271
+ ### Language Rules
272
+ `app/rules/` provides 70 rule files covering 13 languages (TypeScript, Python, Go, Rust, Java, Kotlin, Swift, Dart, C#, PHP, C++, Ruby, common). Auto-detected from project files via `--auto-detect` or selectable with `--modules rules-<lang>`.
273
+
274
+ ### Extension API (`inject-hook`)
275
+ `inject_section_cli.py` provides a stable marker-based API for injecting content into `CLAUDE.md`, `constitution.md`, or `ARCHITECTURE.md` without overwriting user content.
276
+
277
+ ### Manifest Install (`--modules`, `--auto-detect`)
278
+ `manifest.json` defines all installable components as named modules. Install individual modules with `ai-toolkit install --modules <name>` or enable auto-detection to select language rules based on files found in the project.
@@ -13,9 +13,9 @@ description: "DEPRECATED: All slash commands are implemented as skills. See skil
13
13
 
14
14
  All slash commands have been migrated to skills.
15
15
 
16
- See **[Skills Catalog](skills-catalog.md)** for the complete list of 85 skills, including:
17
- - **27 Task Skills** — formerly standalone commands and creator workflows (e.g., `/commit`, `/test`, `/deploy`, `/hook-creator`, `/plugin-creator`)
18
- - **27 Hybrid Skills** — slash commands that also provide agent knowledge (e.g., `/review`, `/debug`, `/plan`, `/tdd`, `/write-a-prd`)
19
- - **31 Knowledge Skills** — domain patterns auto-loaded by agents
16
+ See **[Skills Catalog](skills-catalog.md)** for the complete list of 90 skills, including:
17
+ - **28 Task Skills** — formerly standalone commands and creator workflows (e.g., `/commit`, `/test`, `/deploy`, `/hook-creator`, `/plugin-creator`)
18
+ - **30 Hybrid Skills** — slash commands that also provide agent knowledge (e.g., `/review`, `/debug`, `/plan`, `/tdd`, `/write-a-prd`, `/council`, `/introspect`)
19
+ - **32 Knowledge Skills** — domain patterns auto-loaded by agents (e.g., `brand-voice`, `clean-code`, `testing-patterns`)
20
20
 
21
21
  Slash command syntax (`/command`) continues to work. The underlying implementation moved from `app/commands/` to `app/skills/`.