@workit-dev/pi 0.0.1 → 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/README.md +24 -43
- package/dist/worker.js +10272 -0
- package/dist/workit.js +29682 -0
- package/package.json +47 -6
- package/skills/workit-architecture/SKILL.md +72 -0
- package/skills/workit-architecture/agents/openai.yaml +3 -0
- package/skills/workit-architecture/references/instruction-files.md +52 -0
- package/skills/workit-architecture/references/vocabulary.md +53 -0
- package/skills/workit-bdd/SKILL.md +53 -0
- package/skills/workit-continue/SKILL.md +54 -0
- package/skills/workit-debug/SKILL.md +45 -0
- package/skills/workit-deslop/SKILL.md +58 -0
- package/skills/workit-fanout/SKILL.md +71 -0
- package/skills/workit-fanout/references/brief.md +141 -0
- package/skills/workit-fanout/references/orchestration.md +169 -0
- package/skills/workit-implement/SKILL.md +71 -0
- package/skills/workit-retro/SKILL.md +72 -0
- package/skills/workit-retro/agents/openai.yaml +3 -0
- package/skills/workit-retro/references/sources.md +35 -0
- package/skills/workit-retro/references/steering.md +39 -0
- package/skills/workit-review/SKILL.md +66 -0
- package/skills/workit-review/references/impact.md +24 -0
- package/skills/workit-shape/SKILL.md +71 -0
- package/skills/workit-shape/references/diagrams.md +17 -0
- package/skills/workit-shape/references/knowledge.md +61 -0
- package/skills/workit-shape/references/mockups.md +15 -0
- package/skills/workit-shape/references/slicing.md +44 -0
- package/skills/workit-ship/SKILL.md +71 -0
- package/skills/workit-ship/references/changelog.md +44 -0
- package/skills/workit-ship/references/pr-body.md +32 -0
- package/skills/workit-ship/references/release.md +39 -0
- package/skills/workit-test-audit/SKILL.md +54 -0
- package/skills/workit-verify-app/SKILL.md +68 -0
- package/skills/workit-verify-app/references/template.md +51 -0
package/package.json
CHANGED
|
@@ -1,10 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/pi",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Workit native extension for Pi — tools, method skills, and session continuity",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
6
|
+
"agentic-coding",
|
|
7
|
+
"ai-agents",
|
|
8
|
+
"coding-agent",
|
|
9
|
+
"extension",
|
|
10
|
+
"pi",
|
|
11
|
+
"pi-package",
|
|
12
|
+
"workflow"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/BrainerVirus/workit#readme",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/BrainerVirus/workit.git",
|
|
19
|
+
"directory": "packages/workit-pi"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/",
|
|
23
|
+
"skills/",
|
|
24
|
+
"package.json"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/workit.js",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "bun scripts/build.ts"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@earendil-works/pi-coding-agent": "1.4.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@earendil-works/pi-coding-agent": "^1.4.0"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=24"
|
|
42
|
+
},
|
|
43
|
+
"pi": {
|
|
44
|
+
"extensions": [
|
|
45
|
+
"./dist/workit.js"
|
|
46
|
+
],
|
|
47
|
+
"skills": [
|
|
48
|
+
"./skills"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
10
51
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workit-architecture
|
|
3
|
+
description: Rank cited deepening refactors from churn and ledger friction; never applied unapproved. Use for architecture.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Architecture: deepen the modules that cause friction
|
|
8
|
+
|
|
9
|
+
User-invoked: offer it, never start it yourself. It proposes and grills; it
|
|
10
|
+
never refactors without the user's approval. Use the words in
|
|
11
|
+
`references/vocabulary.md` exactly and the domain words in `GLOSSARY.md`.
|
|
12
|
+
|
|
13
|
+
## Deepening
|
|
14
|
+
|
|
15
|
+
1. **Scope by YAGNI.** A direction the user names wins. Otherwise find hot
|
|
16
|
+
spots: churn (`git log --since=6.months --name-only --format=`, counted per
|
|
17
|
+
file, skipping lockfiles, version-bump manifests, generated files, docs and
|
|
18
|
+
`chore(release)` commits), friction in `workit ledger list --last 200`
|
|
19
|
+
(failed checks and verdicts, rulings, `retro:` decisions) and
|
|
20
|
+
`workit test-audit <paths> --json`. State the window and paths in one line.
|
|
21
|
+
2. **Settled decisions stand.** Read `GLOSSARY.md`, `CODING_STANDARDS.md` and
|
|
22
|
+
ADRs when present. Never re-litigate an ADR without new evidence.
|
|
23
|
+
3. **Explore organically.** A read-only explorer (Claude Code: Explore; or
|
|
24
|
+
you) walks the hot spots under the limits in `references/vocabulary.md`
|
|
25
|
+
and returns cited friction. Run the deletion test on every suspect.
|
|
26
|
+
4. **Report 3-5 ranked candidates, then stop and wait for approval.** Each:
|
|
27
|
+
- files and modules;
|
|
28
|
+
- the friction, with **2 or more cited occurrences** (commit, ledger row,
|
|
29
|
+
PR, test-audit finding); a one-off is not a candidate;
|
|
30
|
+
- an interface sketch: what callers see, what moves behind the seam;
|
|
31
|
+
- what gets simpler and what becomes testable through that interface;
|
|
32
|
+
- **merge danger**: one-way or two-way door, plus blast radius (callers,
|
|
33
|
+
packages, public surface).
|
|
34
|
+
The text list is primary; offer an HTML report only if the host renders one.
|
|
35
|
+
5. **Grill the chosen one**: numbered questions, each with a recommended
|
|
36
|
+
answer; challenge a weak premise with evidence first. Settle the interface,
|
|
37
|
+
the seam, the tests to replace and the migration order; a module named for
|
|
38
|
+
a new concept gets its glossary entry (read the `workit-shape` skill's SKILL.md and follow it).
|
|
39
|
+
6. **Hand off on approval.** Several slices go into a plan for
|
|
40
|
+
`workit fanout plan <plan.json>`, with scopes and dependencies
|
|
41
|
+
(read the `workit-fanout` skill's SKILL.md and follow it). One slice goes to a build (read the `workit-implement` skill's SKILL.md and follow it). Record the
|
|
42
|
+
choice with `workit ledger decision "architecture: <id>" --why "<why>"`;
|
|
43
|
+
offer an ADR for a lasting rejection so the next run does not repeat it.
|
|
44
|
+
|
|
45
|
+
## Instruction files
|
|
46
|
+
|
|
47
|
+
Restructure AGENTS.md or CLAUDE.md in three escalating passes, **each its own
|
|
48
|
+
commit in one PR**, so the user can drop the later ones: remove no-ops;
|
|
49
|
+
progressive disclosure into topic files; coding rules to `CODING_STANDARDS.md`
|
|
50
|
+
and mechanical rules to checks. No commit adds a `workit knowledge lint`
|
|
51
|
+
finding. Never scaffold an empty file (`references/instruction-files.md`).
|
|
52
|
+
|
|
53
|
+
## Test sweep
|
|
54
|
+
|
|
55
|
+
Run `workit test-audit <paths> --json` over the suite or one hot spot and
|
|
56
|
+
report findings by module, worst first. On approval, the bad tests are
|
|
57
|
+
replaced (read the `workit-test-audit` skill's SKILL.md and follow it).
|
|
58
|
+
|
|
59
|
+
## Example
|
|
60
|
+
|
|
61
|
+
Bad: "The CLI is messy, so I split router.ts in five." Uncited, unapproved.
|
|
62
|
+
|
|
63
|
+
Good: "1. Check runner (check.ts, evidence.ts), 3 occurrences: commits a1b2c3
|
|
64
|
+
and d4e5f6 edit both for one fix; ledger row 41 is a `check` red on a hidden
|
|
65
|
+
timeout. Sketch: `runCheck(spec)` returns evidence, the timeout behind it, so
|
|
66
|
+
timeouts test without a shell. Two-way door, 2 callers in one package."
|
|
67
|
+
|
|
68
|
+
## Check
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
workit knowledge lint # no new finding after each instruction-files commit
|
|
72
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Instruction-files mode (AGENTS.md, CLAUDE.md)
|
|
2
|
+
|
|
3
|
+
Instruction files are paid for in every session that reads them. Restructure
|
|
4
|
+
them in three escalating passes. Each pass is its own commit in one PR, in
|
|
5
|
+
this order, so the user can keep pass 1 and drop pass 3. Run
|
|
6
|
+
`workit knowledge lint` before pass 1 and after every commit: no commit adds
|
|
7
|
+
a finding, and the lint exits 0 after the last pass, or the report lists the
|
|
8
|
+
findings that remain and why.
|
|
9
|
+
|
|
10
|
+
After each commit, run `workit check test`. A sentence a test pins stays,
|
|
11
|
+
unless the user approves changing that test. Commit each pass with
|
|
12
|
+
`workit git commit -m "<type>: <pass>" -- <paths>`, then open the PR
|
|
13
|
+
(read the `workit-ship` skill's SKILL.md and follow it).
|
|
14
|
+
|
|
15
|
+
Before pass 1, report the current byte counts and the plan for each pass, then
|
|
16
|
+
wait for approval. A pass with nothing to do is skipped and said so, not
|
|
17
|
+
padded.
|
|
18
|
+
|
|
19
|
+
## Pass 1: remove no-ops
|
|
20
|
+
|
|
21
|
+
Delete lines that would change no behavior if removed: "be thorough", "write
|
|
22
|
+
clean code", "follow best practices", restated defaults of the host, notes
|
|
23
|
+
about one past session, `path:line` references, and rules whose mistake a type,
|
|
24
|
+
lint or check now prevents. Nothing moves in this pass; it only deletes.
|
|
25
|
+
|
|
26
|
+
## Pass 2: progressive disclosure
|
|
27
|
+
|
|
28
|
+
Keep the root file to what every session needs: commands, workflow, and
|
|
29
|
+
"Read before <task>: <file>" pointers. Move topic detail (testing, release,
|
|
30
|
+
hosts, architecture) into topic files under an existing docs folder, one file
|
|
31
|
+
per topic, each opened by when to read it. Move text verbatim first; rewording
|
|
32
|
+
belongs in pass 1 or a later change. Every pointer from AGENTS.md or
|
|
33
|
+
CLAUDE.md must resolve (the lint's `broken-link` rule). The lint does not read
|
|
34
|
+
topic files: check their own links and content by hand.
|
|
35
|
+
|
|
36
|
+
## Pass 3: standards and checks
|
|
37
|
+
|
|
38
|
+
- A judgment rule a reviewer must weigh goes to `CODING_STANDARDS.md`; the
|
|
39
|
+
root file keeps one pointer to it.
|
|
40
|
+
- A mechanical rule (a forbidden import, a naming pattern, a file that must
|
|
41
|
+
exist) becomes a check instead of prose: a lint rule, a test, or a
|
|
42
|
+
configured `workit check <name>`. Show the check failing on a planted
|
|
43
|
+
violation, then delete the sentence.
|
|
44
|
+
- No rule lives in two files (`duplicate-rule`).
|
|
45
|
+
|
|
46
|
+
## Never
|
|
47
|
+
|
|
48
|
+
- Create a file without its first real entry in the same commit. The lint
|
|
49
|
+
flags a scaffolded `CODING_STANDARDS.md` or `GLOSSARY.md` (`scaffold-file`);
|
|
50
|
+
for a topic file, that check is yours.
|
|
51
|
+
- Squash the passes into one commit, or mix a behavior change into them.
|
|
52
|
+
- Grow the root file past the lint's byte budget (`agents-budget`).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Deepening vocabulary
|
|
2
|
+
|
|
3
|
+
Use these words exactly in every candidate. Do not drift into "component",
|
|
4
|
+
"service", "API" or "boundary".
|
|
5
|
+
|
|
6
|
+
| Term | Meaning |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| Module | Anything with an interface and an implementation: a function, a file, a package, a slice across tiers |
|
|
9
|
+
| Interface | Everything a caller must know: types, invariants, ordering, error modes, configuration, cost |
|
|
10
|
+
| Depth | Behavior a caller or test reaches per unit of interface learned. Deep: much behind little. Shallow: the interface is nearly as complex as the implementation |
|
|
11
|
+
| Seam | Where behavior can change without editing that place; where an interface lives |
|
|
12
|
+
| Adapter | A concrete thing that fills a seam (production, in-memory, fake) |
|
|
13
|
+
| Leverage | What callers gain from depth: one implementation pays back across many call sites and tests |
|
|
14
|
+
| Locality | What maintainers gain: change, bugs and verification concentrate in one place |
|
|
15
|
+
|
|
16
|
+
## Tests to run on a suspect
|
|
17
|
+
|
|
18
|
+
- **Deletion test.** Imagine deleting the module. Complexity vanishes: it was
|
|
19
|
+
a pass-through, so inline it. Complexity reappears across callers: it earns
|
|
20
|
+
its keep. A deepening concentrates complexity; it does not just move it.
|
|
21
|
+
- **Interface is the test surface.** Tests that must reach past the interface
|
|
22
|
+
mean the module has the wrong shape.
|
|
23
|
+
- **One adapter is a hypothetical seam; two are a real one.** Do not add a
|
|
24
|
+
port unless something varies across it (production and test count).
|
|
25
|
+
|
|
26
|
+
## What the explorer looks for
|
|
27
|
+
|
|
28
|
+
- One concept that needs a hop through many small modules to understand.
|
|
29
|
+
- Shallow modules: wide interface, thin implementation.
|
|
30
|
+
- Pure helpers extracted only for tests while the bugs live in how they are
|
|
31
|
+
called (no locality).
|
|
32
|
+
- Coupled modules leaking through their seams: one fix edits both (churn shows
|
|
33
|
+
them changing together).
|
|
34
|
+
- Code that is untested, or hard to test through its current interface.
|
|
35
|
+
|
|
36
|
+
The explorer is read-only (on Claude Code, the Explore agent). It reads code,
|
|
37
|
+
git history, `workit ledger list` and `workit test-audit` output only: never
|
|
38
|
+
session transcripts and never another workspace. It copies no secret, token
|
|
39
|
+
or personal data into its findings. It returns only cited findings (file,
|
|
40
|
+
commit, ledger row), never a refactor.
|
|
41
|
+
|
|
42
|
+
## Dependency categories (how the deeper module is tested)
|
|
43
|
+
|
|
44
|
+
1. In-process (pure, in-memory): merge and test through the new interface.
|
|
45
|
+
2. Local stand-in exists (temp dir, in-memory store): test with the stand-in;
|
|
46
|
+
the seam stays internal.
|
|
47
|
+
3. Owned but remote (your own service): a port at the seam, an in-memory
|
|
48
|
+
adapter in tests.
|
|
49
|
+
4. Third party: an injected port, a fake adapter in tests.
|
|
50
|
+
|
|
51
|
+
Replace, do not layer. An old test on a shallow module is deleted only after
|
|
52
|
+
naming the break it catches and showing that a test at the deeper interface
|
|
53
|
+
fails on that planted break (read the `workit-test-audit` skill's SKILL.md and follow it). Until then it stays.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workit-bdd
|
|
3
|
+
description: Turn requirements into Given/When/Then scenarios, agree the test seam, and work test-first in vertical RED/GREEN slices. Use for BDD, TDD, acceptance criteria, scenarios, Given/When/Then, write a test first.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Behavior first: Given/When/Then
|
|
7
|
+
|
|
8
|
+
1. **Write the scenarios.** One behavior each, in the caller's words:
|
|
9
|
+
`Given <state>, When <action>, Then <observable result>`. Include the
|
|
10
|
+
unhappy paths callers depend on (denied, empty, invalid, timeout).
|
|
11
|
+
2. **Agree the seam.** The highest stable interface the scenario can be
|
|
12
|
+
observed through: a CLI verb, a public function, an HTTP route; ideally one
|
|
13
|
+
per feature. Do not test at a seam nobody agreed to. Note what each seam
|
|
14
|
+
catches and misses (a unit seam misses wiring; a CLI seam misses nothing
|
|
15
|
+
the user sees but runs slower) and cover each miss once, elsewhere.
|
|
16
|
+
3. **Name tests after scenarios.** The name is the Given/When/Then sentence;
|
|
17
|
+
the body is arrange, act, assert. Expected values come from the scenario (a
|
|
18
|
+
literal from a worked example, the spec, an external contract), never from
|
|
19
|
+
the code under test. No tautological tests: a test must fail if the
|
|
20
|
+
behavior breaks, never restate the implementation.
|
|
21
|
+
4. **Build in vertical slices, never horizontal ones** (every test first,
|
|
22
|
+
then every implementation: tests written ahead of any code assert guessed
|
|
23
|
+
internals). Write one vertical RED slice that fails for
|
|
24
|
+
the missing behavior and run it through the CLI so the failure is observed:
|
|
25
|
+
`workit check test`. Make the smallest change, run the same check GREEN,
|
|
26
|
+
then take the next scenario. Any edit makes the observation stale; re-run
|
|
27
|
+
before you claim it. A recorded "tests pass" is a note, and an ad-hoc
|
|
28
|
+
`workit check -- <cmd>` never satisfies the gate: only the configured
|
|
29
|
+
`test` check does. No `test` detected? Create `.workit/checks.json`, copying
|
|
30
|
+
in every check the repo already runs: once it exists it replaces the
|
|
31
|
+
detected defaults.
|
|
32
|
+
5. **Mock only at system boundaries:** network, clock, randomness, other
|
|
33
|
+
processes, sometimes the filesystem. Never the unit or its own
|
|
34
|
+
collaborators; use the real thing or an in-memory adapter behind a port.
|
|
35
|
+
6. **Gherkin only where the repo already uses it** (`.feature` files with
|
|
36
|
+
playwright-bdd, cucumber, jest-cucumber). Otherwise test names carry it.
|
|
37
|
+
|
|
38
|
+
Reject noise: version-pin assertions, tests that mirror private structure,
|
|
39
|
+
assertions inside a possibly-empty loop, smoke-only renders, duplicates. If a
|
|
40
|
+
test still passes when every imported function returns `undefined`, rewrite it;
|
|
41
|
+
the audit finds these (read the `workit-test-audit` skill's SKILL.md and follow it).
|
|
42
|
+
|
|
43
|
+
## Example
|
|
44
|
+
|
|
45
|
+
Bad: `test("calculateTotal works", () => expect(calculateTotal(items)).toBe(items.reduce((s, i) => s + i.price, 0)))`
|
|
46
|
+
|
|
47
|
+
Good: `test("Given two items of 5 and 10, When totalled, Then the total is 15", () => expect(calculateTotal([{ price: 5 }, { price: 10 }])).toBe(15))`
|
|
48
|
+
|
|
49
|
+
## Check
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
workit test-audit --diff && workit check test
|
|
53
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workit-continue
|
|
3
|
+
description: Keep work on track across interruptions and sessions - sort new input, checkpoint, hand off with a resume brief, and pick up by verifying inherited claims. Use for resume, pick up, handoff, new session, interruption, change of direction.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Continue without losing the thread
|
|
7
|
+
|
|
8
|
+
## New input mid-task
|
|
9
|
+
|
|
10
|
+
- **Quick question:** answer it; change nothing else.
|
|
11
|
+
- **Same-task adjustment:** update the affected constraint and next step, then
|
|
12
|
+
keep going.
|
|
13
|
+
- **Separate request:** do not silently resume an old objective, and do not
|
|
14
|
+
drop the current one. Checkpoint it (below) if it must continue later, then
|
|
15
|
+
start the new work. Held items stay parked with their resume condition until
|
|
16
|
+
the user resumes them.
|
|
17
|
+
|
|
18
|
+
## Checkpoint and hand off
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
workit git commit -m "wip: <state>" --all # nothing lives only in your context
|
|
22
|
+
workit handoff --note "<state in one line>" --next "<next command>" --record
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The brief carries the branch, HEAD, dirty state, check freshness, verdict,
|
|
26
|
+
rulings and the next command. Add only what it cannot know: choices still
|
|
27
|
+
open, approaches that failed and why. Work spanning repos gets one brief per
|
|
28
|
+
checkout, each with its branch and delivery endpoint. Notes too long for
|
|
29
|
+
`--note` go in a file under `workit dir handoffs`; name its path in the note.
|
|
30
|
+
|
|
31
|
+
## Pick up
|
|
32
|
+
|
|
33
|
+
1. In the checkout: `workit handoff`, then `workit ledger list` and
|
|
34
|
+
`git log --oneline -10`.
|
|
35
|
+
2. Trust the trail, verify the claims: re-run the checks the brief calls
|
|
36
|
+
stale, and confirm each "done" item against the goal on the real artifact
|
|
37
|
+
(a pushed SHA, a PR state, a running feature). Do not re-derive settled
|
|
38
|
+
decisions.
|
|
39
|
+
3. Continue to the recorded endpoint with the brief's next command.
|
|
40
|
+
|
|
41
|
+
## Example
|
|
42
|
+
|
|
43
|
+
Bad: a new session re-reads the whole codebase, re-asks the user which
|
|
44
|
+
approach to take, and redoes a finished slice.
|
|
45
|
+
|
|
46
|
+
Good: "`workit handoff`: feature/usage at 4be1, `test` stale, verdict none,
|
|
47
|
+
next `workit check test`. Re-ran it: exit 0. The brief says PR #42 is open:
|
|
48
|
+
`workit pr status` confirms, CI pending. Continuing to ship (read the `workit-ship` skill's SKILL.md and follow it)."
|
|
49
|
+
|
|
50
|
+
## Check
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
workit handoff # read: "next command" is set and no check is listed as stale
|
|
54
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workit-debug
|
|
3
|
+
description: Find a root cause before patching - start from a red-capable deterministic repro, rank hypotheses, bisect regressions, fix at the root with a regression test. Use for bug, broken, failing, flaky, regression, error, why does.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Debug from a red loop
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. **Build the loop before any hypothesis.** One command that is red for the
|
|
11
|
+
user's exact symptom, deterministic, fast and runnable by you:
|
|
12
|
+
`workit check -- <repro>`. Shrink it until it fails in seconds. If the
|
|
13
|
+
symptom only shows on the running app, drive it with the project's
|
|
14
|
+
verify-<app> skill. No loop yet? Building it is the task; do not guess-patch.
|
|
15
|
+
2. **Read the failure, not the summary:** the full error, the failing value,
|
|
16
|
+
and every caller on its path.
|
|
17
|
+
3. **Rank three to five falsifiable hypotheses**, likeliest first. Test one at
|
|
18
|
+
a time with the loop or a tagged log line (`[DEBUG-<id>]`, removed at the
|
|
19
|
+
end with one grep). Keep a short hypothesis log so a dead idea stays dead.
|
|
20
|
+
4. **Regression? Bisect it:** `git bisect start <bad> <good>` then
|
|
21
|
+
`git bisect run <repro>`. The first bad commit names the cause.
|
|
22
|
+
5. **Fix at the root**, the one place every failing caller passes through.
|
|
23
|
+
Add a regression test at a seam that exercises the real bug pattern; if no
|
|
24
|
+
such seam exists, report that as a finding.
|
|
25
|
+
6. **Stop rule:** after three dead hypotheses, write down what is measured and
|
|
26
|
+
what is inferred, widen the loop, or ask for the one fact only the user has.
|
|
27
|
+
|
|
28
|
+
Every shipped line traces to evidence from the loop. A "might help" retry or
|
|
29
|
+
guard is a hypothesis, not a fix.
|
|
30
|
+
|
|
31
|
+
## Example
|
|
32
|
+
|
|
33
|
+
Bad: "Probably a race; added a retry." (no repro, nothing measured)
|
|
34
|
+
|
|
35
|
+
Good: "Repro: `workit check -- bun test lock.test.ts -t stale` red 10/10.
|
|
36
|
+
H1 dead pid not reclaimed - confirmed: `kill(pid, 0)` throws EPERM for another
|
|
37
|
+
user's pid and we treated it as dead. Fix: EPERM means alive. Loop green 10/10;
|
|
38
|
+
regression test pins the EPERM case."
|
|
39
|
+
|
|
40
|
+
## Check
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
workit check -- <repro> # red before the fix, green after
|
|
44
|
+
workit check test
|
|
45
|
+
```
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workit-deslop
|
|
3
|
+
description: Remove AI slop before a PR - dead code, comments that restate the code, filler prose - with a minimal diff and identical behavior. Use for deslop, clean up, slop, tidy before PR, remove dead code, trim the PR body.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Deslop code and prose
|
|
7
|
+
|
|
8
|
+
Deslop removes; it never changes behavior. Its depth follows the review lane.
|
|
9
|
+
|
|
10
|
+
1. **Scan first, no agent:** `workit deslop scan --diff [<base>] --json`. It
|
|
11
|
+
classes each added comment `narration`, `marker` (TODO, FIXME, HACK),
|
|
12
|
+
`suppression` (a lint or type disable with no reason), `debug` (stray logs,
|
|
13
|
+
`debugger`, `[DEBUG-` tags) or `allowed`, runs `test-audit` on changed
|
|
14
|
+
tests, and prints the lane and its passes. A marker or a lint/type
|
|
15
|
+
suppression raises `self` to `focused`.
|
|
16
|
+
2. **Run the lane's passes** (each lane adds to the one below):
|
|
17
|
+
- `none` (docs only): prose. Cut filler and hedging from the PR body and
|
|
18
|
+
docs; keep real symbol names and before-to-after numbers.
|
|
19
|
+
- `self`: delete every narration, marker and debug finding, plus dead code
|
|
20
|
+
from the repo's tools (`knip`, `ts-prune`, `vulture`, unused-lint rules).
|
|
21
|
+
- `focused`: a fresh-eyes no-comments pass and a test-quality lens. Hand
|
|
22
|
+
the diff, never your verdict, to a fresh reviewer: Claude Code and Codex,
|
|
23
|
+
the `reviewer` agent; OpenCode, a child session; Cursor, a Task subagent
|
|
24
|
+
marked `ROLE: reviewer`; Pi, a supervised worker. It deletes every added
|
|
25
|
+
comment off the keep list and triages `workit test-audit --diff`
|
|
26
|
+
(read the `workit-test-audit` skill's SKILL.md and follow it).
|
|
27
|
+
- `full`: also `workit test-audit --mutate --diff` and one architect
|
|
28
|
+
sketch of the simpler shape, reported, not applied.
|
|
29
|
+
3. **The keep list** (everything else goes): a licence header, an external
|
|
30
|
+
quirk (a library, OS or spec behaving oddly), `prettier-ignore` and other
|
|
31
|
+
tool directives, a lint suppression with its reason (`-- <why>`), public
|
|
32
|
+
API docs, an issue or RFC link.
|
|
33
|
+
4. **No workaround comments for our own code.** Fix the root in a separate
|
|
34
|
+
`refactor:` commit, or open an issue that carries the explanation and
|
|
35
|
+
delete the comment. A "do not remove" note becomes a test, a type or a
|
|
36
|
+
lint rule.
|
|
37
|
+
5. **Record one line per PR** when checks pass again:
|
|
38
|
+
`workit deslop result --removed <n> --reshapes <n> --open <n>` writes
|
|
39
|
+
`deslop: lane focused, -42 lines, 3 reshapes, 1 open` to the ledger.
|
|
40
|
+
Nothing to clean is a valid result (`--removed 0`). When a tracked task
|
|
41
|
+
lists a `pre-pr-cleanup` requirement (≤6.x tasks), this is its evidence.
|
|
42
|
+
|
|
43
|
+
## Example
|
|
44
|
+
|
|
45
|
+
Bad: keeping `// increment the counter` above `count += 1`, or deleting
|
|
46
|
+
`// eslint-disable-next-line no-await-in-loop -- the API rate-limits parallel calls`.
|
|
47
|
+
|
|
48
|
+
Good: the scan lists 6 narration, 1 marker and 1 bare `oxlint-disable`; the
|
|
49
|
+
lane rises to focused; narration and the marker go, the disable gains its
|
|
50
|
+
reason, a fresh reviewer drops two more comments, and a call-order assertion
|
|
51
|
+
on an internal mock becomes a result assertion:
|
|
52
|
+
`deslop: lane focused, -42 lines, 1 reshapes, 0 open`.
|
|
53
|
+
|
|
54
|
+
## Check
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
workit deslop scan --diff && workit check test && workit deslop result --removed <n>
|
|
58
|
+
```
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workit-fanout
|
|
3
|
+
description: Run independent slices in parallel - one worker per isolated worktree with a fixed brief and file-scope manifest, a non-author verifier per slice, results in the ledger. Use for fan out, parallelize, parallel agents, split the work, delegate, swarm.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Fan out parallel workers
|
|
7
|
+
|
|
8
|
+
Inline-first (workspace `delegation`): fan out only past a threshold, named as
|
|
9
|
+
each slice's `reason` (explore, parallel, backstop, high-risk-verify): an
|
|
10
|
+
explorer past ~3 tool calls or 10k tokens; parallel writers only for 2+ disjoint
|
|
11
|
+
units of ~100+ lines each. Coupled work stays with one owner. Workit never spawns.
|
|
12
|
+
|
|
13
|
+
1. **Plan the slices** (read the `workit-shape` skill's SKILL.md and follow it) in a plan file under `workit dir plans`
|
|
14
|
+
(`references/brief.md`): per slice an id, branch, REASON, TIER, SCOPE globs,
|
|
15
|
+
`owns` for shared files, `dependsOn` only for a real dependency, and the brief
|
|
16
|
+
fields. `workit fanout plan <plan.json>` refuses an empty or placeholder brief
|
|
17
|
+
field (exit 2) and two slices that may write one file (exit 3) with a fix; apply it and re-run:
|
|
18
|
+
refuse to spawn while a field is empty or the plan is refused. One PR per
|
|
19
|
+
slice is the default; `"fanIn": "integration"` only when the user wants one
|
|
20
|
+
PR (`references/orchestration.md`).
|
|
21
|
+
2. **Record standing orders** (`workit ledger standing add "<order>"`): every
|
|
22
|
+
user directive all workers share. Directives decay across resumes.
|
|
23
|
+
3. **Brief each worker verbatim**: `workit fanout worktree create <slice>`
|
|
24
|
+
(every host), then `workit fanout brief <slice>` (WORKTREE, SCRATCH, rules).
|
|
25
|
+
Never hand-edit it; change the plan or the standing orders and render again.
|
|
26
|
+
4. **Spawn in a rolling window**, in the background, each in its own worktree:
|
|
27
|
+
keep 4-6 in flight and refill from `spawnable` in `workit fanout status` as
|
|
28
|
+
each one finishes. Assign before spawn (OpenCode: `workit worker assign`); each prompt carries
|
|
29
|
+
the brief, or a pointer: its `WORKER`, `TIER`, `TIMEBOX` and `WORKTREE` lines plus "run `workit fanout brief <slice>` and follow it"
|
|
30
|
+
(budget and model hooks read those lines), so batched OpenCode launches each bind their worker.
|
|
31
|
+
Model: the brief's `model:` and `effort:` lines (`workit models show`), else TIER (`references/orchestration.md`).
|
|
32
|
+
Claude Code: the `implementer` agent; its spawn hook drops `isolation` and refuses a prompt without a WORKTREE line.
|
|
33
|
+
5. **Judge liveness by side effects only:** `workit fanout status` (head age,
|
|
34
|
+
PR, CI, verdict, landed; STUCK past the TIMEBOX). Stop a stuck worker and
|
|
35
|
+
observe that it exited (a timeout is not proof); stop a finished one when its
|
|
36
|
+
report arrives (Claude Code: TaskStop). Never two live workers on one branch.
|
|
37
|
+
Removing a worktree drops its uncommitted changes: `workit fanout worktree
|
|
38
|
+
release <slice>` records `git status` in the ledger and refuses without `--force`.
|
|
39
|
+
6. **Retry once, then escalate.** A stuck or failed slice gets one retry with
|
|
40
|
+
a fresh brief (`workit fanout brief <slice> --mode resume`, same branch);
|
|
41
|
+
if that fails too, re-slice it, take it over, or report the gap. Never
|
|
42
|
+
chain resumes. A fix round and recheck that both fail: a decider, not a
|
|
43
|
+
third round; product choices go to the user (`references/orchestration.md`).
|
|
44
|
+
7. **Verify by the workspace `verification` setting** (`workit grant show`).
|
|
45
|
+
A report is a pointer, never evidence. `proportional` (default): each slice's lane (`workit pr status`) decides; none needs no verdict, self the author's `--self`, focused and full a verifier (Claude Code: the `model` and `effort` of `workit models show --role verifier`) after the last push; one verdict at a stack's top covers its unchanged lower PRs, and a stale one with `reverify: focused` re-checks only the new diff, reusing green CI. `self`: a verifier that wrote none
|
|
46
|
+
of the slices, or you if you wrote none. `independent` or high risk: a
|
|
47
|
+
separate verifier session, never yours (doctrine: the ledger only refuses
|
|
48
|
+
authors). One verifier may take a batch of slices, one verdict per branch
|
|
49
|
+
(`workit ledger verdict <result> --branch <b> --how "<evidence>"`), in a
|
|
50
|
+
session never chosen by the author. Spawn it with the brief's `verifier:` model (`workit models show --role verifier`). A review panel on separate models only at high risk.
|
|
51
|
+
8. **Fan in** with `workit fanout check`: out-of-scope files (any file outside
|
|
52
|
+
it stops the fan-in) and `git merge-tree` conflicts with trunk and between
|
|
53
|
+
siblings. Fix what it names until it exits 0; a merged slice reads as
|
|
54
|
+
landed. Then `workit ledger check --branch <b>` per slice, land in `fanout
|
|
55
|
+
status` order, release the worktrees you made, and `workit ledger standing
|
|
56
|
+
clear`. Only you touch topology: workers never rebase, retarget or merge,
|
|
57
|
+
except the integration-tip merge in integration mode. Then ship
|
|
58
|
+
(read the `workit-ship` skill's SKILL.md and follow it) up to `defaultEndpoint` from `workit grant show`.
|
|
59
|
+
|
|
60
|
+
## Example
|
|
61
|
+
|
|
62
|
+
Bad brief: "Do the API part and add tests." (no scope, acceptance or verify command: nobody can tell when it is done)
|
|
63
|
+
|
|
64
|
+
Good brief: the output of `workit fanout brief usage-endpoint` (`references/brief.md` shows one).
|
|
65
|
+
|
|
66
|
+
## Check
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
workit fanout check # exit 0: in scope, no conflicts, landing order printed
|
|
70
|
+
workit ledger check --branch <b> # per slice: accepted (current, passing, independent)
|
|
71
|
+
```
|