@pmelab/gtd 6.5.1 → 6.6.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 +7 -3
- package/dist/gtd.bundle.mjs +28 -0
- package/docs/configuration.md +24 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,9 +57,13 @@ gtd init simple # or: gtd init advanced
|
|
|
57
57
|
This writes a `.gtdrc.json` for the chosen workflow, with each agent state's
|
|
58
58
|
prompt saved as an editable Markdown file under `gtd-prompts/` and referenced
|
|
59
59
|
from the config (review and commit both). Edit a prompt by editing its
|
|
60
|
-
`gtd-prompts/*.md` file — no config edit needed.
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
`gtd-prompts/*.md` file — no config edit needed. It also seeds a top-level
|
|
61
|
+
`modes:` block suggesting **Prettier** as the steering-file formatter
|
|
62
|
+
(`npx prettier --write` for the built-in `qa`/`review` modes — format only, so
|
|
63
|
+
gtd still validates); edit or drop it freely (swap in dprint, a script, or
|
|
64
|
+
delete the key). gtd ships **no** default workflow: a state command run before
|
|
65
|
+
`gtd init` fails, pointing you back here. See
|
|
66
|
+
[Configuration](docs/configuration.md#gtd-init) for the two templates.
|
|
63
67
|
|
|
64
68
|
## How it works
|
|
65
69
|
|
package/dist/gtd.bundle.mjs
CHANGED
|
@@ -191388,6 +191388,27 @@ const SCHEMA_URL = "https://raw.githubusercontent.com/pmelab/gtd/main/schema.jso
|
|
|
191388
191388
|
*/
|
|
191389
191389
|
const PROMPTS_DIR = "gtd-prompts";
|
|
191390
191390
|
/**
|
|
191391
|
+
* The top-level `modes:` block `gtd init` SEEDS into the scaffolded
|
|
191392
|
+
* `.gtdrc.json` as a ready-to-edit suggestion: a `format:` command for each
|
|
191393
|
+
* built-in steering-file mode the bundled templates use (`qa` for the plan /
|
|
191394
|
+
* open-questions files, `review` for REVIEW.md), so a fresh project's steering
|
|
191395
|
+
* files are auto-formatted with Prettier before gtd validates them. Only
|
|
191396
|
+
* `format:` is declared — gtd's built-in `qa`/`review` validators still do the
|
|
191397
|
+
* validating (the two halves layer independently — see STATES.md §12 /
|
|
191398
|
+
* docs/configuration.md `modes:`). gtd ships no formatter, so this is the one
|
|
191399
|
+
* place a default is suggested; a project edits or drops it freely (swap
|
|
191400
|
+
* Prettier for dprint, point at a script, delete the key).
|
|
191401
|
+
*
|
|
191402
|
+
* Seeded only by `renderInitScaffold` (the real `gtd init` write path), NOT by
|
|
191403
|
+
* `renderInitConfig`: the latter is reused as a hermetic test fixture (the
|
|
191404
|
+
* `Given the "…" workflow` step) that must not depend on Prettier being
|
|
191405
|
+
* installed or spawn a subprocess at every steering-file gate.
|
|
191406
|
+
*/
|
|
191407
|
+
const MODES_SUGGESTION = {
|
|
191408
|
+
qa: { format: "npx prettier --write <%= it.file %>" },
|
|
191409
|
+
review: { format: "npx prettier --write <%= it.file %>" }
|
|
191410
|
+
};
|
|
191411
|
+
/**
|
|
191391
191412
|
* The bundled workflow templates `gtd init <name>` can scaffold, keyed by the
|
|
191392
191413
|
* name the user passes. Each value is the raw YAML text of the template file,
|
|
191393
191414
|
* imported as a string (tsdown's `.yaml` text loader / the vitest `rawMd`
|
|
@@ -191414,6 +191435,12 @@ const isWorkflowTemplateName = (name) => Object.prototype.hasOwnProperty.call(WO
|
|
|
191414
191435
|
* (they are workflow mechanics, not prompts). The bundled YAML template itself
|
|
191415
191436
|
* stays fully inline (it ships inside the single-file bundle); this function is
|
|
191416
191437
|
* the only place the split happens, at scaffold time.
|
|
191438
|
+
*
|
|
191439
|
+
* It also seeds a top-level `modes:` block (`MODES_SUGGESTION`) — a ready-to-
|
|
191440
|
+
* edit Prettier `format:` for the built-in `qa`/`review` steering-file modes —
|
|
191441
|
+
* so a fresh project auto-formats its steering files out of the box. This lives
|
|
191442
|
+
* here rather than in `renderInitConfig` so the latter stays a hermetic test
|
|
191443
|
+
* fixture (see `MODES_SUGGESTION`).
|
|
191417
191444
|
*/
|
|
191418
191445
|
const renderInitScaffold = (name) => {
|
|
191419
191446
|
const workflow = (0, import_dist$1.parse)(WORKFLOW_TEMPLATES[name]);
|
|
@@ -191429,6 +191456,7 @@ const renderInitScaffold = (name) => {
|
|
|
191429
191456
|
return {
|
|
191430
191457
|
config: JSON.stringify({
|
|
191431
191458
|
$schema: SCHEMA_URL,
|
|
191459
|
+
modes: MODES_SUGGESTION,
|
|
191432
191460
|
workflow
|
|
191433
191461
|
}, null, 2) + "\n",
|
|
191434
191462
|
prompts
|
package/docs/configuration.md
CHANGED
|
@@ -371,8 +371,10 @@ So for a state declaring `mode: qa`:
|
|
|
371
371
|
That is what makes the built-in modes extensible rather than all-or-nothing —
|
|
372
372
|
and the top-level key means a project can plug its formatter into whichever
|
|
373
373
|
workflow it scaffolded (`gtd init simple`/`advanced`) without re-declaring a
|
|
374
|
-
`modes:` block on the workflow itself.
|
|
375
|
-
|
|
374
|
+
`modes:` block on the workflow itself. **`gtd init` seeds exactly this block by
|
|
375
|
+
default** (the Prettier suggestion below), so a fresh repo already formats its
|
|
376
|
+
steering files — edit or drop it to taste. It sits alongside the `workflow:` key
|
|
377
|
+
in your `.gtdrc.json`:
|
|
376
378
|
|
|
377
379
|
```jsonc
|
|
378
380
|
// .gtdrc.json — the workflow from `gtd init`, plus your own markdown formatter
|
|
@@ -673,8 +675,26 @@ config references it via a `./gtd-prompts/<state>.md`
|
|
|
673
675
|
[file reference](#content-values-inline-or-a-file-reference) — gtd inlines it at
|
|
674
676
|
load time, so a prompt is editable Markdown and editing it changes the workflow
|
|
675
677
|
with no config edit. Human `message:` blocks and check `script:` bodies stay
|
|
676
|
-
inline in the config (they are workflow mechanics, not prompts).
|
|
677
|
-
|
|
678
|
+
inline in the config (they are workflow mechanics, not prompts).
|
|
679
|
+
|
|
680
|
+
It also seeds a top-level [`modes:`](#modes--pluggable-steering-file-modes)
|
|
681
|
+
block as a ready-to-edit suggestion — a Prettier `format:` for each built-in
|
|
682
|
+
steering-file mode the templates use:
|
|
683
|
+
|
|
684
|
+
```jsonc
|
|
685
|
+
"modes": {
|
|
686
|
+
"qa": { "format": "npx prettier --write <%= it.file %>" },
|
|
687
|
+
"review": { "format": "npx prettier --write <%= it.file %>" }
|
|
688
|
+
}
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
Only `format:` is declared, so gtd's built-in `qa`/`review` validators still do
|
|
692
|
+
the validating (the two halves layer independently). gtd ships no formatter, so
|
|
693
|
+
this is the one default it suggests: a fresh repo auto-formats its steering
|
|
694
|
+
files out of the box, and you edit or drop the block freely (swap Prettier for
|
|
695
|
+
dprint, point at a script, or delete the key).
|
|
696
|
+
|
|
697
|
+
The two templates:
|
|
678
698
|
|
|
679
699
|
- **`simple`** — the 10-state machine walked through in
|
|
680
700
|
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates): idle →
|