@mindfoldhq/trellis 0.4.0-beta.8 → 0.4.0-rc.0

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 (99) hide show
  1. package/README.md +10 -5
  2. package/dist/cli/index.js +2 -0
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/init.d.ts +2 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +165 -13
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/update.d.ts.map +1 -1
  9. package/dist/commands/update.js +14 -2
  10. package/dist/commands/update.js.map +1 -1
  11. package/dist/configurators/codex.d.ts.map +1 -1
  12. package/dist/configurators/codex.js +2 -1
  13. package/dist/configurators/codex.js.map +1 -1
  14. package/dist/configurators/copilot.d.ts +9 -0
  15. package/dist/configurators/copilot.d.ts.map +1 -0
  16. package/dist/configurators/copilot.js +34 -0
  17. package/dist/configurators/copilot.js.map +1 -0
  18. package/dist/configurators/index.d.ts.map +1 -1
  19. package/dist/configurators/index.js +32 -1
  20. package/dist/configurators/index.js.map +1 -1
  21. package/dist/configurators/windsurf.d.ts +8 -0
  22. package/dist/configurators/windsurf.d.ts.map +1 -0
  23. package/dist/configurators/windsurf.js +18 -0
  24. package/dist/configurators/windsurf.js.map +1 -0
  25. package/dist/migrations/manifests/0.4.0-beta.10.json +9 -0
  26. package/dist/migrations/manifests/0.4.0-beta.9.json +9 -0
  27. package/dist/migrations/manifests/0.4.0-rc.0.json +9 -0
  28. package/dist/templates/claude/hooks/inject-subagent-context.py +8 -1
  29. package/dist/templates/claude/hooks/ralph-loop.py +18 -10
  30. package/dist/templates/claude/hooks/session-start.py +60 -19
  31. package/dist/templates/claude/hooks/statusline.py +218 -0
  32. package/dist/templates/claude/settings.json +4 -0
  33. package/dist/templates/codex/hooks/session-start.py +60 -21
  34. package/dist/templates/codex/hooks.json +1 -1
  35. package/dist/templates/copilot/hooks/session-start.py +243 -0
  36. package/dist/templates/copilot/hooks.json +11 -0
  37. package/dist/templates/copilot/index.d.ts +23 -0
  38. package/dist/templates/copilot/index.d.ts.map +1 -0
  39. package/dist/templates/copilot/index.js +54 -0
  40. package/dist/templates/copilot/index.js.map +1 -0
  41. package/dist/templates/copilot/prompts/before-dev.prompt.md +33 -0
  42. package/dist/templates/copilot/prompts/brainstorm.prompt.md +491 -0
  43. package/dist/templates/copilot/prompts/break-loop.prompt.md +129 -0
  44. package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +157 -0
  45. package/dist/templates/copilot/prompts/check.prompt.md +29 -0
  46. package/dist/templates/copilot/prompts/create-command.prompt.md +116 -0
  47. package/dist/templates/copilot/prompts/finish-work.prompt.md +157 -0
  48. package/dist/templates/copilot/prompts/integrate-skill.prompt.md +223 -0
  49. package/dist/templates/copilot/prompts/onboard.prompt.md +362 -0
  50. package/dist/templates/copilot/prompts/parallel.prompt.md +196 -0
  51. package/dist/templates/copilot/prompts/record-session.prompt.md +66 -0
  52. package/dist/templates/copilot/prompts/start.prompt.md +397 -0
  53. package/dist/templates/copilot/prompts/update-spec.prompt.md +358 -0
  54. package/dist/templates/extract.d.ts +18 -0
  55. package/dist/templates/extract.d.ts.map +1 -1
  56. package/dist/templates/extract.js +32 -0
  57. package/dist/templates/extract.js.map +1 -1
  58. package/dist/templates/iflow/hooks/inject-subagent-context.py +8 -1
  59. package/dist/templates/iflow/hooks/ralph-loop.py +8 -1
  60. package/dist/templates/iflow/hooks/session-start.py +60 -19
  61. package/dist/templates/markdown/spec/backend/directory-structure.md +1 -1
  62. package/dist/templates/opencode/agents/dispatch.md +20 -19
  63. package/dist/templates/opencode/lib/trellis-context.js +35 -239
  64. package/dist/templates/opencode/plugins/inject-subagent-context.js +71 -121
  65. package/dist/templates/opencode/plugins/session-start.js +150 -146
  66. package/dist/templates/trellis/scripts/add_session.py +6 -1
  67. package/dist/templates/trellis/scripts/common/__init__.py +2 -0
  68. package/dist/templates/trellis/scripts/common/cli_adapter.py +87 -9
  69. package/dist/templates/trellis/scripts/common/paths.py +57 -6
  70. package/dist/templates/trellis/scripts/common/task_store.py +6 -4
  71. package/dist/templates/trellis/scripts/common/task_utils.py +14 -8
  72. package/dist/templates/trellis/scripts/multi_agent/start.py +9 -5
  73. package/dist/templates/trellis/scripts/task.py +1 -1
  74. package/dist/templates/trellis/workflow.md +17 -4
  75. package/dist/templates/windsurf/index.d.ts +21 -0
  76. package/dist/templates/windsurf/index.d.ts.map +1 -0
  77. package/dist/templates/windsurf/index.js +44 -0
  78. package/dist/templates/windsurf/index.js.map +1 -0
  79. package/dist/templates/windsurf/workflows/trellis-before-dev.md +31 -0
  80. package/dist/templates/windsurf/workflows/trellis-brainstorm.md +491 -0
  81. package/dist/templates/windsurf/workflows/trellis-break-loop.md +111 -0
  82. package/dist/templates/windsurf/workflows/trellis-check-cross-layer.md +157 -0
  83. package/dist/templates/windsurf/workflows/trellis-check.md +27 -0
  84. package/dist/templates/windsurf/workflows/trellis-create-command.md +154 -0
  85. package/dist/templates/windsurf/workflows/trellis-finish-work.md +147 -0
  86. package/dist/templates/windsurf/workflows/trellis-integrate-skill.md +220 -0
  87. package/dist/templates/windsurf/workflows/trellis-onboard.md +362 -0
  88. package/dist/templates/windsurf/workflows/trellis-record-session.md +66 -0
  89. package/dist/templates/windsurf/workflows/trellis-start.md +373 -0
  90. package/dist/templates/windsurf/workflows/trellis-update-spec.md +358 -0
  91. package/dist/types/ai-tools.d.ts +5 -3
  92. package/dist/types/ai-tools.d.ts.map +1 -1
  93. package/dist/types/ai-tools.js +21 -1
  94. package/dist/types/ai-tools.js.map +1 -1
  95. package/dist/utils/template-fetcher.d.ts +17 -4
  96. package/dist/utils/template-fetcher.d.ts.map +1 -1
  97. package/dist/utils/template-fetcher.js +94 -12
  98. package/dist/utils/template-fetcher.js.map +1 -1
  99. package/package.json +1 -1
@@ -0,0 +1,243 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ Copilot Session Start Hook - Inject Trellis context into VS Code Copilot sessions.
5
+
6
+ Output format follows Copilot hook protocol:
7
+ stdout JSON → { hookSpecificOutput: { hookEventName: "SessionStart", additionalContext: "..." } }
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import json
13
+ import os
14
+ import subprocess
15
+ import sys
16
+ import warnings
17
+ from io import StringIO
18
+ from pathlib import Path
19
+
20
+ warnings.filterwarnings("ignore")
21
+
22
+
23
+ def should_skip_injection() -> bool:
24
+ return os.environ.get("COPILOT_NON_INTERACTIVE") == "1"
25
+
26
+
27
+ def read_file(path: Path, fallback: str = "") -> str:
28
+ try:
29
+ return path.read_text(encoding="utf-8")
30
+ except (FileNotFoundError, PermissionError):
31
+ return fallback
32
+
33
+
34
+ def run_script(script_path: Path) -> str:
35
+ try:
36
+ env = os.environ.copy()
37
+ env["PYTHONIOENCODING"] = "utf-8"
38
+ cmd = [sys.executable, "-W", "ignore", str(script_path)]
39
+ result = subprocess.run(
40
+ cmd,
41
+ capture_output=True,
42
+ text=True,
43
+ encoding="utf-8",
44
+ errors="replace",
45
+ timeout=5,
46
+ cwd=str(script_path.parent.parent.parent),
47
+ env=env,
48
+ )
49
+ return result.stdout if result.returncode == 0 else "No context available"
50
+ except (subprocess.TimeoutExpired, FileNotFoundError, PermissionError):
51
+ return "No context available"
52
+
53
+
54
+ def _normalize_task_ref(task_ref: str) -> str:
55
+ normalized = task_ref.strip()
56
+ if not normalized:
57
+ return ""
58
+
59
+ path_obj = Path(normalized)
60
+ if path_obj.is_absolute():
61
+ return str(path_obj)
62
+
63
+ normalized = normalized.replace("\\", "/")
64
+ while normalized.startswith("./"):
65
+ normalized = normalized[2:]
66
+
67
+ if normalized.startswith("tasks/"):
68
+ return f".trellis/{normalized}"
69
+
70
+ return normalized
71
+
72
+
73
+ def _resolve_task_dir(trellis_dir: Path, task_ref: str) -> Path:
74
+ normalized = _normalize_task_ref(task_ref)
75
+ path_obj = Path(normalized)
76
+ if path_obj.is_absolute():
77
+ return path_obj
78
+ if normalized.startswith(".trellis/"):
79
+ return trellis_dir.parent / path_obj
80
+ return trellis_dir / "tasks" / path_obj
81
+
82
+
83
+ def _get_task_status(trellis_dir: Path) -> str:
84
+ current_task_file = trellis_dir / ".current-task"
85
+ if not current_task_file.is_file():
86
+ return "Status: NO ACTIVE TASK\nNext: Describe what you want to work on"
87
+
88
+ task_ref = _normalize_task_ref(current_task_file.read_text(encoding="utf-8").strip())
89
+ if not task_ref:
90
+ return "Status: NO ACTIVE TASK\nNext: Describe what you want to work on"
91
+
92
+ task_dir = _resolve_task_dir(trellis_dir, task_ref)
93
+ if not task_dir.is_dir():
94
+ return f"Status: STALE POINTER\nTask: {task_ref}\nNext: Task directory not found. Run: python3 ./.trellis/scripts/task.py finish"
95
+
96
+ task_json_path = task_dir / "task.json"
97
+ task_data: dict = {}
98
+ if task_json_path.is_file():
99
+ try:
100
+ task_data = json.loads(task_json_path.read_text(encoding="utf-8"))
101
+ except (json.JSONDecodeError, PermissionError):
102
+ pass
103
+
104
+ task_title = task_data.get("title", task_ref)
105
+ task_status = task_data.get("status", "unknown")
106
+
107
+ if task_status == "completed":
108
+ return f"Status: COMPLETED\nTask: {task_title}\nNext: Archive with `python3 ./.trellis/scripts/task.py archive {task_dir.name}` or start a new task"
109
+
110
+ has_context = False
111
+ for jsonl_name in ("implement.jsonl", "check.jsonl", "spec.jsonl"):
112
+ jsonl_path = task_dir / jsonl_name
113
+ if jsonl_path.is_file() and jsonl_path.stat().st_size > 0:
114
+ has_context = True
115
+ break
116
+
117
+ has_prd = (task_dir / "prd.md").is_file()
118
+
119
+ if not has_prd:
120
+ return f"Status: NOT READY\nTask: {task_title}\nMissing: prd.md not created\nNext: Write PRD, then research → init-context → start"
121
+
122
+ if not has_context:
123
+ return f"Status: NOT READY\nTask: {task_title}\nMissing: Context not configured (no jsonl files)\nNext: Complete Phase 2 (research → init-context → start) before implementing"
124
+
125
+ return f"Status: READY\nTask: {task_title}\nNext: Continue with implement or check"
126
+
127
+
128
+ def _build_workflow_toc(workflow_path: Path) -> str:
129
+ """Build a compact section index for workflow.md (lazy-load the full file on demand).
130
+
131
+ Replaces full-file injection to keep additionalContext payload small.
132
+ The full file is accessible via: Read tool on .trellis/workflow.md
133
+ """
134
+ content = read_file(workflow_path)
135
+ if not content:
136
+ return "No workflow.md found"
137
+
138
+ toc_lines = [
139
+ "# Development Workflow — Section Index",
140
+ "Full guide: .trellis/workflow.md (read on demand)",
141
+ "",
142
+ ]
143
+ for line in content.splitlines():
144
+ if line.startswith("## "):
145
+ toc_lines.append(line)
146
+
147
+ toc_lines += [
148
+ "",
149
+ "To read a section: use the Read tool on .trellis/workflow.md",
150
+ ]
151
+ return "\n".join(toc_lines)
152
+
153
+
154
+ def main() -> None:
155
+ if should_skip_injection():
156
+ sys.exit(0)
157
+
158
+ # Read hook input from stdin
159
+ try:
160
+ hook_input = json.loads(sys.stdin.read())
161
+ project_dir = Path(hook_input.get("cwd", ".")).resolve()
162
+ except (json.JSONDecodeError, KeyError):
163
+ project_dir = Path(".").resolve()
164
+
165
+ trellis_dir = project_dir / ".trellis"
166
+
167
+ output = StringIO()
168
+
169
+ output.write("""<session-context>
170
+ You are starting a new session in a Trellis-managed project.
171
+ Read and follow all instructions below carefully.
172
+ </session-context>
173
+
174
+ """)
175
+
176
+ output.write("<current-state>\n")
177
+ context_script = trellis_dir / "scripts" / "get_context.py"
178
+ output.write(run_script(context_script))
179
+ output.write("\n</current-state>\n\n")
180
+
181
+ output.write("<workflow>\n")
182
+ output.write(_build_workflow_toc(trellis_dir / "workflow.md"))
183
+ output.write("\n</workflow>\n\n")
184
+
185
+ output.write("<guidelines>\n")
186
+ output.write("**Note**: The guidelines below are index files — they list available guideline documents and their locations.\n")
187
+ output.write("During actual development, you MUST read the specific guideline files listed in each index's Pre-Development Checklist.\n\n")
188
+
189
+ spec_dir = trellis_dir / "spec"
190
+ if spec_dir.is_dir():
191
+ for sub in sorted(spec_dir.iterdir()):
192
+ if not sub.is_dir() or sub.name.startswith("."):
193
+ continue
194
+
195
+ if sub.name == "guides":
196
+ index_file = sub / "index.md"
197
+ if index_file.is_file():
198
+ output.write(f"## {sub.name}\n")
199
+ output.write(read_file(index_file))
200
+ output.write("\n\n")
201
+ continue
202
+
203
+ index_file = sub / "index.md"
204
+ if index_file.is_file():
205
+ output.write(f"## {sub.name}\n")
206
+ output.write(read_file(index_file))
207
+ output.write("\n\n")
208
+ else:
209
+ for nested in sorted(sub.iterdir()):
210
+ if not nested.is_dir():
211
+ continue
212
+ nested_index = nested / "index.md"
213
+ if nested_index.is_file():
214
+ output.write(f"## {sub.name}/{nested.name}\n")
215
+ output.write(read_file(nested_index))
216
+ output.write("\n\n")
217
+
218
+ output.write("</guidelines>\n\n")
219
+
220
+ task_status = _get_task_status(trellis_dir)
221
+ output.write(f"<task-status>\n{task_status}\n</task-status>\n\n")
222
+
223
+ output.write("""<ready>
224
+ Context loaded. Workflow index, project state, and guidelines are already injected above — do NOT re-read them.
225
+ Wait for the user's first message, then handle it following the workflow guide.
226
+ If there is an active task, ask whether to continue it.
227
+ </ready>""")
228
+
229
+ context = output.getvalue()
230
+ result = {
231
+ "suppressOutput": True,
232
+ "systemMessage": f"Trellis context injected ({len(context)} chars)",
233
+ "hookSpecificOutput": {
234
+ "hookEventName": "SessionStart",
235
+ "additionalContext": context,
236
+ },
237
+ }
238
+
239
+ print(json.dumps(result, ensure_ascii=False), flush=True)
240
+
241
+
242
+ if __name__ == "__main__":
243
+ main()
@@ -0,0 +1,11 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "type": "command",
6
+ "command": "{{PYTHON_CMD}} .github/copilot/hooks/session-start.py",
7
+ "timeout": 10
8
+ }
9
+ ]
10
+ }
11
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copilot templates
3
+ *
4
+ * These are GENERIC templates for user projects.
5
+ *
6
+ * Directory structure:
7
+ * copilot/
8
+ * ├── prompts/ # Slash-command prompts → .github/prompts/*.prompt.md
9
+ * ├── hooks/ # Hook scripts → .github/copilot/hooks/
10
+ * └── hooks.json # Hooks config → .github/hooks/trellis.json
11
+ */
12
+ export interface HookTemplate {
13
+ name: string;
14
+ content: string;
15
+ }
16
+ export interface PromptTemplate {
17
+ name: string;
18
+ content: string;
19
+ }
20
+ export declare function getAllHooks(): HookTemplate[];
21
+ export declare function getHooksConfig(): string;
22
+ export declare function getAllPrompts(): PromptTemplate[];
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqBH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,WAAW,IAAI,YAAY,EAAE,CAW5C;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,aAAa,IAAI,cAAc,EAAE,CAchD"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Copilot templates
3
+ *
4
+ * These are GENERIC templates for user projects.
5
+ *
6
+ * Directory structure:
7
+ * copilot/
8
+ * ├── prompts/ # Slash-command prompts → .github/prompts/*.prompt.md
9
+ * ├── hooks/ # Hook scripts → .github/copilot/hooks/
10
+ * └── hooks.json # Hooks config → .github/hooks/trellis.json
11
+ */
12
+ import { readdirSync, readFileSync } from "node:fs";
13
+ import { dirname, join } from "node:path";
14
+ import { fileURLToPath } from "node:url";
15
+ const __filename = fileURLToPath(import.meta.url);
16
+ const __dirname = dirname(__filename);
17
+ function readTemplate(relativePath) {
18
+ return readFileSync(join(__dirname, relativePath), "utf-8");
19
+ }
20
+ function listFiles(dir) {
21
+ try {
22
+ return readdirSync(join(__dirname, dir)).sort();
23
+ }
24
+ catch {
25
+ return [];
26
+ }
27
+ }
28
+ export function getAllHooks() {
29
+ const hooks = [];
30
+ for (const file of listFiles("hooks")) {
31
+ if (!file.endsWith(".py")) {
32
+ continue;
33
+ }
34
+ hooks.push({ name: file, content: readTemplate(`hooks/${file}`) });
35
+ }
36
+ return hooks;
37
+ }
38
+ export function getHooksConfig() {
39
+ return readTemplate("hooks.json");
40
+ }
41
+ export function getAllPrompts() {
42
+ const prompts = [];
43
+ for (const file of listFiles("prompts")) {
44
+ if (!file.endsWith(".prompt.md")) {
45
+ continue;
46
+ }
47
+ prompts.push({
48
+ name: file.slice(0, -".prompt.md".length),
49
+ content: readTemplate(`prompts/${file}`),
50
+ });
51
+ }
52
+ return prompts;
53
+ }
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,SAAS,CAAC,GAAW;IAC5B,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAYD,MAAM,UAAU,WAAW;IACzB,MAAM,KAAK,GAAmB,EAAE,CAAC;IAEjC,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,SAAS;QACX,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,YAAY,CAAC,YAAY,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,MAAM,OAAO,GAAqB,EAAE,CAAC;IAErC,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;QACxC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YACjC,SAAS;QACX,CAAC;QACD,OAAO,CAAC,IAAI,CAAC;YACX,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC;YACzC,OAAO,EAAE,YAAY,CAAC,WAAW,IAAI,EAAE,CAAC;SACzC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: "Trellis Copilot prompt: before-dev.prompt"
3
+ ---
4
+
5
+ Read the relevant development guidelines before starting your task.
6
+
7
+ Execute these steps:
8
+
9
+ 1. **Discover packages and their spec layers**:
10
+ ```bash
11
+ python3 ./.trellis/scripts/get_context.py --mode packages
12
+ ```
13
+
14
+ 2. **Identify which specs apply** to your task based on:
15
+ - Which package you're modifying (e.g., `cli/`, `docs-site/`)
16
+ - What type of work (backend, frontend, unit-test, docs, etc.)
17
+
18
+ 3. **Read the spec index** for each relevant module:
19
+ ```bash
20
+ cat .trellis/spec/<package>/<layer>/index.md
21
+ ```
22
+ Follow the **"Pre-Development Checklist"** section in the index.
23
+
24
+ 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.
25
+
26
+ 5. **Always read shared guides**:
27
+ ```bash
28
+ cat .trellis/spec/guides/index.md
29
+ ```
30
+
31
+ 6. Understand the coding standards and patterns you need to follow, then proceed with your development plan.
32
+
33
+ This step is **mandatory** before writing any code.