@pmelab/gtd 12.5.0 → 14.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 CHANGED
@@ -29,6 +29,12 @@ bundled workflow names skills from it at several states instead of spelling out
29
29
  technique in the prompt itself; see
30
30
  [Setup](https://github.com/pmelab/gtd/blob/main/docs/setup.md) for the details.
31
31
 
32
+ > **A repository's `gtd.config.ts` is code, and gtd runs it.** A custom workflow
33
+ > is a TypeScript module, and every gtd command that looks at workflow state —
34
+ > `gtd next` and `gtd lsp` included, not just `gtd land` — evaluates it. Treat
35
+ > it like a Makefile or a `package.json` script: don't run gtd in a checkout you
36
+ > don't trust.
37
+
32
38
  ## Quick start
33
39
 
34
40
  Pipe the output of `gtd install` into your coding agent and answer its
@@ -75,15 +81,17 @@ gtd next
75
81
  ```
76
82
  No active gtd process.
77
83
 
78
- To start one, make ANY change — a hand-edit to real code, a scratch note,
79
- anything at all. TODO.md is a good default place to start sketching.
84
+ To start one, make ANY change — a hand-edit to real code, a scratch
85
+ note, anything at all. .gtd/TODO.md is a good default
86
+ place to start sketching.
80
87
  ```
81
88
 
82
- This means its your turn. Add a `TODO.md` file with a detailed, well articulated
83
- idea:
89
+ This means its your turn. Add a `.gtd/TODO.md` file with a detailed, well
90
+ articulated idea:
84
91
 
85
92
  ```bash
86
- echo "Make a billion dollar SaaS. Make no mistakes." > TODO.md
93
+ mkdir -p .gtd
94
+ echo "Make a billion dollar SaaS. Make no mistakes." > .gtd/TODO.md
87
95
  ```
88
96
 
89
97
  Ask again, and gtd leads with what to do, then reports what it sees:
@@ -92,14 +100,13 @@ Ask again, and gtd leads with what to do, then reports what it sees:
92
100
  The edit is already made — run `gtd land` to land it.
93
101
  State: idle
94
102
  Awaits: human
95
- Pending:
96
- A TODO.md -> * **
97
- Next: Start → unwind
103
+ Label: Idle
104
+ File: .gtd/TODO.md
98
105
  ```
99
106
 
100
- Your change matched the pattern `* **`, which routes to the `unwind` state. For
101
- the moment its not important what that is. Important is the fact that changes to
102
- the source tree control what is going to happen next.
107
+ At `idle`, any change at all starts a process, and the next step is `unwind`.
108
+ For the moment its not important what that is. Important is the fact that what
109
+ you leave in the tree controls what is going to happen next.
103
110
 
104
111
  ### Beat 2 — `gtd land` records it as a commit
105
112
 
@@ -123,7 +130,6 @@ gtd land --json=script | sh
123
130
 
124
131
  ```
125
132
  -> idle → unwind
126
- TODO.md
127
133
  ```
128
134
 
129
135
  ```bash
@@ -148,12 +154,17 @@ Awaits: check
148
154
  Label: Unwinding your input
149
155
 
150
156
  #!/usr/bin/env sh
151
- ...
152
- git revert --no-commit "$commit" 2> .gtd/.unwind-error
157
+ set +e
158
+ if ! git diff --quiet '<sketch commit>^' '<sketch commit>' --; then
159
+ mkdir -p "$(dirname '.gtd/FEEDBACK.md')"
160
+ git diff --binary '<sketch commit>^' '<sketch commit>' -- | git apply -R 2> …
161
+ …
153
162
  ```
154
163
 
155
- `Awaits: check` means this beat is not yours: it is a script. gtd never runs
156
- anything itself, so run it and land it exactly as before:
164
+ `Awaits: check` means this beat is not yours: it is a script, here one that
165
+ reverts your sketch out of the working tree. gtd never runs anything itself,
166
+ never commits and never touches the index, so run it and land it exactly as
167
+ before:
157
168
 
158
169
  ```bash
159
170
  sh -c "$(gtd next --json=content)"
@@ -171,13 +182,13 @@ baseline is green:
171
182
  ```
172
183
  State: start-gate.check
173
184
  Awaits: check
174
- Next: C → design.triage
185
+ Label: Checking the baseline
175
186
  ```
176
187
 
177
- `C` is the clean-tree pattern: the suite passed, nothing changed, so move on to
178
- triage. A red suite instead writes `.gtd/FEEDBACK.md`, which matches a different
179
- pattern and routes to `start-gate.blocked` — same two commands, different
180
- outcome, decided entirely by what the beat left in the tree.
188
+ A green suite leaves the tree clean, so the process moves on to triage. A red
189
+ suite instead writes `.gtd/FEEDBACK.md`, and the process goes to
190
+ `start-gate.blocked` — same two commands, different outcome, decided entirely by
191
+ what the beat left in the tree.
181
192
 
182
193
  Land the green one, and the beat after it belongs to an agent.
183
194
 
@@ -306,9 +317,9 @@ noted in steps 2, 3, and 4 below.
306
317
 
307
318
  3. **You wait.** The work is split into packages and built one at a time, each
308
319
  one checked against your test suite and fixed until it passes, then reviewed
309
- against its own spec before moving on. Four points along that loop are judged
310
- rather than always asking you outright — each stops and hands you a verdict
311
- to make (`gtd judge answer`, or land with a clean tree to accept the
320
+ against its own spec before moving on. Three points along that loop are
321
+ judged rather than always asking you outright — each stops and hands you a
322
+ verdict to make (`gtd judge answer`, or land with a clean tree to accept the
312
323
  conservative default, which never skips work):
313
324
  - Every red round after the first: was the failure identical, new, or
314
325
  progress?
@@ -316,22 +327,20 @@ noted in steps 2, 3, and 4 below.
316
327
  each of its requirements?
317
328
  - After a review turn raises concerns: would each one actually violate the
318
329
  spec if left unaddressed, or is it a nit?
319
- - Before showing you the review document: is this round mechanical, touches
320
- no public surface, and changes no behavior? Confident on all three skips
321
- the agent's own review turn — step 4 still shows you a (machine-written)
322
- summary of what changed.
323
330
 
324
331
  A driver built only to run this loop (not to answer judgments) still handles
325
332
  every one of these correctly: it shows you the message and stops, same as any
326
333
  other question.
327
334
 
328
- The `gtd --entry fix-precheck` side door (below) repairs a red baseline
329
- through this same loop's own green check, and that check also runs a
330
- qualitative review lap first: one configured skill per turn, each looking at
331
- the change from its own angle (a security checklist, a simplification pass)
332
- and fixing what it finds once, with no re-review after the fix. It never
333
- replaces step 4 — your review stays the final gate, and nothing here skips
334
- it.
335
+ Once the last package is built, the whole change goes through a qualitative
336
+ review lap before you see anything: one configured skill per turn, each
337
+ looking at the change from its own angle (a security checklist, a
338
+ simplification pass) and fixing what it finds once, with no re-review after
339
+ the fix. The per-package review above only judges that package against its
340
+ own spec; this lap is where code quality is looked at, and every round pays
341
+ for it. It never replaces step 4 — your review stays the final gate, and
342
+ nothing here skips it. The `gtd --entry fix-precheck` side door (below)
343
+ repairs a red baseline through this same lap.
335
344
 
336
345
  A red suite that keeps failing past a few fix attempts escalates instead of
337
346
  retrying forever: an agent turn reads the failing output and writes
@@ -376,9 +385,11 @@ gtd --entry review-gate.check --var reviewBase=<commitish>
376
385
  starts a pure review of everything from `<commitish>` to HEAD — straight to step
377
386
  4, no planning and no building.
378
387
 
379
- The workflow itself is data, not code: a `.gtdrc` `workflow:` key replaces it
380
- wholesale. See
381
- [Configuration](https://github.com/pmelab/gtd/blob/main/docs/configuration.md).
388
+ The workflow itself is a plain async TypeScript function: a `gtd.config.ts` at
389
+ the repository root replaces it, and the pieces the bundled one is built from
390
+ are exported for yours to reuse. See
391
+ [Configuration](https://github.com/pmelab/gtd/blob/main/docs/configuration.md) —
392
+ and remember gtd evaluates that file on every command.
382
393
 
383
394
  ## License
384
395