@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.
Files changed (327) hide show
  1. package/AGENTS.md +412 -0
  2. package/CHANGELOG.md +68 -0
  3. package/LICENSE +21 -0
  4. package/README.md +632 -0
  5. package/action.yml +53 -0
  6. package/app/.claude-plugin/plugin.json +44 -0
  7. package/app/ARCHITECTURE.md +306 -0
  8. package/app/CLAUDE.md.template +23 -0
  9. package/app/agents/ai-engineer.md +128 -0
  10. package/app/agents/backend-specialist.md +193 -0
  11. package/app/agents/business-intelligence.md +54 -0
  12. package/app/agents/chaos-monkey.md +67 -0
  13. package/app/agents/chief-of-staff.md +51 -0
  14. package/app/agents/code-archaeologist.md +127 -0
  15. package/app/agents/code-reviewer.md +184 -0
  16. package/app/agents/command-expert.md +131 -0
  17. package/app/agents/data-analyst.md +205 -0
  18. package/app/agents/data-scientist.md +151 -0
  19. package/app/agents/database-architect.md +317 -0
  20. package/app/agents/debugger.md +238 -0
  21. package/app/agents/devops-implementer.md +194 -0
  22. package/app/agents/documenter.md +364 -0
  23. package/app/agents/explorer-agent.md +145 -0
  24. package/app/agents/fact-checker.md +172 -0
  25. package/app/agents/frontend-specialist.md +209 -0
  26. package/app/agents/game-developer.md +216 -0
  27. package/app/agents/incident-responder.md +226 -0
  28. package/app/agents/infrastructure-architect.md +127 -0
  29. package/app/agents/infrastructure-validator.md +247 -0
  30. package/app/agents/llm-ops-engineer.md +237 -0
  31. package/app/agents/mcp-expert.md +228 -0
  32. package/app/agents/mcp-server-architect.md +195 -0
  33. package/app/agents/mcp-testing-engineer.md +292 -0
  34. package/app/agents/meta-architect.md +58 -0
  35. package/app/agents/ml-engineer.md +136 -0
  36. package/app/agents/mobile-developer.md +190 -0
  37. package/app/agents/night-watchman.md +55 -0
  38. package/app/agents/nlp-engineer.md +154 -0
  39. package/app/agents/orchestrator.md +437 -0
  40. package/app/agents/performance-optimizer.md +254 -0
  41. package/app/agents/predictive-analyst.md +57 -0
  42. package/app/agents/product-manager.md +194 -0
  43. package/app/agents/project-planner.md +287 -0
  44. package/app/agents/prompt-engineer.md +103 -0
  45. package/app/agents/qa-automation-engineer.md +182 -0
  46. package/app/agents/rag-engineer.md +201 -0
  47. package/app/agents/research-synthesizer.md +138 -0
  48. package/app/agents/search-specialist.md +101 -0
  49. package/app/agents/security-architect.md +62 -0
  50. package/app/agents/security-auditor.md +293 -0
  51. package/app/agents/seo-specialist.md +111 -0
  52. package/app/agents/system-governor.md +57 -0
  53. package/app/agents/tech-lead.md +62 -0
  54. package/app/agents/technical-researcher.md +103 -0
  55. package/app/agents/test-engineer.md +264 -0
  56. package/app/constitution.md +38 -0
  57. package/app/hooks/_profile-check.sh +11 -0
  58. package/app/hooks/guard-destructive.sh +74 -0
  59. package/app/hooks/guard-path.sh +73 -0
  60. package/app/hooks/post-tool-use.sh +35 -0
  61. package/app/hooks/pre-compact.sh +31 -0
  62. package/app/hooks/quality-check.sh +22 -0
  63. package/app/hooks/quality-gate.sh +49 -0
  64. package/app/hooks/save-session.sh +24 -0
  65. package/app/hooks/session-end.sh +37 -0
  66. package/app/hooks/session-start.sh +29 -0
  67. package/app/hooks/subagent-start.sh +16 -0
  68. package/app/hooks/subagent-stop.sh +16 -0
  69. package/app/hooks/track-usage.sh +50 -0
  70. package/app/hooks/user-prompt-submit.sh +25 -0
  71. package/app/hooks.json +178 -0
  72. package/app/mcp-defaults.json +23 -0
  73. package/app/output-styles/golden-rules.md +43 -0
  74. package/app/plugins/README.md +19 -0
  75. package/app/plugins/csharp-pack/README.md +11 -0
  76. package/app/plugins/csharp-pack/plugin.json +18 -0
  77. package/app/plugins/enterprise-pack/README.md +16 -0
  78. package/app/plugins/enterprise-pack/hooks/output-style.sh +6 -0
  79. package/app/plugins/enterprise-pack/hooks/status-line.sh +8 -0
  80. package/app/plugins/enterprise-pack/plugin.json +24 -0
  81. package/app/plugins/frontend-pack/README.md +14 -0
  82. package/app/plugins/frontend-pack/plugin.json +22 -0
  83. package/app/plugins/java-pack/README.md +11 -0
  84. package/app/plugins/java-pack/plugin.json +18 -0
  85. package/app/plugins/kotlin-pack/README.md +11 -0
  86. package/app/plugins/kotlin-pack/plugin.json +18 -0
  87. package/app/plugins/memory-pack/README.md +24 -0
  88. package/app/plugins/memory-pack/hooks/observation-capture.sh +67 -0
  89. package/app/plugins/memory-pack/hooks/session-summary.sh +71 -0
  90. package/app/plugins/memory-pack/plugin.json +22 -0
  91. package/app/plugins/memory-pack/scripts/init_db.py +81 -0
  92. package/app/plugins/memory-pack/scripts/strip_private.py +22 -0
  93. package/app/plugins/memory-pack/skills/mem-search/SKILL.md +70 -0
  94. package/app/plugins/research-pack/README.md +14 -0
  95. package/app/plugins/research-pack/plugin.json +22 -0
  96. package/app/plugins/ruby-pack/README.md +11 -0
  97. package/app/plugins/ruby-pack/plugin.json +18 -0
  98. package/app/plugins/rust-pack/README.md +11 -0
  99. package/app/plugins/rust-pack/plugin.json +18 -0
  100. package/app/plugins/security-pack/README.md +15 -0
  101. package/app/plugins/security-pack/plugin.json +23 -0
  102. package/app/plugins/swift-pack/README.md +11 -0
  103. package/app/plugins/swift-pack/plugin.json +18 -0
  104. package/app/rules/claude-toolkit-rules.md +21 -0
  105. package/app/rules/git-conventions.md +5 -0
  106. package/app/rules/quality-gates.md +10 -0
  107. package/app/skills/_lib/__init__.py +1 -0
  108. package/app/skills/_lib/detect_utils.py +150 -0
  109. package/app/skills/agent-creator/SKILL.md +82 -0
  110. package/app/skills/analyze/SKILL.md +92 -0
  111. package/app/skills/analyze/scripts/complexity.py +165 -0
  112. package/app/skills/api-patterns/SKILL.md +305 -0
  113. package/app/skills/app-builder/SKILL.md +187 -0
  114. package/app/skills/architecture-audit/SKILL.md +141 -0
  115. package/app/skills/architecture-decision/SKILL.md +55 -0
  116. package/app/skills/architecture-decision/templates/adr-template.md +36 -0
  117. package/app/skills/biz-scan/SKILL.md +30 -0
  118. package/app/skills/briefing/SKILL.md +27 -0
  119. package/app/skills/build/SKILL.md +97 -0
  120. package/app/skills/build/scripts/detect-build.py +151 -0
  121. package/app/skills/chaos/SKILL.md +32 -0
  122. package/app/skills/ci/SKILL.md +77 -0
  123. package/app/skills/ci/scripts/ci-detect.py +135 -0
  124. package/app/skills/ci/templates/github-actions-node.yml +38 -0
  125. package/app/skills/ci/templates/github-actions-python.yml +42 -0
  126. package/app/skills/ci-cd-patterns/SKILL.md +299 -0
  127. package/app/skills/clean-code/SKILL.md +110 -0
  128. package/app/skills/clean-code/reference/dart.md +18 -0
  129. package/app/skills/clean-code/reference/go.md +23 -0
  130. package/app/skills/clean-code/reference/php.md +32 -0
  131. package/app/skills/clean-code/reference/python.md +180 -0
  132. package/app/skills/clean-code/reference/typescript.md +26 -0
  133. package/app/skills/command-creator/SKILL.md +83 -0
  134. package/app/skills/commit/SKILL.md +98 -0
  135. package/app/skills/commit/scripts/pre-commit-check.py +87 -0
  136. package/app/skills/commit/templates/conventional-commit.md +52 -0
  137. package/app/skills/csharp-patterns/SKILL.md +450 -0
  138. package/app/skills/database-patterns/SKILL.md +297 -0
  139. package/app/skills/debug/SKILL.md +154 -0
  140. package/app/skills/debug/scripts/error-parser.py +187 -0
  141. package/app/skills/debugging-tactics/SKILL.md +136 -0
  142. package/app/skills/deploy/SKILL.md +130 -0
  143. package/app/skills/deploy/scripts/pre_deploy_check.py +171 -0
  144. package/app/skills/deploy/templates/deployment-checklist.md +31 -0
  145. package/app/skills/design-an-interface/SKILL.md +105 -0
  146. package/app/skills/design-engineering/SKILL.md +260 -0
  147. package/app/skills/docker-devops/SKILL.md +303 -0
  148. package/app/skills/docs/SKILL.md +145 -0
  149. package/app/skills/docs/scripts/doc-inventory.py +176 -0
  150. package/app/skills/docs/templates/adr-template.md +36 -0
  151. package/app/skills/docs/templates/readme-template.md +67 -0
  152. package/app/skills/documentation-standards/SKILL.md +191 -0
  153. package/app/skills/ecommerce-patterns/SKILL.md +209 -0
  154. package/app/skills/evaluate/SKILL.md +132 -0
  155. package/app/skills/evolve/SKILL.md +27 -0
  156. package/app/skills/explain/SKILL.md +54 -0
  157. package/app/skills/explain/scripts/dependency-graph.py +215 -0
  158. package/app/skills/explore/SKILL.md +112 -0
  159. package/app/skills/explore/scripts/visualize.py +117 -0
  160. package/app/skills/fix/SKILL.md +78 -0
  161. package/app/skills/fix/scripts/error-classifier.py +191 -0
  162. package/app/skills/flutter-patterns/SKILL.md +254 -0
  163. package/app/skills/git-mastery/SKILL.md +70 -0
  164. package/app/skills/grill-me/SKILL.md +38 -0
  165. package/app/skills/health/SKILL.md +91 -0
  166. package/app/skills/health/scripts/health_check.py +162 -0
  167. package/app/skills/hive-mind/SKILL.md +56 -0
  168. package/app/skills/hook-creator/SKILL.md +107 -0
  169. package/app/skills/index/SKILL.md +74 -0
  170. package/app/skills/instinct-review/SKILL.md +77 -0
  171. package/app/skills/java-patterns/SKILL.md +442 -0
  172. package/app/skills/kotlin-patterns/SKILL.md +446 -0
  173. package/app/skills/lint/SKILL.md +103 -0
  174. package/app/skills/lint/scripts/detect-linters.py +112 -0
  175. package/app/skills/mcp-patterns/SKILL.md +270 -0
  176. package/app/skills/mem-search/SKILL.md +70 -0
  177. package/app/skills/migrate/SKILL.md +90 -0
  178. package/app/skills/migrate/scripts/migration-status.py +195 -0
  179. package/app/skills/migration-patterns/SKILL.md +260 -0
  180. package/app/skills/night-watch/SKILL.md +28 -0
  181. package/app/skills/observability-patterns/SKILL.md +203 -0
  182. package/app/skills/onboard/SKILL.md +76 -0
  183. package/app/skills/orchestrate/SKILL.md +86 -0
  184. package/app/skills/panic/SKILL.md +30 -0
  185. package/app/skills/performance-profiling/SKILL.md +59 -0
  186. package/app/skills/plan/SKILL.md +110 -0
  187. package/app/skills/plan/templates/plan-template.md +40 -0
  188. package/app/skills/plan-writing/SKILL.md +201 -0
  189. package/app/skills/plugin-creator/SKILL.md +78 -0
  190. package/app/skills/pr/SKILL.md +129 -0
  191. package/app/skills/pr/scripts/pr-summary.py +175 -0
  192. package/app/skills/prd-to-issues/SKILL.md +108 -0
  193. package/app/skills/prd-to-plan/SKILL.md +120 -0
  194. package/app/skills/predict/SKILL.md +30 -0
  195. package/app/skills/qa-session/SKILL.md +110 -0
  196. package/app/skills/rag-patterns/SKILL.md +203 -0
  197. package/app/skills/refactor/SKILL.md +124 -0
  198. package/app/skills/refactor/scripts/refactor-scan.py +210 -0
  199. package/app/skills/refactor-plan/SKILL.md +112 -0
  200. package/app/skills/repeat/SKILL.md +149 -0
  201. package/app/skills/research-mastery/SKILL.md +56 -0
  202. package/app/skills/review/SKILL.md +141 -0
  203. package/app/skills/review/scripts/diff-analyzer.py +170 -0
  204. package/app/skills/rollback/SKILL.md +87 -0
  205. package/app/skills/rollback/scripts/rollback_info.py +149 -0
  206. package/app/skills/ruby-patterns/SKILL.md +454 -0
  207. package/app/skills/rust-patterns/SKILL.md +446 -0
  208. package/app/skills/search/SKILL.md +64 -0
  209. package/app/skills/security-patterns/SKILL.md +91 -0
  210. package/app/skills/security-patterns/reference/authentication.md +37 -0
  211. package/app/skills/security-patterns/reference/authorization.md +22 -0
  212. package/app/skills/security-patterns/reference/input-validation.md +30 -0
  213. package/app/skills/security-patterns/reference/oauth-csrf-audit.md +131 -0
  214. package/app/skills/skill-creator/SKILL.md +154 -0
  215. package/app/skills/skill-creator/templates/dashboard/index.html +130 -0
  216. package/app/skills/skill-creator/templates/reasoning-engine/assets/example.json +12 -0
  217. package/app/skills/skill-creator/templates/reasoning-engine/search.py +110 -0
  218. package/app/skills/subagent-development/SKILL.md +225 -0
  219. package/app/skills/subagent-development/reference/code-quality-reviewer-prompt.md +145 -0
  220. package/app/skills/subagent-development/reference/implementer-prompt.md +118 -0
  221. package/app/skills/subagent-development/reference/spec-reviewer-prompt.md +100 -0
  222. package/app/skills/swarm/SKILL.md +81 -0
  223. package/app/skills/swift-patterns/SKILL.md +500 -0
  224. package/app/skills/tdd/SKILL.md +174 -0
  225. package/app/skills/tdd/reference/deep-modules.md +32 -0
  226. package/app/skills/tdd/reference/interface-design.md +32 -0
  227. package/app/skills/tdd/reference/mocking.md +52 -0
  228. package/app/skills/tdd/reference/refactoring.md +10 -0
  229. package/app/skills/tdd/reference/tests.md +59 -0
  230. package/app/skills/teams/SKILL.md +101 -0
  231. package/app/skills/test/SKILL.md +107 -0
  232. package/app/skills/test/scripts/detect-runner.py +113 -0
  233. package/app/skills/testing-patterns/SKILL.md +73 -0
  234. package/app/skills/testing-patterns/reference/flutter-testing.md +33 -0
  235. package/app/skills/testing-patterns/reference/go-testing.md +52 -0
  236. package/app/skills/testing-patterns/reference/php-phpunit.md +39 -0
  237. package/app/skills/testing-patterns/reference/python-pytest.md +228 -0
  238. package/app/skills/testing-patterns/reference/typescript-vitest.md +50 -0
  239. package/app/skills/triage-issue/SKILL.md +120 -0
  240. package/app/skills/typescript-patterns/SKILL.md +256 -0
  241. package/app/skills/ubiquitous-language/SKILL.md +74 -0
  242. package/app/skills/verification-before-completion/SKILL.md +108 -0
  243. package/app/skills/workflow/SKILL.md +250 -0
  244. package/app/skills/write-a-prd/SKILL.md +129 -0
  245. package/app/skills/write-a-prd/reference/visual-companion.md +78 -0
  246. package/app/skills/write-a-prd/scripts/frame-template.html +111 -0
  247. package/app/skills/write-a-prd/scripts/visual-server.cjs +79 -0
  248. package/app/templates/skill/generator/SKILL.md.template +40 -0
  249. package/app/templates/skill/knowledge/SKILL.md.template +52 -0
  250. package/app/templates/skill/linter/SKILL.md.template +34 -0
  251. package/app/templates/skill/reviewer/SKILL.md.template +51 -0
  252. package/app/templates/skill/workflow/SKILL.md.template +49 -0
  253. package/benchmarks/README.md +111 -0
  254. package/benchmarks/ecosystem-dashboard.json +148 -0
  255. package/benchmarks/ecosystem-harvest.json +148 -0
  256. package/benchmarks/results.json +38 -0
  257. package/benchmarks/run.py +351 -0
  258. package/bin/ai-toolkit.js +345 -0
  259. package/kb/best-practices/README.md +11 -0
  260. package/kb/howto/README.md +11 -0
  261. package/kb/procedures/maintenance-sop.md +306 -0
  262. package/kb/reference/agents-catalog.md +124 -0
  263. package/kb/reference/anti-pattern-registry-format.md +221 -0
  264. package/kb/reference/architecture-overview.md +232 -0
  265. package/kb/reference/benchmark-config.md +62 -0
  266. package/kb/reference/ci-integration.md +66 -0
  267. package/kb/reference/claude-ecosystem-benchmark-snapshot.md +80 -0
  268. package/kb/reference/claude-ecosystem-expansion-foundations.md +102 -0
  269. package/kb/reference/commands-catalog.md +21 -0
  270. package/kb/reference/distribution-model.md +63 -0
  271. package/kb/reference/global-install-model.md +56 -0
  272. package/kb/reference/hierarchical-override-pattern.md +200 -0
  273. package/kb/reference/hooks-catalog.md +306 -0
  274. package/kb/reference/integrations.md +88 -0
  275. package/kb/reference/language-packs.md +52 -0
  276. package/kb/reference/merge-friendly-install-model.md +58 -0
  277. package/kb/reference/plugin-pack-conventions.md +151 -0
  278. package/kb/reference/quick-wins-implementation-summary.md +70 -0
  279. package/kb/reference/skill-templates.md +50 -0
  280. package/kb/reference/skills-catalog.md +215 -0
  281. package/kb/reference/skills-unification.md +57 -0
  282. package/kb/reference/stats.md +69 -0
  283. package/kb/reference/sync.md +76 -0
  284. package/kb/troubleshooting/README.md +11 -0
  285. package/llms-full.txt +3068 -0
  286. package/llms.txt +39 -0
  287. package/package.json +75 -0
  288. package/scripts/_common.py +160 -0
  289. package/scripts/add_rule.py +50 -0
  290. package/scripts/benchmark_config.py +127 -0
  291. package/scripts/benchmark_ecosystem.py +288 -0
  292. package/scripts/check_deps.py +260 -0
  293. package/scripts/create_skill.py +118 -0
  294. package/scripts/doctor.py +504 -0
  295. package/scripts/eject.py +113 -0
  296. package/scripts/emission.py +256 -0
  297. package/scripts/evaluate_skills.py +260 -0
  298. package/scripts/frontmatter.py +58 -0
  299. package/scripts/generate_agents_md.py +91 -0
  300. package/scripts/generate_aider_conf.py +51 -0
  301. package/scripts/generate_cline.py +35 -0
  302. package/scripts/generate_copilot.py +30 -0
  303. package/scripts/generate_cursor_rules.py +35 -0
  304. package/scripts/generate_gemini.py +28 -0
  305. package/scripts/generate_llms_txt.py +164 -0
  306. package/scripts/generate_roo_modes.py +80 -0
  307. package/scripts/generate_windsurf.py +35 -0
  308. package/scripts/generator_base.py +140 -0
  309. package/scripts/harvest_ecosystem.py +50 -0
  310. package/scripts/inject_rule_cli.py +101 -0
  311. package/scripts/inject_section_cli.py +47 -0
  312. package/scripts/injection.py +180 -0
  313. package/scripts/install.py +236 -0
  314. package/scripts/install_git_hooks.py +71 -0
  315. package/scripts/install_steps/__init__.py +5 -0
  316. package/scripts/install_steps/ai_tools.py +261 -0
  317. package/scripts/install_steps/hooks.py +90 -0
  318. package/scripts/install_steps/markers.py +79 -0
  319. package/scripts/install_steps/symlinks.py +87 -0
  320. package/scripts/merge-hooks.py +192 -0
  321. package/scripts/plugin.py +642 -0
  322. package/scripts/plugin_schema.py +138 -0
  323. package/scripts/remove_rule.py +58 -0
  324. package/scripts/stats.py +81 -0
  325. package/scripts/sync.py +215 -0
  326. package/scripts/uninstall.py +292 -0
  327. package/scripts/validate.py +700 -0
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: biz-scan
3
+ description: "Scan codebase for business opportunities and KPIs"
4
+ effort: medium
5
+ disable-model-invocation: true
6
+ argument-hint: "[area]"
7
+ agent: business-intelligence
8
+ context: fork
9
+ allowed-tools: Read, Grep, Glob
10
+ ---
11
+
12
+ # Biz Scan Command
13
+
14
+ $ARGUMENTS
15
+
16
+ Triggers the Business Intelligence agent to find opportunities.
17
+
18
+ ## Usage
19
+
20
+ ```bash
21
+ /biz-scan [scope]
22
+ # Example: /biz-scan schema
23
+ # Example: /biz-scan all
24
+ ```
25
+
26
+ ## Protocol
27
+ 1. **Model Scan**: Read DB schema / Entities.
28
+ 2. **Logic Scan**: Read Controllers / UseCases.
29
+ 3. **Synthesis**: Match Data vs Business Goals.
30
+ 4. **Report**: Generate Opportunity Report.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: briefing
3
+ description: "Generate executive daily briefing across all agents"
4
+ effort: medium
5
+ disable-model-invocation: true
6
+ agent: chief-of-staff
7
+ context: fork
8
+ allowed-tools: Read, Grep, Glob
9
+ ---
10
+
11
+ # Briefing Command
12
+
13
+ Triggers the Chief of Staff to generate an executive summary.
14
+
15
+ ## Usage
16
+
17
+ ```bash
18
+ /briefing [period]
19
+ # Example: /briefing today
20
+ # Example: /briefing week
21
+ ```
22
+
23
+ ## Protocol
24
+ 1. **Collect**: Gather logs from `kb/learnings/`, `maintenance/` logs, and recent runs.
25
+ 2. **Synthesize**: Group by category (Ops, Strategy, Actions).
26
+ 3. **Filter**: Remove low-priority success logs.
27
+ 4. **Present**: Render the Daily Brief.
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: build
3
+ description: "Build the project with auto-detected toolchain"
4
+ effort: low
5
+ disable-model-invocation: true
6
+ argument-hint: "[target]"
7
+ allowed-tools: Bash, Read
8
+ ---
9
+
10
+ # Build Project
11
+
12
+ $ARGUMENTS
13
+
14
+ Build the current project.
15
+
16
+ ## Project context
17
+
18
+ - Project config: !`cat package.json 2>/dev/null || cat pyproject.toml 2>/dev/null || echo "unknown"`
19
+
20
+ ## Auto-Detection
21
+
22
+ Run the bundled script to detect build system:
23
+
24
+ ```bash
25
+ python3 ${CLAUDE_SKILL_DIR}/scripts/detect-build.py [dev|prod|docker]
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ```
31
+ /build [target]
32
+ ```
33
+
34
+ ## What This Command Does
35
+
36
+ 1. **Detects** project type
37
+ 2. **Runs** appropriate build command
38
+ 3. **Reports** build status
39
+
40
+ ## Build Commands by Project Type
41
+
42
+ | Project Type | Build Command |
43
+ |--------------|---------------|
44
+ | Node.js | `npm run build` or `pnpm build` |
45
+ | Python | `poetry build` or `pip install -e .` |
46
+ | Flutter | `flutter build` |
47
+ | Go | `go build ./...` |
48
+ | Rust | `cargo build --release` |
49
+ | Docker | `docker compose build` |
50
+
51
+ ## Output Format
52
+
53
+ ```markdown
54
+ ## Build Report
55
+
56
+ ### Status: Success / Failed
57
+
58
+ ### Build Details
59
+ - **Project**: [name]
60
+ - **Type**: [type]
61
+ - **Command**: [command used]
62
+ - **Duration**: [time]
63
+
64
+ ### Artifacts
65
+ - [artifact 1]
66
+ - [artifact 2]
67
+
68
+ ### Warnings
69
+ - [warning if any]
70
+
71
+ ### Errors
72
+ - [error if any]
73
+ ```
74
+
75
+ ## Targets
76
+
77
+ | Target | Description |
78
+ |--------|-------------|
79
+ | `dev` | Development build |
80
+ | `prod` | Production build |
81
+ | `docker` | Docker image build |
82
+ | `all` | Build all targets |
83
+
84
+ ## MANDATORY: Documentation Update
85
+
86
+ After build configuration changes, update documentation:
87
+
88
+ ### When to Update
89
+ - Build config changes -> Update build docs
90
+ - New dependencies -> Update requirements docs
91
+ - Docker changes -> Update Docker docs
92
+ - CI changes -> Update CI/CD docs
93
+
94
+ ### Post-Build Changes Checklist
95
+ - [ ] Build successful
96
+ - [ ] **README build instructions updated** (if changed)
97
+ - [ ] **CI/CD config documented**
@@ -0,0 +1,151 @@
1
+ #!/usr/bin/env python3
2
+ """Detect build system, package manager, and available build/dev/docker commands.
3
+
4
+ Scans a project directory for Node.js, Python, Flutter/Dart, Go, Rust,
5
+ PHP, and Makefile-based projects. Returns a JSON object describing the
6
+ project type, package manager, suggested build and dev commands, Docker
7
+ build command (if applicable), available Makefile targets, and the
8
+ configuration file used for detection.
9
+
10
+ Usage::
11
+
12
+ python3 detect-build.py [project_directory] [dev|prod|docker]
13
+ """
14
+ from __future__ import annotations
15
+
16
+ import sys
17
+ from pathlib import Path
18
+ from typing import Any
19
+
20
+ sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent))
21
+ from _lib.detect_utils import parse_makefile_targets, read_json, read_text, run_detector
22
+
23
+
24
+ def detect_package_manager(project_dir: Path) -> str | None:
25
+ """Detect the Node.js package manager from lock files."""
26
+ checks: list[tuple[str, str]] = [
27
+ ("bun.lockb", "bun"),
28
+ ("pnpm-lock.yaml", "pnpm"),
29
+ ("yarn.lock", "yarn"),
30
+ ("package-lock.json", "npm"),
31
+ ]
32
+ for lockfile, manager in checks:
33
+ if (project_dir / lockfile).exists():
34
+ return manager
35
+ if (project_dir / "package.json").exists():
36
+ return "npm"
37
+ return None
38
+
39
+
40
+ def detect(project_dir: Path, target: str | None = None) -> dict[str, Any]:
41
+ """Detect the build system for the given project directory."""
42
+ result: dict[str, Any] = {
43
+ "project_type": None, "package_manager": None,
44
+ "build_command": None, "dev_command": None,
45
+ "docker_build": None, "makefile_targets": [],
46
+ "scripts": {}, "detected_from": None,
47
+ }
48
+
49
+ result["makefile_targets"] = parse_makefile_targets(project_dir)
50
+
51
+ # Docker detection
52
+ has_dockerfile = (project_dir / "Dockerfile").exists()
53
+ has_compose = (project_dir / "docker-compose.yml").exists() or (project_dir / "docker-compose.yaml").exists() or (project_dir / "compose.yml").exists()
54
+ if has_dockerfile or has_compose:
55
+ if has_compose:
56
+ result["docker_build"] = "docker compose build"
57
+ elif has_dockerfile:
58
+ result["docker_build"] = "docker build -t app ."
59
+
60
+ # Node.js
61
+ pkg = read_json(project_dir / "package.json")
62
+ if pkg:
63
+ pm = detect_package_manager(project_dir)
64
+ result["project_type"] = "node"
65
+ result["package_manager"] = pm
66
+ result["detected_from"] = "package.json"
67
+ scripts = pkg.get("scripts", {})
68
+ result["scripts"] = {k: v for k, v in scripts.items() if k in
69
+ {"build", "dev", "start", "preview", "lint", "test", "typecheck"}}
70
+ run_pfx = f"{pm} run" if pm in ("npm", "pnpm") else (f"{pm} run" if pm == "yarn" else f"{pm} run")
71
+ if pm == "bun":
72
+ run_pfx = "bun run"
73
+ result["build_command"] = f"{run_pfx} build" if "build" in scripts else None
74
+ result["dev_command"] = f"{run_pfx} dev" if "dev" in scripts else (f"{run_pfx} start" if "start" in scripts else None)
75
+ if target == "docker" and result["docker_build"]:
76
+ result["build_command"] = result["docker_build"]
77
+ return result
78
+
79
+ # Python
80
+ pyproject = read_text(project_dir / "pyproject.toml")
81
+ if pyproject or (project_dir / "setup.py").exists():
82
+ result["project_type"] = "python"
83
+ result["detected_from"] = "pyproject.toml" if pyproject else "setup.py"
84
+ if pyproject and "poetry" in pyproject:
85
+ result["package_manager"] = "poetry"
86
+ result["build_command"] = "poetry build"
87
+ result["dev_command"] = "poetry run python -m app"
88
+ elif pyproject and "hatchling" in pyproject:
89
+ result["package_manager"] = "hatch"
90
+ result["build_command"] = "hatch build"
91
+ else:
92
+ result["package_manager"] = "pip"
93
+ result["build_command"] = "pip install -e ."
94
+ if target == "docker" and result["docker_build"]:
95
+ result["build_command"] = result["docker_build"]
96
+ return result
97
+
98
+ # Flutter/Dart
99
+ if (project_dir / "pubspec.yaml").exists():
100
+ result.update(project_type="flutter", package_manager="pub",
101
+ detected_from="pubspec.yaml",
102
+ build_command="flutter build", dev_command="flutter run")
103
+ return result
104
+
105
+ # Go
106
+ if (project_dir / "go.mod").exists():
107
+ result.update(project_type="go", package_manager="go",
108
+ detected_from="go.mod",
109
+ build_command="go build ./...", dev_command="go run .")
110
+ return result
111
+
112
+ # Rust
113
+ if (project_dir / "Cargo.toml").exists():
114
+ result.update(project_type="rust", package_manager="cargo",
115
+ detected_from="Cargo.toml",
116
+ build_command="cargo build --release", dev_command="cargo run")
117
+ return result
118
+
119
+ # PHP
120
+ if (project_dir / "composer.json").exists():
121
+ result.update(project_type="php", package_manager="composer",
122
+ detected_from="composer.json",
123
+ build_command="composer install --no-dev --optimize-autoloader",
124
+ dev_command="composer install && php -S localhost:8000 -t public/")
125
+ return result
126
+
127
+ # Fallback: Makefile-only project
128
+ if result["makefile_targets"]:
129
+ result["project_type"] = "makefile"
130
+ result["detected_from"] = "Makefile"
131
+ if "build" in result["makefile_targets"]:
132
+ result["build_command"] = "make build"
133
+ if "dev" in result["makefile_targets"]:
134
+ result["dev_command"] = "make dev"
135
+ return result
136
+
137
+ result["project_type"] = "unknown"
138
+ return result
139
+
140
+
141
+ if __name__ == "__main__":
142
+ # Handle target arg (dev/prod/docker) specially
143
+ target: str | None = None
144
+ clean_argv = [sys.argv[0]]
145
+ for arg in sys.argv[1:]:
146
+ if arg in ("dev", "prod", "docker"):
147
+ target = arg
148
+ else:
149
+ clean_argv.append(arg)
150
+ sys.argv = clean_argv
151
+ run_detector(lambda d: detect(d, target))
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: chaos
3
+ description: "Inject controlled faults for resilience testing"
4
+ effort: medium
5
+ disable-model-invocation: true
6
+ argument-hint: "[target]"
7
+ context: fork
8
+ agent: chaos-monkey
9
+ allowed-tools: Bash, Read
10
+ ---
11
+
12
+ # Chaos Command
13
+
14
+ $ARGUMENTS
15
+
16
+ Triggers a controlled resilience experiment.
17
+
18
+ ## Usage
19
+
20
+ ```bash
21
+ /chaos <experiment> [target]
22
+ # Example: /chaos latency backend-api
23
+ # Example: /chaos kill redis
24
+ ```
25
+
26
+ ## Protocol
27
+ 1. **Safety Check**: Verify env != PROD.
28
+ 2. **Baseline**: Check system health is green.
29
+ 3. **Inject**: Run the fault injection.
30
+ 4. **Observe**: Monitor logs/metrics for 60s.
31
+ 5. **Recover**: Restore system health.
32
+ 6. **Report**: Did we survive?
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: ci
3
+ description: "Detect and run CI pipeline with status reporting"
4
+ effort: medium
5
+ disable-model-invocation: true
6
+ argument-hint: "[platform]"
7
+ allowed-tools: Bash, Read, Write
8
+ agent: devops-implementer
9
+ context: fork
10
+ scripts:
11
+ - scripts/ci-detect.py
12
+ ---
13
+
14
+ # /ci - CI/CD Pipeline Management
15
+
16
+ $ARGUMENTS
17
+
18
+ ## What This Command Does
19
+
20
+ Generate, update, or troubleshoot CI/CD pipeline configuration based on project type.
21
+
22
+ ## Project context
23
+
24
+ - CI config: !`cat .github/workflows/*.yml 2>/dev/null || cat .gitlab-ci.yml 2>/dev/null || echo "no-ci"`
25
+
26
+ ## CI Detection Script
27
+
28
+ Detect CI platform and analyze configuration:
29
+ ```bash
30
+ python3 scripts/ci-detect.py [directory]
31
+ ```
32
+
33
+ Returns JSON with:
34
+ - `platform` - detected CI platform (github-actions, gitlab-ci, jenkins, bitbucket, circleci)
35
+ - `config_files[]` - CI config file paths
36
+ - `project_type` - detected project type (python, node, flutter, go, rust, php, docker)
37
+ - `jobs_found[]` - job/stage names extracted from config
38
+ - `stages_detected[]` - best-practice stages found (lint, test, build, deploy)
39
+ - `missing_stages[]` - recommended stages not yet configured
40
+ - `suggested_template` - pointer to ci-cd-patterns skill for templates
41
+
42
+ ## Auto-Detection
43
+
44
+ | File Found | Project Type | Pipeline |
45
+ |------------|-------------|----------|
46
+ | `package.json` | Node.js/TypeScript | npm ci, lint, test, build |
47
+ | `pyproject.toml` / `setup.py` | Python | pip install, ruff, mypy, pytest |
48
+ | `pubspec.yaml` | Flutter/Dart | dart analyze, flutter test, build |
49
+ | `composer.json` | PHP | composer install, phpstan, phpunit |
50
+ | `go.mod` | Go | go vet, go test, go build |
51
+ | `Cargo.toml` | Rust | cargo clippy, cargo test, cargo build |
52
+ | `Dockerfile` | Docker | Build and push image |
53
+
54
+ ## Supported Platforms
55
+
56
+ - **GitHub Actions** (default): `.github/workflows/ci.yml`
57
+ - **GitLab CI**: `.gitlab-ci.yml`
58
+
59
+ ## Pipeline Stages
60
+
61
+ 1. **Lint** - Static analysis, formatting checks
62
+ 2. **Test** - Unit tests, integration tests with coverage
63
+ 3. **Build** - Compile, bundle, Docker image
64
+ 4. **Deploy** (optional) - Deploy to staging/production
65
+
66
+ ## Usage Examples
67
+
68
+ ```
69
+ /ci # Generate CI config for detected project type
70
+ /ci github-actions # Explicitly use GitHub Actions
71
+ /ci add deploy staging # Add deployment stage for staging
72
+ /ci fix # Troubleshoot failing pipeline
73
+ /ci add matrix node 18,20,22 # Add matrix testing
74
+ ```
75
+
76
+ ## Reference Skill
77
+ Use `ci-cd-patterns` skill for pipeline templates and best practices.
@@ -0,0 +1,135 @@
1
+ #!/usr/bin/env python3
2
+ """Detect CI platform, analyze configuration, and suggest improvements.
3
+
4
+ Scans a project directory for CI/CD configuration files (GitHub Actions,
5
+ GitLab CI, Jenkins, Bitbucket Pipelines, CircleCI), detects the project
6
+ type, extracts job/stage names, identifies which best-practice stages
7
+ are present, and reports any missing stages with a pointer to the
8
+ ``ci-cd-patterns`` skill for templates.
9
+
10
+ Usage::
11
+
12
+ python3 ci-detect.py [directory]
13
+ """
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import re
18
+ import sys
19
+ from pathlib import Path
20
+
21
+ sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent))
22
+ from _lib.detect_utils import detect_project_type, run_detector
23
+
24
+ CI_PLATFORMS: dict[str, str] = {
25
+ "github-actions": ".github/workflows",
26
+ "gitlab-ci": ".gitlab-ci.yml",
27
+ "jenkins": "Jenkinsfile",
28
+ "bitbucket": "bitbucket-pipelines.yml",
29
+ "circleci": ".circleci/config.yml",
30
+ }
31
+
32
+ BEST_PRACTICE_STAGES: dict[str, list[str]] = {
33
+ "python": ["lint", "test", "build", "deploy"],
34
+ "node": ["lint", "test", "build", "deploy"],
35
+ "flutter": ["analyze", "test", "build", "deploy"],
36
+ "go": ["vet", "test", "build", "deploy"],
37
+ "rust": ["clippy", "test", "build", "deploy"],
38
+ "php": ["lint", "test", "build", "deploy"],
39
+ "docker": ["build", "test", "push", "deploy"],
40
+ }
41
+
42
+ STAGE_PATTERNS: dict[str, str] = {
43
+ "lint": r"(?i)(lint|ruff|eslint|flake8|pylint|phpstan|rubocop|golangci)",
44
+ "test": r"(?i)(test|pytest|jest|vitest|phpunit|go\s+test|cargo\s+test|flutter\s+test)",
45
+ "build": r"(?i)(build|compile|bundle|docker\s+build|cargo\s+build|go\s+build|flutter\s+build)",
46
+ "deploy": r"(?i)(deploy|release|publish|push|upload|heroku|aws|gcp|azure)",
47
+ "analyze": r"(?i)(analyze|dart\s+analyze|static.?analysis)",
48
+ "vet": r"(?i)(go\s+vet|vet)",
49
+ "clippy": r"(?i)(clippy|cargo\s+clippy)",
50
+ "push": r"(?i)(docker\s+push|push.*registry|push.*image)",
51
+ }
52
+
53
+
54
+ def detect_platform(project_dir: Path) -> tuple[str | None, list[str]]:
55
+ """Detect the CI platform and return its config file paths."""
56
+ for platform, path_pattern in CI_PLATFORMS.items():
57
+ full_path = project_dir / path_pattern
58
+ if platform == "github-actions":
59
+ if full_path.is_dir():
60
+ configs = sorted(str(f.relative_to(project_dir)) for f in full_path.glob("*.yml"))
61
+ configs += sorted(str(f.relative_to(project_dir)) for f in full_path.glob("*.yaml"))
62
+ if configs:
63
+ return platform, configs
64
+ elif full_path.exists():
65
+ return platform, [str(full_path.relative_to(project_dir))]
66
+ return None, []
67
+
68
+
69
+ def extract_stages_from_config(config_path: Path) -> list[str]:
70
+ """Extract job/stage names from a CI config file using regex."""
71
+ try:
72
+ content = config_path.read_text()
73
+ except (OSError, UnicodeDecodeError):
74
+ return []
75
+
76
+ stages: list[str] = []
77
+ for match in re.finditer(r"^\s{2}(\w[\w-]*):\s*$", content, re.MULTILINE):
78
+ stages.append(match.group(1))
79
+ for match in re.finditer(r"^(\w[\w-]*):\s*$", content, re.MULTILINE):
80
+ name = match.group(1)
81
+ if name not in ("on", "true", "false", "name", "env", "permissions", "concurrency"):
82
+ stages.append(name)
83
+ return list(dict.fromkeys(stages))
84
+
85
+
86
+ def detect_present_stages(config_files: list[Path], project_type: str | None) -> list[str]:
87
+ """Detect which best-practice stages are present in the CI config."""
88
+ all_content = ""
89
+ for cf in config_files:
90
+ try:
91
+ all_content += cf.read_text() + "\n"
92
+ except (OSError, UnicodeDecodeError):
93
+ continue
94
+
95
+ expected = BEST_PRACTICE_STAGES.get(project_type or "", ["lint", "test", "build", "deploy"])
96
+ found: list[str] = []
97
+ for stage in expected:
98
+ pattern = STAGE_PATTERNS.get(stage)
99
+ if pattern and re.search(pattern, all_content):
100
+ found.append(stage)
101
+ return found
102
+
103
+
104
+ def detect(project_dir: Path) -> dict:
105
+ """Detect CI platform and analyze pipeline stages."""
106
+ platform, config_files = detect_platform(project_dir)
107
+ project_type = detect_project_type(project_dir)
108
+ expected_stages = BEST_PRACTICE_STAGES.get(project_type or "", ["lint", "test", "build", "deploy"])
109
+
110
+ config_paths = [project_dir / cf for cf in config_files]
111
+ stages_detected = detect_present_stages(config_paths, project_type)
112
+ missing_stages = [s for s in expected_stages if s not in stages_detected]
113
+
114
+ job_names: list[str] = []
115
+ for cp in config_paths:
116
+ job_names.extend(extract_stages_from_config(cp))
117
+
118
+ suggested_template: str | None = None
119
+ if missing_stages and project_type:
120
+ suggested_template = f"ci-cd-patterns skill: {project_type} pipeline template"
121
+
122
+ return {
123
+ "platform": platform,
124
+ "config_files": config_files,
125
+ "project_type": project_type,
126
+ "jobs_found": job_names,
127
+ "stages_detected": stages_detected,
128
+ "expected_stages": expected_stages,
129
+ "missing_stages": missing_stages,
130
+ "suggested_template": suggested_template,
131
+ }
132
+
133
+
134
+ if __name__ == "__main__":
135
+ run_detector(detect)
@@ -0,0 +1,38 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ node-version: [18, 20, 22]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Use Node.js ${{ matrix.node-version }}
20
+ uses: actions/setup-node@v4
21
+ with:
22
+ node-version: ${{ matrix.node-version }}
23
+ cache: 'npm'
24
+
25
+ - name: Install dependencies
26
+ run: npm ci
27
+
28
+ - name: Lint
29
+ run: npm run lint
30
+
31
+ - name: Type check
32
+ run: npx tsc --noEmit
33
+
34
+ - name: Test
35
+ run: npm test -- --coverage
36
+
37
+ - name: Build
38
+ run: npm run build
@@ -0,0 +1,42 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e ".[dev]"
28
+
29
+ - name: Lint
30
+ run: ruff check .
31
+
32
+ - name: Type check
33
+ run: mypy --strict src/
34
+
35
+ - name: Test
36
+ run: pytest --cov=src --cov-report=xml
37
+
38
+ - name: Upload coverage
39
+ if: matrix.python-version == '3.12'
40
+ uses: codecov/codecov-action@v4
41
+ with:
42
+ file: ./coverage.xml