@mindfoldhq/trellis 0.6.0-beta.7 → 0.6.0-beta.8
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/dist/configurators/codex.d.ts.map +1 -1
- package/dist/configurators/codex.js +5 -3
- package/dist/configurators/codex.js.map +1 -1
- package/dist/configurators/shared.js +4 -4
- package/dist/configurators/shared.js.map +1 -1
- package/dist/migrations/manifests/0.6.0-beta.8.json +9 -0
- package/dist/templates/claude/agents/trellis-check.md +2 -2
- package/dist/templates/claude/agents/trellis-implement.md +8 -7
- package/dist/templates/codebuddy/agents/trellis-check.md +2 -2
- package/dist/templates/codebuddy/agents/trellis-implement.md +8 -7
- package/dist/templates/codex/agents/trellis-check.toml +4 -4
- package/dist/templates/codex/agents/trellis-implement.toml +4 -4
- package/dist/templates/codex/hooks/session-start.py +183 -119
- package/dist/templates/codex/skills/before-dev/SKILL.md +12 -6
- package/dist/templates/codex/skills/brainstorm/SKILL.md +113 -51
- package/dist/templates/codex/skills/check/SKILL.md +86 -18
- package/dist/templates/codex/skills/start/SKILL.md +33 -323
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +7 -4
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +3 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +5 -5
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +8 -6
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +5 -4
- package/dist/templates/common/commands/continue.md +6 -5
- package/dist/templates/common/commands/start.md +7 -6
- package/dist/templates/common/skills/before-dev.md +12 -6
- package/dist/templates/common/skills/brainstorm.md +56 -42
- package/dist/templates/common/skills/check.md +7 -1
- package/dist/templates/copilot/hooks/session-start.py +183 -90
- package/dist/templates/copilot/prompts/before-dev.prompt.md +12 -6
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +146 -84
- package/dist/templates/copilot/prompts/check.prompt.md +86 -18
- package/dist/templates/copilot/prompts/parallel.prompt.md +16 -8
- package/dist/templates/copilot/prompts/start.prompt.md +33 -367
- package/dist/templates/cursor/agents/trellis-check.md +2 -2
- package/dist/templates/cursor/agents/trellis-implement.md +8 -7
- package/dist/templates/droid/droids/trellis-check.md +2 -2
- package/dist/templates/droid/droids/trellis-implement.md +8 -7
- package/dist/templates/gemini/agents/trellis-implement.md +7 -6
- package/dist/templates/kiro/agents/trellis-check.json +1 -1
- package/dist/templates/kiro/agents/trellis-implement.json +1 -1
- package/dist/templates/opencode/agents/trellis-check.md +2 -2
- package/dist/templates/opencode/agents/trellis-implement.md +9 -8
- package/dist/templates/opencode/lib/session-utils.js +212 -123
- package/dist/templates/opencode/plugins/inject-subagent-context.js +23 -7
- package/dist/templates/opencode/plugins/inject-workflow-state.js +1 -4
- package/dist/templates/pi/extensions/trellis/index.ts.txt +7 -5
- package/dist/templates/qoder/agents/trellis-implement.md +7 -6
- package/dist/templates/shared-hooks/inject-subagent-context.py +36 -14
- package/dist/templates/shared-hooks/inject-workflow-state.py +18 -42
- package/dist/templates/shared-hooks/session-start.py +197 -163
- package/dist/templates/trellis/scripts/common/task_context.py +3 -3
- package/dist/templates/trellis/scripts/common/task_store.py +39 -7
- package/dist/templates/trellis/scripts/common/workflow_phase.py +7 -10
- package/dist/templates/trellis/scripts/task.py +3 -3
- package/dist/templates/trellis/workflow.md +98 -98
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: brainstorm
|
|
3
|
-
description: "Collaborative requirements discovery session optimized for AI coding workflows. Creates task directories,
|
|
3
|
+
description: "Collaborative requirements discovery session optimized for AI coding workflows. Creates task directories, updates PRDs, runs codebase research, separates technical design and implementation planning, and converges on MVP scope through structured Q&A. Use when requirements are unclear, multiple implementation paths exist, trade-offs need evaluation, or a complex feature needs scoping before development."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Brainstorm - Requirements Discovery (AI Coding Enhanced)
|
|
@@ -24,7 +24,7 @@ Guide AI through collaborative requirements discovery **before implementation**,
|
|
|
24
24
|
|
|
25
25
|
## When to Use
|
|
26
26
|
|
|
27
|
-
Triggered from
|
|
27
|
+
Triggered from {{CMD_REF:start}} when the user describes a development task, especially when:
|
|
28
28
|
|
|
29
29
|
* requirements are unclear or evolving
|
|
30
30
|
* there are multiple valid implementation paths
|
|
@@ -70,7 +70,10 @@ Before any Q&A, ensure a task exists. If none exists, create one immediately.
|
|
|
70
70
|
TASK_DIR=$(python3 ./.trellis/scripts/task.py create "brainstorm: <short goal>" --slug <auto>)
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
Use a slug without a date prefix. `task.py create` adds the `MM-DD-`
|
|
74
|
+
directory prefix automatically.
|
|
75
|
+
|
|
76
|
+
`task.py create` already created a default `prd.md`. Immediately update it with what you know:
|
|
74
77
|
|
|
75
78
|
```markdown
|
|
76
79
|
# brainstorm: <short goal>
|
|
@@ -79,7 +82,7 @@ Create/seed `prd.md` immediately with what you know:
|
|
|
79
82
|
|
|
80
83
|
<one paragraph: what + why>
|
|
81
84
|
|
|
82
|
-
##
|
|
85
|
+
## Background / Known Context
|
|
83
86
|
|
|
84
87
|
* <facts from user message>
|
|
85
88
|
* <facts discovered from repo/docs>
|
|
@@ -92,11 +95,11 @@ Create/seed `prd.md` immediately with what you know:
|
|
|
92
95
|
|
|
93
96
|
* <ONLY Blocking / Preference questions; keep list short>
|
|
94
97
|
|
|
95
|
-
## Requirements
|
|
98
|
+
## Requirements
|
|
96
99
|
|
|
97
100
|
* <start with what is known>
|
|
98
101
|
|
|
99
|
-
## Acceptance Criteria
|
|
102
|
+
## Acceptance Criteria
|
|
100
103
|
|
|
101
104
|
* [ ] <testable criterion>
|
|
102
105
|
|
|
@@ -111,10 +114,39 @@ Create/seed `prd.md` immediately with what you know:
|
|
|
111
114
|
|
|
112
115
|
* <what we will not do in this task>
|
|
113
116
|
|
|
114
|
-
##
|
|
117
|
+
## Research References
|
|
118
|
+
|
|
119
|
+
* <links to research/*.md or external references>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For complex tasks, also create/update:
|
|
115
123
|
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
```markdown
|
|
125
|
+
# design.md
|
|
126
|
+
|
|
127
|
+
## Technical Design
|
|
128
|
+
|
|
129
|
+
<boundaries, contracts, data flow, compatibility, tradeoffs>
|
|
130
|
+
|
|
131
|
+
## Rollout / Rollback
|
|
132
|
+
|
|
133
|
+
<operational notes if relevant>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```markdown
|
|
137
|
+
# implement.md
|
|
138
|
+
|
|
139
|
+
## Implementation Checklist
|
|
140
|
+
|
|
141
|
+
- [ ] <ordered implementation step>
|
|
142
|
+
|
|
143
|
+
## Validation
|
|
144
|
+
|
|
145
|
+
- <lint/typecheck/test command>
|
|
146
|
+
|
|
147
|
+
## Review Gates
|
|
148
|
+
|
|
149
|
+
- <human or technical checkpoint before start/finish>
|
|
118
150
|
```
|
|
119
151
|
|
|
120
152
|
---
|
|
@@ -137,8 +169,8 @@ Before asking questions like "what does the code look like?", gather context you
|
|
|
137
169
|
|
|
138
170
|
Write findings into PRD:
|
|
139
171
|
|
|
140
|
-
* Add to `
|
|
141
|
-
*
|
|
172
|
+
* Add user-visible facts to `Background / Known Context`
|
|
173
|
+
* Write technical findings to `research/*.md`, `design.md`, or `implement.md` as appropriate
|
|
142
174
|
|
|
143
175
|
---
|
|
144
176
|
|
|
@@ -197,18 +229,63 @@ Examples:
|
|
|
197
229
|
* The user asks for "best practice", "how others do it", "recommendation"
|
|
198
230
|
* The user can't reasonably enumerate options
|
|
199
231
|
|
|
200
|
-
###
|
|
232
|
+
### Delegate to `trellis-research` sub-agent (don't research inline)
|
|
233
|
+
|
|
234
|
+
For each research topic, **spawn a `trellis-research` sub-agent via the Task tool** — don't do WebFetch / WebSearch / `gh api` inline in the main conversation.
|
|
235
|
+
|
|
236
|
+
Why:
|
|
237
|
+
- The sub-agent has its own context window → doesn't pollute brainstorm context with raw tool output
|
|
238
|
+
- It persists findings to `{TASK_DIR}/research/<topic>.md` (the contract — see `workflow.md` Phase 1.2)
|
|
239
|
+
- It returns only `{file path, one-line summary}` to the main agent
|
|
240
|
+
- Independent topics can be **parallelized** — spawn multiple sub-agents in one tool call
|
|
241
|
+
|
|
242
|
+
> **Codex exception**: on Codex CLI, do NOT dispatch `trellis-research` for research-first mode — do the research inline (WebFetch / WebSearch in the main session) and write findings to `{TASK_DIR}/research/<topic>.md` yourself. Reason: Codex `spawn_agent` runs sub-agents with `fork_turns="none"` (isolated context, no parent session inheritance), so the research sub-agent cannot resolve the active task path via `task.py current` and silently aborts without producing files. Inline research on Codex avoids this failure mode. The 3+ inline research calls limit (B rule in `workflow.md`) is relaxed for Codex specifically.
|
|
201
243
|
|
|
202
|
-
|
|
244
|
+
Agent type: `trellis-research`
|
|
245
|
+
Task description template: "Research <specific question>; persist findings to `{TASK_DIR}/research/<topic-slug>.md`."
|
|
246
|
+
|
|
247
|
+
❌ Bad (what you must NOT do):
|
|
248
|
+
```
|
|
249
|
+
Main agent: WebFetch(url-A) → WebFetch(url-B) → Bash(gh api ...)
|
|
250
|
+
→ WebSearch(q1) → WebSearch(q2) → ... (10+ inline calls)
|
|
251
|
+
→ Write(research/topic.md)
|
|
252
|
+
```
|
|
253
|
+
→ Pollutes main context with raw HTML/JSON, burns tokens.
|
|
254
|
+
|
|
255
|
+
✅ Good:
|
|
256
|
+
```
|
|
257
|
+
Main agent: Task(subagent_type="trellis-research",
|
|
258
|
+
prompt="Research topic A; persist to research/topic-a.md")
|
|
259
|
+
+ Task(subagent_type="trellis-research",
|
|
260
|
+
prompt="Research topic B; persist to research/topic-b.md")
|
|
261
|
+
+ Task(subagent_type="trellis-research",
|
|
262
|
+
prompt="Research topic C; persist to research/topic-c.md")
|
|
263
|
+
→ Reads research/topic-{a,b,c}.md after they finish.
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Research steps (to pass into each sub-agent prompt)
|
|
267
|
+
|
|
268
|
+
Each `trellis-research` sub-agent should:
|
|
269
|
+
|
|
270
|
+
1. Identify 2–4 comparable tools/patterns for its topic
|
|
203
271
|
2. Summarize common conventions and why they exist
|
|
204
272
|
3. Map conventions onto our repo constraints
|
|
205
|
-
4.
|
|
273
|
+
4. Write findings to `{TASK_DIR}/research/<topic>.md`
|
|
274
|
+
|
|
275
|
+
Main agent then reads the persisted files and produces **2–3 feasible approaches** in PRD.
|
|
206
276
|
|
|
207
277
|
### Research output format (PRD)
|
|
208
278
|
|
|
209
|
-
|
|
279
|
+
The PRD itself should only reference the persisted research files, not duplicate their content. Add a `## Research References` section pointing at `research/*.md`.
|
|
280
|
+
|
|
281
|
+
Optionally, add a convergence section with feasible approaches derived from the research:
|
|
210
282
|
|
|
211
283
|
```markdown
|
|
284
|
+
## Research References
|
|
285
|
+
|
|
286
|
+
* [`research/<topic-a>.md`](research/<topic-a>.md) — <one-line takeaway>
|
|
287
|
+
* [`research/<topic-b>.md`](research/<topic-b>.md) — <one-line takeaway>
|
|
288
|
+
|
|
212
289
|
## Research Notes
|
|
213
290
|
|
|
214
291
|
### What similar tools do
|
|
@@ -359,7 +436,7 @@ Record the outcome in PRD as an ADR-lite section:
|
|
|
359
436
|
|
|
360
437
|
---
|
|
361
438
|
|
|
362
|
-
## Step 8: Final Confirmation +
|
|
439
|
+
## Step 8: Final Confirmation + Planning Artifacts
|
|
363
440
|
|
|
364
441
|
When open questions are resolved, confirm complete requirements with a structured summary:
|
|
365
442
|
|
|
@@ -388,16 +465,13 @@ Here's my understanding of the complete requirements:
|
|
|
388
465
|
|
|
389
466
|
* ...
|
|
390
467
|
|
|
391
|
-
**
|
|
392
|
-
<brief summary + key decisions>
|
|
393
|
-
|
|
394
|
-
**Implementation Plan (small PRs)**:
|
|
468
|
+
**Artifact status**:
|
|
395
469
|
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
470
|
+
* prd.md: <ready / needs update>
|
|
471
|
+
* design.md: <not needed for lightweight / ready / missing>
|
|
472
|
+
* implement.md: <not needed for lightweight / ready / missing>
|
|
399
473
|
|
|
400
|
-
Does this look correct? If yes,
|
|
474
|
+
Does this look correct? If yes, the next step is planning review before `task.py start`.
|
|
401
475
|
```
|
|
402
476
|
|
|
403
477
|
### Subtask Decomposition (Complex Tasks)
|
|
@@ -434,25 +508,13 @@ python3 ./.trellis/scripts/task.py add-subtask "$TASK_DIR" "$CHILD_DIR"
|
|
|
434
508
|
|
|
435
509
|
* [ ] ...
|
|
436
510
|
|
|
437
|
-
## Definition of Done
|
|
438
|
-
|
|
439
|
-
* ...
|
|
440
|
-
|
|
441
|
-
## Technical Approach
|
|
442
|
-
|
|
443
|
-
<key design + decisions>
|
|
444
|
-
|
|
445
|
-
## Decision (ADR-lite)
|
|
446
|
-
|
|
447
|
-
Context / Decision / Consequences
|
|
448
|
-
|
|
449
511
|
## Out of Scope
|
|
450
512
|
|
|
451
513
|
* ...
|
|
452
514
|
|
|
453
|
-
##
|
|
515
|
+
## Research References
|
|
454
516
|
|
|
455
|
-
<
|
|
517
|
+
* <links to research/*.md or external references>
|
|
456
518
|
```
|
|
457
519
|
|
|
458
520
|
---
|
|
@@ -469,25 +531,25 @@ Context / Decision / Consequences
|
|
|
469
531
|
|
|
470
532
|
## Integration with Start Workflow
|
|
471
533
|
|
|
472
|
-
After brainstorm completes (Step 8 confirmation approved), the flow continues to the Task Workflow
|
|
534
|
+
After brainstorm completes (Step 8 confirmation approved), the flow continues to the Task Workflow planning review gate:
|
|
473
535
|
|
|
474
536
|
```text
|
|
475
537
|
Brainstorm
|
|
476
|
-
Step 0: Create task directory +
|
|
538
|
+
Step 0: Create task directory + update PRD
|
|
477
539
|
Step 1–7: Discover requirements, research, converge
|
|
478
|
-
Step 8: Final confirmation → user approves
|
|
540
|
+
Step 8: Final confirmation → user approves planning artifacts
|
|
479
541
|
↓
|
|
480
|
-
Task Workflow Phase
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
→
|
|
484
|
-
→
|
|
542
|
+
Task Workflow Phase 1 (Plan)
|
|
543
|
+
Lightweight task → PRD-only may be enough
|
|
544
|
+
Complex task → design.md + implement.md required
|
|
545
|
+
Sub-agent platforms → curate implement.jsonl / check.jsonl manifests
|
|
546
|
+
→ Review gate → task.py start
|
|
485
547
|
↓
|
|
486
|
-
Task Workflow Phase
|
|
548
|
+
Task Workflow Phase 2 (Execute)
|
|
487
549
|
Implement → Check → Complete
|
|
488
550
|
```
|
|
489
551
|
|
|
490
|
-
The task directory and PRD already exist from brainstorm,
|
|
552
|
+
The task directory and PRD already exist from brainstorm, but Phase 1 is not skipped; it owns artifact review and the `task.py start` gate.
|
|
491
553
|
|
|
492
554
|
---
|
|
493
555
|
|
|
@@ -495,6 +557,6 @@ The task directory and PRD already exist from brainstorm, so Phase 1 of the Task
|
|
|
495
557
|
|
|
496
558
|
| Command | When to Use |
|
|
497
559
|
|---------|-------------|
|
|
498
|
-
|
|
|
499
|
-
|
|
|
500
|
-
|
|
|
560
|
+
| `{{CMD_REF:start}}` | Entry point that triggers brainstorm |
|
|
561
|
+
| `{{CMD_REF:finish-work}}` | After implementation is complete |
|
|
562
|
+
| `{{CMD_REF:update-spec}}` | If new patterns emerge during work |
|
|
@@ -3,28 +3,96 @@ name: check
|
|
|
3
3
|
description: "Validates recently written code against project-specific development guidelines from .trellis/spec/. Identifies changed files via git diff, discovers applicable spec modules, runs lint and typecheck, and reports guideline violations. Use when code is written and needs quality verification, to catch context drift during long sessions, or before committing changes."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# Code Quality Check
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Comprehensive quality verification for recently written code. Combines spec compliance, cross-layer safety, and pre-commit checks.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Step 1: Identify What Changed
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
git diff --name-only HEAD
|
|
16
|
+
git status
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Step 2: Read Task Artifacts and Applicable Specs
|
|
20
|
+
|
|
21
|
+
Read the current task artifacts in order:
|
|
22
|
+
|
|
23
|
+
- `prd.md`
|
|
24
|
+
- `design.md` if present
|
|
25
|
+
- `implement.md` if present
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python3 ./.trellis/scripts/get_context.py --mode packages
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For each changed package/layer, read the spec index and follow its **Quality Check** section:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
cat .trellis/spec/<package>/<layer>/index.md
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Read the specific guideline files referenced — the index is a pointer, not the goal.
|
|
38
|
+
|
|
39
|
+
## Step 3: Run Project Checks
|
|
40
|
+
|
|
41
|
+
Run the project's lint, type-check, and test commands. Fix any failures before proceeding.
|
|
42
|
+
|
|
43
|
+
## Step 4: Review Against Checklist
|
|
44
|
+
|
|
45
|
+
### Code Quality
|
|
46
|
+
|
|
47
|
+
- [ ] Linter passes?
|
|
48
|
+
- [ ] Type checker passes (if applicable)?
|
|
49
|
+
- [ ] Tests pass?
|
|
50
|
+
- [ ] No debug logging left in?
|
|
51
|
+
- [ ] No suppressed warnings or type-safety bypasses?
|
|
14
52
|
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
python3 ./.trellis/scripts/get_context.py --mode packages
|
|
18
|
-
```
|
|
53
|
+
### Test Coverage
|
|
19
54
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
Follow the **"Quality Check"** section in the index.
|
|
55
|
+
- [ ] New function → unit test added?
|
|
56
|
+
- [ ] Bug fix → regression test added?
|
|
57
|
+
- [ ] Changed behavior → existing tests updated?
|
|
25
58
|
|
|
26
|
-
|
|
59
|
+
### Spec Sync
|
|
60
|
+
|
|
61
|
+
- [ ] Does `.trellis/spec/` need updates? (new patterns, conventions, lessons learned)
|
|
62
|
+
|
|
63
|
+
> "If I fixed a bug or discovered something non-obvious, should I document it so future me won't hit the same issue?" → If YES, update the relevant spec doc.
|
|
64
|
+
|
|
65
|
+
## Step 5: Cross-Layer Dimensions (if applicable)
|
|
66
|
+
|
|
67
|
+
Skip this step if your change is confined to a single layer.
|
|
68
|
+
|
|
69
|
+
### A. Data Flow (changes touch 3+ layers)
|
|
70
|
+
|
|
71
|
+
- [ ] Read flow traces correctly: Storage → Service → API → UI
|
|
72
|
+
- [ ] Write flow traces correctly: UI → API → Service → Storage
|
|
73
|
+
- [ ] Types/schemas correctly passed between layers?
|
|
74
|
+
- [ ] Errors properly propagated to caller?
|
|
75
|
+
|
|
76
|
+
### B. Code Reuse (modifying constants, creating utilities)
|
|
77
|
+
|
|
78
|
+
- [ ] Searched for existing similar code before creating new?
|
|
79
|
+
```bash
|
|
80
|
+
grep -r "pattern" src/
|
|
81
|
+
```
|
|
82
|
+
- [ ] If 2+ places define same value → extracted to shared constant?
|
|
83
|
+
- [ ] After batch modification, all occurrences updated?
|
|
84
|
+
|
|
85
|
+
### C. Import/Dependency (creating new files)
|
|
86
|
+
|
|
87
|
+
- [ ] Correct import paths (relative vs absolute)?
|
|
88
|
+
- [ ] No circular dependencies?
|
|
89
|
+
|
|
90
|
+
### D. Same-Layer Consistency
|
|
91
|
+
|
|
92
|
+
- [ ] Other places using the same concept are consistent?
|
|
93
|
+
|
|
94
|
+
---
|
|
27
95
|
|
|
28
|
-
|
|
96
|
+
## Step 6: Report and Fix
|
|
29
97
|
|
|
30
|
-
|
|
98
|
+
Report violations found and fix them directly. Re-run project checks after fixes.
|