@mindfoldhq/trellis 0.3.10-beta.0 → 0.3.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.
Files changed (173) hide show
  1. package/dist/cli/index.js +0 -2
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/commands/init.d.ts +0 -1
  4. package/dist/commands/init.d.ts.map +1 -1
  5. package/dist/commands/init.js +31 -203
  6. package/dist/commands/init.js.map +1 -1
  7. package/dist/commands/update.d.ts.map +1 -1
  8. package/dist/commands/update.js +6 -154
  9. package/dist/commands/update.js.map +1 -1
  10. package/dist/configurators/workflow.d.ts +2 -6
  11. package/dist/configurators/workflow.d.ts.map +1 -1
  12. package/dist/configurators/workflow.js +58 -88
  13. package/dist/configurators/workflow.js.map +1 -1
  14. package/dist/migrations/index.d.ts +0 -1
  15. package/dist/migrations/index.d.ts.map +1 -1
  16. package/dist/migrations/index.js +0 -2
  17. package/dist/migrations/index.js.map +1 -1
  18. package/dist/migrations/manifests/0.3.10.json +9 -0
  19. package/dist/templates/claude/agents/dispatch.md +2 -1
  20. package/dist/templates/claude/agents/implement.md +3 -2
  21. package/dist/templates/claude/commands/trellis/before-backend-dev.md +13 -0
  22. package/dist/templates/claude/commands/trellis/before-frontend-dev.md +13 -0
  23. package/dist/templates/claude/commands/trellis/check-backend.md +13 -0
  24. package/dist/templates/claude/commands/trellis/check-frontend.md +13 -0
  25. package/dist/templates/claude/commands/trellis/create-command.md +2 -2
  26. package/dist/templates/claude/commands/trellis/onboard.md +13 -13
  27. package/dist/templates/claude/commands/trellis/parallel.md +2 -1
  28. package/dist/templates/claude/commands/trellis/record-session.md +2 -2
  29. package/dist/templates/claude/commands/trellis/start.md +4 -8
  30. package/dist/templates/claude/hooks/inject-subagent-context.py +13 -21
  31. package/dist/templates/claude/hooks/session-start.py +2 -170
  32. package/dist/templates/codex/skills/before-backend-dev/SKILL.md +18 -0
  33. package/dist/templates/codex/skills/before-frontend-dev/SKILL.md +18 -0
  34. package/dist/templates/codex/skills/check-backend/SKILL.md +18 -0
  35. package/dist/templates/codex/skills/check-frontend/SKILL.md +18 -0
  36. package/dist/templates/codex/skills/create-command/SKILL.md +2 -2
  37. package/dist/templates/codex/skills/onboard/SKILL.md +11 -11
  38. package/dist/templates/codex/skills/record-session/SKILL.md +2 -2
  39. package/dist/templates/codex/skills/start/SKILL.md +3 -8
  40. package/dist/templates/cursor/commands/trellis-before-backend-dev.md +13 -0
  41. package/dist/templates/cursor/commands/trellis-before-frontend-dev.md +13 -0
  42. package/dist/templates/cursor/commands/trellis-check-backend.md +13 -0
  43. package/dist/templates/cursor/commands/trellis-check-frontend.md +13 -0
  44. package/dist/templates/cursor/commands/trellis-create-command.md +2 -2
  45. package/dist/templates/cursor/commands/trellis-onboard.md +13 -13
  46. package/dist/templates/cursor/commands/trellis-record-session.md +2 -2
  47. package/dist/templates/cursor/commands/trellis-start.md +16 -7
  48. package/dist/templates/gemini/commands/trellis/before-backend-dev.toml +17 -0
  49. package/dist/templates/gemini/commands/trellis/before-frontend-dev.toml +17 -0
  50. package/dist/templates/gemini/commands/trellis/check-backend.toml +17 -0
  51. package/dist/templates/gemini/commands/trellis/check-frontend.toml +17 -0
  52. package/dist/templates/gemini/commands/trellis/create-command.toml +2 -2
  53. package/dist/templates/gemini/commands/trellis/onboard.toml +2 -2
  54. package/dist/templates/gemini/commands/trellis/record-session.toml +2 -2
  55. package/dist/templates/gemini/commands/trellis/start.toml +4 -9
  56. package/dist/templates/iflow/agents/dispatch.md +2 -1
  57. package/dist/templates/iflow/agents/implement.md +3 -2
  58. package/dist/templates/iflow/commands/trellis/before-backend-dev.md +13 -0
  59. package/dist/templates/iflow/commands/trellis/before-frontend-dev.md +13 -0
  60. package/dist/templates/iflow/commands/trellis/check-backend.md +13 -0
  61. package/dist/templates/iflow/commands/trellis/check-frontend.md +13 -0
  62. package/dist/templates/iflow/commands/trellis/create-command.md +2 -2
  63. package/dist/templates/iflow/commands/trellis/onboard.md +13 -13
  64. package/dist/templates/iflow/commands/trellis/parallel.md +2 -1
  65. package/dist/templates/iflow/commands/trellis/record-session.md +2 -2
  66. package/dist/templates/iflow/commands/trellis/start.md +4 -8
  67. package/dist/templates/iflow/hooks/inject-subagent-context.py +13 -21
  68. package/dist/templates/iflow/hooks/session-start.py +1 -156
  69. package/dist/templates/kilo/workflows/before-backend-dev.md +13 -0
  70. package/dist/templates/kilo/workflows/before-frontend-dev.md +13 -0
  71. package/dist/templates/kilo/workflows/check-backend.md +13 -0
  72. package/dist/templates/kilo/workflows/check-frontend.md +13 -0
  73. package/dist/templates/kilo/workflows/create-command.md +2 -2
  74. package/dist/templates/kilo/workflows/onboard.md +13 -13
  75. package/dist/templates/kilo/workflows/parallel.md +2 -1
  76. package/dist/templates/kilo/workflows/record-session.md +2 -2
  77. package/dist/templates/kilo/workflows/start.md +3 -8
  78. package/dist/templates/kiro/skills/before-backend-dev/SKILL.md +18 -0
  79. package/dist/templates/kiro/skills/before-frontend-dev/SKILL.md +18 -0
  80. package/dist/templates/kiro/skills/check-backend/SKILL.md +18 -0
  81. package/dist/templates/kiro/skills/check-frontend/SKILL.md +18 -0
  82. package/dist/templates/kiro/skills/create-command/SKILL.md +2 -2
  83. package/dist/templates/kiro/skills/onboard/SKILL.md +11 -11
  84. package/dist/templates/kiro/skills/record-session/SKILL.md +2 -2
  85. package/dist/templates/kiro/skills/start/SKILL.md +3 -8
  86. package/dist/templates/markdown/spec/backend/script-conventions.md +0 -93
  87. package/dist/templates/opencode/agents/dispatch.md +2 -1
  88. package/dist/templates/opencode/agents/implement.md +2 -2
  89. package/dist/templates/opencode/agents/research.md +2 -1
  90. package/dist/templates/opencode/commands/trellis/before-backend-dev.md +13 -0
  91. package/dist/templates/opencode/commands/trellis/before-frontend-dev.md +13 -0
  92. package/dist/templates/opencode/commands/trellis/check-backend.md +13 -0
  93. package/dist/templates/opencode/commands/trellis/check-frontend.md +13 -0
  94. package/dist/templates/opencode/commands/trellis/create-command.md +2 -2
  95. package/dist/templates/opencode/commands/trellis/onboard.md +13 -13
  96. package/dist/templates/opencode/commands/trellis/parallel.md +2 -1
  97. package/dist/templates/opencode/commands/trellis/record-session.md +2 -2
  98. package/dist/templates/opencode/commands/trellis/start.md +3 -8
  99. package/dist/templates/opencode/plugin/inject-subagent-context.js +18 -45
  100. package/dist/templates/opencode/plugin/session-start.js +1 -149
  101. package/dist/templates/qoder/skills/before-backend-dev/SKILL.md +18 -0
  102. package/dist/templates/qoder/skills/before-frontend-dev/SKILL.md +18 -0
  103. package/dist/templates/qoder/skills/check-backend/SKILL.md +18 -0
  104. package/dist/templates/qoder/skills/check-frontend/SKILL.md +18 -0
  105. package/dist/templates/qoder/skills/create-command/SKILL.md +2 -2
  106. package/dist/templates/qoder/skills/onboard/SKILL.md +13 -13
  107. package/dist/templates/qoder/skills/record-session/SKILL.md +2 -2
  108. package/dist/templates/qoder/skills/start/SKILL.md +3 -8
  109. package/dist/templates/trellis/config.yaml +0 -20
  110. package/dist/templates/trellis/index.d.ts +0 -11
  111. package/dist/templates/trellis/index.d.ts.map +1 -1
  112. package/dist/templates/trellis/index.js +0 -22
  113. package/dist/templates/trellis/index.js.map +1 -1
  114. package/dist/templates/trellis/scripts/add_session.py +7 -52
  115. package/dist/templates/trellis/scripts/common/cli_adapter.py +45 -33
  116. package/dist/templates/trellis/scripts/common/config.py +0 -152
  117. package/dist/templates/trellis/scripts/common/git_context.py +586 -23
  118. package/dist/templates/trellis/scripts/common/paths.py +0 -46
  119. package/dist/templates/trellis/scripts/common/phase.py +49 -50
  120. package/dist/templates/trellis/scripts/common/registry.py +72 -41
  121. package/dist/templates/trellis/scripts/common/task_queue.py +98 -27
  122. package/dist/templates/trellis/scripts/common/task_utils.py +6 -96
  123. package/dist/templates/trellis/scripts/create_bootstrap.py +26 -31
  124. package/dist/templates/trellis/scripts/multi_agent/cleanup.py +48 -43
  125. package/dist/templates/trellis/scripts/multi_agent/create_pr.py +45 -336
  126. package/dist/templates/trellis/scripts/multi_agent/plan.py +26 -2
  127. package/dist/templates/trellis/scripts/multi_agent/start.py +57 -126
  128. package/dist/templates/trellis/scripts/multi_agent/status.py +753 -12
  129. package/dist/templates/trellis/scripts/task.py +975 -50
  130. package/dist/templates/trellis/workflow.md +34 -21
  131. package/dist/types/migration.d.ts +1 -3
  132. package/dist/types/migration.d.ts.map +1 -1
  133. package/dist/utils/project-detector.d.ts +0 -23
  134. package/dist/utils/project-detector.d.ts.map +1 -1
  135. package/dist/utils/project-detector.js +0 -364
  136. package/dist/utils/project-detector.js.map +1 -1
  137. package/dist/utils/template-fetcher.d.ts +10 -2
  138. package/dist/utils/template-fetcher.d.ts.map +1 -1
  139. package/dist/utils/template-fetcher.js +43 -12
  140. package/dist/utils/template-fetcher.js.map +1 -1
  141. package/package.json +1 -1
  142. package/dist/migrations/manifests/0.4.0-beta.1.json +0 -228
  143. package/dist/templates/claude/commands/trellis/before-dev.md +0 -29
  144. package/dist/templates/claude/commands/trellis/check.md +0 -25
  145. package/dist/templates/codex/skills/before-dev/SKILL.md +0 -34
  146. package/dist/templates/codex/skills/check/SKILL.md +0 -30
  147. package/dist/templates/cursor/commands/trellis-before-dev.md +0 -29
  148. package/dist/templates/cursor/commands/trellis-check.md +0 -25
  149. package/dist/templates/gemini/commands/trellis/before-dev.toml +0 -33
  150. package/dist/templates/gemini/commands/trellis/check.toml +0 -29
  151. package/dist/templates/iflow/commands/trellis/before-dev.md +0 -29
  152. package/dist/templates/iflow/commands/trellis/check.md +0 -25
  153. package/dist/templates/kilo/workflows/before-dev.md +0 -29
  154. package/dist/templates/kilo/workflows/check.md +0 -25
  155. package/dist/templates/kiro/skills/before-dev/SKILL.md +0 -34
  156. package/dist/templates/kiro/skills/check/SKILL.md +0 -30
  157. package/dist/templates/opencode/commands/trellis/before-dev.md +0 -29
  158. package/dist/templates/opencode/commands/trellis/check.md +0 -25
  159. package/dist/templates/qoder/skills/before-dev/SKILL.md +0 -34
  160. package/dist/templates/qoder/skills/check/SKILL.md +0 -30
  161. package/dist/templates/trellis/scripts/common/git.py +0 -31
  162. package/dist/templates/trellis/scripts/common/io.py +0 -37
  163. package/dist/templates/trellis/scripts/common/log.py +0 -45
  164. package/dist/templates/trellis/scripts/common/packages_context.py +0 -233
  165. package/dist/templates/trellis/scripts/common/session_context.py +0 -466
  166. package/dist/templates/trellis/scripts/common/task_context.py +0 -384
  167. package/dist/templates/trellis/scripts/common/task_store.py +0 -534
  168. package/dist/templates/trellis/scripts/common/tasks.py +0 -109
  169. package/dist/templates/trellis/scripts/common/types.py +0 -112
  170. package/dist/templates/trellis/scripts/hooks/linear_sync.py +0 -243
  171. package/dist/templates/trellis/scripts/multi_agent/_bootstrap.py +0 -17
  172. package/dist/templates/trellis/scripts/multi_agent/status_display.py +0 -542
  173. package/dist/templates/trellis/scripts/multi_agent/status_monitor.py +0 -225
@@ -0,0 +1,13 @@
1
+ Check if the code you just wrote follows the frontend development guidelines.
2
+
3
+ Execute these steps:
4
+ 1. Run `git status` to see modified files
5
+ 2. Read `.trellis/spec/frontend/index.md` to understand which guidelines apply
6
+ 3. Based on what you changed, read the relevant guideline files:
7
+ - Component changes → `.trellis/spec/frontend/component-guidelines.md`
8
+ - Hook changes → `.trellis/spec/frontend/hook-guidelines.md`
9
+ - State changes → `.trellis/spec/frontend/state-management.md`
10
+ - Type changes → `.trellis/spec/frontend/type-safety.md`
11
+ - Any changes → `.trellis/spec/frontend/quality-guidelines.md`
12
+ 4. Review your code against the guidelines
13
+ 5. Report any violations and fix them if found
@@ -99,8 +99,8 @@ Description:
99
99
  | Command Type | Prefix | Example |
100
100
  |--------------|--------|---------|
101
101
  | Session Start | `start` | `start` |
102
- | Pre-development | `before-` | `before-dev` |
103
- | Check | `check-` | `check` |
102
+ | Pre-development | `before-` | `before-frontend-dev` |
103
+ | Check | `check-` | `check-frontend` |
104
104
  | Record | `record-` | `record-session` |
105
105
  | Generate | `generate-` | `generate-api-doc` |
106
106
  | 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-dev - Inject Specialized Knowledge
129
+ ### /trellis:before-frontend-dev and /trellis:before-backend-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. Discovers spec layers via `get_context.py --mode packages` and reads relevant guidelines
135
+ 1. Reads `.trellis/spec/frontend/` or `.trellis/spec/backend/`
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-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.
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 - Combat Context Drift
148
+ ### /trellis:check-frontend and /trellis:check-backend - 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-dev** - Inject project-specific development guidelines
214
+ **[3/8] /trellis:before-frontend-dev** - Inject project-specific frontend knowledge
215
215
  **[4/8] Investigate and fix the bug** - Actual development work
216
- **[5/8] /trellis:check** - Re-verify code against guidelines
216
+ **[5/8] /trellis:check-frontend** - 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-dev** - Re-inject guidelines before fixes
231
+ **[2/6] /trellis:before-backend-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** - Verify fixes did not introduce new issues
233
+ **[4/6] /trellis:check-backend** - Verify fixes didn't 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 /trellis:check after each** - Incremental verification
241
+ **[3/5] Execute phase by phase with /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-dev** - Guidelines might document known gotchas
248
+ **[2/6] /trellis:before-backend-dev** - Guidelines might document known gotchas
249
249
  **[3/6] Investigation** - Actual debugging work
250
- **[4/6] /trellis:check** - Verify debug changes do not break other things
250
+ **[4/6] /trellis:check-backend** - Verify debug changes don't 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-dev command injects project knowledge.
259
+ 2. **Guidelines before code** - /before-*-dev commands inject 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,7 +41,8 @@ python3 ./.trellis/scripts/get_context.py
41
41
  ### Step 3: Read Project Guidelines `[AI]`
42
42
 
43
43
  ```bash
44
- python3 ./.trellis/scripts/get_context.py --mode packages # Discover available spec layers
44
+ cat .trellis/spec/frontend/index.md # Frontend guidelines index
45
+ cat .trellis/spec/backend/index.md # Backend guidelines index
45
46
  cat .trellis/spec/guides/index.md # Thinking guides
46
47
  ```
47
48
 
@@ -1,6 +1,6 @@
1
1
  [!] **Prerequisite**: This command should only be used AFTER the human has tested and committed the code.
2
2
 
3
- **AI must NOT execute git commit** - only read history (`git log`, `git status`, `git diff`).
3
+ **Do NOT run `git commit` directly** the scripts below handle their own commits for `.trellis/` metadata. You only need to read git history (`git log`, `git status`, `git diff`) and run the Python scripts.
4
4
 
5
5
  ---
6
6
 
@@ -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 --stdin --title "Title" --commit "hash"
34
+ cat << 'EOF' | python3 ./.trellis/scripts/add_session.py --title "Title" --commit "hash"
35
35
  | Feature | Description |
36
36
  |---------|-------------|
37
37
  | New API | Added user authentication endpoint |
@@ -40,14 +40,9 @@ 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
- 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)
43
+ cat .trellis/spec/frontend/index.md # Frontend guidelines
44
+ cat .trellis/spec/backend/index.md # Backend guidelines
45
+ cat .trellis/spec/guides/index.md # Thinking guides
51
46
  ```
52
47
 
53
48
  > **Important**: The index files are navigation — they list the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`).
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: before-backend-dev
3
+ description: "Read the backend development guidelines before starting your development task."
4
+ ---
5
+
6
+ Read the backend development guidelines before starting your development task.
7
+
8
+ Execute these steps:
9
+ 1. Read `.trellis/spec/backend/index.md` to understand available guidelines
10
+ 2. Based on your task, read the relevant guideline files:
11
+ - Database work → `.trellis/spec/backend/database-guidelines.md`
12
+ - Error handling → `.trellis/spec/backend/error-handling.md`
13
+ - Logging → `.trellis/spec/backend/logging-guidelines.md`
14
+ - Type questions → `.trellis/spec/backend/type-safety.md`
15
+ 3. Understand the coding standards and patterns you need to follow
16
+ 4. Then proceed with your development plan
17
+
18
+ This step is **mandatory** before writing any backend code.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: before-frontend-dev
3
+ description: "Read the frontend development guidelines before starting your development task."
4
+ ---
5
+
6
+ Read the frontend development guidelines before starting your development task.
7
+
8
+ Execute these steps:
9
+ 1. Read `.trellis/spec/frontend/index.md` to understand available guidelines
10
+ 2. Based on your task, read the relevant guideline files:
11
+ - Component work → `.trellis/spec/frontend/component-guidelines.md`
12
+ - Hook work → `.trellis/spec/frontend/hook-guidelines.md`
13
+ - State management → `.trellis/spec/frontend/state-management.md`
14
+ - Type questions → `.trellis/spec/frontend/type-safety.md`
15
+ 3. Understand the coding standards and patterns you need to follow
16
+ 4. Then proceed with your development plan
17
+
18
+ This step is **mandatory** before writing any frontend code.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: check-backend
3
+ description: "Check if the code you just wrote follows the backend development guidelines."
4
+ ---
5
+
6
+ Check if the code you just wrote follows the backend development guidelines.
7
+
8
+ Execute these steps:
9
+ 1. Run `git status` to see modified files
10
+ 2. Read `.trellis/spec/backend/index.md` to understand which guidelines apply
11
+ 3. Based on what you changed, read the relevant guideline files:
12
+ - Database changes → `.trellis/spec/backend/database-guidelines.md`
13
+ - Error handling → `.trellis/spec/backend/error-handling.md`
14
+ - Logging changes → `.trellis/spec/backend/logging-guidelines.md`
15
+ - Type changes → `.trellis/spec/backend/type-safety.md`
16
+ - Any changes → `.trellis/spec/backend/quality-guidelines.md`
17
+ 4. Review your code against the guidelines
18
+ 5. Report any violations and fix them if found
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: check-frontend
3
+ description: "Check if the code you just wrote follows the frontend development guidelines."
4
+ ---
5
+
6
+ Check if the code you just wrote follows the frontend development guidelines.
7
+
8
+ Execute these steps:
9
+ 1. Run `git status` to see modified files
10
+ 2. Read `.trellis/spec/frontend/index.md` to understand which guidelines apply
11
+ 3. Based on what you changed, read the relevant guideline files:
12
+ - Component changes → `.trellis/spec/frontend/component-guidelines.md`
13
+ - Hook changes → `.trellis/spec/frontend/hook-guidelines.md`
14
+ - State changes → `.trellis/spec/frontend/state-management.md`
15
+ - Type changes → `.trellis/spec/frontend/type-safety.md`
16
+ - Any changes → `.trellis/spec/frontend/quality-guidelines.md`
17
+ 4. Review your code against the guidelines
18
+ 5. Report any violations and fix them if found
@@ -93,8 +93,8 @@ Description:
93
93
  | Skill Type | Prefix | Example |
94
94
  |------------|--------|---------|
95
95
  | Session Start | `start` | `start` |
96
- | Pre-development | `before-` | `before-dev` |
97
- | Check | `check-` | `check` |
96
+ | Pre-development | `before-` | `before-frontend-dev` |
97
+ | Check | `check-` | `check-frontend` |
98
98
  | Record | `record-` | `record-session` |
99
99
  | Generate | `generate-` | `generate-api-doc` |
100
100
  | Update | `update-` | `update-changelog` |
@@ -131,13 +131,13 @@ AI needs the same onboarding - but compressed into seconds at session start.
131
131
 
132
132
  ---
133
133
 
134
- ### $before-dev - Inject Specialized Knowledge
134
+ ### $before-frontend-dev and $before-backend-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. Discovers spec layers via `get_context.py --mode packages` and reads relevant guidelines
140
+ 1. Reads `.trellis/spec/frontend/` or `.trellis/spec/backend/`
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-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.
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 - Combat Context Drift
153
+ ### $check-frontend and $check-backend - 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-dev** - Inject project-specific development guidelines
219
+ **[3/8] $before-frontend-dev** - Inject project-specific frontend knowledge
220
220
  **[4/8] Investigate and fix the bug** - Actual development work
221
- **[5/8] $check** - Re-verify code against guidelines
221
+ **[5/8] $check-frontend** - 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-dev** - Re-inject guidelines before fixes
236
+ **[2/6] $before-backend-dev** - Re-inject guidelines before fixes
237
237
  **[3/6] Fix each CR issue** - Address feedback with guidelines in context
238
- **[4/6] $check** - Verify fixes did not introduce new issues
238
+ **[4/6] $check-backend** - Verify fixes didn't 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-dev** - Guidelines might document known gotchas
253
+ **[2/6] $before-backend-dev** - Guidelines might document known gotchas
254
254
  **[3/6] Investigation** - Actual debugging work
255
- **[4/6] $check** - Verify debug changes do not break other things
255
+ **[4/6] $check-backend** - Verify debug changes don't 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
 
@@ -5,7 +5,7 @@ description: "Record work progress after human has tested and committed code"
5
5
 
6
6
  [!] **Prerequisite**: This skill should only be used AFTER the human has tested and committed the code.
7
7
 
8
- **AI must NOT execute git commit** - only read history (`git log`, `git status`, `git diff`).
8
+ **Do NOT run `git commit` directly** the scripts below handle their own commits for `.trellis/` metadata. You only need to read git history (`git log`, `git status`, `git diff`) and run the Python scripts.
9
9
 
10
10
  ---
11
11
 
@@ -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 --stdin --title "Title" --commit "hash"
39
+ cat << 'EOF' | python3 ./.trellis/scripts/add_session.py --title "Title" --commit "hash"
40
40
  | Feature | Description |
41
41
  |---------|-------------|
42
42
  | New API | Added user authentication endpoint |
@@ -45,14 +45,9 @@ 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
- 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)
48
+ cat .trellis/spec/frontend/index.md # Frontend guidelines
49
+ cat .trellis/spec/backend/index.md # Backend guidelines
50
+ cat .trellis/spec/guides/index.md # Thinking guides
56
51
  ```
57
52
 
58
53
  > **Important**: The index files are navigation — they list the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`).
@@ -502,99 +502,6 @@ 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
-
598
505
  ## Error Handling
599
506
 
600
507
  ### Exit Codes
@@ -106,7 +106,8 @@ Hook will auto-inject:
106
106
 
107
107
  - finish-work.md
108
108
  - check-cross-layer.md
109
- - check.md
109
+ - check-backend.md
110
+ - check-frontend.md
110
111
  - All spec files from check.jsonl
111
112
 
112
113
  ### action: "debug"
@@ -65,8 +65,8 @@ Before implementing, read:
65
65
 
66
66
  Read relevant specs based on task type:
67
67
 
68
- - Spec layers: `.trellis/spec/<package>/<layer>/`
69
- - Shared guides: `.trellis/spec/guides/`
68
+ - Backend: `.trellis/spec/backend/`
69
+ - Frontend: `.trellis/spec/frontend/`
70
70
  - Guides: `.trellis/spec/guides/`
71
71
 
72
72
  ### 2. Understand Requirements
@@ -29,7 +29,8 @@ 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/<package>/<layer>/` - Package-specific standards
32
+ - `.trellis/spec/backend/` - Backend standards
33
+ - `.trellis/spec/frontend/` - Frontend standards
33
34
  - `.trellis/spec/guides/` - Thinking guides
34
35
  - `.trellis/big-question/` - Known issues and pitfalls
35
36
 
@@ -0,0 +1,13 @@
1
+ Read the backend development guidelines before starting your development task.
2
+
3
+ Execute these steps:
4
+ 1. Read `.trellis/spec/backend/index.md` to understand available guidelines
5
+ 2. Based on your task, read the relevant guideline files:
6
+ - Database work → `.trellis/spec/backend/database-guidelines.md`
7
+ - Error handling → `.trellis/spec/backend/error-handling.md`
8
+ - Logging → `.trellis/spec/backend/logging-guidelines.md`
9
+ - Type questions → `.trellis/spec/backend/type-safety.md`
10
+ 3. Understand the coding standards and patterns you need to follow
11
+ 4. Then proceed with your development plan
12
+
13
+ This step is **mandatory** before writing any backend code.
@@ -0,0 +1,13 @@
1
+ Read the frontend development guidelines before starting your development task.
2
+
3
+ Execute these steps:
4
+ 1. Read `.trellis/spec/frontend/index.md` to understand available guidelines
5
+ 2. Based on your task, read the relevant guideline files:
6
+ - Component work → `.trellis/spec/frontend/component-guidelines.md`
7
+ - Hook work → `.trellis/spec/frontend/hook-guidelines.md`
8
+ - State management → `.trellis/spec/frontend/state-management.md`
9
+ - Type questions → `.trellis/spec/frontend/type-safety.md`
10
+ 3. Understand the coding standards and patterns you need to follow
11
+ 4. Then proceed with your development plan
12
+
13
+ This step is **mandatory** before writing any frontend code.
@@ -0,0 +1,13 @@
1
+ Check if the code you just wrote follows the backend development guidelines.
2
+
3
+ Execute these steps:
4
+ 1. Run `git status` to see modified files
5
+ 2. Read `.trellis/spec/backend/index.md` to understand which guidelines apply
6
+ 3. Based on what you changed, read the relevant guideline files:
7
+ - Database changes → `.trellis/spec/backend/database-guidelines.md`
8
+ - Error handling → `.trellis/spec/backend/error-handling.md`
9
+ - Logging changes → `.trellis/spec/backend/logging-guidelines.md`
10
+ - Type changes → `.trellis/spec/backend/type-safety.md`
11
+ - Any changes → `.trellis/spec/backend/quality-guidelines.md`
12
+ 4. Review your code against the guidelines
13
+ 5. Report any violations and fix them if found
@@ -0,0 +1,13 @@
1
+ Check if the code you just wrote follows the frontend development guidelines.
2
+
3
+ Execute these steps:
4
+ 1. Run `git status` to see modified files
5
+ 2. Read `.trellis/spec/frontend/index.md` to understand which guidelines apply
6
+ 3. Based on what you changed, read the relevant guideline files:
7
+ - Component changes → `.trellis/spec/frontend/component-guidelines.md`
8
+ - Hook changes → `.trellis/spec/frontend/hook-guidelines.md`
9
+ - State changes → `.trellis/spec/frontend/state-management.md`
10
+ - Type changes → `.trellis/spec/frontend/type-safety.md`
11
+ - Any changes → `.trellis/spec/frontend/quality-guidelines.md`
12
+ 4. Review your code against the guidelines
13
+ 5. 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-dev` |
105
- | Check | `check-` | `check` |
104
+ | Pre-development | `before-` | `before-frontend-dev` |
105
+ | Check | `check-` | `check-frontend` |
106
106
  | Record | `record-` | `record-session` |
107
107
  | Generate | `generate-` | `generate-api-doc` |
108
108
  | Update | `update-` | `update-changelog` |