@softspark/ai-toolkit 1.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/AGENTS.md +412 -0
- package/CHANGELOG.md +68 -0
- package/LICENSE +21 -0
- package/README.md +632 -0
- package/action.yml +53 -0
- package/app/.claude-plugin/plugin.json +44 -0
- package/app/ARCHITECTURE.md +306 -0
- package/app/CLAUDE.md.template +23 -0
- package/app/agents/ai-engineer.md +128 -0
- package/app/agents/backend-specialist.md +193 -0
- package/app/agents/business-intelligence.md +54 -0
- package/app/agents/chaos-monkey.md +67 -0
- package/app/agents/chief-of-staff.md +51 -0
- package/app/agents/code-archaeologist.md +127 -0
- package/app/agents/code-reviewer.md +184 -0
- package/app/agents/command-expert.md +131 -0
- package/app/agents/data-analyst.md +205 -0
- package/app/agents/data-scientist.md +151 -0
- package/app/agents/database-architect.md +317 -0
- package/app/agents/debugger.md +238 -0
- package/app/agents/devops-implementer.md +194 -0
- package/app/agents/documenter.md +364 -0
- package/app/agents/explorer-agent.md +145 -0
- package/app/agents/fact-checker.md +172 -0
- package/app/agents/frontend-specialist.md +209 -0
- package/app/agents/game-developer.md +216 -0
- package/app/agents/incident-responder.md +226 -0
- package/app/agents/infrastructure-architect.md +127 -0
- package/app/agents/infrastructure-validator.md +247 -0
- package/app/agents/llm-ops-engineer.md +237 -0
- package/app/agents/mcp-expert.md +228 -0
- package/app/agents/mcp-server-architect.md +195 -0
- package/app/agents/mcp-testing-engineer.md +292 -0
- package/app/agents/meta-architect.md +58 -0
- package/app/agents/ml-engineer.md +136 -0
- package/app/agents/mobile-developer.md +190 -0
- package/app/agents/night-watchman.md +55 -0
- package/app/agents/nlp-engineer.md +154 -0
- package/app/agents/orchestrator.md +437 -0
- package/app/agents/performance-optimizer.md +254 -0
- package/app/agents/predictive-analyst.md +57 -0
- package/app/agents/product-manager.md +194 -0
- package/app/agents/project-planner.md +287 -0
- package/app/agents/prompt-engineer.md +103 -0
- package/app/agents/qa-automation-engineer.md +182 -0
- package/app/agents/rag-engineer.md +201 -0
- package/app/agents/research-synthesizer.md +138 -0
- package/app/agents/search-specialist.md +101 -0
- package/app/agents/security-architect.md +62 -0
- package/app/agents/security-auditor.md +293 -0
- package/app/agents/seo-specialist.md +111 -0
- package/app/agents/system-governor.md +57 -0
- package/app/agents/tech-lead.md +62 -0
- package/app/agents/technical-researcher.md +103 -0
- package/app/agents/test-engineer.md +264 -0
- package/app/constitution.md +38 -0
- package/app/hooks/_profile-check.sh +11 -0
- package/app/hooks/guard-destructive.sh +74 -0
- package/app/hooks/guard-path.sh +73 -0
- package/app/hooks/post-tool-use.sh +35 -0
- package/app/hooks/pre-compact.sh +31 -0
- package/app/hooks/quality-check.sh +22 -0
- package/app/hooks/quality-gate.sh +49 -0
- package/app/hooks/save-session.sh +24 -0
- package/app/hooks/session-end.sh +37 -0
- package/app/hooks/session-start.sh +29 -0
- package/app/hooks/subagent-start.sh +16 -0
- package/app/hooks/subagent-stop.sh +16 -0
- package/app/hooks/track-usage.sh +50 -0
- package/app/hooks/user-prompt-submit.sh +25 -0
- package/app/hooks.json +178 -0
- package/app/mcp-defaults.json +23 -0
- package/app/output-styles/golden-rules.md +43 -0
- package/app/plugins/README.md +19 -0
- package/app/plugins/csharp-pack/README.md +11 -0
- package/app/plugins/csharp-pack/plugin.json +18 -0
- package/app/plugins/enterprise-pack/README.md +16 -0
- package/app/plugins/enterprise-pack/hooks/output-style.sh +6 -0
- package/app/plugins/enterprise-pack/hooks/status-line.sh +8 -0
- package/app/plugins/enterprise-pack/plugin.json +24 -0
- package/app/plugins/frontend-pack/README.md +14 -0
- package/app/plugins/frontend-pack/plugin.json +22 -0
- package/app/plugins/java-pack/README.md +11 -0
- package/app/plugins/java-pack/plugin.json +18 -0
- package/app/plugins/kotlin-pack/README.md +11 -0
- package/app/plugins/kotlin-pack/plugin.json +18 -0
- package/app/plugins/memory-pack/README.md +24 -0
- package/app/plugins/memory-pack/hooks/observation-capture.sh +67 -0
- package/app/plugins/memory-pack/hooks/session-summary.sh +71 -0
- package/app/plugins/memory-pack/plugin.json +22 -0
- package/app/plugins/memory-pack/scripts/init_db.py +81 -0
- package/app/plugins/memory-pack/scripts/strip_private.py +22 -0
- package/app/plugins/memory-pack/skills/mem-search/SKILL.md +70 -0
- package/app/plugins/research-pack/README.md +14 -0
- package/app/plugins/research-pack/plugin.json +22 -0
- package/app/plugins/ruby-pack/README.md +11 -0
- package/app/plugins/ruby-pack/plugin.json +18 -0
- package/app/plugins/rust-pack/README.md +11 -0
- package/app/plugins/rust-pack/plugin.json +18 -0
- package/app/plugins/security-pack/README.md +15 -0
- package/app/plugins/security-pack/plugin.json +23 -0
- package/app/plugins/swift-pack/README.md +11 -0
- package/app/plugins/swift-pack/plugin.json +18 -0
- package/app/rules/claude-toolkit-rules.md +21 -0
- package/app/rules/git-conventions.md +5 -0
- package/app/rules/quality-gates.md +10 -0
- package/app/skills/_lib/__init__.py +1 -0
- package/app/skills/_lib/detect_utils.py +150 -0
- package/app/skills/agent-creator/SKILL.md +82 -0
- package/app/skills/analyze/SKILL.md +92 -0
- package/app/skills/analyze/scripts/complexity.py +165 -0
- package/app/skills/api-patterns/SKILL.md +305 -0
- package/app/skills/app-builder/SKILL.md +187 -0
- package/app/skills/architecture-audit/SKILL.md +141 -0
- package/app/skills/architecture-decision/SKILL.md +55 -0
- package/app/skills/architecture-decision/templates/adr-template.md +36 -0
- package/app/skills/biz-scan/SKILL.md +30 -0
- package/app/skills/briefing/SKILL.md +27 -0
- package/app/skills/build/SKILL.md +97 -0
- package/app/skills/build/scripts/detect-build.py +151 -0
- package/app/skills/chaos/SKILL.md +32 -0
- package/app/skills/ci/SKILL.md +77 -0
- package/app/skills/ci/scripts/ci-detect.py +135 -0
- package/app/skills/ci/templates/github-actions-node.yml +38 -0
- package/app/skills/ci/templates/github-actions-python.yml +42 -0
- package/app/skills/ci-cd-patterns/SKILL.md +299 -0
- package/app/skills/clean-code/SKILL.md +110 -0
- package/app/skills/clean-code/reference/dart.md +18 -0
- package/app/skills/clean-code/reference/go.md +23 -0
- package/app/skills/clean-code/reference/php.md +32 -0
- package/app/skills/clean-code/reference/python.md +180 -0
- package/app/skills/clean-code/reference/typescript.md +26 -0
- package/app/skills/command-creator/SKILL.md +83 -0
- package/app/skills/commit/SKILL.md +98 -0
- package/app/skills/commit/scripts/pre-commit-check.py +87 -0
- package/app/skills/commit/templates/conventional-commit.md +52 -0
- package/app/skills/csharp-patterns/SKILL.md +450 -0
- package/app/skills/database-patterns/SKILL.md +297 -0
- package/app/skills/debug/SKILL.md +154 -0
- package/app/skills/debug/scripts/error-parser.py +187 -0
- package/app/skills/debugging-tactics/SKILL.md +136 -0
- package/app/skills/deploy/SKILL.md +130 -0
- package/app/skills/deploy/scripts/pre_deploy_check.py +171 -0
- package/app/skills/deploy/templates/deployment-checklist.md +31 -0
- package/app/skills/design-an-interface/SKILL.md +105 -0
- package/app/skills/design-engineering/SKILL.md +260 -0
- package/app/skills/docker-devops/SKILL.md +303 -0
- package/app/skills/docs/SKILL.md +145 -0
- package/app/skills/docs/scripts/doc-inventory.py +176 -0
- package/app/skills/docs/templates/adr-template.md +36 -0
- package/app/skills/docs/templates/readme-template.md +67 -0
- package/app/skills/documentation-standards/SKILL.md +191 -0
- package/app/skills/ecommerce-patterns/SKILL.md +209 -0
- package/app/skills/evaluate/SKILL.md +132 -0
- package/app/skills/evolve/SKILL.md +27 -0
- package/app/skills/explain/SKILL.md +54 -0
- package/app/skills/explain/scripts/dependency-graph.py +215 -0
- package/app/skills/explore/SKILL.md +112 -0
- package/app/skills/explore/scripts/visualize.py +117 -0
- package/app/skills/fix/SKILL.md +78 -0
- package/app/skills/fix/scripts/error-classifier.py +191 -0
- package/app/skills/flutter-patterns/SKILL.md +254 -0
- package/app/skills/git-mastery/SKILL.md +70 -0
- package/app/skills/grill-me/SKILL.md +38 -0
- package/app/skills/health/SKILL.md +91 -0
- package/app/skills/health/scripts/health_check.py +162 -0
- package/app/skills/hive-mind/SKILL.md +56 -0
- package/app/skills/hook-creator/SKILL.md +107 -0
- package/app/skills/index/SKILL.md +74 -0
- package/app/skills/instinct-review/SKILL.md +77 -0
- package/app/skills/java-patterns/SKILL.md +442 -0
- package/app/skills/kotlin-patterns/SKILL.md +446 -0
- package/app/skills/lint/SKILL.md +103 -0
- package/app/skills/lint/scripts/detect-linters.py +112 -0
- package/app/skills/mcp-patterns/SKILL.md +270 -0
- package/app/skills/mem-search/SKILL.md +70 -0
- package/app/skills/migrate/SKILL.md +90 -0
- package/app/skills/migrate/scripts/migration-status.py +195 -0
- package/app/skills/migration-patterns/SKILL.md +260 -0
- package/app/skills/night-watch/SKILL.md +28 -0
- package/app/skills/observability-patterns/SKILL.md +203 -0
- package/app/skills/onboard/SKILL.md +76 -0
- package/app/skills/orchestrate/SKILL.md +86 -0
- package/app/skills/panic/SKILL.md +30 -0
- package/app/skills/performance-profiling/SKILL.md +59 -0
- package/app/skills/plan/SKILL.md +110 -0
- package/app/skills/plan/templates/plan-template.md +40 -0
- package/app/skills/plan-writing/SKILL.md +201 -0
- package/app/skills/plugin-creator/SKILL.md +78 -0
- package/app/skills/pr/SKILL.md +129 -0
- package/app/skills/pr/scripts/pr-summary.py +175 -0
- package/app/skills/prd-to-issues/SKILL.md +108 -0
- package/app/skills/prd-to-plan/SKILL.md +120 -0
- package/app/skills/predict/SKILL.md +30 -0
- package/app/skills/qa-session/SKILL.md +110 -0
- package/app/skills/rag-patterns/SKILL.md +203 -0
- package/app/skills/refactor/SKILL.md +124 -0
- package/app/skills/refactor/scripts/refactor-scan.py +210 -0
- package/app/skills/refactor-plan/SKILL.md +112 -0
- package/app/skills/repeat/SKILL.md +149 -0
- package/app/skills/research-mastery/SKILL.md +56 -0
- package/app/skills/review/SKILL.md +141 -0
- package/app/skills/review/scripts/diff-analyzer.py +170 -0
- package/app/skills/rollback/SKILL.md +87 -0
- package/app/skills/rollback/scripts/rollback_info.py +149 -0
- package/app/skills/ruby-patterns/SKILL.md +454 -0
- package/app/skills/rust-patterns/SKILL.md +446 -0
- package/app/skills/search/SKILL.md +64 -0
- package/app/skills/security-patterns/SKILL.md +91 -0
- package/app/skills/security-patterns/reference/authentication.md +37 -0
- package/app/skills/security-patterns/reference/authorization.md +22 -0
- package/app/skills/security-patterns/reference/input-validation.md +30 -0
- package/app/skills/security-patterns/reference/oauth-csrf-audit.md +131 -0
- package/app/skills/skill-creator/SKILL.md +154 -0
- package/app/skills/skill-creator/templates/dashboard/index.html +130 -0
- package/app/skills/skill-creator/templates/reasoning-engine/assets/example.json +12 -0
- package/app/skills/skill-creator/templates/reasoning-engine/search.py +110 -0
- package/app/skills/subagent-development/SKILL.md +225 -0
- package/app/skills/subagent-development/reference/code-quality-reviewer-prompt.md +145 -0
- package/app/skills/subagent-development/reference/implementer-prompt.md +118 -0
- package/app/skills/subagent-development/reference/spec-reviewer-prompt.md +100 -0
- package/app/skills/swarm/SKILL.md +81 -0
- package/app/skills/swift-patterns/SKILL.md +500 -0
- package/app/skills/tdd/SKILL.md +174 -0
- package/app/skills/tdd/reference/deep-modules.md +32 -0
- package/app/skills/tdd/reference/interface-design.md +32 -0
- package/app/skills/tdd/reference/mocking.md +52 -0
- package/app/skills/tdd/reference/refactoring.md +10 -0
- package/app/skills/tdd/reference/tests.md +59 -0
- package/app/skills/teams/SKILL.md +101 -0
- package/app/skills/test/SKILL.md +107 -0
- package/app/skills/test/scripts/detect-runner.py +113 -0
- package/app/skills/testing-patterns/SKILL.md +73 -0
- package/app/skills/testing-patterns/reference/flutter-testing.md +33 -0
- package/app/skills/testing-patterns/reference/go-testing.md +52 -0
- package/app/skills/testing-patterns/reference/php-phpunit.md +39 -0
- package/app/skills/testing-patterns/reference/python-pytest.md +228 -0
- package/app/skills/testing-patterns/reference/typescript-vitest.md +50 -0
- package/app/skills/triage-issue/SKILL.md +120 -0
- package/app/skills/typescript-patterns/SKILL.md +256 -0
- package/app/skills/ubiquitous-language/SKILL.md +74 -0
- package/app/skills/verification-before-completion/SKILL.md +108 -0
- package/app/skills/workflow/SKILL.md +250 -0
- package/app/skills/write-a-prd/SKILL.md +129 -0
- package/app/skills/write-a-prd/reference/visual-companion.md +78 -0
- package/app/skills/write-a-prd/scripts/frame-template.html +111 -0
- package/app/skills/write-a-prd/scripts/visual-server.cjs +79 -0
- package/app/templates/skill/generator/SKILL.md.template +40 -0
- package/app/templates/skill/knowledge/SKILL.md.template +52 -0
- package/app/templates/skill/linter/SKILL.md.template +34 -0
- package/app/templates/skill/reviewer/SKILL.md.template +51 -0
- package/app/templates/skill/workflow/SKILL.md.template +49 -0
- package/benchmarks/README.md +111 -0
- package/benchmarks/ecosystem-dashboard.json +148 -0
- package/benchmarks/ecosystem-harvest.json +148 -0
- package/benchmarks/results.json +38 -0
- package/benchmarks/run.py +351 -0
- package/bin/ai-toolkit.js +345 -0
- package/kb/best-practices/README.md +11 -0
- package/kb/howto/README.md +11 -0
- package/kb/procedures/maintenance-sop.md +306 -0
- package/kb/reference/agents-catalog.md +124 -0
- package/kb/reference/anti-pattern-registry-format.md +221 -0
- package/kb/reference/architecture-overview.md +232 -0
- package/kb/reference/benchmark-config.md +62 -0
- package/kb/reference/ci-integration.md +66 -0
- package/kb/reference/claude-ecosystem-benchmark-snapshot.md +80 -0
- package/kb/reference/claude-ecosystem-expansion-foundations.md +102 -0
- package/kb/reference/commands-catalog.md +21 -0
- package/kb/reference/distribution-model.md +63 -0
- package/kb/reference/global-install-model.md +56 -0
- package/kb/reference/hierarchical-override-pattern.md +200 -0
- package/kb/reference/hooks-catalog.md +306 -0
- package/kb/reference/integrations.md +88 -0
- package/kb/reference/language-packs.md +52 -0
- package/kb/reference/merge-friendly-install-model.md +58 -0
- package/kb/reference/plugin-pack-conventions.md +151 -0
- package/kb/reference/quick-wins-implementation-summary.md +70 -0
- package/kb/reference/skill-templates.md +50 -0
- package/kb/reference/skills-catalog.md +215 -0
- package/kb/reference/skills-unification.md +57 -0
- package/kb/reference/stats.md +69 -0
- package/kb/reference/sync.md +76 -0
- package/kb/troubleshooting/README.md +11 -0
- package/llms-full.txt +3068 -0
- package/llms.txt +39 -0
- package/package.json +75 -0
- package/scripts/_common.py +160 -0
- package/scripts/add_rule.py +50 -0
- package/scripts/benchmark_config.py +127 -0
- package/scripts/benchmark_ecosystem.py +288 -0
- package/scripts/check_deps.py +260 -0
- package/scripts/create_skill.py +118 -0
- package/scripts/doctor.py +504 -0
- package/scripts/eject.py +113 -0
- package/scripts/emission.py +256 -0
- package/scripts/evaluate_skills.py +260 -0
- package/scripts/frontmatter.py +58 -0
- package/scripts/generate_agents_md.py +91 -0
- package/scripts/generate_aider_conf.py +51 -0
- package/scripts/generate_cline.py +35 -0
- package/scripts/generate_copilot.py +30 -0
- package/scripts/generate_cursor_rules.py +35 -0
- package/scripts/generate_gemini.py +28 -0
- package/scripts/generate_llms_txt.py +164 -0
- package/scripts/generate_roo_modes.py +80 -0
- package/scripts/generate_windsurf.py +35 -0
- package/scripts/generator_base.py +140 -0
- package/scripts/harvest_ecosystem.py +50 -0
- package/scripts/inject_rule_cli.py +101 -0
- package/scripts/inject_section_cli.py +47 -0
- package/scripts/injection.py +180 -0
- package/scripts/install.py +236 -0
- package/scripts/install_git_hooks.py +71 -0
- package/scripts/install_steps/__init__.py +5 -0
- package/scripts/install_steps/ai_tools.py +261 -0
- package/scripts/install_steps/hooks.py +90 -0
- package/scripts/install_steps/markers.py +79 -0
- package/scripts/install_steps/symlinks.py +87 -0
- package/scripts/merge-hooks.py +192 -0
- package/scripts/plugin.py +642 -0
- package/scripts/plugin_schema.py +138 -0
- package/scripts/remove_rule.py +58 -0
- package/scripts/stats.py +81 -0
- package/scripts/sync.py +215 -0
- package/scripts/uninstall.py +292 -0
- package/scripts/validate.py +700 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Hooks Catalog"
|
|
3
|
+
category: reference
|
|
4
|
+
service: ai-toolkit
|
|
5
|
+
tags: [hooks, quality, safety, enforcement, settings.json]
|
|
6
|
+
version: "1.0.0"
|
|
7
|
+
created: "2026-03-27"
|
|
8
|
+
last_updated: "2026-04-02"
|
|
9
|
+
description: "Complete reference of all ai-toolkit hooks: events, scripts, installation, and runtime behavior."
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Hooks Catalog
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
ai-toolkit provides 15 global hook entries across 12 lifecycle events that enforce quality, safety, and workflow rules across all Claude Code sessions. Hooks are merged into `~/.claude/settings.json` on install, with logic in standalone scripts at `~/.ai-toolkit/hooks/`.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
ai-toolkit install # copies scripts to ~/.ai-toolkit/hooks/, merges into settings.json
|
|
22
|
+
ai-toolkit update # re-copies scripts, re-merges (idempotent)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**File locations:**
|
|
26
|
+
- Scripts: `~/.ai-toolkit/hooks/*.sh`
|
|
27
|
+
- Config: `~/.claude/settings.json` → `hooks` key
|
|
28
|
+
- Source: `ai-toolkit/app/hooks/*.sh` + `app/hooks.json`
|
|
29
|
+
|
|
30
|
+
## Hook Events
|
|
31
|
+
|
|
32
|
+
### SessionStart — `session-start.sh`
|
|
33
|
+
|
|
34
|
+
| Field | Value |
|
|
35
|
+
|-------|-------|
|
|
36
|
+
| Event | `SessionStart` |
|
|
37
|
+
| Matcher | `startup\|compact` |
|
|
38
|
+
| Script | `~/.ai-toolkit/hooks/session-start.sh` |
|
|
39
|
+
| Fires | Session start + after context compaction |
|
|
40
|
+
|
|
41
|
+
**Actions:**
|
|
42
|
+
1. Injects MANDATORY reminder to follow CLAUDE.md rules
|
|
43
|
+
2. Injects REMINDER about tests and documentation
|
|
44
|
+
3. Loads session context from `.claude/session-context.md` (if exists)
|
|
45
|
+
4. Loads active instincts from `.claude/instincts/*.md` (if any)
|
|
46
|
+
|
|
47
|
+
### Notification — inline
|
|
48
|
+
|
|
49
|
+
| Field | Value |
|
|
50
|
+
|-------|-------|
|
|
51
|
+
| Event | `Notification` |
|
|
52
|
+
| Matcher | *(all)* |
|
|
53
|
+
| Fires | Claude Code waiting for user input |
|
|
54
|
+
|
|
55
|
+
**Action:** macOS desktop notification via `osascript`.
|
|
56
|
+
|
|
57
|
+
### PreToolUse (Bash) — `guard-destructive.sh`
|
|
58
|
+
|
|
59
|
+
| Field | Value |
|
|
60
|
+
|-------|-------|
|
|
61
|
+
| Event | `PreToolUse` |
|
|
62
|
+
| Matcher | `Bash` |
|
|
63
|
+
| Script | `~/.ai-toolkit/hooks/guard-destructive.sh` |
|
|
64
|
+
| Fires | Before any Bash command |
|
|
65
|
+
|
|
66
|
+
**Action:** Blocks (exit 2) commands matching destructive patterns:
|
|
67
|
+
- `rm -rf`, `sudo rm`
|
|
68
|
+
- `DROP TABLE`, `DROP DATABASE`, `TRUNCATE`
|
|
69
|
+
- `format /`, `dd if=`
|
|
70
|
+
- `git push --force`
|
|
71
|
+
- `chmod -R 777`
|
|
72
|
+
|
|
73
|
+
### PreToolUse (file ops) — `guard-path.sh`
|
|
74
|
+
|
|
75
|
+
| Field | Value |
|
|
76
|
+
|-------|-------|
|
|
77
|
+
| Event | `PreToolUse` |
|
|
78
|
+
| Matcher | `Bash\|Read\|Edit\|Write\|MultiEdit\|Glob\|Grep\|NotebookEdit\|mcp__filesystem__.*` |
|
|
79
|
+
| Script | `~/.ai-toolkit/hooks/guard-path.sh` |
|
|
80
|
+
| Fires | Before any file access tool (including Bash, MCP filesystem) |
|
|
81
|
+
|
|
82
|
+
**Action:** Blocks (exit 2) when a path contains `/Users/<wrong>` or `/home/<wrong>` that doesn't match the actual `$HOME`. Prevents Claude from hallucinating or confusing similar usernames (common with non-ASCII names like Polish names).
|
|
83
|
+
|
|
84
|
+
**Feedback to Claude:** Tells it to use `~`, `$HOME`, or run `echo $HOME` instead of guessing.
|
|
85
|
+
|
|
86
|
+
### UserPromptSubmit — `user-prompt-submit.sh`
|
|
87
|
+
|
|
88
|
+
| Field | Value |
|
|
89
|
+
|-------|-------|
|
|
90
|
+
| Event | `UserPromptSubmit` |
|
|
91
|
+
| Matcher | *(all)* |
|
|
92
|
+
| Script | `~/.ai-toolkit/hooks/user-prompt-submit.sh` |
|
|
93
|
+
| Fires | Before Claude starts working on a submitted prompt |
|
|
94
|
+
|
|
95
|
+
**Action:** Adds a lightweight governance reminder: plan mode for architectural work, evidence-first debugging, KB-first research, and validation expectations.
|
|
96
|
+
|
|
97
|
+
Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
|
|
98
|
+
|
|
99
|
+
### UserPromptSubmit (usage tracking) — `track-usage.sh`
|
|
100
|
+
|
|
101
|
+
| Field | Value |
|
|
102
|
+
|-------|-------|
|
|
103
|
+
| Event | `UserPromptSubmit` |
|
|
104
|
+
| Matcher | *(all)* |
|
|
105
|
+
| Script | `~/.ai-toolkit/hooks/track-usage.sh` |
|
|
106
|
+
| Fires | Before Claude starts working on a submitted prompt |
|
|
107
|
+
|
|
108
|
+
**Action:** Records skill invocations (slash commands like `/commit`, `/review`) to `~/.ai-toolkit/stats.json` for local usage analytics. Non-slash prompts are ignored.
|
|
109
|
+
|
|
110
|
+
### PostToolUse (edit feedback) — `post-tool-use.sh`
|
|
111
|
+
|
|
112
|
+
| Field | Value |
|
|
113
|
+
|-------|-------|
|
|
114
|
+
| Event | `PostToolUse` |
|
|
115
|
+
| Matcher | `Edit\|MultiEdit\|Write` |
|
|
116
|
+
| Script | `~/.ai-toolkit/hooks/post-tool-use.sh` |
|
|
117
|
+
| Fires | After file edit/write tool operations |
|
|
118
|
+
|
|
119
|
+
**Action:** Adds a lightweight reminder to run relevant validation, tests, and documentation updates after edits.
|
|
120
|
+
|
|
121
|
+
Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
|
|
122
|
+
|
|
123
|
+
### Stop (quality check) — `quality-check.sh`
|
|
124
|
+
|
|
125
|
+
| Field | Value |
|
|
126
|
+
|-------|-------|
|
|
127
|
+
| Event | `Stop` |
|
|
128
|
+
| Matcher | *(all)* |
|
|
129
|
+
| Script | `~/.ai-toolkit/hooks/quality-check.sh` |
|
|
130
|
+
| Fires | After every Claude response |
|
|
131
|
+
|
|
132
|
+
**Action:** Runs language-appropriate linter:
|
|
133
|
+
- Python: `ruff check .`
|
|
134
|
+
- TypeScript: `npx tsc --noEmit`
|
|
135
|
+
- PHP: `vendor/bin/phpstan analyse`
|
|
136
|
+
- Dart: `dart analyze`
|
|
137
|
+
- Go: `go vet ./...`
|
|
138
|
+
|
|
139
|
+
Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
|
|
140
|
+
|
|
141
|
+
### Stop (session save) — `save-session.sh`
|
|
142
|
+
|
|
143
|
+
| Field | Value |
|
|
144
|
+
|-------|-------|
|
|
145
|
+
| Event | `Stop` |
|
|
146
|
+
| Matcher | *(all)* |
|
|
147
|
+
| Script | `~/.ai-toolkit/hooks/save-session.sh` |
|
|
148
|
+
| Fires | After every Claude response |
|
|
149
|
+
|
|
150
|
+
**Action:** Writes session context to `.claude/session-context.md` for cross-session persistence.
|
|
151
|
+
|
|
152
|
+
Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
|
|
153
|
+
|
|
154
|
+
### TaskCompleted — `quality-gate.sh`
|
|
155
|
+
|
|
156
|
+
| Field | Value |
|
|
157
|
+
|-------|-------|
|
|
158
|
+
| Event | `TaskCompleted` |
|
|
159
|
+
| Matcher | *(all)* |
|
|
160
|
+
| Script | `~/.ai-toolkit/hooks/quality-gate.sh` |
|
|
161
|
+
| Fires | When an Agent Teams task is marked complete |
|
|
162
|
+
|
|
163
|
+
**Action:** Runs lint/typecheck. **Blocks completion (exit 2)** if errors found. Strict profile also runs `mypy --strict`.
|
|
164
|
+
|
|
165
|
+
Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
|
|
166
|
+
|
|
167
|
+
### SubagentStart — `subagent-start.sh`
|
|
168
|
+
|
|
169
|
+
| Field | Value |
|
|
170
|
+
|-------|-------|
|
|
171
|
+
| Event | `SubagentStart` |
|
|
172
|
+
| Matcher | *(all)* |
|
|
173
|
+
| Script | `~/.ai-toolkit/hooks/subagent-start.sh` |
|
|
174
|
+
| Fires | When a subagent is spawned |
|
|
175
|
+
|
|
176
|
+
**Action:** Reminds subagents to stay narrow in scope, gather evidence first, and return explicit validation notes.
|
|
177
|
+
|
|
178
|
+
Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
|
|
179
|
+
|
|
180
|
+
### SubagentStop — `subagent-stop.sh`
|
|
181
|
+
|
|
182
|
+
| Field | Value |
|
|
183
|
+
|-------|-------|
|
|
184
|
+
| Event | `SubagentStop` |
|
|
185
|
+
| Matcher | *(all)* |
|
|
186
|
+
| Script | `~/.ai-toolkit/hooks/subagent-stop.sh` |
|
|
187
|
+
| Fires | When a subagent completes |
|
|
188
|
+
|
|
189
|
+
**Action:** Enforces a concise handoff checklist: findings, files touched, tests run, risks, and docs follow-up.
|
|
190
|
+
|
|
191
|
+
Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
|
|
192
|
+
|
|
193
|
+
### PreCompact — `pre-compact.sh`
|
|
194
|
+
|
|
195
|
+
| Field | Value |
|
|
196
|
+
|-------|-------|
|
|
197
|
+
| Event | `PreCompact` |
|
|
198
|
+
| Matcher | *(all)* |
|
|
199
|
+
| Script | `~/.ai-toolkit/hooks/pre-compact.sh` |
|
|
200
|
+
| Fires | Before context compaction |
|
|
201
|
+
|
|
202
|
+
**Actions:**
|
|
203
|
+
1. Injects reminder to re-read CLAUDE.md files after compaction
|
|
204
|
+
2. Preserves session context from `.claude/session-context.md` (if exists)
|
|
205
|
+
3. Preserves active instincts from `.claude/instincts/*.md` (if any)
|
|
206
|
+
|
|
207
|
+
Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
|
|
208
|
+
|
|
209
|
+
### SessionEnd — `session-end.sh`
|
|
210
|
+
|
|
211
|
+
| Field | Value |
|
|
212
|
+
|-------|-------|
|
|
213
|
+
| Event | `SessionEnd` |
|
|
214
|
+
| Matcher | *(all)* |
|
|
215
|
+
| Script | `~/.ai-toolkit/hooks/session-end.sh` |
|
|
216
|
+
| Fires | When a Claude session ends |
|
|
217
|
+
|
|
218
|
+
**Action:** Writes `.claude/session-end.md` with a lightweight handoff note for the next session and reminds the next session to review preserved context.
|
|
219
|
+
|
|
220
|
+
Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
|
|
221
|
+
|
|
222
|
+
### TeammateIdle — inline
|
|
223
|
+
|
|
224
|
+
| Field | Value |
|
|
225
|
+
|-------|-------|
|
|
226
|
+
| Event | `TeammateIdle` |
|
|
227
|
+
| Matcher | *(all)* |
|
|
228
|
+
| Fires | Agent Teams teammate going idle |
|
|
229
|
+
|
|
230
|
+
**Action:** Reminds teammate to verify: files modified, tests written, docs updated.
|
|
231
|
+
|
|
232
|
+
## Runtime Profiles
|
|
233
|
+
|
|
234
|
+
Set in `.claude/settings.local.json`:
|
|
235
|
+
|
|
236
|
+
```json
|
|
237
|
+
{ "env": { "TOOLKIT_HOOK_PROFILE": "standard" } }
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
| Profile | Behavior |
|
|
241
|
+
|---------|----------|
|
|
242
|
+
| `minimal` | Only destructive guard + SessionStart |
|
|
243
|
+
| `standard` | All hooks (default) |
|
|
244
|
+
| `strict` | Standard + mypy --strict on task completion |
|
|
245
|
+
|
|
246
|
+
## Architecture
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
~/.ai-toolkit/
|
|
250
|
+
├── rules/ # Registered rules (add-rule.sh)
|
|
251
|
+
└── hooks/ # Hook scripts (copied on install)
|
|
252
|
+
├── _profile-check.sh # Shared: profile skip logic (sourced by hooks)
|
|
253
|
+
├── session-start.sh
|
|
254
|
+
├── guard-destructive.sh
|
|
255
|
+
├── guard-path.sh
|
|
256
|
+
├── user-prompt-submit.sh
|
|
257
|
+
├── post-tool-use.sh
|
|
258
|
+
├── quality-check.sh
|
|
259
|
+
├── quality-gate.sh
|
|
260
|
+
├── save-session.sh
|
|
261
|
+
├── subagent-start.sh
|
|
262
|
+
├── subagent-stop.sh
|
|
263
|
+
├── track-usage.sh
|
|
264
|
+
├── pre-compact.sh
|
|
265
|
+
└── session-end.sh
|
|
266
|
+
|
|
267
|
+
~/.claude/settings.json
|
|
268
|
+
└── hooks: # Hook definitions referencing ~/.ai-toolkit/hooks/
|
|
269
|
+
├── SessionStart → session-start.sh
|
|
270
|
+
├── Notification → osascript (inline)
|
|
271
|
+
├── PreToolUse → guard-destructive.sh, guard-path.sh
|
|
272
|
+
├── UserPromptSubmit → user-prompt-submit.sh, track-usage.sh
|
|
273
|
+
├── PostToolUse → post-tool-use.sh
|
|
274
|
+
├── Stop → quality-check.sh, save-session.sh
|
|
275
|
+
├── TaskCompleted → quality-gate.sh
|
|
276
|
+
├── TeammateIdle → echo (inline)
|
|
277
|
+
├── SubagentStart → subagent-start.sh
|
|
278
|
+
├── SubagentStop → subagent-stop.sh
|
|
279
|
+
├── PreCompact → pre-compact.sh
|
|
280
|
+
└── SessionEnd → session-end.sh
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
**Key design decisions:**
|
|
284
|
+
- Scripts **copied** (not symlinked) — user can customize without breaking git
|
|
285
|
+
- Hooks in `settings.json` (not `hooks.json`) — Claude Code only reads settings files
|
|
286
|
+
- `_source: "ai-toolkit"` tag on every entry — allows idempotent merge/strip
|
|
287
|
+
- Hooks are **global only** — `--local` does not install hooks into project settings
|
|
288
|
+
|
|
289
|
+
## Troubleshooting
|
|
290
|
+
|
|
291
|
+
**Hooks not loading:**
|
|
292
|
+
1. Run `/hooks` in Claude Code — lists all active hooks
|
|
293
|
+
2. Check `claude --debug hooks` — shows matcher resolution
|
|
294
|
+
3. Verify JSON: `python3 -c "import json; json.load(open('$HOME/.claude/settings.json'))"`
|
|
295
|
+
|
|
296
|
+
**Hook script not found:**
|
|
297
|
+
```bash
|
|
298
|
+
ls ~/.ai-toolkit/hooks/ # should list 12 .sh files (plus _profile-check.sh helper)
|
|
299
|
+
ai-toolkit update # re-copies scripts
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
**Legacy cleanup:**
|
|
303
|
+
```bash
|
|
304
|
+
rm ~/.claude/hooks.json # old format, no longer used
|
|
305
|
+
rm -rf ~/.claude/hooks # old symlink, no longer used
|
|
306
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "AI Toolkit - External Integrations"
|
|
3
|
+
category: reference
|
|
4
|
+
service: ai-toolkit
|
|
5
|
+
tags: [integrations, rules, add-rule]
|
|
6
|
+
version: "1.0.5"
|
|
7
|
+
created: "2026-03-26"
|
|
8
|
+
last_updated: "2026-03-26"
|
|
9
|
+
description: "How external repos inject rules into ~/.claude/CLAUDE.md via ai-toolkit"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# External Integrations
|
|
13
|
+
|
|
14
|
+
Repos that register rules with ai-toolkit so they are automatically injected into `~/.claude/CLAUDE.md` on every `update`.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## How to Register Rules
|
|
19
|
+
|
|
20
|
+
Use `add-rule` to register a rule file globally. Every subsequent `ai-toolkit update` picks it up automatically.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
cd /path/to/your-repo
|
|
24
|
+
ai-toolkit add-rule ./jira-rules.md
|
|
25
|
+
ai-toolkit update # inject now
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
After registration, `ai-toolkit update` will always re-inject the rule. Registry location: `~/.ai-toolkit/rules/`.
|
|
29
|
+
|
|
30
|
+
To unregister a rule (removes from `~/.ai-toolkit/rules/` and strips the block from `CLAUDE.md`):
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
ai-toolkit remove-rule jira-rules
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## How It Works
|
|
39
|
+
|
|
40
|
+
Both mechanisms use marker-based idempotent injection. Rule name = filename without `.md`.
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
<!-- TOOLKIT:jira-rules START -->
|
|
44
|
+
|
|
45
|
+
...rule content...
|
|
46
|
+
|
|
47
|
+
<!-- TOOLKIT:jira-rules END -->
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Content outside markers is never touched. Re-running updates only the marked block.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Adding a New Integration
|
|
55
|
+
|
|
56
|
+
1. Create `<name>-rules.md` in your repo with Claude-relevant conventions
|
|
57
|
+
2. Register it: `ai-toolkit add-rule ./<name>-rules.md`
|
|
58
|
+
3. Verify it appears in: `~/.ai-toolkit/rules/<name>-rules.md`
|
|
59
|
+
4. On next `install` it will be listed in: `Rules injected: ... <name>-rules`
|
|
60
|
+
5. Add an entry below documenting the integration
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Known Integrations
|
|
65
|
+
|
|
66
|
+
### rag-mcp
|
|
67
|
+
|
|
68
|
+
**Rule file:** `rag-mcp.md`
|
|
69
|
+
**Marker:** `TOOLKIT:rag-mcp`
|
|
70
|
+
|
|
71
|
+
Teaches Claude Code the RAG-MCP search protocol: always call `smart_query()` before answering, `kb_id` vs `file_path` distinction, available MCP tools.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
cd /path/to/rag-mcp
|
|
75
|
+
ai-toolkit add-rule ./rag-mcp-rules.md
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### jira-mcp
|
|
79
|
+
|
|
80
|
+
**Rule file:** `jira-rules.md`
|
|
81
|
+
**Marker:** `TOOLKIT:jira-rules`
|
|
82
|
+
|
|
83
|
+
Teaches Claude Code the Jira MCP tool set: `sync_tasks`, `read_cached_tasks`, `update_task_status`, `log_task_time`, and key rules (sync first, hours only, check transitions).
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cd /path/to/jira-mcp
|
|
87
|
+
ai-toolkit add-rule ./jira-rules.md
|
|
88
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "AI Toolkit - Language Plugin Packs"
|
|
3
|
+
category: reference
|
|
4
|
+
service: ai-toolkit
|
|
5
|
+
tags: [plugins, languages, rust, java, csharp, kotlin, swift, ruby]
|
|
6
|
+
version: "1.0.0"
|
|
7
|
+
created: "2026-03-29"
|
|
8
|
+
last_updated: "2026-03-29"
|
|
9
|
+
description: "6 language-specific plugin packs providing knowledge skills for Rust, Java, C#, Kotlin, Swift, and Ruby."
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Language Plugin Packs
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
Language packs are domain-scoped plugin packs that provide knowledge skills for specific programming languages. Each pack contains a single knowledge skill with idiomatic patterns, error handling, testing conventions, common frameworks, and performance tips.
|
|
17
|
+
|
|
18
|
+
## Available Packs
|
|
19
|
+
|
|
20
|
+
| Pack | Skill | Language | Key Topics |
|
|
21
|
+
|------|-------|----------|------------|
|
|
22
|
+
| `rust-pack` | `rust-patterns` | Rust | Ownership, borrowing, Cargo, tokio, serde |
|
|
23
|
+
| `java-pack` | `java-patterns` | Java | Records, sealed classes, Spring Boot, JUnit 5 |
|
|
24
|
+
| `csharp-pack` | `csharp-patterns` | C# / .NET | Nullable refs, async/await, ASP.NET Core, EF Core |
|
|
25
|
+
| `kotlin-pack` | `kotlin-patterns` | Kotlin | Coroutines, DSLs, sealed classes, Ktor, MockK |
|
|
26
|
+
| `swift-pack` | `swift-patterns` | Swift / iOS | Protocol-oriented, SwiftUI, async/await, SPM |
|
|
27
|
+
| `ruby-pack` | `ruby-patterns` | Ruby | Blocks, Rails conventions, RSpec, ActiveRecord |
|
|
28
|
+
|
|
29
|
+
## Skill Content Sections
|
|
30
|
+
|
|
31
|
+
Each language skill follows a consistent structure:
|
|
32
|
+
|
|
33
|
+
1. **Project Structure** — standard directory layout and build tool configuration
|
|
34
|
+
2. **Idioms / Code Style** — language-specific patterns and conventions
|
|
35
|
+
3. **Error Handling** — error types, patterns, and best practices
|
|
36
|
+
4. **Testing Patterns** — test frameworks, assertion libraries, mocking
|
|
37
|
+
5. **Common Libraries / Frameworks** — ecosystem essentials
|
|
38
|
+
6. **Performance Tips** — optimization techniques and profiling
|
|
39
|
+
7. **Build / Package Management** — dependency management and CI
|
|
40
|
+
|
|
41
|
+
## How Knowledge Skills Work
|
|
42
|
+
|
|
43
|
+
These skills have `user-invocable: false` in their frontmatter, meaning they are NOT slash commands. Instead, Claude loads them contextually when the conversation topic matches the skill's description trigger.
|
|
44
|
+
|
|
45
|
+
For example, when a user asks "How do I handle errors in Rust?", Claude automatically loads `rust-patterns` to provide idiomatic Rust error handling guidance.
|
|
46
|
+
|
|
47
|
+
## Requesting New Language Packs
|
|
48
|
+
|
|
49
|
+
File an issue with the `language-pack` label. Include:
|
|
50
|
+
- Language name
|
|
51
|
+
- Key topics to cover
|
|
52
|
+
- Popular frameworks/libraries to include
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Merge-Friendly Install Model"
|
|
3
|
+
category: reference
|
|
4
|
+
service: ai-toolkit
|
|
5
|
+
tags: [install, merge, hooks, injection, symlinks]
|
|
6
|
+
version: "1.0.0"
|
|
7
|
+
created: "2026-03-27"
|
|
8
|
+
last_updated: "2026-03-28"
|
|
9
|
+
description: "Reference description of how ai-toolkit preserves user content while installing toolkit components."
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Merge-Friendly Install Model
|
|
13
|
+
|
|
14
|
+
## Summary
|
|
15
|
+
|
|
16
|
+
`ai-toolkit` preserves user content while injecting toolkit behavior.
|
|
17
|
+
|
|
18
|
+
Instead of replacing entire directories or files, the installer uses merge-friendly strategies tailored to each component type.
|
|
19
|
+
|
|
20
|
+
## Component Strategies
|
|
21
|
+
|
|
22
|
+
| Component | Strategy | User content behavior |
|
|
23
|
+
|-----------|----------|-----------------------|
|
|
24
|
+
| `agents/*.md` | per-file symlinks | preserved; user file wins on name conflict |
|
|
25
|
+
| `skills/*/` | per-directory symlinks | preserved; user directory wins on name conflict |
|
|
26
|
+
| `settings.json` hooks | JSON merge with `_source: ai-toolkit` | preserved; toolkit entries removable |
|
|
27
|
+
| `constitution.md` | marker injection | preserved outside markers |
|
|
28
|
+
| `ARCHITECTURE.md` | marker injection | preserved outside markers |
|
|
29
|
+
| `CLAUDE.md` | marker injection | preserved outside markers |
|
|
30
|
+
|
|
31
|
+
## Why this model exists
|
|
32
|
+
|
|
33
|
+
This avoids two common failure modes:
|
|
34
|
+
1. users losing custom agents / skills due to whole-directory symlinks,
|
|
35
|
+
2. users losing custom hooks or docs due to full-file replacement.
|
|
36
|
+
|
|
37
|
+
## Operational Consequences
|
|
38
|
+
|
|
39
|
+
### Positive
|
|
40
|
+
- reversible installs and uninstalls,
|
|
41
|
+
- backward-compatible upgrades,
|
|
42
|
+
- safe coexistence of toolkit and user customizations,
|
|
43
|
+
- idempotent update flow.
|
|
44
|
+
|
|
45
|
+
### Trade-offs
|
|
46
|
+
- merged / copied artifacts require `ai-toolkit update` to refresh,
|
|
47
|
+
- hook merge logic depends on valid JSON and the `_source` tagging convention,
|
|
48
|
+
- install behavior is more complex than a simple copy or symlink-only model.
|
|
49
|
+
|
|
50
|
+
## Local Project Setup
|
|
51
|
+
|
|
52
|
+
Project-local setup uses the same preservation approach for files that should remain repository-specific, especially `CLAUDE.md` and `.claude/settings.local.json`.
|
|
53
|
+
|
|
54
|
+
## Related Documents
|
|
55
|
+
|
|
56
|
+
- `kb/reference/distribution-model.md`
|
|
57
|
+
- `kb/reference/global-install-model.md`
|
|
58
|
+
- `kb/reference/hooks-catalog.md`
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Plugin Pack Conventions"
|
|
3
|
+
category: reference
|
|
4
|
+
service: ai-toolkit
|
|
5
|
+
tags: [plugins, plugin-packs, conventions, manifests, hooks, policy-packs]
|
|
6
|
+
version: "1.0.0"
|
|
7
|
+
created: "2026-03-28"
|
|
8
|
+
last_updated: "2026-04-02"
|
|
9
|
+
description: "Conventions for experimental ai-toolkit plugin packs, policy packs, hook packs, and plugin-creator scaffolding."
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Plugin Pack Conventions
|
|
13
|
+
|
|
14
|
+
## Purpose
|
|
15
|
+
|
|
16
|
+
`ai-toolkit` now includes experimental plugin packs under `app/plugins/` to formalize a Claude Code-compatible plugin direction without changing the default global install surface.
|
|
17
|
+
|
|
18
|
+
## Pack Types
|
|
19
|
+
|
|
20
|
+
| Type | Purpose | Example |
|
|
21
|
+
|------|---------|---------|
|
|
22
|
+
| `plugin-pack` | Curated bundle of existing assets by domain | `security-pack`, `research-pack` |
|
|
23
|
+
| `policy-pack` | Rules / compliance / governance overlays | future enterprise policy add-ons |
|
|
24
|
+
| `hook-pack` | Optional hook modules or observability bundles | status line, output style |
|
|
25
|
+
|
|
26
|
+
## Directory Contract
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
app/plugins/<pack-name>/
|
|
30
|
+
├── plugin.json
|
|
31
|
+
├── README.md
|
|
32
|
+
├── hooks/ # optional, executable if present
|
|
33
|
+
├── rules/ # optional
|
|
34
|
+
├── skills/ # optional
|
|
35
|
+
├── agents/ # optional
|
|
36
|
+
└── templates/ # optional
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Manifest Contract
|
|
40
|
+
|
|
41
|
+
Required keys:
|
|
42
|
+
- `name`
|
|
43
|
+
- `description`
|
|
44
|
+
- `version`
|
|
45
|
+
- `domain`
|
|
46
|
+
- `type`
|
|
47
|
+
- `status`
|
|
48
|
+
- `requires`
|
|
49
|
+
- `includes`
|
|
50
|
+
|
|
51
|
+
`includes` should declare arrays for:
|
|
52
|
+
- `agents`
|
|
53
|
+
- `skills`
|
|
54
|
+
- `rules`
|
|
55
|
+
- `hooks`
|
|
56
|
+
|
|
57
|
+
## Naming Rules
|
|
58
|
+
|
|
59
|
+
- Pack directory and `name` should use lowercase-hyphen format
|
|
60
|
+
- Prefer `*-pack` suffix for curated bundles
|
|
61
|
+
- Hook module filenames should be kebab-case and executable
|
|
62
|
+
- Experimental packs should declare `"status": "experimental"`
|
|
63
|
+
|
|
64
|
+
## Adoption Rules
|
|
65
|
+
|
|
66
|
+
1. Packs are opt-in and must not be auto-installed by `ai-toolkit install`
|
|
67
|
+
2. Reuse core agents/skills before duplicating definitions
|
|
68
|
+
3. Optional hooks must be documented as opt-in and non-default
|
|
69
|
+
4. Policy packs should be additive and marker-injected where possible
|
|
70
|
+
5. Keep manifests small and reviewable; use README for narrative guidance
|
|
71
|
+
|
|
72
|
+
## CLI Management
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
ai-toolkit plugin list # show all 11 packs with install status
|
|
76
|
+
ai-toolkit plugin install <name> # install a single pack
|
|
77
|
+
ai-toolkit plugin install --all # install all 11 packs
|
|
78
|
+
ai-toolkit plugin update <name> # update a pack (remove + reinstall, preserves data)
|
|
79
|
+
ai-toolkit plugin update --all # update all installed packs
|
|
80
|
+
ai-toolkit plugin clean <name> # prune data older than 90 days (default)
|
|
81
|
+
ai-toolkit plugin clean <name> --days 30 # prune data older than 30 days
|
|
82
|
+
ai-toolkit plugin remove <name> # remove a pack
|
|
83
|
+
ai-toolkit plugin remove --all # remove all installed packs
|
|
84
|
+
ai-toolkit plugin status # show installed packs with data stats
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### What `plugin install` Does
|
|
88
|
+
|
|
89
|
+
1. **Verifies** referenced agents/skills exist in `~/.claude/` (links them from core if missing)
|
|
90
|
+
2. **Copies** plugin-specific hooks to `~/.ai-toolkit/hooks/plugin-<pack>-<hook>.sh`
|
|
91
|
+
3. **Copies** plugin-specific scripts to `~/.ai-toolkit/plugin-scripts/<pack>/`
|
|
92
|
+
4. **Runs** init scripts if present (e.g. `init_db.py` for memory-pack — safe to re-run, preserves data)
|
|
93
|
+
5. **Merges** plugin hooks into `~/.claude/settings.json` (tagged with `_source: ai-toolkit-plugin-<name>`)
|
|
94
|
+
6. **Records** installed state to `~/.ai-toolkit/plugins.json`
|
|
95
|
+
|
|
96
|
+
### What `plugin update` Does
|
|
97
|
+
|
|
98
|
+
1. **Removes** existing plugin hooks, scripts, and settings.json entries (same as `remove`)
|
|
99
|
+
2. **Reinstalls** from the current source (same as `install`)
|
|
100
|
+
3. **Preserves plugin data** (e.g. memory-pack SQLite database is never deleted)
|
|
101
|
+
4. `--all` updates only currently installed packs (not all available)
|
|
102
|
+
|
|
103
|
+
### What `plugin clean` Does
|
|
104
|
+
|
|
105
|
+
1. **Prunes** old plugin data based on `--days N` (default 90)
|
|
106
|
+
2. For memory-pack: deletes observations older than N days, removes orphan sessions, runs VACUUM
|
|
107
|
+
3. Shows before/after counts and DB size
|
|
108
|
+
|
|
109
|
+
### What `plugin remove` Does
|
|
110
|
+
|
|
111
|
+
1. **Removes** plugin hooks from `~/.ai-toolkit/hooks/`
|
|
112
|
+
2. **Removes** plugin scripts from `~/.ai-toolkit/plugin-scripts/`
|
|
113
|
+
3. **Strips** plugin hook entries from `settings.json` (by `_source` tag)
|
|
114
|
+
4. **Updates** `plugins.json` state
|
|
115
|
+
5. **Leaves** core agents/skills untouched (they belong to the base install)
|
|
116
|
+
6. **Leaves** plugin data intact (e.g. `memory.db` — use `clean` to prune)
|
|
117
|
+
|
|
118
|
+
### Data Retention (memory-pack)
|
|
119
|
+
|
|
120
|
+
- **Auto-retention**: `session-summary.sh` hook auto-prunes observations older than 90 days on every session end (configurable via `MEMORY_RETENTION_DAYS` env var)
|
|
121
|
+
- **Manual clean**: `ai-toolkit plugin clean memory-pack --days 30`
|
|
122
|
+
- **Status**: `ai-toolkit plugin status` shows DB size, observation count, date range
|
|
123
|
+
|
|
124
|
+
## Current Experimental Packs
|
|
125
|
+
|
|
126
|
+
| Pack | Domain | Agents | Skills | Hooks | Description |
|
|
127
|
+
|------|--------|--------|--------|-------|-------------|
|
|
128
|
+
| `security-pack` | security | 3 | 3 | 2 | Security auditing, threat modeling, OWASP |
|
|
129
|
+
| `research-pack` | research | 4 | 4 | 1 | Multi-source research, synthesis, fact-checking |
|
|
130
|
+
| `frontend-pack` | frontend | 3 | 3 | 1 | React/Vue/CSS, SEO, design engineering |
|
|
131
|
+
| `enterprise-pack` | enterprise | 3 | 3 | 3 | Executive briefings, infra architecture, status |
|
|
132
|
+
| `memory-pack` | memory | 0 | 1 | 2 | SQLite persistent memory with FTS5 search |
|
|
133
|
+
| `rust-pack` | rust | 0 | 1 | 0 | Rust patterns |
|
|
134
|
+
| `java-pack` | java | 0 | 1 | 0 | Java patterns |
|
|
135
|
+
| `csharp-pack` | csharp | 0 | 1 | 0 | C# patterns |
|
|
136
|
+
| `kotlin-pack` | kotlin | 0 | 1 | 0 | Kotlin patterns |
|
|
137
|
+
| `swift-pack` | swift | 0 | 1 | 0 | Swift patterns |
|
|
138
|
+
| `ruby-pack` | ruby | 0 | 1 | 0 | Ruby patterns |
|
|
139
|
+
|
|
140
|
+
## Optional Hook Modules
|
|
141
|
+
|
|
142
|
+
`enterprise-pack` provides two optional hook modules:
|
|
143
|
+
- `hooks/status-line.sh` — status line overlay
|
|
144
|
+
- `hooks/output-style.sh` — enterprise reporting style
|
|
145
|
+
|
|
146
|
+
`memory-pack` provides two hooks:
|
|
147
|
+
- `hooks/observation-capture.sh` — captures tool actions to SQLite (PostToolUse)
|
|
148
|
+
- `hooks/session-summary.sh` — summarizes session on Stop
|
|
149
|
+
|
|
150
|
+
These are intentionally excluded from the default install until explicitly enabled via `ai-toolkit plugin install`.
|
|
151
|
+
|