@mindfoldhq/trellis 0.3.10 → 0.4.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -5
- package/dist/cli/index.js +5 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +240 -43
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +206 -47
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/codebuddy.d.ts +11 -0
- package/dist/configurators/codebuddy.d.ts.map +1 -0
- package/dist/configurators/codebuddy.js +58 -0
- package/dist/configurators/codebuddy.js.map +1 -0
- package/dist/configurators/codex.d.ts +7 -4
- package/dist/configurators/codex.d.ts.map +1 -1
- package/dist/configurators/codex.js +40 -10
- package/dist/configurators/codex.js.map +1 -1
- package/dist/configurators/copilot.d.ts +9 -0
- package/dist/configurators/copilot.d.ts.map +1 -0
- package/dist/configurators/copilot.js +34 -0
- package/dist/configurators/copilot.js.map +1 -0
- package/dist/configurators/index.d.ts +11 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +72 -4
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/opencode.d.ts +1 -1
- package/dist/configurators/opencode.js +1 -1
- package/dist/configurators/windsurf.d.ts +8 -0
- package/dist/configurators/windsurf.d.ts.map +1 -0
- package/dist/configurators/windsurf.js +18 -0
- package/dist/configurators/windsurf.js.map +1 -0
- package/dist/configurators/workflow.d.ts +6 -2
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +90 -58
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +2 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/manifests/0.4.0-beta.1.json +228 -0
- package/dist/migrations/manifests/0.4.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.5.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.6.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.7.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.8.json +34 -0
- package/dist/migrations/manifests/0.4.0-beta.9.json +9 -0
- package/dist/templates/claude/agents/dispatch.md +1 -2
- package/dist/templates/claude/agents/implement.md +2 -3
- package/dist/templates/claude/commands/trellis/before-dev.md +29 -0
- package/dist/templates/claude/commands/trellis/check.md +25 -0
- package/dist/templates/claude/commands/trellis/create-command.md +2 -2
- package/dist/templates/claude/commands/trellis/onboard.md +13 -13
- package/dist/templates/claude/commands/trellis/parallel.md +1 -2
- package/dist/templates/claude/commands/trellis/record-session.md +3 -2
- package/dist/templates/claude/commands/trellis/start.md +8 -4
- package/dist/templates/claude/hooks/inject-subagent-context.py +29 -14
- package/dist/templates/claude/hooks/ralph-loop.py +18 -10
- package/dist/templates/claude/hooks/session-start.py +201 -9
- package/dist/templates/claude/hooks/statusline.py +211 -0
- package/dist/templates/claude/settings.json +4 -0
- package/dist/templates/codebuddy/commands/trellis/before-dev.md +29 -0
- package/dist/templates/codebuddy/commands/trellis/brainstorm.md +487 -0
- package/dist/templates/codebuddy/commands/trellis/break-loop.md +107 -0
- package/dist/templates/codebuddy/commands/trellis/check-cross-layer.md +153 -0
- package/dist/templates/codebuddy/commands/trellis/check.md +25 -0
- package/dist/templates/codebuddy/commands/trellis/create-command.md +154 -0
- package/dist/templates/codebuddy/commands/trellis/finish-work.md +143 -0
- package/dist/templates/codebuddy/commands/trellis/integrate-skill.md +219 -0
- package/dist/templates/codebuddy/commands/trellis/onboard.md +358 -0
- package/dist/templates/codebuddy/commands/trellis/record-session.md +61 -0
- package/dist/templates/codebuddy/commands/trellis/start.md +373 -0
- package/dist/templates/codebuddy/commands/trellis/update-spec.md +354 -0
- package/dist/templates/codebuddy/index.d.ts +25 -0
- package/dist/templates/codebuddy/index.d.ts.map +1 -0
- package/dist/templates/codebuddy/index.js +45 -0
- package/dist/templates/codebuddy/index.js.map +1 -0
- package/dist/templates/codex/agents/check.toml +23 -0
- package/dist/templates/codex/agents/implement.toml +19 -0
- package/dist/templates/codex/agents/research.toml +26 -0
- package/dist/templates/codex/codex-skills/parallel/SKILL.md +194 -0
- package/dist/templates/codex/config.toml +5 -0
- package/dist/templates/codex/hooks/session-start.py +228 -0
- package/dist/templates/codex/hooks.json +16 -0
- package/dist/templates/codex/index.d.ts +27 -5
- package/dist/templates/codex/index.d.ts.map +1 -1
- package/dist/templates/codex/index.js +60 -8
- package/dist/templates/codex/index.js.map +1 -1
- package/dist/templates/codex/skills/before-dev/SKILL.md +34 -0
- package/dist/templates/codex/skills/brainstorm/SKILL.md +1 -1
- package/dist/templates/codex/skills/break-loop/SKILL.md +1 -1
- package/dist/templates/codex/skills/check/SKILL.md +30 -0
- package/dist/templates/codex/skills/check-cross-layer/SKILL.md +1 -1
- package/dist/templates/codex/skills/create-command/SKILL.md +3 -3
- package/dist/templates/codex/skills/finish-work/SKILL.md +1 -1
- package/dist/templates/codex/skills/improve-ut/SKILL.md +69 -0
- package/dist/templates/codex/skills/integrate-skill/SKILL.md +1 -1
- package/dist/templates/codex/skills/onboard/SKILL.md +12 -12
- package/dist/templates/codex/skills/record-session/SKILL.md +4 -3
- package/dist/templates/codex/skills/start/SKILL.md +9 -4
- package/dist/templates/codex/skills/update-spec/SKILL.md +1 -1
- package/dist/templates/copilot/hooks/session-start.py +218 -0
- package/dist/templates/copilot/hooks.json +11 -0
- package/dist/templates/copilot/index.d.ts +23 -0
- package/dist/templates/copilot/index.d.ts.map +1 -0
- package/dist/templates/copilot/index.js +54 -0
- package/dist/templates/copilot/index.js.map +1 -0
- package/dist/templates/copilot/prompts/before-dev.prompt.md +33 -0
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +491 -0
- package/dist/templates/copilot/prompts/break-loop.prompt.md +129 -0
- package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +157 -0
- package/dist/templates/copilot/prompts/check.prompt.md +29 -0
- package/dist/templates/copilot/prompts/create-command.prompt.md +116 -0
- package/dist/templates/copilot/prompts/finish-work.prompt.md +157 -0
- package/dist/templates/copilot/prompts/integrate-skill.prompt.md +223 -0
- package/dist/templates/copilot/prompts/onboard.prompt.md +362 -0
- package/dist/templates/copilot/prompts/parallel.prompt.md +196 -0
- package/dist/templates/copilot/prompts/record-session.prompt.md +66 -0
- package/dist/templates/copilot/prompts/start.prompt.md +397 -0
- package/dist/templates/copilot/prompts/update-spec.prompt.md +358 -0
- package/dist/templates/cursor/commands/trellis-before-dev.md +29 -0
- package/dist/templates/cursor/commands/trellis-check.md +25 -0
- package/dist/templates/cursor/commands/trellis-create-command.md +2 -2
- package/dist/templates/cursor/commands/trellis-onboard.md +13 -13
- package/dist/templates/cursor/commands/trellis-record-session.md +3 -2
- package/dist/templates/cursor/commands/trellis-start.md +7 -16
- package/dist/templates/extract.d.ts +36 -0
- package/dist/templates/extract.d.ts.map +1 -1
- package/dist/templates/extract.js +64 -0
- package/dist/templates/extract.js.map +1 -1
- package/dist/templates/gemini/commands/trellis/before-dev.toml +33 -0
- package/dist/templates/gemini/commands/trellis/check.toml +29 -0
- package/dist/templates/gemini/commands/trellis/create-command.toml +2 -2
- package/dist/templates/gemini/commands/trellis/onboard.toml +2 -2
- package/dist/templates/gemini/commands/trellis/record-session.toml +3 -2
- package/dist/templates/gemini/commands/trellis/start.toml +9 -4
- package/dist/templates/iflow/agents/dispatch.md +1 -2
- package/dist/templates/iflow/agents/implement.md +2 -3
- package/dist/templates/iflow/commands/trellis/before-dev.md +29 -0
- package/dist/templates/iflow/commands/trellis/check.md +25 -0
- package/dist/templates/iflow/commands/trellis/create-command.md +2 -2
- package/dist/templates/iflow/commands/trellis/onboard.md +13 -13
- package/dist/templates/iflow/commands/trellis/parallel.md +1 -2
- package/dist/templates/iflow/commands/trellis/record-session.md +3 -2
- package/dist/templates/iflow/commands/trellis/start.md +8 -4
- package/dist/templates/iflow/hooks/inject-subagent-context.py +29 -14
- package/dist/templates/iflow/hooks/ralph-loop.py +8 -1
- package/dist/templates/iflow/hooks/session-start.py +187 -8
- package/dist/templates/kilo/workflows/before-dev.md +29 -0
- package/dist/templates/kilo/workflows/check.md +25 -0
- package/dist/templates/kilo/workflows/create-command.md +2 -2
- package/dist/templates/kilo/workflows/onboard.md +13 -13
- package/dist/templates/kilo/workflows/parallel.md +1 -2
- package/dist/templates/kilo/workflows/record-session.md +3 -2
- package/dist/templates/kilo/workflows/start.md +8 -3
- package/dist/templates/kiro/skills/before-dev/SKILL.md +34 -0
- package/dist/templates/kiro/skills/brainstorm/SKILL.md +1 -1
- package/dist/templates/kiro/skills/break-loop/SKILL.md +1 -1
- package/dist/templates/kiro/skills/check/SKILL.md +30 -0
- package/dist/templates/kiro/skills/check-cross-layer/SKILL.md +1 -1
- package/dist/templates/kiro/skills/create-command/SKILL.md +3 -3
- package/dist/templates/kiro/skills/finish-work/SKILL.md +1 -1
- package/dist/templates/kiro/skills/integrate-skill/SKILL.md +1 -1
- package/dist/templates/kiro/skills/onboard/SKILL.md +12 -12
- package/dist/templates/kiro/skills/record-session/SKILL.md +4 -3
- package/dist/templates/kiro/skills/start/SKILL.md +9 -4
- package/dist/templates/kiro/skills/update-spec/SKILL.md +1 -1
- package/dist/templates/markdown/agents.md +4 -0
- package/dist/templates/markdown/spec/backend/directory-structure.md +1 -1
- package/dist/templates/markdown/spec/backend/script-conventions.md +93 -0
- package/dist/templates/markdown/workspace-index.md +2 -0
- package/dist/templates/opencode/agents/dispatch.md +21 -21
- package/dist/templates/opencode/agents/implement.md +2 -2
- package/dist/templates/opencode/agents/research.md +1 -2
- package/dist/templates/opencode/commands/trellis/before-dev.md +29 -0
- package/dist/templates/opencode/commands/trellis/check.md +25 -0
- package/dist/templates/opencode/commands/trellis/create-command.md +2 -2
- package/dist/templates/opencode/commands/trellis/onboard.md +13 -13
- package/dist/templates/opencode/commands/trellis/parallel.md +1 -2
- package/dist/templates/opencode/commands/trellis/record-session.md +3 -2
- package/dist/templates/opencode/commands/trellis/start.md +8 -3
- package/dist/templates/opencode/lib/trellis-context.js +42 -2
- package/dist/templates/opencode/{plugin → plugins}/inject-subagent-context.js +45 -18
- package/dist/templates/opencode/{plugin → plugins}/session-start.js +156 -28
- package/dist/templates/qoder/skills/before-dev/SKILL.md +34 -0
- package/dist/templates/qoder/skills/brainstorm/SKILL.md +1 -1
- package/dist/templates/qoder/skills/break-loop/SKILL.md +1 -1
- package/dist/templates/qoder/skills/check/SKILL.md +30 -0
- package/dist/templates/qoder/skills/check-cross-layer/SKILL.md +1 -1
- package/dist/templates/qoder/skills/create-command/SKILL.md +3 -3
- package/dist/templates/qoder/skills/finish-work/SKILL.md +1 -1
- package/dist/templates/qoder/skills/integrate-skill/SKILL.md +1 -1
- package/dist/templates/qoder/skills/onboard/SKILL.md +14 -14
- package/dist/templates/qoder/skills/record-session/SKILL.md +4 -3
- package/dist/templates/qoder/skills/start/SKILL.md +9 -4
- package/dist/templates/qoder/skills/update-spec/SKILL.md +1 -1
- package/dist/templates/trellis/config.yaml +20 -0
- package/dist/templates/trellis/index.d.ts +11 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +22 -0
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add_session.py +111 -13
- package/dist/templates/trellis/scripts/common/__init__.py +2 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +164 -64
- package/dist/templates/trellis/scripts/common/config.py +192 -0
- package/dist/templates/trellis/scripts/common/developer.py +2 -2
- package/dist/templates/trellis/scripts/common/git.py +31 -0
- package/dist/templates/trellis/scripts/common/git_context.py +23 -586
- package/dist/templates/trellis/scripts/common/io.py +37 -0
- package/dist/templates/trellis/scripts/common/log.py +45 -0
- package/dist/templates/trellis/scripts/common/packages_context.py +238 -0
- package/dist/templates/trellis/scripts/common/paths.py +103 -6
- package/dist/templates/trellis/scripts/common/phase.py +50 -49
- package/dist/templates/trellis/scripts/common/registry.py +41 -72
- package/dist/templates/trellis/scripts/common/session_context.py +562 -0
- package/dist/templates/trellis/scripts/common/task_context.py +410 -0
- package/dist/templates/trellis/scripts/common/task_queue.py +27 -98
- package/dist/templates/trellis/scripts/common/task_store.py +536 -0
- package/dist/templates/trellis/scripts/common/task_utils.py +106 -10
- package/dist/templates/trellis/scripts/common/tasks.py +109 -0
- package/dist/templates/trellis/scripts/common/types.py +112 -0
- package/dist/templates/trellis/scripts/create_bootstrap.py +32 -27
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +243 -0
- package/dist/templates/trellis/scripts/multi_agent/_bootstrap.py +17 -0
- package/dist/templates/trellis/scripts/multi_agent/cleanup.py +43 -48
- package/dist/templates/trellis/scripts/multi_agent/create_pr.py +336 -45
- package/dist/templates/trellis/scripts/multi_agent/plan.py +9 -32
- package/dist/templates/trellis/scripts/multi_agent/start.py +142 -68
- package/dist/templates/trellis/scripts/multi_agent/status.py +12 -753
- package/dist/templates/trellis/scripts/multi_agent/status_display.py +542 -0
- package/dist/templates/trellis/scripts/multi_agent/status_monitor.py +225 -0
- package/dist/templates/trellis/scripts/task.py +51 -976
- package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +1 -1
- package/dist/templates/trellis/workflow.md +38 -38
- package/dist/templates/windsurf/index.d.ts +21 -0
- package/dist/templates/windsurf/index.d.ts.map +1 -0
- package/dist/templates/windsurf/index.js +44 -0
- package/dist/templates/windsurf/index.js.map +1 -0
- package/dist/templates/windsurf/workflows/trellis-before-dev.md +31 -0
- package/dist/templates/windsurf/workflows/trellis-brainstorm.md +491 -0
- package/dist/templates/windsurf/workflows/trellis-break-loop.md +111 -0
- package/dist/templates/windsurf/workflows/trellis-check-cross-layer.md +157 -0
- package/dist/templates/windsurf/workflows/trellis-check.md +27 -0
- package/dist/templates/windsurf/workflows/trellis-create-command.md +154 -0
- package/dist/templates/windsurf/workflows/trellis-finish-work.md +147 -0
- package/dist/templates/windsurf/workflows/trellis-integrate-skill.md +220 -0
- package/dist/templates/windsurf/workflows/trellis-onboard.md +362 -0
- package/dist/templates/windsurf/workflows/trellis-record-session.md +66 -0
- package/dist/templates/windsurf/workflows/trellis-start.md +373 -0
- package/dist/templates/windsurf/workflows/trellis-update-spec.md +358 -0
- package/dist/types/ai-tools.d.ts +15 -3
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +42 -2
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/types/migration.d.ts +3 -1
- package/dist/types/migration.d.ts.map +1 -1
- package/dist/utils/project-detector.d.ts +28 -0
- package/dist/utils/project-detector.d.ts.map +1 -1
- package/dist/utils/project-detector.js +371 -0
- package/dist/utils/project-detector.js.map +1 -1
- package/dist/utils/template-fetcher.d.ts +19 -6
- package/dist/utils/template-fetcher.d.ts.map +1 -1
- package/dist/utils/template-fetcher.js +99 -17
- package/dist/utils/template-fetcher.js.map +1 -1
- package/package.json +1 -1
- package/dist/templates/claude/commands/trellis/before-backend-dev.md +0 -13
- package/dist/templates/claude/commands/trellis/before-frontend-dev.md +0 -13
- package/dist/templates/claude/commands/trellis/check-backend.md +0 -13
- package/dist/templates/claude/commands/trellis/check-frontend.md +0 -13
- package/dist/templates/codex/skills/before-backend-dev/SKILL.md +0 -18
- package/dist/templates/codex/skills/before-frontend-dev/SKILL.md +0 -18
- package/dist/templates/codex/skills/check-backend/SKILL.md +0 -18
- package/dist/templates/codex/skills/check-frontend/SKILL.md +0 -18
- package/dist/templates/cursor/commands/trellis-before-backend-dev.md +0 -13
- package/dist/templates/cursor/commands/trellis-before-frontend-dev.md +0 -13
- package/dist/templates/cursor/commands/trellis-check-backend.md +0 -13
- package/dist/templates/cursor/commands/trellis-check-frontend.md +0 -13
- package/dist/templates/gemini/commands/trellis/before-backend-dev.toml +0 -17
- package/dist/templates/gemini/commands/trellis/before-frontend-dev.toml +0 -17
- package/dist/templates/gemini/commands/trellis/check-backend.toml +0 -17
- package/dist/templates/gemini/commands/trellis/check-frontend.toml +0 -17
- package/dist/templates/iflow/commands/trellis/before-backend-dev.md +0 -13
- package/dist/templates/iflow/commands/trellis/before-frontend-dev.md +0 -13
- package/dist/templates/iflow/commands/trellis/check-backend.md +0 -13
- package/dist/templates/iflow/commands/trellis/check-frontend.md +0 -13
- package/dist/templates/kilo/workflows/before-backend-dev.md +0 -13
- package/dist/templates/kilo/workflows/before-frontend-dev.md +0 -13
- package/dist/templates/kilo/workflows/check-backend.md +0 -13
- package/dist/templates/kilo/workflows/check-frontend.md +0 -13
- package/dist/templates/kiro/skills/before-backend-dev/SKILL.md +0 -18
- package/dist/templates/kiro/skills/before-frontend-dev/SKILL.md +0 -18
- package/dist/templates/kiro/skills/check-backend/SKILL.md +0 -18
- package/dist/templates/kiro/skills/check-frontend/SKILL.md +0 -18
- package/dist/templates/opencode/commands/trellis/before-backend-dev.md +0 -13
- package/dist/templates/opencode/commands/trellis/before-frontend-dev.md +0 -13
- package/dist/templates/opencode/commands/trellis/check-backend.md +0 -13
- package/dist/templates/opencode/commands/trellis/check-frontend.md +0 -13
- package/dist/templates/qoder/skills/before-backend-dev/SKILL.md +0 -18
- package/dist/templates/qoder/skills/before-frontend-dev/SKILL.md +0 -18
- package/dist/templates/qoder/skills/check-backend/SKILL.md +0 -18
- package/dist/templates/qoder/skills/check-frontend/SKILL.md +0 -18
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: onboard
|
|
3
|
-
description: "
|
|
3
|
+
description: "Interactive three-part onboarding for new team members to the Trellis AI-assisted workflow system. Covers core philosophy (AI memory, project-specific knowledge, context drift), system structure and command deep-dives, real-world workflow examples, and guideline customization. Use when a new developer joins the project, someone needs to understand the Trellis workflow, or project guidelines need initial setup."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
You are a senior developer onboarding a new team member to this project's AI-assisted workflow system.
|
|
@@ -131,13 +131,13 @@ AI needs the same onboarding - but compressed into seconds at session start.
|
|
|
131
131
|
|
|
132
132
|
---
|
|
133
133
|
|
|
134
|
-
### $before-
|
|
134
|
+
### $before-dev - Inject Specialized Knowledge
|
|
135
135
|
|
|
136
136
|
**WHY IT EXISTS**:
|
|
137
137
|
AI models have "pre-trained knowledge" - general patterns from millions of codebases. But YOUR project has specific conventions that differ from generic patterns.
|
|
138
138
|
|
|
139
139
|
**WHAT IT ACTUALLY DOES**:
|
|
140
|
-
1.
|
|
140
|
+
1. Discovers spec layers via `get_context.py --mode packages` and reads relevant guidelines
|
|
141
141
|
2. Loads project-specific patterns into AI's working context:
|
|
142
142
|
- Component naming conventions
|
|
143
143
|
- State management patterns
|
|
@@ -145,12 +145,12 @@ AI models have "pre-trained knowledge" - general patterns from millions of codeb
|
|
|
145
145
|
- Error handling standards
|
|
146
146
|
|
|
147
147
|
**WHY THIS MATTERS**:
|
|
148
|
-
- Without before
|
|
149
|
-
- With before
|
|
148
|
+
- Without before-dev: AI writes generic code that doesn't match project style.
|
|
149
|
+
- With before-dev: AI writes code that looks like the rest of the codebase.
|
|
150
150
|
|
|
151
151
|
---
|
|
152
152
|
|
|
153
|
-
### $check
|
|
153
|
+
### $check - Combat Context Drift
|
|
154
154
|
|
|
155
155
|
**WHY IT EXISTS**:
|
|
156
156
|
AI context window has limited capacity. As conversation progresses, guidelines injected at session start become less influential. This causes "context drift."
|
|
@@ -216,9 +216,9 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
216
216
|
|
|
217
217
|
**[1/8] $start** - AI needs project context before touching code
|
|
218
218
|
**[2/8] python3 ./.trellis/scripts/task.py create "Fix bug" --slug fix-bug** - Track work for future reference
|
|
219
|
-
**[3/8] $before-
|
|
219
|
+
**[3/8] $before-dev** - Inject project-specific development guidelines
|
|
220
220
|
**[4/8] Investigate and fix the bug** - Actual development work
|
|
221
|
-
**[5/8] $check
|
|
221
|
+
**[5/8] $check** - Re-verify code against guidelines
|
|
222
222
|
**[6/8] $finish-work** - Holistic cross-layer review
|
|
223
223
|
**[7/8] Human tests and commits** - Human validates before code enters repo
|
|
224
224
|
**[8/8] $record-session** - Persist memory for future sessions
|
|
@@ -233,9 +233,9 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
233
233
|
### Example 3: Code Review Fixes
|
|
234
234
|
|
|
235
235
|
**[1/6] $start** - Resume context from previous session
|
|
236
|
-
**[2/6] $before-
|
|
236
|
+
**[2/6] $before-dev** - Re-inject guidelines before fixes
|
|
237
237
|
**[3/6] Fix each CR issue** - Address feedback with guidelines in context
|
|
238
|
-
**[4/6] $check
|
|
238
|
+
**[4/6] $check** - Verify fixes did not introduce new issues
|
|
239
239
|
**[5/6] $finish-work** - Document lessons from CR
|
|
240
240
|
**[6/6] Human commits, then $record-session** - Preserve CR lessons
|
|
241
241
|
|
|
@@ -250,9 +250,9 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
250
250
|
### Example 5: Debug Session
|
|
251
251
|
|
|
252
252
|
**[1/6] $start** - See if this bug was investigated before
|
|
253
|
-
**[2/6] $before-
|
|
253
|
+
**[2/6] $before-dev** - Guidelines might document known gotchas
|
|
254
254
|
**[3/6] Investigation** - Actual debugging work
|
|
255
|
-
**[4/6] $check
|
|
255
|
+
**[4/6] $check** - Verify debug changes do not break other things
|
|
256
256
|
**[5/6] $finish-work** - Debug findings might need documentation
|
|
257
257
|
**[6/6] Human commits, then $record-session** - Debug knowledge is valuable
|
|
258
258
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: record-session
|
|
3
|
-
description: "
|
|
3
|
+
description: "Records completed work progress to .trellis/workspace/ journal files after human testing and commit. Captures session summaries, commit hashes, and updates developer index files for future session context. Use when a coding session is complete, after the human has committed code, or to persist session knowledge for future AI sessions."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
[!] **Prerequisite**: This skill should only be used AFTER the human has tested and committed the code.
|
|
@@ -36,7 +36,7 @@ python3 ./.trellis/scripts/add_session.py \
|
|
|
36
36
|
--summary "Brief summary of what was done"
|
|
37
37
|
|
|
38
38
|
# Method 2: Pass detailed content via stdin
|
|
39
|
-
cat << 'EOF' | python3 ./.trellis/scripts/add_session.py --title "Title" --commit "hash"
|
|
39
|
+
cat << 'EOF' | python3 ./.trellis/scripts/add_session.py --stdin --title "Title" --commit "hash"
|
|
40
40
|
| Feature | Description |
|
|
41
41
|
|---------|-------------|
|
|
42
42
|
| New API | Added user authentication endpoint |
|
|
@@ -51,6 +51,7 @@ EOF
|
|
|
51
51
|
**Auto-completes**:
|
|
52
52
|
- [OK] Appends session to journal-N.md
|
|
53
53
|
- [OK] Auto-detects line count, creates new file if >2000 lines
|
|
54
|
+
- [OK] Auto-detects Branch context (`--branch` override; otherwise Branch = task.json -> current git branch; missing values are omitted gracefully)
|
|
54
55
|
- [OK] Updates index.md (Total Sessions +1, Last Active, line stats, history)
|
|
55
56
|
- [OK] Auto-commits .trellis/workspace and .trellis/tasks changes
|
|
56
57
|
|
|
@@ -61,6 +62,6 @@ EOF
|
|
|
61
62
|
| Command | Purpose |
|
|
62
63
|
|---------|---------|
|
|
63
64
|
| `python3 ./.trellis/scripts/get_context.py --mode record` | Get context for record-session |
|
|
64
|
-
| `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended)** |
|
|
65
|
+
| `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended, branch auto-complete)** |
|
|
65
66
|
| `python3 ./.trellis/scripts/task.py archive <name>` | Archive completed task (auto-commits) |
|
|
66
67
|
| `python3 ./.trellis/scripts/task.py list` | List active tasks |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: start
|
|
3
|
-
description: "
|
|
3
|
+
description: "Initializes an AI development session by reading workflow guides, developer identity, git status, active tasks, and project guidelines from .trellis/. Classifies incoming tasks and routes to brainstorm, direct edit, or task workflow. Use when beginning a new coding session, resuming work, starting a new task, or re-establishing project context."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Start Session
|
|
@@ -45,9 +45,14 @@ This shows: developer identity, git status, current task (if any), active tasks.
|
|
|
45
45
|
### Step 3: Read Guidelines Index
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
python3 ./.trellis/scripts/get_context.py --mode packages
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This shows available packages and their spec layers. Read the relevant spec indexes:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cat .trellis/spec/<package>/<layer>/index.md # Package-specific guidelines
|
|
55
|
+
cat .trellis/spec/guides/index.md # Thinking guides (always read)
|
|
51
56
|
```
|
|
52
57
|
|
|
53
58
|
> **Important**: The index files are navigation — they list the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: update-spec
|
|
3
|
-
description: "
|
|
3
|
+
description: "Captures executable contracts and coding knowledge into .trellis/spec/ documents after implementation, debugging, or design decisions. Enforces code-spec depth for infra and cross-layer changes with mandatory sections for signatures, contracts, validation matrices, and test points. Use when a feature is implemented, a bug is fixed, a design decision is made, a new pattern is discovered, or cross-layer contracts change."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Update Code-Spec - Capture Executable Contracts
|
|
@@ -13,6 +13,10 @@ Use `@/.trellis/` to learn:
|
|
|
13
13
|
- Project structure guidelines (`spec/`)
|
|
14
14
|
- Developer workspace (`workspace/`)
|
|
15
15
|
|
|
16
|
+
If you're using Codex, project-scoped helpers may also live in:
|
|
17
|
+
- `.agents/skills/` for reusable Trellis skills
|
|
18
|
+
- `.codex/agents/` for optional custom subagents
|
|
19
|
+
|
|
16
20
|
Keep this managed block so 'trellis update' can refresh the instructions.
|
|
17
21
|
|
|
18
22
|
<!-- TRELLIS:END -->
|
|
@@ -239,7 +239,7 @@ Templates use `.txt` extension to:
|
|
|
239
239
|
```typescript
|
|
240
240
|
import { downloadTemplate } from "giget";
|
|
241
241
|
|
|
242
|
-
await downloadTemplate("gh:mindfold-ai/
|
|
242
|
+
await downloadTemplate("gh:mindfold-ai/marketplace/specs/electron-fullstack", {
|
|
243
243
|
dir: destDir,
|
|
244
244
|
preferOffline: true,
|
|
245
245
|
});
|
|
@@ -502,6 +502,99 @@ parser.add_argument(
|
|
|
502
502
|
|
|
503
503
|
---
|
|
504
504
|
|
|
505
|
+
## Parsing Structured Command Output
|
|
506
|
+
|
|
507
|
+
### CRITICAL: Preserve Semantic Whitespace
|
|
508
|
+
|
|
509
|
+
Many CLI tools encode status information in leading/trailing whitespace characters. **Never blindly `.strip()` before parsing.**
|
|
510
|
+
|
|
511
|
+
**Example — `git submodule status` output format**:
|
|
512
|
+
|
|
513
|
+
```
|
|
514
|
+
abc1234 path/to/submodule (v1.0) ← space prefix = initialized
|
|
515
|
+
-def5678 path/to/other (v2.0) ← minus prefix = not initialized
|
|
516
|
+
+ghi9012 path/to/modified (v3.0) ← plus prefix = modified (out of sync)
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
```python
|
|
520
|
+
# BAD — .strip() removes the leading space that means "initialized"
|
|
521
|
+
status_line = status_out.strip()
|
|
522
|
+
prefix = status_line[0] # Reads commit hash char, not status prefix!
|
|
523
|
+
|
|
524
|
+
# GOOD — parse the raw line, then strip individual fields
|
|
525
|
+
raw_line = status_out.rstrip("\n") # Only remove trailing newline
|
|
526
|
+
if not raw_line:
|
|
527
|
+
continue
|
|
528
|
+
prefix = raw_line[0] # ' ', '-', or '+'
|
|
529
|
+
rest = raw_line[1:].strip() # Now safe to strip the rest
|
|
530
|
+
commit_hash = rest.split()[0]
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
**General rule**: When a command's output uses positional formatting (columns, prefixes, fixed-width fields), parse the structure first, then clean up individual values.
|
|
534
|
+
|
|
535
|
+
**Other commands with semantic whitespace**:
|
|
536
|
+
- `git status --porcelain` — two-char status prefix (`XY`)
|
|
537
|
+
- `git diff --name-status` — tab-separated with status prefix
|
|
538
|
+
- `docker ps --format` — column-aligned output
|
|
539
|
+
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
## Monorepo Config API (`common/config.py`)
|
|
543
|
+
|
|
544
|
+
### Config Functions
|
|
545
|
+
|
|
546
|
+
| Function | Return | Purpose |
|
|
547
|
+
|----------|--------|---------|
|
|
548
|
+
| `is_monorepo(repo_root)` | `bool` | Whether `packages:` exists in config.yaml |
|
|
549
|
+
| `get_packages(repo_root)` | `dict[str, dict] \| None` | All packages from config.yaml (`{name: {path, type?}}`) |
|
|
550
|
+
| `get_default_package(repo_root)` | `str \| None` | The `default_package` from config.yaml |
|
|
551
|
+
| `get_submodule_packages(repo_root)` | `dict[str, str]` | Packages with `type: submodule` (`{name: path}`) |
|
|
552
|
+
| `get_spec_base(package, repo_root)` | `str` | `"spec"` (single-repo) or `"spec/<package>"` (monorepo) |
|
|
553
|
+
| `validate_package(package, repo_root)` | `bool` | Whether package exists in config (always `True` for single-repo) |
|
|
554
|
+
| `resolve_package(task_pkg, repo_root)` | `str \| None` | Resolve package: task → default → None |
|
|
555
|
+
| `get_spec_scope(repo_root)` | `str \| list \| None` | The `session.spec_scope` config value |
|
|
556
|
+
| `get_hooks(event, repo_root)` | `list[str]` | Hook commands for lifecycle event |
|
|
557
|
+
|
|
558
|
+
### Config.yaml Schema
|
|
559
|
+
|
|
560
|
+
```yaml
|
|
561
|
+
# Auto-detected monorepo packages (written by trellis init)
|
|
562
|
+
packages:
|
|
563
|
+
cli:
|
|
564
|
+
path: packages/cli
|
|
565
|
+
docs-site:
|
|
566
|
+
path: docs-site
|
|
567
|
+
type: submodule # optional, marks git submodule
|
|
568
|
+
default_package: cli # first non-submodule package
|
|
569
|
+
|
|
570
|
+
# Session behavior
|
|
571
|
+
session:
|
|
572
|
+
spec_scope: active_task # or ["cli", "docs-site"] or omit for full scan
|
|
573
|
+
|
|
574
|
+
# Update behavior
|
|
575
|
+
update:
|
|
576
|
+
skip:
|
|
577
|
+
- .claude/commands/trellis/my-custom.md
|
|
578
|
+
|
|
579
|
+
# Lifecycle hooks
|
|
580
|
+
hooks:
|
|
581
|
+
after_create:
|
|
582
|
+
- "python3 .trellis/scripts/hooks/my_hook.py create"
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
### Worktree Submodule Initialization
|
|
586
|
+
|
|
587
|
+
When `start.py` creates a worktree for a task, it calls `_init_submodules_for_task()`:
|
|
588
|
+
|
|
589
|
+
1. Read `packages` from config.yaml via `get_packages()`
|
|
590
|
+
2. Resolve target package from task data or `default_package`
|
|
591
|
+
3. Check if the package is a submodule via `get_submodule_packages()`
|
|
592
|
+
4. Run `git submodule status <path>` in the worktree
|
|
593
|
+
5. Parse the status prefix (see "Parsing Structured Command Output" above)
|
|
594
|
+
6. If uninitialized (`-` prefix): run `git submodule update --init <path>`
|
|
595
|
+
|
|
596
|
+
---
|
|
597
|
+
|
|
505
598
|
## Error Handling
|
|
506
599
|
|
|
507
600
|
### Exit Codes
|
|
@@ -73,6 +73,7 @@ This will:
|
|
|
73
73
|
|
|
74
74
|
Each session should include:
|
|
75
75
|
- Summary: One-line description
|
|
76
|
+
- Branch: Which branch the work was done on
|
|
76
77
|
- Main Changes: What was modified
|
|
77
78
|
- Git Commits: Commit hashes and messages
|
|
78
79
|
- Next Steps: What to do next
|
|
@@ -88,6 +89,7 @@ Use this template when recording sessions:
|
|
|
88
89
|
|
|
89
90
|
**Date**: YYYY-MM-DD
|
|
90
91
|
**Task**: {task-name}
|
|
92
|
+
**Branch**: `{branch-name}`
|
|
91
93
|
|
|
92
94
|
### Summary
|
|
93
95
|
|
|
@@ -71,6 +71,10 @@ Execute each step in `phase` order.
|
|
|
71
71
|
|
|
72
72
|
> Hook will auto-inject all specs, requirements, and technical design to subagent context.
|
|
73
73
|
> Dispatch only needs to issue simple call commands.
|
|
74
|
+
>
|
|
75
|
+
> **OpenCode dispatch rule**: Call subagents synchronously (`run_in_background: false`).
|
|
76
|
+
> Do NOT use `TaskOutput` or background polling as the completion signal for child phases.
|
|
77
|
+
> The background wrapper can finish before the real subagent session is actually done.
|
|
74
78
|
|
|
75
79
|
### action: "implement"
|
|
76
80
|
|
|
@@ -79,7 +83,7 @@ Task(
|
|
|
79
83
|
subagent_type: "implement",
|
|
80
84
|
prompt: "Implement the feature described in prd.md in the task directory",
|
|
81
85
|
model: "opus",
|
|
82
|
-
run_in_background:
|
|
86
|
+
run_in_background: false
|
|
83
87
|
)
|
|
84
88
|
```
|
|
85
89
|
|
|
@@ -98,7 +102,7 @@ Task(
|
|
|
98
102
|
subagent_type: "check",
|
|
99
103
|
prompt: "Check code changes, fix issues yourself",
|
|
100
104
|
model: "opus",
|
|
101
|
-
run_in_background:
|
|
105
|
+
run_in_background: false
|
|
102
106
|
)
|
|
103
107
|
```
|
|
104
108
|
|
|
@@ -106,8 +110,7 @@ Hook will auto-inject:
|
|
|
106
110
|
|
|
107
111
|
- finish-work.md
|
|
108
112
|
- check-cross-layer.md
|
|
109
|
-
- check
|
|
110
|
-
- check-frontend.md
|
|
113
|
+
- check.md
|
|
111
114
|
- All spec files from check.jsonl
|
|
112
115
|
|
|
113
116
|
### action: "debug"
|
|
@@ -117,7 +120,7 @@ Task(
|
|
|
117
120
|
subagent_type: "debug",
|
|
118
121
|
prompt: "Fix the issues described in the task context",
|
|
119
122
|
model: "opus",
|
|
120
|
-
run_in_background:
|
|
123
|
+
run_in_background: false
|
|
121
124
|
)
|
|
122
125
|
```
|
|
123
126
|
|
|
@@ -133,7 +136,7 @@ Task(
|
|
|
133
136
|
subagent_type: "check",
|
|
134
137
|
prompt: "[finish] Execute final completion check before PR",
|
|
135
138
|
model: "opus",
|
|
136
|
-
run_in_background:
|
|
139
|
+
run_in_background: false
|
|
137
140
|
)
|
|
138
141
|
```
|
|
139
142
|
|
|
@@ -169,27 +172,23 @@ This will:
|
|
|
169
172
|
### Basic Pattern
|
|
170
173
|
|
|
171
174
|
```
|
|
172
|
-
|
|
175
|
+
result = Task(
|
|
173
176
|
subagent_type: "implement", // or "check", "debug"
|
|
174
177
|
prompt: "Simple task description",
|
|
175
178
|
model: "opus",
|
|
176
|
-
run_in_background:
|
|
179
|
+
run_in_background: false
|
|
177
180
|
)
|
|
178
181
|
|
|
179
|
-
//
|
|
180
|
-
|
|
181
|
-
result = TaskOutput(task_id, block=true, timeout=300000)
|
|
182
|
-
if result.status == "completed":
|
|
183
|
-
break
|
|
182
|
+
// Wait for the Task call to return before starting the next phase.
|
|
183
|
+
// Do NOT call TaskOutput or use background polling inside OpenCode dispatch.
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
###
|
|
186
|
+
### Execution Rule
|
|
187
187
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
| debug | 20 min | 4 times |
|
|
188
|
+
- Run one phase at a time
|
|
189
|
+
- Start the next phase only after the current `Task(...)` call returns
|
|
190
|
+
- If a phase returns a clear timeout or failure, handle that result explicitly
|
|
191
|
+
- Do **not** simulate completion by polling a background task wrapper
|
|
193
192
|
|
|
194
193
|
---
|
|
195
194
|
|
|
@@ -197,7 +196,7 @@ for i in 1..N:
|
|
|
197
196
|
|
|
198
197
|
### Timeout
|
|
199
198
|
|
|
200
|
-
If a subagent times out, notify the user and ask for guidance:
|
|
199
|
+
If a synchronous subagent call times out, notify the user and ask for guidance:
|
|
201
200
|
|
|
202
201
|
```
|
|
203
202
|
"Subagent {phase} timed out after {time}. Options:
|
|
@@ -208,10 +207,11 @@ If a subagent times out, notify the user and ask for guidance:
|
|
|
208
207
|
|
|
209
208
|
### Subagent Failure
|
|
210
209
|
|
|
211
|
-
If a subagent reports failure, read the output and decide:
|
|
210
|
+
If a synchronous subagent call reports failure, read the output and decide:
|
|
212
211
|
|
|
213
212
|
- If recoverable: call debug agent to fix
|
|
214
213
|
- If not recoverable: notify user and ask for guidance
|
|
214
|
+
- Do not switch back to `TaskOutput` polling for the same phase
|
|
215
215
|
|
|
216
216
|
---
|
|
217
217
|
|
|
@@ -65,8 +65,8 @@ Before implementing, read:
|
|
|
65
65
|
|
|
66
66
|
Read relevant specs based on task type:
|
|
67
67
|
|
|
68
|
-
-
|
|
69
|
-
-
|
|
68
|
+
- Spec layers: `.trellis/spec/<package>/<layer>/`
|
|
69
|
+
- Shared guides: `.trellis/spec/guides/`
|
|
70
70
|
- Guides: `.trellis/spec/guides/`
|
|
71
71
|
|
|
72
72
|
### 2. Understand Requirements
|
|
@@ -29,8 +29,7 @@ Otherwise, if task-specific research is needed:
|
|
|
29
29
|
- If `path` is a directory → Read all `.md` files in it
|
|
30
30
|
|
|
31
31
|
Project spec locations for reference:
|
|
32
|
-
- `.trellis/spec
|
|
33
|
-
- `.trellis/spec/frontend/` - Frontend standards
|
|
32
|
+
- `.trellis/spec/<package>/<layer>/` - Package-specific standards
|
|
34
33
|
- `.trellis/spec/guides/` - Thinking guides
|
|
35
34
|
- `.trellis/big-question/` - Known issues and pitfalls
|
|
36
35
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Read the relevant development guidelines before starting your task.
|
|
2
|
+
|
|
3
|
+
Execute these steps:
|
|
4
|
+
|
|
5
|
+
1. **Discover packages and their spec layers**:
|
|
6
|
+
```bash
|
|
7
|
+
python3 ./.trellis/scripts/get_context.py --mode packages
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
2. **Identify which specs apply** to your task based on:
|
|
11
|
+
- Which package you're modifying (e.g., `cli/`, `docs-site/`)
|
|
12
|
+
- What type of work (backend, frontend, unit-test, docs, etc.)
|
|
13
|
+
|
|
14
|
+
3. **Read the spec index** for each relevant module:
|
|
15
|
+
```bash
|
|
16
|
+
cat .trellis/spec/<package>/<layer>/index.md
|
|
17
|
+
```
|
|
18
|
+
Follow the **"Pre-Development Checklist"** section in the index.
|
|
19
|
+
|
|
20
|
+
4. **Read the specific guideline files** listed in the Pre-Development Checklist that are relevant to your task. The index is NOT the goal — it points you to the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`). Read those files to understand the coding standards and patterns.
|
|
21
|
+
|
|
22
|
+
5. **Always read shared guides**:
|
|
23
|
+
```bash
|
|
24
|
+
cat .trellis/spec/guides/index.md
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
6. Understand the coding standards and patterns you need to follow, then proceed with your development plan.
|
|
28
|
+
|
|
29
|
+
This step is **mandatory** before writing any code.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Check if the code you just wrote follows the development guidelines.
|
|
2
|
+
|
|
3
|
+
Execute these steps:
|
|
4
|
+
|
|
5
|
+
1. **Identify changed files**:
|
|
6
|
+
```bash
|
|
7
|
+
git diff --name-only HEAD
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
2. **Determine which spec modules apply** based on the changed file paths:
|
|
11
|
+
```bash
|
|
12
|
+
python3 ./.trellis/scripts/get_context.py --mode packages
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
3. **Read the spec index** for each relevant module:
|
|
16
|
+
```bash
|
|
17
|
+
cat .trellis/spec/<package>/<layer>/index.md
|
|
18
|
+
```
|
|
19
|
+
Follow the **"Quality Check"** section in the index.
|
|
20
|
+
|
|
21
|
+
4. **Read the specific guideline files** referenced in the Quality Check section (e.g., `quality-guidelines.md`, `conventions.md`). The index is NOT the goal — it points you to the actual guideline files. Read those files and review your code against them.
|
|
22
|
+
|
|
23
|
+
5. **Run lint and typecheck** for the affected package.
|
|
24
|
+
|
|
25
|
+
6. **Report any violations** and fix them if found.
|
|
@@ -101,8 +101,8 @@ Description:
|
|
|
101
101
|
| Command Type | Prefix | Example |
|
|
102
102
|
|--------------|--------|---------|
|
|
103
103
|
| Session Start | `start` | `start` |
|
|
104
|
-
| Pre-development | `before-` | `before-
|
|
105
|
-
| Check | `check-` | `check
|
|
104
|
+
| Pre-development | `before-` | `before-dev` |
|
|
105
|
+
| Check | `check-` | `check` |
|
|
106
106
|
| Record | `record-` | `record-session` |
|
|
107
107
|
| Generate | `generate-` | `generate-api-doc` |
|
|
108
108
|
| Update | `update-` | `update-changelog` |
|
|
@@ -126,13 +126,13 @@ AI needs the same onboarding - but compressed into seconds at session start.
|
|
|
126
126
|
|
|
127
127
|
---
|
|
128
128
|
|
|
129
|
-
### /trellis:before-
|
|
129
|
+
### /trellis:before-dev - Inject Specialized Knowledge
|
|
130
130
|
|
|
131
131
|
**WHY IT EXISTS**:
|
|
132
132
|
AI models have "pre-trained knowledge" - general patterns from millions of codebases. But YOUR project has specific conventions that differ from generic patterns.
|
|
133
133
|
|
|
134
134
|
**WHAT IT ACTUALLY DOES**:
|
|
135
|
-
1.
|
|
135
|
+
1. Discovers spec layers via `get_context.py --mode packages` and reads relevant guidelines
|
|
136
136
|
2. Loads project-specific patterns into AI's working context:
|
|
137
137
|
- Component naming conventions
|
|
138
138
|
- State management patterns
|
|
@@ -140,12 +140,12 @@ AI models have "pre-trained knowledge" - general patterns from millions of codeb
|
|
|
140
140
|
- Error handling standards
|
|
141
141
|
|
|
142
142
|
**WHY THIS MATTERS**:
|
|
143
|
-
- Without before
|
|
144
|
-
- With before
|
|
143
|
+
- Without before-dev: AI writes generic code that doesn't match project style.
|
|
144
|
+
- With before-dev: AI writes code that looks like the rest of the codebase.
|
|
145
145
|
|
|
146
146
|
---
|
|
147
147
|
|
|
148
|
-
### /trellis:check
|
|
148
|
+
### /trellis:check - Combat Context Drift
|
|
149
149
|
|
|
150
150
|
**WHY IT EXISTS**:
|
|
151
151
|
AI context window has limited capacity. As conversation progresses, guidelines injected at session start become less influential. This causes "context drift."
|
|
@@ -211,9 +211,9 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
211
211
|
|
|
212
212
|
**[1/8] /trellis:start** - AI needs project context before touching code
|
|
213
213
|
**[2/8] python3 ./.trellis/scripts/task.py create "Fix bug" --slug fix-bug** - Track work for future reference
|
|
214
|
-
**[3/8] /trellis:before-
|
|
214
|
+
**[3/8] /trellis:before-dev** - Inject project-specific development guidelines
|
|
215
215
|
**[4/8] Investigate and fix the bug** - Actual development work
|
|
216
|
-
**[5/8] /trellis:check
|
|
216
|
+
**[5/8] /trellis:check** - Re-verify code against guidelines
|
|
217
217
|
**[6/8] /trellis:finish-work** - Holistic cross-layer review
|
|
218
218
|
**[7/8] Human tests and commits** - Human validates before code enters repo
|
|
219
219
|
**[8/8] /trellis:record-session** - Persist memory for future sessions
|
|
@@ -228,9 +228,9 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
228
228
|
### Example 3: Code Review Fixes
|
|
229
229
|
|
|
230
230
|
**[1/6] /trellis:start** - Resume context from previous session
|
|
231
|
-
**[2/6] /trellis:before-
|
|
231
|
+
**[2/6] /trellis:before-dev** - Re-inject guidelines before fixes
|
|
232
232
|
**[3/6] Fix each CR issue** - Address feedback with guidelines in context
|
|
233
|
-
**[4/6] /trellis:check
|
|
233
|
+
**[4/6] /trellis:check** - Verify fixes did not introduce new issues
|
|
234
234
|
**[5/6] /trellis:finish-work** - Document lessons from CR
|
|
235
235
|
**[6/6] Human commits, then /trellis:record-session** - Preserve CR lessons
|
|
236
236
|
|
|
@@ -238,16 +238,16 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
238
238
|
|
|
239
239
|
**[1/5] /trellis:start** - Clear baseline before major changes
|
|
240
240
|
**[2/5] Plan phases** - Break into verifiable chunks
|
|
241
|
-
**[3/5] Execute phase by phase with /check
|
|
241
|
+
**[3/5] Execute phase by phase with /trellis:check after each** - Incremental verification
|
|
242
242
|
**[4/5] /trellis:finish-work** - Check if new patterns should be documented
|
|
243
243
|
**[5/5] Record with multiple commit hashes** - Link all commits to one feature
|
|
244
244
|
|
|
245
245
|
### Example 5: Debug Session
|
|
246
246
|
|
|
247
247
|
**[1/6] /trellis:start** - See if this bug was investigated before
|
|
248
|
-
**[2/6] /trellis:before-
|
|
248
|
+
**[2/6] /trellis:before-dev** - Guidelines might document known gotchas
|
|
249
249
|
**[3/6] Investigation** - Actual debugging work
|
|
250
|
-
**[4/6] /trellis:check
|
|
250
|
+
**[4/6] /trellis:check** - Verify debug changes do not break other things
|
|
251
251
|
**[5/6] /trellis:finish-work** - Debug findings might need documentation
|
|
252
252
|
**[6/6] Human commits, then /trellis:record-session** - Debug knowledge is valuable
|
|
253
253
|
|
|
@@ -256,7 +256,7 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
256
256
|
## KEY RULES TO EMPHASIZE
|
|
257
257
|
|
|
258
258
|
1. **AI NEVER commits** - Human tests and approves. AI prepares, human validates.
|
|
259
|
-
2. **Guidelines before code** - /before
|
|
259
|
+
2. **Guidelines before code** - /before-dev command injects project knowledge.
|
|
260
260
|
3. **Check after code** - /check-* commands catch context drift.
|
|
261
261
|
4. **Record everything** - /trellis:record-session persists memory.
|
|
262
262
|
|
|
@@ -41,8 +41,7 @@ python3 ./.trellis/scripts/get_context.py
|
|
|
41
41
|
### Step 3: Read Project Guidelines `[AI]`
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
|
|
45
|
-
cat .trellis/spec/backend/index.md # Backend guidelines index
|
|
44
|
+
python3 ./.trellis/scripts/get_context.py --mode packages # Discover available spec layers
|
|
46
45
|
cat .trellis/spec/guides/index.md # Thinking guides
|
|
47
46
|
```
|
|
48
47
|
|
|
@@ -31,7 +31,7 @@ python3 ./.trellis/scripts/add_session.py \
|
|
|
31
31
|
--summary "Brief summary of what was done"
|
|
32
32
|
|
|
33
33
|
# Method 2: Pass detailed content via stdin
|
|
34
|
-
cat << 'EOF' | python3 ./.trellis/scripts/add_session.py --title "Title" --commit "hash"
|
|
34
|
+
cat << 'EOF' | python3 ./.trellis/scripts/add_session.py --stdin --title "Title" --commit "hash"
|
|
35
35
|
| Feature | Description |
|
|
36
36
|
|---------|-------------|
|
|
37
37
|
| New API | Added user authentication endpoint |
|
|
@@ -46,6 +46,7 @@ EOF
|
|
|
46
46
|
**Auto-completes**:
|
|
47
47
|
- [OK] Appends session to journal-N.md
|
|
48
48
|
- [OK] Auto-detects line count, creates new file if >2000 lines
|
|
49
|
+
- [OK] Auto-detects Branch context (`--branch` override; otherwise Branch = task.json -> current git branch; missing values are omitted gracefully)
|
|
49
50
|
- [OK] Updates index.md (Total Sessions +1, Last Active, line stats, history)
|
|
50
51
|
- [OK] Auto-commits .trellis/workspace and .trellis/tasks changes
|
|
51
52
|
|
|
@@ -56,6 +57,6 @@ EOF
|
|
|
56
57
|
| Command | Purpose |
|
|
57
58
|
|---------|---------|
|
|
58
59
|
| `python3 ./.trellis/scripts/get_context.py --mode record` | Get context for record-session |
|
|
59
|
-
| `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended)** |
|
|
60
|
+
| `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended, branch auto-complete)** |
|
|
60
61
|
| `python3 ./.trellis/scripts/task.py archive <name>` | Archive completed task (auto-commits) |
|
|
61
62
|
| `python3 ./.trellis/scripts/task.py list` | List active tasks |
|
|
@@ -40,9 +40,14 @@ This shows: developer identity, git status, current task (if any), active tasks.
|
|
|
40
40
|
### Step 3: Read Guidelines Index
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
python3 ./.trellis/scripts/get_context.py --mode packages
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This shows available packages and their spec layers. Read the relevant spec indexes:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cat .trellis/spec/<package>/<layer>/index.md # Package-specific guidelines
|
|
50
|
+
cat .trellis/spec/guides/index.md # Thinking guides (always read)
|
|
46
51
|
```
|
|
47
52
|
|
|
48
53
|
> **Important**: The index files are navigation — they list the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`).
|