@mindfoldhq/trellis 0.4.0 → 0.5.0-beta.1
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 +0 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +2 -4
- 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 +83 -22
- 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 +142 -98
- 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 +3 -28
- package/dist/configurators/opencode.d.ts.map +1 -1
- package/dist/configurators/opencode.js +23 -48
- package/dist/configurators/opencode.js.map +1 -1
- package/dist/configurators/qoder.d.ts +6 -4
- package/dist/configurators/qoder.d.ts.map +1 -1
- package/dist/configurators/qoder.js +20 -47
- package/dist/configurators/qoder.js.map +1 -1
- package/dist/configurators/shared.d.ts +66 -3
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +251 -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 +1644 -0
- package/dist/templates/claude/agents/check.md +2 -29
- package/dist/templates/claude/agents/research.md +70 -52
- 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 +3 -4
- package/dist/templates/{iflow → codebuddy}/agents/check.md +3 -30
- package/dist/templates/{iflow → codebuddy}/agents/implement.md +1 -1
- package/dist/templates/codebuddy/agents/research.md +138 -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/research.toml +50 -16
- 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/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/{codebuddy/commands/trellis → common/skills}/brainstorm.md +4 -4
- package/dist/templates/{opencode/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/cursor/agents/check.md +95 -0
- package/dist/templates/cursor/agents/implement.md +95 -0
- package/dist/templates/cursor/agents/research.md +138 -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/check.md +95 -0
- package/dist/templates/droid/droids/implement.md +95 -0
- package/dist/templates/droid/droids/research.md +138 -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/check.md +95 -0
- package/dist/templates/gemini/agents/implement.md +95 -0
- package/dist/templates/gemini/agents/research.md +138 -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/check.json +13 -0
- package/dist/templates/kiro/agents/implement.json +13 -0
- package/dist/templates/kiro/agents/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 +3 -30
- package/dist/templates/opencode/agents/implement.md +1 -1
- package/dist/templates/opencode/agents/research.md +1 -2
- package/dist/templates/opencode/plugins/inject-subagent-context.js +9 -183
- package/dist/templates/opencode/plugins/inject-workflow-state.js +160 -0
- package/dist/templates/opencode/plugins/session-start.js +71 -32
- package/dist/templates/qoder/agents/check.md +95 -0
- package/dist/templates/qoder/agents/implement.md +95 -0
- package/dist/templates/qoder/agents/research.md +138 -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 +74 -263
- package/dist/templates/shared-hooks/inject-workflow-state.py +231 -0
- package/dist/templates/{claude/hooks → shared-hooks}/session-start.py +162 -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/index.d.ts +1 -14
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +2 -27
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/common/cli_adapter.py +2 -2
- 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 +3 -23
- package/dist/templates/trellis/scripts/common/task_store.py +0 -12
- package/dist/templates/trellis/scripts/common/workflow_phase.py +176 -0
- package/dist/templates/trellis/scripts/task.py +6 -35
- package/dist/templates/trellis/workflow.md +274 -297
- package/dist/types/ai-tools.d.ts +21 -3
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +106 -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/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/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/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/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/brainstorm.md +0 -491
- 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/break-loop.md +0 -125
- 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/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/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/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,396 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# =============================================================================
|
|
3
|
-
# Multi-Agent Pipeline: Cleanup Worktree
|
|
4
|
-
# =============================================================================
|
|
5
|
-
# Usage:
|
|
6
|
-
# ./cleanup.sh <branch-name> Remove specific worktree
|
|
7
|
-
# ./cleanup.sh --list List all worktrees
|
|
8
|
-
# ./cleanup.sh --merged Remove merged worktrees
|
|
9
|
-
# ./cleanup.sh --all Remove all worktrees (with confirmation)
|
|
10
|
-
#
|
|
11
|
-
# Options:
|
|
12
|
-
# -y, --yes Skip confirmation prompts
|
|
13
|
-
# --keep-branch Don't delete the git branch
|
|
14
|
-
#
|
|
15
|
-
# This script:
|
|
16
|
-
# 1. Archives task directory to archive/{YYYY-MM}/
|
|
17
|
-
# 2. Removes agent from registry
|
|
18
|
-
# 3. Removes git worktree
|
|
19
|
-
# 4. Optionally deletes git branch
|
|
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/task-queue.sh"
|
|
29
|
-
source "$SCRIPT_DIR/../common/task-utils.sh"
|
|
30
|
-
source "$SCRIPT_DIR/../common/registry.sh"
|
|
31
|
-
|
|
32
|
-
# Colors
|
|
33
|
-
RED='\033[0;31m'
|
|
34
|
-
GREEN='\033[0;32m'
|
|
35
|
-
YELLOW='\033[1;33m'
|
|
36
|
-
BLUE='\033[0;34m'
|
|
37
|
-
NC='\033[0m'
|
|
38
|
-
|
|
39
|
-
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
|
40
|
-
log_success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; }
|
|
41
|
-
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
|
42
|
-
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
|
43
|
-
|
|
44
|
-
PROJECT_ROOT=$(get_repo_root)
|
|
45
|
-
SKIP_CONFIRM=false
|
|
46
|
-
KEEP_BRANCH=false
|
|
47
|
-
|
|
48
|
-
# =============================================================================
|
|
49
|
-
# Parse Arguments
|
|
50
|
-
# =============================================================================
|
|
51
|
-
POSITIONAL_ARGS=()
|
|
52
|
-
while [[ $# -gt 0 ]]; do
|
|
53
|
-
case $1 in
|
|
54
|
-
-y|--yes)
|
|
55
|
-
SKIP_CONFIRM=true
|
|
56
|
-
shift
|
|
57
|
-
;;
|
|
58
|
-
--keep-branch)
|
|
59
|
-
KEEP_BRANCH=true
|
|
60
|
-
shift
|
|
61
|
-
;;
|
|
62
|
-
--list|--merged|--all)
|
|
63
|
-
ACTION="${1#--}"
|
|
64
|
-
shift
|
|
65
|
-
;;
|
|
66
|
-
-*)
|
|
67
|
-
log_error "Unknown option: $1"
|
|
68
|
-
exit 1
|
|
69
|
-
;;
|
|
70
|
-
*)
|
|
71
|
-
POSITIONAL_ARGS+=("$1")
|
|
72
|
-
shift
|
|
73
|
-
;;
|
|
74
|
-
esac
|
|
75
|
-
done
|
|
76
|
-
|
|
77
|
-
# =============================================================================
|
|
78
|
-
# List Worktrees
|
|
79
|
-
# =============================================================================
|
|
80
|
-
cmd_list() {
|
|
81
|
-
echo -e "${BLUE}=== Git Worktrees ===${NC}"
|
|
82
|
-
echo ""
|
|
83
|
-
|
|
84
|
-
cd "$PROJECT_ROOT"
|
|
85
|
-
git worktree list
|
|
86
|
-
|
|
87
|
-
echo ""
|
|
88
|
-
|
|
89
|
-
# Show registry info
|
|
90
|
-
local registry_file=$(registry_get_file "$PROJECT_ROOT")
|
|
91
|
-
|
|
92
|
-
if [ -f "$registry_file" ]; then
|
|
93
|
-
echo -e "${BLUE}=== Registered Agents ===${NC}"
|
|
94
|
-
echo ""
|
|
95
|
-
jq -r '.agents[] | " \(.id): PID=\(.pid) [\(.worktree_path)]"' "$registry_file" 2>/dev/null || echo " (none)"
|
|
96
|
-
echo ""
|
|
97
|
-
fi
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
# =============================================================================
|
|
101
|
-
# Archive Task (using common function)
|
|
102
|
-
# =============================================================================
|
|
103
|
-
archive_task() {
|
|
104
|
-
local worktree_path="$1"
|
|
105
|
-
|
|
106
|
-
# Find task directory from registry
|
|
107
|
-
local task_dir=$(registry_get_task_dir "$worktree_path" "$PROJECT_ROOT")
|
|
108
|
-
|
|
109
|
-
# Validate task path is safe
|
|
110
|
-
if ! is_safe_task_path "$task_dir" "$PROJECT_ROOT" 2>/dev/null; then
|
|
111
|
-
return 0
|
|
112
|
-
fi
|
|
113
|
-
|
|
114
|
-
local task_dir_abs="${PROJECT_ROOT}/${task_dir}"
|
|
115
|
-
if [ ! -d "$task_dir_abs" ]; then
|
|
116
|
-
return 0
|
|
117
|
-
fi
|
|
118
|
-
|
|
119
|
-
# Use common archive function
|
|
120
|
-
local result=$(archive_task_complete "$task_dir_abs" "$PROJECT_ROOT")
|
|
121
|
-
|
|
122
|
-
# Parse result and log
|
|
123
|
-
echo "$result" | while IFS= read -r line; do
|
|
124
|
-
case "$line" in
|
|
125
|
-
task_completed:*)
|
|
126
|
-
log_info "Completed task: ${line#task_completed:}"
|
|
127
|
-
;;
|
|
128
|
-
archived_to:*)
|
|
129
|
-
local dest="${line#archived_to:}"
|
|
130
|
-
local task_name=$(basename "$dest")
|
|
131
|
-
local month_dir=$(dirname "$dest")
|
|
132
|
-
log_success "Archived task: $task_name -> $(basename "$month_dir")/"
|
|
133
|
-
;;
|
|
134
|
-
esac
|
|
135
|
-
done
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
# =============================================================================
|
|
139
|
-
# Cleanup from Registry Only (no worktree)
|
|
140
|
-
# =============================================================================
|
|
141
|
-
cleanup_registry_only() {
|
|
142
|
-
local search="$1"
|
|
143
|
-
|
|
144
|
-
# Find agent using registry function
|
|
145
|
-
local agent_info=$(registry_search_agent "$search" "$PROJECT_ROOT")
|
|
146
|
-
|
|
147
|
-
if [ -z "$agent_info" ]; then
|
|
148
|
-
log_error "No agent found in registry matching: $search"
|
|
149
|
-
exit 1
|
|
150
|
-
fi
|
|
151
|
-
|
|
152
|
-
local agent_id=$(echo "$agent_info" | jq -r '.id')
|
|
153
|
-
local task_dir=$(echo "$agent_info" | jq -r '.task_dir')
|
|
154
|
-
|
|
155
|
-
echo ""
|
|
156
|
-
echo -e "${BLUE}=== Cleanup Agent (no worktree) ===${NC}"
|
|
157
|
-
echo " Agent ID: $agent_id"
|
|
158
|
-
echo " Task Dir: $task_dir"
|
|
159
|
-
echo ""
|
|
160
|
-
|
|
161
|
-
# Confirmation
|
|
162
|
-
if [ "$SKIP_CONFIRM" != "true" ]; then
|
|
163
|
-
if [ -t 0 ]; then
|
|
164
|
-
read -p "Archive task and remove from registry? [y/N] " -n 1 -r
|
|
165
|
-
echo
|
|
166
|
-
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
167
|
-
log_info "Aborted"
|
|
168
|
-
exit 0
|
|
169
|
-
fi
|
|
170
|
-
else
|
|
171
|
-
log_error "Non-interactive mode detected. Use -y to skip confirmation."
|
|
172
|
-
exit 1
|
|
173
|
-
fi
|
|
174
|
-
fi
|
|
175
|
-
|
|
176
|
-
# 1. Archive task directory if exists
|
|
177
|
-
# Validate task path is safe
|
|
178
|
-
if ! is_safe_task_path "$task_dir" "$PROJECT_ROOT" 2>/dev/null; then
|
|
179
|
-
log_warn "Invalid task_dir in registry, skipping archive"
|
|
180
|
-
else
|
|
181
|
-
local task_dir_abs="${PROJECT_ROOT}/${task_dir}"
|
|
182
|
-
if [ -d "$task_dir_abs" ]; then
|
|
183
|
-
local result=$(archive_task_complete "$task_dir_abs" "$PROJECT_ROOT")
|
|
184
|
-
|
|
185
|
-
echo "$result" | while IFS= read -r line; do
|
|
186
|
-
case "$line" in
|
|
187
|
-
task_completed:*)
|
|
188
|
-
log_info "Completed task: ${line#task_completed:}"
|
|
189
|
-
;;
|
|
190
|
-
archived_to:*)
|
|
191
|
-
local dest="${line#archived_to:}"
|
|
192
|
-
local task_name=$(basename "$dest")
|
|
193
|
-
log_success "Archived task: $task_name -> archive/$(basename "$(dirname "$dest")")/"
|
|
194
|
-
;;
|
|
195
|
-
esac
|
|
196
|
-
done
|
|
197
|
-
fi
|
|
198
|
-
fi
|
|
199
|
-
|
|
200
|
-
# 2. Remove from registry
|
|
201
|
-
registry_remove_by_id "$agent_id" "$PROJECT_ROOT"
|
|
202
|
-
log_success "Removed from registry: $agent_id"
|
|
203
|
-
|
|
204
|
-
log_success "Cleanup complete"
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
# =============================================================================
|
|
208
|
-
# Cleanup Single Worktree
|
|
209
|
-
# =============================================================================
|
|
210
|
-
cleanup_worktree() {
|
|
211
|
-
local branch="$1"
|
|
212
|
-
|
|
213
|
-
cd "$PROJECT_ROOT"
|
|
214
|
-
|
|
215
|
-
# Find worktree path for branch
|
|
216
|
-
# porcelain format: worktree line comes BEFORE branch line, so use -B2
|
|
217
|
-
local worktree_info=$(git worktree list --porcelain | grep -B2 "branch refs/heads/$branch" | head -3)
|
|
218
|
-
local worktree_path=$(echo "$worktree_info" | grep "^worktree " | cut -d' ' -f2-)
|
|
219
|
-
|
|
220
|
-
if [ -z "$worktree_path" ]; then
|
|
221
|
-
# No worktree found, try to cleanup from registry only
|
|
222
|
-
log_warn "No worktree found for: $branch"
|
|
223
|
-
log_info "Trying to cleanup from registry..."
|
|
224
|
-
cleanup_registry_only "$branch"
|
|
225
|
-
return
|
|
226
|
-
fi
|
|
227
|
-
|
|
228
|
-
echo ""
|
|
229
|
-
echo -e "${BLUE}=== Cleanup Worktree ===${NC}"
|
|
230
|
-
echo " Branch: $branch"
|
|
231
|
-
echo " Worktree: $worktree_path"
|
|
232
|
-
echo ""
|
|
233
|
-
|
|
234
|
-
# Confirmation
|
|
235
|
-
if [ "$SKIP_CONFIRM" != "true" ]; then
|
|
236
|
-
# Check if running interactively
|
|
237
|
-
if [ -t 0 ]; then
|
|
238
|
-
read -p "Remove this worktree? [y/N] " -n 1 -r
|
|
239
|
-
echo
|
|
240
|
-
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
241
|
-
log_info "Aborted"
|
|
242
|
-
exit 0
|
|
243
|
-
fi
|
|
244
|
-
else
|
|
245
|
-
log_error "Non-interactive mode detected. Use -y to skip confirmation."
|
|
246
|
-
exit 1
|
|
247
|
-
fi
|
|
248
|
-
fi
|
|
249
|
-
|
|
250
|
-
# 1. Archive task
|
|
251
|
-
archive_task "$worktree_path"
|
|
252
|
-
|
|
253
|
-
# 2. Remove from registry
|
|
254
|
-
registry_remove_by_worktree "$worktree_path" "$PROJECT_ROOT"
|
|
255
|
-
log_info "Removed from registry"
|
|
256
|
-
|
|
257
|
-
# 3. Remove worktree
|
|
258
|
-
log_info "Removing worktree..."
|
|
259
|
-
git worktree remove "$worktree_path" --force 2>/dev/null || rm -rf "$worktree_path"
|
|
260
|
-
log_success "Worktree removed"
|
|
261
|
-
|
|
262
|
-
# 4. Delete branch (optional)
|
|
263
|
-
if [ "$KEEP_BRANCH" != "true" ]; then
|
|
264
|
-
log_info "Deleting branch..."
|
|
265
|
-
git branch -D "$branch" 2>/dev/null || log_warn "Could not delete branch (may be checked out elsewhere)"
|
|
266
|
-
fi
|
|
267
|
-
|
|
268
|
-
log_success "Cleanup complete for: $branch"
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
# =============================================================================
|
|
272
|
-
# Cleanup Merged Worktrees
|
|
273
|
-
# =============================================================================
|
|
274
|
-
cmd_merged() {
|
|
275
|
-
cd "$PROJECT_ROOT"
|
|
276
|
-
|
|
277
|
-
local main_branch=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main")
|
|
278
|
-
|
|
279
|
-
echo -e "${BLUE}=== Finding Merged Worktrees ===${NC}"
|
|
280
|
-
echo ""
|
|
281
|
-
|
|
282
|
-
local merged_branches=$(git branch --merged "$main_branch" | grep -v "^\*" | grep -v "$main_branch" | tr -d ' ')
|
|
283
|
-
|
|
284
|
-
if [ -z "$merged_branches" ]; then
|
|
285
|
-
log_info "No merged branches found"
|
|
286
|
-
exit 0
|
|
287
|
-
fi
|
|
288
|
-
|
|
289
|
-
local worktree_branches=""
|
|
290
|
-
while IFS= read -r branch; do
|
|
291
|
-
if git worktree list | grep -q "\[$branch\]"; then
|
|
292
|
-
worktree_branches="$worktree_branches $branch"
|
|
293
|
-
echo " - $branch"
|
|
294
|
-
fi
|
|
295
|
-
done <<< "$merged_branches"
|
|
296
|
-
|
|
297
|
-
if [ -z "$worktree_branches" ]; then
|
|
298
|
-
log_info "No merged worktrees found"
|
|
299
|
-
exit 0
|
|
300
|
-
fi
|
|
301
|
-
|
|
302
|
-
echo ""
|
|
303
|
-
|
|
304
|
-
if [ "$SKIP_CONFIRM" != "true" ]; then
|
|
305
|
-
if [ -t 0 ]; then
|
|
306
|
-
read -p "Remove these merged worktrees? [y/N] " -n 1 -r
|
|
307
|
-
echo
|
|
308
|
-
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
309
|
-
log_info "Aborted"
|
|
310
|
-
exit 0
|
|
311
|
-
fi
|
|
312
|
-
else
|
|
313
|
-
log_error "Non-interactive mode detected. Use -y to skip confirmation."
|
|
314
|
-
exit 1
|
|
315
|
-
fi
|
|
316
|
-
fi
|
|
317
|
-
|
|
318
|
-
for branch in $worktree_branches; do
|
|
319
|
-
cleanup_worktree "$branch"
|
|
320
|
-
done
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
# =============================================================================
|
|
324
|
-
# Cleanup All Worktrees
|
|
325
|
-
# =============================================================================
|
|
326
|
-
cmd_all() {
|
|
327
|
-
cd "$PROJECT_ROOT"
|
|
328
|
-
|
|
329
|
-
echo -e "${BLUE}=== All Worktrees ===${NC}"
|
|
330
|
-
echo ""
|
|
331
|
-
|
|
332
|
-
local worktrees=$(git worktree list --porcelain | grep "^worktree " | grep -v "$PROJECT_ROOT$" | cut -d' ' -f2-)
|
|
333
|
-
|
|
334
|
-
if [ -z "$worktrees" ]; then
|
|
335
|
-
log_info "No worktrees to remove"
|
|
336
|
-
exit 0
|
|
337
|
-
fi
|
|
338
|
-
|
|
339
|
-
while IFS= read -r wt; do
|
|
340
|
-
echo " - $wt"
|
|
341
|
-
done <<< "$worktrees"
|
|
342
|
-
|
|
343
|
-
echo ""
|
|
344
|
-
|
|
345
|
-
if [ "$SKIP_CONFIRM" != "true" ]; then
|
|
346
|
-
if [ -t 0 ]; then
|
|
347
|
-
echo -e "${RED}WARNING: This will remove ALL worktrees!${NC}"
|
|
348
|
-
read -p "Are you sure? [y/N] " -n 1 -r
|
|
349
|
-
echo
|
|
350
|
-
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
351
|
-
log_info "Aborted"
|
|
352
|
-
exit 0
|
|
353
|
-
fi
|
|
354
|
-
else
|
|
355
|
-
log_error "Non-interactive mode detected. Use -y to skip confirmation."
|
|
356
|
-
exit 1
|
|
357
|
-
fi
|
|
358
|
-
fi
|
|
359
|
-
|
|
360
|
-
while IFS= read -r wt; do
|
|
361
|
-
local branch=$(git worktree list | grep "$wt" | awk '{print $NF}' | tr -d '[]')
|
|
362
|
-
if [ -n "$branch" ]; then
|
|
363
|
-
cleanup_worktree "$branch"
|
|
364
|
-
fi
|
|
365
|
-
done <<< "$worktrees"
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
# =============================================================================
|
|
369
|
-
# Main
|
|
370
|
-
# =============================================================================
|
|
371
|
-
case "${ACTION:-}" in
|
|
372
|
-
list)
|
|
373
|
-
cmd_list
|
|
374
|
-
;;
|
|
375
|
-
merged)
|
|
376
|
-
cmd_merged
|
|
377
|
-
;;
|
|
378
|
-
all)
|
|
379
|
-
cmd_all
|
|
380
|
-
;;
|
|
381
|
-
*)
|
|
382
|
-
if [ ${#POSITIONAL_ARGS[@]} -eq 0 ]; then
|
|
383
|
-
echo "Usage:"
|
|
384
|
-
echo " $0 <branch-name> Remove specific worktree"
|
|
385
|
-
echo " $0 --list List all worktrees"
|
|
386
|
-
echo " $0 --merged Remove merged worktrees"
|
|
387
|
-
echo " $0 --all Remove all worktrees"
|
|
388
|
-
echo ""
|
|
389
|
-
echo "Options:"
|
|
390
|
-
echo " -y, --yes Skip confirmation"
|
|
391
|
-
echo " --keep-branch Don't delete git branch"
|
|
392
|
-
exit 1
|
|
393
|
-
fi
|
|
394
|
-
cleanup_worktree "${POSITIONAL_ARGS[0]}"
|
|
395
|
-
;;
|
|
396
|
-
esac
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# =============================================================================
|
|
3
|
-
# Multi-Agent Pipeline: Create PR
|
|
4
|
-
# =============================================================================
|
|
5
|
-
# Usage:
|
|
6
|
-
# ./create-pr.sh [task-dir] [--dry-run]
|
|
7
|
-
#
|
|
8
|
-
# This script:
|
|
9
|
-
# 1. Stages and commits all changes (excluding workspace/)
|
|
10
|
-
# 2. Pushes to origin
|
|
11
|
-
# 3. Creates a Draft PR using `gh pr create`
|
|
12
|
-
# 4. Updates task.json with status="completed", pr_url, and current_phase
|
|
13
|
-
#
|
|
14
|
-
# Note: This is the only action that performs git commit, as it's the final
|
|
15
|
-
# step after all implementation and checks are complete.
|
|
16
|
-
# =============================================================================
|
|
17
|
-
|
|
18
|
-
set -e
|
|
19
|
-
|
|
20
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
21
|
-
source "$SCRIPT_DIR/../common/paths.sh"
|
|
22
|
-
source "$SCRIPT_DIR/../common/phase.sh"
|
|
23
|
-
|
|
24
|
-
# Colors
|
|
25
|
-
RED='\033[0;31m'
|
|
26
|
-
GREEN='\033[0;32m'
|
|
27
|
-
YELLOW='\033[1;33m'
|
|
28
|
-
BLUE='\033[0;34m'
|
|
29
|
-
NC='\033[0m'
|
|
30
|
-
|
|
31
|
-
REPO_ROOT=$(get_repo_root)
|
|
32
|
-
|
|
33
|
-
# =============================================================================
|
|
34
|
-
# Parse Arguments
|
|
35
|
-
# =============================================================================
|
|
36
|
-
TARGET_DIR=""
|
|
37
|
-
DRY_RUN=false
|
|
38
|
-
|
|
39
|
-
while [[ $# -gt 0 ]]; do
|
|
40
|
-
case "$1" in
|
|
41
|
-
--dry-run)
|
|
42
|
-
DRY_RUN=true
|
|
43
|
-
shift
|
|
44
|
-
;;
|
|
45
|
-
-h|--help)
|
|
46
|
-
echo "Usage: $0 [task-dir] [--dry-run]"
|
|
47
|
-
echo ""
|
|
48
|
-
echo "Options:"
|
|
49
|
-
echo " --dry-run Show what would be done without making changes"
|
|
50
|
-
echo " -h, --help Show this help message"
|
|
51
|
-
exit 0
|
|
52
|
-
;;
|
|
53
|
-
*)
|
|
54
|
-
if [[ -z "$TARGET_DIR" ]]; then
|
|
55
|
-
TARGET_DIR="$1"
|
|
56
|
-
fi
|
|
57
|
-
shift
|
|
58
|
-
;;
|
|
59
|
-
esac
|
|
60
|
-
done
|
|
61
|
-
|
|
62
|
-
# =============================================================================
|
|
63
|
-
# Get Task Directory
|
|
64
|
-
# =============================================================================
|
|
65
|
-
if [[ -z "$TARGET_DIR" ]]; then
|
|
66
|
-
# Try to get from .current-task
|
|
67
|
-
CURRENT_TASK_FILE="$REPO_ROOT/.trellis/.current-task"
|
|
68
|
-
if [[ -f "$CURRENT_TASK_FILE" ]]; then
|
|
69
|
-
TARGET_DIR=$(cat "$CURRENT_TASK_FILE")
|
|
70
|
-
fi
|
|
71
|
-
|
|
72
|
-
if [[ -z "$TARGET_DIR" ]]; then
|
|
73
|
-
echo -e "${RED}Error: No task directory specified and no current task set${NC}"
|
|
74
|
-
echo "Usage: $0 [task-dir] [--dry-run]"
|
|
75
|
-
exit 1
|
|
76
|
-
fi
|
|
77
|
-
fi
|
|
78
|
-
|
|
79
|
-
# Support relative paths
|
|
80
|
-
if [[ ! "$TARGET_DIR" = /* ]]; then
|
|
81
|
-
TARGET_DIR="$REPO_ROOT/$TARGET_DIR"
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
TASK_JSON="$TARGET_DIR/task.json"
|
|
85
|
-
if [[ ! -f "$TASK_JSON" ]]; then
|
|
86
|
-
echo -e "${RED}Error: task.json not found at $TARGET_DIR${NC}"
|
|
87
|
-
exit 1
|
|
88
|
-
fi
|
|
89
|
-
|
|
90
|
-
# =============================================================================
|
|
91
|
-
# Main
|
|
92
|
-
# =============================================================================
|
|
93
|
-
echo -e "${BLUE}=== Create PR ===${NC}"
|
|
94
|
-
if [[ "$DRY_RUN" == "true" ]]; then
|
|
95
|
-
echo -e "${YELLOW}[DRY-RUN MODE] No actual changes will be made${NC}"
|
|
96
|
-
fi
|
|
97
|
-
echo ""
|
|
98
|
-
|
|
99
|
-
# Read task config
|
|
100
|
-
TASK_NAME=$(jq -r '.name' "$TASK_JSON")
|
|
101
|
-
BASE_BRANCH=$(jq -r '.base_branch // "main"' "$TASK_JSON")
|
|
102
|
-
SCOPE=$(jq -r '.scope // "core"' "$TASK_JSON")
|
|
103
|
-
DEV_TYPE=$(jq -r '.dev_type // "feature"' "$TASK_JSON")
|
|
104
|
-
|
|
105
|
-
# Map dev_type to commit prefix
|
|
106
|
-
case "$DEV_TYPE" in
|
|
107
|
-
feature|frontend|backend|fullstack) COMMIT_PREFIX="feat" ;;
|
|
108
|
-
bugfix|fix) COMMIT_PREFIX="fix" ;;
|
|
109
|
-
refactor) COMMIT_PREFIX="refactor" ;;
|
|
110
|
-
docs) COMMIT_PREFIX="docs" ;;
|
|
111
|
-
test) COMMIT_PREFIX="test" ;;
|
|
112
|
-
*) COMMIT_PREFIX="feat" ;;
|
|
113
|
-
esac
|
|
114
|
-
|
|
115
|
-
echo -e "Task: ${TASK_NAME}"
|
|
116
|
-
echo -e "Base branch: ${BASE_BRANCH}"
|
|
117
|
-
echo -e "Scope: ${SCOPE}"
|
|
118
|
-
echo -e "Commit prefix: ${COMMIT_PREFIX}"
|
|
119
|
-
echo ""
|
|
120
|
-
|
|
121
|
-
# Get current branch
|
|
122
|
-
CURRENT_BRANCH=$(git branch --show-current)
|
|
123
|
-
echo -e "Current branch: ${CURRENT_BRANCH}"
|
|
124
|
-
|
|
125
|
-
# Check for changes
|
|
126
|
-
echo -e "${YELLOW}Checking for changes...${NC}"
|
|
127
|
-
|
|
128
|
-
# Stage changes (even in dry-run to detect what would be committed)
|
|
129
|
-
git add -A
|
|
130
|
-
|
|
131
|
-
# Exclude workspace and temp files
|
|
132
|
-
git reset ".trellis/workspace/" 2>/dev/null || true
|
|
133
|
-
git reset .agent-log .agent-runner.sh 2>/dev/null || true
|
|
134
|
-
|
|
135
|
-
# Check if there are staged changes
|
|
136
|
-
if git diff --cached --quiet 2>/dev/null; then
|
|
137
|
-
echo -e "${YELLOW}No staged changes to commit${NC}"
|
|
138
|
-
|
|
139
|
-
# Check for unpushed commits
|
|
140
|
-
UNPUSHED=$(git log "origin/${CURRENT_BRANCH}..HEAD" --oneline 2>/dev/null | wc -l | tr -d ' ' || echo "0")
|
|
141
|
-
if [[ "$UNPUSHED" -eq 0 ]] 2>/dev/null; then
|
|
142
|
-
# In dry-run, also reset the staging
|
|
143
|
-
if [[ "$DRY_RUN" == "true" ]]; then
|
|
144
|
-
git reset HEAD >/dev/null 2>&1 || true
|
|
145
|
-
fi
|
|
146
|
-
echo -e "${RED}No changes to create PR${NC}"
|
|
147
|
-
exit 1
|
|
148
|
-
fi
|
|
149
|
-
echo -e "Found ${UNPUSHED} unpushed commit(s)"
|
|
150
|
-
else
|
|
151
|
-
# Commit changes
|
|
152
|
-
echo -e "${YELLOW}Committing changes...${NC}"
|
|
153
|
-
COMMIT_MSG="${COMMIT_PREFIX}(${SCOPE}): ${TASK_NAME}"
|
|
154
|
-
|
|
155
|
-
if [[ "$DRY_RUN" == "true" ]]; then
|
|
156
|
-
echo -e "[DRY-RUN] Would commit with message: ${COMMIT_MSG}"
|
|
157
|
-
echo -e "[DRY-RUN] Staged files:"
|
|
158
|
-
git diff --cached --name-only | sed 's/^/ - /'
|
|
159
|
-
else
|
|
160
|
-
git commit -m "$COMMIT_MSG"
|
|
161
|
-
echo -e "${GREEN}Committed: ${COMMIT_MSG}${NC}"
|
|
162
|
-
fi
|
|
163
|
-
fi
|
|
164
|
-
|
|
165
|
-
# Push to remote
|
|
166
|
-
echo -e "${YELLOW}Pushing to remote...${NC}"
|
|
167
|
-
if [[ "$DRY_RUN" == "true" ]]; then
|
|
168
|
-
echo -e "[DRY-RUN] Would push to: origin/${CURRENT_BRANCH}"
|
|
169
|
-
else
|
|
170
|
-
git push -u origin "$CURRENT_BRANCH"
|
|
171
|
-
echo -e "${GREEN}Pushed to origin/${CURRENT_BRANCH}${NC}"
|
|
172
|
-
fi
|
|
173
|
-
|
|
174
|
-
# Create PR
|
|
175
|
-
echo -e "${YELLOW}Creating PR...${NC}"
|
|
176
|
-
PR_TITLE="${COMMIT_PREFIX}(${SCOPE}): ${TASK_NAME}"
|
|
177
|
-
PR_URL=""
|
|
178
|
-
|
|
179
|
-
if [[ "$DRY_RUN" == "true" ]]; then
|
|
180
|
-
echo -e "[DRY-RUN] Would create PR:"
|
|
181
|
-
echo -e " Title: ${PR_TITLE}"
|
|
182
|
-
echo -e " Base: ${BASE_BRANCH}"
|
|
183
|
-
echo -e " Head: ${CURRENT_BRANCH}"
|
|
184
|
-
if [[ -f "$TARGET_DIR/prd.md" ]]; then
|
|
185
|
-
echo -e " Body: (from prd.md)"
|
|
186
|
-
fi
|
|
187
|
-
PR_URL="https://github.com/example/repo/pull/DRY-RUN"
|
|
188
|
-
else
|
|
189
|
-
# Check if PR already exists
|
|
190
|
-
EXISTING_PR=$(gh pr list --head "$CURRENT_BRANCH" --base "$BASE_BRANCH" --json url --jq '.[0].url' 2>/dev/null || echo "")
|
|
191
|
-
|
|
192
|
-
if [[ -n "$EXISTING_PR" ]]; then
|
|
193
|
-
echo -e "${YELLOW}PR already exists: ${EXISTING_PR}${NC}"
|
|
194
|
-
PR_URL="$EXISTING_PR"
|
|
195
|
-
else
|
|
196
|
-
# Read PRD as PR body
|
|
197
|
-
PR_BODY=""
|
|
198
|
-
if [[ -f "$TARGET_DIR/prd.md" ]]; then
|
|
199
|
-
PR_BODY=$(cat "$TARGET_DIR/prd.md")
|
|
200
|
-
fi
|
|
201
|
-
|
|
202
|
-
# Create PR
|
|
203
|
-
PR_URL=$(gh pr create \
|
|
204
|
-
--draft \
|
|
205
|
-
--base "$BASE_BRANCH" \
|
|
206
|
-
--title "$PR_TITLE" \
|
|
207
|
-
--body "$PR_BODY" \
|
|
208
|
-
2>&1)
|
|
209
|
-
|
|
210
|
-
echo -e "${GREEN}PR created: ${PR_URL}${NC}"
|
|
211
|
-
fi
|
|
212
|
-
fi
|
|
213
|
-
|
|
214
|
-
# Update task.json
|
|
215
|
-
echo -e "${YELLOW}Updating task status...${NC}"
|
|
216
|
-
if [[ "$DRY_RUN" == "true" ]]; then
|
|
217
|
-
echo -e "[DRY-RUN] Would update task.json:"
|
|
218
|
-
echo -e " status: completed"
|
|
219
|
-
echo -e " pr_url: ${PR_URL}"
|
|
220
|
-
echo -e " current_phase: (set to create-pr phase)"
|
|
221
|
-
else
|
|
222
|
-
# Get the phase number for create-pr action using common/phase.sh
|
|
223
|
-
CREATE_PR_PHASE=$(get_phase_for_action "$TASK_JSON" "create-pr")
|
|
224
|
-
if [[ -z "$CREATE_PR_PHASE" ]] || [[ "$CREATE_PR_PHASE" == "0" ]]; then
|
|
225
|
-
CREATE_PR_PHASE=4 # Default fallback
|
|
226
|
-
fi
|
|
227
|
-
|
|
228
|
-
jq --arg url "$PR_URL" --argjson phase "$CREATE_PR_PHASE" \
|
|
229
|
-
'.status = "completed" | .pr_url = $url | .current_phase = $phase' "$TASK_JSON" > "${TASK_JSON}.tmp"
|
|
230
|
-
mv "${TASK_JSON}.tmp" "$TASK_JSON"
|
|
231
|
-
echo -e "${GREEN}Task status updated to 'completed', phase ${CREATE_PR_PHASE}${NC}"
|
|
232
|
-
fi
|
|
233
|
-
|
|
234
|
-
# In dry-run, reset the staging area
|
|
235
|
-
if [[ "$DRY_RUN" == "true" ]]; then
|
|
236
|
-
git reset HEAD >/dev/null 2>&1 || true
|
|
237
|
-
fi
|
|
238
|
-
|
|
239
|
-
echo ""
|
|
240
|
-
echo -e "${GREEN}=== PR Created Successfully ===${NC}"
|
|
241
|
-
echo -e "PR URL: ${PR_URL}"
|