@davidbalzan/groundwork 0.3.1

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 (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +323 -0
  3. package/docs/DECISIONS.md +170 -0
  4. package/package.json +38 -0
  5. package/payload/doc-templates/COMMANDS.md +419 -0
  6. package/payload/doc-templates/DECISIONS.md +168 -0
  7. package/payload/doc-templates/FACTS.md +43 -0
  8. package/payload/doc-templates/GROUNDWORK_METHODOLOGY.md +1300 -0
  9. package/payload/doc-templates/STACK_MAP.md +90 -0
  10. package/payload/doc-templates/WORKSTREAMS.md +79 -0
  11. package/payload/doc-templates/_INDEX.md +54 -0
  12. package/payload/doc-templates/phases/README.md +36 -0
  13. package/payload/doc-templates/phases/templates/README.md +63 -0
  14. package/payload/doc-templates/phases/templates/TASK_TEMPLATE.md +302 -0
  15. package/payload/doc-templates/phases/templates/task_template_prompt.md +229 -0
  16. package/payload/doc-templates/templates/ARCHITECTURE_GUIDE_TEMPLATE.md +250 -0
  17. package/payload/doc-templates/templates/DESIGN_SYSTEM_TEMPLATE.md +336 -0
  18. package/payload/doc-templates/templates/DONE_TEMPLATE.md +21 -0
  19. package/payload/doc-templates/templates/PHASES_README_TEMPLATE.md +144 -0
  20. package/payload/doc-templates/templates/PHASE_README_TEMPLATE.md +142 -0
  21. package/payload/doc-templates/templates/PRD_TEMPLATE.md +348 -0
  22. package/payload/doc-templates/templates/PRODUCTION_ROADMAP_TEMPLATE.md +168 -0
  23. package/payload/doc-templates/templates/QUEUE_TEMPLATE.md +17 -0
  24. package/payload/doc-templates/templates/TECH_STACK_TEMPLATE.md +199 -0
  25. package/payload/scripts/check-task.mjs +98 -0
  26. package/payload/scripts/check-versions.mjs +113 -0
  27. package/payload/scripts/phase-status.mjs +69 -0
  28. package/payload/scripts/set-fact.mjs +86 -0
  29. package/payload/skills/add-data-layer/SKILL.md +129 -0
  30. package/payload/skills/check-task/SKILL.md +35 -0
  31. package/payload/skills/check-versions/SKILL.md +47 -0
  32. package/payload/skills/create-prd/SKILL.md +90 -0
  33. package/payload/skills/domain-model/SKILL.md +90 -0
  34. package/payload/skills/kickstart/SKILL.md +157 -0
  35. package/payload/skills/log-decision/SKILL.md +65 -0
  36. package/payload/skills/next/SKILL.md +65 -0
  37. package/payload/skills/plan-phase/SKILL.md +108 -0
  38. package/payload/skills/remember/SKILL.md +77 -0
  39. package/payload/skills/start-session/SKILL.md +52 -0
  40. package/payload/skills/update-workstreams/SKILL.md +60 -0
  41. package/src/cli.mjs +115 -0
  42. package/src/commands/add.mjs +39 -0
  43. package/src/commands/artifacts.mjs +24 -0
  44. package/src/commands/doctor.mjs +292 -0
  45. package/src/commands/init.mjs +147 -0
  46. package/src/commands/knowledge.mjs +148 -0
  47. package/src/commands/list.mjs +61 -0
  48. package/src/commands/status.mjs +96 -0
  49. package/src/commands/update.mjs +128 -0
  50. package/src/lib/adr-tripwire.mjs +171 -0
  51. package/src/lib/artifacts.mjs +124 -0
  52. package/src/lib/config.mjs +43 -0
  53. package/src/lib/fs.mjs +46 -0
  54. package/src/lib/log.mjs +22 -0
  55. package/src/lib/paths.mjs +36 -0
  56. package/src/lib/progress.mjs +26 -0
  57. package/src/lib/skills.mjs +42 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 David Balzan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,323 @@
1
+ # Groundwork
2
+
3
+ > An installable AI development workflow you **bolt onto any repo**. It gives your AI
4
+ > assistant persistent project context, a phase-based process, and deterministic helper
5
+ > scripts — working identically across **Claude Code**, **Cursor**, and **VS Code
6
+ > Copilot** from a single source.
7
+
8
+ It's a small CLI that installs the workflow into any repo — new or existing — and re-syncs
9
+ in place as it improves. (A bolt-on, not a template you fork.)
10
+
11
+ ```bash
12
+ npx github:davidbalzan/groundwork init # full workflow into the current repo
13
+ npx github:davidbalzan/groundwork init . --minimal # just the core 6 skills
14
+ ```
15
+
16
+ > **Private repo:** `npx github:...` needs GitHub auth (the `gh` CLI login is enough).
17
+ > Make it public with `gh repo edit davidbalzan/groundwork --visibility public`.
18
+
19
+ > **One-time per machine** (only if you use `/remember`): point Groundwork at your central
20
+ > knowledge repo — `groundwork knowledge link <path>` (or `export GROUNDWORK_KNOWLEDGE=<path>`
21
+ > in your shell profile). This is separate from `init` and machine-local — it doesn't travel.
22
+ > See [Cross-project knowledge](#cross-project-knowledge).
23
+
24
+ ---
25
+
26
+ ## Mental model
27
+
28
+ Groundwork is two separable pieces:
29
+
30
+ | | What it is | Where it lives |
31
+ | --- | --- | --- |
32
+ | **The workflow** | Skills + doc methodology + scripts | This repo — installed by `groundwork init` |
33
+ | **The starter** *(optional)* | A generic React/Hono monorepo to scaffold from | A separate starter repo; not required |
34
+
35
+ **Repo shape: works anywhere, monorepos recommended.** The Groundwork *tool* is a single
36
+ flat npm package (no workspaces, no build, zero runtime deps) and installs into **any**
37
+ repo — monorepo, single package, or split repos.
38
+
39
+ But in practice **agents work noticeably better in a monorepo**: one source tree to reason
40
+ over, shared types/contracts in one place, atomic cross-package changes, and — for swarms —
41
+ a **single coordination bus and one worktree space**. Split repos are supported, but you'd
42
+ run a `coord-mcp` bus **per module**, which adds coordination overhead and makes cross-repo
43
+ changes harder for agents to get right. So a monorepo isn't *required*, it's *recommended* —
44
+ which is why the methodology's `apps/web` + `apps/api` layout is the default shape.
45
+
46
+ ---
47
+
48
+ ## Design principles
49
+
50
+ These emerged from real use and shape every decision:
51
+
52
+ - **Harness-agnostic first.** The value lives in portable markdown skills + a plain
53
+ `node`/`npx` CLI — *not* harness-specific glue like session-start hooks. So it behaves
54
+ identically across Claude Code, Cursor, and parallel multi-agent / multi-harness runs.
55
+ - **Single source → generated.** Anything that would otherwise be duplicated is generated
56
+ from one source: IDE mirrors from `SKILL.md`, `ARTIFACTS.md` from a manifest, versions
57
+ from `STACK_MAP`. Drift is prevented by construction, not discipline.
58
+ - **Deterministic where the model is weak.** Counting, version checks, and drift detection
59
+ run as scripts/CLI (`check-task`, `groundwork status`, `doctor`) — not LLM guesswork.
60
+ - **Spec-first, minimal tests.** Rigor lives in the docs/spec; tests are an opt-in tripwire,
61
+ not a default (see methodology §4b — and its caveat for human handover).
62
+
63
+ ---
64
+
65
+ ## The flow
66
+
67
+ ```
68
+ ┌─────────────────────────── one-time ───────────────────────────┐
69
+ groundwork init ──▶ │ /create-prd ──▶ /kickstart ──▶ /check-versions ──▶ /plan-phase 1 │
70
+ └──────────────────────────────────────────────────────┬──────────┘
71
+
72
+ ┌──────────────────────────── per session / per stream ───────────────────┘
73
+
74
+ /start-session ─▶ …code… ─▶ /check-task ─▶ /update-workstreams ─▶ /log-decision (progress: `groundwork status`)
75
+
76
+ external coordinator ┘ (reads QUEUE, writes WORKSTREAMS + DONE)
77
+ ```
78
+
79
+ 1. **`init`** drops skills, IDE mirrors, docs, and scripts into the repo.
80
+ 2. **`/create-prd`** is the first step — the single product-discovery interview (problem,
81
+ users, goals, scope, requirements, high-level phases) → `docs/PRD.md`.
82
+ 3. **`/kickstart`** *consumes the PRD* to scaffold the project docs (tech stack,
83
+ architecture, roadmap, phases, WORKSTREAMS, QUEUE/DONE) — it does **not** re-ask what the
84
+ PRD already covered.
85
+ 4. **`/check-versions`** pins the stack to latest stable so `STACK_MAP.md` starts honest.
86
+ 5. **`/plan-phase N`** turns each phase into a checkbox task file and a `QUEUE.md` item.
87
+ 6. **Work loop:** `/start-session` loads context; `/check-task` marks tasks done and
88
+ `groundwork status` reports progress deterministically; `/update-workstreams` records live parallel work;
89
+ `/log-decision` captures ADRs.
90
+
91
+ ---
92
+
93
+ ## The skills
94
+
95
+ `min` = installed by `--minimal` · `opt` = optional (add with `groundwork add <name>`).
96
+ `mode` is how the VS Code mirror is generated: `ask` = read-only, `edit` = can modify files.
97
+
98
+ | Skill | min/opt | mode | What it does |
99
+ | ----- | ------- | ---- | ------------ |
100
+ | `kickstart` | min | edit | Scaffold all project docs **from the PRD** (tech stack, roadmap, phases, WORKSTREAMS, QUEUE/DONE) — no re-interview |
101
+ | `next` | min | ask | Flow coach — inspects project state and recommends the single best next step |
102
+ | `plan-phase` | min | edit | Turn a phase goal into a detailed task file + add it to QUEUE |
103
+ | `start-session` | min | ask | Load current context: active phase, recent decisions, next backlog item |
104
+ | `check-task` | min | edit | Mark a task done and recompute progress (uses a deterministic script) |
105
+ | `update-workstreams` | min | edit | Update `WORKSTREAMS.md` — live state of every parallel stream |
106
+ | `create-prd` | opt | edit | Guided 6-stage Product Requirements Document |
107
+ | `domain-model` | opt | edit | Build the ubiquitous-language glossary (`CONTEXT.md`) + bounded-context map |
108
+ | `log-decision` | opt | edit | Append an Architectural Decision Record to `DECISIONS.md` |
109
+ | `check-versions` | opt | edit | Audit dependencies vs latest stable; flag drift; refresh `STACK_MAP.md` |
110
+ | `add-data-layer` | opt | edit | Add an optional Drizzle + PostgreSQL data layer (DB is opt-in) |
111
+ | `remember` | opt | edit | Capture a cross-project lesson in the central git knowledge repo — quick note, or a formal ADR with `--adr` |
112
+
113
+ All twelve are authored once as `SKILL.md`; the Cursor and VS Code variants are
114
+ **generated** (see below).
115
+
116
+ ### Auto-execution
117
+
118
+ Every skill is **agent-invocable by default** — the assistant runs the right one on its
119
+ own when a skill's `description` matches the situation (e.g. it reaches for `next` when
120
+ you ask "what should I do now?"). You can still call any of them explicitly with
121
+ `/<name>`. None set `disable-model-invocation`, so nothing is locked to manual-only. The
122
+ quality of each `description` is what makes auto-selection accurate — keep them
123
+ action-oriented when you add skills.
124
+
125
+ ---
126
+
127
+ ## What gets installed
128
+
129
+ ```
130
+ your-repo/
131
+ ├── .claude/skills/<name>/SKILL.md # canonical skills (Claude Code)
132
+ ├── .cursor/commands/<name>.md # generated mirror (Cursor)
133
+ ├── .vscode/prompts/<name>.prompt.md # generated mirror (VS Code Copilot)
134
+ └── docs/
135
+ ├── GROUNDWORK_METHODOLOGY.md # the full methodology
136
+ ├── STACK_MAP.md # single source of truth for versions
137
+ ├── COMMANDS.md, _INDEX.md # command guide + Obsidian map of content
138
+ ├── WORKSTREAMS.md # live parallel-work state
139
+ ├── templates/ # doc templates /kickstart fills in
140
+ ├── phases/ # phase structure + task templates
141
+ └── .groundwork/
142
+ ├── VERSION # installed Groundwork version
143
+ └── scripts/ # deterministic helpers (below)
144
+ ```
145
+
146
+ Project-specific docs (`TECH_STACK.md`, `PRODUCTION_ROADMAP.md`, `PHASE*_TASKS.md`,
147
+ `QUEUE.md`, …) are generated by the skills, not by `init`.
148
+
149
+ ### Helper scripts (deterministic, not LLM-guessed)
150
+
151
+ Shipped to `docs/.groundwork/scripts/` and preferred by the matching skills:
152
+
153
+ | Script | Backs | Does |
154
+ | ------ | ----- | ---- |
155
+ | `check-task.mjs` | `/check-task` | Flip a checkbox, recompute `Overall Progress`, print % |
156
+ | `phase-status.mjs` | `groundwork status` / on-demand | Count checkboxes per phase, render progress bars |
157
+ | `check-versions.mjs` | `/check-versions` | `npm view` each stack dep, report pinned vs latest, exit non-zero if behind |
158
+
159
+ ---
160
+
161
+ ## Versions stay honest
162
+
163
+ Two mechanisms keep dependency versions from rotting:
164
+
165
+ 1. **One source of truth** — every version number lives only in `docs/STACK_MAP.md`
166
+ (pinned, latest-stable, and which files to touch when bumping). No other doc restates
167
+ a version; they link to it. Drift becomes impossible by construction.
168
+ 2. **A check baked into bootstrap** — `/kickstart` runs `/check-versions`, which queries
169
+ the registry and flags anything a major behind. Re-run it anytime; it updates
170
+ `STACK_MAP.md` and the audit date. Major bumps are recommended as their own
171
+ workstream (branch + build/test verify), never inline with feature work.
172
+
173
+ ---
174
+
175
+ ## Docs stay honest (`doctor`)
176
+
177
+ Living docs are only worth trusting if they can't quietly lie. `groundwork doctor` is a
178
+ deterministic, **offline** lint for doc↔reality drift:
179
+
180
+ - orphaned `[[wikilinks]]` (alias-aware — respects each note's frontmatter `aliases:`),
181
+ - phases 100%-done in tasks but not marked complete,
182
+ - PRDs missing core sections, phase dirs with no tasks file,
183
+ - a stale `VERSION` marker or `STACK_MAP` audit,
184
+ - **ADR tripwire** — an *Accepted* ADR whose rejected alternative (its "Alternatives Considered"
185
+ rows) now appears as a dependency in any `package.json` or as a top-level/workspace directory
186
+ (`react-native`/`expo`/`ios/` after "PWA over native", `bcrypt` after "magic link over
187
+ password", …). Either supersede the ADR or record a fact `adr-NNN-accepted-deviation` in
188
+ `FACTS.md` to silence it. Field case: two ADRs silently reversed in one week and stayed
189
+ Accepted for five months — the docs agents read every session were wrong.
190
+
191
+ It exits non-zero on issues, so it drops straight into a pre-commit hook or CI. It's the
192
+ *enforcement* third of a loop: the **manifest** keeps the doc list single-sourced,
193
+ **`update --docs`** refreshes the generic docs, and **`doctor`** flags what drifted.
194
+
195
+ Honest boundary: `doctor` catches *structural / consistency* drift, **not** whether prose
196
+ matches the running code — that still needs you or the agent (or the optional test tripwire).
197
+ The ADR tripwire is keyword-based (`src/lib/adr-tripwire.mjs` `ALIASES` maps alternative names
198
+ to package/dir tokens — extend it); it catches the reversal that shows up as a dependency or a
199
+ folder, not one that is pure code.
200
+
201
+ ---
202
+
203
+ ## Data layer is opt-in
204
+
205
+ The starter ships **no database** — it stays generic. When a feature actually needs
206
+ persistence, run `/add-data-layer` (Drizzle ORM + PostgreSQL by default; MySQL/SQLite
207
+ supported). It wires the client, schema, migrations, env, docker service, and scripts,
208
+ pins to latest stable, and records an ADR. Until then, nothing about a DB clutters the
209
+ project.
210
+
211
+ ---
212
+
213
+ ## Cross-project knowledge
214
+
215
+ Lessons that outlive a single project live in a **central git knowledge repo** — one
216
+ **per user**, not bundled with Groundwork. Set yours up once:
217
+
218
+ ```bash
219
+ groundwork knowledge init # scaffold ~/groundwork-knowledge + save the path
220
+ # or point at an existing clone:
221
+ groundwork knowledge link ~/path/to/your-knowledge-repo
222
+ groundwork knowledge sync [--push] # pull latest from origin (and optionally push)
223
+ groundwork knowledge path # show what's resolved
224
+ ```
225
+
226
+ **Sync behaviour:** `/remember` **pulls from origin before writing** and
227
+ **pushes after** — so the log stays current across machines and the swarm, and you never
228
+ write onto stale state. Run `groundwork knowledge sync` yourself to freshen a clone (e.g.
229
+ when you start on a new machine — `init` installs the project workflow, it does not touch
230
+ your separate knowledge repo).
231
+
232
+ The location resolves per user, in order: **`$GROUNDWORK_KNOWLEDGE`** → the saved user
233
+ config (`~/.config/groundwork/config.json`) → otherwise the skills tell you to run the
234
+ setup above. There is **no hardcoded/shared default** — your ADRs go in your repo.
235
+
236
+ - **`/remember`** appends a dated note (`notes/lessons.md`), commits, pushes.
237
+ - **`/remember --adr`** promotes a lesson into a formal ADR (`adr/NNNN-*.md`) and updates the index — for decisions that are hard-to-reverse, surprising, and a real trade-off.
238
+
239
+ Both are tool-agnostic (git + markdown), so the swarm and any assistant share one log.
240
+ Project-specific decisions still go in that project's `docs/DECISIONS.md` via `/log-decision`.
241
+
242
+ ## Multi-agent seam (optional)
243
+
244
+ Groundwork runs **solo out of the box** — a one-row `WORKSTREAMS.md`, no coordinator. When
245
+ you want a swarm, it hands off via a file contract split by writer, without absorbing the orchestration:
246
+
247
+ - **`QUEUE.md`** — the *inbound* queue. `/plan-phase` and you write it (and nobody else); one item per phase.
248
+ - **`WORKSTREAMS.md`** — the *live* state. The coordinator/workers (and `/update-workstreams`)
249
+ write it as work proceeds.
250
+ - **`DONE.md`** — the *completion log*. The executor appends one line per completed item
251
+ (its only write in the queue seam).
252
+
253
+ **One-way dependency:** the coordinator depends on Groundwork's seam, **never the reverse** —
254
+ Groundwork has no knowledge of any coordinator and works fully without one. The reference
255
+ implementation is **`coord-mcp`**, an MCP-based coordination server (harness-agnostic, same
256
+ principle as Groundwork) that's an optional layer on top. Any orchestrator honouring the two
257
+ files drops in just as well — rooms, worktrees, and messaging stay entirely outside Groundwork.
258
+
259
+ ---
260
+
261
+ ## Supported harnesses
262
+
263
+ One `init` installs the same workflow into **three** AI coding harnesses, each in its native
264
+ location:
265
+
266
+ | Harness | Skills installed to | Format |
267
+ | ------- | ------------------- | ------ |
268
+ | **Claude Code** | `.claude/skills/<name>/SKILL.md` | canonical source (frontmatter + body) |
269
+ | **Cursor** | `.cursor/commands/<name>.md` | generated mirror (skill body, no frontmatter) |
270
+ | **VS Code Copilot** | `.vscode/prompts/<name>.prompt.md` | generated mirror (`mode: ask`/`edit`) |
271
+
272
+ The CLI itself is plain `node`/`npx` and the docs are portable markdown, so the workflow also
273
+ runs unchanged in any other agent or in parallel multi-agent / multi-harness setups — those
274
+ three are the harnesses with first-class generated skill mirrors.
275
+
276
+ ## How the IDE mirrors stay in sync
277
+
278
+ `SKILL.md` (Claude Code) is the only hand-edited source. `init`, `update`, and `add` regenerate:
279
+
280
+ - **Cursor** (`.cursor/commands/*.md`) — the skill body, no frontmatter.
281
+ - **VS Code** (`.vscode/prompts/*.prompt.md`) — `mode: ask` when the skill's
282
+ `allowed-tools` are read-only (`Read, Glob, Grep`), else `mode: edit`.
283
+
284
+ Both carry a `GENERATED … do not edit by hand` banner. Edit the skill, run
285
+ `groundwork update`, and all three harnesses move together.
286
+
287
+ ---
288
+
289
+ ## Commands
290
+
291
+ | Command | Purpose |
292
+ | ------- | ------- |
293
+ | `groundwork init [dir]` | Install skills + IDE mirrors + docs + scripts (`--minimal`, `--force`) |
294
+ | `groundwork update [dir]` | Upgrade skills + mirrors + helper scripts in place (leaves your project docs alone). `--all` installs skills added upstream; `--docs` refreshes the generic reference docs (methodology, COMMANDS, _INDEX, ARTIFACTS) |
295
+ | `groundwork artifacts [dir]` | Regenerate `docs/ARTIFACTS.md` from the manifest |
296
+ | `groundwork add <skill> [dir]` | Add one optional skill and its mirrors |
297
+ | `groundwork list [dir]` | List skills with install state, minimal/optional, and mode |
298
+ | `groundwork status [dir]` | Live workstreams + next backlog item + phase progress |
299
+ | `groundwork doctor [dir]` | Flag doc↔reality drift: orphaned wikilinks, phases 100%-done but not marked, stale version marker / versions audit |
300
+ | `groundwork knowledge <init\|link\|path>` | Configure your per-user central ADR/lessons repo |
301
+ | `groundwork help` / `version` | Usage / version |
302
+
303
+ ---
304
+
305
+ ## This repo's structure
306
+
307
+ ```
308
+ src/cli.mjs # entry + command dispatch
309
+ src/commands/*.mjs # init · update · add · list · status · doctor · artifacts · knowledge
310
+ src/lib/*.mjs # skills (parse + mirror gen) · artifacts (manifest) · fs · paths · progress · config · log
311
+ payload/skills/ # the 12 canonical SKILL.md files (the single source)
312
+ payload/doc-templates/ # docs scaffold (methodology, STACK_MAP, templates, phases, WORKSTREAMS)
313
+ payload/scripts/ # project-side deterministic helpers
314
+ docs/DECISIONS.md # ADRs about Groundwork itself
315
+ MIGRATION_PLAN.md # how/why it became a bolt-on
316
+ ```
317
+
318
+ Plain Node ESM (`>=20`), zero runtime dependencies, no build step. To add a skill: drop
319
+ a `SKILL.md` in `payload/skills/<name>/`, then `groundwork update` any project to pull it.
320
+
321
+ ## License
322
+
323
+ MIT © David Balzan
@@ -0,0 +1,170 @@
1
+ ---
2
+ title: "Groundwork — Architectural Decisions"
3
+ tags: [groundwork/reference]
4
+ aliases: ["Groundwork ADRs"]
5
+ ---
6
+
7
+ # Groundwork — Architectural Decision Records
8
+
9
+ Decisions about **Groundwork itself** (the tool). Project-level ADRs live in each
10
+ project's own `docs/DECISIONS.md` (scaffolded from the payload template).
11
+
12
+ | ID | Decision | Status | Date |
13
+ | ------- | ---------------------------------------------------- | -------- | ---------- |
14
+ | ADR-001 | Install-model bolt-on, not a fork-a-template repo | Accepted | 2026-06-29 |
15
+ | ADR-002 | Single canonical skill source → generated IDE mirrors | Accepted | 2026-06-29 |
16
+ | ADR-003 | Workstreams replace single "current focus" | Accepted | 2026-06-29 |
17
+ | ADR-004 | Database is opt-in, not in the base starter | Accepted | 2026-06-29 |
18
+ | ADR-005 | STACK_MAP is the single source of truth for versions | Accepted | 2026-06-29 |
19
+ | ADR-006 | Coordinator stays external; integrate via seam files | Accepted | 2026-06-29 · amended 2026-08-16 |
20
+
21
+ ---
22
+
23
+ ## ADR-001: Install-model bolt-on, not a fork-a-template repo
24
+
25
+ **Status**: Accepted · **Date**: 2026-06-29
26
+
27
+ ### Context
28
+
29
+ Groundwork began as a template monorepo you fork. That created recurring friction:
30
+ renaming every `groundwork`/`@groundwork` reference per project, no way to receive
31
+ upstream improvements, and it only worked for greenfield repos.
32
+
33
+ ### Decision
34
+
35
+ Ship Groundwork as an installable CLI (`npx github:davidbalzan/groundwork init`) that
36
+ lays the workflow into any existing repo and can re-sync via `update`.
37
+
38
+ ### Consequences
39
+
40
+ **Positive:** no rename churn; works on existing repos; upgradeable in place; the
41
+ "starter monorepo" becomes an optional, separate concern.
42
+ **Negative:** a CLI to maintain; install/update edge cases (handled with safe-copy +
43
+ `--force`).
44
+
45
+ ### Alternatives Considered
46
+
47
+ | Alternative | Why Not |
48
+ | ----------- | ------- |
49
+ | Keep template repo | Rename pain, no upgrades, greenfield-only |
50
+ | Script-only (no CLI) | No `add`/`update`/`status` ergonomics |
51
+ | Full npm publish now | Deferred — git/`npx`-from-GitHub first, publish once proven |
52
+
53
+ ---
54
+
55
+ ## ADR-002: Single canonical skill source → generated IDE mirrors
56
+
57
+ **Status**: Accepted · **Date**: 2026-06-29
58
+
59
+ ### Context
60
+
61
+ The template kept three hand-maintained copies of each command (`.claude/skills`,
62
+ `.cursor/commands`, `.vscode/prompts`). They had already drifted — Cursor copies were
63
+ written in a different style than the Claude skills.
64
+
65
+ ### Decision
66
+
67
+ `SKILL.md` is the only source. `init`/`update`/`add` generate the Cursor and VS Code
68
+ mirrors. VS Code `mode` is derived: `ask` when `allowed-tools` are only read tools
69
+ (`Read, Glob, Grep`), else `edit`. Mirrors carry a `GENERATED` banner.
70
+
71
+ ### Consequences
72
+
73
+ **Positive:** zero drift; add a skill once; consistent across IDEs.
74
+ **Negative:** hand-tuned per-IDE wording is lost (acceptable — consistency wins).
75
+
76
+ ---
77
+
78
+ ## ADR-003: Workstreams replace single "current focus"
79
+
80
+ **Status**: Accepted · **Date**: 2026-06-29
81
+
82
+ ### Context
83
+
84
+ `CURRENT_FOCUS.md` assumes one active task. With multi-agent swarms, several streams
85
+ run at once and a single focus file becomes misleading.
86
+
87
+ ### Decision
88
+
89
+ Replace it with `WORKSTREAMS.md` — a table of active streams (owner/agent, branch ·
90
+ worktree, status, blocker). `update-focus` → `update-workstreams`. Solo work is the
91
+ one-row case.
92
+
93
+ ### Consequences
94
+
95
+ **Positive:** honest under parallelism; scales solo→fleet; records resume context.
96
+ **Negative:** a table is slightly heavier than a focus blurb (worth it).
97
+
98
+ ---
99
+
100
+ ## ADR-004: Database is opt-in, not in the base starter
101
+
102
+ **Status**: Accepted · **Date**: 2026-06-29
103
+
104
+ ### Context
105
+
106
+ The methodology documented Drizzle/MySQL/PostgreSQL/Zustand as if they shipped, but the
107
+ starter had none of them — a phantom stack that broke anyone following the docs.
108
+
109
+ ### Decision
110
+
111
+ Keep the starter generic (no DB/ORM/state lib). Deliver persistence as the optional
112
+ `/add-data-layer` skill (Drizzle + PostgreSQL by default). Docs describe it as opt-in.
113
+
114
+ ### Consequences
115
+
116
+ **Positive:** docs match reality; the starter stays universal.
117
+ **Negative:** a DB-needing project runs one extra step (`/add-data-layer`).
118
+
119
+ ---
120
+
121
+ ## ADR-005: STACK_MAP is the single source of truth for versions
122
+
123
+ **Status**: Accepted · **Date**: 2026-06-29
124
+
125
+ ### Context
126
+
127
+ Versions were restated across README, methodology, STACK_MAP, and templates — and had
128
+ already contradicted (Vite listed as 6.x and 7.x in different files).
129
+
130
+ ### Decision
131
+
132
+ `STACK_MAP.md` holds the only version numbers (pinned + latest-stable + files-to-change).
133
+ Every other doc links to it instead of restating versions.
134
+
135
+ ### Consequences
136
+
137
+ **Positive:** drift becomes impossible by construction.
138
+ **Negative:** must keep the audit date current (noted in the file).
139
+
140
+ ---
141
+
142
+ ## ADR-006: Coordinator stays external; integrate via seam files
143
+
144
+ **Status**: Accepted · **Date**: 2026-06-29 · **Amended**: 2026-08-16
145
+
146
+ ### Context
147
+
148
+ Multi-agent orchestration (coordinator/worker over a bus) is used alongside Groundwork.
149
+ Folding it in would couple a generic workflow to specific swarm tooling.
150
+
151
+ The original contract named two files (`BACKLOG.md` + `WORKSTREAMS.md`). The backlog
152
+ split into `QUEUE.md` + `DONE.md` (one writer per file), and `FACTS.md` became the
153
+ verified world-model. The coordinator still stays external.
154
+
155
+ ### Decision
156
+
157
+ Keep the coordinator external. The integration is the Groundwork seam, owned by
158
+ `@davidbalzan/groundwork-seam`:
159
+
160
+ - `docs/QUEUE.md` — inbound (human / aide)
161
+ - `docs/WORKSTREAMS.md` — live board (`workstreams.v1`: 6-col Active Streams)
162
+ - `docs/DONE.md` — completion log (coordinator, append-only)
163
+ - `docs/FACTS.md` — verified world-state (whoever verified the fact)
164
+
165
+ ### Consequences
166
+
167
+ **Positive:** Groundwork stays portable across orchestration layers.
168
+ **Negative:** the contract must be respected by both sides (documented in the methodology).
169
+ **Amendment:** 5-col MCP Lanes tables still parse as `workstreams.lanes-v0`; they are not
170
+ a write grammar. New 5-col writes fail `groundwork doctor` and mutating `export_work`.
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@davidbalzan/groundwork",
3
+ "version": "0.3.1",
4
+ "description": "Groundwork — an installable AI development workflow (skills + doc methodology) you bolt onto any repo.",
5
+ "type": "module",
6
+ "bin": {
7
+ "groundwork": "src/cli.mjs"
8
+ },
9
+ "engines": {
10
+ "node": ">=20"
11
+ },
12
+ "files": [
13
+ "src",
14
+ "payload",
15
+ "docs",
16
+ "README.md"
17
+ ],
18
+ "keywords": [
19
+ "ai",
20
+ "claude-code",
21
+ "cursor",
22
+ "copilot",
23
+ "workflow",
24
+ "scaffold",
25
+ "skills",
26
+ "methodology"
27
+ ],
28
+ "author": "David Balzan",
29
+ "license": "MIT",
30
+ "dependencies": {
31
+ "@davidbalzan/groundwork-seam": "0.1.0"
32
+ },
33
+ "scripts": {
34
+ "groundwork": "node src/cli.mjs",
35
+ "test": "node --test test/*.test.mjs",
36
+ "test:init": "node src/cli.mjs init /tmp/groundwork-smoke --force && node src/cli.mjs list /tmp/groundwork-smoke && node src/cli.mjs status /tmp/groundwork-smoke"
37
+ }
38
+ }