autonomous-coding-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 (324) hide show
  1. package/.claude-plugin/marketplace.json +22 -0
  2. package/.claude-plugin/plugin.json +13 -0
  3. package/LICENSE +21 -0
  4. package/Makefile +21 -0
  5. package/README.md +140 -0
  6. package/SECURITY.md +28 -0
  7. package/agents/bash-expert.md +113 -0
  8. package/agents/dependency-auditor.md +138 -0
  9. package/agents/integration-tester.md +120 -0
  10. package/agents/lesson-scanner.md +149 -0
  11. package/agents/python-expert.md +179 -0
  12. package/agents/service-monitor.md +141 -0
  13. package/agents/shell-expert.md +147 -0
  14. package/benchmarks/runner.sh +147 -0
  15. package/benchmarks/tasks/01-rest-endpoint/rubric.sh +29 -0
  16. package/benchmarks/tasks/01-rest-endpoint/task.md +17 -0
  17. package/benchmarks/tasks/02-refactor-module/task.md +8 -0
  18. package/benchmarks/tasks/03-fix-integration-bug/task.md +8 -0
  19. package/benchmarks/tasks/04-add-test-coverage/task.md +8 -0
  20. package/benchmarks/tasks/05-multi-file-feature/task.md +8 -0
  21. package/bin/act.js +238 -0
  22. package/commands/autocode.md +6 -0
  23. package/commands/cancel-ralph.md +18 -0
  24. package/commands/code-factory.md +53 -0
  25. package/commands/create-prd.md +55 -0
  26. package/commands/ralph-loop.md +18 -0
  27. package/commands/run-plan.md +117 -0
  28. package/commands/submit-lesson.md +122 -0
  29. package/docs/ARCHITECTURE.md +630 -0
  30. package/docs/CONTRIBUTING.md +125 -0
  31. package/docs/lessons/0001-bare-exception-swallowing.md +34 -0
  32. package/docs/lessons/0002-async-def-without-await.md +28 -0
  33. package/docs/lessons/0003-create-task-without-callback.md +28 -0
  34. package/docs/lessons/0004-hardcoded-test-counts.md +28 -0
  35. package/docs/lessons/0005-sqlite-without-closing.md +33 -0
  36. package/docs/lessons/0006-venv-pip-path.md +27 -0
  37. package/docs/lessons/0007-runner-state-self-rejection.md +35 -0
  38. package/docs/lessons/0008-quality-gate-blind-spot.md +33 -0
  39. package/docs/lessons/0009-parser-overcount-empty-batches.md +36 -0
  40. package/docs/lessons/0010-local-outside-function-bash.md +33 -0
  41. package/docs/lessons/0011-batch-tests-for-unimplemented-code.md +36 -0
  42. package/docs/lessons/0012-api-markdown-unescaped-chars.md +33 -0
  43. package/docs/lessons/0013-export-prefix-env-parsing.md +33 -0
  44. package/docs/lessons/0014-decorator-registry-import-side-effect.md +43 -0
  45. package/docs/lessons/0015-frontend-backend-schema-drift.md +43 -0
  46. package/docs/lessons/0016-event-driven-cold-start-seeding.md +44 -0
  47. package/docs/lessons/0017-copy-paste-logic-diverges.md +43 -0
  48. package/docs/lessons/0018-layer-passes-pipeline-broken.md +45 -0
  49. package/docs/lessons/0019-systemd-envfile-ignores-export.md +41 -0
  50. package/docs/lessons/0020-persist-state-incrementally.md +44 -0
  51. package/docs/lessons/0021-dual-axis-testing.md +48 -0
  52. package/docs/lessons/0022-jsx-factory-shadowing.md +43 -0
  53. package/docs/lessons/0023-static-analysis-spiral.md +51 -0
  54. package/docs/lessons/0024-shared-pipeline-implementation.md +55 -0
  55. package/docs/lessons/0025-defense-in-depth-all-entry-points.md +65 -0
  56. package/docs/lessons/0026-linter-no-rules-false-enforcement.md +54 -0
  57. package/docs/lessons/0027-jsx-silent-prop-drop.md +64 -0
  58. package/docs/lessons/0028-no-infrastructure-in-client-code.md +49 -0
  59. package/docs/lessons/0029-never-write-secrets-to-files.md +61 -0
  60. package/docs/lessons/0030-cache-merge-not-replace.md +62 -0
  61. package/docs/lessons/0031-verify-units-at-boundaries.md +66 -0
  62. package/docs/lessons/0032-module-lifecycle-subscribe-unsubscribe.md +89 -0
  63. package/docs/lessons/0033-async-iteration-mutable-snapshot.md +72 -0
  64. package/docs/lessons/0034-caller-missing-await-silent-discard.md +65 -0
  65. package/docs/lessons/0035-duplicate-registration-silent-overwrite.md +85 -0
  66. package/docs/lessons/0036-websocket-dirty-disconnect.md +33 -0
  67. package/docs/lessons/0037-parallel-agents-worktree-corruption.md +31 -0
  68. package/docs/lessons/0038-subscribe-no-stored-ref.md +36 -0
  69. package/docs/lessons/0039-fallback-or-default-hides-bugs.md +34 -0
  70. package/docs/lessons/0040-event-firehose-filter-first.md +36 -0
  71. package/docs/lessons/0041-ambiguous-base-dir-path-nesting.md +32 -0
  72. package/docs/lessons/0042-spec-compliance-insufficient.md +36 -0
  73. package/docs/lessons/0043-exact-count-extensible-collections.md +32 -0
  74. package/docs/lessons/0044-relative-file-deps-worktree.md +39 -0
  75. package/docs/lessons/0045-iterative-design-improvement.md +33 -0
  76. package/docs/lessons/0046-plan-assertion-math-bugs.md +38 -0
  77. package/docs/lessons/0047-pytest-single-threaded-default.md +37 -0
  78. package/docs/lessons/0048-integration-wiring-batch.md +40 -0
  79. package/docs/lessons/0049-ab-verification.md +41 -0
  80. package/docs/lessons/0050-editing-sourced-files-during-execution.md +33 -0
  81. package/docs/lessons/0051-infrastructure-fixes-cant-self-heal.md +30 -0
  82. package/docs/lessons/0052-uncommitted-changes-poison-quality-gates.md +31 -0
  83. package/docs/lessons/0053-jq-compact-flag-inconsistency.md +31 -0
  84. package/docs/lessons/0054-parser-matches-inside-code-blocks.md +30 -0
  85. package/docs/lessons/0055-agents-compensate-for-garbled-prompts.md +31 -0
  86. package/docs/lessons/0056-grep-count-exit-code-on-zero.md +42 -0
  87. package/docs/lessons/0057-new-artifacts-break-git-clean-gates.md +42 -0
  88. package/docs/lessons/0058-dead-config-keys-never-consumed.md +49 -0
  89. package/docs/lessons/0059-contract-test-shared-structures.md +53 -0
  90. package/docs/lessons/0060-set-e-silent-death-in-runners.md +53 -0
  91. package/docs/lessons/0061-context-injection-dirty-state.md +50 -0
  92. package/docs/lessons/0062-sibling-bug-neighborhood-scan.md +29 -0
  93. package/docs/lessons/0063-one-flag-two-lifetimes.md +31 -0
  94. package/docs/lessons/0064-test-passes-wrong-reason.md +31 -0
  95. package/docs/lessons/0065-pipefail-grep-count-double-output.md +39 -0
  96. package/docs/lessons/0066-local-keyword-outside-function.md +37 -0
  97. package/docs/lessons/0067-stdin-hang-non-interactive-shell.md +36 -0
  98. package/docs/lessons/0068-agent-builds-wrong-thing-correctly.md +31 -0
  99. package/docs/lessons/0069-plan-quality-dominates-execution.md +30 -0
  100. package/docs/lessons/0070-spec-echo-back-prevents-drift.md +31 -0
  101. package/docs/lessons/0071-positive-instructions-outperform-negative.md +30 -0
  102. package/docs/lessons/0072-lost-in-the-middle-context-placement.md +30 -0
  103. package/docs/lessons/0073-unscoped-lessons-cause-false-positives.md +30 -0
  104. package/docs/lessons/0074-stale-context-injection-wrong-batch.md +32 -0
  105. package/docs/lessons/0075-research-artifacts-must-persist.md +32 -0
  106. package/docs/lessons/0076-wrong-decomposition-contaminates-downstream.md +30 -0
  107. package/docs/lessons/0077-cherry-pick-merges-need-manual-resolution.md +30 -0
  108. package/docs/lessons/0078-static-review-without-live-test.md +30 -0
  109. package/docs/lessons/0079-integration-wiring-batch-required.md +32 -0
  110. package/docs/lessons/FRAMEWORK.md +161 -0
  111. package/docs/lessons/SUMMARY.md +201 -0
  112. package/docs/lessons/TEMPLATE.md +85 -0
  113. package/docs/plans/2026-02-21-code-factory-v2-design.md +204 -0
  114. package/docs/plans/2026-02-21-code-factory-v2-implementation-plan.md +2189 -0
  115. package/docs/plans/2026-02-21-code-factory-v2-phase4-design.md +537 -0
  116. package/docs/plans/2026-02-21-code-factory-v2-phase4-implementation-plan.md +2012 -0
  117. package/docs/plans/2026-02-21-hardening-pass-design.md +108 -0
  118. package/docs/plans/2026-02-21-hardening-pass-plan.md +1378 -0
  119. package/docs/plans/2026-02-21-mab-research-report.md +406 -0
  120. package/docs/plans/2026-02-21-marketplace-restructure-design.md +240 -0
  121. package/docs/plans/2026-02-21-marketplace-restructure-plan.md +832 -0
  122. package/docs/plans/2026-02-21-phase4-completion-plan.md +697 -0
  123. package/docs/plans/2026-02-21-validator-suite-design.md +148 -0
  124. package/docs/plans/2026-02-21-validator-suite-plan.md +540 -0
  125. package/docs/plans/2026-02-22-mab-research-round2.md +556 -0
  126. package/docs/plans/2026-02-22-mab-run-design.md +462 -0
  127. package/docs/plans/2026-02-22-mab-run-plan.md +2046 -0
  128. package/docs/plans/2026-02-22-operations-design-methodology-research.md +681 -0
  129. package/docs/plans/2026-02-22-research-agent-failure-taxonomy.md +532 -0
  130. package/docs/plans/2026-02-22-research-code-guideline-policies.md +886 -0
  131. package/docs/plans/2026-02-22-research-codebase-audit-refactoring.md +908 -0
  132. package/docs/plans/2026-02-22-research-coding-standards-documentation.md +541 -0
  133. package/docs/plans/2026-02-22-research-competitive-landscape.md +687 -0
  134. package/docs/plans/2026-02-22-research-comprehensive-testing.md +1076 -0
  135. package/docs/plans/2026-02-22-research-context-utilization.md +459 -0
  136. package/docs/plans/2026-02-22-research-cost-quality-tradeoff.md +548 -0
  137. package/docs/plans/2026-02-22-research-lesson-transferability.md +508 -0
  138. package/docs/plans/2026-02-22-research-multi-agent-coordination.md +312 -0
  139. package/docs/plans/2026-02-22-research-phase-integration.md +602 -0
  140. package/docs/plans/2026-02-22-research-plan-quality.md +428 -0
  141. package/docs/plans/2026-02-22-research-prompt-engineering.md +558 -0
  142. package/docs/plans/2026-02-22-research-unconventional-perspectives.md +528 -0
  143. package/docs/plans/2026-02-22-research-user-adoption.md +638 -0
  144. package/docs/plans/2026-02-22-research-verification-effectiveness.md +433 -0
  145. package/docs/plans/2026-02-23-agent-suite-design.md +299 -0
  146. package/docs/plans/2026-02-23-agent-suite-plan.md +578 -0
  147. package/docs/plans/2026-02-23-phase3-cost-infrastructure-design.md +148 -0
  148. package/docs/plans/2026-02-23-phase3-cost-infrastructure-plan.md +1062 -0
  149. package/docs/plans/2026-02-23-research-bash-expert-agent.md +543 -0
  150. package/docs/plans/2026-02-23-research-dependency-auditor-agent.md +564 -0
  151. package/docs/plans/2026-02-23-research-improving-existing-agents.md +503 -0
  152. package/docs/plans/2026-02-23-research-integration-tester-agent.md +454 -0
  153. package/docs/plans/2026-02-23-research-python-expert-agent.md +429 -0
  154. package/docs/plans/2026-02-23-research-service-monitor-agent.md +425 -0
  155. package/docs/plans/2026-02-23-research-shell-expert-agent.md +533 -0
  156. package/docs/plans/2026-02-23-roadmap-to-completion.md +530 -0
  157. package/docs/plans/2026-02-24-headless-module-split-design.md +98 -0
  158. package/docs/plans/2026-02-24-headless-module-split.md +443 -0
  159. package/docs/plans/2026-02-24-lesson-scope-metadata-design.md +228 -0
  160. package/docs/plans/2026-02-24-lesson-scope-metadata-plan.md +968 -0
  161. package/docs/plans/2026-02-24-npm-packaging-design.md +841 -0
  162. package/docs/plans/2026-02-24-npm-packaging-plan.md +1965 -0
  163. package/docs/plans/audit-findings.md +186 -0
  164. package/docs/telegram-notification-format.md +98 -0
  165. package/examples/example-plan.md +51 -0
  166. package/examples/example-prd.json +72 -0
  167. package/examples/example-roadmap.md +33 -0
  168. package/examples/quickstart-plan.md +63 -0
  169. package/hooks/hooks.json +26 -0
  170. package/hooks/setup-symlinks.sh +48 -0
  171. package/hooks/stop-hook.sh +135 -0
  172. package/package.json +47 -0
  173. package/policies/bash.md +71 -0
  174. package/policies/python.md +71 -0
  175. package/policies/testing.md +61 -0
  176. package/policies/universal.md +60 -0
  177. package/scripts/analyze-report.sh +97 -0
  178. package/scripts/architecture-map.sh +145 -0
  179. package/scripts/auto-compound.sh +273 -0
  180. package/scripts/batch-audit.sh +42 -0
  181. package/scripts/batch-test.sh +101 -0
  182. package/scripts/entropy-audit.sh +221 -0
  183. package/scripts/failure-digest.sh +51 -0
  184. package/scripts/generate-ast-rules.sh +96 -0
  185. package/scripts/init.sh +112 -0
  186. package/scripts/lesson-check.sh +428 -0
  187. package/scripts/lib/common.sh +61 -0
  188. package/scripts/lib/cost-tracking.sh +153 -0
  189. package/scripts/lib/ollama.sh +60 -0
  190. package/scripts/lib/progress-writer.sh +128 -0
  191. package/scripts/lib/run-plan-context.sh +215 -0
  192. package/scripts/lib/run-plan-echo-back.sh +231 -0
  193. package/scripts/lib/run-plan-headless.sh +396 -0
  194. package/scripts/lib/run-plan-notify.sh +57 -0
  195. package/scripts/lib/run-plan-parser.sh +81 -0
  196. package/scripts/lib/run-plan-prompt.sh +215 -0
  197. package/scripts/lib/run-plan-quality-gate.sh +132 -0
  198. package/scripts/lib/run-plan-routing.sh +315 -0
  199. package/scripts/lib/run-plan-sampling.sh +170 -0
  200. package/scripts/lib/run-plan-scoring.sh +146 -0
  201. package/scripts/lib/run-plan-state.sh +142 -0
  202. package/scripts/lib/run-plan-team.sh +199 -0
  203. package/scripts/lib/telegram.sh +54 -0
  204. package/scripts/lib/thompson-sampling.sh +176 -0
  205. package/scripts/license-check.sh +74 -0
  206. package/scripts/mab-run.sh +575 -0
  207. package/scripts/module-size-check.sh +146 -0
  208. package/scripts/patterns/async-no-await.yml +5 -0
  209. package/scripts/patterns/bare-except.yml +6 -0
  210. package/scripts/patterns/empty-catch.yml +6 -0
  211. package/scripts/patterns/hardcoded-localhost.yml +9 -0
  212. package/scripts/patterns/retry-loop-no-backoff.yml +12 -0
  213. package/scripts/pipeline-status.sh +197 -0
  214. package/scripts/policy-check.sh +226 -0
  215. package/scripts/prior-art-search.sh +133 -0
  216. package/scripts/promote-mab-lessons.sh +126 -0
  217. package/scripts/prompts/agent-a-superpowers.md +29 -0
  218. package/scripts/prompts/agent-b-ralph.md +29 -0
  219. package/scripts/prompts/judge-agent.md +61 -0
  220. package/scripts/prompts/planner-agent.md +44 -0
  221. package/scripts/pull-community-lessons.sh +90 -0
  222. package/scripts/quality-gate.sh +266 -0
  223. package/scripts/research-gate.sh +90 -0
  224. package/scripts/run-plan.sh +329 -0
  225. package/scripts/scope-infer.sh +159 -0
  226. package/scripts/setup-ralph-loop.sh +155 -0
  227. package/scripts/telemetry.sh +230 -0
  228. package/scripts/tests/run-all-tests.sh +52 -0
  229. package/scripts/tests/test-act-cli.sh +46 -0
  230. package/scripts/tests/test-agents-md.sh +87 -0
  231. package/scripts/tests/test-analyze-report.sh +114 -0
  232. package/scripts/tests/test-architecture-map.sh +89 -0
  233. package/scripts/tests/test-auto-compound.sh +169 -0
  234. package/scripts/tests/test-batch-test.sh +65 -0
  235. package/scripts/tests/test-benchmark-runner.sh +25 -0
  236. package/scripts/tests/test-common.sh +168 -0
  237. package/scripts/tests/test-cost-tracking.sh +158 -0
  238. package/scripts/tests/test-echo-back.sh +180 -0
  239. package/scripts/tests/test-entropy-audit.sh +146 -0
  240. package/scripts/tests/test-failure-digest.sh +66 -0
  241. package/scripts/tests/test-generate-ast-rules.sh +145 -0
  242. package/scripts/tests/test-helpers.sh +82 -0
  243. package/scripts/tests/test-init.sh +47 -0
  244. package/scripts/tests/test-lesson-check.sh +278 -0
  245. package/scripts/tests/test-lesson-local.sh +55 -0
  246. package/scripts/tests/test-license-check.sh +109 -0
  247. package/scripts/tests/test-mab-run.sh +182 -0
  248. package/scripts/tests/test-ollama-lib.sh +49 -0
  249. package/scripts/tests/test-ollama.sh +60 -0
  250. package/scripts/tests/test-pipeline-status.sh +198 -0
  251. package/scripts/tests/test-policy-check.sh +124 -0
  252. package/scripts/tests/test-prior-art-search.sh +96 -0
  253. package/scripts/tests/test-progress-writer.sh +140 -0
  254. package/scripts/tests/test-promote-mab-lessons.sh +110 -0
  255. package/scripts/tests/test-pull-community-lessons.sh +149 -0
  256. package/scripts/tests/test-quality-gate.sh +241 -0
  257. package/scripts/tests/test-research-gate.sh +132 -0
  258. package/scripts/tests/test-run-plan-cli.sh +86 -0
  259. package/scripts/tests/test-run-plan-context.sh +305 -0
  260. package/scripts/tests/test-run-plan-e2e.sh +153 -0
  261. package/scripts/tests/test-run-plan-headless.sh +424 -0
  262. package/scripts/tests/test-run-plan-notify.sh +124 -0
  263. package/scripts/tests/test-run-plan-parser.sh +217 -0
  264. package/scripts/tests/test-run-plan-prompt.sh +254 -0
  265. package/scripts/tests/test-run-plan-quality-gate.sh +222 -0
  266. package/scripts/tests/test-run-plan-routing.sh +178 -0
  267. package/scripts/tests/test-run-plan-scoring.sh +148 -0
  268. package/scripts/tests/test-run-plan-state.sh +261 -0
  269. package/scripts/tests/test-run-plan-team.sh +157 -0
  270. package/scripts/tests/test-scope-infer.sh +150 -0
  271. package/scripts/tests/test-setup-ralph-loop.sh +63 -0
  272. package/scripts/tests/test-telegram-env.sh +38 -0
  273. package/scripts/tests/test-telegram.sh +121 -0
  274. package/scripts/tests/test-telemetry.sh +46 -0
  275. package/scripts/tests/test-thompson-sampling.sh +139 -0
  276. package/scripts/tests/test-validate-all.sh +60 -0
  277. package/scripts/tests/test-validate-commands.sh +89 -0
  278. package/scripts/tests/test-validate-hooks.sh +98 -0
  279. package/scripts/tests/test-validate-lessons.sh +150 -0
  280. package/scripts/tests/test-validate-plan-quality.sh +235 -0
  281. package/scripts/tests/test-validate-plans.sh +187 -0
  282. package/scripts/tests/test-validate-plugin.sh +106 -0
  283. package/scripts/tests/test-validate-prd.sh +184 -0
  284. package/scripts/tests/test-validate-skills.sh +134 -0
  285. package/scripts/validate-all.sh +57 -0
  286. package/scripts/validate-commands.sh +67 -0
  287. package/scripts/validate-hooks.sh +89 -0
  288. package/scripts/validate-lessons.sh +98 -0
  289. package/scripts/validate-plan-quality.sh +369 -0
  290. package/scripts/validate-plans.sh +120 -0
  291. package/scripts/validate-plugin.sh +86 -0
  292. package/scripts/validate-policies.sh +42 -0
  293. package/scripts/validate-prd.sh +118 -0
  294. package/scripts/validate-skills.sh +96 -0
  295. package/skills/autocode/SKILL.md +285 -0
  296. package/skills/autocode/ab-verification.md +51 -0
  297. package/skills/autocode/code-quality-standards.md +37 -0
  298. package/skills/autocode/competitive-mode.md +364 -0
  299. package/skills/brainstorming/SKILL.md +97 -0
  300. package/skills/capture-lesson/SKILL.md +187 -0
  301. package/skills/check-lessons/SKILL.md +116 -0
  302. package/skills/dispatching-parallel-agents/SKILL.md +110 -0
  303. package/skills/executing-plans/SKILL.md +85 -0
  304. package/skills/finishing-a-development-branch/SKILL.md +201 -0
  305. package/skills/receiving-code-review/SKILL.md +72 -0
  306. package/skills/requesting-code-review/SKILL.md +59 -0
  307. package/skills/requesting-code-review/code-reviewer.md +82 -0
  308. package/skills/research/SKILL.md +145 -0
  309. package/skills/roadmap/SKILL.md +115 -0
  310. package/skills/subagent-driven-development/SKILL.md +98 -0
  311. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +18 -0
  312. package/skills/subagent-driven-development/implementer-prompt.md +73 -0
  313. package/skills/subagent-driven-development/spec-reviewer-prompt.md +57 -0
  314. package/skills/systematic-debugging/SKILL.md +134 -0
  315. package/skills/systematic-debugging/condition-based-waiting.md +64 -0
  316. package/skills/systematic-debugging/defense-in-depth.md +32 -0
  317. package/skills/systematic-debugging/root-cause-tracing.md +55 -0
  318. package/skills/test-driven-development/SKILL.md +167 -0
  319. package/skills/using-git-worktrees/SKILL.md +219 -0
  320. package/skills/using-superpowers/SKILL.md +54 -0
  321. package/skills/verification-before-completion/SKILL.md +140 -0
  322. package/skills/verify/SKILL.md +82 -0
  323. package/skills/writing-plans/SKILL.md +128 -0
  324. package/skills/writing-skills/SKILL.md +93 -0
@@ -0,0 +1,832 @@
1
+ # Marketplace Restructure Implementation Plan
2
+
3
+ > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
4
+
5
+ **Goal:** Restructure the repo as a marketplace-ready Claude Code plugin with a dynamic community lesson system.
6
+
7
+ **Architecture:** Merge ralph-loop into top level, move commands to top level, add plugin/marketplace manifests, rewrite lesson-check.sh and lesson-scanner to read lesson files dynamically, create starter lesson files from hardcoded checks, add /submit-lesson command and CONTRIBUTING.md.
8
+
9
+ **Tech Stack:** Bash, Markdown (YAML frontmatter), jq, grep, awk
10
+
11
+ ---
12
+
13
+ ## Batch 1: Plugin Manifests & Directory Restructure
14
+
15
+ ### Task 1: Create plugin.json manifest
16
+
17
+ **Files:**
18
+ - Create: `.claude-plugin/plugin.json`
19
+
20
+ **Step 1: Create the file**
21
+
22
+ ```json
23
+ {
24
+ "name": "autonomous-coding-toolkit",
25
+ "description": "Complete autonomous coding pipeline: skills for every stage from brainstorming through verification, quality gates between batches, headless execution, and a lessons-learned feedback loop that compounds with every user",
26
+ "version": "1.0.0",
27
+ "author": {
28
+ "name": "Justin McFarland",
29
+ "email": "parthalon025@gmail.com"
30
+ },
31
+ "homepage": "https://github.com/parthalon025/autonomous-coding-toolkit",
32
+ "repository": "https://github.com/parthalon025/autonomous-coding-toolkit",
33
+ "license": "MIT",
34
+ "keywords": ["autonomous", "tdd", "quality-gates", "headless", "skills", "pipeline", "lessons-learned"]
35
+ }
36
+ ```
37
+
38
+ **Step 2: Commit**
39
+
40
+ ```bash
41
+ git add .claude-plugin/plugin.json
42
+ git commit -m "feat: add plugin.json manifest for marketplace discovery"
43
+ ```
44
+
45
+ ### Task 2: Create marketplace.json
46
+
47
+ **Files:**
48
+ - Create: `.claude-plugin/marketplace.json`
49
+
50
+ **Step 1: Create the file**
51
+
52
+ ```json
53
+ {
54
+ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
55
+ "name": "autonomous-coding-toolkit",
56
+ "description": "Autonomous coding pipeline with quality gates, fresh-context execution, and community lessons",
57
+ "owner": {
58
+ "name": "Justin McFarland",
59
+ "email": "parthalon025@gmail.com"
60
+ },
61
+ "plugins": [
62
+ {
63
+ "name": "autonomous-coding-toolkit",
64
+ "description": "Complete autonomous coding pipeline with skills, agents, scripts, and a community lesson system",
65
+ "version": "1.0.0",
66
+ "source": "./",
67
+ "author": {
68
+ "name": "Justin McFarland",
69
+ "email": "parthalon025@gmail.com"
70
+ },
71
+ "category": "development"
72
+ }
73
+ ]
74
+ }
75
+ ```
76
+
77
+ **Step 2: Commit**
78
+
79
+ ```bash
80
+ git add .claude-plugin/marketplace.json
81
+ git commit -m "feat: add marketplace.json for self-hosted marketplace distribution"
82
+ ```
83
+
84
+ ### Task 3: Move commands to top level
85
+
86
+ **Files:**
87
+ - Move: `.claude/commands/code-factory.md` → `commands/code-factory.md`
88
+ - Move: `.claude/commands/create-prd.md` → `commands/create-prd.md`
89
+ - Move: `.claude/commands/run-plan.md` → `commands/run-plan.md`
90
+ - Move: `plugins/ralph-loop/commands/ralph-loop.md` → `commands/ralph-loop.md`
91
+ - Move: `plugins/ralph-loop/commands/cancel-ralph.md` → `commands/cancel-ralph.md`
92
+ - Delete: `.claude/commands/` directory
93
+ - Delete: `plugins/ralph-loop/commands/` directory
94
+
95
+ **Step 1: Create top-level commands/ and move files**
96
+
97
+ ```bash
98
+ mkdir -p commands
99
+ mv .claude/commands/code-factory.md commands/
100
+ mv .claude/commands/create-prd.md commands/
101
+ mv .claude/commands/run-plan.md commands/
102
+ mv plugins/ralph-loop/commands/ralph-loop.md commands/
103
+ mv plugins/ralph-loop/commands/cancel-ralph.md commands/
104
+ rmdir .claude/commands
105
+ rmdir plugins/ralph-loop/commands
106
+ ```
107
+
108
+ **Step 2: Update ralph-loop.md — change CLAUDE_PLUGIN_ROOT script path**
109
+
110
+ In `commands/ralph-loop.md`, the setup script path references `${CLAUDE_PLUGIN_ROOT}/scripts/setup-ralph-loop.sh`. After merge, the setup script will be at `scripts/setup-ralph-loop.sh` (same relative position from plugin root), so the path remains valid.
111
+
112
+ Verify `allowed-tools` in frontmatter still references the correct path pattern.
113
+
114
+ **Step 3: Commit**
115
+
116
+ ```bash
117
+ git add commands/ .claude/commands/ plugins/ralph-loop/commands/
118
+ git commit -m "refactor: move commands to top-level for marketplace discovery"
119
+ ```
120
+
121
+ ### Task 4: Move ralph-loop hooks and scripts to top level
122
+
123
+ **Files:**
124
+ - Move: `plugins/ralph-loop/hooks/hooks.json` → `hooks/hooks.json`
125
+ - Move: `plugins/ralph-loop/hooks/stop-hook.sh` → `hooks/stop-hook.sh`
126
+ - Move: `plugins/ralph-loop/scripts/setup-ralph-loop.sh` → `scripts/setup-ralph-loop.sh`
127
+ - Delete: `plugins/ralph-loop/.claude-plugin/plugin.json`
128
+ - Delete: `plugins/` directory entirely
129
+
130
+ **Step 1: Move hooks**
131
+
132
+ ```bash
133
+ mkdir -p hooks
134
+ mv plugins/ralph-loop/hooks/hooks.json hooks/
135
+ mv plugins/ralph-loop/hooks/stop-hook.sh hooks/
136
+ ```
137
+
138
+ **Step 2: Move setup script**
139
+
140
+ ```bash
141
+ mv plugins/ralph-loop/scripts/setup-ralph-loop.sh scripts/
142
+ ```
143
+
144
+ **Step 3: Clean up plugins directory**
145
+
146
+ ```bash
147
+ rm plugins/ralph-loop/.claude-plugin/plugin.json
148
+ rmdir plugins/ralph-loop/.claude-plugin
149
+ rmdir plugins/ralph-loop/scripts
150
+ rmdir plugins/ralph-loop/hooks
151
+ rmdir plugins/ralph-loop
152
+ rmdir plugins
153
+ ```
154
+
155
+ **Step 4: Commit**
156
+
157
+ ```bash
158
+ git add hooks/ scripts/setup-ralph-loop.sh plugins/
159
+ git commit -m "refactor: merge ralph-loop hooks and scripts into top level"
160
+ ```
161
+
162
+ ## Batch 2: Starter Lesson Files
163
+
164
+ ### Task 5: Create starter lesson — bare exception swallowing
165
+
166
+ **Files:**
167
+ - Create: `docs/lessons/0001-bare-exception-swallowing.md`
168
+
169
+ **Step 1: Write lesson file with structured YAML frontmatter**
170
+
171
+ ```yaml
172
+ ---
173
+ id: 1
174
+ title: "Bare exception swallowing hides failures"
175
+ severity: blocker
176
+ languages: [python]
177
+ category: silent-failures
178
+ pattern:
179
+ type: syntactic
180
+ regex: "^\\s*except\\s*:"
181
+ description: "bare except clause without logging"
182
+ fix: "Always log the exception before returning a fallback: except Exception as e: logger.error(..., exc_info=True)"
183
+ example:
184
+ bad: |
185
+ try:
186
+ result = api_call()
187
+ except:
188
+ return default_value
189
+ good: |
190
+ try:
191
+ result = api_call()
192
+ except Exception as e:
193
+ logger.error("API call failed", exc_info=True)
194
+ return default_value
195
+ ---
196
+
197
+ ## Observation
198
+ Bare `except:` clauses silently swallow all exceptions including KeyboardInterrupt, SystemExit, and MemoryError. When the fallback value is returned, there's no log trail to indicate a failure occurred, making debugging impossible.
199
+
200
+ ## Insight
201
+ The root cause is a habit of writing "safe" exception handling that catches everything. The Python exception hierarchy means `except:` catches far more than intended. Combined with no logging, failures become invisible.
202
+
203
+ ## Lesson
204
+ Never use bare `except:` — always catch a specific exception class and log before returning a fallback. The 3-line rule: within 3 lines of an except clause, there must be a logging call.
205
+ ```
206
+
207
+ **Step 2: Commit**
208
+
209
+ ```bash
210
+ git add docs/lessons/0001-bare-exception-swallowing.md
211
+ git commit -m "feat: add starter lesson 0001 — bare exception swallowing"
212
+ ```
213
+
214
+ ### Task 6: Create starter lesson — async def without await
215
+
216
+ **Files:**
217
+ - Create: `docs/lessons/0002-async-def-without-await.md`
218
+
219
+ **Step 1: Write lesson file**
220
+
221
+ ```yaml
222
+ ---
223
+ id: 2
224
+ title: "async def without await returns truthy coroutine"
225
+ severity: blocker
226
+ languages: [python]
227
+ category: async-traps
228
+ pattern:
229
+ type: syntactic
230
+ regex: "async\\s+def\\s+"
231
+ description: "async def that may be missing await — requires multi-line analysis to confirm no await in function body"
232
+ multi_line: true
233
+ fix: "Either add await for async I/O operations, or remove the async keyword if the function does no async work"
234
+ example:
235
+ bad: |
236
+ async def get_data():
237
+ return database.query("SELECT *") # Returns coroutine, not result
238
+ good: |
239
+ async def get_data():
240
+ return await database.query("SELECT *")
241
+ ---
242
+
243
+ ## Observation
244
+ An `async def` function that never uses `await`, `async for`, or `async with` returns a coroutine object instead of its result. Since coroutine objects are truthy, code like `if await get_data():` silently succeeds with a truthy coroutine even when the actual data would be falsy.
245
+
246
+ ## Insight
247
+ This is insidious because the function appears to work — it returns something truthy, no exceptions are raised, no warnings are logged. The bug only surfaces when the return value is used for its actual content rather than truthiness.
248
+
249
+ ## Lesson
250
+ Every `async def` must contain at least one `await`, `async for`, or `async with`. If it doesn't need any, remove the `async` keyword. This check requires multi-line analysis (scanning the full function body), so it's a semantic check in the lesson-scanner rather than a simple grep.
251
+ ```
252
+
253
+ **Step 2: Commit**
254
+
255
+ ```bash
256
+ git add docs/lessons/0002-async-def-without-await.md
257
+ git commit -m "feat: add starter lesson 0002 — async def without await"
258
+ ```
259
+
260
+ ### Task 7: Create starter lesson — create_task without callback
261
+
262
+ **Files:**
263
+ - Create: `docs/lessons/0003-create-task-without-callback.md`
264
+
265
+ **Step 1: Write lesson file**
266
+
267
+ ```yaml
268
+ ---
269
+ id: 3
270
+ title: "asyncio.create_task without done_callback swallows exceptions"
271
+ severity: should-fix
272
+ languages: [python]
273
+ category: silent-failures
274
+ pattern:
275
+ type: syntactic
276
+ regex: "create_task\\("
277
+ description: "create_task() without add_done_callback within 5 lines — untracked task may swallow exceptions"
278
+ multi_line: true
279
+ fix: "Add a done_callback that logs exceptions: task.add_done_callback(lambda t: t.exception() and logger.error(...))"
280
+ example:
281
+ bad: |
282
+ task = asyncio.create_task(process_event(data))
283
+ # No callback — if process_event raises, you'll never know
284
+ good: |
285
+ task = asyncio.create_task(process_event(data))
286
+ task.add_done_callback(lambda t: t.exception() and logger.error("Task failed", exc_info=t.exception()))
287
+ ---
288
+
289
+ ## Observation
290
+ `asyncio.create_task()` launches a coroutine as a background task. If the task raises an exception and nobody awaits it or checks its result, Python logs a "Task exception was never retrieved" warning at garbage collection time — which may be much later or not at all.
291
+
292
+ ## Insight
293
+ Fire-and-forget tasks are a common pattern but they create invisible failure paths. The exception is silently stored in the task object and only surfaces (maybe) when the task is garbage collected.
294
+
295
+ ## Lesson
296
+ Every `create_task()` call should be followed within 5 lines by `add_done_callback()` that handles exceptions. Alternatively, store the task and await it later.
297
+ ```
298
+
299
+ **Step 2: Commit**
300
+
301
+ ```bash
302
+ git add docs/lessons/0003-create-task-without-callback.md
303
+ git commit -m "feat: add starter lesson 0003 — create_task without callback"
304
+ ```
305
+
306
+ ### Task 8: Create starter lesson — hardcoded test counts
307
+
308
+ **Files:**
309
+ - Create: `docs/lessons/0004-hardcoded-test-counts.md`
310
+
311
+ **Step 1: Write lesson file**
312
+
313
+ ```yaml
314
+ ---
315
+ id: 4
316
+ title: "Hardcoded count assertions break when datasets grow"
317
+ severity: should-fix
318
+ languages: [python, javascript, typescript]
319
+ category: test-anti-patterns
320
+ pattern:
321
+ type: syntactic
322
+ regex: "assert.*==\\s*\\d+|expect\\(.*\\)\\.toBe\\(\\d+\\)|assert_equal.*\\d+"
323
+ description: "test assertion comparing count to a hardcoded number"
324
+ fix: "Use >= for extensible collections, or assert against a computed expected value rather than a magic number"
325
+ example:
326
+ bad: |
327
+ assert len(collectors) == 15 # Breaks when a 16th collector is added
328
+ good: |
329
+ assert len(collectors) >= 15 # Passes as collection grows
330
+ # Or better: assert expected_collector in collectors
331
+ ---
332
+
333
+ ## Observation
334
+ Tests that assert exact counts (e.g., `assert len(items) == 15`) break every time a new item is added to an extensible collection. This creates friction where adding a feature requires updating unrelated test files.
335
+
336
+ ## Insight
337
+ Exact count assertions conflate "the collection is not empty and has the expected items" with "the collection has exactly N items." The former is what you usually want to test; the latter creates brittle coupling.
338
+
339
+ ## Lesson
340
+ For extensible collections, use `>=` assertions or check for specific members. Reserve exact count assertions for fixed-size structures where the count is genuinely part of the contract.
341
+ ```
342
+
343
+ **Step 2: Commit**
344
+
345
+ ```bash
346
+ git add docs/lessons/0004-hardcoded-test-counts.md
347
+ git commit -m "feat: add starter lesson 0004 — hardcoded test counts"
348
+ ```
349
+
350
+ ### Task 9: Create starter lesson — sqlite without closing
351
+
352
+ **Files:**
353
+ - Create: `docs/lessons/0005-sqlite-without-closing.md`
354
+
355
+ **Step 1: Write lesson file**
356
+
357
+ ```yaml
358
+ ---
359
+ id: 5
360
+ title: "sqlite3 connections leak without closing() context manager"
361
+ severity: should-fix
362
+ languages: [python]
363
+ category: silent-failures
364
+ pattern:
365
+ type: syntactic
366
+ regex: "sqlite3\\.connect\\("
367
+ description: "sqlite3.connect() call — verify closing() context manager is used (with conn: manages transactions, not connections)"
368
+ fix: "Use contextlib.closing(): with closing(sqlite3.connect(db_path)) as conn:"
369
+ example:
370
+ bad: |
371
+ conn = sqlite3.connect("data.db")
372
+ with conn:
373
+ conn.execute("INSERT ...")
374
+ # Connection never explicitly closed — relies on GC
375
+ good: |
376
+ from contextlib import closing
377
+ with closing(sqlite3.connect("data.db")) as conn:
378
+ with conn:
379
+ conn.execute("INSERT ...")
380
+ ---
381
+
382
+ ## Observation
383
+ `with conn:` in sqlite3 manages transactions (auto-commit/rollback), NOT the connection lifecycle. The connection remains open until garbage collected. Under load or in long-running processes, this leaks file descriptors.
384
+
385
+ ## Insight
386
+ Python's sqlite3 `with` statement is misleading — it looks like a resource manager but only manages transactions. The actual connection close requires either `conn.close()` or `contextlib.closing()`.
387
+
388
+ ## Lesson
389
+ Always wrap `sqlite3.connect()` in `contextlib.closing()` for reliable cleanup. The pattern is: `with closing(connect(...)) as conn: with conn: ...` — outer for lifecycle, inner for transactions.
390
+ ```
391
+
392
+ **Step 2: Commit**
393
+
394
+ ```bash
395
+ git add docs/lessons/0005-sqlite-without-closing.md
396
+ git commit -m "feat: add starter lesson 0005 — sqlite without closing"
397
+ ```
398
+
399
+ ### Task 10: Create starter lesson — venv pip path
400
+
401
+ **Files:**
402
+ - Create: `docs/lessons/0006-venv-pip-path.md`
403
+
404
+ **Step 1: Write lesson file**
405
+
406
+ ```yaml
407
+ ---
408
+ id: 6
409
+ title: ".venv/bin/pip installs to wrong site-packages"
410
+ severity: should-fix
411
+ languages: [python, shell]
412
+ category: integration-boundaries
413
+ pattern:
414
+ type: syntactic
415
+ regex: "\\.venv/bin/pip\\b"
416
+ description: ".venv/bin/pip instead of .venv/bin/python -m pip — pip shebang may point to wrong Python"
417
+ fix: "Use .venv/bin/python -m pip to ensure packages install into the correct virtual environment"
418
+ example:
419
+ bad: |
420
+ .venv/bin/pip install requests
421
+ good: |
422
+ .venv/bin/python -m pip install requests
423
+ ---
424
+
425
+ ## Observation
426
+ When multiple Python versions exist on the system (e.g., system Python + Homebrew Python), `.venv/bin/pip` may resolve to the wrong Python interpreter via its shebang line. Packages install into the wrong site-packages directory, making them invisible to the venv's Python.
427
+
428
+ ## Insight
429
+ The pip executable's shebang (`#!/path/to/python`) is set at venv creation time. If PATH changes or another Python is installed later, the shebang becomes stale. Using `python -m pip` always uses the Python that's running it.
430
+
431
+ ## Lesson
432
+ Never call `.venv/bin/pip` directly. Always use `.venv/bin/python -m pip` to guarantee the correct interpreter and site-packages directory.
433
+ ```
434
+
435
+ **Step 2: Commit**
436
+
437
+ ```bash
438
+ git add docs/lessons/0006-venv-pip-path.md
439
+ git commit -m "feat: add starter lesson 0006 — venv pip path"
440
+ ```
441
+
442
+ ## Batch 3: Dynamic Lesson System
443
+
444
+ ### Task 11: Rewrite lesson-check.sh to read lesson files dynamically
445
+
446
+ **Files:**
447
+ - Modify: `scripts/lesson-check.sh`
448
+
449
+ **Step 1: Rewrite the script**
450
+
451
+ Replace the entire script with a dynamic version that:
452
+
453
+ 1. Finds all lesson files in `docs/lessons/` matching `[0-9]*.md`
454
+ 2. Parses YAML frontmatter to extract `pattern.type`, `pattern.regex`, `severity`, `title`, `id`, `languages`
455
+ 3. For each lesson with `pattern.type: syntactic` and a non-empty `regex`:
456
+ - Filter target files by language (`.py` for python, `.js`/`.ts` for javascript/typescript, all files for `shell`/`all`)
457
+ - Run `grep -Pn "$regex"` against matching files
458
+ - Report violations in `file:line: [lesson-N] title` format
459
+ 4. Preserve: file gathering logic (args, stdin, git diff fallback), help text, exit codes
460
+ 5. Remove: all 6 hardcoded checks (they're now in lesson files)
461
+ 6. Handle `multi_line: true` lessons by noting them as "requires lesson-scanner" in help text
462
+
463
+ The script should find lessons relative to its own location (`SCRIPT_DIR`), not the current working directory, so it works when called from any project.
464
+
465
+ Key functions needed:
466
+ - `parse_frontmatter()` — extract YAML fields from a lesson file (awk-based, no external deps)
467
+ - `matches_language()` — check if a file matches a lesson's language filter
468
+ - Main loop that reads lessons and runs grep per lesson
469
+
470
+ **Step 2: Run existing tests to verify**
471
+
472
+ ```bash
473
+ bash scripts/tests/run-all-tests.sh
474
+ ```
475
+
476
+ The existing tests may need updating since checks are now dynamic. If tests reference specific lesson numbers, update them to match the new lesson file IDs.
477
+
478
+ **Step 3: Commit**
479
+
480
+ ```bash
481
+ git add scripts/lesson-check.sh
482
+ git commit -m "feat: rewrite lesson-check.sh to read patterns from lesson files dynamically"
483
+ ```
484
+
485
+ ### Task 12: Rewrite lesson-scanner agent to be dynamic
486
+
487
+ **Files:**
488
+ - Modify: `agents/lesson-scanner.md`
489
+
490
+ **Step 1: Rewrite the agent**
491
+
492
+ Replace hardcoded scan groups with dynamic lesson loading:
493
+
494
+ ```markdown
495
+ ---
496
+ name: lesson-scanner
497
+ description: Scans codebase for anti-patterns from community lessons learned. Reads lesson files dynamically — adding a lesson file adds a check. Reports violations with file:line references.
498
+ tools: Read, Grep, Glob, Bash
499
+ ---
500
+
501
+ You are a codebase auditor. Your checks come from lesson files, not hardcoded rules.
502
+
503
+ ## Input
504
+
505
+ Project root directory (default: current working directory).
506
+
507
+ ## Step 1: Load Lessons
508
+
509
+ Read all lesson files from the toolkit's `docs/lessons/` directory:
510
+ - Glob: `docs/lessons/[0-9]*.md`
511
+ - Parse YAML frontmatter from each file
512
+ - Group by category for organized scanning
513
+ - Filter by language (match target project's file types)
514
+
515
+ ## Step 2: Run Syntactic Checks
516
+
517
+ For lessons with `pattern.type: syntactic`:
518
+ - Run `grep -Pn` with the lesson's `regex` against matching files
519
+ - For `multi_line: true` lessons, use multi-line grep or awk as needed
520
+ - Record: file, line, lesson ID, title, severity
521
+
522
+ ## Step 3: Run Semantic Checks
523
+
524
+ For lessons with `pattern.type: semantic`:
525
+ - Use the lesson's `description` and `example` to guide analysis
526
+ - Read candidate files and look for the described anti-pattern in context
527
+ - Only report confirmed matches — do not hallucinate findings
528
+
529
+ ## Step 4: Report
530
+
531
+ [Same report format as before — BLOCKERS/SHOULD-FIX/NICE-TO-HAVE tables]
532
+
533
+ ## Execution Notes
534
+
535
+ - Run ALL lessons even if earlier ones find blockers
536
+ - Skip node_modules/, .venv/, dist/, build/, __pycache__/
537
+ - If no files match a lesson's language filter, skip it and note in summary
538
+ - Do not hallucinate findings. Only report what grep + read confirms.
539
+ - Report how many lesson files were loaded and how many were applicable
540
+ ```
541
+
542
+ **Step 2: Commit**
543
+
544
+ ```bash
545
+ git add agents/lesson-scanner.md
546
+ git commit -m "feat: rewrite lesson-scanner to read lessons dynamically"
547
+ ```
548
+
549
+ ### Task 13: Update lesson TEMPLATE.md to match new schema
550
+
551
+ **Files:**
552
+ - Modify: `docs/lessons/TEMPLATE.md`
553
+
554
+ **Step 1: Replace with new structured template**
555
+
556
+ Replace entire content with the structured YAML schema from the design doc. Include both the frontmatter section (id, title, severity, languages, category, pattern, fix, example) and the body sections (Observation, Insight, Lesson).
557
+
558
+ Keep it simpler than the current template — remove the PMI-heavy fields (sustain plan, ripple effects, corrective action table) that add friction for community contributors. Those belong in the FRAMEWORK.md for internal use, not in the community submission template.
559
+
560
+ **Step 2: Commit**
561
+
562
+ ```bash
563
+ git add docs/lessons/TEMPLATE.md
564
+ git commit -m "refactor: simplify lesson template to structured YAML schema for community use"
565
+ ```
566
+
567
+ ## Batch 4: Submit-Lesson Command & Contributing Guide
568
+
569
+ ### Task 14: Create /submit-lesson command
570
+
571
+ **Files:**
572
+ - Create: `commands/submit-lesson.md`
573
+
574
+ **Step 1: Write the command**
575
+
576
+ ```markdown
577
+ ---
578
+ description: "Submit a lesson learned from a bug you encountered — contributes back to the community"
579
+ argument-hint: "[description of the bug or anti-pattern]"
580
+ ---
581
+
582
+ # Submit Lesson
583
+
584
+ Help the user capture a lesson learned and generate a PR against the toolkit repo.
585
+
586
+ ## Process
587
+
588
+ 1. **Understand the bug** — Ask what happened, what the expected behavior was, and what code was involved. If $ARGUMENTS is provided, use that as the starting description.
589
+
590
+ 2. **Identify the pattern** — Determine:
591
+ - Category: async-traps, resource-lifecycle, silent-failures, integration-boundaries, test-anti-patterns, performance
592
+ - Severity: blocker (causes data loss/crashes), should-fix (causes subtle bugs), nice-to-have (code smell)
593
+ - Languages: which languages this applies to
594
+
595
+ 3. **Determine check type** — Is this pattern detectable by grep (syntactic) or does it need AI context (semantic)?
596
+ - If syntactic: generate a grep -P regex and test it against the user's code to verify it catches the pattern
597
+ - If semantic: write a clear description and example for the lesson-scanner agent
598
+
599
+ 4. **Generate the lesson file** — Use the structured YAML frontmatter schema:
600
+ - Auto-assign the next available ID (read existing lessons, find max ID, add 1)
601
+ - Generate slug from title
602
+ - Fill all frontmatter fields
603
+ - Write Observation, Insight, and Lesson sections
604
+
605
+ 5. **Save locally** — Write to `docs/lessons/NNNN-<slug>.md`
606
+
607
+ 6. **Generate PR** — If the user wants to contribute back:
608
+ - Fork the toolkit repo if needed
609
+ - Create a branch: `lesson/NNNN-<slug>`
610
+ - Commit the lesson file
611
+ - Open a PR with title: `lesson: <title>` and body describing the anti-pattern
612
+
613
+ ## Output
614
+
615
+ Show the user the generated lesson file and ask if they want to:
616
+ - Save locally only (for personal use)
617
+ - Submit as a PR to the toolkit repo (for community benefit)
618
+ ```
619
+
620
+ **Step 2: Commit**
621
+
622
+ ```bash
623
+ git add commands/submit-lesson.md
624
+ git commit -m "feat: add /submit-lesson command for community lesson contributions"
625
+ ```
626
+
627
+ ### Task 15: Create CONTRIBUTING.md
628
+
629
+ **Files:**
630
+ - Create: `docs/CONTRIBUTING.md`
631
+
632
+ **Step 1: Write contributing guide**
633
+
634
+ Cover:
635
+ - How to submit a lesson (use `/submit-lesson` command or manual PR)
636
+ - Lesson file format (link to TEMPLATE.md)
637
+ - Quality bar (must include a real example, regex must not produce false positives)
638
+ - Review process (maintainer tests the regex, verifies the anti-pattern is real)
639
+ - Categories and severity definitions
640
+ - How lessons become automated checks (syntactic → lesson-check.sh, semantic → lesson-scanner)
641
+
642
+ **Step 2: Commit**
643
+
644
+ ```bash
645
+ git add docs/CONTRIBUTING.md
646
+ git commit -m "docs: add contributing guide for community lesson submissions"
647
+ ```
648
+
649
+ ## Batch 5: Cleanup & Documentation
650
+
651
+ ### Task 16: Strip personal references from skills
652
+
653
+ **Files:**
654
+ - Scan and modify: all files in `skills/`
655
+
656
+ **Step 1: Search for personal references**
657
+
658
+ ```bash
659
+ grep -rn 'ha-aria\|hub\.cache\|lesson #\|lesson-[0-9]\|~/\.\|/home/\|ARIA\|Preact' skills/
660
+ ```
661
+
662
+ **Step 2: Replace or remove**
663
+
664
+ The grep results from the earlier scan show very few personal references in skills — mostly generic CLAUDE.md references which are fine (every project has a CLAUDE.md). If any ha-aria or project-specific references are found, replace with generic equivalents.
665
+
666
+ **Step 3: Add `version: 1.0.0` to all skill frontmatter**
667
+
668
+ For each SKILL.md, add `version: 1.0.0` to the YAML frontmatter if not already present.
669
+
670
+ **Step 4: Commit**
671
+
672
+ ```bash
673
+ git add skills/
674
+ git commit -m "refactor: strip personal references from skills, add version to frontmatter"
675
+ ```
676
+
677
+ ### Task 17: Update CLAUDE.md for new structure
678
+
679
+ **Files:**
680
+ - Modify: `CLAUDE.md`
681
+
682
+ **Step 1: Update directory layout**
683
+
684
+ Replace the directory layout section to reflect:
685
+ - `.claude-plugin/` at root (new)
686
+ - `commands/` at root (moved from `.claude/commands/` + ralph-loop)
687
+ - `hooks/` at root (moved from `plugins/ralph-loop/hooks/`)
688
+ - `plugins/` removed
689
+ - `docs/lessons/` now contains numbered lesson files
690
+
691
+ **Step 2: Add community lesson section**
692
+
693
+ Add a section explaining the dynamic lesson system and `/submit-lesson` command.
694
+
695
+ **Step 3: Commit**
696
+
697
+ ```bash
698
+ git add CLAUDE.md
699
+ git commit -m "docs: update CLAUDE.md for marketplace structure and community lessons"
700
+ ```
701
+
702
+ ### Task 18: Update README.md
703
+
704
+ **Files:**
705
+ - Modify: `README.md`
706
+
707
+ **Step 1: Update installation section**
708
+
709
+ Add marketplace installation:
710
+ ```bash
711
+ # Self-hosted marketplace
712
+ /plugin marketplace add parthalon025/autonomous-coding-toolkit
713
+ /plugin install autonomous-coding-toolkit@autonomous-coding-toolkit
714
+
715
+ # Or clone directly
716
+ git clone https://github.com/parthalon025/autonomous-coding-toolkit.git ~/.claude/plugins/autonomous-coding-toolkit
717
+ ```
718
+
719
+ **Step 2: Add community lessons section**
720
+
721
+ New section explaining:
722
+ - The toolkit improves with every user's lessons
723
+ - How to submit a lesson (`/submit-lesson` or manual PR)
724
+ - How lessons become automated checks
725
+ - Link to CONTRIBUTING.md
726
+
727
+ **Step 3: Add attribution**
728
+
729
+ Add acknowledgment section crediting superpowers plugin as the foundation for the core skill chain.
730
+
731
+ **Step 4: Update directory structure diagram**
732
+
733
+ Reflect the new top-level layout.
734
+
735
+ **Step 5: Commit**
736
+
737
+ ```bash
738
+ git add README.md
739
+ git commit -m "docs: update README with marketplace install, community lessons, and attribution"
740
+ ```
741
+
742
+ ### Task 19: Update ARCHITECTURE.md
743
+
744
+ **Files:**
745
+ - Modify: `docs/ARCHITECTURE.md`
746
+
747
+ **Step 1: Add community lesson loop diagram**
748
+
749
+ Add a new section to the Feedback Loops area showing the community flow:
750
+ ```
751
+ User hits bug → /submit-lesson → PR → merge →
752
+ → lesson file in docs/lessons/
753
+ → lesson-check.sh picks up syntactic pattern
754
+ → lesson-scanner picks up semantic pattern
755
+ → all users benefit on next scan
756
+ ```
757
+
758
+ **Step 2: Update directory references**
759
+
760
+ Update any references to `.claude/commands/` or `plugins/ralph-loop/` to reflect new top-level locations.
761
+
762
+ **Step 3: Commit**
763
+
764
+ ```bash
765
+ git add docs/ARCHITECTURE.md
766
+ git commit -m "docs: update architecture with community lesson loop and new directory layout"
767
+ ```
768
+
769
+ ## Batch 6: Integration Wiring & Verification
770
+
771
+ ### Task 20: Verify all paths are consistent
772
+
773
+ **Step 1: Search for stale paths**
774
+
775
+ ```bash
776
+ grep -rn '\.claude/commands\|plugins/ralph-loop' --include='*.md' --include='*.sh' --include='*.json' .
777
+ ```
778
+
779
+ Any results are stale references that need updating.
780
+
781
+ **Step 2: Verify hooks.json path works from plugin root**
782
+
783
+ Read `hooks/hooks.json` and verify the stop-hook.sh path resolves correctly when the plugin root is the repo root.
784
+
785
+ **Step 3: Verify lesson-check.sh finds lessons**
786
+
787
+ ```bash
788
+ scripts/lesson-check.sh --help
789
+ ```
790
+
791
+ Should list dynamically loaded lessons instead of hardcoded checks.
792
+
793
+ **Step 4: Run test suite**
794
+
795
+ ```bash
796
+ bash scripts/tests/run-all-tests.sh
797
+ ```
798
+
799
+ Fix any failures.
800
+
801
+ **Step 5: Commit any fixes**
802
+
803
+ ```bash
804
+ git add -A
805
+ git commit -m "fix: resolve stale path references after restructure"
806
+ ```
807
+
808
+ ### Task 21: Final push
809
+
810
+ **Step 1: Push all commits**
811
+
812
+ ```bash
813
+ git push origin main
814
+ ```
815
+
816
+ ## Quality Gates
817
+
818
+ Between each batch, verify:
819
+ 1. `git status` — working tree clean
820
+ 2. `git log --oneline -5` — commits look right
821
+ 3. No stale references to old paths
822
+
823
+ ## Summary
824
+
825
+ | Batch | Tasks | What it does |
826
+ |-------|-------|-------------|
827
+ | 1 | 1-4 | Plugin manifests + directory restructure |
828
+ | 2 | 5-10 | Create 6 starter lesson files |
829
+ | 3 | 11-13 | Dynamic lesson-check.sh + lesson-scanner + template |
830
+ | 4 | 14-15 | /submit-lesson command + CONTRIBUTING.md |
831
+ | 5 | 16-19 | Strip personal refs, update all docs |
832
+ | 6 | 20-21 | Integration wiring, verify paths, push |