@jahanxu/trellis 0.4.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/LICENSE +235 -0
- package/README.md +212 -0
- package/bin/trellis.js +3 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +97 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/init.d.ts +21 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +527 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/update.d.ts +27 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +1289 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/configurators/antigravity.d.ts +8 -0
- package/dist/configurators/antigravity.d.ts.map +1 -0
- package/dist/configurators/antigravity.js +18 -0
- package/dist/configurators/antigravity.js.map +1 -0
- package/dist/configurators/claude.d.ts +32 -0
- package/dist/configurators/claude.d.ts.map +1 -0
- package/dist/configurators/claude.js +98 -0
- package/dist/configurators/claude.js.map +1 -0
- package/dist/configurators/codex.d.ts +8 -0
- package/dist/configurators/codex.d.ts.map +1 -0
- package/dist/configurators/codex.js +20 -0
- package/dist/configurators/codex.js.map +1 -0
- package/dist/configurators/cursor.d.ts +5 -0
- package/dist/configurators/cursor.d.ts.map +1 -0
- package/dist/configurators/cursor.js +52 -0
- package/dist/configurators/cursor.js.map +1 -0
- package/dist/configurators/gemini.d.ts +8 -0
- package/dist/configurators/gemini.d.ts.map +1 -0
- package/dist/configurators/gemini.js +52 -0
- package/dist/configurators/gemini.js.map +1 -0
- package/dist/configurators/iflow.d.ts +33 -0
- package/dist/configurators/iflow.d.ts.map +1 -0
- package/dist/configurators/iflow.js +99 -0
- package/dist/configurators/iflow.js.map +1 -0
- package/dist/configurators/index.d.ts +55 -0
- package/dist/configurators/index.d.ts.map +1 -0
- package/dist/configurators/index.js +220 -0
- package/dist/configurators/index.js.map +1 -0
- package/dist/configurators/kilo.d.ts +8 -0
- package/dist/configurators/kilo.d.ts.map +1 -0
- package/dist/configurators/kilo.js +51 -0
- package/dist/configurators/kilo.js.map +1 -0
- package/dist/configurators/kiro.d.ts +8 -0
- package/dist/configurators/kiro.d.ts.map +1 -0
- package/dist/configurators/kiro.js +20 -0
- package/dist/configurators/kiro.js.map +1 -0
- package/dist/configurators/opencode.d.ts +32 -0
- package/dist/configurators/opencode.d.ts.map +1 -0
- package/dist/configurators/opencode.js +92 -0
- package/dist/configurators/opencode.js.map +1 -0
- package/dist/configurators/shared.d.ts +12 -0
- package/dist/configurators/shared.d.ts.map +1 -0
- package/dist/configurators/shared.js +21 -0
- package/dist/configurators/shared.js.map +1 -0
- package/dist/configurators/workflow.d.ts +28 -0
- package/dist/configurators/workflow.d.ts.map +1 -0
- package/dist/configurators/workflow.js +134 -0
- package/dist/configurators/workflow.js.map +1 -0
- package/dist/constants/paths.d.ts +68 -0
- package/dist/constants/paths.d.ts.map +1 -0
- package/dist/constants/paths.js +77 -0
- package/dist/constants/paths.js.map +1 -0
- package/dist/constants/version.d.ts +9 -0
- package/dist/constants/version.d.ts.map +1 -0
- package/dist/constants/version.js +15 -0
- package/dist/constants/version.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/index.d.ts +54 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +160 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/manifests/0.1.9.json +30 -0
- package/dist/migrations/manifests/0.2.0.json +49 -0
- package/dist/migrations/manifests/0.2.12.json +9 -0
- package/dist/migrations/manifests/0.2.13.json +9 -0
- package/dist/migrations/manifests/0.2.14.json +175 -0
- package/dist/migrations/manifests/0.2.15.json +33 -0
- package/dist/migrations/manifests/0.3.0-beta.0.json +278 -0
- package/dist/migrations/manifests/0.3.0-beta.1.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.15.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.5.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.6.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.7.json +11 -0
- package/dist/migrations/manifests/0.3.0-beta.8.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.9.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.0.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.1.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.2.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.3.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.4.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.5.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.6.json +9 -0
- package/dist/migrations/manifests/0.3.0.json +11 -0
- package/dist/templates/antigravity/index.d.ts +12 -0
- package/dist/templates/antigravity/index.d.ts.map +1 -0
- package/dist/templates/antigravity/index.js +29 -0
- package/dist/templates/antigravity/index.js.map +1 -0
- package/dist/templates/claude/agents/check.md +122 -0
- package/dist/templates/claude/agents/debug.md +106 -0
- package/dist/templates/claude/agents/dispatch.md +214 -0
- package/dist/templates/claude/agents/implement.md +96 -0
- package/dist/templates/claude/agents/plan.md +396 -0
- package/dist/templates/claude/agents/research.md +120 -0
- package/dist/templates/claude/commands/trellis/before-backend-dev.md +13 -0
- package/dist/templates/claude/commands/trellis/before-frontend-dev.md +13 -0
- package/dist/templates/claude/commands/trellis/before-role-work.md +364 -0
- package/dist/templates/claude/commands/trellis/brainstorm.md +474 -0
- package/dist/templates/claude/commands/trellis/break-loop.md +125 -0
- package/dist/templates/claude/commands/trellis/check-backend.md +13 -0
- package/dist/templates/claude/commands/trellis/check-cross-layer.md +153 -0
- package/dist/templates/claude/commands/trellis/check-frontend.md +13 -0
- package/dist/templates/claude/commands/trellis/create-command.md +154 -0
- package/dist/templates/claude/commands/trellis/finish-work.md +153 -0
- package/dist/templates/claude/commands/trellis/handoff.md +445 -0
- package/dist/templates/claude/commands/trellis/integrate-skill.md +219 -0
- package/dist/templates/claude/commands/trellis/onboard.md +358 -0
- package/dist/templates/claude/commands/trellis/parallel.md +193 -0
- package/dist/templates/claude/commands/trellis/pick-task.md +515 -0
- package/dist/templates/claude/commands/trellis/record-session.md +62 -0
- package/dist/templates/claude/commands/trellis/start.md +373 -0
- package/dist/templates/claude/commands/trellis/update-spec.md +354 -0
- package/dist/templates/claude/hooks/inject-subagent-context.py +873 -0
- package/dist/templates/claude/hooks/ralph-loop.py +388 -0
- package/dist/templates/claude/hooks/session-start.py +200 -0
- package/dist/templates/claude/index.d.ts +54 -0
- package/dist/templates/claude/index.d.ts.map +1 -0
- package/dist/templates/claude/index.js +85 -0
- package/dist/templates/claude/index.js.map +1 -0
- package/dist/templates/claude/settings.json +41 -0
- package/dist/templates/codex/index.d.ts +18 -0
- package/dist/templates/codex/index.d.ts.map +1 -0
- package/dist/templates/codex/index.js +40 -0
- package/dist/templates/codex/index.js.map +1 -0
- package/dist/templates/codex/skills/before-backend-dev/SKILL.md +18 -0
- package/dist/templates/codex/skills/before-frontend-dev/SKILL.md +18 -0
- package/dist/templates/codex/skills/brainstorm/SKILL.md +479 -0
- package/dist/templates/codex/skills/break-loop/SKILL.md +130 -0
- package/dist/templates/codex/skills/check-backend/SKILL.md +18 -0
- package/dist/templates/codex/skills/check-cross-layer/SKILL.md +158 -0
- package/dist/templates/codex/skills/check-frontend/SKILL.md +18 -0
- package/dist/templates/codex/skills/create-command/SKILL.md +101 -0
- package/dist/templates/codex/skills/finish-work/SKILL.md +148 -0
- package/dist/templates/codex/skills/integrate-skill/SKILL.md +221 -0
- package/dist/templates/codex/skills/onboard/SKILL.md +363 -0
- package/dist/templates/codex/skills/record-session/SKILL.md +67 -0
- package/dist/templates/codex/skills/start/SKILL.md +330 -0
- package/dist/templates/codex/skills/update-spec/SKILL.md +335 -0
- package/dist/templates/cursor/commands/trellis-before-backend-dev.md +13 -0
- package/dist/templates/cursor/commands/trellis-before-frontend-dev.md +13 -0
- package/dist/templates/cursor/commands/trellis-brainstorm.md +474 -0
- package/dist/templates/cursor/commands/trellis-break-loop.md +107 -0
- package/dist/templates/cursor/commands/trellis-check-backend.md +13 -0
- package/dist/templates/cursor/commands/trellis-check-cross-layer.md +153 -0
- package/dist/templates/cursor/commands/trellis-check-frontend.md +13 -0
- package/dist/templates/cursor/commands/trellis-create-command.md +154 -0
- package/dist/templates/cursor/commands/trellis-finish-work.md +143 -0
- package/dist/templates/cursor/commands/trellis-integrate-skill.md +219 -0
- package/dist/templates/cursor/commands/trellis-onboard.md +358 -0
- package/dist/templates/cursor/commands/trellis-record-session.md +62 -0
- package/dist/templates/cursor/commands/trellis-start.md +366 -0
- package/dist/templates/cursor/commands/trellis-update-spec.md +354 -0
- package/dist/templates/cursor/index.d.ts +24 -0
- package/dist/templates/cursor/index.d.ts.map +1 -0
- package/dist/templates/cursor/index.js +44 -0
- package/dist/templates/cursor/index.js.map +1 -0
- package/dist/templates/extract.d.ts +166 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +296 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/gemini/commands/trellis/before-backend-dev.toml +17 -0
- package/dist/templates/gemini/commands/trellis/before-frontend-dev.toml +17 -0
- package/dist/templates/gemini/commands/trellis/brainstorm.toml +420 -0
- package/dist/templates/gemini/commands/trellis/break-loop.toml +129 -0
- package/dist/templates/gemini/commands/trellis/check-backend.toml +17 -0
- package/dist/templates/gemini/commands/trellis/check-cross-layer.toml +147 -0
- package/dist/templates/gemini/commands/trellis/check-frontend.toml +17 -0
- package/dist/templates/gemini/commands/trellis/create-command.toml +119 -0
- package/dist/templates/gemini/commands/trellis/finish-work.toml +133 -0
- package/dist/templates/gemini/commands/trellis/integrate-skill.toml +104 -0
- package/dist/templates/gemini/commands/trellis/onboard.toml +111 -0
- package/dist/templates/gemini/commands/trellis/record-session.toml +66 -0
- package/dist/templates/gemini/commands/trellis/start.toml +292 -0
- package/dist/templates/gemini/commands/trellis/update-spec.toml +132 -0
- package/dist/templates/gemini/index.d.ts +21 -0
- package/dist/templates/gemini/index.d.ts.map +1 -0
- package/dist/templates/gemini/index.js +44 -0
- package/dist/templates/gemini/index.js.map +1 -0
- package/dist/templates/iflow/agents/check.md +122 -0
- package/dist/templates/iflow/agents/debug.md +106 -0
- package/dist/templates/iflow/agents/dispatch.md +214 -0
- package/dist/templates/iflow/agents/implement.md +96 -0
- package/dist/templates/iflow/agents/plan.md +396 -0
- package/dist/templates/iflow/agents/research.md +120 -0
- package/dist/templates/iflow/commands/trellis/before-backend-dev.md +13 -0
- package/dist/templates/iflow/commands/trellis/before-frontend-dev.md +13 -0
- package/dist/templates/iflow/commands/trellis/brainstorm.md +474 -0
- package/dist/templates/iflow/commands/trellis/break-loop.md +125 -0
- package/dist/templates/iflow/commands/trellis/check-backend.md +13 -0
- package/dist/templates/iflow/commands/trellis/check-cross-layer.md +153 -0
- package/dist/templates/iflow/commands/trellis/check-frontend.md +13 -0
- package/dist/templates/iflow/commands/trellis/create-command.md +152 -0
- package/dist/templates/iflow/commands/trellis/finish-work.md +153 -0
- package/dist/templates/iflow/commands/trellis/integrate-skill.md +219 -0
- package/dist/templates/iflow/commands/trellis/onboard.md +358 -0
- package/dist/templates/iflow/commands/trellis/parallel.md +193 -0
- package/dist/templates/iflow/commands/trellis/record-session.md +62 -0
- package/dist/templates/iflow/commands/trellis/start.md +373 -0
- package/dist/templates/iflow/commands/trellis/update-spec.md +354 -0
- package/dist/templates/iflow/hooks/inject-subagent-context.py +788 -0
- package/dist/templates/iflow/hooks/ralph-loop.py +388 -0
- package/dist/templates/iflow/hooks/session-start.py +143 -0
- package/dist/templates/iflow/index.d.ts +54 -0
- package/dist/templates/iflow/index.d.ts.map +1 -0
- package/dist/templates/iflow/index.js +85 -0
- package/dist/templates/iflow/index.js.map +1 -0
- package/dist/templates/iflow/settings.json +40 -0
- package/dist/templates/kilo/commands/trellis/before-backend-dev.md +13 -0
- package/dist/templates/kilo/commands/trellis/before-frontend-dev.md +13 -0
- package/dist/templates/kilo/commands/trellis/brainstorm.md +474 -0
- package/dist/templates/kilo/commands/trellis/break-loop.md +125 -0
- package/dist/templates/kilo/commands/trellis/check-backend.md +13 -0
- package/dist/templates/kilo/commands/trellis/check-cross-layer.md +153 -0
- package/dist/templates/kilo/commands/trellis/check-frontend.md +13 -0
- package/dist/templates/kilo/commands/trellis/create-command.md +152 -0
- package/dist/templates/kilo/commands/trellis/finish-work.md +129 -0
- package/dist/templates/kilo/commands/trellis/integrate-skill.md +219 -0
- package/dist/templates/kilo/commands/trellis/onboard.md +358 -0
- package/dist/templates/kilo/commands/trellis/parallel.md +194 -0
- package/dist/templates/kilo/commands/trellis/record-session.md +62 -0
- package/dist/templates/kilo/commands/trellis/start.md +321 -0
- package/dist/templates/kilo/commands/trellis/update-spec.md +285 -0
- package/dist/templates/kilo/index.d.ts +16 -0
- package/dist/templates/kilo/index.d.ts.map +1 -0
- package/dist/templates/kilo/index.js +39 -0
- package/dist/templates/kilo/index.js.map +1 -0
- package/dist/templates/kiro/index.d.ts +18 -0
- package/dist/templates/kiro/index.d.ts.map +1 -0
- package/dist/templates/kiro/index.js +40 -0
- package/dist/templates/kiro/index.js.map +1 -0
- package/dist/templates/kiro/skills/before-backend-dev/SKILL.md +18 -0
- package/dist/templates/kiro/skills/before-frontend-dev/SKILL.md +18 -0
- package/dist/templates/kiro/skills/brainstorm/SKILL.md +479 -0
- package/dist/templates/kiro/skills/break-loop/SKILL.md +130 -0
- package/dist/templates/kiro/skills/check-backend/SKILL.md +18 -0
- package/dist/templates/kiro/skills/check-cross-layer/SKILL.md +158 -0
- package/dist/templates/kiro/skills/check-frontend/SKILL.md +18 -0
- package/dist/templates/kiro/skills/create-command/SKILL.md +101 -0
- package/dist/templates/kiro/skills/finish-work/SKILL.md +148 -0
- package/dist/templates/kiro/skills/integrate-skill/SKILL.md +221 -0
- package/dist/templates/kiro/skills/onboard/SKILL.md +363 -0
- package/dist/templates/kiro/skills/record-session/SKILL.md +67 -0
- package/dist/templates/kiro/skills/start/SKILL.md +330 -0
- package/dist/templates/kiro/skills/update-spec/SKILL.md +335 -0
- package/dist/templates/markdown/agents.md +18 -0
- package/dist/templates/markdown/gitignore.txt +12 -0
- package/dist/templates/markdown/index.d.ts +27 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +52 -0
- package/dist/templates/markdown/index.js.map +1 -0
- package/dist/templates/markdown/spec/backend/database-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/backend/error-handling.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/index.md +40 -0
- package/dist/templates/markdown/spec/backend/index.md.txt +38 -0
- package/dist/templates/markdown/spec/backend/logging-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/script-conventions.md +467 -0
- package/dist/templates/markdown/spec/frontend/component-guidelines.md.txt +59 -0
- package/dist/templates/markdown/spec/frontend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/frontend/hook-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/index.md.txt +39 -0
- package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/state-management.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/type-safety.md.txt +51 -0
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md +118 -0
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +92 -0
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +94 -0
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md +394 -0
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +319 -0
- package/dist/templates/markdown/spec/guides/index.md.txt +79 -0
- package/dist/templates/markdown/workspace-index.md +123 -0
- package/dist/templates/markdown/worktree.yaml.txt +58 -0
- package/dist/templates/opencode/agents/check.md +146 -0
- package/dist/templates/opencode/agents/debug.md +129 -0
- package/dist/templates/opencode/agents/dispatch.md +223 -0
- package/dist/templates/opencode/agents/implement.md +120 -0
- package/dist/templates/opencode/agents/research.md +147 -0
- package/dist/templates/opencode/agents/trellis-plan.md +427 -0
- package/dist/templates/opencode/commands/trellis/before-backend-dev.md +13 -0
- package/dist/templates/opencode/commands/trellis/before-frontend-dev.md +13 -0
- package/dist/templates/opencode/commands/trellis/brainstorm.md +474 -0
- package/dist/templates/opencode/commands/trellis/break-loop.md +125 -0
- package/dist/templates/opencode/commands/trellis/check-backend.md +13 -0
- package/dist/templates/opencode/commands/trellis/check-cross-layer.md +153 -0
- package/dist/templates/opencode/commands/trellis/check-frontend.md +13 -0
- package/dist/templates/opencode/commands/trellis/create-command.md +154 -0
- package/dist/templates/opencode/commands/trellis/finish-work.md +144 -0
- package/dist/templates/opencode/commands/trellis/integrate-skill.md +219 -0
- package/dist/templates/opencode/commands/trellis/migrate-specs.md +0 -0
- package/dist/templates/opencode/commands/trellis/onboard.md +358 -0
- package/dist/templates/opencode/commands/trellis/parallel.md +194 -0
- package/dist/templates/opencode/commands/trellis/record-session.md +62 -0
- package/dist/templates/opencode/commands/trellis/start.md +338 -0
- package/dist/templates/opencode/commands/trellis/update-spec.md +354 -0
- package/dist/templates/opencode/lib/trellis-context.js +436 -0
- package/dist/templates/opencode/package.json +5 -0
- package/dist/templates/opencode/plugin/inject-subagent-context.js +538 -0
- package/dist/templates/opencode/plugin/session-start.js +192 -0
- package/dist/templates/trellis/VERSION +1 -0
- package/dist/templates/trellis/deliverables/README.md +51 -0
- package/dist/templates/trellis/gitignore.txt +29 -0
- package/dist/templates/trellis/index.d.ts +49 -0
- package/dist/templates/trellis/index.d.ts.map +1 -0
- package/dist/templates/trellis/index.js +92 -0
- package/dist/templates/trellis/index.js.map +1 -0
- package/dist/templates/trellis/paths.README.md +277 -0
- package/dist/templates/trellis/paths.yaml +41 -0
- package/dist/templates/trellis/pool/implementations.json +5 -0
- package/dist/templates/trellis/pool/prototypes.json +5 -0
- package/dist/templates/trellis/pool/requirements.json +5 -0
- package/dist/templates/trellis/scripts/__init__.py +5 -0
- package/dist/templates/trellis/scripts/add_session.py +391 -0
- package/dist/templates/trellis/scripts/common/__init__.py +80 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +522 -0
- package/dist/templates/trellis/scripts/common/developer.py +189 -0
- package/dist/templates/trellis/scripts/common/git_context.py +383 -0
- package/dist/templates/trellis/scripts/common/paths.py +346 -0
- package/dist/templates/trellis/scripts/common/phase.py +253 -0
- package/dist/templates/trellis/scripts/common/project_paths.py +189 -0
- package/dist/templates/trellis/scripts/common/registry.py +365 -0
- package/dist/templates/trellis/scripts/common/task_queue.py +255 -0
- package/dist/templates/trellis/scripts/common/task_utils.py +177 -0
- package/dist/templates/trellis/scripts/common/worktree.py +218 -0
- package/dist/templates/trellis/scripts/create_bootstrap.py +290 -0
- package/dist/templates/trellis/scripts/get_context.py +16 -0
- package/dist/templates/trellis/scripts/get_developer.py +26 -0
- package/dist/templates/trellis/scripts/handoff_generator.py +380 -0
- package/dist/templates/trellis/scripts/init_developer.py +51 -0
- package/dist/templates/trellis/scripts/multi_agent/__init__.py +5 -0
- package/dist/templates/trellis/scripts/multi_agent/cleanup.py +403 -0
- package/dist/templates/trellis/scripts/multi_agent/create_pr.py +329 -0
- package/dist/templates/trellis/scripts/multi_agent/plan.py +233 -0
- package/dist/templates/trellis/scripts/multi_agent/start.py +461 -0
- package/dist/templates/trellis/scripts/multi_agent/status.py +817 -0
- package/dist/templates/trellis/scripts/pool.py +373 -0
- package/dist/templates/trellis/scripts/task.py +1162 -0
- package/dist/templates/trellis/scripts-shell-archive/add-session.sh +384 -0
- package/dist/templates/trellis/scripts-shell-archive/common/developer.sh +129 -0
- package/dist/templates/trellis/scripts-shell-archive/common/git-context.sh +263 -0
- package/dist/templates/trellis/scripts-shell-archive/common/paths.sh +208 -0
- package/dist/templates/trellis/scripts-shell-archive/common/phase.sh +150 -0
- package/dist/templates/trellis/scripts-shell-archive/common/registry.sh +247 -0
- package/dist/templates/trellis/scripts-shell-archive/common/task-queue.sh +142 -0
- package/dist/templates/trellis/scripts-shell-archive/common/task-utils.sh +151 -0
- package/dist/templates/trellis/scripts-shell-archive/common/worktree.sh +128 -0
- package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +299 -0
- package/dist/templates/trellis/scripts-shell-archive/get-context.sh +7 -0
- package/dist/templates/trellis/scripts-shell-archive/get-developer.sh +15 -0
- package/dist/templates/trellis/scripts-shell-archive/init-developer.sh +34 -0
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/cleanup.sh +396 -0
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/create-pr.sh +241 -0
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/plan.sh +207 -0
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/start.sh +317 -0
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/status.sh +828 -0
- package/dist/templates/trellis/scripts-shell-archive/task.sh +1204 -0
- package/dist/templates/trellis/spec/roles/designer/index.md +243 -0
- package/dist/templates/trellis/spec/roles/designer/mock-data-standards.md +481 -0
- package/dist/templates/trellis/spec/roles/designer/prototype-guidelines.md +429 -0
- package/dist/templates/trellis/spec/roles/frontend-impl/api-integration.md +565 -0
- package/dist/templates/trellis/spec/roles/frontend-impl/index.md +321 -0
- package/dist/templates/trellis/spec/roles/frontend-impl/state-management.md +599 -0
- package/dist/templates/trellis/spec/roles/pm/index.md +112 -0
- package/dist/templates/trellis/spec/roles/pm/prd-template.md +124 -0
- package/dist/templates/trellis/tasks/.gitkeep +0 -0
- package/dist/templates/trellis/workflow.md +416 -0
- package/dist/templates/trellis/worktree.yaml +47 -0
- package/dist/types/ai-tools.d.ts +56 -0
- package/dist/types/ai-tools.d.ts.map +1 -0
- package/dist/types/ai-tools.js +103 -0
- package/dist/types/ai-tools.js.map +1 -0
- package/dist/types/migration.d.ts +86 -0
- package/dist/types/migration.d.ts.map +1 -0
- package/dist/types/migration.js +8 -0
- package/dist/types/migration.js.map +1 -0
- package/dist/utils/compare-versions.d.ts +12 -0
- package/dist/utils/compare-versions.d.ts.map +1 -0
- package/dist/utils/compare-versions.js +76 -0
- package/dist/utils/compare-versions.js.map +1 -0
- package/dist/utils/file-writer.d.ts +23 -0
- package/dist/utils/file-writer.d.ts.map +1 -0
- package/dist/utils/file-writer.js +140 -0
- package/dist/utils/file-writer.js.map +1 -0
- package/dist/utils/project-detector.d.ts +16 -0
- package/dist/utils/project-detector.d.ts.map +1 -0
- package/dist/utils/project-detector.js +186 -0
- package/dist/utils/project-detector.js.map +1 -0
- package/dist/utils/template-fetcher.d.ts +51 -0
- package/dist/utils/template-fetcher.d.ts.map +1 -0
- package/dist/utils/template-fetcher.js +174 -0
- package/dist/utils/template-fetcher.js.map +1 -0
- package/dist/utils/template-hash.d.ts +78 -0
- package/dist/utils/template-hash.d.ts.map +1 -0
- package/dist/utils/template-hash.js +233 -0
- package/dist/utils/template-hash.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
description = "Guide AI through collaborative requirements discovery before implementation"
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
# Brainstorm - Requirements Discovery (AI Coding Enhanced)
|
|
5
|
+
|
|
6
|
+
Guide AI through collaborative requirements discovery **before implementation**, optimized for AI coding workflows:
|
|
7
|
+
|
|
8
|
+
* **Task-first** (capture ideas immediately)
|
|
9
|
+
* **Action-before-asking** (reduce low-value questions)
|
|
10
|
+
* **Research-first** for technical choices (avoid asking users to invent options)
|
|
11
|
+
* **Diverge -> Converge** (expand thinking, then lock MVP)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
Triggered from `/trellis:start` when the user describes a development task, especially when:
|
|
18
|
+
|
|
19
|
+
* requirements are unclear or evolving
|
|
20
|
+
* there are multiple valid implementation paths
|
|
21
|
+
* trade-offs matter (UX, reliability, maintainability, cost, performance)
|
|
22
|
+
* the user might not know the best options up front
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Core Principles (Non-negotiable)
|
|
27
|
+
|
|
28
|
+
1. **Task-first (capture early)**
|
|
29
|
+
Always ensure a task exists at the start so the user's ideas are recorded immediately.
|
|
30
|
+
|
|
31
|
+
2. **Action before asking**
|
|
32
|
+
If you can derive the answer from repo code, docs, configs, conventions, or quick research -- do that first.
|
|
33
|
+
|
|
34
|
+
3. **One question per message**
|
|
35
|
+
Never overwhelm the user with a list of questions. Ask one, update PRD, repeat.
|
|
36
|
+
|
|
37
|
+
4. **Prefer concrete options**
|
|
38
|
+
For preference/decision questions, present 2-3 feasible, specific approaches with trade-offs.
|
|
39
|
+
|
|
40
|
+
5. **Research-first for technical choices**
|
|
41
|
+
If the decision depends on industry conventions / similar tools / established patterns, do research first, then propose options.
|
|
42
|
+
|
|
43
|
+
6. **Diverge -> Converge**
|
|
44
|
+
After initial understanding, proactively consider future evolution, related scenarios, and failure/edge cases -- then converge to an MVP with explicit out-of-scope.
|
|
45
|
+
|
|
46
|
+
7. **No meta questions**
|
|
47
|
+
Do not ask "should I search?" or "can you paste the code so I can continue?"
|
|
48
|
+
If you need information: search/inspect. If blocked: ask the minimal blocking question.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Step 0: Ensure Task Exists (ALWAYS)
|
|
53
|
+
|
|
54
|
+
Before any Q&A, ensure a task exists. If none exists, create one immediately.
|
|
55
|
+
|
|
56
|
+
* Use a **temporary working title** derived from the user's message.
|
|
57
|
+
* It's OK if the title is imperfect -- refine later in PRD.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
TASK_DIR=$(python3 ./.trellis/scripts/task.py create "brainstorm: <short goal>" --slug <auto>)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Create/seed `prd.md` immediately with what you know:
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
# brainstorm: <short goal>
|
|
67
|
+
|
|
68
|
+
## Goal
|
|
69
|
+
|
|
70
|
+
<one paragraph: what + why>
|
|
71
|
+
|
|
72
|
+
## What I already know
|
|
73
|
+
|
|
74
|
+
* <facts from user message>
|
|
75
|
+
* <facts discovered from repo/docs>
|
|
76
|
+
|
|
77
|
+
## Assumptions (temporary)
|
|
78
|
+
|
|
79
|
+
* <assumptions to validate>
|
|
80
|
+
|
|
81
|
+
## Open Questions
|
|
82
|
+
|
|
83
|
+
* <ONLY Blocking / Preference questions; keep list short>
|
|
84
|
+
|
|
85
|
+
## Requirements (evolving)
|
|
86
|
+
|
|
87
|
+
* <start with what is known>
|
|
88
|
+
|
|
89
|
+
## Acceptance Criteria (evolving)
|
|
90
|
+
|
|
91
|
+
* [ ] <testable criterion>
|
|
92
|
+
|
|
93
|
+
## Definition of Done (team quality bar)
|
|
94
|
+
|
|
95
|
+
* Tests added/updated (unit/integration where appropriate)
|
|
96
|
+
* Lint / typecheck / CI green
|
|
97
|
+
* Docs/notes updated if behavior changes
|
|
98
|
+
* Rollout/rollback considered if risky
|
|
99
|
+
|
|
100
|
+
## Out of Scope (explicit)
|
|
101
|
+
|
|
102
|
+
* <what we will not do in this task>
|
|
103
|
+
|
|
104
|
+
## Technical Notes
|
|
105
|
+
|
|
106
|
+
* <files inspected, constraints, links, references>
|
|
107
|
+
* <research notes summary if applicable>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Step 1: Auto-Context (DO THIS BEFORE ASKING QUESTIONS)
|
|
113
|
+
|
|
114
|
+
Before asking questions like "what does the code look like?", gather context yourself:
|
|
115
|
+
|
|
116
|
+
### Repo inspection checklist
|
|
117
|
+
|
|
118
|
+
* Identify likely modules/files impacted
|
|
119
|
+
* Locate existing patterns (similar features, conventions, error handling style)
|
|
120
|
+
* Check configs, scripts, existing command definitions
|
|
121
|
+
* Note any constraints (runtime, dependency policy, build tooling)
|
|
122
|
+
|
|
123
|
+
### Documentation checklist
|
|
124
|
+
|
|
125
|
+
* Look for existing PRDs/specs/templates
|
|
126
|
+
* Look for command usage examples, README, ADRs if any
|
|
127
|
+
|
|
128
|
+
Write findings into PRD:
|
|
129
|
+
|
|
130
|
+
* Add to `What I already know`
|
|
131
|
+
* Add constraints/links to `Technical Notes`
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Step 2: Classify Complexity (still useful, not gating task creation)
|
|
136
|
+
|
|
137
|
+
| Complexity | Criteria | Action |
|
|
138
|
+
| ------------ | ------------------------------------------------------ | ------------------------------------------- |
|
|
139
|
+
| **Trivial** | Single-line fix, typo, obvious change | Skip brainstorm, implement directly |
|
|
140
|
+
| **Simple** | Clear goal, 1-2 files, scope well-defined | Ask 1 confirm question, then implement |
|
|
141
|
+
| **Moderate** | Multiple files, some ambiguity | Light brainstorm (2-3 high-value questions) |
|
|
142
|
+
| **Complex** | Vague goal, architectural choices, multiple approaches | Full brainstorm |
|
|
143
|
+
|
|
144
|
+
> Note: Task already exists from Step 0. Classification only affects depth of brainstorming.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Step 3: Question Gate (Ask ONLY high-value questions)
|
|
149
|
+
|
|
150
|
+
Before asking ANY question, run the following gate:
|
|
151
|
+
|
|
152
|
+
### Gate A -- Can I derive this without the user?
|
|
153
|
+
|
|
154
|
+
If answer is available via:
|
|
155
|
+
|
|
156
|
+
* repo inspection (code/config)
|
|
157
|
+
* docs/specs/conventions
|
|
158
|
+
* quick market/OSS research
|
|
159
|
+
|
|
160
|
+
-> **Do not ask.** Fetch it, summarize, update PRD.
|
|
161
|
+
|
|
162
|
+
### Gate B -- Is this a meta/lazy question?
|
|
163
|
+
|
|
164
|
+
Examples:
|
|
165
|
+
|
|
166
|
+
* "Should I search?"
|
|
167
|
+
* "Can you paste the code so I can proceed?"
|
|
168
|
+
* "What does the code look like?" (when repo is available)
|
|
169
|
+
|
|
170
|
+
-> **Do not ask.** Take action.
|
|
171
|
+
|
|
172
|
+
### Gate C -- What type of question is it?
|
|
173
|
+
|
|
174
|
+
* **Blocking**: cannot proceed without user input
|
|
175
|
+
* **Preference**: multiple valid choices, depends on product/UX/risk preference
|
|
176
|
+
* **Derivable**: should be answered by inspection/research
|
|
177
|
+
|
|
178
|
+
-> Only ask **Blocking** or **Preference**.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Step 4: Research-first Mode (Mandatory for technical choices)
|
|
183
|
+
|
|
184
|
+
### Trigger conditions (any -> research-first)
|
|
185
|
+
|
|
186
|
+
* The task involves selecting an approach, library, protocol, framework, template system, plugin mechanism, or CLI UX convention
|
|
187
|
+
* The user asks for "best practice", "how others do it", "recommendation"
|
|
188
|
+
* The user can't reasonably enumerate options
|
|
189
|
+
|
|
190
|
+
### Research steps
|
|
191
|
+
|
|
192
|
+
1. Identify 2-4 comparable tools/patterns
|
|
193
|
+
2. Summarize common conventions and why they exist
|
|
194
|
+
3. Map conventions onto our repo constraints
|
|
195
|
+
4. Produce **2-3 feasible approaches** for our project
|
|
196
|
+
|
|
197
|
+
### Research output format (PRD)
|
|
198
|
+
|
|
199
|
+
Add a section in PRD (either within Technical Notes or as its own):
|
|
200
|
+
|
|
201
|
+
```markdown
|
|
202
|
+
## Research Notes
|
|
203
|
+
|
|
204
|
+
### What similar tools do
|
|
205
|
+
|
|
206
|
+
* ...
|
|
207
|
+
* ...
|
|
208
|
+
|
|
209
|
+
### Constraints from our repo/project
|
|
210
|
+
|
|
211
|
+
* ...
|
|
212
|
+
|
|
213
|
+
### Feasible approaches here
|
|
214
|
+
|
|
215
|
+
**Approach A: <name>** (Recommended)
|
|
216
|
+
|
|
217
|
+
* How it works:
|
|
218
|
+
* Pros:
|
|
219
|
+
* Cons:
|
|
220
|
+
|
|
221
|
+
**Approach B: <name>**
|
|
222
|
+
|
|
223
|
+
* How it works:
|
|
224
|
+
* Pros:
|
|
225
|
+
* Cons:
|
|
226
|
+
|
|
227
|
+
**Approach C: <name>** (optional)
|
|
228
|
+
|
|
229
|
+
* ...
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Then ask **one** preference question:
|
|
233
|
+
|
|
234
|
+
* "Which approach do you prefer: A / B / C (or other)?"
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Step 5: Expansion Sweep (DIVERGE) -- Required after initial understanding
|
|
239
|
+
|
|
240
|
+
After you can summarize the goal, proactively broaden thinking before converging.
|
|
241
|
+
|
|
242
|
+
### Expansion categories (keep to 1-2 bullets each)
|
|
243
|
+
|
|
244
|
+
1. **Future evolution**
|
|
245
|
+
|
|
246
|
+
* What might this feature become in 1-3 months?
|
|
247
|
+
* What extension points are worth preserving now?
|
|
248
|
+
|
|
249
|
+
2. **Related scenarios**
|
|
250
|
+
|
|
251
|
+
* What adjacent commands/flows should remain consistent with this?
|
|
252
|
+
* Are there parity expectations (create vs update, import vs export, etc.)?
|
|
253
|
+
|
|
254
|
+
3. **Failure & edge cases**
|
|
255
|
+
|
|
256
|
+
* Conflicts, offline/network failure, retries, idempotency, compatibility, rollback
|
|
257
|
+
* Input validation, security boundaries, permission checks
|
|
258
|
+
|
|
259
|
+
### Expansion message template (to user)
|
|
260
|
+
|
|
261
|
+
```markdown
|
|
262
|
+
I understand you want to implement: <current goal>.
|
|
263
|
+
|
|
264
|
+
Before diving into design, let me quickly diverge to consider three categories (to avoid rework later):
|
|
265
|
+
|
|
266
|
+
1. Future evolution: <1-2 bullets>
|
|
267
|
+
2. Related scenarios: <1-2 bullets>
|
|
268
|
+
3. Failure/edge cases: <1-2 bullets>
|
|
269
|
+
|
|
270
|
+
For this MVP, which would you like to include (or none)?
|
|
271
|
+
|
|
272
|
+
1. Current requirement only (minimal viable)
|
|
273
|
+
2. Add <X> (reserve for future extension)
|
|
274
|
+
3. Add <Y> (improve robustness/consistency)
|
|
275
|
+
4. Other: describe your preference
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Then update PRD:
|
|
279
|
+
|
|
280
|
+
* What's in MVP -> `Requirements`
|
|
281
|
+
* What's excluded -> `Out of Scope`
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Step 6: Q&A Loop (CONVERGE)
|
|
286
|
+
|
|
287
|
+
### Rules
|
|
288
|
+
|
|
289
|
+
* One question per message
|
|
290
|
+
* Prefer multiple-choice when possible
|
|
291
|
+
* After each user answer:
|
|
292
|
+
|
|
293
|
+
* Update PRD immediately
|
|
294
|
+
* Move answered items from `Open Questions` -> `Requirements`
|
|
295
|
+
* Update `Acceptance Criteria` with testable checkboxes
|
|
296
|
+
* Clarify `Out of Scope`
|
|
297
|
+
|
|
298
|
+
### Question priority (recommended)
|
|
299
|
+
|
|
300
|
+
1. **MVP scope boundary** (what is included/excluded)
|
|
301
|
+
2. **Preference decisions** (after presenting concrete options)
|
|
302
|
+
3. **Failure/edge behavior** (only for MVP-critical paths)
|
|
303
|
+
4. **Success metrics & Acceptance Criteria** (what proves it works)
|
|
304
|
+
|
|
305
|
+
### Preferred question format (multiple choice)
|
|
306
|
+
|
|
307
|
+
```markdown
|
|
308
|
+
For <topic>, which approach do you prefer?
|
|
309
|
+
|
|
310
|
+
1. **Option A** -- <what it means + trade-off>
|
|
311
|
+
2. **Option B** -- <what it means + trade-off>
|
|
312
|
+
3. **Option C** -- <what it means + trade-off>
|
|
313
|
+
4. **Other** -- describe your preference
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## Step 7: Propose Approaches + Record Decisions (Complex tasks)
|
|
319
|
+
|
|
320
|
+
After requirements are clear enough, propose 2-3 approaches (if not already done via research-first):
|
|
321
|
+
|
|
322
|
+
```markdown
|
|
323
|
+
Based on current information, here are 2-3 feasible approaches:
|
|
324
|
+
|
|
325
|
+
**Approach A: <name>** (Recommended)
|
|
326
|
+
|
|
327
|
+
* How:
|
|
328
|
+
* Pros:
|
|
329
|
+
* Cons:
|
|
330
|
+
|
|
331
|
+
**Approach B: <name>**
|
|
332
|
+
|
|
333
|
+
* How:
|
|
334
|
+
* Pros:
|
|
335
|
+
* Cons:
|
|
336
|
+
|
|
337
|
+
Which direction do you prefer?
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Record the outcome in PRD as an ADR-lite section:
|
|
341
|
+
|
|
342
|
+
```markdown
|
|
343
|
+
## Decision (ADR-lite)
|
|
344
|
+
|
|
345
|
+
**Context**: Why this decision was needed
|
|
346
|
+
**Decision**: Which approach was chosen
|
|
347
|
+
**Consequences**: Trade-offs, risks, potential future improvements
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## Step 8: Final Confirmation + Implementation Plan
|
|
353
|
+
|
|
354
|
+
When open questions are resolved, confirm complete requirements with a structured summary:
|
|
355
|
+
|
|
356
|
+
### Final confirmation format
|
|
357
|
+
|
|
358
|
+
```markdown
|
|
359
|
+
Here's my understanding of the complete requirements:
|
|
360
|
+
|
|
361
|
+
**Goal**: <one sentence>
|
|
362
|
+
|
|
363
|
+
**Requirements**:
|
|
364
|
+
|
|
365
|
+
* ...
|
|
366
|
+
* ...
|
|
367
|
+
|
|
368
|
+
**Acceptance Criteria**:
|
|
369
|
+
|
|
370
|
+
* [ ] ...
|
|
371
|
+
* [ ] ...
|
|
372
|
+
|
|
373
|
+
**Definition of Done**:
|
|
374
|
+
|
|
375
|
+
* ...
|
|
376
|
+
|
|
377
|
+
**Out of Scope**:
|
|
378
|
+
|
|
379
|
+
* ...
|
|
380
|
+
|
|
381
|
+
**Technical Approach**:
|
|
382
|
+
<brief summary + key decisions>
|
|
383
|
+
|
|
384
|
+
**Implementation Plan (small PRs)**:
|
|
385
|
+
|
|
386
|
+
* PR1: <scaffolding + tests + minimal plumbing>
|
|
387
|
+
* PR2: <core behavior>
|
|
388
|
+
* PR3: <edge cases + docs + cleanup>
|
|
389
|
+
|
|
390
|
+
Does this look correct? If yes, I'll proceed with implementation.
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## Anti-Patterns (Hard Avoid)
|
|
396
|
+
|
|
397
|
+
* Asking user for code/context that can be derived from repo
|
|
398
|
+
* Asking user to choose an approach before presenting concrete options
|
|
399
|
+
* Meta questions about whether to research
|
|
400
|
+
* Staying narrowly on the initial request without considering evolution/edges
|
|
401
|
+
* Letting brainstorming drift without updating PRD
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## Integration with Start Workflow
|
|
406
|
+
|
|
407
|
+
After brainstorm completes (Step 8 confirmation approved), the flow continues to the Task Workflow's **Phase 2: Prepare for Implementation**.
|
|
408
|
+
|
|
409
|
+
The task directory and PRD already exist from brainstorm, so Phase 1 of the Task Workflow is skipped entirely.
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## Related Commands
|
|
414
|
+
|
|
415
|
+
| Command | When to Use |
|
|
416
|
+
|---------|-------------|
|
|
417
|
+
| `/trellis:start` | Entry point that triggers brainstorm |
|
|
418
|
+
| `/trellis:finish-work` | After implementation is complete |
|
|
419
|
+
| `/trellis:update-spec` | If new patterns emerge during work |
|
|
420
|
+
"""
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
description = "Deep bug analysis to break the fix-forget-repeat cycle"
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
# Break the Loop - Deep Bug Analysis
|
|
5
|
+
|
|
6
|
+
When debug is complete, use this command for deep analysis to break the "fix bug -> forget -> repeat" cycle.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Analysis Framework
|
|
11
|
+
|
|
12
|
+
Analyze the bug you just fixed from these 5 dimensions:
|
|
13
|
+
|
|
14
|
+
### 1. Root Cause Category
|
|
15
|
+
|
|
16
|
+
Which category does this bug belong to?
|
|
17
|
+
|
|
18
|
+
| Category | Characteristics | Example |
|
|
19
|
+
|----------|-----------------|---------|
|
|
20
|
+
| **A. Missing Spec** | No documentation on how to do it | New feature without checklist |
|
|
21
|
+
| **B. Cross-Layer Contract** | Interface between layers unclear | API returns different format than expected |
|
|
22
|
+
| **C. Change Propagation Failure** | Changed one place, missed others | Changed function signature, missed call sites |
|
|
23
|
+
| **D. Test Coverage Gap** | Unit test passes, integration fails | Works alone, breaks when combined |
|
|
24
|
+
| **E. Implicit Assumption** | Code relies on undocumented assumption | Timestamp seconds vs milliseconds |
|
|
25
|
+
|
|
26
|
+
### 2. Why Fixes Failed (if applicable)
|
|
27
|
+
|
|
28
|
+
If you tried multiple fixes before succeeding, analyze each failure:
|
|
29
|
+
|
|
30
|
+
- **Surface Fix**: Fixed symptom, not root cause
|
|
31
|
+
- **Incomplete Scope**: Found root cause, didn't cover all cases
|
|
32
|
+
- **Tool Limitation**: grep missed it, type check wasn't strict
|
|
33
|
+
- **Mental Model**: Kept looking in same layer, didn't think cross-layer
|
|
34
|
+
|
|
35
|
+
### 3. Prevention Mechanisms
|
|
36
|
+
|
|
37
|
+
What mechanisms would prevent this from happening again?
|
|
38
|
+
|
|
39
|
+
| Type | Description | Example |
|
|
40
|
+
|------|-------------|---------|
|
|
41
|
+
| **Documentation** | Write it down so people know | Update thinking guide |
|
|
42
|
+
| **Architecture** | Make the error impossible structurally | Type-safe wrappers |
|
|
43
|
+
| **Compile-time** | TypeScript strict, no any | Signature change causes compile error |
|
|
44
|
+
| **Runtime** | Monitoring, alerts, scans | Detect orphan entities |
|
|
45
|
+
| **Test Coverage** | E2E tests, integration tests | Verify full flow |
|
|
46
|
+
| **Code Review** | Checklist, PR template | "Did you check X?" |
|
|
47
|
+
|
|
48
|
+
### 4. Systematic Expansion
|
|
49
|
+
|
|
50
|
+
What broader problems does this bug reveal?
|
|
51
|
+
|
|
52
|
+
- **Similar Issues**: Where else might this problem exist?
|
|
53
|
+
- **Design Flaw**: Is there a fundamental architecture issue?
|
|
54
|
+
- **Process Flaw**: Is there a development process improvement?
|
|
55
|
+
- **Knowledge Gap**: Is the team missing some understanding?
|
|
56
|
+
|
|
57
|
+
### 5. Knowledge Capture
|
|
58
|
+
|
|
59
|
+
Solidify insights into the system:
|
|
60
|
+
|
|
61
|
+
- [ ] Update `.trellis/spec/guides/` thinking guides
|
|
62
|
+
- [ ] Update `.trellis/spec/backend/` or `frontend/` docs
|
|
63
|
+
- [ ] Create issue record (if applicable)
|
|
64
|
+
- [ ] Create feature ticket for root fix
|
|
65
|
+
- [ ] Update check commands if needed
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Output Format
|
|
70
|
+
|
|
71
|
+
Please output analysis in this format:
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
## Bug Analysis: [Short Description]
|
|
75
|
+
|
|
76
|
+
### 1. Root Cause Category
|
|
77
|
+
- **Category**: [A/B/C/D/E] - [Category Name]
|
|
78
|
+
- **Specific Cause**: [Detailed description]
|
|
79
|
+
|
|
80
|
+
### 2. Why Fixes Failed (if applicable)
|
|
81
|
+
1. [First attempt]: [Why it failed]
|
|
82
|
+
2. [Second attempt]: [Why it failed]
|
|
83
|
+
...
|
|
84
|
+
|
|
85
|
+
### 3. Prevention Mechanisms
|
|
86
|
+
| Priority | Mechanism | Specific Action | Status |
|
|
87
|
+
|----------|-----------|-----------------|--------|
|
|
88
|
+
| P0 | ... | ... | TODO/DONE |
|
|
89
|
+
|
|
90
|
+
### 4. Systematic Expansion
|
|
91
|
+
- **Similar Issues**: [List places with similar problems]
|
|
92
|
+
- **Design Improvement**: [Architecture-level suggestions]
|
|
93
|
+
- **Process Improvement**: [Development process suggestions]
|
|
94
|
+
|
|
95
|
+
### 5. Knowledge Capture
|
|
96
|
+
- [ ] [Documents to update / tickets to create]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Core Philosophy
|
|
102
|
+
|
|
103
|
+
> **The value of debugging is not in fixing the bug, but in making this class of bugs never happen again.**
|
|
104
|
+
|
|
105
|
+
Three levels of insight:
|
|
106
|
+
1. **Tactical**: How to fix THIS bug
|
|
107
|
+
2. **Strategic**: How to prevent THIS CLASS of bugs
|
|
108
|
+
3. **Philosophical**: How to expand thinking patterns
|
|
109
|
+
|
|
110
|
+
30 minutes of analysis saves 30 hours of future debugging.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## After Analysis: Immediate Actions
|
|
115
|
+
|
|
116
|
+
**IMPORTANT**: After completing the analysis above, you MUST immediately:
|
|
117
|
+
|
|
118
|
+
1. **Update spec/guides** - Don't just list TODOs, actually update the relevant files:
|
|
119
|
+
- If it's a cross-platform issue -> update `cross-platform-thinking-guide.md`
|
|
120
|
+
- If it's a cross-layer issue -> update `cross-layer-thinking-guide.md`
|
|
121
|
+
- If it's a code reuse issue -> update `code-reuse-thinking-guide.md`
|
|
122
|
+
- If it's domain-specific -> update `backend/*.md` or `frontend/*.md`
|
|
123
|
+
|
|
124
|
+
2. **Sync templates** - After updating `.trellis/spec/`, sync to `src/templates/markdown/spec/`
|
|
125
|
+
|
|
126
|
+
3. **Commit the spec updates** - This is the primary output, not just the analysis text
|
|
127
|
+
|
|
128
|
+
> **The analysis is worthless if it stays in chat. The value is in the updated specs.**
|
|
129
|
+
"""
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
description = "Check if your code follows the backend development guidelines"
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Check if the code you just wrote follows the backend development guidelines.
|
|
5
|
+
|
|
6
|
+
Execute these steps:
|
|
7
|
+
1. Run `git status` to see modified files
|
|
8
|
+
2. Read `.trellis/spec/backend/index.md` to understand which guidelines apply
|
|
9
|
+
3. Based on what you changed, read the relevant guideline files:
|
|
10
|
+
- Database changes -> `.trellis/spec/backend/database-guidelines.md`
|
|
11
|
+
- Error handling -> `.trellis/spec/backend/error-handling.md`
|
|
12
|
+
- Logging changes -> `.trellis/spec/backend/logging-guidelines.md`
|
|
13
|
+
- Type changes -> `.trellis/spec/backend/type-safety.md`
|
|
14
|
+
- Any changes -> `.trellis/spec/backend/quality-guidelines.md`
|
|
15
|
+
4. Review your code against the guidelines
|
|
16
|
+
5. Report any violations and fix them if found
|
|
17
|
+
"""
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
description = "Cross-layer verification check for multi-dimension changes"
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
# Cross-Layer Check
|
|
5
|
+
|
|
6
|
+
Check if your changes considered all dimensions. Most bugs come from "didn't think of it", not lack of technical skill.
|
|
7
|
+
|
|
8
|
+
> **Note**: This is a **post-implementation** safety net. Ideally, read the Pre-Implementation Checklist **before** writing code.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Execution Steps
|
|
13
|
+
|
|
14
|
+
### 1. Identify Change Scope
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
git status
|
|
18
|
+
git diff --name-only
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. Select Applicable Check Dimensions
|
|
22
|
+
|
|
23
|
+
Based on your change type, execute relevant checks below:
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Dimension A: Cross-Layer Data Flow (Required when 3+ layers)
|
|
28
|
+
|
|
29
|
+
**Trigger**: Changes involve 3 or more layers
|
|
30
|
+
|
|
31
|
+
| Layer | Common Locations |
|
|
32
|
+
|-------|------------------|
|
|
33
|
+
| API/Routes | `routes/`, `api/`, `handlers/`, `controllers/` |
|
|
34
|
+
| Service/Business Logic | `services/`, `lib/`, `core/`, `domain/` |
|
|
35
|
+
| Database/Storage | `db/`, `models/`, `repositories/`, `schema/` |
|
|
36
|
+
| UI/Presentation | `components/`, `views/`, `templates/`, `pages/` |
|
|
37
|
+
| Utility | `utils/`, `helpers/`, `common/` |
|
|
38
|
+
|
|
39
|
+
**Checklist**:
|
|
40
|
+
- [ ] Read flow: Database -> Service -> API -> UI
|
|
41
|
+
- [ ] Write flow: UI -> API -> Service -> Database
|
|
42
|
+
- [ ] Types/schemas correctly passed between layers?
|
|
43
|
+
- [ ] Errors properly propagated to caller?
|
|
44
|
+
- [ ] Loading/pending states handled at each layer?
|
|
45
|
+
|
|
46
|
+
**Detailed Guide**: `.trellis/spec/guides/cross-layer-thinking-guide.md`
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Dimension B: Code Reuse (Required when modifying constants/config)
|
|
51
|
+
|
|
52
|
+
**Trigger**:
|
|
53
|
+
- Modifying UI constants (label, icon, color)
|
|
54
|
+
- Modifying any hardcoded value
|
|
55
|
+
- Seeing similar code in multiple places
|
|
56
|
+
- Creating a new utility/helper function
|
|
57
|
+
- Just finished batch modifications across files
|
|
58
|
+
|
|
59
|
+
**Checklist**:
|
|
60
|
+
- [ ] Search first: How many places define this value?
|
|
61
|
+
```bash
|
|
62
|
+
# Search in source files (adjust extensions for your project)
|
|
63
|
+
grep -r "value-to-change" src/
|
|
64
|
+
```
|
|
65
|
+
- [ ] If 2+ places define same value -> Should extract to shared constant
|
|
66
|
+
- [ ] After modification, all usage sites updated?
|
|
67
|
+
- [ ] If creating utility: Does similar utility already exist?
|
|
68
|
+
|
|
69
|
+
**Detailed Guide**: `.trellis/spec/guides/code-reuse-thinking-guide.md`
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Dimension B2: New Utility Functions
|
|
74
|
+
|
|
75
|
+
**Trigger**: About to create a new utility/helper function
|
|
76
|
+
|
|
77
|
+
**Checklist**:
|
|
78
|
+
- [ ] Search for existing similar utilities first
|
|
79
|
+
```bash
|
|
80
|
+
grep -r "functionNamePattern" src/
|
|
81
|
+
```
|
|
82
|
+
- [ ] If similar exists, can you extend it instead?
|
|
83
|
+
- [ ] If creating new, is it in the right location (shared vs domain-specific)?
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Dimension B3: After Batch Modifications
|
|
88
|
+
|
|
89
|
+
**Trigger**: Just modified similar patterns in multiple files
|
|
90
|
+
|
|
91
|
+
**Checklist**:
|
|
92
|
+
- [ ] Did you check ALL files with similar patterns?
|
|
93
|
+
```bash
|
|
94
|
+
grep -r "patternYouChanged" src/
|
|
95
|
+
```
|
|
96
|
+
- [ ] Any files missed that should also be updated?
|
|
97
|
+
- [ ] Should this pattern be abstracted to prevent future duplication?
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Dimension C: Import/Dependency Paths (Required when creating new files)
|
|
102
|
+
|
|
103
|
+
**Trigger**: Creating new source files
|
|
104
|
+
|
|
105
|
+
**Checklist**:
|
|
106
|
+
- [ ] Using correct import paths (relative vs absolute)?
|
|
107
|
+
- [ ] No circular dependencies?
|
|
108
|
+
- [ ] Consistent with project's module organization?
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Dimension D: Same-Layer Consistency
|
|
113
|
+
|
|
114
|
+
**Trigger**:
|
|
115
|
+
- Modifying display logic or formatting
|
|
116
|
+
- Same domain concept used in multiple places
|
|
117
|
+
|
|
118
|
+
**Checklist**:
|
|
119
|
+
- [ ] Search for other places using same concept
|
|
120
|
+
```bash
|
|
121
|
+
grep -r "ConceptName" src/
|
|
122
|
+
```
|
|
123
|
+
- [ ] Are these usages consistent?
|
|
124
|
+
- [ ] Should they share configuration/constants?
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Common Issues Quick Reference
|
|
129
|
+
|
|
130
|
+
| Issue | Root Cause | Prevention |
|
|
131
|
+
|-------|------------|------------|
|
|
132
|
+
| Changed one place, missed others | Didn't search impact scope | `grep` before changing |
|
|
133
|
+
| Data lost at some layer | Didn't check data flow | Trace data source to destination |
|
|
134
|
+
| Type/schema mismatch | Cross-layer types inconsistent | Use shared type definitions |
|
|
135
|
+
| UI/output inconsistent | Same concept in multiple places | Extract shared constants |
|
|
136
|
+
| Similar utility exists | Didn't search first | Search before creating |
|
|
137
|
+
| Batch fix incomplete | Didn't verify all occurrences | grep after fixing |
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Output
|
|
142
|
+
|
|
143
|
+
Report:
|
|
144
|
+
1. Which dimensions your changes involve
|
|
145
|
+
2. Check results for each dimension
|
|
146
|
+
3. Issues found and fix suggestions
|
|
147
|
+
"""
|