trellis-hgl 0.6.0-beta.18
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/LICENSE +235 -0
- package/README.md +149 -0
- package/bin/trellis.js +3 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +207 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/channel/adapters/claude.d.ts +38 -0
- package/dist/commands/channel/adapters/claude.d.ts.map +1 -0
- package/dist/commands/channel/adapters/claude.js +209 -0
- package/dist/commands/channel/adapters/claude.js.map +1 -0
- package/dist/commands/channel/adapters/codex.d.ts +81 -0
- package/dist/commands/channel/adapters/codex.d.ts.map +1 -0
- package/dist/commands/channel/adapters/codex.js +512 -0
- package/dist/commands/channel/adapters/codex.js.map +1 -0
- package/dist/commands/channel/adapters/index.d.ts +79 -0
- package/dist/commands/channel/adapters/index.d.ts.map +1 -0
- package/dist/commands/channel/adapters/index.js +109 -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/index.d.ts +3 -0
- package/dist/commands/channel/index.d.ts.map +1 -0
- package/dist/commands/channel/index.js +503 -0
- package/dist/commands/channel/index.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 +16 -0
- package/dist/commands/channel/messages.d.ts.map +1 -0
- package/dist/commands/channel/messages.js +249 -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 +31 -0
- package/dist/commands/channel/run.d.ts.map +1 -0
- package/dist/commands/channel/run.js +137 -0
- package/dist/commands/channel/run.js.map +1 -0
- package/dist/commands/channel/send.d.ts +13 -0
- package/dist/commands/channel/send.d.ts.map +1 -0
- package/dist/commands/channel/send.js +26 -0
- package/dist/commands/channel/send.js.map +1 -0
- package/dist/commands/channel/spawn.d.ts +30 -0
- package/dist/commands/channel/spawn.d.ts.map +1 -0
- package/dist/commands/channel/spawn.js +194 -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/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 +66 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/shutdown.js +143 -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 +20 -0
- package/dist/commands/channel/supervisor/turns.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/turns.js +28 -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 +53 -0
- package/dist/commands/channel/supervisor.d.ts.map +1 -0
- package/dist/commands/channel/supervisor.js +304 -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 +18 -0
- package/dist/commands/channel/wait.d.ts.map +1 -0
- package/dist/commands/channel/wait.js +76 -0
- package/dist/commands/channel/wait.js.map +1 -0
- package/dist/commands/init.d.ts +59 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +1459 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mem.d.ts +30 -0
- package/dist/commands/mem.d.ts.map +1 -0
- package/dist/commands/mem.js +424 -0
- package/dist/commands/mem.js.map +1 -0
- package/dist/commands/uninstall.d.ts +27 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +339 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.d.ts +72 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +1926 -0
- package/dist/commands/update.js.map +1 -0
- 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/antigravity.d.ts +7 -0
- package/dist/configurators/antigravity.d.ts.map +1 -0
- package/dist/configurators/antigravity.js +19 -0
- package/dist/configurators/antigravity.js.map +1 -0
- package/dist/configurators/claude.d.ts +9 -0
- package/dist/configurators/claude.d.ts.map +1 -0
- package/dist/configurators/claude.js +72 -0
- package/dist/configurators/claude.js.map +1 -0
- package/dist/configurators/codebuddy.d.ts +10 -0
- package/dist/configurators/codebuddy.d.ts.map +1 -0
- package/dist/configurators/codebuddy.js +30 -0
- package/dist/configurators/codebuddy.js.map +1 -0
- package/dist/configurators/codex.d.ts +8 -0
- package/dist/configurators/codex.d.ts.map +1 -0
- package/dist/configurators/codex.js +87 -0
- package/dist/configurators/codex.js.map +1 -0
- package/dist/configurators/copilot.d.ts +10 -0
- package/dist/configurators/copilot.d.ts.map +1 -0
- package/dist/configurators/copilot.js +51 -0
- package/dist/configurators/copilot.js.map +1 -0
- package/dist/configurators/cursor.d.ts +10 -0
- package/dist/configurators/cursor.d.ts.map +1 -0
- package/dist/configurators/cursor.js +29 -0
- package/dist/configurators/cursor.js.map +1 -0
- package/dist/configurators/droid.d.ts +10 -0
- package/dist/configurators/droid.d.ts.map +1 -0
- package/dist/configurators/droid.js +30 -0
- package/dist/configurators/droid.js.map +1 -0
- package/dist/configurators/gemini.d.ts +16 -0
- package/dist/configurators/gemini.d.ts.map +1 -0
- package/dist/configurators/gemini.js +38 -0
- package/dist/configurators/gemini.js.map +1 -0
- package/dist/configurators/index.d.ts +65 -0
- package/dist/configurators/index.d.ts.map +1 -0
- package/dist/configurators/index.js +367 -0
- package/dist/configurators/index.js.map +1 -0
- package/dist/configurators/kilo.d.ts +7 -0
- package/dist/configurators/kilo.d.ts.map +1 -0
- package/dist/configurators/kilo.js +19 -0
- package/dist/configurators/kilo.js.map +1 -0
- package/dist/configurators/kiro.d.ts +8 -0
- package/dist/configurators/kiro.d.ts.map +1 -0
- package/dist/configurators/kiro.js +24 -0
- package/dist/configurators/kiro.js.map +1 -0
- package/dist/configurators/opencode.d.ts +14 -0
- package/dist/configurators/opencode.d.ts.map +1 -0
- package/dist/configurators/opencode.js +96 -0
- package/dist/configurators/opencode.js.map +1 -0
- package/dist/configurators/pi.d.ts +3 -0
- package/dist/configurators/pi.d.ts.map +1 -0
- package/dist/configurators/pi.js +45 -0
- package/dist/configurators/pi.js.map +1 -0
- package/dist/configurators/qoder.d.ts +11 -0
- package/dist/configurators/qoder.d.ts.map +1 -0
- package/dist/configurators/qoder.js +31 -0
- package/dist/configurators/qoder.js.map +1 -0
- package/dist/configurators/shared.d.ts +178 -0
- package/dist/configurators/shared.d.ts.map +1 -0
- package/dist/configurators/shared.js +541 -0
- package/dist/configurators/shared.js.map +1 -0
- package/dist/configurators/windsurf.d.ts +7 -0
- package/dist/configurators/windsurf.d.ts.map +1 -0
- package/dist/configurators/windsurf.js +19 -0
- package/dist/configurators/windsurf.js.map +1 -0
- package/dist/configurators/workflow.d.ts +37 -0
- package/dist/configurators/workflow.d.ts.map +1 -0
- package/dist/configurators/workflow.js +164 -0
- package/dist/configurators/workflow.js.map +1 -0
- package/dist/constants/paths.d.ts +70 -0
- package/dist/constants/paths.d.ts.map +1 -0
- package/dist/constants/paths.js +79 -0
- package/dist/constants/paths.js.map +1 -0
- package/dist/constants/version.d.ts +9 -0
- package/dist/constants/version.d.ts.map +1 -0
- package/dist/constants/version.js +15 -0
- package/dist/constants/version.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/index.d.ts +62 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +187 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/manifests/0.1.9.json +30 -0
- package/dist/migrations/manifests/0.2.0.json +49 -0
- package/dist/migrations/manifests/0.2.12.json +9 -0
- package/dist/migrations/manifests/0.2.13.json +9 -0
- package/dist/migrations/manifests/0.2.14.json +175 -0
- package/dist/migrations/manifests/0.2.15.json +33 -0
- package/dist/migrations/manifests/0.3.0-beta.0.json +297 -0
- package/dist/migrations/manifests/0.3.0-beta.1.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.15.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.5.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.6.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.7.json +11 -0
- package/dist/migrations/manifests/0.3.0-beta.8.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.9.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.0.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.1.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.2.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.3.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.4.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.5.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.6.json +9 -0
- package/dist/migrations/manifests/0.3.0.json +11 -0
- package/dist/migrations/manifests/0.3.1.json +9 -0
- package/dist/migrations/manifests/0.3.10.json +9 -0
- package/dist/migrations/manifests/0.3.2.json +9 -0
- package/dist/migrations/manifests/0.3.3.json +9 -0
- package/dist/migrations/manifests/0.3.4.json +21 -0
- package/dist/migrations/manifests/0.3.5.json +9 -0
- package/dist/migrations/manifests/0.3.6.json +9 -0
- package/dist/migrations/manifests/0.3.7.json +9 -0
- package/dist/migrations/manifests/0.3.8.json +9 -0
- package/dist/migrations/manifests/0.3.9.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.1.json +228 -0
- package/dist/migrations/manifests/0.4.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.5.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.6.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.7.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.8.json +34 -0
- package/dist/migrations/manifests/0.4.0-beta.9.json +9 -0
- package/dist/migrations/manifests/0.4.0-rc.0.json +9 -0
- package/dist/migrations/manifests/0.4.0-rc.1.json +9 -0
- package/dist/migrations/manifests/0.4.0.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.0.json +1646 -0
- package/dist/migrations/manifests/0.5.0-beta.1.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.15.json +116 -0
- package/dist/migrations/manifests/0.5.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.17.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.18.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.19.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.5.json +222 -0
- package/dist/migrations/manifests/0.5.0-beta.6.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.7.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.8.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.9.json +48 -0
- package/dist/migrations/manifests/0.5.0-rc.0.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.1.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.2.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.3.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.4.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.5.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.6.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.7.json +9 -0
- package/dist/migrations/manifests/0.5.0.json +9 -0
- package/dist/migrations/manifests/0.5.1.json +9 -0
- 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.2.json +9 -0
- package/dist/migrations/manifests/0.5.3.json +9 -0
- package/dist/migrations/manifests/0.5.4.json +9 -0
- package/dist/migrations/manifests/0.5.5.json +9 -0
- package/dist/migrations/manifests/0.5.6.json +9 -0
- package/dist/migrations/manifests/0.5.7.json +16 -0
- package/dist/migrations/manifests/0.5.8.json +9 -0
- package/dist/migrations/manifests/0.5.9.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.0.json +16 -0
- package/dist/migrations/manifests/0.6.0-beta.1.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.2.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 +123 -0
- package/dist/templates/claude/agents/trellis-code-architecture-review.md +71 -0
- package/dist/templates/claude/agents/trellis-code-review.md +71 -0
- package/dist/templates/claude/agents/trellis-implement.md +118 -0
- package/dist/templates/claude/agents/trellis-merge-review.md +72 -0
- package/dist/templates/claude/agents/trellis-research.md +137 -0
- package/dist/templates/claude/agents/trellis-spec-review.md +71 -0
- package/dist/templates/claude/index.d.ts +22 -0
- package/dist/templates/claude/index.d.ts.map +1 -0
- package/dist/templates/claude/index.js +46 -0
- package/dist/templates/claude/index.js.map +1 -0
- package/dist/templates/claude/settings.json +73 -0
- package/dist/templates/codebuddy/agents/trellis-check.md +115 -0
- package/dist/templates/codebuddy/agents/trellis-implement.md +110 -0
- package/dist/templates/codebuddy/agents/trellis-research.md +137 -0
- package/dist/templates/codebuddy/index.d.ts +15 -0
- package/dist/templates/codebuddy/index.d.ts.map +1 -0
- package/dist/templates/codebuddy/index.js +15 -0
- package/dist/templates/codebuddy/index.js.map +1 -0
- package/dist/templates/codebuddy/settings.json +59 -0
- package/dist/templates/codex/agents/trellis-check.toml +84 -0
- package/dist/templates/codex/agents/trellis-implement.toml +65 -0
- package/dist/templates/codex/agents/trellis-research.toml +73 -0
- package/dist/templates/codex/config.toml +35 -0
- package/dist/templates/codex/hooks/session-start.py +545 -0
- package/dist/templates/codex/hooks.json +15 -0
- package/dist/templates/codex/index.d.ts +39 -0
- package/dist/templates/codex/index.d.ts.map +1 -0
- package/dist/templates/codex/index.js +85 -0
- package/dist/templates/codex/index.js.map +1 -0
- package/dist/templates/codex/skills/before-dev/SKILL.md +40 -0
- package/dist/templates/codex/skills/brainstorm/SKILL.md +112 -0
- package/dist/templates/codex/skills/break-loop/SKILL.md +130 -0
- package/dist/templates/codex/skills/check/SKILL.md +98 -0
- package/dist/templates/codex/skills/check-cross-layer/SKILL.md +158 -0
- package/dist/templates/codex/skills/create-command/SKILL.md +101 -0
- package/dist/templates/codex/skills/finish-work/SKILL.md +90 -0
- package/dist/templates/codex/skills/improve-ut/SKILL.md +69 -0
- package/dist/templates/codex/skills/integrate-skill/SKILL.md +221 -0
- package/dist/templates/codex/skills/onboard/SKILL.md +363 -0
- package/dist/templates/codex/skills/record-session/SKILL.md +67 -0
- package/dist/templates/codex/skills/start/SKILL.md +64 -0
- package/dist/templates/codex/skills/update-spec/SKILL.md +335 -0
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +73 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +54 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +84 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +57 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +78 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +90 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +65 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +55 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +68 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +80 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +51 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +102 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +130 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +75 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +71 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +80 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +69 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +59 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +74 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +83 -0
- package/dist/templates/common/commands/continue.md +56 -0
- package/dist/templates/common/commands/finish-work.md +66 -0
- package/dist/templates/common/commands/start.md +59 -0
- package/dist/templates/common/index.d.ts +48 -0
- package/dist/templates/common/index.d.ts.map +1 -0
- package/dist/templates/common/index.js +104 -0
- package/dist/templates/common/index.js.map +1 -0
- package/dist/templates/common/skills/before-dev.md +41 -0
- package/dist/templates/common/skills/brainstorm.md +112 -0
- package/dist/templates/common/skills/break-loop.md +125 -0
- package/dist/templates/common/skills/check.md +93 -0
- package/dist/templates/common/skills/grill-me.md +49 -0
- package/dist/templates/common/skills/improve-codebase-architecture.md +38 -0
- package/dist/templates/common/skills/tdd.md +34 -0
- package/dist/templates/common/skills/update-spec.md +351 -0
- package/dist/templates/copilot/hooks/session-start.py +547 -0
- package/dist/templates/copilot/hooks.json +19 -0
- package/dist/templates/copilot/index.d.ts +23 -0
- package/dist/templates/copilot/index.d.ts.map +1 -0
- package/dist/templates/copilot/index.js +54 -0
- package/dist/templates/copilot/index.js.map +1 -0
- package/dist/templates/copilot/prompts/before-dev.prompt.md +39 -0
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +111 -0
- package/dist/templates/copilot/prompts/break-loop.prompt.md +129 -0
- package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +157 -0
- package/dist/templates/copilot/prompts/check.prompt.md +97 -0
- package/dist/templates/copilot/prompts/create-command.prompt.md +116 -0
- package/dist/templates/copilot/prompts/finish-work.prompt.md +99 -0
- package/dist/templates/copilot/prompts/integrate-skill.prompt.md +223 -0
- package/dist/templates/copilot/prompts/onboard.prompt.md +362 -0
- package/dist/templates/copilot/prompts/parallel.prompt.md +204 -0
- package/dist/templates/copilot/prompts/record-session.prompt.md +66 -0
- package/dist/templates/copilot/prompts/start.prompt.md +63 -0
- package/dist/templates/copilot/prompts/update-spec.prompt.md +358 -0
- package/dist/templates/cursor/agents/trellis-check.md +114 -0
- package/dist/templates/cursor/agents/trellis-implement.md +109 -0
- package/dist/templates/cursor/agents/trellis-research.md +136 -0
- package/dist/templates/cursor/hooks.json +24 -0
- package/dist/templates/cursor/index.d.ts +13 -0
- package/dist/templates/cursor/index.d.ts.map +1 -0
- package/dist/templates/cursor/index.js +13 -0
- package/dist/templates/cursor/index.js.map +1 -0
- package/dist/templates/droid/droids/trellis-check.md +107 -0
- package/dist/templates/droid/droids/trellis-implement.md +102 -0
- package/dist/templates/droid/droids/trellis-research.md +137 -0
- package/dist/templates/droid/index.d.ts +15 -0
- package/dist/templates/droid/index.d.ts.map +1 -0
- package/dist/templates/droid/index.js +15 -0
- package/dist/templates/droid/index.js.map +1 -0
- package/dist/templates/droid/settings.json +59 -0
- package/dist/templates/extract.d.ts +40 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +106 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/gemini/agents/trellis-check.md +107 -0
- package/dist/templates/gemini/agents/trellis-implement.md +102 -0
- package/dist/templates/gemini/agents/trellis-research.md +136 -0
- package/dist/templates/gemini/index.d.ts +13 -0
- package/dist/templates/gemini/index.d.ts.map +1 -0
- package/dist/templates/gemini/index.js +13 -0
- package/dist/templates/gemini/index.js.map +1 -0
- package/dist/templates/gemini/settings.json +28 -0
- package/dist/templates/kiro/agents/trellis-check.json +26 -0
- package/dist/templates/kiro/agents/trellis-implement.json +26 -0
- package/dist/templates/kiro/agents/trellis-research.json +30 -0
- package/dist/templates/kiro/index.d.ts +18 -0
- package/dist/templates/kiro/index.d.ts.map +1 -0
- package/dist/templates/kiro/index.js +18 -0
- package/dist/templates/kiro/index.js.map +1 -0
- package/dist/templates/markdown/agents.md +21 -0
- package/dist/templates/markdown/gitignore.txt +15 -0
- package/dist/templates/markdown/index.d.ts +27 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +52 -0
- package/dist/templates/markdown/index.js.map +1 -0
- package/dist/templates/markdown/spec/backend/database-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/backend/error-handling.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/index.md.txt +38 -0
- package/dist/templates/markdown/spec/backend/logging-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/component-guidelines.md.txt +59 -0
- package/dist/templates/markdown/spec/frontend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/frontend/hook-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/index.md.txt +39 -0
- package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/state-management.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/type-safety.md.txt +51 -0
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +223 -0
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +259 -0
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +595 -0
- package/dist/templates/markdown/spec/guides/index.md.txt +97 -0
- package/dist/templates/markdown/workspace-index.md +125 -0
- package/dist/templates/markdown/worktree.yaml.txt +58 -0
- package/dist/templates/opencode/agents/trellis-check.md +122 -0
- package/dist/templates/opencode/agents/trellis-implement.md +118 -0
- package/dist/templates/opencode/agents/trellis-research.md +145 -0
- package/dist/templates/opencode/lib/session-utils.js +521 -0
- package/dist/templates/opencode/lib/trellis-context.js +381 -0
- package/dist/templates/opencode/package.json +5 -0
- package/dist/templates/opencode/plugins/inject-subagent-context.js +513 -0
- package/dist/templates/opencode/plugins/inject-workflow-state.js +159 -0
- package/dist/templates/opencode/plugins/session-start.js +101 -0
- package/dist/templates/pi/agents/trellis-check.md +37 -0
- package/dist/templates/pi/agents/trellis-implement.md +42 -0
- package/dist/templates/pi/agents/trellis-research.md +25 -0
- package/dist/templates/pi/extensions/trellis/index.ts.txt +1174 -0
- package/dist/templates/pi/index.d.ts +5 -0
- package/dist/templates/pi/index.d.ts.map +1 -0
- package/dist/templates/pi/index.js +12 -0
- package/dist/templates/pi/index.js.map +1 -0
- package/dist/templates/pi/settings.json +21 -0
- package/dist/templates/qoder/agents/trellis-check.md +108 -0
- package/dist/templates/qoder/agents/trellis-implement.md +103 -0
- package/dist/templates/qoder/agents/trellis-research.md +137 -0
- package/dist/templates/qoder/index.d.ts +15 -0
- package/dist/templates/qoder/index.d.ts.map +1 -0
- package/dist/templates/qoder/index.js +15 -0
- package/dist/templates/qoder/index.js.map +1 -0
- package/dist/templates/qoder/settings.json +47 -0
- package/dist/templates/shared-hooks/index.d.ts +50 -0
- package/dist/templates/shared-hooks/index.d.ts.map +1 -0
- package/dist/templates/shared-hooks/index.js +88 -0
- package/dist/templates/shared-hooks/index.js.map +1 -0
- package/dist/templates/shared-hooks/inject-shell-session-context.py +183 -0
- package/dist/templates/shared-hooks/inject-subagent-context.py +771 -0
- package/dist/templates/shared-hooks/inject-workflow-state.py +363 -0
- package/dist/templates/shared-hooks/session-start.py +832 -0
- package/dist/templates/template-utils.d.ts +26 -0
- package/dist/templates/template-utils.d.ts.map +1 -0
- package/dist/templates/template-utils.js +60 -0
- package/dist/templates/template-utils.js.map +1 -0
- package/dist/templates/trellis/config.yaml +90 -0
- package/dist/templates/trellis/gitignore.txt +32 -0
- package/dist/templates/trellis/index.d.ts +52 -0
- package/dist/templates/trellis/index.d.ts.map +1 -0
- package/dist/templates/trellis/index.js +97 -0
- package/dist/templates/trellis/index.js.map +1 -0
- package/dist/templates/trellis/scripts/__init__.py +5 -0
- package/dist/templates/trellis/scripts/add_session.py +547 -0
- package/dist/templates/trellis/scripts/common/__init__.py +92 -0
- package/dist/templates/trellis/scripts/common/active_task.py +626 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +811 -0
- package/dist/templates/trellis/scripts/common/config.py +445 -0
- package/dist/templates/trellis/scripts/common/developer.py +190 -0
- package/dist/templates/trellis/scripts/common/git.py +31 -0
- package/dist/templates/trellis/scripts/common/git_context.py +106 -0
- package/dist/templates/trellis/scripts/common/io.py +37 -0
- package/dist/templates/trellis/scripts/common/log.py +45 -0
- package/dist/templates/trellis/scripts/common/packages_context.py +238 -0
- package/dist/templates/trellis/scripts/common/paths.py +447 -0
- package/dist/templates/trellis/scripts/common/safe_commit.py +285 -0
- package/dist/templates/trellis/scripts/common/session_context.py +821 -0
- package/dist/templates/trellis/scripts/common/task_context.py +223 -0
- package/dist/templates/trellis/scripts/common/task_queue.py +188 -0
- package/dist/templates/trellis/scripts/common/task_store.py +698 -0
- package/dist/templates/trellis/scripts/common/task_utils.py +274 -0
- package/dist/templates/trellis/scripts/common/tasks.py +112 -0
- package/dist/templates/trellis/scripts/common/trellis_config.py +131 -0
- package/dist/templates/trellis/scripts/common/types.py +110 -0
- package/dist/templates/trellis/scripts/common/workflow_phase.py +212 -0
- package/dist/templates/trellis/scripts/get_context.py +16 -0
- package/dist/templates/trellis/scripts/get_developer.py +26 -0
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +243 -0
- package/dist/templates/trellis/scripts/init_developer.py +51 -0
- package/dist/templates/trellis/scripts/task.py +500 -0
- package/dist/templates/trellis/tasks/.gitkeep +0 -0
- package/dist/templates/trellis/workflow.md +750 -0
- package/dist/types/ai-tools.d.ts +95 -0
- package/dist/types/ai-tools.d.ts.map +1 -0
- package/dist/types/ai-tools.js +280 -0
- package/dist/types/ai-tools.js.map +1 -0
- package/dist/types/migration.d.ts +125 -0
- package/dist/types/migration.d.ts.map +1 -0
- package/dist/types/migration.js +8 -0
- package/dist/types/migration.js.map +1 -0
- package/dist/utils/compare-versions.d.ts +12 -0
- package/dist/utils/compare-versions.d.ts.map +1 -0
- package/dist/utils/compare-versions.js +86 -0
- package/dist/utils/compare-versions.js.map +1 -0
- 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 +36 -0
- package/dist/utils/file-writer.d.ts.map +1 -0
- package/dist/utils/file-writer.js +203 -0
- package/dist/utils/file-writer.js.map +1 -0
- 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/posix.d.ts +13 -0
- package/dist/utils/posix.d.ts.map +1 -0
- package/dist/utils/posix.js +15 -0
- package/dist/utils/posix.js.map +1 -0
- package/dist/utils/project-detector.d.ts +46 -0
- package/dist/utils/project-detector.d.ts.map +1 -0
- package/dist/utils/project-detector.js +666 -0
- package/dist/utils/project-detector.js.map +1 -0
- package/dist/utils/proxy.d.ts +25 -0
- package/dist/utils/proxy.d.ts.map +1 -0
- package/dist/utils/proxy.js +60 -0
- package/dist/utils/proxy.js.map +1 -0
- package/dist/utils/task-json.d.ts +13 -0
- package/dist/utils/task-json.d.ts.map +1 -0
- package/dist/utils/task-json.js +12 -0
- package/dist/utils/task-json.js.map +1 -0
- package/dist/utils/template-fetcher.d.ts +150 -0
- package/dist/utils/template-fetcher.d.ts.map +1 -0
- package/dist/utils/template-fetcher.js +907 -0
- package/dist/utils/template-fetcher.js.map +1 -0
- package/dist/utils/template-hash.d.ts +123 -0
- package/dist/utils/template-hash.d.ts.map +1 -0
- package/dist/utils/template-hash.js +334 -0
- package/dist/utils/template-hash.js.map +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts +66 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -0
- package/dist/utils/uninstall-scrubbers.js +342 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -0
- 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 +90 -0
|
@@ -0,0 +1,750 @@
|
|
|
1
|
+
# 开发工作流
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## 核心原则
|
|
6
|
+
|
|
7
|
+
1. **先规划,再编码** —— 动手前先想清楚要做什么
|
|
8
|
+
2. **规范靠注入,不靠记忆** —— 指南通过 hook / skill 注入,而不是靠记住
|
|
9
|
+
3. **所有信息都要落盘** —— 调研、决策、经验都写进文件;对话会被压缩,文件不会
|
|
10
|
+
4. **增量式开发** —— 一次只处理一个任务
|
|
11
|
+
5. **沉淀经验** —— 每个任务结束后回顾,并把新知识写回 spec
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Trellis 系统
|
|
16
|
+
|
|
17
|
+
### 开发者身份
|
|
18
|
+
|
|
19
|
+
首次使用时,先初始化你的身份:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python3 ./.trellis/scripts/init_developer.py <你的名字>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
这会创建 `.trellis/.developer`(已 gitignore)以及 `.trellis/workspace/<你的名字>/`。
|
|
26
|
+
|
|
27
|
+
### Spec 系统
|
|
28
|
+
|
|
29
|
+
`.trellis/spec/` 用来存放按 package 和 layer 组织的编码规范。
|
|
30
|
+
|
|
31
|
+
- `.trellis/spec/<package>/<layer>/index.md` —— 入口文件,包含**开发前检查清单**与**质量检查**。具体规范写在它引用的 `.md` 文件中。
|
|
32
|
+
- `.trellis/spec/guides/index.md` —— 跨 package 的通用思考指南。
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
python3 ./.trellis/scripts/get_context.py --mode packages # 列出可用 package / layer
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**什么时候更新 spec**:发现新模式 / 新约定 · 需要把 bug 修复经验沉淀成预防规则 · 形成新的技术决策。
|
|
39
|
+
|
|
40
|
+
### 任务系统
|
|
41
|
+
|
|
42
|
+
每个任务在 `.trellis/tasks/{MM-DD-name}/` 下都有自己的目录,里面包含 `task.json`、`prd.md`、可选的 `design.md`、可选的 `implement.md`、可选的 `research/`,以及供支持子代理的平台使用的上下文清单(`implement.jsonl`、`check.jsonl`)。
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# 任务生命周期
|
|
46
|
+
python3 ./.trellis/scripts/task.py create "<标题>" [--slug <name>] [--parent <dir>]
|
|
47
|
+
python3 ./.trellis/scripts/task.py start <name> # 设置当前活动任务(有会话身份时为会话级)
|
|
48
|
+
python3 ./.trellis/scripts/task.py current --source # 显示当前任务及其来源
|
|
49
|
+
python3 ./.trellis/scripts/task.py finish # 清除当前活动任务(触发 after_finish hooks)
|
|
50
|
+
python3 ./.trellis/scripts/task.py archive <name> # 移动到 archive/{year-month}/
|
|
51
|
+
python3 ./.trellis/scripts/task.py list [--mine] [--status <s>]
|
|
52
|
+
python3 ./.trellis/scripts/task.py list-archive
|
|
53
|
+
|
|
54
|
+
# 代码规范上下文(通过 JSONL 注入 implement/check 子代理)。
|
|
55
|
+
# `implement.jsonl` / `check.jsonl` 会在 `task create` 时为支持子代理的平台预置种子行;
|
|
56
|
+
# 之后由 AI 在规划阶段补成真实 spec / research 条目。
|
|
57
|
+
python3 ./.trellis/scripts/task.py add-context <name> <action> <file> <reason>
|
|
58
|
+
python3 ./.trellis/scripts/task.py list-context <name> [action]
|
|
59
|
+
python3 ./.trellis/scripts/task.py validate <name>
|
|
60
|
+
|
|
61
|
+
# 任务元数据
|
|
62
|
+
python3 ./.trellis/scripts/task.py set-branch <name> <branch>
|
|
63
|
+
python3 ./.trellis/scripts/task.py set-base-branch <name> <branch> # PR 目标分支
|
|
64
|
+
python3 ./.trellis/scripts/task.py set-scope <name> <scope>
|
|
65
|
+
|
|
66
|
+
# 层级关系(父 / 子任务)
|
|
67
|
+
python3 ./.trellis/scripts/task.py add-subtask <parent> <child>
|
|
68
|
+
python3 ./.trellis/scripts/task.py remove-subtask <parent> <child>
|
|
69
|
+
|
|
70
|
+
# 创建 PR
|
|
71
|
+
python3 ./.trellis/scripts/task.py create-pr [name] [--dry-run]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
> 可运行 `python3 ./.trellis/scripts/task.py --help` 查看权威且最新的命令列表。
|
|
75
|
+
|
|
76
|
+
**当前任务机制**:`task.py create` 会创建任务目录,并在存在会话身份时自动设置当前会话的活动任务指针,这样 planning breadcrumb 会立即生效。`task.py start` 会写入同一个指针(如果已存在则幂等),并把 `task.json.status` 从 `planning` 切换为 `in_progress`。状态文件保存在 `.trellis/.runtime/sessions/` 下。如果 hook 输入、`TRELLIS_CONTEXT_ID` 或平台原生会话环境变量里都没有上下文 key,则不会有活动任务,`task.py start` 会提示缺少会话身份。`task.py finish` 只删除当前会话文件(不改任务状态)。`task.py archive <task>` 会写入 `status=completed`、移动目录到 `archive/`,并删除仍指向该任务的运行时会话文件。
|
|
77
|
+
|
|
78
|
+
### Workspace 系统
|
|
79
|
+
|
|
80
|
+
它会在 `.trellis/workspace/<developer>/` 下记录每次 AI 会话,便于跨会话追踪。
|
|
81
|
+
|
|
82
|
+
- `journal-N.md` —— 会话日志。**每个文件最多 2000 行**;超出后会自动创建新的 `journal-(N+1).md`
|
|
83
|
+
- `index.md` —— 个人索引(总会话数、最近活跃时间)
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
python3 ./.trellis/scripts/add_session.py --title "标题" --commit "hash" --summary "摘要"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 上下文脚本
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
python3 ./.trellis/scripts/get_context.py # 完整会话运行时上下文
|
|
93
|
+
python3 ./.trellis/scripts/get_context.py --mode packages # 可用 package + spec layer
|
|
94
|
+
python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y> # 读取某个工作流步骤的详细说明
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
<!--
|
|
100
|
+
WORKFLOW-STATE BREADCRUMB CONTRACT(修改下面标签块前先读)
|
|
101
|
+
|
|
102
|
+
`## Phase Index` 下面嵌入的 [workflow-state:STATUS] 块,是每个支持平台的
|
|
103
|
+
UserPromptSubmit hook 读取的每回合 `<workflow-state>` breadcrumb 的**唯一事实来源**。
|
|
104
|
+
inject-workflow-state.py(Python 平台)和 inject-workflow-state.js(OpenCode 插件)
|
|
105
|
+
只负责解析这里,不再保留 v0.5.0-rc.0 之前的后备字典。
|
|
106
|
+
|
|
107
|
+
STATUS 允许字符集:[A-Za-z0-9_-]。如果 hook 找不到标签,就会退化成一条通用提示:
|
|
108
|
+
"Refer to workflow.md for current step." —— 这是故意保留的可见退化,方便用户发现并修复损坏的 workflow.md。
|
|
109
|
+
|
|
110
|
+
不变量(test/regression.test.ts):
|
|
111
|
+
每个被标记为 `[required · once]` 的 workflow-walkthrough 步骤,必须在对应 phase 的
|
|
112
|
+
[workflow-state:*] 块里有匹配的 enforcement 文案。breadcrumb 是唯一的逐回合信道;
|
|
113
|
+
如果某个必经步骤没有写进这里,AI 就会静默跳过(Phase 1 的规划门禁跳过、Phase 3.4 的 commit 跳过都曾因此出现)。
|
|
114
|
+
|
|
115
|
+
TAG ↔ PHASE 作用域:
|
|
116
|
+
[workflow-state:no_task] → 没有活动任务;Phase 1 之前
|
|
117
|
+
[workflow-state:planning] → Phase 1 全阶段(status='planning')
|
|
118
|
+
[workflow-state:planning-inline] → Codex 的 Phase 1 内联变体
|
|
119
|
+
[workflow-state:in_progress] → Phase 2 + Phase 3.1-3.4
|
|
120
|
+
(从 task.py start 到 task.py archive 期间状态都保持 'in_progress')
|
|
121
|
+
[workflow-state:in_progress-inline] → Codex 的 Phase 2/3 内联变体
|
|
122
|
+
[workflow-state:completed] → 当前为 DEAD:cmd_archive 会在同一次调用里改状态并移动目录,
|
|
123
|
+
导致 resolver 丢失指针(这个块保留给未来显式的 in_progress→completed 转换)
|
|
124
|
+
|
|
125
|
+
编辑检查清单:
|
|
126
|
+
- 你修改某个 [workflow-state:STATUS] 块时,也要同步检查该 phase 下所有 `[required · once]` 步骤是否一致
|
|
127
|
+
- 修改后运行 `trellis update`,把新的 block 内容推送到下游用户项目(按块托管替换)
|
|
128
|
+
- 完整运行时约定见:
|
|
129
|
+
.trellis/spec/cli/backend/workflow-state-contract.md
|
|
130
|
+
-->
|
|
131
|
+
|
|
132
|
+
## Phase Index
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
Phase 1: Plan → 分类请求、取得创建任务的同意、然后写规划产物
|
|
136
|
+
Phase 2: Execute → 只有任务状态进入 in_progress 后才开始实现
|
|
137
|
+
Phase 3: Finish → 验证、更新 spec、提交代码、最后收尾
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Request Triage
|
|
141
|
+
|
|
142
|
+
- 简单对话或小任务:只问这次是否需要创建 Trellis 任务;如果用户说不需要,本次会话就跳过 Trellis。
|
|
143
|
+
- 复杂任务:先问用户是否允许创建 Trellis 任务并进入 planning。如果用户不同意,就不要做大范围内联实现,只做说明、澄清范围,或建议拆成更小的问题。
|
|
144
|
+
- 用户同意创建任务,不等于同意直接开始实现;实现前仍然需要先完成 planning。
|
|
145
|
+
|
|
146
|
+
### Planning Artifacts
|
|
147
|
+
|
|
148
|
+
- `prd.md` —— 需求、约束与验收标准。不要把技术设计或执行清单写进这里。
|
|
149
|
+
- `design.md` —— 复杂任务的技术设计:边界、契约、数据流、权衡、兼容性、上线 / 回滚形态。
|
|
150
|
+
- `implement.md` —— 复杂任务的执行计划:开发策略决策、有序清单、review 闸门、验证命令、回滚点。
|
|
151
|
+
- `implement.jsonl` / `check.jsonl` —— 提供给子代理的 spec / research 清单。它们不能替代 `implement.md`。
|
|
152
|
+
- 轻量任务可以只保留 PRD;复杂任务在 `task.py start` 前必须补齐 `prd.md`、`design.md` 与 `implement.md`。
|
|
153
|
+
|
|
154
|
+
### Parent / Child Task Trees
|
|
155
|
+
|
|
156
|
+
当一个用户请求包含多个可独立验证的交付物时,使用父任务。父任务负责源需求集合、任务地图、跨子任务验收标准以及最终集成评审;除非它本身也有直接工作,否则通常不应作为实现目标。This means one request can cover several independently verifiable deliverables.
|
|
157
|
+
|
|
158
|
+
对子任务,应保证它们都可以独立地完成 planning、implement、check 与 archive。父子结构不是依赖系统:如果某个子任务必须等待另一个子任务,应该把这个顺序写在子任务自己的 `prd.md` / `implement.md` 里,并保持各子任务的验收标准可独立验证。Parent/child structure is not a dependency system: if one child must wait for another, write that ordering in the child artifacts instead.
|
|
159
|
+
|
|
160
|
+
用 `task.py create "<标题>" --slug <name> --parent <parent-dir>` 创建新的子任务。用 `task.py add-subtask <parent> <child>` 关联已有任务;如果连错了,用 `task.py remove-subtask <parent> <child>` 解除。创建完后,start the child that owns the next independently verifiable deliverable。
|
|
161
|
+
|
|
162
|
+
<!-- Per-turn breadcrumb: shown when there is no active task (before Phase 1) -->
|
|
163
|
+
|
|
164
|
+
[workflow-state:no_task]
|
|
165
|
+
No active task. First classify the current turn and ask for task-creation consent before creating any Trellis task.
|
|
166
|
+
Simple conversation / small task: ask only whether this turn should create a Trellis task. If the user says no, skip Trellis for this session.
|
|
167
|
+
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.
|
|
168
|
+
|
|
169
|
+
当用户用自然语言提出 Claude Code 工作流改动时,先引导他们进入 `task.py create`;不要要求固定命令短语。
|
|
170
|
+
[/workflow-state:no_task]
|
|
171
|
+
|
|
172
|
+
### Phase 1: Plan
|
|
173
|
+
- 1.0 Create task `[required · once]`(只有获得 task-creation consent 后才能执行)
|
|
174
|
+
- 1.1 Requirement exploration `[required · repeatable]`(`prd.md`;复杂任务还需要 `design.md` + `implement.md`)
|
|
175
|
+
- 1.2 Research `[optional · repeatable]`
|
|
176
|
+
- 1.3 Configure context `[required · once]` —— Claude Code、Cursor、OpenCode、Codex、Kiro、Gemini、Qoder、CodeBuddy、Copilot、Droid、Pi
|
|
177
|
+
- 1.4 Activate task `[required · once]`(review gate 通过后执行 `task.py start`;状态切到 in_progress)
|
|
178
|
+
- 1.5 Completion criteria
|
|
179
|
+
|
|
180
|
+
<!-- Per-turn breadcrumb: shown throughout Phase 1 (status='planning') -->
|
|
181
|
+
|
|
182
|
+
[workflow-state:planning]
|
|
183
|
+
Load `trellis-brainstorm`; stay in planning.
|
|
184
|
+
Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; ask for review before `task.py start`.
|
|
185
|
+
Multi-deliverable scope: consider a parent task plus independently verifiable child tasks; dependencies must be written in child artifacts, not implied by tree position.
|
|
186
|
+
Sub-agent mode: curate `implement.jsonl` and `check.jsonl` as spec/research manifests before start.
|
|
187
|
+
|
|
188
|
+
Planning order for this Claude Code path: `task.py create` → `trellis-brainstorm` → `trellis-grill-me` → development strategy decision.
|
|
189
|
+
Do not enter development strategy decisions until `prd.md` has been tightened through repository-first clarification and one-question-at-a-time follow-up.
|
|
190
|
+
Before `task.py start`, record the development strategy decisions in the task documents. Complex tasks should store them in `implement.md`: development mode (current session / subagent), branch vs worktree, default flow vs TDD, plus the planned review-gate order: `trellis-spec-review` → `trellis-code-review` → `trellis-code-architecture-review`. If the strategy is `subagent + worktree`, pin the shared path to `./.claude/worktree` and require every code-development subagent to use it. If the strategy is TDD, record `trellis-tdd` as the reference flow.
|
|
191
|
+
[/workflow-state:planning]
|
|
192
|
+
|
|
193
|
+
<!-- Per-turn breadcrumb: shown throughout Phase 1 when codex.dispatch_mode=inline.
|
|
194
|
+
Codex-only opt-in alternate to [workflow-state:planning]. The main agent
|
|
195
|
+
edits code directly in Phase 2, so jsonl curation is skipped —
|
|
196
|
+
the inline workflow loads `trellis-before-dev` instead of injecting JSONL
|
|
197
|
+
into a sub-agent. -->
|
|
198
|
+
|
|
199
|
+
[workflow-state:planning-inline]
|
|
200
|
+
Load `trellis-brainstorm`; stay in planning.
|
|
201
|
+
Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; ask for review before `task.py start`.
|
|
202
|
+
Multi-deliverable scope: consider a parent task plus independently verifiable child tasks; dependencies must be written in child artifacts, not implied by tree position.
|
|
203
|
+
Inline mode: skip jsonl curation; Phase 2 reads artifacts/specs via `trellis-before-dev`.
|
|
204
|
+
[/workflow-state:planning-inline]
|
|
205
|
+
|
|
206
|
+
### Phase 2: Execute
|
|
207
|
+
- 2.1 Implement `[required · repeatable]`
|
|
208
|
+
- 2.2 Quality check `[required · repeatable]`
|
|
209
|
+
- 2.3 Rollback `[on demand]`
|
|
210
|
+
|
|
211
|
+
<!-- Per-turn breadcrumb: shown while status='in_progress'.
|
|
212
|
+
Scope: all of Phase 2 + Phase 3.1-3.4 (status stays 'in_progress' from
|
|
213
|
+
task.py start until task.py archive; only archive flips it). The body
|
|
214
|
+
therefore must cover every required step from implementation through
|
|
215
|
+
archive / optional commit, including Phase 3.3 spec update and any
|
|
216
|
+
Phase 3.4 commit guidance when a commit is actually needed. -->
|
|
217
|
+
|
|
218
|
+
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.
|
|
219
|
+
|
|
220
|
+
[workflow-state:in_progress]
|
|
221
|
+
Flow: `trellis-implement` -> `trellis-check` -> `trellis-update-spec` -> archive or commit as needed -> `/trellis:finish-work`.
|
|
222
|
+
Claude Code review-gate order: `trellis-spec-review` -> `trellis-code-review` -> `trellis-code-architecture-review`.
|
|
223
|
+
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.
|
|
224
|
+
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`.
|
|
225
|
+
|
|
226
|
+
If the chosen strategy is `subagent + worktree`, all code-development subagents must use the same `./.claude/worktree` path.
|
|
227
|
+
If the chosen strategy is TDD, align implementation and review expectations to `trellis-tdd`.
|
|
228
|
+
If the task is architecture-sensitive or enters structural refactoring, route the architecture pass through `trellis-improve-codebase-architecture` before widening the change.
|
|
229
|
+
If the user asks to archive the current task, do not block on commit; archive is allowed even when code is not committed.
|
|
230
|
+
[/workflow-state:in_progress]
|
|
231
|
+
|
|
232
|
+
<!-- Per-turn breadcrumb: shown while status='in_progress' when
|
|
233
|
+
codex.dispatch_mode=inline. Codex-only opt-in alternate to
|
|
234
|
+
[workflow-state:in_progress]. The main session edits code directly
|
|
235
|
+
instead of dispatching sub-agents. -->
|
|
236
|
+
|
|
237
|
+
[workflow-state:in_progress-inline]
|
|
238
|
+
Flow: `trellis-before-dev` -> edit -> `trellis-check` -> validation -> `trellis-update-spec` -> archive or commit as needed -> `/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.
|
|
241
|
+
If the user asks to archive the current task, do not block on commit; archive is allowed even when code is not committed.
|
|
242
|
+
[/workflow-state:in_progress-inline]
|
|
243
|
+
|
|
244
|
+
### Phase 3: Finish
|
|
245
|
+
- 3.1 Quality verification `[required · repeatable]`
|
|
246
|
+
- 3.2 Debug retrospective `[on demand]`
|
|
247
|
+
- 3.3 Spec update `[required · once]`
|
|
248
|
+
- 3.4 Commit changes `[optional · once]`
|
|
249
|
+
- 3.5 Merge & Final Verification `[required · once]`
|
|
250
|
+
- 3.6 Wrap-up reminder
|
|
251
|
+
|
|
252
|
+
<!-- Per-turn breadcrumb: shown while status='completed'.
|
|
253
|
+
Currently DEAD in normal flow: cmd_archive writes status='completed' in
|
|
254
|
+
the same call that moves the task dir to archive/, so the active-task
|
|
255
|
+
resolver loses the pointer and the hook never fires on archived tasks.
|
|
256
|
+
Block preserved for a future status-transition redesign (e.g. an
|
|
257
|
+
explicit in_progress→completed command). Edit through the same spec
|
|
258
|
+
channel as the live blocks. -->
|
|
259
|
+
|
|
260
|
+
[workflow-state:completed]
|
|
261
|
+
Task archived or code committed. Run `/trellis:finish-work`; if more validation or wrap-up is needed, do that before closing the work.
|
|
262
|
+
[/workflow-state:completed]
|
|
263
|
+
|
|
264
|
+
### Rules
|
|
265
|
+
|
|
266
|
+
1. 先判断当前处于哪个 Phase,再从该 Phase 的下一步继续
|
|
267
|
+
2. 每个 Phase 内按顺序执行;`[required]` 步骤不能跳过
|
|
268
|
+
3. Phase 允许回滚(例如 Execute 发现 prd 缺陷 → 回到 Plan 修正,再重新进入 Execute)
|
|
269
|
+
4. 标记为 `[once]` 的步骤,如果产物已存在则跳过,不要重复执行
|
|
270
|
+
5. 产物是否存在会影响下一步判断;轻量任务缺少 `design.md` / `implement.md` 是正常的,复杂任务则代表 planning 未完成
|
|
271
|
+
|
|
272
|
+
### Active Task Routing
|
|
273
|
+
|
|
274
|
+
当用户请求发生在一个活动任务里时,先按意图路由,再按需加载详细步骤说明。
|
|
275
|
+
|
|
276
|
+
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
277
|
+
|
|
278
|
+
- Planning 或需求未清晰 -> `trellis-brainstorm`。
|
|
279
|
+
- `in_progress` 的实现 / 检查 -> 分派 `trellis-implement` / `trellis-check`。
|
|
280
|
+
- 重复调试 -> `trellis-break-loop`;spec 更新 -> `trellis-update-spec`。
|
|
281
|
+
|
|
282
|
+
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
283
|
+
|
|
284
|
+
[codex-inline, Kilo, Antigravity, Windsurf]
|
|
285
|
+
|
|
286
|
+
- Planning 或需求未清晰 -> `trellis-brainstorm`。
|
|
287
|
+
- 编辑前 -> `trellis-before-dev`;编辑后 -> `trellis-check`。
|
|
288
|
+
- 重复调试 -> `trellis-break-loop`;spec 更新 -> `trellis-update-spec`。
|
|
289
|
+
|
|
290
|
+
[/codex-inline, Kilo, Antigravity, Windsurf]
|
|
291
|
+
|
|
292
|
+
### Guardrails
|
|
293
|
+
|
|
294
|
+
- 用户同意创建任务,不等于同意开始实现;只有在产物 review 完成并执行 `task.py start` 后,才能进入实现。
|
|
295
|
+
- 轻量任务允许只有 PRD;复杂任务必须有 `design.md` + `implement.md`。
|
|
296
|
+
- planning 必须落盘到任务产物;完成前必须跑检查。
|
|
297
|
+
|
|
298
|
+
### Loading Step Detail
|
|
299
|
+
|
|
300
|
+
在每一步,你都可以运行下面命令读取详细指导:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
python3 ./.trellis/scripts/get_context.py --mode phase --step <step>
|
|
304
|
+
# 例如:python3 ./.trellis/scripts/get_context.py --mode phase --step 1.1
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Phase 1: Plan
|
|
310
|
+
|
|
311
|
+
目标:对请求分类,在需要任务时取得创建任务的同意,并产出进入实现前所需的 planning 产物。
|
|
312
|
+
|
|
313
|
+
#### 1.0 Create task `[required · once]`
|
|
314
|
+
|
|
315
|
+
只有在获得 task-creation consent 后才能创建任务目录。该命令会设置 `planning` 状态、写入 `task.json`、创建默认 `prd.md`,并在有会话身份时自动把新任务设为当前目标:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
python3 ./.trellis/scripts/task.py create "<任务标题>" --slug <name>
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
`--slug` 只填写人类可读的名称。**不要**带 `MM-DD-` 日期前缀;`task.py create` 会自动添加此前缀。
|
|
322
|
+
|
|
323
|
+
对于任务树,先创建父任务,再用 `--parent <parent-dir>` 创建各个子任务。不要因为子任务已存在就启动父任务;应该启动拥有下一个可独立验证交付物的那个子任务。
|
|
324
|
+
|
|
325
|
+
命令成功后,每回合 breadcrumb 会自动切换到 `[workflow-state:planning]`,提醒 AI 留在 planning 阶段。
|
|
326
|
+
|
|
327
|
+
这里仅运行 `create` —— 不要同时运行 `start`。`start` 会把状态切到 `in_progress`,导致 breadcrumb 在 planning 产物 review 前就切到实现阶段。把 `start` 留到 1.4。
|
|
328
|
+
|
|
329
|
+
若 `python3 ./.trellis/scripts/task.py current --source` 已指向某个任务,则跳过本步。
|
|
330
|
+
|
|
331
|
+
#### 1.1 Requirement exploration `[required · repeatable]`
|
|
332
|
+
|
|
333
|
+
加载 `trellis-brainstorm` skill,并按该 skill 的指导与用户交互式澄清需求。
|
|
334
|
+
|
|
335
|
+
brainstorm skill 会指导你:
|
|
336
|
+
- 一次只问一个问题
|
|
337
|
+
- 能靠调研回答的就先调研,不要先问用户
|
|
338
|
+
- 优先给选项,而不是纯开放式提问
|
|
339
|
+
- 用户每次回答后立刻更新 `prd.md`
|
|
340
|
+
- 当交付物可独立验证时,把大范围拆成父任务 + 子任务
|
|
341
|
+
- 保持 `prd.md` 只记录需求和验收标准
|
|
342
|
+
- 对复杂任务,在实现开始前产出 `design.md` 和 `implement.md`
|
|
343
|
+
|
|
344
|
+
当考虑父 / 子任务拆分时:
|
|
345
|
+
- When considering a parent/child split:
|
|
346
|
+
- 当一个请求包含多个可独立验证的交付物时,使用父任务。
|
|
347
|
+
- Parent tasks own source requirements, child-task mapping, cross-child acceptance criteria, and final integration review.
|
|
348
|
+
- 子任务负责那些可以独立 planning、implement、check 与 archive 的真实交付物。Child tasks own actual deliverables that can be planned, implemented, checked, and archived independently.
|
|
349
|
+
- Parent/child structure is not a dependency system. 如果子任务 B 依赖子任务 A,应把顺序写在子任务 B 的 `prd.md` / `implement.md` 里。
|
|
350
|
+
- 启动拥有下一个交付物的子任务。Do not start the parent unless the parent itself has direct implementation work.
|
|
351
|
+
|
|
352
|
+
在 Claude Code 路径进入实现前,把开发策略决策写入任务文档。
|
|
353
|
+
- 轻量任务可以把这些记录写在 `prd.md`。
|
|
354
|
+
- 复杂任务应把这些策略与 review-gate 计划一起写在 `implement.md`。
|
|
355
|
+
- 需要记录:当前会话 vs subagent、当前分支 vs worktree、默认流程 vs TDD。
|
|
356
|
+
- 如果选择 `subagent + worktree`,将 `./.claude/worktree` 固定为所有代码开发子代理共享的路径。
|
|
357
|
+
- 如果选择 TDD,记录 `trellis-tdd` 作为参考流程,并让后续实现与评审都对齐到它。
|
|
358
|
+
- 如果任务涉及架构治理、重构收敛或避免结构劣化,进入 `trellis-improve-codebase-architecture` 作为显式入口与自动调用入口。
|
|
359
|
+
|
|
360
|
+
每当需求变化,就回到此步骤并修订相关产物。
|
|
361
|
+
|
|
362
|
+
#### 1.2 Research `[optional · repeatable]`
|
|
363
|
+
|
|
364
|
+
在需求澄清期间,研究可以随时发生。它不局限于本地代码——你可以用任何可用工具(MCP servers、skills、web search 等)查询外部信息,包括第三方库文档、行业实践、API 参考等。
|
|
365
|
+
|
|
366
|
+
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
367
|
+
|
|
368
|
+
分派 research 子代理:
|
|
369
|
+
|
|
370
|
+
- **Agent type**: `trellis-research`
|
|
371
|
+
- **Task description**: Research <specific question>
|
|
372
|
+
- **Key requirement**: 研究结果**必须**落盘到 `{TASK_DIR}/research/`
|
|
373
|
+
|
|
374
|
+
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
375
|
+
|
|
376
|
+
[codex-inline, Kilo, Antigravity, Windsurf]
|
|
377
|
+
|
|
378
|
+
在主会话中直接做研究,并把结果写入 `{TASK_DIR}/research/`。(对 `codex-inline` 而言,这可避开 `fork_turns="none"` 隔离带来的 active task 路径无法解析问题。)
|
|
379
|
+
|
|
380
|
+
[/codex-inline, Kilo, Antigravity, Windsurf]
|
|
381
|
+
|
|
382
|
+
**研究产物约定**:
|
|
383
|
+
- 每个研究主题一个文件(例如 `research/auth-library-comparison.md`)
|
|
384
|
+
- 把第三方库用法示例、API 参考、版本约束写进文件
|
|
385
|
+
- 记下你发现的相关 spec 文件路径,供后续引用
|
|
386
|
+
|
|
387
|
+
brainstorm 和 research 可以自由交错 —— 可以先停下来研究某个技术问题,再回来继续与用户收敛。
|
|
388
|
+
|
|
389
|
+
**关键原则**:研究结果必须写入文件,不能只留在对话里。对话会被压缩,文件不会。
|
|
390
|
+
|
|
391
|
+
#### 1.3 Configure context `[required · once]`
|
|
392
|
+
|
|
393
|
+
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
394
|
+
|
|
395
|
+
整理 `implement.jsonl` 和 `check.jsonl`,让 Phase 2 的子代理拿到正确的 spec / research 上下文。这两个文件会在 `task create` 时带着一条自描述 `_example` 种子行创建;你此时的工作是补上真实条目。
|
|
396
|
+
|
|
397
|
+
**位置**:`{TASK_DIR}/implement.jsonl` 和 `{TASK_DIR}/check.jsonl`(文件已存在)。
|
|
398
|
+
|
|
399
|
+
**格式**:每行一个 JSON 对象 —— `{"file": "<path>", "reason": "<why>"}`。路径相对于仓库根目录。
|
|
400
|
+
|
|
401
|
+
**应该放什么**:
|
|
402
|
+
- **Spec 文件** —— `.trellis/spec/<package>/<layer>/index.md` 以及与本任务相关的具体规范文件(`error-handling.md`、`conventions.md` 等)
|
|
403
|
+
- **Research 文件** —— `{TASK_DIR}/research/*.md` 中实现 / 检查子代理需要查看的文件
|
|
404
|
+
|
|
405
|
+
**不要放什么**:
|
|
406
|
+
- 代码文件(`src/**`、`packages/**/*.ts` 等)—— 这些文件由子代理在实现时自己读取,不要提前登记
|
|
407
|
+
- 你即将修改的文件 —— 原因相同
|
|
408
|
+
|
|
409
|
+
**两个文件怎么分工**:
|
|
410
|
+
- `implement.jsonl` → 实现子代理写代码时需要的 spec + research
|
|
411
|
+
- `check.jsonl` → 检查子代理需要的 spec(质量规范、检查约定,以及必要时相同的 research)
|
|
412
|
+
|
|
413
|
+
这些 manifest 不能替代 `implement.md`。`implement.md` 是复杂任务的人类可读执行计划;jsonl 只负责列出需注入或加载的上下文文件。
|
|
414
|
+
|
|
415
|
+
**如何发现相关 spec**:
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
python3 ./.trellis/scripts/get_context.py --mode packages
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
它会列出每个 package 及其 spec layer 路径。选出与本任务领域匹配的那些条目。
|
|
422
|
+
|
|
423
|
+
**如何追加条目**:
|
|
424
|
+
|
|
425
|
+
可以直接编辑 jsonl 文件,也可以使用:
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement "<path>" "<reason>"
|
|
429
|
+
python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reason>"
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
真实条目写入后,可删除 `_example` 种子行(可选——消费者会自动跳过它)。
|
|
433
|
+
|
|
434
|
+
如果 `implement.jsonl` 和 `check.jsonl` 已有 AI 整理过的真实条目(仅有种子行不算),则跳过。
|
|
435
|
+
|
|
436
|
+
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
437
|
+
|
|
438
|
+
[codex-inline, Kilo, Antigravity, Windsurf]
|
|
439
|
+
|
|
440
|
+
跳过本步。上下文会在 Phase 2 由 `trellis-before-dev` skill 直接读取。
|
|
441
|
+
|
|
442
|
+
[/codex-inline, Kilo, Antigravity, Windsurf]
|
|
443
|
+
|
|
444
|
+
#### 1.4 Activate task `[required · once]`
|
|
445
|
+
|
|
446
|
+
在产物 review 完成后,把任务状态切到 `in_progress`:
|
|
447
|
+
|
|
448
|
+
```bash
|
|
449
|
+
python3 ./.trellis/scripts/task.py start <task-dir>
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
对于轻量任务,`prd.md` 可以足够。对于复杂任务,必须先存在并 review 完成 `prd.md`、`design.md` 和 `implement.md`。在 Claude Code 路径下,只有当任务文档已经记录开发策略决策后才能 start;复杂任务应把这些记录以及计划中的 review-gate 顺序写在 `implement.md` 中,轻量任务则可写在 `prd.md` 中。对于支持子代理的平台,当任务需要额外 spec / research 上下文时,应整理 jsonl manifest;仅含种子行的 manifest 也会被消费者容忍,但不算真正完成该步。
|
|
453
|
+
|
|
454
|
+
命令成功后,breadcrumb 会自动切换到 `[workflow-state:in_progress]`,后续 Phase 2 / 3 将按此继续。
|
|
455
|
+
|
|
456
|
+
如果 `task.py start` 因缺少会话身份而报错(hook 输入、`TRELLIS_CONTEXT_ID` 或平台原生会话环境变量都未提供上下文 key),按报错提示先补上会话身份,再重试。
|
|
457
|
+
|
|
458
|
+
#### 1.5 Completion criteria
|
|
459
|
+
|
|
460
|
+
| Condition | Required |
|
|
461
|
+
|------|:---:|
|
|
462
|
+
| `prd.md` exists | ✅ |
|
|
463
|
+
| 用户确认任务可以进入实现 | ✅ |
|
|
464
|
+
| 已执行 `task.py start`(status = in_progress) | ✅ |
|
|
465
|
+
| 开发策略决策已在 start 前写入任务文档 | ✅ |
|
|
466
|
+
| `research/` 已有产物(复杂任务) | recommended |
|
|
467
|
+
| `design.md` exists(复杂任务) | ✅ |
|
|
468
|
+
| `implement.md` exists(复杂任务) | ✅ |
|
|
469
|
+
|
|
470
|
+
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
471
|
+
|
|
472
|
+
| 在需要额外 spec / research 上下文时,`implement.jsonl` / `check.jsonl` 已整理 | recommended |
|
|
473
|
+
|
|
474
|
+
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
475
|
+
|
|
476
|
+
---
|
|
477
|
+
|
|
478
|
+
## Phase 2: Execute
|
|
479
|
+
|
|
480
|
+
目标:把经过 review 的 planning 产物落实成能通过质量检查的代码。
|
|
481
|
+
|
|
482
|
+
#### 2.1 Implement `[required · repeatable]`
|
|
483
|
+
|
|
484
|
+
[Claude Code, Cursor, OpenCode, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
485
|
+
|
|
486
|
+
分派 implement 子代理:
|
|
487
|
+
|
|
488
|
+
- **Agent type**: `trellis-implement`
|
|
489
|
+
- **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
|
|
490
|
+
- **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`.
|
|
491
|
+
|
|
492
|
+
平台 hook / plugin 会自动处理:The platform hook/plugin auto-handles:
|
|
493
|
+
- 读取 `implement.jsonl`,把引用的 spec / research 文件注入子代理 prompt。Reads `implement.jsonl`, injecting referenced spec / research files into the sub-agent prompt.
|
|
494
|
+
- 注入 `prd.md`、`design.md if present`、`implement.md if present`
|
|
495
|
+
|
|
496
|
+
[/Claude Code, Cursor, OpenCode, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
497
|
+
|
|
498
|
+
[codex-sub-agent]
|
|
499
|
+
|
|
500
|
+
分派 implement 子代理:
|
|
501
|
+
|
|
502
|
+
- **Agent type**: `trellis-implement`
|
|
503
|
+
- **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
|
|
504
|
+
- **Dispatch prompt guard**: prompt **必须**以 `Active task: <task path>` 开头,然后显式说明该子代理已经是 `trellis-implement`,必须直接实现,不能再分派新的 `trellis-implement` / `trellis-check`。
|
|
505
|
+
|
|
506
|
+
Codex 子代理定义会自动处理上下文加载。The Codex sub-agent definition auto-handles context loading:
|
|
507
|
+
- 用 `task.py current --source` 解析活动任务,然后读取 `prd.md`、`design.md if present`、`implement.md if present`。Resolves the active task with `task.py current --source`, then reads task artifacts.
|
|
508
|
+
- 读取 `implement.jsonl`,并要求子代理在编码前加载每个引用的 spec / research 文件
|
|
509
|
+
|
|
510
|
+
[/codex-sub-agent]
|
|
511
|
+
|
|
512
|
+
[Kiro]
|
|
513
|
+
|
|
514
|
+
分派 implement 子代理:
|
|
515
|
+
|
|
516
|
+
- **Agent type**: `trellis-implement`
|
|
517
|
+
- **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
|
|
518
|
+
- **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`.
|
|
519
|
+
|
|
520
|
+
平台前置上下文会自动处理:
|
|
521
|
+
- 读取 `implement.jsonl`,把引用的 spec / research 文件注入 prompt
|
|
522
|
+
- 注入 `prd.md`、`design.md if present`、`implement.md if present`
|
|
523
|
+
|
|
524
|
+
[/Kiro]
|
|
525
|
+
|
|
526
|
+
[codex-inline, Kilo, Antigravity, Windsurf]
|
|
527
|
+
|
|
528
|
+
1. 加载 `trellis-before-dev` skill,先读项目规范
|
|
529
|
+
2. Read `{TASK_DIR}/prd.md`、`design.md if present`、`implement.md if present`
|
|
530
|
+
3. 查看 `{TASK_DIR}/research/` 下的材料
|
|
531
|
+
4. 按 review 通过的产物实现代码
|
|
532
|
+
5. 运行项目 lint 和 type-check
|
|
533
|
+
|
|
534
|
+
[/codex-inline, Kilo, Antigravity, Windsurf]
|
|
535
|
+
|
|
536
|
+
#### 2.2 Quality check `[required · repeatable]`
|
|
537
|
+
|
|
538
|
+
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
539
|
+
|
|
540
|
+
对于 Claude Code 路径,实现完成后按顺序运行三个明确的 review gate:
|
|
541
|
+
|
|
542
|
+
1. `trellis-spec-review`
|
|
543
|
+
2. `trellis-code-review`
|
|
544
|
+
3. `trellis-code-architecture-review`
|
|
545
|
+
|
|
546
|
+
Do not advance to the next gate until the previous gate passes. Each gate must review the code against `prd.md`, `design.md` if present, `implement.md` if present, and the relevant specs; fix issues directly before continuing.
|
|
547
|
+
|
|
548
|
+
如果当前平台还没有专用的 review-gate agent,则继续使用 `trellis-check` 作为兼容回退:
|
|
549
|
+
|
|
550
|
+
- **Agent type**: `trellis-check`
|
|
551
|
+
- **Task description**: Review all code changes against specs and task artifacts; fix any findings directly; ensure lint and type-check pass
|
|
552
|
+
- **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`.
|
|
553
|
+
|
|
554
|
+
check 子代理的职责:
|
|
555
|
+
- 对照 spec 审查代码改动
|
|
556
|
+
- 对照 `prd.md`、`design.md if present`、`implement.md if present` 审查代码改动
|
|
557
|
+
- 自动修复发现的问题
|
|
558
|
+
- 运行 lint 和 typecheck 验证
|
|
559
|
+
|
|
560
|
+
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
|
|
561
|
+
|
|
562
|
+
[codex-inline, Kilo, Antigravity, Windsurf]
|
|
563
|
+
|
|
564
|
+
加载 `trellis-check` skill,并按其指导验证代码:
|
|
565
|
+
- spec 合规性
|
|
566
|
+
- lint / type-check / tests
|
|
567
|
+
- 跨层一致性(当改动跨层时)
|
|
568
|
+
|
|
569
|
+
如有问题 → 修复 → 再检查,直到通过。
|
|
570
|
+
|
|
571
|
+
[/codex-inline, Kilo, Antigravity, Windsurf]
|
|
572
|
+
|
|
573
|
+
#### 2.3 Rollback `[on demand]`
|
|
574
|
+
|
|
575
|
+
- `check` 暴露出 prd 缺陷 → 回到 Phase 1,修正 `prd.md`,再重做 2.1
|
|
576
|
+
- 实现走偏 → 回滚代码,重做 2.1
|
|
577
|
+
- 需要更多研究 → 继续研究(同 Phase 1.2),并把结论写进 `research/`
|
|
578
|
+
|
|
579
|
+
---
|
|
580
|
+
|
|
581
|
+
## Phase 3: Finish
|
|
582
|
+
|
|
583
|
+
目标:确保代码质量、沉淀经验,并记录本次工作。
|
|
584
|
+
|
|
585
|
+
#### 3.1 Quality verification `[required · repeatable]`
|
|
586
|
+
|
|
587
|
+
加载 `trellis-check` skill,做最终验证:
|
|
588
|
+
- spec 合规性
|
|
589
|
+
- lint / type-check / tests
|
|
590
|
+
- 跨层一致性(当改动跨层时)
|
|
591
|
+
|
|
592
|
+
如有问题 → 修复 → 再检查,直到通过。
|
|
593
|
+
|
|
594
|
+
#### 3.2 Debug retrospective `[on demand]`
|
|
595
|
+
|
|
596
|
+
如果这个任务经历了重复调试(同一个问题被修了多次),加载 `trellis-break-loop` skill 来:
|
|
597
|
+
- 分类根因
|
|
598
|
+
- 解释为什么前面的修复会失败
|
|
599
|
+
- 提出预防方案
|
|
600
|
+
|
|
601
|
+
目标是把调试经验沉淀下来,避免同类问题再次发生。
|
|
602
|
+
|
|
603
|
+
#### 3.3 Spec update `[required · once]`
|
|
604
|
+
|
|
605
|
+
加载 `trellis-update-spec` skill,评估这次任务是否产生了值得记录的新知识:
|
|
606
|
+
- 新发现的模式或约定
|
|
607
|
+
- 踩过的坑
|
|
608
|
+
- 新的技术决策
|
|
609
|
+
|
|
610
|
+
相应更新 `.trellis/spec/` 下的文档。即使结论是“这次没有内容要更新”,也要走完判断过程。
|
|
611
|
+
|
|
612
|
+
#### 3.4 Commit changes `[required · once]`
|
|
613
|
+
|
|
614
|
+
AI 会驱动一次按批次组织的提交,让 `/finish-work` 后续能在干净状态下运行。目标:先产出工作提交,再产出收尾性的 archive + journal 提交,绝不交错。
|
|
615
|
+
|
|
616
|
+
**Step-by-step**:
|
|
617
|
+
|
|
618
|
+
1. **检查脏状态**:
|
|
619
|
+
```bash
|
|
620
|
+
git status --porcelain
|
|
621
|
+
```
|
|
622
|
+
记录所有脏文件路径。如果工作树干净,直接跳到 3.5。
|
|
623
|
+
|
|
624
|
+
2. **学习提交风格**,从最近历史里判断惯例(方便拟定风格一致的 commit message):
|
|
625
|
+
```bash
|
|
626
|
+
git log --oneline -5
|
|
627
|
+
```
|
|
628
|
+
注意前缀风格(`feat:` / `fix:` / `chore:` / `docs:` ...)、语言(中文 / English)以及长度习惯。
|
|
629
|
+
|
|
630
|
+
3. **把脏文件分两类**:
|
|
631
|
+
- **本会话 AI 改过的文件** —— 你通过 Edit / Write / Bash 工具改过,知道改动原因。
|
|
632
|
+
- **未识别文件** —— 本会话没碰过的脏文件(可能是用户手动改的、上一次遗留的 WIP,或无关工作)。不要静默把这些文件带进提交。
|
|
633
|
+
|
|
634
|
+
4. **拟定提交计划**。把本会话 AI 改过的文件按“连贯改动单元”分组(一个逻辑改动一个 commit,而不是一文件一 commit)。每组写成:`<commit message>` + 文件列表。未识别文件单独列在底部。
|
|
635
|
+
|
|
636
|
+
5. **一次性展示计划,并请求一次性确认**。格式:
|
|
637
|
+
```
|
|
638
|
+
Proposed commits (in order):
|
|
639
|
+
1. <message>
|
|
640
|
+
- <file>
|
|
641
|
+
- <file>
|
|
642
|
+
2. <message>
|
|
643
|
+
- <file>
|
|
644
|
+
|
|
645
|
+
Unrecognized dirty files (NOT in any commit — confirm include/exclude):
|
|
646
|
+
- <file>
|
|
647
|
+
- <file>
|
|
648
|
+
|
|
649
|
+
Reply 'ok' / '行' to execute. Reply with edits, or '我自己来' / 'manual' to abort.
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
6. **得到确认后**:按顺序对每一组执行 `git add <files>` + `git commit -m "<msg>"`。不要 amend。不要 push。
|
|
653
|
+
|
|
654
|
+
7. **如果用户拒绝**(例如回复“不行” / “我自己来” / “manual”,或对分组方案有异议):立即停止。不要再给第二版提交计划。用户将自行提交;待其确认后,你再跳到 3.5。
|
|
655
|
+
|
|
656
|
+
**Rules**:
|
|
657
|
+
- 全程禁止 `git commit --amend` —— 保持“三阶段三提交”流(工作提交 → archive 提交 → journal 提交)。
|
|
658
|
+
- 这一阶段绝不能 push 到远端。
|
|
659
|
+
- 如果用户只是接受文件分组、但希望调整 message wording,可以修改 message 并再确认一次;但如果用户否定了分组本身,就退出到 manual 模式。
|
|
660
|
+
- 这个 batched plan 只问一次,不要每个 commit 单独确认。
|
|
661
|
+
|
|
662
|
+
#### 3.5 Merge & Final Verification `[required · once]`
|
|
663
|
+
|
|
664
|
+
代码已提交。执行合并并做最终验收,确认需求真正落地。
|
|
665
|
+
|
|
666
|
+
**Step-by-step**:
|
|
667
|
+
|
|
668
|
+
1. **判断是否需要合并**:
|
|
669
|
+
- 如果开发策略是 `subagent + worktree` 或 feature branch,执行合并(`git merge` 到主分支,或通过 PR 合并)。
|
|
670
|
+
- 如果策略是"当前分支直接开发"(无独立分支),跳过合并,直接进入第 2 步。
|
|
671
|
+
|
|
672
|
+
2. **dispatch `trellis-merge-review` agent**,检查合并结果:
|
|
673
|
+
- 无合并冲突残留
|
|
674
|
+
- 无遗漏文件
|
|
675
|
+
- 合并目标分支状态与 `prd.md` 验收标准对齐
|
|
676
|
+
- 如果 `trellis-merge-review` 返回 FAIL,修复问题后重新执行此步骤。
|
|
677
|
+
|
|
678
|
+
3. **编译 + 测试**:`trellis-merge-review` 返回 PASS 后,在合并目标分支上执行项目的编译命令与完整测试套件。
|
|
679
|
+
- 编译 + 测试全部通过,才允许进入 3.6。
|
|
680
|
+
- 如有失败,修复后重新从第 2 步开始。
|
|
681
|
+
|
|
682
|
+
#### 3.6 Wrap-up reminder
|
|
683
|
+
|
|
684
|
+
完成上述步骤后,提醒用户可以运行 `/finish-work` 来收尾(archive task、记录 session)。
|
|
685
|
+
|
|
686
|
+
---
|
|
687
|
+
|
|
688
|
+
## Customizing Trellis (for forks)
|
|
689
|
+
|
|
690
|
+
本节面向想修改 Trellis 工作流本身的开发者。所有定制都通过编辑此文件完成;脚本只负责解析,不持有业务语义。
|
|
691
|
+
|
|
692
|
+
### Changing what a step means
|
|
693
|
+
|
|
694
|
+
直接编辑上面 Phase 1 / 2 / 3 中对应步骤的 walkthrough 内容。关键不变量:
|
|
695
|
+
- 没有活动任务时,必须先做请求分流,并在创建 Trellis 任务前征得 task-creation consent。
|
|
696
|
+
- planning 必须区分:轻量 PRD-only 任务 vs 需要在 start 前补齐 `prd.md`、`design.md`、`implement.md` 的复杂任务。
|
|
697
|
+
- 每条 required 的执行路径都必须保留通往 Phase 3.4 commit 提醒的可达性,不能在 `/trellis:finish-work` 前丢失。
|
|
698
|
+
|
|
699
|
+
所有 tag block 都位于上方 `## Phase Index` 区域、紧跟在各阶段摘要之后:
|
|
700
|
+
|
|
701
|
+
| Scope | Corresponding tag |
|
|
702
|
+
|---|---|
|
|
703
|
+
| 无活动任务(Phase 1 之前) | `[workflow-state:no_task]`(位于 Phase Index ASCII art 之后) |
|
|
704
|
+
| Phase 1 全阶段(任务已创建 → 准备进入实现) | `[workflow-state:planning]`(位于 Phase 1 摘要之后) |
|
|
705
|
+
| Codex inline 的 Phase 1 | `[workflow-state:planning-inline]` |
|
|
706
|
+
| Phase 2 + Phase 3.1–3.4(实现 + 检查 + 收尾) | `[workflow-state:in_progress]`(位于 Phase 2 摘要之后) |
|
|
707
|
+
| Codex inline 的 Phase 2 + Phase 3.1–3.4 | `[workflow-state:in_progress-inline]` |
|
|
708
|
+
| Phase 3.5 之后(已 archive) | `[workflow-state:completed]`(位于 Phase 3 摘要之后;**currently DEAD**) |
|
|
709
|
+
|
|
710
|
+
### Changing the per-turn prompt text
|
|
711
|
+
|
|
712
|
+
直接编辑对应 `[workflow-state:STATUS]` block 的内容即可。编辑后,若你是模板维护者,运行 `trellis update`;若你是在定制自己的项目,重启 AI 会话即可 —— 无需改脚本。
|
|
713
|
+
|
|
714
|
+
### Adding a custom status
|
|
715
|
+
|
|
716
|
+
新增一个 block:
|
|
717
|
+
|
|
718
|
+
```
|
|
719
|
+
[workflow-state:my-status]
|
|
720
|
+
your per-turn prompt text
|
|
721
|
+
[/workflow-state:my-status]
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
约束:
|
|
725
|
+
- STATUS 字符集:`[A-Za-z0-9_-]+`(允许下划线和连字符,例如 `in-review`、`blocked-by-team`)
|
|
726
|
+
- 必须有生命周期 hook 把 `task.json.status` 写成你的自定义值,否则这个 tag 永远不会被读取
|
|
727
|
+
- 生命周期 hooks 写在 `task.json.hooks.after_*` 下,并绑定到 `after_create / after_start / after_finish / after_archive` 之一
|
|
728
|
+
|
|
729
|
+
### Adding a lifecycle hook
|
|
730
|
+
|
|
731
|
+
在 `task.json` 中新增 `hooks` 字段:
|
|
732
|
+
|
|
733
|
+
```json
|
|
734
|
+
{
|
|
735
|
+
"hooks": {
|
|
736
|
+
"after_finish": [
|
|
737
|
+
"your-script-or-command-here"
|
|
738
|
+
]
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
支持事件:`after_create / after_start / after_finish / after_archive`。注意 `after_finish` **不等于**状态切换(它只是清除 active-task 指针);如果你想表达“任务完成”,请使用 `after_archive`。
|
|
744
|
+
|
|
745
|
+
### Full contract
|
|
746
|
+
|
|
747
|
+
关于工作流状态机的运行时契约、所有 status writer 位置、伪状态(`no_task` / `stale_<source_type>`)、hook 可达性矩阵等更深细节,请查看:
|
|
748
|
+
|
|
749
|
+
- `.trellis/spec/cli/backend/workflow-state-contract.md` —— 运行时契约 + writer 表 + 测试不变量
|
|
750
|
+
- `.trellis/scripts/inject-workflow-state.py` —— 实际解析器(只读 workflow.md,不内嵌文本)
|