@mindfoldhq/trellis 0.4.0 → 0.5.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +0 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +10 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +382 -120
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts +5 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +178 -61
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/antigravity.d.ts +3 -4
- package/dist/configurators/antigravity.d.ts.map +1 -1
- package/dist/configurators/antigravity.js +17 -10
- package/dist/configurators/antigravity.js.map +1 -1
- package/dist/configurators/claude.d.ts +5 -28
- package/dist/configurators/claude.d.ts.map +1 -1
- package/dist/configurators/claude.js +30 -51
- package/dist/configurators/claude.js.map +1 -1
- package/dist/configurators/codebuddy.d.ts +6 -7
- package/dist/configurators/codebuddy.d.ts.map +1 -1
- package/dist/configurators/codebuddy.js +23 -51
- package/dist/configurators/codebuddy.js.map +1 -1
- package/dist/configurators/codex.d.ts +3 -6
- package/dist/configurators/codex.d.ts.map +1 -1
- package/dist/configurators/codex.js +29 -12
- package/dist/configurators/codex.js.map +1 -1
- package/dist/configurators/copilot.d.ts +6 -5
- package/dist/configurators/copilot.d.ts.map +1 -1
- package/dist/configurators/copilot.js +42 -13
- package/dist/configurators/copilot.js.map +1 -1
- package/dist/configurators/cursor.d.ts +6 -1
- package/dist/configurators/cursor.d.ts.map +1 -1
- package/dist/configurators/cursor.js +22 -45
- package/dist/configurators/cursor.js.map +1 -1
- package/dist/configurators/droid.d.ts +6 -1
- package/dist/configurators/droid.d.ts.map +1 -1
- package/dist/configurators/droid.js +23 -41
- package/dist/configurators/droid.js.map +1 -1
- package/dist/configurators/gemini.d.ts +8 -4
- package/dist/configurators/gemini.d.ts.map +1 -1
- package/dist/configurators/gemini.js +28 -47
- package/dist/configurators/gemini.js.map +1 -1
- package/dist/configurators/index.d.ts +1 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +146 -100
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/kilo.d.ts +3 -4
- package/dist/configurators/kilo.d.ts.map +1 -1
- package/dist/configurators/kilo.js +19 -46
- package/dist/configurators/kilo.js.map +1 -1
- package/dist/configurators/kiro.d.ts +4 -4
- package/dist/configurators/kiro.d.ts.map +1 -1
- package/dist/configurators/kiro.js +18 -14
- package/dist/configurators/kiro.js.map +1 -1
- package/dist/configurators/opencode.d.ts +7 -25
- package/dist/configurators/opencode.d.ts.map +1 -1
- package/dist/configurators/opencode.js +57 -56
- package/dist/configurators/opencode.js.map +1 -1
- package/dist/configurators/qoder.d.ts +6 -3
- package/dist/configurators/qoder.d.ts.map +1 -1
- package/dist/configurators/qoder.js +27 -46
- package/dist/configurators/qoder.js.map +1 -1
- package/dist/configurators/shared.d.ts +68 -3
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +274 -3
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/windsurf.d.ts +3 -4
- package/dist/configurators/windsurf.d.ts.map +1 -1
- package/dist/configurators/windsurf.js +17 -10
- package/dist/configurators/windsurf.js.map +1 -1
- package/dist/configurators/workflow.d.ts +0 -3
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +1 -7
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/manifests/0.4.0.json +1 -1
- 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.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/templates/claude/agents/{check.md → trellis-check.md} +3 -31
- package/dist/templates/claude/agents/{implement.md → trellis-implement.md} +1 -2
- package/dist/templates/claude/agents/trellis-research.md +137 -0
- package/dist/templates/claude/index.d.ts +5 -37
- package/dist/templates/claude/index.d.ts.map +1 -1
- package/dist/templates/claude/index.js +3 -42
- package/dist/templates/claude/index.js.map +1 -1
- package/dist/templates/claude/settings.json +6 -4
- package/dist/templates/{iflow/agents/check.md → codebuddy/agents/trellis-check.md} +3 -31
- package/dist/templates/{iflow/agents/implement.md → codebuddy/agents/trellis-implement.md} +1 -2
- package/dist/templates/codebuddy/agents/trellis-research.md +137 -0
- package/dist/templates/codebuddy/index.d.ts +6 -16
- package/dist/templates/codebuddy/index.d.ts.map +1 -1
- package/dist/templates/codebuddy/index.js +6 -36
- package/dist/templates/codebuddy/index.js.map +1 -1
- package/dist/templates/codebuddy/settings.json +59 -0
- package/dist/templates/codex/agents/trellis-check.toml +38 -0
- package/dist/templates/codex/agents/{implement.toml → trellis-implement.toml} +1 -1
- package/dist/templates/codex/agents/trellis-research.toml +60 -0
- package/dist/templates/codex/config.toml +10 -0
- package/dist/templates/codex/hooks/session-start.py +65 -29
- package/dist/templates/codex/hooks.json +11 -0
- package/dist/templates/codex/index.d.ts +0 -1
- package/dist/templates/codex/index.d.ts.map +1 -1
- package/dist/templates/codex/index.js +1 -8
- package/dist/templates/codex/index.js.map +1 -1
- package/dist/templates/codex/skills/start/SKILL.md +1 -1
- package/dist/templates/common/commands/continue.md +51 -0
- package/dist/templates/common/commands/finish-work.md +32 -0
- package/dist/templates/common/commands/start.md +56 -0
- package/dist/templates/common/index.d.ts +28 -0
- package/dist/templates/common/index.d.ts.map +1 -0
- package/dist/templates/common/index.js +55 -0
- package/dist/templates/common/index.js.map +1 -0
- package/dist/templates/{droid/commands/trellis → common/skills}/brainstorm.md +51 -12
- package/dist/templates/{iflow/commands/trellis → common/skills}/break-loop.md +4 -4
- package/dist/templates/common/skills/check.md +87 -0
- package/dist/templates/{codebuddy/commands/trellis → common/skills}/update-spec.md +18 -21
- package/dist/templates/copilot/hooks/session-start.py +65 -29
- package/dist/templates/copilot/hooks.json +8 -0
- package/dist/templates/copilot/prompts/start.prompt.md +13 -16
- package/dist/templates/cursor/agents/trellis-check.md +94 -0
- package/dist/templates/cursor/agents/trellis-implement.md +94 -0
- package/dist/templates/cursor/agents/trellis-research.md +137 -0
- package/dist/templates/cursor/hooks.json +24 -0
- package/dist/templates/cursor/index.d.ts +6 -17
- package/dist/templates/cursor/index.d.ts.map +1 -1
- package/dist/templates/cursor/index.js +6 -37
- package/dist/templates/cursor/index.js.map +1 -1
- package/dist/templates/droid/droids/trellis-check.md +94 -0
- package/dist/templates/droid/droids/trellis-implement.md +94 -0
- package/dist/templates/droid/droids/trellis-research.md +137 -0
- package/dist/templates/droid/index.d.ts +7 -19
- package/dist/templates/droid/index.d.ts.map +1 -1
- package/dist/templates/droid/index.js +7 -39
- package/dist/templates/droid/index.js.map +1 -1
- package/dist/templates/droid/settings.json +59 -0
- package/dist/templates/extract.d.ts +7 -193
- package/dist/templates/extract.d.ts.map +1 -1
- package/dist/templates/extract.js +7 -310
- package/dist/templates/extract.js.map +1 -1
- package/dist/templates/gemini/agents/trellis-check.md +94 -0
- package/dist/templates/gemini/agents/trellis-implement.md +94 -0
- package/dist/templates/gemini/agents/trellis-research.md +137 -0
- package/dist/templates/gemini/index.d.ts +6 -14
- package/dist/templates/gemini/index.d.ts.map +1 -1
- package/dist/templates/gemini/index.js +6 -37
- package/dist/templates/gemini/index.js.map +1 -1
- package/dist/templates/gemini/settings.json +28 -0
- package/dist/templates/kiro/agents/trellis-check.json +13 -0
- package/dist/templates/kiro/agents/trellis-implement.json +13 -0
- package/dist/templates/kiro/agents/trellis-research.json +21 -0
- package/dist/templates/kiro/index.d.ts +11 -11
- package/dist/templates/kiro/index.d.ts.map +1 -1
- package/dist/templates/kiro/index.js +11 -33
- package/dist/templates/kiro/index.js.map +1 -1
- package/dist/templates/opencode/agents/{check.md → trellis-check.md} +3 -30
- package/dist/templates/opencode/agents/{implement.md → trellis-implement.md} +1 -1
- package/dist/templates/opencode/agents/{research.md → trellis-research.md} +1 -2
- package/dist/templates/opencode/plugins/inject-subagent-context.js +18 -190
- package/dist/templates/opencode/plugins/inject-workflow-state.js +172 -0
- package/dist/templates/opencode/plugins/session-start.js +76 -39
- package/dist/templates/qoder/agents/trellis-check.md +94 -0
- package/dist/templates/qoder/agents/trellis-implement.md +94 -0
- package/dist/templates/qoder/agents/trellis-research.md +137 -0
- package/dist/templates/qoder/index.d.ts +7 -10
- package/dist/templates/qoder/index.d.ts.map +1 -1
- package/dist/templates/qoder/index.js +7 -32
- package/dist/templates/qoder/index.js.map +1 -1
- package/dist/templates/qoder/settings.json +47 -0
- package/dist/templates/shared-hooks/index.d.ts +19 -0
- package/dist/templates/shared-hooks/index.d.ts.map +1 -0
- package/dist/templates/shared-hooks/index.js +30 -0
- package/dist/templates/shared-hooks/index.js.map +1 -0
- package/dist/templates/{iflow/hooks → shared-hooks}/inject-subagent-context.py +77 -266
- package/dist/templates/shared-hooks/inject-workflow-state.py +244 -0
- package/dist/templates/{claude/hooks → shared-hooks}/session-start.py +172 -55
- 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 +6 -0
- package/dist/templates/trellis/index.d.ts +1 -15
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +2 -29
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/common/cli_adapter.py +31 -8
- package/dist/templates/trellis/scripts/common/config.py +126 -1
- package/dist/templates/trellis/scripts/common/git_context.py +25 -2
- package/dist/templates/trellis/scripts/common/task_context.py +23 -28
- package/dist/templates/trellis/scripts/common/task_store.py +0 -12
- package/dist/templates/trellis/scripts/common/types.py +0 -2
- package/dist/templates/trellis/scripts/common/workflow_phase.py +176 -0
- package/dist/templates/trellis/scripts/task.py +13 -35
- package/dist/templates/trellis/workflow.md +283 -298
- package/dist/types/ai-tools.d.ts +30 -3
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +119 -15
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/types/migration.d.ts +8 -1
- package/dist/types/migration.d.ts.map +1 -1
- package/dist/utils/project-detector.d.ts +2 -0
- package/dist/utils/project-detector.d.ts.map +1 -1
- package/dist/utils/project-detector.js +120 -11
- package/dist/utils/project-detector.js.map +1 -1
- package/dist/utils/task-json.d.ts +46 -0
- package/dist/utils/task-json.d.ts.map +1 -0
- package/dist/utils/task-json.js +49 -0
- package/dist/utils/task-json.js.map +1 -0
- package/package.json +3 -2
- package/dist/configurators/iflow.d.ts +0 -33
- package/dist/configurators/iflow.d.ts.map +0 -1
- package/dist/configurators/iflow.js +0 -99
- package/dist/configurators/iflow.js.map +0 -1
- package/dist/templates/antigravity/index.d.ts +0 -12
- package/dist/templates/antigravity/index.d.ts.map +0 -1
- package/dist/templates/antigravity/index.js +0 -29
- package/dist/templates/antigravity/index.js.map +0 -1
- package/dist/templates/claude/agents/debug.md +0 -106
- package/dist/templates/claude/agents/dispatch.md +0 -213
- package/dist/templates/claude/agents/plan.md +0 -396
- package/dist/templates/claude/agents/research.md +0 -120
- package/dist/templates/claude/commands/trellis/brainstorm.md +0 -487
- package/dist/templates/claude/commands/trellis/break-loop.md +0 -125
- package/dist/templates/claude/commands/trellis/check-cross-layer.md +0 -153
- package/dist/templates/claude/commands/trellis/check.md +0 -25
- package/dist/templates/claude/commands/trellis/create-command.md +0 -154
- package/dist/templates/claude/commands/trellis/finish-work.md +0 -153
- package/dist/templates/claude/commands/trellis/integrate-skill.md +0 -219
- package/dist/templates/claude/commands/trellis/onboard.md +0 -358
- package/dist/templates/claude/commands/trellis/parallel.md +0 -192
- package/dist/templates/claude/commands/trellis/record-session.md +0 -62
- package/dist/templates/claude/commands/trellis/start.md +0 -393
- package/dist/templates/claude/commands/trellis/update-spec.md +0 -354
- package/dist/templates/claude/hooks/inject-subagent-context.py +0 -803
- package/dist/templates/claude/hooks/ralph-loop.py +0 -396
- package/dist/templates/codebuddy/commands/trellis/before-dev.md +0 -29
- package/dist/templates/codebuddy/commands/trellis/brainstorm.md +0 -487
- package/dist/templates/codebuddy/commands/trellis/break-loop.md +0 -107
- package/dist/templates/codebuddy/commands/trellis/check-cross-layer.md +0 -153
- package/dist/templates/codebuddy/commands/trellis/check.md +0 -25
- package/dist/templates/codebuddy/commands/trellis/create-command.md +0 -154
- package/dist/templates/codebuddy/commands/trellis/finish-work.md +0 -143
- package/dist/templates/codebuddy/commands/trellis/integrate-skill.md +0 -219
- package/dist/templates/codebuddy/commands/trellis/onboard.md +0 -358
- package/dist/templates/codebuddy/commands/trellis/record-session.md +0 -61
- package/dist/templates/codebuddy/commands/trellis/start.md +0 -373
- package/dist/templates/codex/agents/check.toml +0 -23
- package/dist/templates/codex/agents/research.toml +0 -26
- package/dist/templates/codex/codex-skills/parallel/SKILL.md +0 -194
- package/dist/templates/cursor/commands/trellis-before-dev.md +0 -29
- package/dist/templates/cursor/commands/trellis-brainstorm.md +0 -487
- package/dist/templates/cursor/commands/trellis-break-loop.md +0 -107
- package/dist/templates/cursor/commands/trellis-check-cross-layer.md +0 -153
- package/dist/templates/cursor/commands/trellis-check.md +0 -25
- package/dist/templates/cursor/commands/trellis-create-command.md +0 -154
- package/dist/templates/cursor/commands/trellis-finish-work.md +0 -143
- package/dist/templates/cursor/commands/trellis-integrate-skill.md +0 -219
- package/dist/templates/cursor/commands/trellis-onboard.md +0 -358
- package/dist/templates/cursor/commands/trellis-record-session.md +0 -62
- package/dist/templates/cursor/commands/trellis-start.md +0 -373
- package/dist/templates/cursor/commands/trellis-update-spec.md +0 -354
- package/dist/templates/droid/commands/trellis/before-dev.md +0 -33
- package/dist/templates/droid/commands/trellis/break-loop.md +0 -111
- package/dist/templates/droid/commands/trellis/check-cross-layer.md +0 -157
- package/dist/templates/droid/commands/trellis/check.md +0 -29
- package/dist/templates/droid/commands/trellis/create-command.md +0 -158
- package/dist/templates/droid/commands/trellis/finish-work.md +0 -147
- package/dist/templates/droid/commands/trellis/integrate-skill.md +0 -223
- package/dist/templates/droid/commands/trellis/onboard.md +0 -362
- package/dist/templates/droid/commands/trellis/record-session.md +0 -66
- package/dist/templates/droid/commands/trellis/start.md +0 -377
- package/dist/templates/droid/commands/trellis/update-spec.md +0 -358
- package/dist/templates/gemini/commands/trellis/before-dev.toml +0 -33
- package/dist/templates/gemini/commands/trellis/brainstorm.toml +0 -435
- package/dist/templates/gemini/commands/trellis/break-loop.toml +0 -129
- package/dist/templates/gemini/commands/trellis/check-cross-layer.toml +0 -147
- package/dist/templates/gemini/commands/trellis/check.toml +0 -29
- package/dist/templates/gemini/commands/trellis/create-command.toml +0 -119
- package/dist/templates/gemini/commands/trellis/finish-work.toml +0 -133
- package/dist/templates/gemini/commands/trellis/integrate-skill.toml +0 -104
- package/dist/templates/gemini/commands/trellis/onboard.toml +0 -111
- package/dist/templates/gemini/commands/trellis/record-session.toml +0 -66
- package/dist/templates/gemini/commands/trellis/start.toml +0 -354
- package/dist/templates/gemini/commands/trellis/update-spec.toml +0 -132
- package/dist/templates/iflow/agents/debug.md +0 -106
- package/dist/templates/iflow/agents/dispatch.md +0 -213
- package/dist/templates/iflow/agents/plan.md +0 -396
- package/dist/templates/iflow/agents/research.md +0 -120
- package/dist/templates/iflow/commands/trellis/before-dev.md +0 -29
- package/dist/templates/iflow/commands/trellis/brainstorm.md +0 -487
- package/dist/templates/iflow/commands/trellis/check-cross-layer.md +0 -153
- package/dist/templates/iflow/commands/trellis/check.md +0 -25
- package/dist/templates/iflow/commands/trellis/create-command.md +0 -152
- package/dist/templates/iflow/commands/trellis/finish-work.md +0 -153
- package/dist/templates/iflow/commands/trellis/integrate-skill.md +0 -219
- package/dist/templates/iflow/commands/trellis/onboard.md +0 -358
- package/dist/templates/iflow/commands/trellis/parallel.md +0 -192
- package/dist/templates/iflow/commands/trellis/record-session.md +0 -62
- package/dist/templates/iflow/commands/trellis/start.md +0 -393
- package/dist/templates/iflow/commands/trellis/update-spec.md +0 -354
- package/dist/templates/iflow/hooks/ralph-loop.py +0 -395
- package/dist/templates/iflow/hooks/session-start.py +0 -403
- package/dist/templates/iflow/index.d.ts +0 -54
- package/dist/templates/iflow/index.d.ts.map +0 -1
- package/dist/templates/iflow/index.js +0 -85
- package/dist/templates/iflow/index.js.map +0 -1
- package/dist/templates/iflow/settings.json +0 -60
- package/dist/templates/kilo/index.d.ts +0 -16
- package/dist/templates/kilo/index.d.ts.map +0 -1
- package/dist/templates/kilo/index.js +0 -39
- package/dist/templates/kilo/index.js.map +0 -1
- package/dist/templates/kilo/workflows/before-dev.md +0 -29
- package/dist/templates/kilo/workflows/brainstorm.md +0 -487
- package/dist/templates/kilo/workflows/break-loop.md +0 -125
- package/dist/templates/kilo/workflows/check-cross-layer.md +0 -153
- package/dist/templates/kilo/workflows/check.md +0 -25
- package/dist/templates/kilo/workflows/create-command.md +0 -152
- package/dist/templates/kilo/workflows/finish-work.md +0 -129
- package/dist/templates/kilo/workflows/integrate-skill.md +0 -219
- package/dist/templates/kilo/workflows/onboard.md +0 -358
- package/dist/templates/kilo/workflows/parallel.md +0 -193
- package/dist/templates/kilo/workflows/record-session.md +0 -62
- package/dist/templates/kilo/workflows/start.md +0 -387
- package/dist/templates/kilo/workflows/update-spec.md +0 -285
- package/dist/templates/kiro/skills/before-dev/SKILL.md +0 -34
- package/dist/templates/kiro/skills/brainstorm/SKILL.md +0 -492
- package/dist/templates/kiro/skills/break-loop/SKILL.md +0 -130
- package/dist/templates/kiro/skills/check/SKILL.md +0 -30
- package/dist/templates/kiro/skills/check-cross-layer/SKILL.md +0 -158
- package/dist/templates/kiro/skills/create-command/SKILL.md +0 -101
- package/dist/templates/kiro/skills/finish-work/SKILL.md +0 -148
- package/dist/templates/kiro/skills/integrate-skill/SKILL.md +0 -221
- package/dist/templates/kiro/skills/onboard/SKILL.md +0 -363
- package/dist/templates/kiro/skills/record-session/SKILL.md +0 -67
- package/dist/templates/kiro/skills/start/SKILL.md +0 -351
- package/dist/templates/kiro/skills/update-spec/SKILL.md +0 -335
- package/dist/templates/markdown/spec/backend/directory-structure.md +0 -292
- package/dist/templates/markdown/spec/backend/index.md +0 -40
- package/dist/templates/markdown/spec/backend/script-conventions.md +0 -742
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md +0 -118
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md +0 -394
- package/dist/templates/opencode/agents/debug.md +0 -129
- package/dist/templates/opencode/agents/dispatch.md +0 -223
- package/dist/templates/opencode/agents/trellis-plan.md +0 -427
- package/dist/templates/opencode/commands/trellis/before-dev.md +0 -29
- package/dist/templates/opencode/commands/trellis/brainstorm.md +0 -487
- package/dist/templates/opencode/commands/trellis/break-loop.md +0 -125
- package/dist/templates/opencode/commands/trellis/check-cross-layer.md +0 -153
- package/dist/templates/opencode/commands/trellis/check.md +0 -25
- package/dist/templates/opencode/commands/trellis/create-command.md +0 -154
- package/dist/templates/opencode/commands/trellis/finish-work.md +0 -144
- package/dist/templates/opencode/commands/trellis/integrate-skill.md +0 -219
- package/dist/templates/opencode/commands/trellis/migrate-specs.md +0 -0
- package/dist/templates/opencode/commands/trellis/onboard.md +0 -358
- package/dist/templates/opencode/commands/trellis/parallel.md +0 -193
- package/dist/templates/opencode/commands/trellis/record-session.md +0 -62
- package/dist/templates/opencode/commands/trellis/start.md +0 -351
- package/dist/templates/opencode/commands/trellis/update-spec.md +0 -354
- package/dist/templates/qoder/skills/before-dev/SKILL.md +0 -34
- package/dist/templates/qoder/skills/brainstorm/SKILL.md +0 -492
- package/dist/templates/qoder/skills/break-loop/SKILL.md +0 -130
- package/dist/templates/qoder/skills/check/SKILL.md +0 -30
- package/dist/templates/qoder/skills/check-cross-layer/SKILL.md +0 -158
- package/dist/templates/qoder/skills/create-command/SKILL.md +0 -101
- package/dist/templates/qoder/skills/finish-work/SKILL.md +0 -134
- package/dist/templates/qoder/skills/integrate-skill/SKILL.md +0 -221
- package/dist/templates/qoder/skills/onboard/SKILL.md +0 -363
- package/dist/templates/qoder/skills/record-session/SKILL.md +0 -67
- package/dist/templates/qoder/skills/start/SKILL.md +0 -388
- package/dist/templates/qoder/skills/update-spec/SKILL.md +0 -290
- package/dist/templates/trellis/scripts/common/phase.py +0 -254
- package/dist/templates/trellis/scripts/common/registry.py +0 -335
- package/dist/templates/trellis/scripts/common/worktree.py +0 -305
- package/dist/templates/trellis/scripts/create_bootstrap.py +0 -298
- package/dist/templates/trellis/scripts/multi_agent/__init__.py +0 -5
- package/dist/templates/trellis/scripts/multi_agent/_bootstrap.py +0 -17
- package/dist/templates/trellis/scripts/multi_agent/cleanup.py +0 -398
- package/dist/templates/trellis/scripts/multi_agent/create_pr.py +0 -620
- package/dist/templates/trellis/scripts/multi_agent/plan.py +0 -213
- package/dist/templates/trellis/scripts/multi_agent/start.py +0 -539
- package/dist/templates/trellis/scripts/multi_agent/status.py +0 -76
- package/dist/templates/trellis/scripts/multi_agent/status_display.py +0 -542
- package/dist/templates/trellis/scripts/multi_agent/status_monitor.py +0 -225
- package/dist/templates/trellis/scripts-shell-archive/add-session.sh +0 -384
- package/dist/templates/trellis/scripts-shell-archive/common/developer.sh +0 -129
- package/dist/templates/trellis/scripts-shell-archive/common/git-context.sh +0 -263
- package/dist/templates/trellis/scripts-shell-archive/common/paths.sh +0 -208
- package/dist/templates/trellis/scripts-shell-archive/common/phase.sh +0 -150
- package/dist/templates/trellis/scripts-shell-archive/common/registry.sh +0 -247
- package/dist/templates/trellis/scripts-shell-archive/common/task-queue.sh +0 -142
- package/dist/templates/trellis/scripts-shell-archive/common/task-utils.sh +0 -151
- package/dist/templates/trellis/scripts-shell-archive/common/worktree.sh +0 -128
- package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +0 -299
- package/dist/templates/trellis/scripts-shell-archive/get-context.sh +0 -7
- package/dist/templates/trellis/scripts-shell-archive/get-developer.sh +0 -15
- package/dist/templates/trellis/scripts-shell-archive/init-developer.sh +0 -34
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/cleanup.sh +0 -396
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/create-pr.sh +0 -241
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/plan.sh +0 -207
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/start.sh +0 -317
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/status.sh +0 -828
- package/dist/templates/trellis/scripts-shell-archive/task.sh +0 -1204
- package/dist/templates/trellis/worktree.yaml +0 -47
- package/dist/templates/windsurf/index.d.ts +0 -21
- package/dist/templates/windsurf/index.d.ts.map +0 -1
- package/dist/templates/windsurf/index.js +0 -44
- package/dist/templates/windsurf/index.js.map +0 -1
- package/dist/templates/windsurf/workflows/trellis-before-dev.md +0 -31
- package/dist/templates/windsurf/workflows/trellis-brainstorm.md +0 -491
- package/dist/templates/windsurf/workflows/trellis-break-loop.md +0 -111
- package/dist/templates/windsurf/workflows/trellis-check-cross-layer.md +0 -157
- package/dist/templates/windsurf/workflows/trellis-check.md +0 -27
- package/dist/templates/windsurf/workflows/trellis-create-command.md +0 -154
- package/dist/templates/windsurf/workflows/trellis-finish-work.md +0 -147
- package/dist/templates/windsurf/workflows/trellis-integrate-skill.md +0 -220
- package/dist/templates/windsurf/workflows/trellis-onboard.md +0 -362
- package/dist/templates/windsurf/workflows/trellis-record-session.md +0 -66
- package/dist/templates/windsurf/workflows/trellis-start.md +0 -373
- package/dist/templates/windsurf/workflows/trellis-update-spec.md +0 -358
- /package/dist/templates/{claude/commands/trellis → common/skills}/before-dev.md +0 -0
- /package/dist/templates/{claude/hooks → shared-hooks}/statusline.py +0 -0
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# =============================================================================
|
|
3
|
-
# Multi-Agent Pipeline: Plan Agent Launcher
|
|
4
|
-
# =============================================================================
|
|
5
|
-
# Usage: ./plan.sh --name <task-name> --type <dev-type> --requirement "<requirement>"
|
|
6
|
-
#
|
|
7
|
-
# This script:
|
|
8
|
-
# 1. Creates task directory
|
|
9
|
-
# 2. Starts Plan Agent in background
|
|
10
|
-
# 3. Plan Agent produces fully configured task directory
|
|
11
|
-
#
|
|
12
|
-
# After completion, use start.sh to launch the Dispatch Agent.
|
|
13
|
-
#
|
|
14
|
-
# Prerequisites:
|
|
15
|
-
# - .claude/agents/plan.md must exist
|
|
16
|
-
# - Developer must be initialized
|
|
17
|
-
# =============================================================================
|
|
18
|
-
|
|
19
|
-
set -e
|
|
20
|
-
|
|
21
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
22
|
-
source "$SCRIPT_DIR/../common/paths.sh"
|
|
23
|
-
source "$SCRIPT_DIR/../common/developer.sh"
|
|
24
|
-
|
|
25
|
-
# Colors
|
|
26
|
-
RED='\033[0;31m'
|
|
27
|
-
GREEN='\033[0;32m'
|
|
28
|
-
YELLOW='\033[1;33m'
|
|
29
|
-
BLUE='\033[0;34m'
|
|
30
|
-
NC='\033[0m'
|
|
31
|
-
|
|
32
|
-
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
|
33
|
-
log_success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; }
|
|
34
|
-
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
|
35
|
-
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
|
36
|
-
|
|
37
|
-
# =============================================================================
|
|
38
|
-
# Constants
|
|
39
|
-
# =============================================================================
|
|
40
|
-
PROJECT_ROOT=$(get_repo_root)
|
|
41
|
-
PLAN_MD_PATH=".claude/agents/plan.md"
|
|
42
|
-
|
|
43
|
-
# =============================================================================
|
|
44
|
-
# Parse Arguments
|
|
45
|
-
# =============================================================================
|
|
46
|
-
TASK_NAME=""
|
|
47
|
-
DEV_TYPE=""
|
|
48
|
-
REQUIREMENT=""
|
|
49
|
-
|
|
50
|
-
show_usage() {
|
|
51
|
-
cat << EOF
|
|
52
|
-
Usage: $0 --name <task-name> --type <dev-type> --requirement "<requirement>"
|
|
53
|
-
|
|
54
|
-
Arguments:
|
|
55
|
-
--name, -n Task name (e.g., user-auth, add-rate-limiting)
|
|
56
|
-
--type, -t Development type: backend | frontend | fullstack
|
|
57
|
-
--requirement, -r Requirement description (quote if contains spaces)
|
|
58
|
-
|
|
59
|
-
Examples:
|
|
60
|
-
$0 --name user-auth --type backend --requirement "Add JWT-based user authentication"
|
|
61
|
-
$0 -n rate-limit -t backend -r "Add rate limiting to API endpoints"
|
|
62
|
-
|
|
63
|
-
The Plan Agent runs in background. Monitor with:
|
|
64
|
-
tail -f <task-dir>/.plan-log
|
|
65
|
-
EOF
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
while [[ $# -gt 0 ]]; do
|
|
69
|
-
case $1 in
|
|
70
|
-
--name|-n)
|
|
71
|
-
TASK_NAME="$2"
|
|
72
|
-
shift 2
|
|
73
|
-
;;
|
|
74
|
-
--type|-t)
|
|
75
|
-
DEV_TYPE="$2"
|
|
76
|
-
shift 2
|
|
77
|
-
;;
|
|
78
|
-
--requirement|-r)
|
|
79
|
-
REQUIREMENT="$2"
|
|
80
|
-
shift 2
|
|
81
|
-
;;
|
|
82
|
-
--help|-h)
|
|
83
|
-
show_usage
|
|
84
|
-
exit 0
|
|
85
|
-
;;
|
|
86
|
-
*)
|
|
87
|
-
log_error "Unknown argument: $1"
|
|
88
|
-
show_usage
|
|
89
|
-
exit 1
|
|
90
|
-
;;
|
|
91
|
-
esac
|
|
92
|
-
done
|
|
93
|
-
|
|
94
|
-
# =============================================================================
|
|
95
|
-
# Validation
|
|
96
|
-
# =============================================================================
|
|
97
|
-
if [ -z "$TASK_NAME" ]; then
|
|
98
|
-
log_error "Task name is required (--name)"
|
|
99
|
-
show_usage
|
|
100
|
-
exit 1
|
|
101
|
-
fi
|
|
102
|
-
|
|
103
|
-
if [ -z "$DEV_TYPE" ]; then
|
|
104
|
-
log_error "Development type is required (--type)"
|
|
105
|
-
show_usage
|
|
106
|
-
exit 1
|
|
107
|
-
fi
|
|
108
|
-
|
|
109
|
-
if [[ ! "$DEV_TYPE" =~ ^(backend|frontend|fullstack)$ ]]; then
|
|
110
|
-
log_error "Invalid dev type: $DEV_TYPE (must be: backend, frontend, fullstack)"
|
|
111
|
-
exit 1
|
|
112
|
-
fi
|
|
113
|
-
|
|
114
|
-
if [ -z "$REQUIREMENT" ]; then
|
|
115
|
-
log_error "Requirement is required (--requirement)"
|
|
116
|
-
show_usage
|
|
117
|
-
exit 1
|
|
118
|
-
fi
|
|
119
|
-
|
|
120
|
-
PLAN_MD="${PROJECT_ROOT}/${PLAN_MD_PATH}"
|
|
121
|
-
if [ ! -f "$PLAN_MD" ]; then
|
|
122
|
-
log_error "plan.md not found at ${PLAN_MD}"
|
|
123
|
-
exit 1
|
|
124
|
-
fi
|
|
125
|
-
|
|
126
|
-
ensure_developer "$PROJECT_ROOT"
|
|
127
|
-
|
|
128
|
-
# =============================================================================
|
|
129
|
-
# Step 1: Create Task Directory
|
|
130
|
-
# =============================================================================
|
|
131
|
-
echo ""
|
|
132
|
-
echo -e "${BLUE}=== Multi-Agent Pipeline: Plan ===${NC}"
|
|
133
|
-
log_info "Task: ${TASK_NAME}"
|
|
134
|
-
log_info "Type: ${DEV_TYPE}"
|
|
135
|
-
log_info "Requirement: ${REQUIREMENT}"
|
|
136
|
-
echo ""
|
|
137
|
-
|
|
138
|
-
log_info "Step 1: Creating task directory..."
|
|
139
|
-
|
|
140
|
-
# Create task (use requirement as title, task name as slug)
|
|
141
|
-
TASK_DIR=$("$SCRIPT_DIR/../task.sh" create "$REQUIREMENT" --slug "$TASK_NAME")
|
|
142
|
-
TASK_DIR_ABS="${PROJECT_ROOT}/${TASK_DIR}"
|
|
143
|
-
|
|
144
|
-
log_success "Task directory: ${TASK_DIR}"
|
|
145
|
-
|
|
146
|
-
# =============================================================================
|
|
147
|
-
# Step 2: Prepare and Start Plan Agent
|
|
148
|
-
# =============================================================================
|
|
149
|
-
log_info "Step 2: Starting Plan Agent in background..."
|
|
150
|
-
|
|
151
|
-
LOG_FILE="${TASK_DIR_ABS}/.plan-log"
|
|
152
|
-
touch "$LOG_FILE"
|
|
153
|
-
|
|
154
|
-
# Create a temporary runner script (will be deleted after agent starts)
|
|
155
|
-
RUNNER_SCRIPT=$(mktemp)
|
|
156
|
-
cat > "$RUNNER_SCRIPT" << RUNNER_EOF
|
|
157
|
-
#!/bin/bash
|
|
158
|
-
cd "${PROJECT_ROOT}"
|
|
159
|
-
|
|
160
|
-
export PLAN_TASK_NAME="${TASK_NAME}"
|
|
161
|
-
export PLAN_DEV_TYPE="${DEV_TYPE}"
|
|
162
|
-
export PLAN_TASK_DIR="${TASK_DIR}"
|
|
163
|
-
export PLAN_REQUIREMENT="${REQUIREMENT}"
|
|
164
|
-
|
|
165
|
-
export https_proxy="\${AGENT_HTTPS_PROXY:-}"
|
|
166
|
-
export http_proxy="\${AGENT_HTTP_PROXY:-}"
|
|
167
|
-
export all_proxy="\${AGENT_ALL_PROXY:-}"
|
|
168
|
-
export CLAUDE_NON_INTERACTIVE=1
|
|
169
|
-
|
|
170
|
-
# Use --agent flag to load plan agent directly
|
|
171
|
-
claude -p --agent plan --dangerously-skip-permissions --output-format stream-json --verbose "Start planning for task: ${TASK_NAME}"
|
|
172
|
-
|
|
173
|
-
# Self-delete the runner script
|
|
174
|
-
rm -f "\$0"
|
|
175
|
-
RUNNER_EOF
|
|
176
|
-
chmod +x "$RUNNER_SCRIPT"
|
|
177
|
-
|
|
178
|
-
# Start agent in background
|
|
179
|
-
AGENT_HTTPS_PROXY="${https_proxy:-}" \
|
|
180
|
-
AGENT_HTTP_PROXY="${http_proxy:-}" \
|
|
181
|
-
AGENT_ALL_PROXY="${all_proxy:-}" \
|
|
182
|
-
nohup "$RUNNER_SCRIPT" > "$LOG_FILE" 2>&1 &
|
|
183
|
-
AGENT_PID=$!
|
|
184
|
-
|
|
185
|
-
log_success "Plan Agent started (PID: ${AGENT_PID})"
|
|
186
|
-
|
|
187
|
-
# =============================================================================
|
|
188
|
-
# Summary
|
|
189
|
-
# =============================================================================
|
|
190
|
-
echo ""
|
|
191
|
-
echo -e "${GREEN}=== Plan Agent Running ===${NC}"
|
|
192
|
-
echo ""
|
|
193
|
-
echo " Task: $TASK_NAME"
|
|
194
|
-
echo " Type: $DEV_TYPE"
|
|
195
|
-
echo " Dir: $TASK_DIR"
|
|
196
|
-
echo " Log: $LOG_FILE"
|
|
197
|
-
echo " PID: $AGENT_PID"
|
|
198
|
-
echo ""
|
|
199
|
-
echo -e "${YELLOW}To monitor:${NC}"
|
|
200
|
-
echo " tail -f $LOG_FILE"
|
|
201
|
-
echo ""
|
|
202
|
-
echo -e "${YELLOW}To check status:${NC}"
|
|
203
|
-
echo " ps -p $AGENT_PID"
|
|
204
|
-
echo " ls -la $TASK_DIR"
|
|
205
|
-
echo ""
|
|
206
|
-
echo -e "${YELLOW}After completion, run:${NC}"
|
|
207
|
-
echo " ./.trellis/scripts/multi-agent/start.sh $TASK_DIR"
|
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# =============================================================================
|
|
3
|
-
# Multi-Agent Pipeline: Start Worktree Agent
|
|
4
|
-
# =============================================================================
|
|
5
|
-
# Usage: ./start.sh <task-dir>
|
|
6
|
-
# Example: ./start.sh .trellis/tasks/01-21-my-task
|
|
7
|
-
#
|
|
8
|
-
# This script:
|
|
9
|
-
# 1. Creates worktree (if not exists) with dependency install
|
|
10
|
-
# 2. Copies environment files (from worktree.yaml config)
|
|
11
|
-
# 3. Sets .current-task in worktree
|
|
12
|
-
# 4. Starts claude agent in background
|
|
13
|
-
# 5. Registers agent to registry.json
|
|
14
|
-
#
|
|
15
|
-
# Prerequisites:
|
|
16
|
-
# - task.json must exist with 'branch' field
|
|
17
|
-
# - .claude/agents/dispatch.md must exist
|
|
18
|
-
#
|
|
19
|
-
# Configuration: .trellis/worktree.yaml
|
|
20
|
-
# =============================================================================
|
|
21
|
-
|
|
22
|
-
set -e
|
|
23
|
-
|
|
24
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
25
|
-
source "$SCRIPT_DIR/../common/paths.sh"
|
|
26
|
-
source "$SCRIPT_DIR/../common/worktree.sh"
|
|
27
|
-
source "$SCRIPT_DIR/../common/developer.sh"
|
|
28
|
-
source "$SCRIPT_DIR/../common/registry.sh"
|
|
29
|
-
|
|
30
|
-
# Colors
|
|
31
|
-
RED='\033[0;31m'
|
|
32
|
-
GREEN='\033[0;32m'
|
|
33
|
-
YELLOW='\033[1;33m'
|
|
34
|
-
BLUE='\033[0;34m'
|
|
35
|
-
NC='\033[0m'
|
|
36
|
-
|
|
37
|
-
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
|
38
|
-
log_success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; }
|
|
39
|
-
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
|
40
|
-
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
|
41
|
-
|
|
42
|
-
# =============================================================================
|
|
43
|
-
# Constants
|
|
44
|
-
# =============================================================================
|
|
45
|
-
PROJECT_ROOT=$(get_repo_root)
|
|
46
|
-
DISPATCH_MD_PATH=".claude/agents/dispatch.md"
|
|
47
|
-
|
|
48
|
-
# =============================================================================
|
|
49
|
-
# Parse Arguments
|
|
50
|
-
# =============================================================================
|
|
51
|
-
TASK_DIR=$1
|
|
52
|
-
if [ -z "$TASK_DIR" ]; then
|
|
53
|
-
log_error "Task directory required"
|
|
54
|
-
echo "Usage: $0 <task-dir>"
|
|
55
|
-
echo "Example: $0 .trellis/tasks/01-21-my-task"
|
|
56
|
-
exit 1
|
|
57
|
-
fi
|
|
58
|
-
|
|
59
|
-
# Normalize paths
|
|
60
|
-
if [[ "$TASK_DIR" = /* ]]; then
|
|
61
|
-
TASK_DIR_RELATIVE="${TASK_DIR#$PROJECT_ROOT/}"
|
|
62
|
-
TASK_DIR_ABS="$TASK_DIR"
|
|
63
|
-
else
|
|
64
|
-
TASK_DIR_RELATIVE="$TASK_DIR"
|
|
65
|
-
TASK_DIR_ABS="${PROJECT_ROOT}/${TASK_DIR}"
|
|
66
|
-
fi
|
|
67
|
-
|
|
68
|
-
TASK_JSON="${TASK_DIR_ABS}/$FILE_TASK_JSON"
|
|
69
|
-
|
|
70
|
-
# =============================================================================
|
|
71
|
-
# Validation
|
|
72
|
-
# =============================================================================
|
|
73
|
-
if [ ! -f "$TASK_JSON" ]; then
|
|
74
|
-
log_error "task.json not found at ${TASK_JSON}"
|
|
75
|
-
exit 1
|
|
76
|
-
fi
|
|
77
|
-
|
|
78
|
-
DISPATCH_MD="${PROJECT_ROOT}/${DISPATCH_MD_PATH}"
|
|
79
|
-
if [ ! -f "$DISPATCH_MD" ]; then
|
|
80
|
-
log_error "dispatch.md not found at ${DISPATCH_MD}"
|
|
81
|
-
exit 1
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
CONFIG_FILE=$(get_worktree_config "$PROJECT_ROOT")
|
|
85
|
-
if [ ! -f "$CONFIG_FILE" ]; then
|
|
86
|
-
log_error "worktree.yaml not found at ${CONFIG_FILE}"
|
|
87
|
-
exit 1
|
|
88
|
-
fi
|
|
89
|
-
|
|
90
|
-
# =============================================================================
|
|
91
|
-
# Read Task Config
|
|
92
|
-
# =============================================================================
|
|
93
|
-
echo ""
|
|
94
|
-
echo -e "${BLUE}=== Multi-Agent Pipeline: Start ===${NC}"
|
|
95
|
-
log_info "Task: ${TASK_DIR_ABS}"
|
|
96
|
-
|
|
97
|
-
BRANCH=$(jq -r '.branch' "$TASK_JSON")
|
|
98
|
-
TASK_NAME=$(jq -r '.name' "$TASK_JSON")
|
|
99
|
-
TASK_STATUS=$(jq -r '.status' "$TASK_JSON")
|
|
100
|
-
WORKTREE_PATH=$(jq -r '.worktree_path // empty' "$TASK_JSON")
|
|
101
|
-
CONFIGURED_BASE_BRANCH=$(jq -r '.base_branch // empty' "$TASK_JSON")
|
|
102
|
-
|
|
103
|
-
# Check if task was rejected
|
|
104
|
-
if [ "$TASK_STATUS" = "rejected" ]; then
|
|
105
|
-
log_error "Task was rejected by Plan Agent"
|
|
106
|
-
if [ -f "${TASK_DIR_ABS}/REJECTED.md" ]; then
|
|
107
|
-
echo ""
|
|
108
|
-
echo -e "${YELLOW}Rejection reason:${NC}"
|
|
109
|
-
cat "${TASK_DIR_ABS}/REJECTED.md"
|
|
110
|
-
fi
|
|
111
|
-
echo ""
|
|
112
|
-
log_info "To retry, delete this directory and run plan.sh again with revised requirements"
|
|
113
|
-
exit 1
|
|
114
|
-
fi
|
|
115
|
-
|
|
116
|
-
# Check if prd.md exists (plan completed successfully)
|
|
117
|
-
if [ ! -f "${TASK_DIR_ABS}/prd.md" ]; then
|
|
118
|
-
log_error "prd.md not found - Plan Agent may not have completed"
|
|
119
|
-
log_info "Check plan log: ${TASK_DIR_ABS}/.plan-log"
|
|
120
|
-
exit 1
|
|
121
|
-
fi
|
|
122
|
-
|
|
123
|
-
if [ -z "$BRANCH" ] || [ "$BRANCH" = "null" ]; then
|
|
124
|
-
log_error "branch field not set in task.json"
|
|
125
|
-
log_info "Please set branch field first, e.g.:"
|
|
126
|
-
log_info " jq '.branch = \"task/my-task\"' task.json > tmp && mv tmp task.json"
|
|
127
|
-
exit 1
|
|
128
|
-
fi
|
|
129
|
-
|
|
130
|
-
log_info "Branch: ${BRANCH}"
|
|
131
|
-
log_info "Name: ${TASK_NAME}"
|
|
132
|
-
|
|
133
|
-
# =============================================================================
|
|
134
|
-
# Step 1: Create Worktree (if not exists)
|
|
135
|
-
# =============================================================================
|
|
136
|
-
if [ -z "$WORKTREE_PATH" ] || [ ! -d "$WORKTREE_PATH" ]; then
|
|
137
|
-
log_info "Step 1: Creating worktree..."
|
|
138
|
-
|
|
139
|
-
# Determine base_branch (PR target)
|
|
140
|
-
# Priority: 1) task.json configured value, 2) current branch
|
|
141
|
-
if [ -n "$CONFIGURED_BASE_BRANCH" ]; then
|
|
142
|
-
BASE_BRANCH="$CONFIGURED_BASE_BRANCH"
|
|
143
|
-
log_info "Base branch (from task.json): ${BASE_BRANCH}"
|
|
144
|
-
else
|
|
145
|
-
BASE_BRANCH=$(git -C "$PROJECT_ROOT" branch --show-current)
|
|
146
|
-
log_info "Base branch (current branch): ${BASE_BRANCH}"
|
|
147
|
-
fi
|
|
148
|
-
|
|
149
|
-
# Calculate worktree path
|
|
150
|
-
WORKTREE_BASE=$(get_worktree_base_dir "$PROJECT_ROOT")
|
|
151
|
-
mkdir -p "$WORKTREE_BASE"
|
|
152
|
-
WORKTREE_BASE="$(cd "$WORKTREE_BASE" && pwd)"
|
|
153
|
-
WORKTREE_PATH="${WORKTREE_BASE}/${BRANCH}"
|
|
154
|
-
|
|
155
|
-
# Create parent directory
|
|
156
|
-
mkdir -p "$(dirname "$WORKTREE_PATH")"
|
|
157
|
-
cd "$PROJECT_ROOT"
|
|
158
|
-
|
|
159
|
-
# Create branch if not exists
|
|
160
|
-
if git show-ref --verify --quiet "refs/heads/${BRANCH}"; then
|
|
161
|
-
log_info "Branch exists, checking out..."
|
|
162
|
-
git worktree add "$WORKTREE_PATH" "$BRANCH"
|
|
163
|
-
else
|
|
164
|
-
log_info "Creating new branch: $BRANCH"
|
|
165
|
-
git worktree add -b "$BRANCH" "$WORKTREE_PATH"
|
|
166
|
-
fi
|
|
167
|
-
|
|
168
|
-
log_success "Worktree created: ${WORKTREE_PATH}"
|
|
169
|
-
|
|
170
|
-
# Update task.json with worktree_path and base_branch
|
|
171
|
-
jq --arg path "$WORKTREE_PATH" --arg base "$BASE_BRANCH" \
|
|
172
|
-
'.worktree_path = $path | .base_branch = $base' "$TASK_JSON" > "${TASK_JSON}.tmp"
|
|
173
|
-
mv "${TASK_JSON}.tmp" "$TASK_JSON"
|
|
174
|
-
|
|
175
|
-
# ----- Copy environment files -----
|
|
176
|
-
log_info "Copying environment files..."
|
|
177
|
-
cd "$WORKTREE_PATH"
|
|
178
|
-
|
|
179
|
-
COPY_LIST=$(get_worktree_copy_files "$PROJECT_ROOT")
|
|
180
|
-
COPY_COUNT=0
|
|
181
|
-
|
|
182
|
-
while IFS= read -r item; do
|
|
183
|
-
[ -z "$item" ] && continue
|
|
184
|
-
|
|
185
|
-
SOURCE="${PROJECT_ROOT}/${item}"
|
|
186
|
-
TARGET="${WORKTREE_PATH}/${item}"
|
|
187
|
-
|
|
188
|
-
if [ -f "$SOURCE" ]; then
|
|
189
|
-
mkdir -p "$(dirname "$TARGET")"
|
|
190
|
-
cp "$SOURCE" "$TARGET"
|
|
191
|
-
((COPY_COUNT++))
|
|
192
|
-
fi
|
|
193
|
-
done <<< "$COPY_LIST"
|
|
194
|
-
|
|
195
|
-
if [ $COPY_COUNT -gt 0 ]; then
|
|
196
|
-
log_success "Copied $COPY_COUNT file(s)"
|
|
197
|
-
fi
|
|
198
|
-
|
|
199
|
-
# ----- Copy task directory (may not be committed yet) -----
|
|
200
|
-
log_info "Copying task directory..."
|
|
201
|
-
TASK_TARGET_DIR="${WORKTREE_PATH}/${TASK_DIR_RELATIVE}"
|
|
202
|
-
mkdir -p "$(dirname "$TASK_TARGET_DIR")"
|
|
203
|
-
cp -r "$TASK_DIR_ABS" "$(dirname "$TASK_TARGET_DIR")/"
|
|
204
|
-
log_success "Task directory copied to worktree"
|
|
205
|
-
|
|
206
|
-
# ----- Run post_create hooks -----
|
|
207
|
-
log_info "Running post_create hooks..."
|
|
208
|
-
|
|
209
|
-
POST_CREATE=$(get_worktree_post_create_hooks "$PROJECT_ROOT")
|
|
210
|
-
HOOK_COUNT=0
|
|
211
|
-
|
|
212
|
-
while IFS= read -r cmd; do
|
|
213
|
-
[ -z "$cmd" ] && continue
|
|
214
|
-
|
|
215
|
-
log_info " Running: $cmd"
|
|
216
|
-
if eval "$cmd"; then
|
|
217
|
-
((HOOK_COUNT++))
|
|
218
|
-
else
|
|
219
|
-
log_error "Hook failed: $cmd"
|
|
220
|
-
exit 1
|
|
221
|
-
fi
|
|
222
|
-
done <<< "$POST_CREATE"
|
|
223
|
-
|
|
224
|
-
if [ $HOOK_COUNT -gt 0 ]; then
|
|
225
|
-
log_success "Ran $HOOK_COUNT hook(s)"
|
|
226
|
-
fi
|
|
227
|
-
|
|
228
|
-
else
|
|
229
|
-
log_info "Step 1: Using existing worktree: ${WORKTREE_PATH}"
|
|
230
|
-
fi
|
|
231
|
-
|
|
232
|
-
# =============================================================================
|
|
233
|
-
# Step 2: Set .current-task in Worktree
|
|
234
|
-
# =============================================================================
|
|
235
|
-
log_info "Step 2: Setting current task in worktree..."
|
|
236
|
-
|
|
237
|
-
mkdir -p "${WORKTREE_PATH}/$DIR_WORKFLOW"
|
|
238
|
-
echo "$TASK_DIR_RELATIVE" > "${WORKTREE_PATH}/$DIR_WORKFLOW/$FILE_CURRENT_TASK"
|
|
239
|
-
log_success "Current task set: ${TASK_DIR_RELATIVE}"
|
|
240
|
-
|
|
241
|
-
# =============================================================================
|
|
242
|
-
# Step 3: Prepare and Start Claude Agent
|
|
243
|
-
# =============================================================================
|
|
244
|
-
log_info "Step 3: Starting Claude agent..."
|
|
245
|
-
|
|
246
|
-
# Update task status
|
|
247
|
-
jq '.status = "in_progress"' "$TASK_JSON" > "${TASK_JSON}.tmp"
|
|
248
|
-
mv "${TASK_JSON}.tmp" "$TASK_JSON"
|
|
249
|
-
|
|
250
|
-
cd "$WORKTREE_PATH"
|
|
251
|
-
|
|
252
|
-
LOG_FILE="${WORKTREE_PATH}/.agent-log"
|
|
253
|
-
RUNNER_SCRIPT="${WORKTREE_PATH}/.agent-runner.sh"
|
|
254
|
-
SESSION_ID_FILE="${WORKTREE_PATH}/.session-id"
|
|
255
|
-
|
|
256
|
-
touch "$LOG_FILE"
|
|
257
|
-
|
|
258
|
-
# Generate session ID for resume support
|
|
259
|
-
SESSION_ID=$(uuidgen | tr '[:upper:]' '[:lower:]')
|
|
260
|
-
echo "$SESSION_ID" > "$SESSION_ID_FILE"
|
|
261
|
-
log_info "Session ID: ${SESSION_ID}"
|
|
262
|
-
|
|
263
|
-
# Create runner script (uses --agent flag to load dispatch agent directly)
|
|
264
|
-
cat > "$RUNNER_SCRIPT" << RUNNER_EOF
|
|
265
|
-
#!/bin/bash
|
|
266
|
-
cd "\$(dirname "\$0")"
|
|
267
|
-
export https_proxy="\${AGENT_HTTPS_PROXY:-}"
|
|
268
|
-
export http_proxy="\${AGENT_HTTP_PROXY:-}"
|
|
269
|
-
export all_proxy="\${AGENT_ALL_PROXY:-}"
|
|
270
|
-
export CLAUDE_NON_INTERACTIVE=1
|
|
271
|
-
|
|
272
|
-
claude -p --agent dispatch --session-id "${SESSION_ID}" --dangerously-skip-permissions --output-format stream-json --verbose "Start the pipeline"
|
|
273
|
-
RUNNER_EOF
|
|
274
|
-
chmod +x "$RUNNER_SCRIPT"
|
|
275
|
-
|
|
276
|
-
# Start agent in background
|
|
277
|
-
AGENT_HTTPS_PROXY="${https_proxy:-}" \
|
|
278
|
-
AGENT_HTTP_PROXY="${http_proxy:-}" \
|
|
279
|
-
AGENT_ALL_PROXY="${all_proxy:-}" \
|
|
280
|
-
nohup "$RUNNER_SCRIPT" > "$LOG_FILE" 2>&1 &
|
|
281
|
-
AGENT_PID=$!
|
|
282
|
-
|
|
283
|
-
log_success "Agent started with PID: ${AGENT_PID}"
|
|
284
|
-
|
|
285
|
-
# =============================================================================
|
|
286
|
-
# Step 4: Register to Registry (in main repo, not worktree)
|
|
287
|
-
# =============================================================================
|
|
288
|
-
log_info "Step 4: Registering agent to registry..."
|
|
289
|
-
|
|
290
|
-
# Generate agent ID
|
|
291
|
-
TASK_ID=$(jq -r '.id // empty' "$TASK_JSON")
|
|
292
|
-
if [ -z "$TASK_ID" ]; then
|
|
293
|
-
TASK_ID=$(echo "$BRANCH" | sed 's/\//-/g')
|
|
294
|
-
fi
|
|
295
|
-
|
|
296
|
-
# Use common registry function
|
|
297
|
-
registry_add_agent "$TASK_ID" "$WORKTREE_PATH" "$AGENT_PID" "$TASK_DIR_RELATIVE" "$PROJECT_ROOT"
|
|
298
|
-
|
|
299
|
-
log_success "Agent registered: ${TASK_ID}"
|
|
300
|
-
|
|
301
|
-
# =============================================================================
|
|
302
|
-
# Summary
|
|
303
|
-
# =============================================================================
|
|
304
|
-
echo ""
|
|
305
|
-
echo -e "${GREEN}=== Agent Started ===${NC}"
|
|
306
|
-
echo ""
|
|
307
|
-
echo " ID: $TASK_ID"
|
|
308
|
-
echo " PID: $AGENT_PID"
|
|
309
|
-
echo " Session: $SESSION_ID"
|
|
310
|
-
echo " Worktree: $WORKTREE_PATH"
|
|
311
|
-
echo " Task: $TASK_DIR_RELATIVE"
|
|
312
|
-
echo " Log: $LOG_FILE"
|
|
313
|
-
echo " Registry: $(registry_get_file "$PROJECT_ROOT")"
|
|
314
|
-
echo ""
|
|
315
|
-
echo -e "${YELLOW}To monitor:${NC} tail -f $LOG_FILE"
|
|
316
|
-
echo -e "${YELLOW}To stop:${NC} kill $AGENT_PID"
|
|
317
|
-
echo -e "${YELLOW}To resume:${NC} cd $WORKTREE_PATH && claude --resume $SESSION_ID"
|