gnd-workflow 0.1.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.
@@ -0,0 +1,184 @@
1
+ ---
2
+ name: "gnd-chart"
3
+ description: "Structured plan format for manual planning and navigator-led execution. Use when charting multi-step plans intended for @gnd-navigator to dispatch as legs via runSubagent in any project."
4
+ user-invocable: true
5
+ disable-model-invocation: true
6
+ contracts:
7
+ - navigator-gates-unconfirmed
8
+ ---
9
+ # Chart
10
+
11
+ Plan multi-step work as structured legs for `@gnd-navigator` to dispatch to `gnd-diver`.
12
+
13
+ ## Workflow Role
14
+
15
+ Break the user's goal into bounded, reviewable legs. Project constraints come from project guidance sources, not hidden assumptions.
16
+
17
+ ## Project Context Resolution
18
+
19
+ Identify authoritative guidance in priority order:
20
+
21
+ 1. User request and attachments
22
+ 2. Workspace instructions
23
+ 3. `README.md` and area docs
24
+ 4. Skills, file instructions, or agent files referenced by those docs
25
+ 5. Build, test, packaging, deployment, or CI config
26
+
27
+ Read only what matters. Record useful sources in the plan's `## Project Context`.
28
+
29
+ ---
30
+
31
+ ## Workflow
32
+
33
+ ```text
34
+ Discovery → Alignment → Draft → Workshop → Refinement
35
+ ```
36
+
37
+ ### Phase 1 — Discovery
38
+
39
+ Explore the codebase: read relevant files, run searches, identify affected modules. Skim archived plans or critiques for prior corrections if they exist. Do not write legs yet.
40
+
41
+ ### Phase 2 — Alignment
42
+
43
+ One round after Discovery. Summarize findings, then ask scope/approach questions. At minimum: (a) in-scope vs out-of-scope, (b) non-obvious tradeoffs, (c) genuine ambiguities. Skip only when the task maps to a single unambiguous leg.
44
+
45
+ ### Phase 3 — Draft
46
+
47
+ Present a **plan outline** — not full legs:
48
+
49
+ - Plan title
50
+ - Leg list: ID, label, one-line intent
51
+ - Proposed dispatch order
52
+
53
+ ### Phase 4 — Workshop
54
+
55
+ After the draft, automatically workshop each leg:
56
+
57
+ 1. Present legs one at a time (group tightly coupled ones at your discretion).
58
+ 2. For each leg, show in chat:
59
+ - Title, ID
60
+ - **Goal link** — one sentence connecting this leg to the user's overall goal
61
+ - 2–3 bullets of key intent
62
+ - Owned files
63
+ - One alternative or tradeoff if applicable; otherwise state "mechanical"
64
+ 3. Ask the user. Options: **Approve as-is** (recommended), concrete alternatives from the summary, **Remove**. Freeform always available.
65
+ 4. Apply feedback immediately. Move to next leg.
66
+ 5. Mark confirmed legs `Confirmed: yes`.
67
+
68
+ Do not advance until all legs are confirmed or removed.
69
+
70
+ ### Phase 5 — Refinement
71
+
72
+ **User Intent confirmation.** Present a 2–4 sentence summary of the user's goal distilled from the conversation. Ask: "Does this capture your goal?" Options: **Looks right** (recommended), **Needs revision**. Update and re-confirm if revised.
73
+
74
+ Then write the full plan with all fields. Output only:
75
+ 1. Changes made during workshop
76
+ 2. Any unconfirmed legs
77
+ 3. Final dispatch order
78
+
79
+ The plan file is the source of truth — do not paste the full plan into chat.
80
+
81
+ ---
82
+
83
+ ## Re-entry Triggers
84
+
85
+ **"review"** or **"walk me through it"**: re-enter workshop for unconfirmed legs, or ask which confirmed leg to revisit. Confirmed legs are not re-presented unless a subsequent change significantly alters their scope.
86
+
87
+ ---
88
+
89
+ ## Plan File Location
90
+
91
+ Plans live in `.planning/` as `active-plan-YYYY-MM-DD-HHmm-<slug>.md`.
92
+
93
+ - View existing plans first; leave them in place.
94
+ - Each plan gets its own timestamped file. Multiple live plans may coexist.
95
+ - Only one plan should be actively dispatched at a time.
96
+ - After implementation, leave the plan for critique. `gnd-critique` appends findings then archives.
97
+
98
+ ---
99
+
100
+ ## Plan Structure
101
+
102
+ ```markdown
103
+ # Plan: [Short Title]
104
+
105
+ ## Project Context
106
+ - Sources:
107
+ - `path/to/doc.md` - why it matters
108
+ - Constraints:
109
+ - [Derived rules]
110
+ - Full validation:
111
+ - `command` or checklist
112
+ - Delivery verification:
113
+ - deployed URL, package check, artifact check, local-only, or `none`
114
+
115
+ ## User Intent
116
+ [2-4 sentences confirmed by user during Refinement. Navigator and critique
117
+ reference this to evaluate alignment.]
118
+
119
+ ## Legs
120
+
121
+ ### LEG-1: [Area] - [Short description]
122
+ - Status: pending
123
+ - Confirmed: yes | no
124
+ - Goal link: [How this leg serves the User Intent]
125
+ - Depends on: none | LEG-N
126
+ - Owned files:
127
+ - `path/to/file.ts`
128
+ - Read-only:
129
+ - `path/to/reference.ts` - reason
130
+ - Deferred shared edits:
131
+ - `shared/file.ts` - what to change
132
+ - Verification: `command`
133
+ - Intent: [Detailed implementation description]
134
+
135
+ ## Dispatch Order
136
+ Sequential via runSubagent (navigator reviews between each):
137
+ 1. LEG-1 (label) - no dependencies
138
+ 2. LEG-2 (label) - depends on LEG-1
139
+ After all complete: deferred edits → full validation → delivery verification → commit → push.
140
+ ```
141
+
142
+ ---
143
+
144
+ ## Field Definitions
145
+
146
+ | Field | Notes |
147
+ |-------|-------|
148
+ | **Status** | `pending`, `in-progress`, `done`, `failed`. Only navigator updates during dispatch. |
149
+ | **Confirmed** | `yes`/`no`. Set to `yes` on user approval in workshop. Navigator won't dispatch `no`. |
150
+ | **Depends on** | `none` or a leg ID. Dispatch Order makes the sequence explicit. |
151
+ | **Dispatch agent** | Always `gnd-diver`. If a leg seems too vague, tighten the intent or split it — don't assign a different agent. |
152
+ | **Owned files** | Exhaustive list the sub-agent may modify. No globs. One leg per file — never split. Grep during Draft/Workshop to confirm targets exist. |
153
+ | **Read-only** | Reference files the sub-agent reads but must not modify. Include a reason. |
154
+ | **Deferred shared edits** | Changes to shared files (`package.json`, routers, etc.) the navigator applies after all legs complete. Be precise. |
155
+ | **Verification** | Single shell command covering only this leg's files. Not the project's full gate. For test legs: list explicit per-file expected assertions. |
156
+ | **Intent** | The critical field. Must be **specific** (name functions, interfaces, selectors), **self-contained** (embed needed constraints), **outcome-oriented** (what code does when done), and **bounded** (number sub-tasks). |
157
+
158
+ ---
159
+
160
+ ## Scoping Guidelines
161
+
162
+ - **One module or feature per leg** when files are tightly coupled. Don't split types and state that always change together.
163
+ - **Split by independence** when modules don't share types.
164
+ - **Maximize parallelism** — minimize serial dependency chains.
165
+ - **≤15 owned files per leg.** Larger → find a seam to split on.
166
+ - **Shared files** (`package.json`, `build.ts`, routers, shared styles) never appear in owned sets. Use deferred shared edits.
167
+
168
+ ---
169
+
170
+ ## Embedding Project Constraints
171
+
172
+ Leg intents must embed relevant project constraints so sub-agents don't rediscover them. Common categories: performance/bundle budgets, layout checkpoints, accessibility, content/copy rules, state/persistence, styling/design-system, build/test/release, motion/audio/media. Include only what affects each leg.
173
+
174
+ ---
175
+
176
+ ## Dispatch Order Section
177
+
178
+ List legs in dispatch order. Note dependencies and parallelism. End with:
179
+
180
+ ```markdown
181
+ After all complete: deferred edits → `## Project Context` full-validation → delivery verification → commit → push.
182
+ ```
183
+
184
+ Project-specific sync, packaging, or publish steps belong in `## Project Context`.
@@ -0,0 +1,200 @@
1
+ ---
2
+ name: "gnd-critique"
3
+ description: "Evaluate completed work against intent and delivered behavior. Two modes: plan critique (evaluates an implemented live plan after @gnd-navigator execution) and field review (--field-review / --fr, triages runtime or workflow observations, implements fixes, and archives findings)."
4
+ user-invocable: true
5
+ disable-model-invocation: true
6
+ ---
7
+ # Critique
8
+
9
+ Evaluate delivered work against the plan. Validation and delivery checks come from the plan's `## Project Context`, workspace instructions, READMEs, and skills.
10
+
11
+ Two modes — detect from invocation:
12
+
13
+ | Flag | Mode | When |
14
+ |------|------|------|
15
+ | *(default)* | Plan critique | After a navigator-led plan is implemented and validated. Requires an implemented live plan. |
16
+ | `--field-review` / `--fr` | Field review | Runtime, delivery, or workflow observations that don't map to a critique target. No target required. |
17
+
18
+ ---
19
+
20
+ ## Mode: Field Review
21
+
22
+ User tests the delivered system and reports observations.
23
+
24
+ ### FR Phase 1 — Gather Context
25
+
26
+ For process-only reviews (memory-path conflicts, workflow bugs), skip inapplicable delivery checks — read workflow files and `.planning/` state instead.
27
+
28
+ 1. **Determine evaluation surface.** Use the user's report plus `## Project Context`, workspace instructions, READMEs, and skills to decide: deployed web, local runtime, package/artifact, or pure workflow.
29
+ 2. **Verify delivery** when the evaluation surface (step 1) is deployed, published, or has a preview — check the live surface. If the surface is local-only, workflow-only, or has no delivery verification defined, mark not applicable.
30
+ 3. **Inspect real surface** when applicable via `fetch_webpage` or similar.
31
+ 4. **Read relevant code/process files** based on user observations. Enough to form hypotheses, not the whole codebase.
32
+ 5. **Check archived plans.** Skim `.planning/archive/` for recent plans touching affected areas.
33
+
34
+ ### FR Phase 2 — Triage
35
+
36
+ Classify each observation:
37
+
38
+ | Category | Meaning | Output |
39
+ |----------|---------|--------|
40
+ | **Bug** | Broken — visible defect, wrong behavior | Root cause hypothesis with file + line refs |
41
+ | **UX issue** | Works but wrong feel — confusing, inconsistent | Description + what "right" looks like, with code evidence |
42
+ | **Design question** | Not clearly a bug — questioning a decision | Restate original intent, note concern, flag for planning |
43
+ | **Recurring** | Previously flagged in a prior critique/cycle | Link to prior finding, escalate priority |
44
+
45
+ Per observation: what the user reported, category, evidence (code refs, surface observations, prior findings), hypothesis, severity (blocker/high/medium/low).
46
+
47
+ ### FR Phase 3 — Findings & Plan
48
+
49
+ Present triaged findings, then propose an implementation plan:
50
+
51
+ ```text
52
+ ## Field Review: [Area]
53
+ Date: [date]
54
+ Delivery: [verified / mismatch / not applicable]
55
+
56
+ ### Findings
57
+ #### 1. [Title]
58
+ - Reported: [user's words]
59
+ - Category: Bug / UX issue / Design question / Recurring
60
+ - Severity: blocker / high / medium / low
61
+ - Evidence: [refs]
62
+ - Hypothesis: [root cause + fix location]
63
+
64
+ ### Implementation Plan
65
+ Ordered fixes with files and approach. Design questions flagged for user decision.
66
+
67
+ ### Process Observations
68
+ Process-level corrections if findings reveal a gap. Otherwise omit.
69
+ ```
70
+
71
+ ### FR Phase 4 — Implement
72
+
73
+ Fix bugs and UX issues in severity order (blockers first). Design questions → present to user first. Run tests after each fix.
74
+
75
+ ### FR Phase 5 — Deploy & Verify
76
+
77
+ 1. Run full validation from `## Project Context` / workspace instructions / READMEs / skills.
78
+ 2. Commit and push (when in scope) with a descriptive message.
79
+ 3. Verify delivery yourself — don't ask the user to check first.
80
+ 4. Tell user any needed refresh/update step only if the surface requires it.
81
+ 5. User re-verifies. Persistent findings → another Phase 4 round.
82
+ 6. **Archive.** Create `.planning/archive/<YYYY-MM-DD>-field-review-<slug>.md` with findings + implementation + verification.
83
+ 7. Update process files if findings reveal a gap.
84
+
85
+ ---
86
+
87
+ ## Mode: Plan Critique
88
+
89
+ After `@gnd-navigator` implements and validates a plan.
90
+
91
+ ```text
92
+ Gather Context → Interactive Review → Analysis → Findings → Apply
93
+ ```
94
+
95
+ ### PC Phase 1 — Gather Context
96
+
97
+ 1. **Resolve critique target.** List `.planning/` (exclude `archive/`). Supports `active-plan-*.md`.
98
+ - Prefer a plan with `## Implementation` and no `## Critique`.
99
+ - User-selected plan takes priority.
100
+ - One candidate → select it. Multiple → ask.
101
+
102
+ 2. **Read implementation.** Use the commit SHA from `## Implementation` to review the change. Check the commit's file summary and targeted diffs.
103
+
104
+ 3. **Resolve validation context.** From `## Project Context`, or derive from workspace instructions, READMEs, skills, and CI config.
105
+
106
+ 4. **Verify delivery** if the project defines a delivery surface. Failed validation/delivery is a blocker.
107
+
108
+ 5. **Inspect real surface** when applicable.
109
+
110
+ 6. **Read process files.** Targeted reads of:
111
+ - `.agents/skills/gnd-chart/SKILL.md`
112
+ - `.agents/skills/gnd-critique/SKILL.md`
113
+ - `.agents/agents/gnd-navigator.agent.md`
114
+ - `.agents/agents/gnd-diver.agent.md`
115
+
116
+
117
+ ### PC Phase 2 — Interactive Review
118
+
119
+ Three beats to surface gaps before automated analysis.
120
+
121
+ **Beat 1 — Intent Check.** Show `## User Intent` from the plan. Ask: *"Does this still capture what you wanted?"* Options: **Yes** (recommended), **Needs adjustment**.
122
+ - If confirmed → Beat 2.
123
+ - If "yeah, but also X" → **chart gap** (workshop failed to capture this). Flag immediately as `gnd-chart` correction.
124
+ - If substantial revision → update User Intent, re-evaluate legs.
125
+
126
+ **Beat 2 — Leg Walkthrough.** One at a time (or grouped by area). Show what *actually shipped* from the diff, not the plan's intent. Ask: *"How did this land?"* Options: **Landed well**, **Has issues**, **Didn't notice it**.
127
+
128
+ Anchor to plan scope. Off-topic observations → triage (below).
129
+
130
+ **Beat 3 — Open Impressions.** *"Anything else you noticed?"* Triage all responses.
131
+
132
+ **Off-topic triage:**
133
+
134
+ | Signal | Class | Action |
135
+ |--------|-------|--------|
136
+ | Relates to User Intent but no leg covers it | Chart gap | Flag as `gnd-chart` correction |
137
+ | Unrelated area plan didn't touch | Out of scope | Add to Field Review Holding List |
138
+ | Ambiguous | Clarify | Ask user, then classify |
139
+
140
+ ### PC Phase 3 — Analysis
141
+
142
+ Cross-reference plan, code, user observations, and triage to identify:
143
+
144
+ 1. **Intent-vs-implementation gaps** — scope creep, incomplete implementation, drift.
145
+ 2. **Delivered-behavior issues** — match bugs/UX gaps to specific legs. Root cause: bad plan, bad execution, or unforeseen interaction?
146
+ 3. **Chart gaps** — for each, identify which charting phase failed (Discovery/Alignment/Workshop) and why.
147
+ 4. **User effectiveness patterns** — vague prompt context, unstated scope. Collaborative observations to help tighten future chart-time input.
148
+ 5. **Process patterns** — recurring problems across legs, leg shapes that worked well or poorly, navigator review gaps.
149
+
150
+ ### PC Phase 4 — Findings
151
+
152
+ Present structured findings before applying:
153
+
154
+ ```text
155
+ ## Critique Findings: [Plan Title]
156
+
157
+ ### What Worked
158
+ - [Evidence-backed positives]
159
+
160
+ ### What Didn't
161
+ - [Problems tied to specific legs or steps]
162
+
163
+ ### Chart Gaps
164
+ - [Missing intent facets + which chart phase failed and why]
165
+
166
+ ### User Effectiveness
167
+ - [Collaborative prompting observations]
168
+
169
+ ### Blockers
170
+ - [Validation/delivery failures]
171
+
172
+ ### Corrections for Next Cycle
173
+ - [Concrete, actionable changes — not vague aspirations]
174
+
175
+ ### Field Review Holding List
176
+ - [Out-of-scope observations from Phase 2]
177
+
178
+ ### Process File Updates
179
+ - [Each file + what changes]
180
+ ```
181
+
182
+ Get user approval before applying.
183
+
184
+ ### PC Phase 5 — Apply
185
+
186
+ 1. **Append** `## Critique` section to the plan file.
187
+ 2. **Update process files** with approved changes. All files are eligible (`gnd-chart`, `gnd-critique`, `gnd-navigator`, `gnd-diver`, project-local files). Only where findings warrant it.
188
+ 3. **Archive** the plan → `.planning/archive/<YYYY-MM-DD>-<slug>.md`.
189
+ 4. **Report** what was updated and the archive path.
190
+ 5. **Field review handoff** if the holding list is non-empty.
191
+
192
+ ---
193
+
194
+ ## Key Rules
195
+
196
+ - **Archive, don't delete.** Move the plan to archive after critique. Other live plans remain.
197
+ - **Evidence over opinion.** Every finding references a specific leg, diff, or observation.
198
+ - **Actionable corrections only.** "Be more specific" is not actionable. "Include viewport checkpoints for CSS layout legs" is.
199
+ - **Don't over-correct.** If most legs executed cleanly, the process works. Focus on the gaps.
200
+ - **Respect scope.** Plan critique evaluates what shipped. It doesn't redesign the product or start a new plan.