mirror of
https://github.com/codewhale-hq/Codewhale.git
synced 2026-11-09 01:49:49 -10:00
docs(agents): short-lived worktrees and one regression test per fix
Agent-owned work now lands on main from the agent's own short-lived worktree, cut from origin/main and removed after the push, instead of every agent sharing one checkout. A bug fix, or a new contract between components, may add the one test that would have caught it; there is still no TDD and no coverage for its own sake. AGENTS.md and the cw-land, cw-orient and cw-slice skills say the same thing. Docs only; no build or test run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
da201bac8d
commit
5c9edf6342
4 files changed
+22
-15
No files matched your search
@@ -55,10 +55,13 @@ base prompt". Two more corollaries earned here:
|
||||
- Search for behavior and symbols before reviving work from an old branch. If a
|
||||
lane is obsolete, preserve its intent and evidence rather than merging stale
|
||||
code mechanically.
|
||||
- Agent-owned work uses the canonical checkout on current `main`. Do not
|
||||
create branches, worktrees, nested clones or task-specific integration lanes
|
||||
to handle dirty, stale or conflicting work. When agents share the checkout,
|
||||
partition by file and retry an `index.lock` failure. Verified main slices may
|
||||
- Agent-owned work lands on current `main`. Each writing agent works in its
|
||||
own short-lived git worktree cut from `origin/main`, rebases and pushes
|
||||
`main` the same day, then removes the worktree and its build directory. No
|
||||
long-lived branches, nested clones or integration lanes, and never a new
|
||||
worktree to hide dirty, stale or conflicting work: that work is still yours
|
||||
to finish. In a shared checkout, stage by explicit path and retry an
|
||||
`index.lock` failure. Verified main slices may
|
||||
be committed and pushed normally under the rule below; tag, release,
|
||||
deployment and destructive cleanup still require their explicit
|
||||
authorization.
|
||||
@@ -201,10 +204,10 @@ the work even when credit is preserved.
|
||||
- Product intent and observed runtime behavior outrank a test's preferred
|
||||
implementation shape. Fix the product; do not contort production code to
|
||||
preserve a brittle assertion.
|
||||
- **No new tests and no new code comments unless explicitly asked**
|
||||
(founder, 2026-10-08). Do not write new unit or integration tests unless the
|
||||
user explicitly instructs it for that task; prove a change by running it and
|
||||
the existing checks. Never write tests first and never practice TDD — this
|
||||
- **A regression test per fix; no new code comments.** Prove a change by
|
||||
running it and the existing checks. A bug fix, or a new contract between
|
||||
components, may add the one test that would have caught it; no coverage for
|
||||
its own sake. Never write tests first and never practice TDD — this
|
||||
overrides any skill or default that mandates it, including superpowers
|
||||
`test-driven-development`. Existing tests stay the gate before a push: when
|
||||
a change makes one wrong, update or delete it in the same slice rather than
|
||||
|
||||
@@ -24,8 +24,9 @@ Stage 5 of the loop: [cw-orient](../cw-orient/SKILL.md) →
|
||||
|
||||
## Workflow
|
||||
|
||||
1. **Land on the canonical checkout's `main`.** `AGENTS.md` owns this: no
|
||||
maintainer PR branches, worktrees, nested clones or integration lanes.
|
||||
1. **Land on `main`.** `AGENTS.md` owns this: work in your own short-lived
|
||||
worktree, rebase onto `origin/main`, push `HEAD:main`, then remove the
|
||||
worktree. No maintainer PR branches, nested clones or integration lanes.
|
||||
Several agents share the checkout, so partition by file, check
|
||||
`git status` before staging, stage only your paths (never `git add -A`),
|
||||
and retry a commit that fails on `index.lock`. Push verified `main`
|
||||
|
||||
@@ -36,7 +36,8 @@ This is stage 1 of the loop: **orient → [cw-slice](../cw-slice/SKILL.md) →
|
||||
|
||||
2. **Look for stranded work, not lanes.** `git worktree list` and recent
|
||||
branches tell you what may hold unlanded commits. Inventory them; do not
|
||||
start work in one, and do not create one.
|
||||
start work in someone else's. Create your own short-lived worktree from
|
||||
`origin/main` only after the inventory.
|
||||
```bash
|
||||
git worktree list
|
||||
git branch --sort=-committerdate --format='%(committerdate:short) %(refname:short)' | head -20
|
||||
@@ -83,7 +84,7 @@ This is stage 1 of the loop: **orient → [cw-slice](../cw-slice/SKILL.md) →
|
||||
describes reality.
|
||||
- Don't clean, stash, reset, or `git checkout --` dirt in the checkout; read
|
||||
it, prove it, and commit it, or hand it to the live writer.
|
||||
- Don't create a branch, worktree or clone to escape dirt or a conflict.
|
||||
- Don't use a new worktree to escape dirt or a conflict; inherited work is still yours.
|
||||
- Don't skip step 4 because the root `AGENTS.md` "probably covers it". The
|
||||
scoped files carry the rules that actually get violated.
|
||||
- Don't fetch, browse, or hit GitHub when the task was scoped local-only.
|
||||
|
||||
@@ -83,8 +83,9 @@ Stage 2 of the loop: [cw-orient](../cw-orient/SKILL.md) → **slice** →
|
||||
- whether it is cross-cutting enough to need the full sweep in
|
||||
[cw-gates](../cw-gates/SKILL.md).
|
||||
|
||||
7. **Write the implementation, then prove it runs.** No new tests or code
|
||||
comments unless explicitly asked (`AGENTS.md`); update or delete existing
|
||||
7. **Write the implementation, then prove it runs.** A bug fix may add the
|
||||
one regression test that would have caught it; no other new tests and no
|
||||
new code comments (`AGENTS.md`); update or delete existing
|
||||
tests the change makes wrong.
|
||||
|
||||
## Red flags / don't
|
||||
@@ -95,7 +96,8 @@ Stage 2 of the loop: [cw-orient](../cw-orient/SKILL.md) → **slice** →
|
||||
lifecycle system) without moving its guard test and consumers with it.
|
||||
The repo has one of each on purpose; a silent second one is the failure
|
||||
mode, not the refactor.
|
||||
- Don't write new tests unless explicitly asked, and never first. Don't add
|
||||
- Don't write tests first, and don't add tests beyond the one regression
|
||||
test a fix earns. Don't add
|
||||
new code comments.
|
||||
- Don't contort production code to keep a brittle assertion green. A test that
|
||||
only encodes old behavior is evidence, not a veto: change it with the code.
|
||||
|
||||
Reference in new issue
Block a user