@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,445 @@
|
|
|
1
|
+
# Handoff - 完成任务并生成交接文档
|
|
2
|
+
|
|
3
|
+
完成当前任务,AI自动生成 HANDOFF.md 交接文档,并将产出加入任务池供下游消费。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 使用场景
|
|
8
|
+
|
|
9
|
+
| 角色 | 何时使用 | 产出去向 |
|
|
10
|
+
|------|---------|---------|
|
|
11
|
+
| **PM** | 完成 PRD 编写 | → requirements 池 |
|
|
12
|
+
| **Designer** | 完成原型代码 | → prototypes 池 |
|
|
13
|
+
| **Frontend** | 完成生产代码 | → implementations 池 |
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 执行流程
|
|
18
|
+
|
|
19
|
+
### Step 1: 检查当前任务状态
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python3 .trellis/scripts/get_context.py
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**验证点**:
|
|
26
|
+
- ✅ 当前任务已设置(`.trellis/.current-task`)
|
|
27
|
+
- ✅ 任务目录存在
|
|
28
|
+
- ✅ `task.json` 包含 `role` 字段
|
|
29
|
+
|
|
30
|
+
**如果验证失败**:
|
|
31
|
+
```
|
|
32
|
+
如果没有当前任务:
|
|
33
|
+
→ 先执行: python3 .trellis/scripts/task.py start <task-dir>
|
|
34
|
+
|
|
35
|
+
如果没有 role 字段:
|
|
36
|
+
→ 先执行: python3 .trellis/scripts/task.py set-role <task-dir> <pm|designer|frontend>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### Step 2: 读取任务配置
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
cat .trellis/.current-task
|
|
45
|
+
# 输出任务目录,例如:.trellis/tasks/01-21-user-login
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
基于当前任务目录,读取:
|
|
49
|
+
- `task.json` - 获取 role, id, title 等元数据
|
|
50
|
+
- `source.json` - (Designer/Frontend)获取上游产出引用
|
|
51
|
+
- `prd.md` - (所有角色)获取需求文档
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### Step 3: 确定产出目录
|
|
56
|
+
|
|
57
|
+
**读取项目配置**:
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
# 使用配置化路径(框架层与业务层分离)
|
|
61
|
+
python3 -c "
|
|
62
|
+
import sys
|
|
63
|
+
from pathlib import Path
|
|
64
|
+
sys.path.insert(0, str(Path('.trellis/scripts/common')))
|
|
65
|
+
from project_paths import get_output_dir_for_task, get_repo_root
|
|
66
|
+
|
|
67
|
+
repo_root = get_repo_root()
|
|
68
|
+
role = '<role>' # 从 task.json 读取
|
|
69
|
+
task_id = '<task-id>' # 从 task.json 读取
|
|
70
|
+
|
|
71
|
+
output_dir = get_output_dir_for_task(repo_root, role, task_id)
|
|
72
|
+
print(output_dir)
|
|
73
|
+
"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**默认路径映射**(如果 `.trellis/paths.yaml` 不存在):
|
|
77
|
+
|
|
78
|
+
| Role | 默认产出目录 | 示例 |
|
|
79
|
+
|------|-------------|------|
|
|
80
|
+
| `pm` | `deliverables/requirements/{task-id}/` | `deliverables/requirements/user-login/` |
|
|
81
|
+
| `designer` | `deliverables/prototypes/{task-id}/` | `deliverables/prototypes/user-login/` |
|
|
82
|
+
| `frontend` | `deliverables/production/features/{task-id}/` | `deliverables/production/features/user-login/` |
|
|
83
|
+
|
|
84
|
+
**自定义路径**:
|
|
85
|
+
|
|
86
|
+
项目可以通过修改 `.trellis/paths.yaml` 自定义产出目录结构:
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
deliverables_base: "outputs" # 可改为任何名称
|
|
90
|
+
role_outputs:
|
|
91
|
+
pm:
|
|
92
|
+
dir: "specs"
|
|
93
|
+
designer:
|
|
94
|
+
dir: "designs"
|
|
95
|
+
frontend:
|
|
96
|
+
dir: "code"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**任务ID** 从 `task.json` 的 `id` 字段读取。
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### Step 4: 检查产出完整性
|
|
104
|
+
|
|
105
|
+
**PM 角色必需文件**:
|
|
106
|
+
- [ ] `prd.md` 存在且非空
|
|
107
|
+
- [ ] (可选)`user-stories.md`
|
|
108
|
+
|
|
109
|
+
**Designer 角色必需文件**:
|
|
110
|
+
- [ ] 至少1个 `.tsx` 或 `.vue` 文件(原型代码)
|
|
111
|
+
- [ ] 至少1个 Mock 数据文件(`mocks/` 或 `*.mock.ts`)
|
|
112
|
+
|
|
113
|
+
**Frontend 角色必需文件**:
|
|
114
|
+
- [ ] 修改了至少1个代码文件(通过 `git diff --name-only` 检查)
|
|
115
|
+
|
|
116
|
+
**如果检查失败**:
|
|
117
|
+
```
|
|
118
|
+
警告用户产出不完整,询问是否继续:
|
|
119
|
+
"⚠️ 检测到以下问题:
|
|
120
|
+
- PM: 缺少 prd.md
|
|
121
|
+
|
|
122
|
+
是否继续生成 HANDOFF?[y/N]"
|
|
123
|
+
|
|
124
|
+
如果用户选择 N,中止执行。
|
|
125
|
+
如果用户选择 y,继续但在 HANDOFF 中标注警告。
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### Step 5: AI 生成 HANDOFF.md
|
|
131
|
+
|
|
132
|
+
调用 Python 脚本生成初稿:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
python3 .trellis/scripts/handoff_generator.py \
|
|
136
|
+
<task-dir> \
|
|
137
|
+
<role> \
|
|
138
|
+
--output <产出目录>/HANDOFF.md
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**脚本输出**:
|
|
142
|
+
- 基于角色模板生成的 HANDOFF.md
|
|
143
|
+
- 包含 TODO 标记需要 AI 补充的部分
|
|
144
|
+
|
|
145
|
+
**AI 任务**:
|
|
146
|
+
1. 读取生成的 HANDOFF.md
|
|
147
|
+
2. 分析任务目录中的文件(prd.md, 代码文件等)
|
|
148
|
+
3. 替换所有 `[TODO: AI填写...]` 标记为实际内容
|
|
149
|
+
|
|
150
|
+
**AI 补充内容指南**:
|
|
151
|
+
|
|
152
|
+
#### PM 角色 HANDOFF
|
|
153
|
+
```markdown
|
|
154
|
+
## 🎯 核心需求
|
|
155
|
+
[TODO: AI根据PRD总结核心要点(2-3段)]
|
|
156
|
+
|
|
157
|
+
→ AI应该:
|
|
158
|
+
- 阅读 prd.md
|
|
159
|
+
- 提炼最重要的2-3个功能点
|
|
160
|
+
- 用简洁的语言(每段50-100字)总结
|
|
161
|
+
|
|
162
|
+
## 🔑 关键设计要点
|
|
163
|
+
1. [TODO: AI填写关键功能点1]
|
|
164
|
+
2. [TODO: AI填写关键功能点2]
|
|
165
|
+
|
|
166
|
+
→ AI应该:
|
|
167
|
+
- 从 PRD 中提取 Designer 需要重点关注的 UI/交互要求
|
|
168
|
+
- 例如:"支持邮箱+密码登录"、"第三方登录按钮布局参考设计稿"
|
|
169
|
+
|
|
170
|
+
## ⚠️ 特别注意事项
|
|
171
|
+
- [TODO: AI填写注意事项1 - 如UI布局要求]
|
|
172
|
+
|
|
173
|
+
→ AI应该:
|
|
174
|
+
- 提取技术限制、兼容性要求、时间节点等
|
|
175
|
+
- 例如:"支持 IE11"、"密码输入框需要显示/隐藏切换"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### Designer 角色 HANDOFF
|
|
179
|
+
```markdown
|
|
180
|
+
## 🎨 设计说明
|
|
181
|
+
[TODO: AI总结设计思路(2-3段)]
|
|
182
|
+
|
|
183
|
+
→ AI应该:
|
|
184
|
+
- 阅读原型代码文件
|
|
185
|
+
- 总结布局结构、主要组件、交互流程
|
|
186
|
+
|
|
187
|
+
## 🧩 组件结构
|
|
188
|
+
[TODO: AI绘制组件树]
|
|
189
|
+
|
|
190
|
+
→ AI应该:
|
|
191
|
+
- 分析代码文件依赖关系
|
|
192
|
+
- 绘制组件树(Markdown 文本格式)
|
|
193
|
+
|
|
194
|
+
## 💾 Mock数据说明
|
|
195
|
+
[TODO: AI填写Mock数据示例]
|
|
196
|
+
|
|
197
|
+
→ AI应该:
|
|
198
|
+
- 搜索 `*.mock.ts` 或 `mocks/` 目录
|
|
199
|
+
- 提取关键 Mock 数据结构
|
|
200
|
+
- 标注文件位置和行号
|
|
201
|
+
|
|
202
|
+
## 🔄 需要Frontend补充的逻辑
|
|
203
|
+
1. **API集成** - 替换Mock为真实API调用
|
|
204
|
+
- 位置: [TODO: 文件名:行号]
|
|
205
|
+
|
|
206
|
+
→ AI应该:
|
|
207
|
+
- 搜索代码中的 `TODO` 或 `MOCK` 注释
|
|
208
|
+
- 或搜索包含 `setTimeout`、`Promise.resolve` 的 Mock 实现
|
|
209
|
+
- 列出每个需要替换的位置
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### Frontend 角色 HANDOFF
|
|
213
|
+
```markdown
|
|
214
|
+
## 🎯 实现总结
|
|
215
|
+
[TODO: AI总结实现要点(2-3段)]
|
|
216
|
+
|
|
217
|
+
→ AI应该:
|
|
218
|
+
- 运行 `git diff --name-only` 获取修改的文件列表
|
|
219
|
+
- 总结主要功能实现、API 集成情况
|
|
220
|
+
|
|
221
|
+
## 🔌 API集成
|
|
222
|
+
| 端点 | 方法 | 用途 | 位置 |
|
|
223
|
+
|------|------|------|------|
|
|
224
|
+
| [TODO] | POST | [TODO] | [TODO:文件:行号] |
|
|
225
|
+
|
|
226
|
+
→ AI应该:
|
|
227
|
+
- 搜索代码中的 API 调用(axios, fetch)
|
|
228
|
+
- 提取端点、方法、用途
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
### Step 6: 询问用户交接留言
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
AI 提示用户:
|
|
237
|
+
"HANDOFF 文档已生成。请查看:
|
|
238
|
+
|
|
239
|
+
<产出目录>/HANDOFF.md
|
|
240
|
+
|
|
241
|
+
是否需要添加额外的交接留言?(可选)
|
|
242
|
+
例如:重点关注第三方登录流程、Mock 数据在 src/mocks/auth.ts"
|
|
243
|
+
|
|
244
|
+
用户输入:<留言内容> 或直接回车跳过
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**如果用户提供留言**:
|
|
248
|
+
- 追加到 HANDOFF.md 末尾:
|
|
249
|
+
```markdown
|
|
250
|
+
## 📝 交接留言
|
|
251
|
+
|
|
252
|
+
{用户留言内容}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
### Step 7: 复制文件到产出目录
|
|
258
|
+
|
|
259
|
+
**创建产出目录**:
|
|
260
|
+
```bash
|
|
261
|
+
mkdir -p <产出目录>
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**复制规则**:
|
|
265
|
+
|
|
266
|
+
#### PM 角色
|
|
267
|
+
```bash
|
|
268
|
+
cp <task-dir>/prd.md <产出目录>/
|
|
269
|
+
cp <task-dir>/user-stories.md <产出目录>/ # 如果存在
|
|
270
|
+
cp <task-dir>/HANDOFF.md <产出目录>/ # 已生成
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
#### Designer 角色
|
|
274
|
+
```bash
|
|
275
|
+
# 复制所有原型代码文件(.tsx, .ts, .vue, .jsx, .js)
|
|
276
|
+
find <task-dir> -name "*.tsx" -o -name "*.ts" | while read file; do
|
|
277
|
+
cp "$file" <产出目录>/
|
|
278
|
+
done
|
|
279
|
+
|
|
280
|
+
# 复制 Mock 数据
|
|
281
|
+
cp -r <task-dir>/mocks/ <产出目录>/mocks/ # 如果存在
|
|
282
|
+
|
|
283
|
+
# 复制 HANDOFF
|
|
284
|
+
cp <task-dir>/HANDOFF.md <产出目录>/
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
#### Frontend 角色
|
|
288
|
+
```bash
|
|
289
|
+
# 获取 git 修改的文件
|
|
290
|
+
git diff --name-only > /tmp/modified_files.txt
|
|
291
|
+
|
|
292
|
+
# 复制修改的文件到产出目录(保持目录结构)
|
|
293
|
+
while read file; do
|
|
294
|
+
mkdir -p <产出目录>/$(dirname "$file")
|
|
295
|
+
cp "$file" <产出目录>/"$file"
|
|
296
|
+
done < /tmp/modified_files.txt
|
|
297
|
+
|
|
298
|
+
# 复制 HANDOFF
|
|
299
|
+
cp <task-dir>/HANDOFF.md <产出目录>/
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
### Step 8: 加入任务池
|
|
305
|
+
|
|
306
|
+
调用 pool.py 添加到对应池子:
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
python3 .trellis/scripts/pool.py add <pool-type> <task-data-json>
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**pool-type 映射**:
|
|
313
|
+
- `pm` → `requirements`
|
|
314
|
+
- `designer` → `prototypes`
|
|
315
|
+
- `frontend` → `implementations`
|
|
316
|
+
|
|
317
|
+
**task-data-json 格式**:
|
|
318
|
+
```json
|
|
319
|
+
{
|
|
320
|
+
"id": "<task-id>",
|
|
321
|
+
"title": "<task-title>",
|
|
322
|
+
"path": "<产出目录相对路径>",
|
|
323
|
+
"completed_by": "<当前开发者>",
|
|
324
|
+
"handoff_doc": "<产出目录>/HANDOFF.md",
|
|
325
|
+
"completed_at": "<当前时间 ISO格式>"
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
**获取当前开发者**:
|
|
330
|
+
```bash
|
|
331
|
+
python3 .trellis/scripts/get_developer.py
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
### Step 9: 更新任务状态
|
|
337
|
+
|
|
338
|
+
**更新 task.json**:
|
|
339
|
+
```json
|
|
340
|
+
{
|
|
341
|
+
...
|
|
342
|
+
"status": "completed",
|
|
343
|
+
"completedAt": "<当前日期 YYYY-MM-DD>",
|
|
344
|
+
"output_dir": "<产出目录相对路径>"
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**清除当前任务**(可选):
|
|
349
|
+
```bash
|
|
350
|
+
python3 .trellis/scripts/task.py finish
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
### Step 10: 输出通知信息
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
✅ 任务交接完成!
|
|
359
|
+
|
|
360
|
+
产出目录: <产出目录>
|
|
361
|
+
HANDOFF 文档: <产出目录>/HANDOFF.md
|
|
362
|
+
已加入任务池: <pool-type>
|
|
363
|
+
|
|
364
|
+
下游可通过以下命令消费:
|
|
365
|
+
/trellis:pick-task <pool-type> <task-id>
|
|
366
|
+
|
|
367
|
+
提示:记得提醒下游角色(通过IM、邮件等)
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## 错误处理
|
|
373
|
+
|
|
374
|
+
### 错误场景1:没有当前任务
|
|
375
|
+
```
|
|
376
|
+
Error: 没有设置当前任务
|
|
377
|
+
|
|
378
|
+
请先执行:python3 .trellis/scripts/task.py start <task-dir>
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### 错误场景2:task.json 缺少 role 字段
|
|
382
|
+
```
|
|
383
|
+
Error: task.json 缺少 role 字段
|
|
384
|
+
|
|
385
|
+
请先执行:python3 .trellis/scripts/task.py set-role <task-dir> <pm|designer|frontend>
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### 错误场景3:产出目录已存在
|
|
389
|
+
```
|
|
390
|
+
Warning: 产出目录已存在:<产出目录>
|
|
391
|
+
|
|
392
|
+
是否覆盖?[y/N]
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### 错误场景4:HANDOFF 生成失败
|
|
396
|
+
```
|
|
397
|
+
Error: HANDOFF 文档生成失败
|
|
398
|
+
|
|
399
|
+
可能原因:
|
|
400
|
+
- task.json 格式错误
|
|
401
|
+
- Python 脚本路径错误
|
|
402
|
+
|
|
403
|
+
请检查并重试,或手动创建 HANDOFF.md
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## 示例执行流程
|
|
409
|
+
|
|
410
|
+
### PM 完成 PRD 后交接
|
|
411
|
+
|
|
412
|
+
```bash
|
|
413
|
+
# 用户执行命令
|
|
414
|
+
/trellis:handoff
|
|
415
|
+
|
|
416
|
+
# AI 执行流程
|
|
417
|
+
1. 读取当前任务:.trellis/tasks/01-21-user-login
|
|
418
|
+
2. 读取 task.json:role=pm, id=user-login
|
|
419
|
+
3. 确定产出目录:deliverables/requirements/user-login/
|
|
420
|
+
4. 检查文件:prd.md ✅
|
|
421
|
+
5. 生成 HANDOFF.md(AI 补充核心要点)
|
|
422
|
+
6. 询问交接留言:用户输入"重点关注第三方登录流程"
|
|
423
|
+
7. 复制文件:prd.md, HANDOFF.md → deliverables/requirements/user-login/
|
|
424
|
+
8. 加入池子:pool.py add requirements {...}
|
|
425
|
+
9. 更新状态:task.json status=completed
|
|
426
|
+
10. 输出通知:✅ 已加入 requirements 池,Designer 可消费
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## 注意事项
|
|
432
|
+
|
|
433
|
+
1. **HANDOFF 质量**:AI 补充的内容应该准确、简洁、有用
|
|
434
|
+
2. **文件完整性**:确保复制所有必要文件到产出目录
|
|
435
|
+
3. **任务池状态**:成功加入池子后,任务状态应为 `available`
|
|
436
|
+
4. **交接通知**:提醒用户通知下游角色(命令只更新池子,不发送通知)
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## 命令别名(可选)
|
|
441
|
+
|
|
442
|
+
用户可能使用以下变体,AI 应识别并执行相同逻辑:
|
|
443
|
+
- `/trellis:handoff`
|
|
444
|
+
- `/handoff`
|
|
445
|
+
- "完成任务并交接"
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Integrate Claude Skill into Project Guidelines
|
|
2
|
+
|
|
3
|
+
Adapt and integrate a Claude global skill into your project's development guidelines (not directly into project code).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/trellis:integrate-skill <skill-name>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Examples**:
|
|
12
|
+
```
|
|
13
|
+
/trellis:integrate-skill frontend-design
|
|
14
|
+
/trellis:integrate-skill mcp-builder
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Core Principle
|
|
18
|
+
|
|
19
|
+
> [!] **Important**: The goal of skill integration is to update **development guidelines**, not to generate project code directly.
|
|
20
|
+
>
|
|
21
|
+
> - Guidelines content -> Write to `.trellis/spec/{target}/doc.md`
|
|
22
|
+
> - Code examples -> Place in `.trellis/spec/{target}/examples/skills/<skill-name>/`
|
|
23
|
+
> - Example files -> Use `.template` suffix (e.g., `component.tsx.template`) to avoid IDE errors
|
|
24
|
+
>
|
|
25
|
+
> Where `{target}` is `frontend` or `backend`, determined by skill type.
|
|
26
|
+
|
|
27
|
+
## Execution Steps
|
|
28
|
+
|
|
29
|
+
### 1. Read Skill Content
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
openskills read <skill-name>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If the skill doesn't exist, prompt user to check available skills:
|
|
36
|
+
```bash
|
|
37
|
+
# Available skills are listed in AGENTS.md under <available_skills>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. Determine Integration Target
|
|
41
|
+
|
|
42
|
+
Based on skill type, determine which guidelines to update:
|
|
43
|
+
|
|
44
|
+
| Skill Category | Integration Target |
|
|
45
|
+
|----------------|-------------------|
|
|
46
|
+
| UI/Frontend (`frontend-design`, `web-artifacts-builder`) | `.trellis/spec/frontend/` |
|
|
47
|
+
| Backend/API (`mcp-builder`) | `.trellis/spec/backend/` |
|
|
48
|
+
| Documentation (`doc-coauthoring`, `docx`, `pdf`) | `.trellis/` or create dedicated guidelines |
|
|
49
|
+
| Testing (`webapp-testing`) | `.trellis/spec/frontend/` (E2E) |
|
|
50
|
+
|
|
51
|
+
### 3. Analyze Skill Content
|
|
52
|
+
|
|
53
|
+
Extract from the skill:
|
|
54
|
+
- **Core concepts**: How the skill works and key concepts
|
|
55
|
+
- **Best practices**: Recommended approaches
|
|
56
|
+
- **Code patterns**: Reusable code templates
|
|
57
|
+
- **Caveats**: Common issues and solutions
|
|
58
|
+
|
|
59
|
+
### 4. Execute Integration
|
|
60
|
+
|
|
61
|
+
#### 4.1 Update Guidelines Document
|
|
62
|
+
|
|
63
|
+
Add a new section to the corresponding `doc.md`:
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
@@@section:skill-<skill-name>
|
|
67
|
+
## # <Skill Name> Integration Guide
|
|
68
|
+
|
|
69
|
+
### Overview
|
|
70
|
+
[Core functionality and use cases of the skill]
|
|
71
|
+
|
|
72
|
+
### Project Adaptation
|
|
73
|
+
[How to use this skill in the current project]
|
|
74
|
+
|
|
75
|
+
### Usage Steps
|
|
76
|
+
1. [Step 1]
|
|
77
|
+
2. [Step 2]
|
|
78
|
+
|
|
79
|
+
### Caveats
|
|
80
|
+
- [Project-specific constraints]
|
|
81
|
+
- [Differences from default behavior]
|
|
82
|
+
|
|
83
|
+
### Reference Examples
|
|
84
|
+
See `examples/skills/<skill-name>/`
|
|
85
|
+
|
|
86
|
+
@@@/section:skill-<skill-name>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### 4.2 Create Examples Directory (if code examples exist)
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Directory structure ({target} = frontend or backend)
|
|
93
|
+
.trellis/spec/{target}/
|
|
94
|
+
|-- doc.md # Add skill-related section
|
|
95
|
+
|-- index.md # Update index
|
|
96
|
+
+-- examples/
|
|
97
|
+
+-- skills/
|
|
98
|
+
+-- <skill-name>/
|
|
99
|
+
|-- README.md # Example documentation
|
|
100
|
+
|-- example-1.ts.template # Code example (use .template suffix)
|
|
101
|
+
+-- example-2.tsx.template
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**File naming conventions**:
|
|
105
|
+
- Code files: `<name>.<ext>.template` (e.g., `component.tsx.template`)
|
|
106
|
+
- Config files: `<name>.config.template` (e.g., `tailwind.config.template`)
|
|
107
|
+
- Documentation: `README.md` (normal suffix)
|
|
108
|
+
|
|
109
|
+
#### 4.3 Update Index File
|
|
110
|
+
|
|
111
|
+
Add to the Quick Navigation table in `index.md`:
|
|
112
|
+
|
|
113
|
+
```markdown
|
|
114
|
+
| <Skill-related task> | <Section name> | `skill-<skill-name>` |
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 5. Generate Integration Report
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Skill Integration Report: `<skill-name>`
|
|
122
|
+
|
|
123
|
+
### # Overview
|
|
124
|
+
- **Skill description**: [Functionality description]
|
|
125
|
+
- **Integration target**: `.trellis/spec/{target}/`
|
|
126
|
+
|
|
127
|
+
### # Tech Stack Compatibility
|
|
128
|
+
|
|
129
|
+
| Skill Requirement | Project Status | Compatibility |
|
|
130
|
+
|-------------------|----------------|---------------|
|
|
131
|
+
| [Tech 1] | [Project tech] | [OK]/[!]/[X] |
|
|
132
|
+
|
|
133
|
+
### # Integration Locations
|
|
134
|
+
|
|
135
|
+
| Type | Path |
|
|
136
|
+
|------|------|
|
|
137
|
+
| Guidelines doc | `.trellis/spec/{target}/doc.md` (section: `skill-<name>`) |
|
|
138
|
+
| Code examples | `.trellis/spec/{target}/examples/skills/<name>/` |
|
|
139
|
+
| Index update | `.trellis/spec/{target}/index.md` |
|
|
140
|
+
|
|
141
|
+
> `{target}` = `frontend` or `backend`
|
|
142
|
+
|
|
143
|
+
### # Dependencies (if needed)
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Install required dependencies (adjust for your package manager)
|
|
147
|
+
npm install <package>
|
|
148
|
+
# or
|
|
149
|
+
pnpm add <package>
|
|
150
|
+
# or
|
|
151
|
+
yarn add <package>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### [OK] Completed Changes
|
|
155
|
+
|
|
156
|
+
- [ ] Added `@@@section:skill-<name>` section to `doc.md`
|
|
157
|
+
- [ ] Added index entry to `index.md`
|
|
158
|
+
- [ ] Created example files in `examples/skills/<name>/`
|
|
159
|
+
- [ ] Example files use `.template` suffix
|
|
160
|
+
|
|
161
|
+
### # Related Guidelines
|
|
162
|
+
|
|
163
|
+
- [Existing related section IDs]
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 6. Optional: Create Usage Command
|
|
168
|
+
|
|
169
|
+
If this skill is frequently used, create a shortcut command:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
/trellis:create-command use-<skill-name> Use <skill-name> skill following project guidelines
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Common Skill Integration Reference
|
|
176
|
+
|
|
177
|
+
| Skill | Integration Target | Examples Directory |
|
|
178
|
+
|-------|-------------------|-------------------|
|
|
179
|
+
| `frontend-design` | `frontend` | `examples/skills/frontend-design/` |
|
|
180
|
+
| `mcp-builder` | `backend` | `examples/skills/mcp-builder/` |
|
|
181
|
+
| `webapp-testing` | `frontend` | `examples/skills/webapp-testing/` |
|
|
182
|
+
| `doc-coauthoring` | `.trellis/` | N/A (documentation workflow only) |
|
|
183
|
+
|
|
184
|
+
## Example: Integrating `mcp-builder` Skill
|
|
185
|
+
|
|
186
|
+
### Directory Structure
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
.trellis/spec/backend/
|
|
190
|
+
|-- doc.md # Add MCP section
|
|
191
|
+
|-- index.md # Add index entry
|
|
192
|
+
+-- examples/
|
|
193
|
+
+-- skills/
|
|
194
|
+
+-- mcp-builder/
|
|
195
|
+
|-- README.md
|
|
196
|
+
|-- server.ts.template
|
|
197
|
+
|-- tools.ts.template
|
|
198
|
+
+-- types.ts.template
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### New Section in doc.md
|
|
202
|
+
|
|
203
|
+
```markdown
|
|
204
|
+
@@@section:skill-mcp-builder
|
|
205
|
+
## # MCP Server Development Guide
|
|
206
|
+
|
|
207
|
+
### Overview
|
|
208
|
+
Create LLM-callable tool services using MCP (Model Context Protocol).
|
|
209
|
+
|
|
210
|
+
### Project Adaptation
|
|
211
|
+
- Place services in a dedicated directory
|
|
212
|
+
- Follow existing TypeScript and type definition conventions
|
|
213
|
+
- Use project's logging system
|
|
214
|
+
|
|
215
|
+
### Reference Examples
|
|
216
|
+
See `examples/skills/mcp-builder/`
|
|
217
|
+
|
|
218
|
+
@@@/section:skill-mcp-builder
|
|
219
|
+
```
|