@pmelab/gtd 6.7.0 → 6.8.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 +38 -30
- package/dist/gtd.bundle.mjs +71 -55
- package/docs/cli.md +24 -21
- package/docs/configuration.md +65 -56
- package/docs/design/state-file-association.md +3 -3
- package/docs/design/state-machine-validation.md +2 -2
- package/docs/design/steering-file-loops.md +1 -1
- package/docs/design/work-packages.md +6 -7
- package/docs/development.md +5 -7
- package/docs/upgrading.md +25 -25
- package/package.json +1 -1
- package/docs/examples/advanced-workflow.md +0 -481
package/docs/cli.md
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
Usage: gtd [command] [options]
|
|
5
5
|
|
|
6
6
|
Commands:
|
|
7
|
-
init
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
init Scaffold a .gtdrc.json for this repo with the bundled
|
|
8
|
+
unified workflow; its agent prompts are written as editable
|
|
9
|
+
Markdown under gtd-prompts/ and referenced from the config.
|
|
10
|
+
Takes no argument. Run once per repo; refuses if a gtd
|
|
11
|
+
config already exists. Leaves the files uncommitted for you
|
|
12
|
+
to review and commit
|
|
13
13
|
step <actor> Authenticate as <actor>, match the resolved rest's
|
|
14
14
|
declared patterns against the pending changes, and commit
|
|
15
15
|
(or squash) the one resulting transition. Pass
|
|
@@ -59,19 +59,22 @@ mistyped flag can never degrade a JSON caller to plain-text mode. A bare
|
|
|
59
59
|
`--model`, `--model` without `--cost`, or either flag on any command other than
|
|
60
60
|
`gtd step` are all usage errors.
|
|
61
61
|
|
|
62
|
-
## `gtd init
|
|
62
|
+
## `gtd init`
|
|
63
63
|
|
|
64
|
-
Scaffolds a `.gtdrc.json` at the repository root with
|
|
65
|
-
workflow
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
so this is the one-time setup step for a repo; a state command
|
|
69
|
-
fails with `gtd: no workflow configured — run \`gtd init
|
|
64
|
+
Scaffolds a `.gtdrc.json` at the repository root with the bundled **unified**
|
|
65
|
+
workflow template inline under a `workflow:` key, plus a `$schema` link. It
|
|
66
|
+
takes **no argument** — passing one is a usage error
|
|
67
|
+
(`gtd init: too many arguments — init takes no argument`). gtd ships **no**
|
|
68
|
+
default workflow, so this is the one-time setup step for a repo; a state command
|
|
69
|
+
run before it fails with `gtd: no workflow configured — run \`gtd init\` to
|
|
70
|
+
create .gtdrc.json`.
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
The unified template has three entry points into one shared review/squash tail
|
|
73
|
+
(see [STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)): creating
|
|
74
|
+
`.gtd/TODO.md` starts the simple flow (grilling → building → checking), creating
|
|
75
|
+
`.gtd/REQUIREMENTS.md` starts the advanced flow (two-phase Q&A planning,
|
|
76
|
+
per-package parallel build, agentic spec-review), and `gtd review <commitish>`
|
|
77
|
+
enters review directly.
|
|
75
78
|
|
|
76
79
|
The file is written **uncommitted**; review and commit it before your first
|
|
77
80
|
`gtd step` (an uncommitted `.gtdrc.json` is a pending change the initial state
|
|
@@ -79,7 +82,7 @@ would otherwise capture). `gtd init` refuses if the repo root already has its
|
|
|
79
82
|
own gtd config (a global/ancestor config, e.g. `~/.gtdrc`, does not count),
|
|
80
83
|
requires the repository root, and — with `gtd lsp` — is one of the two commands
|
|
81
84
|
that run with no workflow configured. `--json` prints
|
|
82
|
-
`{"written":".gtdrc.json","workflow":"
|
|
85
|
+
`{"written":".gtdrc.json","workflow":"unified","prompts":[…]}`. See
|
|
83
86
|
[Configuration](configuration.md#gtd-init).
|
|
84
87
|
|
|
85
88
|
## `gtd step <actor> [--cost=<n>] [--model=<name>]`
|
|
@@ -325,9 +328,9 @@ Then:
|
|
|
325
328
|
approve), has nothing to validate and exits `0`
|
|
326
329
|
(`nothing to validate at "<state>"`). Nothing is formatted in that case.
|
|
327
330
|
|
|
328
|
-
This is how the
|
|
329
|
-
|
|
330
|
-
|
|
331
|
+
This is how the unified template keeps its steering files well-formed without an
|
|
332
|
+
in-machine validation state — and the check runs whoever last touched the file,
|
|
333
|
+
agent or human:
|
|
331
334
|
|
|
332
335
|
- **The producing agent self-validates.** Plain `gtd next` appends a "run
|
|
333
336
|
`gtd validate` and fix all violations" instruction to a `prompt` rest that
|
package/docs/configuration.md
CHANGED
|
@@ -40,7 +40,7 @@ Any other top-level key is **rejected** (`onExcessProperty: "error"`) — v3 has
|
|
|
40
40
|
no `testCommand`, `fixAttemptCap`, `reviewThreshold`, `agenticReview`, `squash`,
|
|
41
41
|
`learning`, `decisionLog`, or `models` keys; all of that machinery is gone (see
|
|
42
42
|
[Upgrading](upgrading.md)). The engine blesses no VARIABLE NAMES either —
|
|
43
|
-
`testCommand` (the bundled
|
|
43
|
+
`testCommand` (the bundled template's own var, see ["Variables"](#variables)) is
|
|
44
44
|
workflow-authored data like any other `it.vars` entry, not a special key gtd
|
|
45
45
|
interprets.
|
|
46
46
|
|
|
@@ -53,10 +53,9 @@ interprets.
|
|
|
53
53
|
> behind it.
|
|
54
54
|
|
|
55
55
|
The `workflow:` key is the **only** definition source — there is no `extends`,
|
|
56
|
-
no merge-over-a-built-in. The bundled
|
|
57
|
-
|
|
58
|
-
`
|
|
59
|
-
(`compileWorkflowConfig`); `gtd init` just writes one of them, inline, under
|
|
56
|
+
no merge-over-a-built-in. The bundled template `gtd init` scaffolds is itself a
|
|
57
|
+
YAML asset (`src/workflows/unified.yaml`) compiled through the exact same
|
|
58
|
+
compiler (`compileWorkflowConfig`); `gtd init` just writes it, inline, under
|
|
60
59
|
this key. Its shape:
|
|
61
60
|
|
|
62
61
|
```yaml
|
|
@@ -230,9 +229,10 @@ Because `grilling` re-enters itself around the answer loop, every lap emits
|
|
|
230
229
|
`building` emits a different label (`build`), which is where the driver clears
|
|
231
230
|
memory for a fresh implementation turn. A loop of same-labelled turns retains; a
|
|
232
231
|
differently-labelled state at a phase boundary clears. This is exactly how the
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
the
|
|
232
|
+
unified template scopes its agent states across the four `plan`/`build`/`fix`/
|
|
233
|
+
`review` memory tiers (see
|
|
234
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)), and how the
|
|
235
|
+
loop driver reads it is spelled out in `skills/loop/SKILL.md`.
|
|
236
236
|
|
|
237
237
|
Like `model`, `memory:` is rendered as an Eta template through the same context
|
|
238
238
|
as the state's content — a plain label (`plan`) passes through unchanged, while
|
|
@@ -250,8 +250,7 @@ A state may additionally declare `file:` — an Eta template naming THE steering
|
|
|
250
250
|
file this state is about: the file a human/editor should look at while the
|
|
251
251
|
machine rests here (rendered through the same `it.vars`-carrying context as
|
|
252
252
|
content/`model`; must render non-empty). Forbidden on a commit state (never at
|
|
253
|
-
rest). Multiple states may share one `file:` (and, in the
|
|
254
|
-
do):
|
|
253
|
+
rest). Multiple states may share one `file:` (and, in the unified template, do):
|
|
255
254
|
|
|
256
255
|
```yaml
|
|
257
256
|
workflow:
|
|
@@ -369,12 +368,11 @@ So for a state declaring `mode: qa`:
|
|
|
369
368
|
| both | its `format:` | its `validate:` |
|
|
370
369
|
|
|
371
370
|
That is what makes the built-in modes extensible rather than all-or-nothing —
|
|
372
|
-
and the top-level key means a project can plug its formatter into
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
in your `.gtdrc.json`:
|
|
371
|
+
and the top-level key means a project can plug its formatter into the workflow
|
|
372
|
+
it scaffolded (`gtd init`) without re-declaring a `modes:` block on the workflow
|
|
373
|
+
itself. **`gtd init` seeds exactly this block by default** (the Prettier
|
|
374
|
+
suggestion below), so a fresh repo already formats its steering files — edit or
|
|
375
|
+
drop it to taste. It sits alongside the `workflow:` key in your `.gtdrc.json`:
|
|
378
376
|
|
|
379
377
|
```jsonc
|
|
380
378
|
// .gtdrc.json — the workflow from `gtd init`, plus your own markdown formatter
|
|
@@ -429,10 +427,11 @@ workflow:
|
|
|
429
427
|
"* **": building
|
|
430
428
|
```
|
|
431
429
|
|
|
432
|
-
The
|
|
433
|
-
`
|
|
434
|
-
|
|
435
|
-
|
|
430
|
+
The unified template enables `reviewWindow: true` on `await-review` and marks
|
|
431
|
+
`review-deciding` `reviewBase: true`, so the first review covers the whole cycle
|
|
432
|
+
but each subsequent feedback round's window narrows to `last-review..HEAD`. The
|
|
433
|
+
pure engine never observes an open window — it is opened/closed entirely at the
|
|
434
|
+
edge; the real head is preserved under `refs/gtd/review-head` (the base under
|
|
436
435
|
`refs/gtd/review-base`) for the window's lifetime. See
|
|
437
436
|
[STATES.md §11](../STATES.md) for the full lifecycle.
|
|
438
437
|
|
|
@@ -546,15 +545,14 @@ Every template — `script`/`prompt`/`message`/`commit`, and `model`/`memory`/
|
|
|
546
545
|
layers, **later wins**:
|
|
547
546
|
|
|
548
547
|
1. **The workflow's own `vars:` key** (sibling to `states:`, shown above) — the
|
|
549
|
-
workflow author's declared defaults. The
|
|
548
|
+
workflow author's declared defaults. The unified template declares
|
|
550
549
|
`vars: { testCommand: "npm test" }`, read by `checking`'s script as
|
|
551
550
|
`<%~ it.vars.testCommand %>` (see
|
|
552
|
-
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)).
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
tier at once.
|
|
551
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)). The bundled
|
|
552
|
+
template also declares two model-tier vars — `plannerModel` (default `smart`)
|
|
553
|
+
and `coderModel` (default `base`) — that every agent state's `model:`
|
|
554
|
+
resolves through (`model: <%= it.vars.plannerModel %>`), so repointing one
|
|
555
|
+
var here (or via layer 2/3 below) changes every state on that tier at once.
|
|
558
556
|
2. **A top-level `.gtdrc` `vars:` key** (a sibling of `workflow:`, NOT nested
|
|
559
557
|
inside it) — per-repo tuning without redefining the whole workflow. Subject
|
|
560
558
|
to the same cwd→home deep merge as everything else in `.gtdrc` (innermost
|
|
@@ -572,7 +570,7 @@ alongside every other config-shape finding (see
|
|
|
572
570
|
already strings.
|
|
573
571
|
|
|
574
572
|
```yaml
|
|
575
|
-
# .gtdrc — overriding the
|
|
573
|
+
# .gtdrc — overriding the unified template's testCommand
|
|
576
574
|
vars:
|
|
577
575
|
testCommand: npm run test:ci
|
|
578
576
|
```
|
|
@@ -664,14 +662,16 @@ gtd ships **no** default workflow, so a repo must scaffold one before any state
|
|
|
664
662
|
command works:
|
|
665
663
|
|
|
666
664
|
```bash
|
|
667
|
-
gtd init
|
|
665
|
+
gtd init # takes no argument
|
|
668
666
|
```
|
|
669
667
|
|
|
670
|
-
`gtd init
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
is
|
|
674
|
-
|
|
668
|
+
`gtd init` writes a `.gtdrc.json` at the repository root with the bundled
|
|
669
|
+
unified template's workflow under a `workflow:` key, plus a `$schema` link (so
|
|
670
|
+
editors pick up completion/validation). It takes **no argument** — passing one
|
|
671
|
+
is a usage error (`gtd init: too many arguments — init takes no argument`). Each
|
|
672
|
+
**agent state's prompt** is written as a standalone Markdown file under
|
|
673
|
+
`gtd-prompts/<state>.md` and the config references it via a
|
|
674
|
+
`./gtd-prompts/<state>.md`
|
|
675
675
|
[file reference](#content-values-inline-or-a-file-reference) — gtd inlines it at
|
|
676
676
|
load time, so a prompt is editable Markdown and editing it changes the workflow
|
|
677
677
|
with no config edit. Human `message:` blocks and check `script:` bodies stay
|
|
@@ -679,7 +679,7 @@ inline in the config (they are workflow mechanics, not prompts).
|
|
|
679
679
|
|
|
680
680
|
It also seeds a top-level [`modes:`](#modes--pluggable-steering-file-modes)
|
|
681
681
|
block as a ready-to-edit suggestion — a Prettier `format:` for each built-in
|
|
682
|
-
steering-file mode the
|
|
682
|
+
steering-file mode the template uses:
|
|
683
683
|
|
|
684
684
|
```jsonc
|
|
685
685
|
"modes": {
|
|
@@ -694,16 +694,22 @@ this is the one default it suggests: a fresh repo auto-formats its steering
|
|
|
694
694
|
files out of the box, and you edit or drop the block freely (swap Prettier for
|
|
695
695
|
dprint, point at a script, or delete the key).
|
|
696
696
|
|
|
697
|
-
The
|
|
697
|
+
The one bundled template has three entry points into a shared review/squash tail
|
|
698
|
+
(all walked through in
|
|
699
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)):
|
|
698
700
|
|
|
699
|
-
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
701
|
+
- **the simple flow** — creating `.gtd/TODO.md` starts idle → grilling ⇄
|
|
702
|
+
grilling-answer → building → checking ⇄ fixing (→ escalate) → reviewing →
|
|
703
|
+
await-review.
|
|
704
|
+
- **the advanced flow** — creating `.gtd/REQUIREMENTS.md` starts the fuller
|
|
705
|
+
machine: two-phase Q&A planning (product then architecture), package
|
|
706
|
+
decomposition, a per-package parallel build queue with an agentic spec-review
|
|
707
|
+
gate, then the same shared tail.
|
|
708
|
+
- **`gtd review <commitish>`** — enters the shared `reviewing` state directly to
|
|
709
|
+
review a foreign branch.
|
|
710
|
+
|
|
711
|
+
Both file-created flows converge on `reviewing` → `await-review`, and a full
|
|
712
|
+
sign-off squashes the whole cycle into one commit.
|
|
707
713
|
|
|
708
714
|
The files are written **uncommitted** — review them, then commit `.gtdrc.json`
|
|
709
715
|
and `gtd-prompts/` before your first `gtd step` (an uncommitted file is a
|
|
@@ -715,7 +721,7 @@ that run with no workflow configured. A state command run before `gtd init`
|
|
|
715
721
|
fails with:
|
|
716
722
|
|
|
717
723
|
```
|
|
718
|
-
gtd: no workflow configured — run `gtd init
|
|
724
|
+
gtd: no workflow configured — run `gtd init` to create .gtdrc.json
|
|
719
725
|
```
|
|
720
726
|
|
|
721
727
|
## A complete example
|
|
@@ -778,19 +784,22 @@ the file.
|
|
|
778
784
|
|
|
779
785
|
## Recipe: a per-task builder loop without a script state
|
|
780
786
|
|
|
781
|
-
A `picking`-style queue arbiter (
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
+
A `picking`-style queue arbiter (the bundled unified template's advanced flow
|
|
788
|
+
carries one — see
|
|
789
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)) is a `script`
|
|
790
|
+
state that turns a task-queue glob into a diff patterns can see. A driver that
|
|
791
|
+
can't run scripts can get the same per-task loop out of pure prompt/`on`
|
|
792
|
+
declarations instead, at the cost of trusting the agent to honor a marker
|
|
793
|
+
protocol rather than a deterministic `ls`: see
|
|
787
794
|
[docs/design/work-packages.md §3](design/work-packages.md) ("Option B —
|
|
788
795
|
agent-encoded verdict") for the worked example.
|
|
789
796
|
|
|
790
797
|
## A fuller example: two-phase planning, task decomposition, agent-prepared review
|
|
791
798
|
|
|
792
|
-
The example above is deliberately small (it is close to the
|
|
793
|
-
For a heavier machine — Q&A planning loops, an
|
|
794
|
-
decomposition, the deterministic per-task `picking`
|
|
795
|
-
`.gtd/REVIEW.md` review —
|
|
796
|
-
|
|
799
|
+
The example above is deliberately small (it is close to the bundled unified
|
|
800
|
+
template's simple flow). For a heavier machine — Q&A planning loops, an
|
|
801
|
+
architecture phase, task decomposition, the deterministic per-task `picking`
|
|
802
|
+
arbiter, and agent-prepared `.gtd/REVIEW.md` review — the unified template's
|
|
803
|
+
**advanced flow** (started by creating `.gtd/REQUIREMENTS.md`) is exactly that,
|
|
804
|
+
walked through in
|
|
805
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates).
|
|
@@ -68,8 +68,8 @@ patterns desyncs the machine. The vars are a DRY mechanism inside templates and
|
|
|
68
68
|
the state↔file association, not a rename switch. (Making pattern keys var-aware
|
|
69
69
|
at compile time is noted as possible future work.)
|
|
70
70
|
|
|
71
|
-
The advanced
|
|
72
|
-
`file:`/`mode:` annotations (it is the LSP-heavy flow), including
|
|
71
|
+
The advanced flow of the bundled unified template (see STATES.md §10) gains the
|
|
72
|
+
same `file:`/`mode:` annotations (it is the LSP-heavy flow), including
|
|
73
73
|
`architectureFile` for its architecting phases (also `qa`-format).
|
|
74
74
|
|
|
75
75
|
## 3. The LSP becomes config-driven
|
|
@@ -105,7 +105,7 @@ The advanced example (`docs/examples/advanced-workflow.md`) gains the same
|
|
|
105
105
|
| `src/Edge.ts` / `src/program.ts` | Render `file:` at rest; `file`/`mode` in both `--json` payloads + plain `status` lines. |
|
|
106
106
|
| `src/Lsp.ts` | Config discovery, path→mode dispatch (with basename fallback), `gtd.openSteeringFile`. |
|
|
107
107
|
| `src/workflows/default.yaml` | §2's vars + per-state `file:`/`mode:`; templates switch to filename vars. |
|
|
108
|
-
| Docs | STATES.md property table + §10; configuration.md (`file:`/`mode:` section + mode vocabulary + the pattern-literal limitation); cli.md JSON contracts;
|
|
108
|
+
| Docs | STATES.md property table + §10; configuration.md (`file:`/`mode:` section + mode vocabulary + the pattern-literal limitation); cli.md JSON contracts; the bundled unified template's advanced-flow annotations (STATES.md §10); upgrading note (jump command is back, config-driven). |
|
|
109
109
|
| Tests | Unit: validation (mode vocabulary, mode-requires-file, commit-state prohibition, aggregation), compile, `file:` render + failure path; LSP path→mode dispatch, fallback, openSteeringFile (pure helpers). E2e: `driver-json-status.feature` file/mode emission (present + omitted); `lsp.feature` @live — documentSymbol served for a CUSTOM-named qa file mapped via a real `.gtdrc` (proving config-driven dispatch), and the jump command returning the rendered path at a known state. |
|
|
110
110
|
| Live verification | Scratch repo with a custom workflow whose `file:` uses a var: `gtd status` shows the rendered `File:`/`Mode:`; LSP smoke against the custom filename; default workflow spot-check (`grilling` → `File: .gtd/TODO.md`, `Mode: qa`). |
|
|
111
111
|
|
|
@@ -306,8 +306,8 @@ sub-millisecond — safe to run on every invocation, exactly like today's
|
|
|
306
306
|
- **The bundled default must stay finding-free** — findings 7 and 10 are
|
|
307
307
|
calibrated against it (`fixing`'s cap bounds the check loop; the literal
|
|
308
308
|
`.gtd/...` patterns match the declared default vars). Any new check must be
|
|
309
|
-
validated against
|
|
310
|
-
before landing.
|
|
309
|
+
validated against the bundled unified template (`src/workflows/unified.yaml`,
|
|
310
|
+
covering both its simple and advanced flows) before landing.
|
|
311
311
|
- **Warning channel is the only architectural change** — everything else slots
|
|
312
312
|
into the existing collect-and-merge flow in `compileWorkflowConfig`.
|
|
313
313
|
|
|
@@ -133,7 +133,7 @@ review-deciding branch condition. Findings go into `.gtd/FORMAT.md` verbatim
|
|
|
133
133
|
| `STATES.md` §10 | New table + walkthrough (both loops, the declaration-order subtleties, the hygiene invariant). |
|
|
134
134
|
| `tests/integration/features/default-workflow.feature` | Rewritten: malformed-TODO lap (simulate `todo-validating` by writing `.gtd/FORMAT.md` + `gtd step check` — @inmem never executes scripts), valid draft → answer lap → accept; malformed-REVIEW lap; tick-all approve → `idle` with empty `.gtd/`; partial-tick feedback → TODO.md extraction → `grilling`; delete-shortcut approve; retry/escalation kept. |
|
|
135
135
|
| `smoke.feature` | Hop updates (`grilling` now routes to `todo-validating`). |
|
|
136
|
-
| Docs | `configuration.md` / `README.md` walkthrough mentions;
|
|
136
|
+
| Docs | `configuration.md` / `README.md` walkthrough mentions; the advanced flow is now part of the bundled unified template (see STATES.md §10) rather than a standalone example. |
|
|
137
137
|
| Live verification | Real-script drive (`gtd run` at each validator) covering: agent writes malformed TODO → FORMAT.md → fixed lap; answers folded; malformed REVIEW lap; tick-all approve; partial-tick feedback extracting TODO.md; final tree `.gtd`-free at idle. |
|
|
138
138
|
|
|
139
139
|
## 5. The LSP server comes back (v3-shaped)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# Design: the builder / work-packages flow as pure workflow configuration
|
|
2
2
|
|
|
3
|
-
> Status: LANDED
|
|
4
|
-
>
|
|
5
|
-
>
|
|
6
|
-
>
|
|
7
|
-
>
|
|
8
|
-
>
|
|
9
|
-
> over B/C/D, and the process-per-task topology (§6) remains a documented,
|
|
3
|
+
> Status: LANDED — Option A shipped in the bundled default workflow's `picking`
|
|
4
|
+
> state. It now lives in the bundled **unified** template's advanced flow (the
|
|
5
|
+
> `picking` state, reached by starting a cycle with `.gtd/REQUIREMENTS.md` — see
|
|
6
|
+
> [STATES.md §10](../../STATES.md#10-the-bundled-workflow-templates)). The rest
|
|
7
|
+
> of this document is kept as the decision record: why Option A was chosen over
|
|
8
|
+
> B/C/D, and the process-per-task topology (§6) remains a documented,
|
|
10
9
|
> unimplemented recipe.
|
|
11
10
|
>
|
|
12
11
|
> Context (as originally written): v2 had an engine-level package loop
|
package/docs/development.md
CHANGED
|
@@ -31,18 +31,16 @@ registry to keep in sync: a workflow's content strings are either inline in its
|
|
|
31
31
|
YAML/`.gtdrc` or a `./`-relative file reference auto-inlined at config load
|
|
32
32
|
(`src/PatternConfig.ts`) — see
|
|
33
33
|
[Configuration](configuration.md#content-values-inline-or-a-file-reference). The
|
|
34
|
-
bundled workflow
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
— no privileged code path.
|
|
34
|
+
bundled workflow template (`src/workflows/unified.yaml`) `gtd init` scaffolds is
|
|
35
|
+
imported as raw text via tsdown's `.yaml`-as-text loader (`tsdown.config.ts`)
|
|
36
|
+
and compiled through the same path a `.gtdrc` `workflow:` key goes through
|
|
37
|
+
(`src/workflows/templates.ts`) — no privileged code path.
|
|
39
38
|
|
|
40
39
|
`npm run dev` runs `src/main.ts` directly via Node's native TypeScript
|
|
41
40
|
type-stripping (requires Node 22.6+). It registers `dev/hooks.mjs`, which
|
|
42
41
|
resolves `./Foo.js` specifiers to the on-disk `./Foo.ts` and imports `*.yaml`
|
|
43
42
|
files as raw text, mirroring tsdown's `.yaml`-as-text loader — this is what lets
|
|
44
|
-
`src/workflows/
|
|
45
|
-
running from source.
|
|
43
|
+
`src/workflows/unified.yaml` resolve when running from source.
|
|
46
44
|
|
|
47
45
|
The decision core is pure and IO-free: the pattern machine's shape (states,
|
|
48
46
|
patterns, retry) is a plain-data `WorkflowDefinition` (`src/PatternMachine.ts`),
|
package/docs/upgrading.md
CHANGED
|
@@ -16,7 +16,7 @@ subject (or the bare `gtd(<actor>): <to>`) naming a state and an actor the
|
|
|
16
16
|
active workflow currently declares; everything else — a v1 `gtd: grilling`, a v2
|
|
17
17
|
`gtd(agent): building`, a plain `chore: …` commit, anything from a foreign repo
|
|
18
18
|
— parses as unrecognized and lands at the workflow's initial state (`idle` in
|
|
19
|
-
the
|
|
19
|
+
the unified template). There is no special-casing for "this looks like an old
|
|
20
20
|
gtd commit": the mechanism is exactly the same one that already made v1 history
|
|
21
21
|
inert to v2, and v2 history inert to a differently-configured workflow — v3 just
|
|
22
22
|
applies it uniformly to all prior history instead of drawing a v1/v2 line.
|
|
@@ -41,8 +41,8 @@ upgrading.
|
|
|
41
41
|
all gone — `workflow:` and `vars:` are the only two blessed keys (see
|
|
42
42
|
[Configuration](configuration.md)). A check's command now lives inline in its
|
|
43
43
|
own `script:` content, reading a workflow-declared `it.vars` entry (the
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
unified template's `testCommand`, overridable via the top-level `vars:` key or
|
|
45
|
+
a `GTD_VAR_testCommand` environment variable — see
|
|
46
46
|
[Configuration's "Variables"](configuration.md#variables)) rather than a
|
|
47
47
|
blessed `testCommand` config key; squashing is a `commit:` state instead of a
|
|
48
48
|
boolean flag; there is no learning phase, no decision log, and no model
|
|
@@ -53,17 +53,17 @@ upgrading.
|
|
|
53
53
|
v3.0 rewrite, then RE-INTRODUCED as the explicit state property it was always
|
|
54
54
|
meant to become: a state declaring `reviewWindow: true` opens the window while
|
|
55
55
|
the machine rests there (base = the process start, or a state marked
|
|
56
|
-
`reviewBase: true`). The
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
`reviewBase: true`). The unified template enables it on `await-review`. Unlike
|
|
57
|
+
v2's hardwired gate, it is pure workflow DATA and the engine stays oblivious —
|
|
58
|
+
see [STATES.md §11](../STATES.md) and the `file:`/`mode:` neighbours in
|
|
59
|
+
[configuration.md](configuration.md).
|
|
60
60
|
- **`forceApprove`, content-inspection verdicts.** FEEDBACK.md emptiness,
|
|
61
61
|
checkbox-only REVIEW.md diffs, and doc-structure validation are gone as ENGINE
|
|
62
62
|
mechanisms — verdicts are now expressed purely by which file a turn writes or
|
|
63
|
-
deletes, matched by an ordinary `on` pattern. The
|
|
63
|
+
deletes, matched by an ordinary `on` pattern. The unified template's own
|
|
64
64
|
checkbox-review verdict (`review-deciding`) is ordinary WORKFLOW data (an `on`
|
|
65
65
|
pattern), not an engine hook: `D REVIEW.md` = approve, `M REVIEW.md` = route
|
|
66
|
-
to the deterministic decider, in the
|
|
66
|
+
to the deterministic decider, in the unified template. Deterministic
|
|
67
67
|
format-checking of the steering files is likewise no longer a pair of
|
|
68
68
|
in-machine `check`/`script` states — the old `todo-validating`/
|
|
69
69
|
`review-validating` states and their `.gtd/FORMAT.md` steering file are gone,
|
|
@@ -87,7 +87,7 @@ upgrading.
|
|
|
87
87
|
formats anything on its own: a steering-file mode declares its own `format:`
|
|
88
88
|
SHELL COMMAND, so a project brings whatever formatter it already uses. Adding
|
|
89
89
|
four lines to `.gtdrc` restores (and improves on) the old auto-formatting for
|
|
90
|
-
the
|
|
90
|
+
the unified template:
|
|
91
91
|
|
|
92
92
|
```yaml
|
|
93
93
|
modes:
|
|
@@ -116,9 +116,9 @@ upgrading.
|
|
|
116
116
|
itself only understands the two built-ins), the LSP reads that same config the
|
|
117
117
|
CLI does to build its path→mode dispatch, and `gtd.openSteeringFile` resolves
|
|
118
118
|
the current state and shows its `file:`. No mapping declared at all (the
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
bundled template's predecessor shape, or any workflow with no `file:`/`mode:`)
|
|
120
|
+
falls back to basename dispatch (`TODO.md`/`REVIEW.md`), same as before this
|
|
121
|
+
addition.
|
|
122
122
|
|
|
123
123
|
## How to adopt
|
|
124
124
|
|
|
@@ -126,20 +126,20 @@ upgrading.
|
|
|
126
126
|
upgrading each repo must scaffold one **once**:
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
|
-
gtd init
|
|
129
|
+
gtd init # takes no argument
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
`gtd init
|
|
133
|
-
prompts extracted to editable `gtd-prompts/*.md`
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
[
|
|
132
|
+
`gtd init` (no argument) writes a `.gtdrc.json` for the single bundled
|
|
133
|
+
**unified** template (its agent prompts extracted to editable `gtd-prompts/*.md`
|
|
134
|
+
files the config references). The template forks on which steering file you
|
|
135
|
+
create: `.gtd/TODO.md` starts the **simple flow** (a single-shot `grilling`
|
|
136
|
+
plan, direct `building`, a `checking`/`fixing` loop), while
|
|
137
|
+
`.gtd/REQUIREMENTS.md` starts the **advanced flow** (two-phase grilling ⇄
|
|
138
|
+
grilling-answer / architecting ⇄ architecting-answer / decompose / picking /
|
|
139
|
+
per-package build with an agentic spec-review gate). Both converge on the same
|
|
140
|
+
`reviewing` → `await-review` tail, and a full sign-off squashes the whole cycle
|
|
141
|
+
into one commit (see
|
|
142
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)). Review and
|
|
143
143
|
commit the generated `.gtdrc.json` (and its `gtd-prompts/` directory), then
|
|
144
144
|
continue from a settled `idle` boundary. **Note:** a repo relying on earlier
|
|
145
145
|
gtd's auto-created `.gtdrc.json` `$schema` stub (which carried no `workflow:`)
|