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.
- package/.claude-plugin/marketplace.json +22 -0
- package/.claude-plugin/plugin.json +13 -0
- package/LICENSE +21 -0
- package/Makefile +21 -0
- package/README.md +140 -0
- package/SECURITY.md +28 -0
- package/agents/bash-expert.md +113 -0
- package/agents/dependency-auditor.md +138 -0
- package/agents/integration-tester.md +120 -0
- package/agents/lesson-scanner.md +149 -0
- package/agents/python-expert.md +179 -0
- package/agents/service-monitor.md +141 -0
- package/agents/shell-expert.md +147 -0
- package/benchmarks/runner.sh +147 -0
- package/benchmarks/tasks/01-rest-endpoint/rubric.sh +29 -0
- package/benchmarks/tasks/01-rest-endpoint/task.md +17 -0
- package/benchmarks/tasks/02-refactor-module/task.md +8 -0
- package/benchmarks/tasks/03-fix-integration-bug/task.md +8 -0
- package/benchmarks/tasks/04-add-test-coverage/task.md +8 -0
- package/benchmarks/tasks/05-multi-file-feature/task.md +8 -0
- package/bin/act.js +238 -0
- package/commands/autocode.md +6 -0
- package/commands/cancel-ralph.md +18 -0
- package/commands/code-factory.md +53 -0
- package/commands/create-prd.md +55 -0
- package/commands/ralph-loop.md +18 -0
- package/commands/run-plan.md +117 -0
- package/commands/submit-lesson.md +122 -0
- package/docs/ARCHITECTURE.md +630 -0
- package/docs/CONTRIBUTING.md +125 -0
- package/docs/lessons/0001-bare-exception-swallowing.md +34 -0
- package/docs/lessons/0002-async-def-without-await.md +28 -0
- package/docs/lessons/0003-create-task-without-callback.md +28 -0
- package/docs/lessons/0004-hardcoded-test-counts.md +28 -0
- package/docs/lessons/0005-sqlite-without-closing.md +33 -0
- package/docs/lessons/0006-venv-pip-path.md +27 -0
- package/docs/lessons/0007-runner-state-self-rejection.md +35 -0
- package/docs/lessons/0008-quality-gate-blind-spot.md +33 -0
- package/docs/lessons/0009-parser-overcount-empty-batches.md +36 -0
- package/docs/lessons/0010-local-outside-function-bash.md +33 -0
- package/docs/lessons/0011-batch-tests-for-unimplemented-code.md +36 -0
- package/docs/lessons/0012-api-markdown-unescaped-chars.md +33 -0
- package/docs/lessons/0013-export-prefix-env-parsing.md +33 -0
- package/docs/lessons/0014-decorator-registry-import-side-effect.md +43 -0
- package/docs/lessons/0015-frontend-backend-schema-drift.md +43 -0
- package/docs/lessons/0016-event-driven-cold-start-seeding.md +44 -0
- package/docs/lessons/0017-copy-paste-logic-diverges.md +43 -0
- package/docs/lessons/0018-layer-passes-pipeline-broken.md +45 -0
- package/docs/lessons/0019-systemd-envfile-ignores-export.md +41 -0
- package/docs/lessons/0020-persist-state-incrementally.md +44 -0
- package/docs/lessons/0021-dual-axis-testing.md +48 -0
- package/docs/lessons/0022-jsx-factory-shadowing.md +43 -0
- package/docs/lessons/0023-static-analysis-spiral.md +51 -0
- package/docs/lessons/0024-shared-pipeline-implementation.md +55 -0
- package/docs/lessons/0025-defense-in-depth-all-entry-points.md +65 -0
- package/docs/lessons/0026-linter-no-rules-false-enforcement.md +54 -0
- package/docs/lessons/0027-jsx-silent-prop-drop.md +64 -0
- package/docs/lessons/0028-no-infrastructure-in-client-code.md +49 -0
- package/docs/lessons/0029-never-write-secrets-to-files.md +61 -0
- package/docs/lessons/0030-cache-merge-not-replace.md +62 -0
- package/docs/lessons/0031-verify-units-at-boundaries.md +66 -0
- package/docs/lessons/0032-module-lifecycle-subscribe-unsubscribe.md +89 -0
- package/docs/lessons/0033-async-iteration-mutable-snapshot.md +72 -0
- package/docs/lessons/0034-caller-missing-await-silent-discard.md +65 -0
- package/docs/lessons/0035-duplicate-registration-silent-overwrite.md +85 -0
- package/docs/lessons/0036-websocket-dirty-disconnect.md +33 -0
- package/docs/lessons/0037-parallel-agents-worktree-corruption.md +31 -0
- package/docs/lessons/0038-subscribe-no-stored-ref.md +36 -0
- package/docs/lessons/0039-fallback-or-default-hides-bugs.md +34 -0
- package/docs/lessons/0040-event-firehose-filter-first.md +36 -0
- package/docs/lessons/0041-ambiguous-base-dir-path-nesting.md +32 -0
- package/docs/lessons/0042-spec-compliance-insufficient.md +36 -0
- package/docs/lessons/0043-exact-count-extensible-collections.md +32 -0
- package/docs/lessons/0044-relative-file-deps-worktree.md +39 -0
- package/docs/lessons/0045-iterative-design-improvement.md +33 -0
- package/docs/lessons/0046-plan-assertion-math-bugs.md +38 -0
- package/docs/lessons/0047-pytest-single-threaded-default.md +37 -0
- package/docs/lessons/0048-integration-wiring-batch.md +40 -0
- package/docs/lessons/0049-ab-verification.md +41 -0
- package/docs/lessons/0050-editing-sourced-files-during-execution.md +33 -0
- package/docs/lessons/0051-infrastructure-fixes-cant-self-heal.md +30 -0
- package/docs/lessons/0052-uncommitted-changes-poison-quality-gates.md +31 -0
- package/docs/lessons/0053-jq-compact-flag-inconsistency.md +31 -0
- package/docs/lessons/0054-parser-matches-inside-code-blocks.md +30 -0
- package/docs/lessons/0055-agents-compensate-for-garbled-prompts.md +31 -0
- package/docs/lessons/0056-grep-count-exit-code-on-zero.md +42 -0
- package/docs/lessons/0057-new-artifacts-break-git-clean-gates.md +42 -0
- package/docs/lessons/0058-dead-config-keys-never-consumed.md +49 -0
- package/docs/lessons/0059-contract-test-shared-structures.md +53 -0
- package/docs/lessons/0060-set-e-silent-death-in-runners.md +53 -0
- package/docs/lessons/0061-context-injection-dirty-state.md +50 -0
- package/docs/lessons/0062-sibling-bug-neighborhood-scan.md +29 -0
- package/docs/lessons/0063-one-flag-two-lifetimes.md +31 -0
- package/docs/lessons/0064-test-passes-wrong-reason.md +31 -0
- package/docs/lessons/0065-pipefail-grep-count-double-output.md +39 -0
- package/docs/lessons/0066-local-keyword-outside-function.md +37 -0
- package/docs/lessons/0067-stdin-hang-non-interactive-shell.md +36 -0
- package/docs/lessons/0068-agent-builds-wrong-thing-correctly.md +31 -0
- package/docs/lessons/0069-plan-quality-dominates-execution.md +30 -0
- package/docs/lessons/0070-spec-echo-back-prevents-drift.md +31 -0
- package/docs/lessons/0071-positive-instructions-outperform-negative.md +30 -0
- package/docs/lessons/0072-lost-in-the-middle-context-placement.md +30 -0
- package/docs/lessons/0073-unscoped-lessons-cause-false-positives.md +30 -0
- package/docs/lessons/0074-stale-context-injection-wrong-batch.md +32 -0
- package/docs/lessons/0075-research-artifacts-must-persist.md +32 -0
- package/docs/lessons/0076-wrong-decomposition-contaminates-downstream.md +30 -0
- package/docs/lessons/0077-cherry-pick-merges-need-manual-resolution.md +30 -0
- package/docs/lessons/0078-static-review-without-live-test.md +30 -0
- package/docs/lessons/0079-integration-wiring-batch-required.md +32 -0
- package/docs/lessons/FRAMEWORK.md +161 -0
- package/docs/lessons/SUMMARY.md +201 -0
- package/docs/lessons/TEMPLATE.md +85 -0
- package/docs/plans/2026-02-21-code-factory-v2-design.md +204 -0
- package/docs/plans/2026-02-21-code-factory-v2-implementation-plan.md +2189 -0
- package/docs/plans/2026-02-21-code-factory-v2-phase4-design.md +537 -0
- package/docs/plans/2026-02-21-code-factory-v2-phase4-implementation-plan.md +2012 -0
- package/docs/plans/2026-02-21-hardening-pass-design.md +108 -0
- package/docs/plans/2026-02-21-hardening-pass-plan.md +1378 -0
- package/docs/plans/2026-02-21-mab-research-report.md +406 -0
- package/docs/plans/2026-02-21-marketplace-restructure-design.md +240 -0
- package/docs/plans/2026-02-21-marketplace-restructure-plan.md +832 -0
- package/docs/plans/2026-02-21-phase4-completion-plan.md +697 -0
- package/docs/plans/2026-02-21-validator-suite-design.md +148 -0
- package/docs/plans/2026-02-21-validator-suite-plan.md +540 -0
- package/docs/plans/2026-02-22-mab-research-round2.md +556 -0
- package/docs/plans/2026-02-22-mab-run-design.md +462 -0
- package/docs/plans/2026-02-22-mab-run-plan.md +2046 -0
- package/docs/plans/2026-02-22-operations-design-methodology-research.md +681 -0
- package/docs/plans/2026-02-22-research-agent-failure-taxonomy.md +532 -0
- package/docs/plans/2026-02-22-research-code-guideline-policies.md +886 -0
- package/docs/plans/2026-02-22-research-codebase-audit-refactoring.md +908 -0
- package/docs/plans/2026-02-22-research-coding-standards-documentation.md +541 -0
- package/docs/plans/2026-02-22-research-competitive-landscape.md +687 -0
- package/docs/plans/2026-02-22-research-comprehensive-testing.md +1076 -0
- package/docs/plans/2026-02-22-research-context-utilization.md +459 -0
- package/docs/plans/2026-02-22-research-cost-quality-tradeoff.md +548 -0
- package/docs/plans/2026-02-22-research-lesson-transferability.md +508 -0
- package/docs/plans/2026-02-22-research-multi-agent-coordination.md +312 -0
- package/docs/plans/2026-02-22-research-phase-integration.md +602 -0
- package/docs/plans/2026-02-22-research-plan-quality.md +428 -0
- package/docs/plans/2026-02-22-research-prompt-engineering.md +558 -0
- package/docs/plans/2026-02-22-research-unconventional-perspectives.md +528 -0
- package/docs/plans/2026-02-22-research-user-adoption.md +638 -0
- package/docs/plans/2026-02-22-research-verification-effectiveness.md +433 -0
- package/docs/plans/2026-02-23-agent-suite-design.md +299 -0
- package/docs/plans/2026-02-23-agent-suite-plan.md +578 -0
- package/docs/plans/2026-02-23-phase3-cost-infrastructure-design.md +148 -0
- package/docs/plans/2026-02-23-phase3-cost-infrastructure-plan.md +1062 -0
- package/docs/plans/2026-02-23-research-bash-expert-agent.md +543 -0
- package/docs/plans/2026-02-23-research-dependency-auditor-agent.md +564 -0
- package/docs/plans/2026-02-23-research-improving-existing-agents.md +503 -0
- package/docs/plans/2026-02-23-research-integration-tester-agent.md +454 -0
- package/docs/plans/2026-02-23-research-python-expert-agent.md +429 -0
- package/docs/plans/2026-02-23-research-service-monitor-agent.md +425 -0
- package/docs/plans/2026-02-23-research-shell-expert-agent.md +533 -0
- package/docs/plans/2026-02-23-roadmap-to-completion.md +530 -0
- package/docs/plans/2026-02-24-headless-module-split-design.md +98 -0
- package/docs/plans/2026-02-24-headless-module-split.md +443 -0
- package/docs/plans/2026-02-24-lesson-scope-metadata-design.md +228 -0
- package/docs/plans/2026-02-24-lesson-scope-metadata-plan.md +968 -0
- package/docs/plans/2026-02-24-npm-packaging-design.md +841 -0
- package/docs/plans/2026-02-24-npm-packaging-plan.md +1965 -0
- package/docs/plans/audit-findings.md +186 -0
- package/docs/telegram-notification-format.md +98 -0
- package/examples/example-plan.md +51 -0
- package/examples/example-prd.json +72 -0
- package/examples/example-roadmap.md +33 -0
- package/examples/quickstart-plan.md +63 -0
- package/hooks/hooks.json +26 -0
- package/hooks/setup-symlinks.sh +48 -0
- package/hooks/stop-hook.sh +135 -0
- package/package.json +47 -0
- package/policies/bash.md +71 -0
- package/policies/python.md +71 -0
- package/policies/testing.md +61 -0
- package/policies/universal.md +60 -0
- package/scripts/analyze-report.sh +97 -0
- package/scripts/architecture-map.sh +145 -0
- package/scripts/auto-compound.sh +273 -0
- package/scripts/batch-audit.sh +42 -0
- package/scripts/batch-test.sh +101 -0
- package/scripts/entropy-audit.sh +221 -0
- package/scripts/failure-digest.sh +51 -0
- package/scripts/generate-ast-rules.sh +96 -0
- package/scripts/init.sh +112 -0
- package/scripts/lesson-check.sh +428 -0
- package/scripts/lib/common.sh +61 -0
- package/scripts/lib/cost-tracking.sh +153 -0
- package/scripts/lib/ollama.sh +60 -0
- package/scripts/lib/progress-writer.sh +128 -0
- package/scripts/lib/run-plan-context.sh +215 -0
- package/scripts/lib/run-plan-echo-back.sh +231 -0
- package/scripts/lib/run-plan-headless.sh +396 -0
- package/scripts/lib/run-plan-notify.sh +57 -0
- package/scripts/lib/run-plan-parser.sh +81 -0
- package/scripts/lib/run-plan-prompt.sh +215 -0
- package/scripts/lib/run-plan-quality-gate.sh +132 -0
- package/scripts/lib/run-plan-routing.sh +315 -0
- package/scripts/lib/run-plan-sampling.sh +170 -0
- package/scripts/lib/run-plan-scoring.sh +146 -0
- package/scripts/lib/run-plan-state.sh +142 -0
- package/scripts/lib/run-plan-team.sh +199 -0
- package/scripts/lib/telegram.sh +54 -0
- package/scripts/lib/thompson-sampling.sh +176 -0
- package/scripts/license-check.sh +74 -0
- package/scripts/mab-run.sh +575 -0
- package/scripts/module-size-check.sh +146 -0
- package/scripts/patterns/async-no-await.yml +5 -0
- package/scripts/patterns/bare-except.yml +6 -0
- package/scripts/patterns/empty-catch.yml +6 -0
- package/scripts/patterns/hardcoded-localhost.yml +9 -0
- package/scripts/patterns/retry-loop-no-backoff.yml +12 -0
- package/scripts/pipeline-status.sh +197 -0
- package/scripts/policy-check.sh +226 -0
- package/scripts/prior-art-search.sh +133 -0
- package/scripts/promote-mab-lessons.sh +126 -0
- package/scripts/prompts/agent-a-superpowers.md +29 -0
- package/scripts/prompts/agent-b-ralph.md +29 -0
- package/scripts/prompts/judge-agent.md +61 -0
- package/scripts/prompts/planner-agent.md +44 -0
- package/scripts/pull-community-lessons.sh +90 -0
- package/scripts/quality-gate.sh +266 -0
- package/scripts/research-gate.sh +90 -0
- package/scripts/run-plan.sh +329 -0
- package/scripts/scope-infer.sh +159 -0
- package/scripts/setup-ralph-loop.sh +155 -0
- package/scripts/telemetry.sh +230 -0
- package/scripts/tests/run-all-tests.sh +52 -0
- package/scripts/tests/test-act-cli.sh +46 -0
- package/scripts/tests/test-agents-md.sh +87 -0
- package/scripts/tests/test-analyze-report.sh +114 -0
- package/scripts/tests/test-architecture-map.sh +89 -0
- package/scripts/tests/test-auto-compound.sh +169 -0
- package/scripts/tests/test-batch-test.sh +65 -0
- package/scripts/tests/test-benchmark-runner.sh +25 -0
- package/scripts/tests/test-common.sh +168 -0
- package/scripts/tests/test-cost-tracking.sh +158 -0
- package/scripts/tests/test-echo-back.sh +180 -0
- package/scripts/tests/test-entropy-audit.sh +146 -0
- package/scripts/tests/test-failure-digest.sh +66 -0
- package/scripts/tests/test-generate-ast-rules.sh +145 -0
- package/scripts/tests/test-helpers.sh +82 -0
- package/scripts/tests/test-init.sh +47 -0
- package/scripts/tests/test-lesson-check.sh +278 -0
- package/scripts/tests/test-lesson-local.sh +55 -0
- package/scripts/tests/test-license-check.sh +109 -0
- package/scripts/tests/test-mab-run.sh +182 -0
- package/scripts/tests/test-ollama-lib.sh +49 -0
- package/scripts/tests/test-ollama.sh +60 -0
- package/scripts/tests/test-pipeline-status.sh +198 -0
- package/scripts/tests/test-policy-check.sh +124 -0
- package/scripts/tests/test-prior-art-search.sh +96 -0
- package/scripts/tests/test-progress-writer.sh +140 -0
- package/scripts/tests/test-promote-mab-lessons.sh +110 -0
- package/scripts/tests/test-pull-community-lessons.sh +149 -0
- package/scripts/tests/test-quality-gate.sh +241 -0
- package/scripts/tests/test-research-gate.sh +132 -0
- package/scripts/tests/test-run-plan-cli.sh +86 -0
- package/scripts/tests/test-run-plan-context.sh +305 -0
- package/scripts/tests/test-run-plan-e2e.sh +153 -0
- package/scripts/tests/test-run-plan-headless.sh +424 -0
- package/scripts/tests/test-run-plan-notify.sh +124 -0
- package/scripts/tests/test-run-plan-parser.sh +217 -0
- package/scripts/tests/test-run-plan-prompt.sh +254 -0
- package/scripts/tests/test-run-plan-quality-gate.sh +222 -0
- package/scripts/tests/test-run-plan-routing.sh +178 -0
- package/scripts/tests/test-run-plan-scoring.sh +148 -0
- package/scripts/tests/test-run-plan-state.sh +261 -0
- package/scripts/tests/test-run-plan-team.sh +157 -0
- package/scripts/tests/test-scope-infer.sh +150 -0
- package/scripts/tests/test-setup-ralph-loop.sh +63 -0
- package/scripts/tests/test-telegram-env.sh +38 -0
- package/scripts/tests/test-telegram.sh +121 -0
- package/scripts/tests/test-telemetry.sh +46 -0
- package/scripts/tests/test-thompson-sampling.sh +139 -0
- package/scripts/tests/test-validate-all.sh +60 -0
- package/scripts/tests/test-validate-commands.sh +89 -0
- package/scripts/tests/test-validate-hooks.sh +98 -0
- package/scripts/tests/test-validate-lessons.sh +150 -0
- package/scripts/tests/test-validate-plan-quality.sh +235 -0
- package/scripts/tests/test-validate-plans.sh +187 -0
- package/scripts/tests/test-validate-plugin.sh +106 -0
- package/scripts/tests/test-validate-prd.sh +184 -0
- package/scripts/tests/test-validate-skills.sh +134 -0
- package/scripts/validate-all.sh +57 -0
- package/scripts/validate-commands.sh +67 -0
- package/scripts/validate-hooks.sh +89 -0
- package/scripts/validate-lessons.sh +98 -0
- package/scripts/validate-plan-quality.sh +369 -0
- package/scripts/validate-plans.sh +120 -0
- package/scripts/validate-plugin.sh +86 -0
- package/scripts/validate-policies.sh +42 -0
- package/scripts/validate-prd.sh +118 -0
- package/scripts/validate-skills.sh +96 -0
- package/skills/autocode/SKILL.md +285 -0
- package/skills/autocode/ab-verification.md +51 -0
- package/skills/autocode/code-quality-standards.md +37 -0
- package/skills/autocode/competitive-mode.md +364 -0
- package/skills/brainstorming/SKILL.md +97 -0
- package/skills/capture-lesson/SKILL.md +187 -0
- package/skills/check-lessons/SKILL.md +116 -0
- package/skills/dispatching-parallel-agents/SKILL.md +110 -0
- package/skills/executing-plans/SKILL.md +85 -0
- package/skills/finishing-a-development-branch/SKILL.md +201 -0
- package/skills/receiving-code-review/SKILL.md +72 -0
- package/skills/requesting-code-review/SKILL.md +59 -0
- package/skills/requesting-code-review/code-reviewer.md +82 -0
- package/skills/research/SKILL.md +145 -0
- package/skills/roadmap/SKILL.md +115 -0
- package/skills/subagent-driven-development/SKILL.md +98 -0
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +18 -0
- package/skills/subagent-driven-development/implementer-prompt.md +73 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +57 -0
- package/skills/systematic-debugging/SKILL.md +134 -0
- package/skills/systematic-debugging/condition-based-waiting.md +64 -0
- package/skills/systematic-debugging/defense-in-depth.md +32 -0
- package/skills/systematic-debugging/root-cause-tracing.md +55 -0
- package/skills/test-driven-development/SKILL.md +167 -0
- package/skills/using-git-worktrees/SKILL.md +219 -0
- package/skills/using-superpowers/SKILL.md +54 -0
- package/skills/verification-before-completion/SKILL.md +140 -0
- package/skills/verify/SKILL.md +82 -0
- package/skills/writing-plans/SKILL.md +128 -0
- package/skills/writing-skills/SKILL.md +93 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Execute an implementation plan batch-by-batch with quality gates between each batch"
|
|
3
|
+
argument-hint: "<plan-file> [--start-batch N] [--end-batch N] [--mode headless|team|competitive]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Run Plan
|
|
7
|
+
|
|
8
|
+
Execute the implementation plan: $ARGUMENTS
|
|
9
|
+
|
|
10
|
+
## How This Works
|
|
11
|
+
|
|
12
|
+
You are orchestrating batch-by-batch execution of a markdown plan file. Each batch contains tasks that you implement sequentially using TDD, then a quality gate runs before proceeding to the next batch.
|
|
13
|
+
|
|
14
|
+
## Step 1: Parse the Plan
|
|
15
|
+
|
|
16
|
+
Read the plan file specified in the arguments. Extract:
|
|
17
|
+
- All batches (lines matching `## Batch N: Title`)
|
|
18
|
+
- Tasks within each batch (lines matching `### Task M: Name`)
|
|
19
|
+
- Any metadata header (test baseline, quality gate command, tech stack)
|
|
20
|
+
|
|
21
|
+
Report what you found:
|
|
22
|
+
```
|
|
23
|
+
Plan: <filename>
|
|
24
|
+
Batches: N total
|
|
25
|
+
Batch 1: <title> (M tasks)
|
|
26
|
+
Batch 2: <title> (M tasks)
|
|
27
|
+
...
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If `--start-batch` or `--end-batch` were specified, note the execution range.
|
|
31
|
+
|
|
32
|
+
## Step 2: Initialize State
|
|
33
|
+
|
|
34
|
+
Create or read `.run-plan-state.json` in the current working directory:
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"plan_file": "<plan-file>",
|
|
38
|
+
"mode": "<mode>",
|
|
39
|
+
"current_batch": 1,
|
|
40
|
+
"completed_batches": [],
|
|
41
|
+
"test_counts": {},
|
|
42
|
+
"started_at": "<ISO timestamp>",
|
|
43
|
+
"last_quality_gate": null
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If the state file already exists and `--resume` was not specified, ask the user whether to resume or start fresh.
|
|
48
|
+
|
|
49
|
+
## Step 3: Execute Batches
|
|
50
|
+
|
|
51
|
+
For each batch in the execution range:
|
|
52
|
+
|
|
53
|
+
### Mode: headless (default)
|
|
54
|
+
Execute each task in the batch yourself using TDD:
|
|
55
|
+
1. **Write a failing test** for the task
|
|
56
|
+
2. **Run the test** — confirm it fails
|
|
57
|
+
3. **Implement** the minimum code to pass
|
|
58
|
+
4. **Run the test** — confirm it passes
|
|
59
|
+
5. **Commit** the task with a descriptive message
|
|
60
|
+
|
|
61
|
+
### Mode: team
|
|
62
|
+
For each batch, spawn two agents:
|
|
63
|
+
1. **Implementer** (general-purpose agent via Task tool) — receives the full batch text, implements using TDD
|
|
64
|
+
2. **Reviewer** (code-reviewer agent via Task tool) — reviews the implementer's git diff against the batch spec
|
|
65
|
+
|
|
66
|
+
If the reviewer finds issues, send fixes back to the implementer. Then run the quality gate.
|
|
67
|
+
|
|
68
|
+
### Mode: competitive
|
|
69
|
+
For critical batches (marked `⚠ CRITICAL` in the plan or specified via `--competitive-batches`):
|
|
70
|
+
|
|
71
|
+
See `skills/autocode/competitive-mode.md` for the full competitive execution flow including:
|
|
72
|
+
- Pre-flight exploration (codebase explorer + external research agents)
|
|
73
|
+
- Competitor A (TDD) and Competitor B (Iterative) prompt templates
|
|
74
|
+
- Judge scoring rubric with SCORE ANCHORS, structured checks, and hybrid evaluation
|
|
75
|
+
- Mandatory best-of-both synthesis and loser merge
|
|
76
|
+
- Cross-round learning (LESSONS FOR NEXT ROUND)
|
|
77
|
+
|
|
78
|
+
Non-critical batches fall back to team mode.
|
|
79
|
+
|
|
80
|
+
## Step 4: Quality Gate (after every batch)
|
|
81
|
+
|
|
82
|
+
Run the quality gate between every batch. Default: `scripts/quality-gate.sh --project-root .`
|
|
83
|
+
|
|
84
|
+
The quality gate checks:
|
|
85
|
+
1. **Lesson check** — scan changed files for known anti-patterns
|
|
86
|
+
2. **Test suite** — auto-detected (pytest / npm test / make test)
|
|
87
|
+
3. **Memory check** — warn if < 4GB available
|
|
88
|
+
|
|
89
|
+
Additionally check:
|
|
90
|
+
- **Test count regression** — the number of passing tests must be >= the previous batch's count
|
|
91
|
+
- **Git clean** — all changes must be committed
|
|
92
|
+
|
|
93
|
+
If the quality gate fails:
|
|
94
|
+
- Report what failed and why
|
|
95
|
+
- Ask the user how to proceed (fix, skip, or abort)
|
|
96
|
+
|
|
97
|
+
Update the state file after each batch completes.
|
|
98
|
+
|
|
99
|
+
## Step 5: Summary
|
|
100
|
+
|
|
101
|
+
After all batches complete, report:
|
|
102
|
+
```
|
|
103
|
+
Plan: <filename>
|
|
104
|
+
Batches completed: N of M
|
|
105
|
+
Test progression: 0 → 25 → 58 → 112
|
|
106
|
+
Duration: <total time>
|
|
107
|
+
Quality gates: all passed
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Rules
|
|
111
|
+
|
|
112
|
+
- **TDD is mandatory.** Every task gets a failing test before implementation.
|
|
113
|
+
- **Quality gates are mandatory.** Never skip to the next batch without passing.
|
|
114
|
+
- **Test counts only go up.** If tests decrease, something broke — fix it.
|
|
115
|
+
- **Commit after every task.** Small, atomic commits with descriptive messages.
|
|
116
|
+
- **Update progress.txt** after each batch with a summary of what was done.
|
|
117
|
+
- **Fresh context matters.** If you're past batch 5 and context feels degraded, suggest the user run `scripts/run-plan.sh --resume` headlessly for remaining batches.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Submit a lesson learned from a bug you encountered — contributes back to the community"
|
|
3
|
+
argument-hint: "[description of the bug or anti-pattern]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Submit Lesson
|
|
7
|
+
|
|
8
|
+
Help the user capture a lesson learned and generate a PR against the autonomous-coding-toolkit repo.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
### 1. Understand the Bug
|
|
13
|
+
|
|
14
|
+
Ask the user what happened. If `$ARGUMENTS` is provided, use that as the starting description. Clarify:
|
|
15
|
+
- What was the expected behavior?
|
|
16
|
+
- What actually happened?
|
|
17
|
+
- What code was involved? (file paths, snippets)
|
|
18
|
+
- How long did it take to find the bug?
|
|
19
|
+
|
|
20
|
+
### 2. Identify the Pattern
|
|
21
|
+
|
|
22
|
+
Determine:
|
|
23
|
+
- **Category:** async-traps | resource-lifecycle | silent-failures | integration-boundaries | test-anti-patterns | performance
|
|
24
|
+
- **Severity:** blocker (data loss, crashes, silent corruption) | should-fix (subtle bugs, degraded behavior) | nice-to-have (code smell, future risk)
|
|
25
|
+
- **Languages:** which languages this applies to (python, javascript, typescript, shell, all)
|
|
26
|
+
|
|
27
|
+
### 3. Determine Check Type
|
|
28
|
+
|
|
29
|
+
Is this pattern detectable by grep (syntactic) or does it need AI context (semantic)?
|
|
30
|
+
|
|
31
|
+
**Syntactic** (grep-detectable, near-zero false positives):
|
|
32
|
+
- Generate a `grep -P` regex that catches the anti-pattern
|
|
33
|
+
- Test the regex against the user's actual code to verify it works
|
|
34
|
+
- Verify it doesn't produce false positives on nearby code
|
|
35
|
+
|
|
36
|
+
**Semantic** (needs context, AI-detectable):
|
|
37
|
+
- Write a clear description of what to look for
|
|
38
|
+
- Include a concrete bad/good example
|
|
39
|
+
- The lesson-scanner agent will use this for contextual analysis
|
|
40
|
+
|
|
41
|
+
### 4. Generate the Lesson File
|
|
42
|
+
|
|
43
|
+
Auto-assign the next available ID:
|
|
44
|
+
```bash
|
|
45
|
+
# Find the highest existing ID
|
|
46
|
+
max_id=$(ls docs/lessons/[0-9]*.md 2>/dev/null | sed 's/.*\///' | sed 's/-.*//' | sort -n | tail -1)
|
|
47
|
+
next_id=$(printf "%04d" $((10#${max_id:-0} + 1)))
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Generate slug from title (lowercase, hyphens, no special chars).
|
|
51
|
+
|
|
52
|
+
Write the lesson file using this schema:
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
---
|
|
56
|
+
id: <next_id>
|
|
57
|
+
title: "<concise title>"
|
|
58
|
+
severity: <blocker|should-fix|nice-to-have>
|
|
59
|
+
languages: [<list>]
|
|
60
|
+
category: <category>
|
|
61
|
+
pattern:
|
|
62
|
+
type: <syntactic|semantic>
|
|
63
|
+
regex: "<grep -P pattern>" # Only for syntactic
|
|
64
|
+
description: "<what to look for>"
|
|
65
|
+
fix: "<how to fix it>"
|
|
66
|
+
example:
|
|
67
|
+
bad: |
|
|
68
|
+
<code that demonstrates the anti-pattern>
|
|
69
|
+
good: |
|
|
70
|
+
<code that demonstrates the fix>
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Observation
|
|
74
|
+
<What happened — factual description>
|
|
75
|
+
|
|
76
|
+
## Insight
|
|
77
|
+
<Why it happened — root cause>
|
|
78
|
+
|
|
79
|
+
## Lesson
|
|
80
|
+
<The rule to follow going forward>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 5. Save and Offer Contribution
|
|
84
|
+
|
|
85
|
+
Save to `docs/lessons/<next_id>-<slug>.md`.
|
|
86
|
+
|
|
87
|
+
Show the user the generated file and ask:
|
|
88
|
+
|
|
89
|
+
**Option A: Save locally only**
|
|
90
|
+
- File is saved in the current project's `docs/lessons/` directory
|
|
91
|
+
- Available to their local lesson-check.sh and lesson-scanner
|
|
92
|
+
|
|
93
|
+
**Option B: Submit as PR to the toolkit repo**
|
|
94
|
+
- Fork the toolkit repo if needed: `gh repo fork parthalon025/autonomous-coding-toolkit --clone=false`
|
|
95
|
+
- Create a branch: `lesson/<id>-<slug>`
|
|
96
|
+
- Commit the lesson file
|
|
97
|
+
- Open a PR:
|
|
98
|
+
```bash
|
|
99
|
+
gh pr create --repo parthalon025/autonomous-coding-toolkit \
|
|
100
|
+
--title "lesson: <title>" \
|
|
101
|
+
--body "## New Lesson
|
|
102
|
+
|
|
103
|
+
**Category:** <category>
|
|
104
|
+
**Severity:** <severity>
|
|
105
|
+
**Pattern type:** <syntactic|semantic>
|
|
106
|
+
|
|
107
|
+
## What this catches
|
|
108
|
+
<description>
|
|
109
|
+
|
|
110
|
+
## How it was discovered
|
|
111
|
+
<user's bug description>
|
|
112
|
+
"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Quality Bar
|
|
116
|
+
|
|
117
|
+
Before submitting, verify:
|
|
118
|
+
- [ ] The regex (if syntactic) catches the bad example
|
|
119
|
+
- [ ] The regex does NOT match the good example
|
|
120
|
+
- [ ] The description is clear enough for the lesson-scanner to use
|
|
121
|
+
- [ ] The fix is actionable (not just "be careful")
|
|
122
|
+
- [ ] The example is realistic (from real code, anonymized)
|