@pmelab/gtd 28.1.0 → 29.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 (54) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +28 -17
  3. package/claude/hooks/assist.ts +1 -1
  4. package/claude/hooks/register.tsx +1 -1
  5. package/claude/hooks/ship.ts +963 -143
  6. package/dist/chunks/{reserved-DeBS4Ymh.mjs → reserved-DoHUII2D.mjs} +206 -121
  7. package/dist/chunks/{tail-B2SER2Ih.mjs → tail-C6YBG5zh.mjs} +19 -12
  8. package/dist/testkit.mjs +2 -1
  9. package/dist/workflow-kit.mjs +51 -21
  10. package/dist/workflows/cleanup.mjs +2 -2
  11. package/dist/workflows/feature.mjs +247 -96
  12. package/dist/workflows/fix.mjs +2 -2
  13. package/dist/workflows/review.mjs +2 -2
  14. package/dist/workflows/rollout.mjs +1 -1
  15. package/dist/workflows.mjs +528 -262
  16. package/package.json +1 -1
  17. package/src/testkit/TestRepo.ts +3 -0
  18. package/src/testkit/index.ts +1 -1
  19. package/src/testkit/steps.ts +44 -0
  20. package/src/workflow-kit/review.test.ts +366 -8
  21. package/src/workflow-kit/review.ts +109 -26
  22. package/src/workflows/feature/feature.test.ts +313 -1
  23. package/src/workflows/feature/feature.ts +48 -43
  24. package/src/workflows/feature/one-step-land.feature +4 -0
  25. package/src/workflows/feature/refactor-first.feature +54 -24
  26. package/src/workflows/feature/refactor-review.feature +1706 -0
  27. package/src/workflows/feature/refactor.test.ts +592 -2
  28. package/src/workflows/feature/refactor.ts +160 -42
  29. package/src/workflows/feature/review.test.ts +322 -5
  30. package/src/workflows/feature/review.ts +77 -10
  31. package/src/workflows/feature/seam-rejection.feature +4 -0
  32. package/src/workflows/feature/seam.feature +3 -4
  33. package/src/workflows/feature/seam.test.ts +196 -1
  34. package/src/workflows/feature/seam.ts +23 -9
  35. package/src/workflows/feature/steps.test.ts +54 -2
  36. package/src/workflows/feature/steps.ts +45 -9
  37. package/src/workflows/feature/tier.test.ts +4 -0
  38. package/src/workflows/feature/tier.ts +2 -20
  39. package/src/workflows/shared/__fixtures__/feature-collecting-prompt.txt +97 -0
  40. package/src/workflows/shared/access.test.ts +31 -1
  41. package/src/workflows/shared/access.ts +7 -1
  42. package/src/workflows/shared/fences.ts +19 -0
  43. package/src/workflows/shared/health.ts +32 -12
  44. package/src/workflows/shared/options.test.ts +18 -0
  45. package/src/workflows/shared/options.ts +1 -0
  46. package/src/workflows/shared/prose.ts +4 -2
  47. package/src/workflows/shared/skills.test.ts +20 -1
  48. package/src/workflows/shared/skills.ts +43 -32
  49. package/src/workflows/shared/steps.ts +33 -19
  50. package/src/workflows/shared/tail.test.ts +84 -1
  51. package/src/workflows/shared/tail.ts +30 -12
  52. package/src/workflows/shared/text.test.ts +266 -4
  53. package/src/workflows/shared/text.ts +183 -70
  54. package/src/workflows/shared/vars.ts +12 -2
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtd",
3
- "version": "28.1.0",
3
+ "version": "29.0.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
@@ -336,16 +336,18 @@ questions one at a time, answers your own questions about the plan or the diff,
336
336
  records what you decide in the steering file the way the step asks, and moves
337
337
  the process on only when you say so; a review you leave untouched signs off.
338
338
  While a step runs you can keep asking; requests for changes wait for the next
339
- rest. When the process finishes, Claude offers to squash it into one commit and
340
- open its pull request (or run `/gtd ship`). A process can change hands at any
341
- gate: ask Claude to hand it off (or run `/gtd throw @dev`) and it opens a draft
342
- pull request assigned to them, and `/gtd catch <pr>` picks it up exactly where
343
- it waits, so whoever wrote the requirements can hand the architecture to someone
344
- else. Ship, hand-off and throw answer at once and run in the background, with
345
- progress on the status line; they report by waking Claude, a toast, a transcript
346
- line and a push notification, and a failed push or `gh` call reports as a
347
- failure. While a ship or hand-off runs or is queued, `/gtd catch`, the doors,
348
- `/gtd <requirements>` and bare `/gtd` wait for its report. See
339
+ rest. When the process finishes, Claude offers to squash it and open its pull
340
+ request(s) (or run `/gtd ship`; `GTD_SHIP_MODE` picks one stacked pull request
341
+ per slice or one commit per slice, see the [driver doc](docs/driver.md)). A
342
+ process can change hands at any gate: ask Claude to hand it off (or run
343
+ `/gtd throw @dev`) and it opens a draft pull request assigned to them, and
344
+ `/gtd catch <pr>` picks it up exactly where it waits, so whoever wrote the
345
+ requirements can hand the architecture to someone else. Ship, hand-off and throw
346
+ answer at once and run in the background, with progress on the status line; they
347
+ report by waking Claude, a toast, a transcript line and a push notification, and
348
+ a failed push or `gh` call reports as a failure. While a ship or hand-off runs
349
+ or is queued, `/gtd catch`, the doors, `/gtd <requirements>` and bare `/gtd`
350
+ wait for its report. See
349
351
  [Inside Claude Code](https://github.com/pmelab/gtd/blob/main/docs/driver.md#inside-claude-code-the-gtd-mod).
350
352
 
351
353
  ### Then let an agent build your own
@@ -568,8 +570,16 @@ home directory — fails every command until you delete it. See
568
570
  architecture and package files, the agent first implements the requirements
569
571
  directly. A judge checks whether it changed anything outside the expected set
570
572
  (tests, steering files; see `seamAllow`). Incidental changes land; a needed seam
571
- change goes to you for approval and is refactored first; a wrong approach is
572
- retried twice, then rests for you to steer or overrule it. Details in
573
+ change is refactored first, in its own slice with its own quality lap
574
+ (`refactorQualityReviews`) and review, before the feature is implemented and
575
+ reviewed; a wrong approach is retried twice, then rests for you to steer or
576
+ overrule it. `gtd slices` lists the `refactor` and `feature` slices. Feedback at
577
+ the feature review re-runs design and the implementation, never the naive pass;
578
+ feedback at the refactor review re-runs the refactor, never design; a
579
+ refactor-review change the refactor cannot build is refused, and the only way
580
+ out is `gtd abandon`. A process from 27.5.0 or later whose judge ruled
581
+ `refactor-first` must `gtd abandon` too. Each slice's quality lap reviews only
582
+ that slice. Details in
573
583
  [the naive-pass path](docs/configuration.md#the-naive-pass-path).
574
584
 
575
585
  **Risk tier (flag `GTD_FLAG_RISK_TIER=1`, off by default, needs
@@ -623,9 +633,9 @@ When a process finishes, the landing that closes it also keeps the whole run
623
633
  behind a ref, `refs/gtd/history/<entry>`, so a squash or a deleted branch
624
634
  doesn't lose it. `/gtd ship` pushes this process's own ref to origin alongside
625
635
  the branch (never the others) and writes a `Gtd-History: <ref>` trailer on the
626
- squash commit. The push is forced, so it replaces origin's copy of that one ref.
627
- If that push fails, the ship fails and nothing is squashed. Recover the full
628
- trail with `gtd history fetch | sh`, then `gtd history show <ref>`.
636
+ commit of every slice. The push is forced, so it replaces origin's copy of that
637
+ one ref. If that push fails, the ship fails and nothing is squashed. Recover the
638
+ full trail with `gtd history fetch | sh`, then `gtd history show <ref>`.
629
639
 
630
640
  ```sh
631
641
  gtd history list # one line per kept process
@@ -654,8 +664,9 @@ are not process history: `gtd history` does not list them, and the
654
664
  `refs/gtd/history/*` refspecs above neither push nor fetch them.
655
665
 
656
666
  A workflow can rest at an approval gate (`human(name, { approve: true })`; the
657
- `seamGate` helper does this after a `refactor-first` diff-shape judgment). Only
658
- a clean `gtd land` approves it, and the commit records who in a
667
+ `seamGate` helper does this for a `refactor-first` diff-shape judgment; the
668
+ shipped flow does not use it). Only a clean `gtd land` approves it, and the
669
+ commit records who in a
659
670
  `Gtd-Approved: {"step":"<step>#<n>","name":"<name>","email":"<email>"}` trailer;
660
671
  a landing with any edit is refused (as is a script run after the tree changed —
661
672
  revert and land again), and `gtd abandon` is the only other way out. `approve`
@@ -119,7 +119,7 @@ function trouble(w: Wake) {
119
119
  function finished(w: Wake) {
120
120
  return [
121
121
  `gtd finished the process on branch ${w.branch}.`,
122
- `Tell the person in two or three lines what was built (read the branch's commits), then ask whether to combine it into one commit and open its pull request. On yes, call ${TOOL.ship}.`,
122
+ `Tell the person in two or three lines what was built (read the branch's commits), then ask whether to squash it and open its pull request(s). On yes, call ${TOOL.ship}.`,
123
123
  ]
124
124
  }
125
125
 
@@ -593,7 +593,7 @@ async function shipNow($: $, isDry: boolean, isInTurn: boolean) {
593
593
  isInTurn,
594
594
  async () => {
595
595
  $.ui.status(isDry ? "previewing the pull request…" : "opening the pull request…")
596
- return ship(shipIo($), isDry)
596
+ return ship(shipIo($), isDry, await $.env.get("GTD_SHIP_MODE"))
597
597
  },
598
598
  async (shipped) => {
599
599
  // a failed ship leaves the run as it was; a dry run changes nothing