@mindfoldhq/trellis 0.6.0-beta.2 → 0.6.0-beta.20
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 +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +58 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/channel/adapters/claude.d.ts +29 -0
- package/dist/commands/channel/adapters/claude.d.ts.map +1 -0
- package/dist/commands/channel/adapters/claude.js +203 -0
- package/dist/commands/channel/adapters/claude.js.map +1 -0
- package/dist/commands/channel/adapters/codex.d.ts +85 -0
- package/dist/commands/channel/adapters/codex.d.ts.map +1 -0
- package/dist/commands/channel/adapters/codex.js +505 -0
- package/dist/commands/channel/adapters/codex.js.map +1 -0
- package/dist/commands/channel/adapters/index.d.ts +84 -0
- package/dist/commands/channel/adapters/index.d.ts.map +1 -0
- package/dist/commands/channel/adapters/index.js +115 -0
- package/dist/commands/channel/adapters/index.js.map +1 -0
- package/dist/commands/channel/adapters/types.d.ts +33 -0
- package/dist/commands/channel/adapters/types.d.ts.map +1 -0
- package/dist/commands/channel/adapters/types.js +2 -0
- package/dist/commands/channel/adapters/types.js.map +1 -0
- package/dist/commands/channel/agent-loader.d.ts +32 -0
- package/dist/commands/channel/agent-loader.d.ts.map +1 -0
- package/dist/commands/channel/agent-loader.js +154 -0
- package/dist/commands/channel/agent-loader.js.map +1 -0
- package/dist/commands/channel/context-loader.d.ts +26 -0
- package/dist/commands/channel/context-loader.d.ts.map +1 -0
- package/dist/commands/channel/context-loader.js +290 -0
- package/dist/commands/channel/context-loader.js.map +1 -0
- package/dist/commands/channel/context.d.ts +16 -0
- package/dist/commands/channel/context.d.ts.map +1 -0
- package/dist/commands/channel/context.js +83 -0
- package/dist/commands/channel/context.js.map +1 -0
- package/dist/commands/channel/create.d.ts +27 -0
- package/dist/commands/channel/create.d.ts.map +1 -0
- package/dist/commands/channel/create.js +39 -0
- package/dist/commands/channel/create.js.map +1 -0
- package/dist/commands/channel/dev-parse-trace.d.ts +14 -0
- package/dist/commands/channel/dev-parse-trace.d.ts.map +1 -0
- package/dist/commands/channel/dev-parse-trace.js +70 -0
- package/dist/commands/channel/dev-parse-trace.js.map +1 -0
- package/dist/commands/channel/guard.d.ts +150 -0
- package/dist/commands/channel/guard.d.ts.map +1 -0
- package/dist/commands/channel/guard.js +474 -0
- package/dist/commands/channel/guard.js.map +1 -0
- package/dist/commands/channel/index.d.ts +3 -0
- package/dist/commands/channel/index.d.ts.map +1 -0
- package/dist/commands/channel/index.js +531 -0
- package/dist/commands/channel/index.js.map +1 -0
- package/dist/commands/channel/interrupt.d.ts +10 -0
- package/dist/commands/channel/interrupt.d.ts.map +1 -0
- package/dist/commands/channel/interrupt.js +22 -0
- package/dist/commands/channel/interrupt.js.map +1 -0
- package/dist/commands/channel/kill.d.ts +7 -0
- package/dist/commands/channel/kill.d.ts.map +1 -0
- package/dist/commands/channel/kill.js +121 -0
- package/dist/commands/channel/kill.js.map +1 -0
- package/dist/commands/channel/list.d.ts +17 -0
- package/dist/commands/channel/list.d.ts.map +1 -0
- package/dist/commands/channel/list.js +233 -0
- package/dist/commands/channel/list.js.map +1 -0
- package/dist/commands/channel/messages.d.ts +15 -0
- package/dist/commands/channel/messages.d.ts.map +1 -0
- package/dist/commands/channel/messages.js +245 -0
- package/dist/commands/channel/messages.js.map +1 -0
- package/dist/commands/channel/rm.d.ts +27 -0
- package/dist/commands/channel/rm.d.ts.map +1 -0
- package/dist/commands/channel/rm.js +216 -0
- package/dist/commands/channel/rm.js.map +1 -0
- package/dist/commands/channel/run.d.ts +30 -0
- package/dist/commands/channel/run.d.ts.map +1 -0
- package/dist/commands/channel/run.js +130 -0
- package/dist/commands/channel/run.js.map +1 -0
- package/dist/commands/channel/send.d.ts +11 -0
- package/dist/commands/channel/send.d.ts.map +1 -0
- package/dist/commands/channel/send.js +24 -0
- package/dist/commands/channel/send.js.map +1 -0
- package/dist/commands/channel/spawn.d.ts +40 -0
- package/dist/commands/channel/spawn.d.ts.map +1 -0
- package/dist/commands/channel/spawn.js +244 -0
- package/dist/commands/channel/spawn.js.map +1 -0
- package/dist/commands/channel/store/events.d.ts +39 -0
- package/dist/commands/channel/store/events.d.ts.map +1 -0
- package/dist/commands/channel/store/events.js +87 -0
- package/dist/commands/channel/store/events.js.map +1 -0
- package/dist/commands/channel/store/filter.d.ts +3 -0
- package/dist/commands/channel/store/filter.d.ts.map +1 -0
- package/dist/commands/channel/store/filter.js +2 -0
- package/dist/commands/channel/store/filter.js.map +1 -0
- package/dist/commands/channel/store/lock.d.ts +23 -0
- package/dist/commands/channel/store/lock.d.ts.map +1 -0
- package/dist/commands/channel/store/lock.js +99 -0
- package/dist/commands/channel/store/lock.js.map +1 -0
- package/dist/commands/channel/store/paths.d.ts +63 -0
- package/dist/commands/channel/store/paths.d.ts.map +1 -0
- package/dist/commands/channel/store/paths.js +246 -0
- package/dist/commands/channel/store/paths.js.map +1 -0
- package/dist/commands/channel/store/schema.d.ts +27 -0
- package/dist/commands/channel/store/schema.d.ts.map +1 -0
- package/dist/commands/channel/store/schema.js +34 -0
- package/dist/commands/channel/store/schema.js.map +1 -0
- package/dist/commands/channel/store/thread-state.d.ts +5 -0
- package/dist/commands/channel/store/thread-state.d.ts.map +1 -0
- package/dist/commands/channel/store/thread-state.js +16 -0
- package/dist/commands/channel/store/thread-state.js.map +1 -0
- package/dist/commands/channel/store/watch.d.ts +19 -0
- package/dist/commands/channel/store/watch.d.ts.map +1 -0
- package/dist/commands/channel/store/watch.js +146 -0
- package/dist/commands/channel/store/watch.js.map +1 -0
- package/dist/commands/channel/supervisor/idle.d.ts +46 -0
- package/dist/commands/channel/supervisor/idle.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/idle.js +72 -0
- package/dist/commands/channel/supervisor/idle.js.map +1 -0
- package/dist/commands/channel/supervisor/inbox.d.ts +30 -0
- package/dist/commands/channel/supervisor/inbox.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/inbox.js +160 -0
- package/dist/commands/channel/supervisor/inbox.js.map +1 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts +68 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/shutdown.js +146 -0
- package/dist/commands/channel/supervisor/shutdown.js.map +1 -0
- package/dist/commands/channel/supervisor/stdout.d.ts +51 -0
- package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/stdout.js +121 -0
- package/dist/commands/channel/supervisor/stdout.js.map +1 -0
- package/dist/commands/channel/supervisor/turns.d.ts +31 -0
- package/dist/commands/channel/supervisor/turns.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/turns.js +45 -0
- package/dist/commands/channel/supervisor/turns.js.map +1 -0
- package/dist/commands/channel/supervisor/warning.d.ts +48 -0
- package/dist/commands/channel/supervisor/warning.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/warning.js +77 -0
- package/dist/commands/channel/supervisor/warning.js.map +1 -0
- package/dist/commands/channel/supervisor.d.ts +59 -0
- package/dist/commands/channel/supervisor.d.ts.map +1 -0
- package/dist/commands/channel/supervisor.js +344 -0
- package/dist/commands/channel/supervisor.js.map +1 -0
- package/dist/commands/channel/text-body.d.ts +13 -0
- package/dist/commands/channel/text-body.d.ts.map +1 -0
- package/dist/commands/channel/text-body.js +47 -0
- package/dist/commands/channel/text-body.js.map +1 -0
- package/dist/commands/channel/threads.d.ts +39 -0
- package/dist/commands/channel/threads.d.ts.map +1 -0
- package/dist/commands/channel/threads.js +106 -0
- package/dist/commands/channel/threads.js.map +1 -0
- package/dist/commands/channel/title.d.ts +12 -0
- package/dist/commands/channel/title.d.ts.map +1 -0
- package/dist/commands/channel/title.js +24 -0
- package/dist/commands/channel/title.js.map +1 -0
- package/dist/commands/channel/wait.d.ts +17 -0
- package/dist/commands/channel/wait.d.ts.map +1 -0
- package/dist/commands/channel/wait.js +75 -0
- package/dist/commands/channel/wait.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +97 -42
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mem.d.ts +13 -117
- package/dist/commands/mem.d.ts.map +1 -1
- package/dist/commands/mem.js +168 -1074
- package/dist/commands/mem.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +28 -2
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +31 -111
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/upgrade.d.ts +28 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +84 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/workflow.d.ts +35 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +219 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/configurators/claude.d.ts.map +1 -1
- package/dist/configurators/claude.js +1 -0
- package/dist/configurators/claude.js.map +1 -1
- 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/configurators/workflow.d.ts +8 -0
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +3 -2
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/manifests/0.5.10.json +9 -0
- package/dist/migrations/manifests/0.5.11.json +16 -0
- package/dist/migrations/manifests/0.5.12.json +9 -0
- package/dist/migrations/manifests/0.5.13.json +9 -0
- package/dist/migrations/manifests/0.5.14.json +9 -0
- package/dist/migrations/manifests/0.5.15.json +9 -0
- package/dist/migrations/manifests/0.5.16.json +9 -0
- package/dist/migrations/manifests/0.5.17.json +9 -0
- package/dist/migrations/manifests/0.5.18.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.15.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.17.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.18.json +16 -0
- package/dist/migrations/manifests/0.6.0-beta.19.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.20.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.5.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.6.json +16 -0
- package/dist/migrations/manifests/0.6.0-beta.7.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.8.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.9.json +9 -0
- package/dist/templates/claude/agents/trellis-check.md +13 -7
- package/dist/templates/claude/agents/trellis-implement.md +8 -7
- package/dist/templates/claude/settings.json +4 -4
- package/dist/templates/codebuddy/agents/trellis-check.md +13 -7
- package/dist/templates/codebuddy/agents/trellis-implement.md +8 -7
- package/dist/templates/codebuddy/settings.json +4 -4
- package/dist/templates/codex/agents/trellis-check.toml +4 -4
- package/dist/templates/codex/agents/trellis-implement.toml +4 -4
- package/dist/templates/codex/config.toml +5 -3
- package/dist/templates/codex/hooks/session-start.py +205 -119
- package/dist/templates/codex/hooks.json +2 -2
- package/dist/templates/codex/skills/before-dev/SKILL.md +12 -6
- package/dist/templates/codex/skills/brainstorm/SKILL.md +69 -457
- 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 +35 -6
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +5 -4
- package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/SKILL.md +41 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/mcp-setup.md +90 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/repository-analysis.md +59 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/spec-task-planning.md +61 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/spec-writing.md +70 -0
- package/dist/templates/common/commands/continue.md +6 -5
- package/dist/templates/common/commands/start.md +9 -6
- package/dist/templates/common/skills/before-dev.md +12 -6
- package/dist/templates/common/skills/brainstorm.md +68 -504
- package/dist/templates/common/skills/check.md +7 -1
- package/dist/templates/copilot/hooks/session-start.py +219 -101
- package/dist/templates/copilot/hooks.json +2 -2
- package/dist/templates/copilot/prompts/before-dev.prompt.md +12 -6
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +69 -457
- 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 +13 -7
- package/dist/templates/cursor/agents/trellis-implement.md +8 -7
- package/dist/templates/cursor/hooks.json +1 -7
- package/dist/templates/droid/droids/trellis-check.md +13 -7
- package/dist/templates/droid/droids/trellis-implement.md +8 -7
- package/dist/templates/droid/settings.json +4 -4
- package/dist/templates/gemini/agents/trellis-check.md +11 -5
- package/dist/templates/gemini/agents/trellis-implement.md +7 -6
- package/dist/templates/gemini/settings.json +2 -2
- package/dist/templates/kiro/agents/trellis-check.json +1 -1
- package/dist/templates/kiro/agents/trellis-implement.json +1 -1
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +127 -9
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +171 -6
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +333 -43
- package/dist/templates/markdown/spec/guides/index.md.txt +18 -0
- package/dist/templates/opencode/agents/trellis-check.md +13 -7
- package/dist/templates/opencode/agents/trellis-implement.md +9 -8
- package/dist/templates/opencode/lib/session-utils.js +212 -123
- package/dist/templates/opencode/lib/trellis-context.js +73 -11
- package/dist/templates/opencode/plugins/inject-subagent-context.js +131 -29
- package/dist/templates/opencode/plugins/inject-workflow-state.js +9 -5
- package/dist/templates/opencode/plugins/session-start.js +9 -1
- package/dist/templates/pi/agents/trellis-check.md +5 -4
- package/dist/templates/pi/agents/trellis-implement.md +5 -4
- package/dist/templates/pi/extensions/trellis/index.ts.txt +1357 -754
- package/dist/templates/qoder/agents/trellis-check.md +11 -5
- package/dist/templates/qoder/agents/trellis-implement.md +7 -6
- package/dist/templates/qoder/settings.json +4 -4
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +0 -1
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-subagent-context.py +36 -14
- package/dist/templates/shared-hooks/inject-workflow-state.py +40 -42
- package/dist/templates/shared-hooks/session-start.py +222 -171
- package/dist/templates/trellis/config.yaml +38 -0
- package/dist/templates/trellis/index.d.ts +1 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +2 -0
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add_session.py +50 -24
- package/dist/templates/trellis/scripts/common/config.py +57 -1
- package/dist/templates/trellis/scripts/common/safe_commit.py +285 -0
- package/dist/templates/trellis/scripts/common/session_context.py +384 -137
- package/dist/templates/trellis/scripts/common/task_context.py +3 -3
- package/dist/templates/trellis/scripts/common/task_store.py +161 -15
- 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 +119 -98
- package/dist/utils/cwd-guard.d.ts +38 -0
- package/dist/utils/cwd-guard.d.ts.map +1 -0
- package/dist/utils/cwd-guard.js +62 -0
- package/dist/utils/cwd-guard.js.map +1 -0
- package/dist/utils/file-writer.d.ts +13 -0
- package/dist/utils/file-writer.d.ts.map +1 -1
- package/dist/utils/file-writer.js +59 -1
- package/dist/utils/file-writer.js.map +1 -1
- package/dist/utils/manifest-prune.d.ts +61 -0
- package/dist/utils/manifest-prune.d.ts.map +1 -0
- package/dist/utils/manifest-prune.js +136 -0
- package/dist/utils/manifest-prune.js.map +1 -0
- package/dist/utils/task-json.d.ts +9 -42
- package/dist/utils/task-json.d.ts.map +1 -1
- package/dist/utils/task-json.js +8 -45
- package/dist/utils/task-json.js.map +1 -1
- package/dist/utils/template-hash.d.ts +32 -6
- package/dist/utils/template-hash.d.ts.map +1 -1
- package/dist/utils/template-hash.js +53 -31
- package/dist/utils/template-hash.js.map +1 -1
- package/dist/utils/uninstall-scrubbers.d.ts +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +21 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/dist/utils/workflow-resolver.d.ts +86 -0
- package/dist/utils/workflow-resolver.d.ts.map +1 -0
- package/dist/utils/workflow-resolver.js +265 -0
- package/dist/utils/workflow-resolver.js.map +1 -0
- package/package.json +9 -8
|
@@ -39,7 +39,7 @@ python3 ./.trellis/scripts/get_context.py --mode packages # list packages / la
|
|
|
39
39
|
|
|
40
40
|
### Task System
|
|
41
41
|
|
|
42
|
-
Every task has its own directory under `.trellis/tasks/{MM-DD-name}/` holding `
|
|
42
|
+
Every task has its own directory under `.trellis/tasks/{MM-DD-name}/` holding `task.json`, `prd.md`, optional `design.md`, optional `implement.md`, optional `research/`, and context manifests (`implement.jsonl`, `check.jsonl`) for sub-agent-capable platforms.
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
45
|
# Task lifecycle
|
|
@@ -53,7 +53,7 @@ python3 ./.trellis/scripts/task.py list-archive
|
|
|
53
53
|
|
|
54
54
|
# Code-spec context (injected into implement/check agents via JSONL).
|
|
55
55
|
# `implement.jsonl` / `check.jsonl` are seeded on `task create` for sub-agent-capable
|
|
56
|
-
# platforms; the AI curates real spec + research entries during
|
|
56
|
+
# platforms; the AI curates real spec + research entries during planning when needed.
|
|
57
57
|
python3 ./.trellis/scripts/task.py add-context <name> <action> <file> <reason>
|
|
58
58
|
python3 ./.trellis/scripts/task.py list-context <name> [action]
|
|
59
59
|
python3 ./.trellis/scripts/task.py validate <name>
|
|
@@ -99,7 +99,7 @@ python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y> # detailed
|
|
|
99
99
|
<!--
|
|
100
100
|
WORKFLOW-STATE BREADCRUMB CONTRACT (read this before editing the tag blocks below)
|
|
101
101
|
|
|
102
|
-
The
|
|
102
|
+
The [workflow-state:STATUS] blocks embedded in the ## Phase Index section
|
|
103
103
|
below are the SINGLE source of truth for the per-turn `<workflow-state>`
|
|
104
104
|
breadcrumb that every supported AI platform's UserPromptSubmit hook
|
|
105
105
|
reads. inject-workflow-state.py (Python platforms) and
|
|
@@ -114,15 +114,17 @@ python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y> # detailed
|
|
|
114
114
|
Every workflow-walkthrough step marked `[required · once]` must have a
|
|
115
115
|
matching enforcement line in its phase's [workflow-state:*] block. The
|
|
116
116
|
breadcrumb is the only per-turn channel; if a mandatory step isn't
|
|
117
|
-
mentioned there, the AI silently skips it (Phase 1
|
|
117
|
+
mentioned there, the AI silently skips it (Phase 1 planning gate
|
|
118
118
|
skip and Phase 3.4 commit skip both manifested via this gap).
|
|
119
119
|
|
|
120
120
|
TAG ↔ PHASE scoping:
|
|
121
121
|
[workflow-state:no_task] → no active task; before Phase 1
|
|
122
122
|
[workflow-state:planning] → all of Phase 1 (status='planning')
|
|
123
|
+
[workflow-state:planning-inline] → Codex inline variant of Phase 1
|
|
123
124
|
[workflow-state:in_progress] → Phase 2 + Phase 3.1-3.4
|
|
124
125
|
(status stays 'in_progress' from
|
|
125
126
|
task.py start until task.py archive)
|
|
127
|
+
[workflow-state:in_progress-inline] → Codex inline variant of Phase 2/3
|
|
126
128
|
[workflow-state:completed] → currently DEAD: cmd_archive flips
|
|
127
129
|
status and moves the dir in the same
|
|
128
130
|
call, so the resolver loses the
|
|
@@ -142,45 +144,69 @@ python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y> # detailed
|
|
|
142
144
|
## Phase Index
|
|
143
145
|
|
|
144
146
|
```
|
|
145
|
-
Phase 1: Plan →
|
|
146
|
-
Phase 2: Execute →
|
|
147
|
-
Phase 3: Finish →
|
|
147
|
+
Phase 1: Plan → classify, get task-creation consent, then write planning artifacts
|
|
148
|
+
Phase 2: Execute → implement only after task status is in_progress
|
|
149
|
+
Phase 3: Finish → verify, update spec, commit, and wrap up
|
|
148
150
|
```
|
|
149
151
|
|
|
152
|
+
### Request Triage
|
|
153
|
+
|
|
154
|
+
- Simple conversation or small task: ask only whether this turn should create a Trellis task. If the user says no, skip Trellis for this session.
|
|
155
|
+
- Complex task: ask whether you may create a Trellis task and enter planning. If the user says no, do not do broad inline implementation; explain, clarify scope, or suggest a smaller split.
|
|
156
|
+
- User approval to create a task is not approval to start implementation. Planning still happens first.
|
|
157
|
+
|
|
158
|
+
### Planning Artifacts
|
|
159
|
+
|
|
160
|
+
- `prd.md` — requirements, constraints, and acceptance criteria. Do not put technical design or execution checklists here.
|
|
161
|
+
- `design.md` — technical design for complex tasks: boundaries, contracts, data flow, tradeoffs, compatibility, rollout / rollback shape.
|
|
162
|
+
- `implement.md` — execution plan for complex tasks: ordered checklist, validation commands, review gates, and rollback points.
|
|
163
|
+
- `implement.jsonl` / `check.jsonl` — spec and research manifests for sub-agent context. They do not replace `implement.md`.
|
|
164
|
+
- Lightweight tasks may be PRD-only. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start`.
|
|
165
|
+
|
|
166
|
+
### Parent / Child Task Trees
|
|
167
|
+
|
|
168
|
+
Use a parent task when one user request contains several independently verifiable deliverables. The parent task owns the source requirement set, the task map, cross-child acceptance criteria, and final integration review; it normally should not be the implementation target unless it also has direct work.
|
|
169
|
+
|
|
170
|
+
Use child tasks for deliverables that can be planned, implemented, checked, and archived independently. Parent/child structure is not a dependency system: if one child must wait for another, write that ordering in the child `prd.md` / `implement.md` and keep each child's acceptance criteria testable.
|
|
171
|
+
|
|
172
|
+
Create new children with `task.py create "<title>" --slug <name> --parent <parent-dir>`. Link existing tasks with `task.py add-subtask <parent> <child>`, and unlink mistakes with `task.py remove-subtask <parent> <child>`.
|
|
173
|
+
|
|
150
174
|
<!-- Per-turn breadcrumb: shown when there is no active task (before Phase 1) -->
|
|
151
175
|
|
|
152
176
|
[workflow-state:no_task]
|
|
153
|
-
No active task.
|
|
154
|
-
|
|
155
|
-
|
|
177
|
+
No active task. First classify the current turn and ask for task-creation consent before creating any Trellis task.
|
|
178
|
+
Simple conversation / small task: ask only whether this turn should create a Trellis task. If the user says no, skip Trellis for this session.
|
|
179
|
+
Complex task: ask the user if you can create a Trellis task and enter the planning phase. If the user says no, explain, clarify scope, or suggest a smaller split.
|
|
156
180
|
[/workflow-state:no_task]
|
|
157
181
|
|
|
158
182
|
### Phase 1: Plan
|
|
159
|
-
- 1.0 Create task `[required · once]` (
|
|
160
|
-
- 1.1 Requirement exploration `[required · repeatable]`
|
|
183
|
+
- 1.0 Create task `[required · once]` (only after task-creation consent)
|
|
184
|
+
- 1.1 Requirement exploration `[required · repeatable]` (`prd.md`; complex tasks also need `design.md` + `implement.md`)
|
|
161
185
|
- 1.2 Research `[optional · repeatable]`
|
|
162
|
-
- 1.3 Configure context `[
|
|
163
|
-
- 1.4 Activate task `[required · once]` (
|
|
186
|
+
- 1.3 Configure context `[conditional · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi
|
|
187
|
+
- 1.4 Activate task `[required · once]` (review gate, then `task.py start`; status → in_progress)
|
|
164
188
|
- 1.5 Completion criteria
|
|
165
189
|
|
|
166
190
|
<!-- Per-turn breadcrumb: shown throughout Phase 1 (status='planning') -->
|
|
167
191
|
|
|
168
192
|
[workflow-state:planning]
|
|
169
|
-
Load
|
|
170
|
-
|
|
171
|
-
|
|
193
|
+
Load `trellis-brainstorm`; stay in planning.
|
|
194
|
+
Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; ask for review before `task.py start`.
|
|
195
|
+
Multi-deliverable scope: consider a parent task plus independently verifiable child tasks; dependencies must be written in child artifacts, not implied by tree position.
|
|
196
|
+
Sub-agent mode: curate `implement.jsonl` and `check.jsonl` as spec/research manifests before start.
|
|
172
197
|
[/workflow-state:planning]
|
|
173
198
|
|
|
174
199
|
<!-- Per-turn breadcrumb: shown throughout Phase 1 when codex.dispatch_mode=inline.
|
|
175
200
|
Codex-only opt-in alternate to [workflow-state:planning]. The main agent
|
|
176
|
-
edits code directly in Phase 2, so
|
|
201
|
+
edits code directly in Phase 2, so jsonl curation is skipped —
|
|
177
202
|
the inline workflow loads `trellis-before-dev` instead of injecting JSONL
|
|
178
203
|
into a sub-agent. -->
|
|
179
204
|
|
|
180
205
|
[workflow-state:planning-inline]
|
|
181
|
-
Load
|
|
182
|
-
|
|
183
|
-
|
|
206
|
+
Load `trellis-brainstorm`; stay in planning.
|
|
207
|
+
Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; ask for review before `task.py start`.
|
|
208
|
+
Multi-deliverable scope: consider a parent task plus independently verifiable child tasks; dependencies must be written in child artifacts, not implied by tree position.
|
|
209
|
+
Inline mode: skip jsonl curation; Phase 2 reads artifacts/specs via `trellis-before-dev`.
|
|
184
210
|
[/workflow-state:planning-inline]
|
|
185
211
|
|
|
186
212
|
### Phase 2: Execute
|
|
@@ -194,12 +220,13 @@ Then run `task.py start <task-dir>` to flip status to in_progress.
|
|
|
194
220
|
therefore must cover every required step from implementation through
|
|
195
221
|
commit, including Phase 3.3 spec update and Phase 3.4 commit. -->
|
|
196
222
|
|
|
223
|
+
Sub-agent dispatch protocol applies to all platforms and all sub-agents, including class-2 Codex/Copilot/Gemini/Qoder and `trellis-research`: every dispatch prompt starts with `Active task: <task path from task.py current>` before role-specific instructions.
|
|
224
|
+
|
|
197
225
|
[workflow-state:in_progress]
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
**Inline override** (per-turn only, escape hatch for sub-agent dispatch): the user's CURRENT message MUST explicitly contain one of: "do it inline" / "no sub-agent" / "你直接改" / "别派 sub-agent" / "main session 写就行" / "不用 sub-agent". **Without seeing one of these phrases you must NOT inline on your own**; do not invent an override the user never said.
|
|
226
|
+
Tools: `trellis-implement` / `trellis-research` are sub-agent types only (Task/Agent tool, NOT Skill; there is no skill by these names). `trellis-update-spec` is a skill. `trellis-check` exists as both; prefer the Agent form when verifying after code changes.
|
|
227
|
+
Flow: `trellis-implement` -> `trellis-check` -> `trellis-update-spec` -> commit (Phase 3.4) -> `/trellis:finish-work`.
|
|
228
|
+
Main-session default: dispatch implement/check sub-agents. Sub-agent self-exemption: if already running as `trellis-implement`, do NOT spawn another `trellis-implement` or `trellis-check`; if already running as `trellis-check`, do NOT spawn another `trellis-check` or `trellis-implement`. Dispatch is main session only.
|
|
229
|
+
Dispatch prompt starts with `Active task: <task path from task.py current>`. Read context: jsonl entries -> `prd.md` -> `design.md if present` -> `implement.md if present`.
|
|
203
230
|
[/workflow-state:in_progress]
|
|
204
231
|
|
|
205
232
|
<!-- Per-turn breadcrumb: shown while status='in_progress' when
|
|
@@ -208,9 +235,9 @@ Then run `task.py start <task-dir>` to flip status to in_progress.
|
|
|
208
235
|
instead of dispatching sub-agents. -->
|
|
209
236
|
|
|
210
237
|
[workflow-state:in_progress-inline]
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
238
|
+
Flow: `trellis-before-dev` -> edit -> `trellis-check` -> validation -> `trellis-update-spec` -> commit (Phase 3.4) -> `/trellis:finish-work`.
|
|
239
|
+
Do not dispatch implement/check sub-agents in inline mode.
|
|
240
|
+
Read context: `prd.md` -> `design.md if present` -> `implement.md if present`, plus relevant spec/research loaded by skills.
|
|
214
241
|
[/workflow-state:in_progress-inline]
|
|
215
242
|
|
|
216
243
|
### Phase 3: Finish
|
|
@@ -229,9 +256,7 @@ Phase 3.4 commit (required, once): after `trellis-update-spec`, or whenever impl
|
|
|
229
256
|
channel as the live blocks. -->
|
|
230
257
|
|
|
231
258
|
[workflow-state:completed]
|
|
232
|
-
Code committed
|
|
233
|
-
If you reach this state with uncommitted code, return to Phase 3.4 first — `/finish-work` refuses to run on a dirty working tree.
|
|
234
|
-
`task.py archive` deletes any runtime session files that still point at the archived task.
|
|
259
|
+
Code committed. Run `/trellis:finish-work`; if dirty, return to Phase 3.4 first.
|
|
235
260
|
[/workflow-state:completed]
|
|
236
261
|
|
|
237
262
|
### Rules
|
|
@@ -240,60 +265,33 @@ If you reach this state with uncommitted code, return to Phase 3.4 first — `/f
|
|
|
240
265
|
2. Run steps in order inside each Phase; `[required]` steps can't be skipped
|
|
241
266
|
3. Phases can roll back (e.g., Execute reveals a prd defect → return to Plan to fix, then re-enter Execute)
|
|
242
267
|
4. Steps tagged `[once]` are skipped if the output already exists; don't re-run
|
|
268
|
+
5. Artifact presence informs the next step; missing `design.md` / `implement.md` is valid for lightweight tasks and incomplete planning for complex tasks.
|
|
243
269
|
|
|
244
|
-
###
|
|
270
|
+
### Active Task Routing
|
|
245
271
|
|
|
246
|
-
When a user request matches one of these intents
|
|
272
|
+
When a user request matches one of these intents inside an active task, route first, then load the detailed phase step if needed.
|
|
247
273
|
|
|
248
274
|
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
249
275
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
| About to write code / start implementing | Dispatch the `trellis-implement` sub-agent per Phase 2.1 |
|
|
254
|
-
| Finished writing / want to verify | Dispatch the `trellis-check` sub-agent per Phase 2.2 |
|
|
255
|
-
| Stuck / fixed same bug several times | `trellis-break-loop` |
|
|
256
|
-
| Spec needs update | `trellis-update-spec` |
|
|
257
|
-
|
|
258
|
-
**Why `trellis-before-dev` is NOT in this table:** you are not the one writing code — the `trellis-implement` sub-agent is. Sub-agent platforms get spec context via `implement.jsonl` injection / prelude, not via the main thread loading `trellis-before-dev`.
|
|
276
|
+
- Planning or unclear requirements -> `trellis-brainstorm`.
|
|
277
|
+
- `in_progress` implementation/check -> dispatch `trellis-implement` / `trellis-check`.
|
|
278
|
+
- Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
|
|
259
279
|
|
|
260
280
|
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
261
281
|
|
|
262
282
|
[codex-inline, Kilo, Antigravity, Windsurf]
|
|
263
283
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
| About to write code / start implementing | `trellis-before-dev` (then implement directly in the main session) |
|
|
268
|
-
| Finished writing / want to verify | `trellis-check` |
|
|
269
|
-
| Stuck / fixed same bug several times | `trellis-break-loop` |
|
|
270
|
-
| Spec needs update | `trellis-update-spec` |
|
|
284
|
+
- Planning or unclear requirements -> `trellis-brainstorm`.
|
|
285
|
+
- Before editing -> `trellis-before-dev`; after editing -> `trellis-check`.
|
|
286
|
+
- Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
|
|
271
287
|
|
|
272
288
|
[/codex-inline, Kilo, Antigravity, Windsurf]
|
|
273
289
|
|
|
274
|
-
###
|
|
290
|
+
### Guardrails
|
|
275
291
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|---|---|
|
|
280
|
-
| "This is simple, I'll just code it in the main thread" | Dispatching `trellis-implement` is the cheap path; skipping it tempts you to write code in the main thread and lose spec context — sub-agents get `implement.jsonl` injected, you don't |
|
|
281
|
-
| "I already thought it through in plan mode" | Plan-mode output lives in memory — sub-agents can't see it; must be persisted to prd.md |
|
|
282
|
-
| "I already know the spec" | The spec may have been updated since you last read it; the sub-agent gets the fresh copy, you may not |
|
|
283
|
-
| "Code first, check later" | `trellis-check` surfaces issues you won't notice yourself; earlier is cheaper |
|
|
284
|
-
|
|
285
|
-
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
286
|
-
|
|
287
|
-
[codex-inline, Kilo, Antigravity, Windsurf]
|
|
288
|
-
|
|
289
|
-
| What you're thinking | Why it's wrong |
|
|
290
|
-
|---|---|
|
|
291
|
-
| "This is simple, just code it" | Simple tasks often grow complex; `trellis-before-dev` takes under a minute and loads the spec context you'll need |
|
|
292
|
-
| "I already thought it through in plan mode" | Plan-mode output lives in memory — must be persisted to prd.md before code |
|
|
293
|
-
| "I already know the spec" | The spec may have been updated since you last read it; read again |
|
|
294
|
-
| "Code first, check later" | `trellis-check` surfaces issues you won't notice yourself; earlier is cheaper |
|
|
295
|
-
|
|
296
|
-
[/codex-inline, Kilo, Antigravity, Windsurf]
|
|
292
|
+
- Task creation approval is not implementation approval; implementation waits for `task.py start` after artifact review.
|
|
293
|
+
- PRD-only is valid for lightweight tasks; complex tasks need `design.md` + `implement.md`.
|
|
294
|
+
- Planning must be persisted to task artifacts; checks must run before reporting completion.
|
|
297
295
|
|
|
298
296
|
### Loading Step Detail
|
|
299
297
|
|
|
@@ -308,11 +306,11 @@ python3 ./.trellis/scripts/get_context.py --mode phase --step <step>
|
|
|
308
306
|
|
|
309
307
|
## Phase 1: Plan
|
|
310
308
|
|
|
311
|
-
Goal:
|
|
309
|
+
Goal: classify the request, get task-creation consent when a task is needed, and produce the planning artifacts required before implementation.
|
|
312
310
|
|
|
313
311
|
#### 1.0 Create task `[required · once]`
|
|
314
312
|
|
|
315
|
-
Create the task directory
|
|
313
|
+
Create the task directory only after task-creation consent. The command sets status to `planning`, writes `task.json`, creates a default `prd.md`, and auto-targets the new task when session identity is available:
|
|
316
314
|
|
|
317
315
|
```bash
|
|
318
316
|
python3 ./.trellis/scripts/task.py create "<task title>" --slug <name>
|
|
@@ -320,9 +318,11 @@ python3 ./.trellis/scripts/task.py create "<task title>" --slug <name>
|
|
|
320
318
|
|
|
321
319
|
`--slug` is the human-readable name only. Do **not** include the `MM-DD-` date prefix; `task.py create` adds that prefix automatically.
|
|
322
320
|
|
|
323
|
-
|
|
321
|
+
For task trees, create the parent task first and then create each child with `--parent <parent-dir>`. Do not start the parent just because children exist; start the child that owns the next independently verifiable deliverable.
|
|
322
|
+
|
|
323
|
+
After this command succeeds, the per-turn breadcrumb auto-switches to `[workflow-state:planning]`, telling the AI to stay in planning.
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
Run only `create` here — do not also run `start`. `start` flips status to `in_progress`, which switches the breadcrumb to the implementation phase before planning artifacts are reviewed. Save `start` for step 1.4.
|
|
326
326
|
|
|
327
327
|
Skip when `python3 ./.trellis/scripts/task.py current --source` already points to a task.
|
|
328
328
|
|
|
@@ -335,8 +335,18 @@ The brainstorm skill will guide you to:
|
|
|
335
335
|
- Prefer researching over asking the user
|
|
336
336
|
- Prefer offering options over open-ended questions
|
|
337
337
|
- Update `prd.md` immediately after each user answer
|
|
338
|
+
- Split large scopes into a parent task plus child tasks when the deliverables can be verified independently
|
|
339
|
+
- Keep `prd.md` focused on requirements and acceptance criteria
|
|
340
|
+
- For complex tasks, produce `design.md` and `implement.md` before implementation starts
|
|
338
341
|
|
|
339
|
-
|
|
342
|
+
When considering a parent/child split:
|
|
343
|
+
- Use a parent task when one request contains several independently verifiable deliverables.
|
|
344
|
+
- Parent tasks own source requirements, child-task mapping, cross-child acceptance criteria, and final integration review.
|
|
345
|
+
- Child tasks own actual deliverables that can be planned, implemented, checked, and archived independently.
|
|
346
|
+
- Parent/child structure is not a dependency system. If child B depends on child A, write that ordering in child B's `prd.md` / `implement.md`.
|
|
347
|
+
- Start the child task that owns the next deliverable. Do not start the parent unless the parent itself has direct implementation work.
|
|
348
|
+
|
|
349
|
+
Return to this step whenever requirements change and revise the relevant artifact.
|
|
340
350
|
|
|
341
351
|
#### 1.2 Research `[optional · repeatable]`
|
|
342
352
|
|
|
@@ -371,7 +381,7 @@ Brainstorm and research can interleave freely — pause to research a technical
|
|
|
371
381
|
|
|
372
382
|
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
373
383
|
|
|
374
|
-
Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the right spec context. These files were seeded on `task create` with a single self-describing `_example` line; your job here is to fill in real entries.
|
|
384
|
+
Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the right spec/research context. These files were seeded on `task create` with a single self-describing `_example` line; your job here is to fill in real entries.
|
|
375
385
|
|
|
376
386
|
**Location**: `{TASK_DIR}/implement.jsonl` and `{TASK_DIR}/check.jsonl` (already exist).
|
|
377
387
|
|
|
@@ -389,6 +399,8 @@ Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the rig
|
|
|
389
399
|
- `implement.jsonl` → specs + research the implement sub-agent needs to write code correctly
|
|
390
400
|
- `check.jsonl` → specs for the check sub-agent (quality guidelines, check conventions, same research if needed)
|
|
391
401
|
|
|
402
|
+
These manifests do not replace `implement.md`. `implement.md` is the human-readable execution plan for a complex task; jsonl files only list context files to inject or load.
|
|
403
|
+
|
|
392
404
|
**How to discover relevant specs**:
|
|
393
405
|
|
|
394
406
|
```bash
|
|
@@ -408,7 +420,7 @@ python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reas
|
|
|
408
420
|
|
|
409
421
|
Delete the seed `_example` line once real entries exist (optional — it's skipped automatically by consumers).
|
|
410
422
|
|
|
411
|
-
Skip when: `implement.jsonl`
|
|
423
|
+
Skip when: `implement.jsonl` and `check.jsonl` have agent-curated entries (the seed row alone doesn't count).
|
|
412
424
|
|
|
413
425
|
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
414
426
|
|
|
@@ -420,12 +432,14 @@ Skip this step. Context is loaded directly by the `trellis-before-dev` skill in
|
|
|
420
432
|
|
|
421
433
|
#### 1.4 Activate task `[required · once]`
|
|
422
434
|
|
|
423
|
-
|
|
435
|
+
After artifact review, flip the task status to `in_progress`:
|
|
424
436
|
|
|
425
437
|
```bash
|
|
426
438
|
python3 ./.trellis/scripts/task.py start <task-dir>
|
|
427
439
|
```
|
|
428
440
|
|
|
441
|
+
For lightweight tasks, `prd.md` can be enough. For complex tasks, `prd.md`, `design.md`, and `implement.md` must exist and be reviewed before start. On sub-agent-capable platforms, curate jsonl manifests when extra spec or research context is needed; seed-only manifests are tolerated by consumers.
|
|
442
|
+
|
|
429
443
|
After this command succeeds, the breadcrumb auto-switches to `[workflow-state:in_progress]`, and the rest of Phase 2 / 3 follows.
|
|
430
444
|
|
|
431
445
|
If `task.py start` errors with a session-identity message (no context key from hook input, `TRELLIS_CONTEXT_ID`, or platform-native session env), follow the hint in the error to set up session identity, then retry.
|
|
@@ -435,14 +449,15 @@ If `task.py start` errors with a session-identity message (no context key from h
|
|
|
435
449
|
| Condition | Required |
|
|
436
450
|
|------|:---:|
|
|
437
451
|
| `prd.md` exists | ✅ |
|
|
438
|
-
| User confirms
|
|
452
|
+
| User confirms task should enter implementation | ✅ |
|
|
439
453
|
| `task.py start` has been run (status = in_progress) | ✅ |
|
|
440
454
|
| `research/` has artifacts (complex tasks) | recommended |
|
|
441
|
-
| `
|
|
455
|
+
| `design.md` exists (complex tasks) | ✅ |
|
|
456
|
+
| `implement.md` exists (complex tasks) | ✅ |
|
|
442
457
|
|
|
443
458
|
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
444
459
|
|
|
445
|
-
| `implement.jsonl`
|
|
460
|
+
| `implement.jsonl` / `check.jsonl` curated when extra spec or research context is needed | recommended |
|
|
446
461
|
|
|
447
462
|
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
448
463
|
|
|
@@ -450,7 +465,7 @@ If `task.py start` errors with a session-identity message (no context key from h
|
|
|
450
465
|
|
|
451
466
|
## Phase 2: Execute
|
|
452
467
|
|
|
453
|
-
Goal: turn
|
|
468
|
+
Goal: turn reviewed planning artifacts into code that passes quality checks.
|
|
454
469
|
|
|
455
470
|
#### 2.1 Implement `[required · repeatable]`
|
|
456
471
|
|
|
@@ -459,12 +474,12 @@ Goal: turn the prd into code that passes quality checks.
|
|
|
459
474
|
Spawn the implement sub-agent:
|
|
460
475
|
|
|
461
476
|
- **Agent type**: `trellis-implement`
|
|
462
|
-
- **Task description**: Implement the
|
|
477
|
+
- **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
|
|
463
478
|
- **Dispatch prompt guard**: Tell the spawned agent it is already the `trellis-implement` sub-agent and must implement directly, not spawn another `trellis-implement` / `trellis-check`.
|
|
464
479
|
|
|
465
480
|
The platform hook/plugin auto-handles:
|
|
466
|
-
- Reads `implement.jsonl` and injects
|
|
467
|
-
- Injects prd.md
|
|
481
|
+
- Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
|
|
482
|
+
- Injects `prd.md`, `design.md` if present, and `implement.md` if present
|
|
468
483
|
|
|
469
484
|
[/Claude Code, Cursor, OpenCode, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
470
485
|
|
|
@@ -473,12 +488,12 @@ The platform hook/plugin auto-handles:
|
|
|
473
488
|
Spawn the implement sub-agent:
|
|
474
489
|
|
|
475
490
|
- **Agent type**: `trellis-implement`
|
|
476
|
-
- **Task description**: Implement the
|
|
491
|
+
- **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
|
|
477
492
|
- **Dispatch prompt guard**: The prompt MUST start with `Active task: <task path>`, then explicitly say the spawned agent is already `trellis-implement` and must implement directly without spawning another `trellis-implement` / `trellis-check`.
|
|
478
493
|
|
|
479
494
|
The Codex sub-agent definition auto-handles the context load requirement:
|
|
480
|
-
- Resolves the active task with `task.py current --source`, then reads `prd.md` and `
|
|
481
|
-
- Reads `implement.jsonl` and requires the agent to load each referenced spec file before coding
|
|
495
|
+
- Resolves the active task with `task.py current --source`, then reads `prd.md`, `design.md` if present, and `implement.md` if present
|
|
496
|
+
- Reads `implement.jsonl` and requires the agent to load each referenced spec/research file before coding
|
|
482
497
|
|
|
483
498
|
[/codex-sub-agent]
|
|
484
499
|
|
|
@@ -487,21 +502,21 @@ The Codex sub-agent definition auto-handles the context load requirement:
|
|
|
487
502
|
Spawn the implement sub-agent:
|
|
488
503
|
|
|
489
504
|
- **Agent type**: `trellis-implement`
|
|
490
|
-
- **Task description**: Implement the
|
|
505
|
+
- **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
|
|
491
506
|
- **Dispatch prompt guard**: Tell the spawned agent it is already the `trellis-implement` sub-agent and must implement directly, not spawn another `trellis-implement` / `trellis-check`.
|
|
492
507
|
|
|
493
508
|
The platform prelude auto-handles the context load requirement:
|
|
494
|
-
- Reads `implement.jsonl` and injects
|
|
495
|
-
- Injects prd.md
|
|
509
|
+
- Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
|
|
510
|
+
- Injects `prd.md`, `design.md` if present, and `implement.md` if present
|
|
496
511
|
|
|
497
512
|
[/Kiro]
|
|
498
513
|
|
|
499
514
|
[codex-inline, Kilo, Antigravity, Windsurf]
|
|
500
515
|
|
|
501
516
|
1. Load the `trellis-before-dev` skill to read project guidelines
|
|
502
|
-
2. Read `{TASK_DIR}/prd.md`
|
|
517
|
+
2. Read `{TASK_DIR}/prd.md`, then `design.md` if present, then `implement.md` if present
|
|
503
518
|
3. Consult materials under `{TASK_DIR}/research/`
|
|
504
|
-
4. Implement the code per
|
|
519
|
+
4. Implement the code per reviewed artifacts
|
|
505
520
|
5. Run project lint and type-check
|
|
506
521
|
|
|
507
522
|
[/codex-inline, Kilo, Antigravity, Windsurf]
|
|
@@ -513,11 +528,12 @@ The platform prelude auto-handles the context load requirement:
|
|
|
513
528
|
Spawn the check sub-agent:
|
|
514
529
|
|
|
515
530
|
- **Agent type**: `trellis-check`
|
|
516
|
-
- **Task description**: Review all code changes against
|
|
531
|
+
- **Task description**: Review all code changes against specs and task artifacts; fix any findings directly; ensure lint and type-check pass
|
|
517
532
|
- **Dispatch prompt guard**: Tell the spawned agent it is already the `trellis-check` sub-agent and must review/fix directly, not spawn another `trellis-check` / `trellis-implement`.
|
|
518
533
|
|
|
519
534
|
The check agent's job:
|
|
520
535
|
- Review code changes against specs
|
|
536
|
+
- Review code changes against `prd.md`, `design.md` if present, and `implement.md` if present
|
|
521
537
|
- Auto-fix issues it finds
|
|
522
538
|
- Run lint and typecheck to verify
|
|
523
539
|
|
|
@@ -635,15 +651,20 @@ This section is for developers who want to modify the Trellis workflow itself. A
|
|
|
635
651
|
|
|
636
652
|
### Changing what a step means
|
|
637
653
|
|
|
638
|
-
Edit the corresponding step's walkthrough body in the Phase 1 / 2 / 3 sections above.
|
|
654
|
+
Edit the corresponding step's walkthrough body in the Phase 1 / 2 / 3 sections above. Critical invariants:
|
|
655
|
+
- No active task must triage first and ask for task-creation consent before creating a Trellis task.
|
|
656
|
+
- Planning must distinguish lightweight PRD-only tasks from complex tasks that require `prd.md`, `design.md`, and `implement.md` before start.
|
|
657
|
+
- Every required execution path must keep the Phase 3.4 commit reminder reachable before `/trellis:finish-work`.
|
|
639
658
|
|
|
640
|
-
All
|
|
659
|
+
All tag blocks live in the `## Phase Index` section above, immediately after each phase summary:
|
|
641
660
|
|
|
642
661
|
| Scope | Corresponding tag |
|
|
643
662
|
|---|---|
|
|
644
663
|
| No active task (before Phase 1) | `[workflow-state:no_task]` (after the Phase Index ASCII art) |
|
|
645
664
|
| All of Phase 1 (task created → ready for implementation) | `[workflow-state:planning]` (after Phase 1 summary) |
|
|
665
|
+
| Codex inline Phase 1 | `[workflow-state:planning-inline]` |
|
|
646
666
|
| Phase 2 + Phase 3.1–3.4 (implementation + check + wrap-up) | `[workflow-state:in_progress]` (after Phase 2 summary) |
|
|
667
|
+
| Codex inline Phase 2 + Phase 3.1–3.4 | `[workflow-state:in_progress-inline]` |
|
|
647
668
|
| After Phase 3.5 (archived) | `[workflow-state:completed]` (after Phase 3 summary; **currently DEAD**) |
|
|
648
669
|
|
|
649
670
|
### Changing the per-turn prompt text
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Homedir guard for destructive commands (init, uninstall).
|
|
3
|
+
*
|
|
4
|
+
* Running `trellis init` / `trellis uninstall` in `$HOME` is catastrophic:
|
|
5
|
+
* platforms like Claude Code, Codex, OpenCode all store global runtime data
|
|
6
|
+
* (`.claude/projects/<sanitized-cwd>/*.jsonl` chat history, `.codex/sessions/`,
|
|
7
|
+
* `.opencode/` caches, etc.) directly in the user's home directory. If
|
|
8
|
+
* trellis manages the same `.{platform}/` config dirs and the hash manifest
|
|
9
|
+
* picks up runtime data, uninstall would later unlink it.
|
|
10
|
+
*
|
|
11
|
+
* Subdirectories of home (`~/Documents/projects/foo/`) are NOT blocked — only
|
|
12
|
+
* exact-home match.
|
|
13
|
+
*
|
|
14
|
+
* Bypass: `TRELLIS_ALLOW_HOMEDIR=1`.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Returns true if `process.cwd()` is exactly the user's home directory.
|
|
18
|
+
*
|
|
19
|
+
* Uses `realpathSync.native()` on both sides so symlinks, `..` segments, and
|
|
20
|
+
* case differences (Windows) don't confuse the comparison. On Windows the
|
|
21
|
+
* comparison is also case-insensitive — `C:\Users\Alice` matches
|
|
22
|
+
* `c:\users\alice`.
|
|
23
|
+
*
|
|
24
|
+
* Permissive on lookup failure: if realpath fails for any reason (broken
|
|
25
|
+
* symlink, EACCES, etc.) we return false so a safety check doesn't crash
|
|
26
|
+
* the command.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isCwdHomedir(): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Error message printed by both `trellis init` and `trellis uninstall` when
|
|
31
|
+
* the homedir guard trips.
|
|
32
|
+
*/
|
|
33
|
+
export declare function homedirGuardMessage(commandName: "init" | "uninstall"): string;
|
|
34
|
+
/**
|
|
35
|
+
* Returns true when the bypass env var is set.
|
|
36
|
+
*/
|
|
37
|
+
export declare function homedirBypassEnabled(): boolean;
|
|
38
|
+
//# sourceMappingURL=cwd-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cwd-guard.d.ts","sourceRoot":"","sources":["../../src/utils/cwd-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAYtC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAS7E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Homedir guard for destructive commands (init, uninstall).
|
|
3
|
+
*
|
|
4
|
+
* Running `trellis init` / `trellis uninstall` in `$HOME` is catastrophic:
|
|
5
|
+
* platforms like Claude Code, Codex, OpenCode all store global runtime data
|
|
6
|
+
* (`.claude/projects/<sanitized-cwd>/*.jsonl` chat history, `.codex/sessions/`,
|
|
7
|
+
* `.opencode/` caches, etc.) directly in the user's home directory. If
|
|
8
|
+
* trellis manages the same `.{platform}/` config dirs and the hash manifest
|
|
9
|
+
* picks up runtime data, uninstall would later unlink it.
|
|
10
|
+
*
|
|
11
|
+
* Subdirectories of home (`~/Documents/projects/foo/`) are NOT blocked — only
|
|
12
|
+
* exact-home match.
|
|
13
|
+
*
|
|
14
|
+
* Bypass: `TRELLIS_ALLOW_HOMEDIR=1`.
|
|
15
|
+
*/
|
|
16
|
+
import { realpathSync } from "node:fs";
|
|
17
|
+
import * as os from "node:os";
|
|
18
|
+
/**
|
|
19
|
+
* Returns true if `process.cwd()` is exactly the user's home directory.
|
|
20
|
+
*
|
|
21
|
+
* Uses `realpathSync.native()` on both sides so symlinks, `..` segments, and
|
|
22
|
+
* case differences (Windows) don't confuse the comparison. On Windows the
|
|
23
|
+
* comparison is also case-insensitive — `C:\Users\Alice` matches
|
|
24
|
+
* `c:\users\alice`.
|
|
25
|
+
*
|
|
26
|
+
* Permissive on lookup failure: if realpath fails for any reason (broken
|
|
27
|
+
* symlink, EACCES, etc.) we return false so a safety check doesn't crash
|
|
28
|
+
* the command.
|
|
29
|
+
*/
|
|
30
|
+
export function isCwdHomedir() {
|
|
31
|
+
try {
|
|
32
|
+
let cwd = realpathSync.native(process.cwd());
|
|
33
|
+
let home = realpathSync.native(os.homedir());
|
|
34
|
+
if (process.platform === "win32") {
|
|
35
|
+
cwd = cwd.toLowerCase();
|
|
36
|
+
home = home.toLowerCase();
|
|
37
|
+
}
|
|
38
|
+
return cwd === home;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Error message printed by both `trellis init` and `trellis uninstall` when
|
|
46
|
+
* the homedir guard trips.
|
|
47
|
+
*/
|
|
48
|
+
export function homedirGuardMessage(commandName) {
|
|
49
|
+
return (`✗ Refusing to run \`trellis ${commandName}\` in your home directory.\n\n` +
|
|
50
|
+
`Trellis manages platform config dirs like .claude/, .codex/, .opencode/, which\n` +
|
|
51
|
+
`in your home directory also contain runtime data from those CLIs (chat history,\n` +
|
|
52
|
+
`session JSONLs, caches). Running here can wipe that data.\n\n` +
|
|
53
|
+
`Run trellis from your project directory instead. If you really want to run in\n` +
|
|
54
|
+
`$HOME, set TRELLIS_ALLOW_HOMEDIR=1.`);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Returns true when the bypass env var is set.
|
|
58
|
+
*/
|
|
59
|
+
export function homedirBypassEnabled() {
|
|
60
|
+
return process.env.TRELLIS_ALLOW_HOMEDIR === "1";
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=cwd-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cwd-guard.js","sourceRoot":"","sources":["../../src/utils/cwd-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY;IAC1B,IAAI,CAAC;QACH,IAAI,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7C,IAAI,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YACjC,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;YACxB,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,CAAC;QACD,OAAO,GAAG,KAAK,IAAI,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAAiC;IACnE,OAAO,CACL,+BAA+B,WAAW,gCAAgC;QAC1E,kFAAkF;QAClF,mFAAmF;QACnF,+DAA+D;QAC/D,iFAAiF;QACjF,qCAAqC,CACtC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,GAAG,CAAC;AACnD,CAAC"}
|
|
@@ -4,6 +4,19 @@ export interface WriteOptions {
|
|
|
4
4
|
}
|
|
5
5
|
export declare function setWriteMode(mode: WriteMode): void;
|
|
6
6
|
export declare function getWriteMode(): WriteMode;
|
|
7
|
+
/**
|
|
8
|
+
* Begin recording every write into the returned Set. Calls accumulate into the
|
|
9
|
+
* same set until `stopRecordingWrites` runs. POSIX relative paths (relative to
|
|
10
|
+
* `cwd`) are stored, matching `.template-hashes.json` keys.
|
|
11
|
+
*
|
|
12
|
+
* Nested recording sessions are NOT supported — the caller must ensure
|
|
13
|
+
* `stopRecordingWrites` runs before the next `startRecordingWrites`. Failure
|
|
14
|
+
* is silent (the second `start` replaces the first set), so callers should
|
|
15
|
+
* always pair start/stop in try/finally.
|
|
16
|
+
*/
|
|
17
|
+
export declare function startRecordingWrites(cwd: string): Set<string>;
|
|
18
|
+
/** End recording. Subsequent writes are not captured until `start` is called again. */
|
|
19
|
+
export declare function stopRecordingWrites(): void;
|
|
7
20
|
/**
|
|
8
21
|
* Write file with conflict handling
|
|
9
22
|
* - If file doesn't exist: write directly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-writer.d.ts","sourceRoot":"","sources":["../../src/utils/file-writer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-writer.d.ts","sourceRoot":"","sources":["../../src/utils/file-writer.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE5D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;CACjB;AASD,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAElD;AAED,wBAAgB,YAAY,IAAI,SAAS,CAExC;AAkBD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAK7D;AAED,uFAAuF;AACvF,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAsCD;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GACjC,OAAO,CAAC,OAAO,CAAC,CA0HlB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE/C"}
|