@pmelab/gtd 29.3.1 → 30.1.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 (54) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +64 -63
  3. package/claude/hooks/register.tsx +5 -0
  4. package/dist/chunks/{reserved-Dmpg6dAp.mjs → reserved-DDiiAZ8U.mjs} +35 -239
  5. package/dist/chunks/{tail-CLyE5VFR.mjs → tail-ILPlELuy.mjs} +1 -1
  6. package/dist/gtd.bundle.mjs +0 -5
  7. package/dist/testkit.mjs +0 -5
  8. package/dist/workflows/cleanup.mjs +2 -2
  9. package/dist/workflows/feature.mjs +17 -182
  10. package/dist/workflows/fix.mjs +2 -2
  11. package/dist/workflows/review.mjs +2 -2
  12. package/dist/workflows/rollout.mjs +1 -1
  13. package/dist/workflows.mjs +47 -416
  14. package/package.json +1 -1
  15. package/skills/authoring/SKILL.md +15 -27
  16. package/src/cli/Cli.test.ts +6 -6
  17. package/src/edge/Edge.test.ts +7 -7
  18. package/src/flags/index.test.ts +0 -4
  19. package/src/flags/index.ts +0 -1
  20. package/src/workflow/load.test.ts +1 -1
  21. package/src/workflows/feature/fast-path.feature +1 -2
  22. package/src/workflows/feature/feature.test.ts +115 -63
  23. package/src/workflows/feature/feature.ts +21 -38
  24. package/src/workflows/feature/flag-mode.feature +157 -0
  25. package/src/workflows/feature/index.ts +0 -1
  26. package/src/workflows/feature/one-step-land.feature +4 -6
  27. package/src/workflows/feature/planning.ts +2 -27
  28. package/src/workflows/feature/refactor-absorbs.feature +1 -2
  29. package/src/workflows/feature/refactor-first.feature +1 -3
  30. package/src/workflows/feature/refactor-review.feature +0 -1
  31. package/src/workflows/feature/risk-tier.feature +2 -3
  32. package/src/workflows/feature/seam-rejection.feature +1 -3
  33. package/src/workflows/feature/seam.feature +4 -6
  34. package/src/workflows/feature/seam.ts +2 -0
  35. package/src/workflows/feature/steps.test.ts +0 -20
  36. package/src/workflows/feature/steps.ts +1 -49
  37. package/src/workflows/feature/{seam-pin.feature → tier-pin.feature} +17 -11
  38. package/src/workflows/feature/tier.test.ts +3 -5
  39. package/src/workflows/feature/tier.ts +2 -2
  40. package/src/workflows/index.ts +0 -1
  41. package/src/workflows/shared/access.test.ts +0 -2
  42. package/src/workflows/shared/access.ts +0 -2
  43. package/src/workflows/shared/options.test.ts +14 -3
  44. package/src/workflows/shared/options.ts +17 -2
  45. package/src/workflows/shared/prose.ts +4 -11
  46. package/src/workflows/shared/reserved.ts +2 -2
  47. package/src/workflows/shared/skills.test.ts +0 -11
  48. package/src/workflows/shared/skills.ts +2 -9
  49. package/src/workflows/shared/steps.ts +0 -1
  50. package/src/workflows/shared/text.test.ts +20 -104
  51. package/src/workflows/shared/text.ts +28 -229
  52. package/src/workflows/shared/vars.ts +2 -3
  53. package/src/workflows/feature/packages.test.ts +0 -368
  54. package/src/workflows/feature/packages.ts +0 -173
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtd",
3
- "version": "29.3.1",
3
+ "version": "30.1.0",
4
4
  "description": "Drive the gtd loop inside Claude Code: agent turns run as subagents, gtd decides every beat",
5
5
  "author": {
6
6
  "name": "Philipp Melab"
package/README.md CHANGED
@@ -74,8 +74,8 @@ autonomously run the process for you. Ask your agent if you have any questions.
74
74
  misreading it — see
75
75
  [History format](https://github.com/pmelab/gtd/blob/main/docs/configuration.md#history-format).
76
76
  - **Files, not chat.** Conversation lives in files like `REQUIREMENTS.md` or
77
- `ARCHITECTURE.md`. Request changes by editing them, approve by leaving the
78
- tree clean — all in your own editor. There is no chat UI that could flicker.
77
+ `REVIEW.md`. Request changes by editing them, approve by leaving the tree
78
+ clean — all in your own editor. There is no chat UI that could flicker.
79
79
  - **Harness agnostic.** gtd emits prompts to stdout (or JSON). Claude Code, a
80
80
  bash loop, a CI job, or you reading it out loud to your sentient cat — the
81
81
  workflow doesn't care who executes it.
@@ -355,12 +355,12 @@ stack down from its worktree, delete the top branch with
355
355
  process can change hands at any gate: ask Claude to hand it off (or run
356
356
  `/gtd throw @dev`) and it opens a draft pull request assigned to them, and
357
357
  `/gtd catch <pr>` picks it up exactly where it waits, so whoever wrote the
358
- requirements can hand the architecture to someone else. Ship, hand-off and throw
359
- answer at once and run in the background, with progress on the status line; they
360
- report by waking Claude, a toast, a transcript line and a push notification, and
361
- a failed push or `gh` call reports as a failure. While a ship or hand-off runs
362
- or is queued, `/gtd catch`, the doors, `/gtd <requirements>` and bare `/gtd`
363
- wait for its report. See
358
+ requirements can hand the build to someone else. Ship, hand-off and throw answer
359
+ at once and run in the background, with progress on the status line; they report
360
+ by waking Claude, a toast, a transcript line and a push notification, and a
361
+ failed push or `gh` call reports as a failure. While a ship or hand-off runs or
362
+ is queued, `/gtd catch`, the doors, `/gtd <requirements>` and bare `/gtd` wait
363
+ for its report. See
364
364
  [Inside Claude Code](https://github.com/pmelab/gtd/blob/main/docs/driver.md#inside-claude-code-the-gtd-mod).
365
365
 
366
366
  ### Then let an agent build your own
@@ -411,36 +411,27 @@ noted in steps 3 and 4 below.
411
411
  1. **You sketch.** Change anything, or write the idea into `.gtd/TODO.md`. Rough
412
412
  is fine; it is treated as a sketch, not as work.
413
413
  2. **You answer questions and discuss.** Planning works out what the thing
414
- should do first, then how it should be built, and hands you a file at either
415
- point — every process stops there, even with no open question. Answer open
416
- questions in your editor, in the file, and start the loop again; a round that
417
- only leaves notes needs no tick. Start a footnote with `- H: <question>` to
418
- ask something: the agent replies with `- A: <reply>` and the process stops at
419
- the same gate again. Close a thread by replying with a conclusion or deleting
420
- it. While a thread's last entry is the agent's, moving on is refused. Leave
421
- the file untouched and start the loop to accept the plan as-is, unanswered
422
- questions and all. Every plan gets the technical pass: its document has four
423
- sections, in order — `## Interfaces`, `## Call Stacks`, `## E2E Scenarios`,
424
- `## Unit Tests` — behind a leading `## Open Questions` when there are any.
425
- `## E2E Scenarios` is never empty: it names each user-visible behaviour in
426
- plain words (the builder writes the scenario itself), or, when nothing
427
- user-visible changes, the line `No e2e change.` with a one-line reason.
428
-
429
- 3. **You wait.** The work is split into vertical slices and built one at a time,
430
- each one starting from the unit and e2e tests it declares (a build turn
431
- missing one is refused; a test the package only relies on is marked
432
- `(unchanged)`; it must exist before the turn, and the build turn must not
433
- create, edit or delete it — a wrong marker is fixed upstream, in the plan,
434
- and a process stuck on one is ended with `gtd abandon`; and a package whose
435
- work lies outside the repository, such as filing issues, closes on recorded
436
- evidence), checked against the full suite (`testCommand`) and fixed until it
437
- passes before moving on — so keep that suite fast; gtd has no lighter one.
438
- Scenario wording is not frozen: you sign the scenarios off once, in the
439
- review's `## Scenarios` chunk, where any assertion an existing scenario lost
440
- is marked `Weakened:`. After the last package the quality lap runs. Two
441
- points along the process are judged rather than always asking you outright —
442
- each stops and hands you a verdict to make (`gtd judge answer`, or land with
443
- a clean tree to accept the conservative default, which never skips work;
414
+ should do and hands you `.gtd/REQUIREMENTS.md` — every process stops there,
415
+ even with no open question. Answer open questions in your editor, in the
416
+ file, and start the loop again; a round that only leaves notes needs no tick.
417
+ Start a footnote with `- H: <question>` to ask something: the agent replies
418
+ with `- A: <reply>` and the process stops at the same gate again. Close a
419
+ thread by replying with a conclusion or deleting it. While a thread's last
420
+ entry is the agent's, moving on is refused. Leave the file untouched and
421
+ start the loop to accept the plan as-is, unanswered questions and all.
422
+
423
+ 3. **You wait.** The agent first implements the requirements the quickest way
424
+ that works — the naive pass — and a judge reads where it changed code (see
425
+ [the naive pass](#the-naive-pass) below; with [flag mode](#the-naive-pass)
426
+ off, neither runs). Then the change is built test-first, checked against the
427
+ full suite (`testCommand`) and fixed until it passes — so keep that suite
428
+ fast; gtd has no lighter one. Scenario wording is not frozen: you sign the
429
+ scenarios off once, in the review's `## Scenarios` chunk, where any assertion
430
+ an existing scenario lost is marked `Weakened:`. After the build the quality
431
+ lap runs. Three points along the process (two with flag mode off) are judged
432
+ rather than always asking you outright — each stops and hands you a verdict
433
+ to make (`gtd judge answer`, or land with a clean tree to accept the
434
+ conservative default, which never skips work;
444
435
  `gtd judge run --provider fixed --answers <path>` — or the
445
436
  `GTD_JUDGE_ANSWERS` env var, inline JSON — answers one from a file, piped
446
437
  between `gtd judge --json` and `gtd judge answer`;
@@ -455,6 +446,8 @@ noted in steps 3 and 4 below.
455
446
  choose the judge without editing the driver (flags win over both, in that
456
447
  order); `--model` with `--provider fixed`/`jev` is refused. jev and llm exit
457
448
  1 with nothing on stdout when they cannot answer every question):
449
+ - After the naive pass: does it land as is, need its seam refactored first,
450
+ or get rejected and retried?
458
451
  - Every red round after the first: was the failure identical, new, or
459
452
  progress?
460
453
  - After you review: is each of your notes an edit, a question, a nit or
@@ -469,8 +462,8 @@ noted in steps 3 and 4 below.
469
462
  measured probability, so a confidently wrong verdict can clear the 0.7 floor
470
463
  and skip a gate unattended.**
471
464
 
472
- Once the last package is built, the whole change goes through a qualitative
473
- review lap before you see anything: six lenses, one turn each, in order —
465
+ Once the change is built, the whole change goes through a qualitative review
466
+ lap before you see anything: six lenses, one turn each, in order —
474
467
  `correctness`, `owasp-security`, `ponytail-review`, `test-audit`,
475
468
  `conventions`, `spec-challenge`. Each traces the change from its own angle
476
469
  and records every finding, blocking or not; one fix turn then fixes ALL of
@@ -497,14 +490,14 @@ noted in steps 3 and 4 below.
497
490
  you unfixed; risk: a fix lands with no check that the risk was real. Tick the
498
491
  boxes to approve, or write what is wrong. Approving ends the process;
499
492
  feedback is judged note by note, each as `edit`, `question`, `nit` or
500
- `praise`. An `edit` sends the process back to step 2 for a fresh plan — it
501
- never patches over a design you rejected. A `question` is answered inline
502
- under your note and the process stops at the review again — no new plan. A
503
- `nit` is fixed in one batch, the suite must go green (a red one gets fix
504
- turns first), then a fresh review of the change stops at the review again.
505
- `praise` is dropped; a round of only praise signs off. When a round mixes
506
- them, questions are answered and nits fixed first, then the edits are planned
507
- — risk: the planning lap may redo nit fixes it touches.
493
+ `praise`. An `edit` sends the process back to step 2 for re-derived
494
+ requirements, and the implementation is amended to meet them. A `question` is
495
+ answered inline under your note and the process stops at the review again —
496
+ no new plan. A `nit` is fixed in one batch, the suite must go green (a red
497
+ one gets fix turns first), then a fresh review of the change stops at the
498
+ review again. `praise` is dropped; a round of only praise signs off. When a
499
+ round mixes them, questions are answered and nits fixed first, then the edits
500
+ are planned — risk: the planning lap may redo nit fixes it touches.
508
501
 
509
502
  Each `edit` note also gets a severity tier from four judge questions
510
503
  (security, reversibility, blast radius, new concept). `critical` and `should`
@@ -523,8 +516,8 @@ noted in steps 3 and 4 below.
523
516
 
524
517
  You never talk to it. Every exchange is a file in `.gtd/` that you edit in your
525
518
  own editor, and every answer you give is a commit. Your test suite is the gate
526
- throughout: a red baseline stops the process before it starts, and a red package
527
- is fixed before the next one begins.
519
+ throughout: a red baseline stops the process before it starts, and a red build
520
+ is fixed before review.
528
521
 
529
522
  Prefer a phone or another device over your editor? `gtd ui` opens the file whose
530
523
  turn it is as a small web app, over Tailscale — including a step that names no
@@ -584,11 +577,12 @@ unknown key. `gtd.config.ts` is the only repository config: gtd 23 removed the
584
577
  home directory — fails every command until you delete it. See
585
578
  [Migrating from `.gtdrc`](https://github.com/pmelab/gtd/blob/main/docs/configuration.md#migrating-from-gtdrc).
586
579
 
587
- **Naive pass (flag `GTD_FLAG_NAIVE_PASS=1`, off by default).** Instead of an
588
- architecture and package files, the agent first implements the requirements
589
- directly. A judge checks whether it changed anything outside the expected set
590
- (tests, steering files; see `seamAllow`). Incidental changes land; a needed seam
591
- change is refactored first, in its own slice with its own quality lap
580
+ #### The naive pass
581
+
582
+ After design the agent first implements the requirements directly. A judge
583
+ checks whether it changed anything outside the expected set (tests, steering
584
+ files; see `seamAllow`). Incidental changes land; a needed seam change is
585
+ refactored first, in its own slice with its own quality lap
592
586
  (`refactorQualityReviews`) and review, before the feature is implemented and
593
587
  reviewed; a wrong approach is retried twice, then rests for you to steer or
594
588
  overrule it. `gtd slices` lists the `refactor` and `feature` slices. A refactor
@@ -602,14 +596,21 @@ out is `gtd abandon`. A process from 27.5.0 or later whose judge ruled
602
596
  that slice. Details in
603
597
  [the naive-pass path](docs/configuration.md#the-naive-pass-path).
604
598
 
605
- **Risk tier (flag `GTD_FLAG_RISK_TIER=1`, off by default, needs
606
- `GTD_FLAG_NAIVE_PASS=1`).** Triage proposes a risk tier, `low` or `high`, and
607
- the production signals to watch after merge. Edit the first word under
608
- `## Risk Tier` at the design gate to change it; a missing or unreadable tier
609
- means `high`. Each lap lands a `Gtd-Mark: risk-tier=<low|high>` trailer and a
610
- `Gtd-Mark: production-signal=…` trailer per signal; `gtd summary` reads the last
611
- lap's only. Its "needs a human reviewer" line for `high` is advisory, not a
612
- gate.
599
+ **Flag mode (`flagMode`, on by default).** On, the implementation is asked for a
600
+ new release flag (none at a `low` risk tier) and the naive pass and its judge
601
+ run as above. A project that is not publicly released turns it off explicitly —
602
+ `feature({ flagMode: false })` in `gtd.config.ts`, it is never detected: then no
603
+ flag is asked for, no seam judge or refactor runs, and the implementation is the
604
+ naive version, straight through the health loop and the quality lap. See
605
+ [`flagMode`](docs/configuration.md#the-bundled-workflows-settings).
606
+
607
+ **Risk tier (flag `GTD_FLAG_RISK_TIER=1`, off by default).** Triage proposes a
608
+ risk tier, `low` or `high`, and the production signals to watch after merge.
609
+ Edit the first word under `## Risk Tier` at the design gate to change it; a
610
+ missing or unreadable tier means `high`. Each lap lands a
611
+ `Gtd-Mark: risk-tier=<low|high>` trailer and a `Gtd-Mark: production-signal=…`
612
+ trailer per signal; `gtd summary` reads the last lap's only. Its "needs a human
613
+ reviewer" line for `high` is advisory, not a gate.
613
614
 
614
615
  A `gtd.config.ts` call to `buildTail` or `tail` that fits neither call form is
615
616
  rejected; `tail`'s positional form is deprecated for `tail(finish, options?)`.
@@ -993,6 +993,11 @@ export const register: Register = (on) => {
993
993
  return next(e)
994
994
  })
995
995
 
996
+ // A worker's tool call hands settings hooks the MAIN session's
997
+ // `transcript_path`, marked only by `agent_id`/`agent_type`; its own
998
+ // transcript (`agent_transcript_path`) is named only at SubagentStop, too
999
+ // late to measure a running worker's context.
1000
+ //
996
1001
  // The loop lands a turn when it ends; work left running in the background
997
1002
  // would still be writing the tree gtd is committing.
998
1003
  on("tool.call", async ($, e, next) => {