@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
@@ -119,151 +119,6 @@ def _get_task_status(trellis_dir: Path) -> str:
119
119
  return f"Status: READY\nTask: {task_title}\nNext: Continue with implement or check"
120
120
 
121
121
 
122
- def _load_trellis_config(trellis_dir: Path) -> tuple:
123
- """Load Trellis config for session-start decisions.
124
-
125
- Returns:
126
- (is_mono, packages_dict, spec_scope, task_pkg, default_pkg)
127
- """
128
- scripts_dir = trellis_dir / "scripts"
129
- if str(scripts_dir) not in sys.path:
130
- sys.path.insert(0, str(scripts_dir))
131
-
132
- try:
133
- from common.config import get_default_package, get_packages, get_spec_scope, is_monorepo
134
- from common.paths import get_current_task
135
-
136
- repo_root = trellis_dir.parent
137
- is_mono = is_monorepo(repo_root)
138
- packages = get_packages(repo_root) or {}
139
- scope = get_spec_scope(repo_root)
140
-
141
- # Get active task's package
142
- task_pkg = None
143
- current = get_current_task(repo_root)
144
- if current:
145
- task_json = repo_root / current / "task.json"
146
- if task_json.is_file():
147
- try:
148
- data = json.loads(task_json.read_text(encoding="utf-8"))
149
- if isinstance(data, dict):
150
- tp = data.get("package")
151
- if isinstance(tp, str) and tp:
152
- task_pkg = tp
153
- except (json.JSONDecodeError, OSError):
154
- pass
155
-
156
- default_pkg = get_default_package(repo_root)
157
- return is_mono, packages, scope, task_pkg, default_pkg
158
- except Exception:
159
- return False, {}, None, None, None
160
-
161
-
162
- def _check_legacy_spec(trellis_dir: Path, is_mono: bool, packages: dict) -> str | None:
163
- """Check for legacy spec directory structure in monorepo.
164
-
165
- Returns warning message if legacy structure detected, None otherwise.
166
- """
167
- if not is_mono or not packages:
168
- return None
169
-
170
- spec_dir = trellis_dir / "spec"
171
- if not spec_dir.is_dir():
172
- return None
173
-
174
- # Check for legacy flat spec dirs (spec/backend/, spec/frontend/ with index.md)
175
- has_legacy = False
176
- for legacy_name in ("backend", "frontend"):
177
- legacy_dir = spec_dir / legacy_name
178
- if legacy_dir.is_dir() and (legacy_dir / "index.md").is_file():
179
- has_legacy = True
180
- break
181
-
182
- if not has_legacy:
183
- return None
184
-
185
- # Check which packages are missing spec/<pkg>/ directory
186
- missing = [
187
- name for name in sorted(packages.keys())
188
- if not (spec_dir / name).is_dir()
189
- ]
190
-
191
- if not missing:
192
- return None # All packages have spec dirs
193
-
194
- if len(missing) == len(packages):
195
- return (
196
- f"[!] Legacy spec structure detected: found `spec/backend/` or `spec/frontend/` "
197
- f"but no package-scoped `spec/<package>/` directories.\n"
198
- f"Monorepo packages: {', '.join(sorted(packages.keys()))}\n"
199
- f"Please reorganize: `spec/backend/` -> `spec/<package>/backend/`"
200
- )
201
- return (
202
- f"[!] Partial spec migration detected: packages {', '.join(missing)} "
203
- f"still missing `spec/<pkg>/` directory.\n"
204
- f"Please complete migration for all packages."
205
- )
206
-
207
-
208
- def _resolve_spec_scope(
209
- is_mono: bool,
210
- packages: dict,
211
- scope,
212
- task_pkg: str | None,
213
- default_pkg: str | None,
214
- ) -> set | None:
215
- """Resolve which packages should have their specs injected.
216
-
217
- Returns:
218
- Set of package names to include, or None for full scan.
219
- """
220
- if not is_mono or not packages:
221
- return None # Single-repo: full scan
222
-
223
- if scope is None:
224
- return None # No scope configured: full scan
225
-
226
- if isinstance(scope, str) and scope == "active_task":
227
- if task_pkg and task_pkg in packages:
228
- return {task_pkg}
229
- if default_pkg and default_pkg in packages:
230
- return {default_pkg}
231
- return None # Fallback to full scan
232
-
233
- if isinstance(scope, list):
234
- valid = set()
235
- for entry in scope:
236
- if entry in packages:
237
- valid.add(entry)
238
- else:
239
- print(
240
- f"Warning: spec_scope contains unknown package: {entry}, ignoring",
241
- file=sys.stderr,
242
- )
243
-
244
- if valid:
245
- # Warn if active task is out of scope
246
- if task_pkg and task_pkg not in valid:
247
- print(
248
- f"Warning: active task package '{task_pkg}' is out of configured spec_scope",
249
- file=sys.stderr,
250
- )
251
- return valid
252
-
253
- # All entries invalid: fallback chain
254
- print(
255
- "Warning: all spec_scope entries invalid, falling back to task/default/full",
256
- file=sys.stderr,
257
- )
258
- if task_pkg and task_pkg in packages:
259
- return {task_pkg}
260
- if default_pkg and default_pkg in packages:
261
- return {default_pkg}
262
- return None # Full scan
263
-
264
- return None # Unknown scope type: full scan
265
-
266
-
267
122
  def main():
268
123
  if should_skip_injection():
269
124
  sys.exit(0)
@@ -272,10 +127,6 @@ def main():
272
127
  trellis_dir = project_dir / ".trellis"
273
128
  claude_dir = project_dir / ".claude"
274
129
 
275
- # Load config for scope filtering and legacy detection
276
- is_mono, packages, scope_config, task_pkg, default_pkg = _load_trellis_config(trellis_dir)
277
- allowed_pkgs = _resolve_spec_scope(is_mono, packages, scope_config, task_pkg, default_pkg)
278
-
279
130
  output = StringIO()
280
131
 
281
132
  output.write("""<session-context>
@@ -285,11 +136,6 @@ Read and follow all instructions below carefully.
285
136
 
286
137
  """)
287
138
 
288
- # Legacy migration warning
289
- legacy_warning = _check_legacy_spec(trellis_dir, is_mono, packages)
290
- if legacy_warning:
291
- output.write(f"<migration-warning>\n{legacy_warning}\n</migration-warning>\n\n")
292
-
293
139
  output.write("<current-state>\n")
294
140
  context_script = trellis_dir / "scripts" / "get_context.py"
295
141
  output.write(run_script(context_script))
@@ -309,27 +155,13 @@ Read and follow all instructions below carefully.
309
155
  for sub in sorted(spec_dir.iterdir()):
310
156
  if not sub.is_dir() or sub.name.startswith("."):
311
157
  continue
312
-
313
- # Always include guides/ regardless of scope
314
- if sub.name == "guides":
315
- index_file = sub / "index.md"
316
- if index_file.is_file():
317
- output.write(f"## {sub.name}\n")
318
- output.write(read_file(index_file))
319
- output.write("\n\n")
320
- continue
321
-
322
158
  index_file = sub / "index.md"
323
159
  if index_file.is_file():
324
- # Flat spec dir (single-repo layer like spec/backend/)
325
160
  output.write(f"## {sub.name}\n")
326
161
  output.write(read_file(index_file))
327
162
  output.write("\n\n")
328
163
  else:
329
- # Nested package dirs (monorepo: spec/<pkg>/<layer>/index.md)
330
- # Apply scope filter
331
- if allowed_pkgs is not None and sub.name not in allowed_pkgs:
332
- continue
164
+ # Check for nested package dirs (monorepo: spec/<pkg>/<layer>/index.md)
333
165
  for nested in sorted(sub.iterdir()):
334
166
  if not nested.is_dir():
335
167
  continue
@@ -348,7 +180,7 @@ Read and follow all instructions below carefully.
348
180
  output.write(start_md)
349
181
  output.write("\n</instructions>\n\n")
350
182
 
351
- # Check task status and inject structured tag
183
+ # R2: Check task status and inject structured tag
352
184
  task_status = _get_task_status(trellis_dir)
353
185
  output.write(f"<task-status>\n{task_status}\n</task-status>\n\n")
354
186
 
@@ -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`).
@@ -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` |
@@ -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
 
@@ -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 |
@@ -38,17 +38,24 @@ This returns:
38
38
  - Active tasks
39
39
  - Journal file status
40
40
 
41
- ### Step 3: Read Guidelines Index `[AI]`
41
+ ### Step 3: Read Project Code-Spec Index `[AI]`
42
42
 
43
+ Based on the upcoming task, read appropriate code-spec docs:
44
+
45
+ **For Frontend Work**:
43
46
  ```bash
44
- python3 ./.trellis/scripts/get_context.py --mode packages
47
+ cat .trellis/spec/frontend/index.md
45
48
  ```
46
49
 
47
- This shows available packages and their spec layers. Read the relevant spec indexes:
50
+ **For Backend Work**:
51
+ ```bash
52
+ cat .trellis/spec/backend/index.md
53
+ ```
48
54
 
55
+ **For Cross-Layer Features**:
49
56
  ```bash
50
- cat .trellis/spec/<package>/<layer>/index.md # Package-specific guidelines
51
- cat .trellis/spec/guides/index.md # Thinking guides (always read)
57
+ cat .trellis/spec/guides/index.md
58
+ cat .trellis/spec/guides/cross-layer-thinking-guide.md
52
59
  ```
53
60
 
54
61
  > **Important**: The index files are navigation — they list the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`).
@@ -324,8 +331,10 @@ The following slash commands are for users (not AI):
324
331
  |---------|-------------|
325
332
  | `/trellis-start` | Start development session (this command) |
326
333
  | `/trellis-brainstorm` | Clarify vague requirements before implementation |
327
- | `/trellis-before-dev` | Read development guidelines |
328
- | `/trellis-check` | Check code quality |
334
+ | `/trellis-before-frontend-dev` | Read frontend guidelines |
335
+ | `/trellis-before-backend-dev` | Read backend guidelines |
336
+ | `/trellis-check-frontend` | Check frontend code |
337
+ | `/trellis-check-backend` | Check backend code |
329
338
  | `/trellis-check-cross-layer` | Cross-layer verification |
330
339
  | `/trellis-finish-work` | Pre-commit checklist |
331
340
  | `/trellis-record-session` | Record session progress |
@@ -0,0 +1,17 @@
1
+ description = "Read backend development guidelines before starting your task"
2
+
3
+ prompt = """
4
+ Read the backend development guidelines before starting your development task.
5
+
6
+ Execute these steps:
7
+ 1. Read `.trellis/spec/backend/index.md` to understand available guidelines
8
+ 2. Based on your task, read the relevant guideline files:
9
+ - Database work -> `.trellis/spec/backend/database-guidelines.md`
10
+ - Error handling -> `.trellis/spec/backend/error-handling.md`
11
+ - Logging -> `.trellis/spec/backend/logging-guidelines.md`
12
+ - Type questions -> `.trellis/spec/backend/type-safety.md`
13
+ 3. Understand the coding standards and patterns you need to follow
14
+ 4. Then proceed with your development plan
15
+
16
+ This step is **mandatory** before writing any backend code.
17
+ """