@mindfoldhq/trellis 0.1.0 → 0.1.2

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 (140) hide show
  1. package/README.md +58 -11
  2. package/dist/.claude/agents/check.md +98 -0
  3. package/dist/.claude/agents/debug.md +109 -0
  4. package/dist/{templates/agents/dispatch.txt → .claude/agents/dispatch.md} +20 -12
  5. package/dist/.claude/agents/implement.md +101 -0
  6. package/dist/.claude/agents/plan.md +396 -0
  7. package/dist/.claude/agents/research.md +120 -0
  8. package/dist/{templates/commands/common/check-cross-layer.txt → .claude/commands/check-cross-layer.md} +29 -29
  9. package/dist/{templates/commands/common/onboard-developer.txt → .claude/commands/onboard-developer.md} +2 -2
  10. package/dist/.claude/commands/parallel.md +199 -0
  11. package/dist/{templates/commands/common/record-agent-flow.txt → .claude/commands/record-agent-flow.md} +1 -1
  12. package/dist/.claude/commands/start.md +192 -0
  13. package/dist/{templates → .claude}/hooks/inject-subagent-context.py +63 -0
  14. package/dist/.cursor/commands/before-backend-dev.md +13 -0
  15. package/dist/.cursor/commands/before-frontend-dev.md +13 -0
  16. package/dist/.cursor/commands/break-loop.md +107 -0
  17. package/dist/.cursor/commands/check-backend.md +13 -0
  18. package/dist/.cursor/commands/check-cross-layer.md +153 -0
  19. package/dist/.cursor/commands/check-frontend.md +13 -0
  20. package/dist/.cursor/commands/create-command.md +154 -0
  21. package/dist/.cursor/commands/finish-work.md +129 -0
  22. package/dist/.cursor/commands/integrate-skill.md +219 -0
  23. package/dist/.cursor/commands/onboard-developer.md +355 -0
  24. package/dist/.cursor/commands/record-agent-flow.md +62 -0
  25. package/dist/.cursor/commands/start.md +157 -0
  26. package/dist/{templates/markdown/agent-traces-index.md.txt → .trellis/agent-traces/index.md} +8 -9
  27. package/dist/{templates/scripts/add-session.sh.txt → .trellis/scripts/add-session.sh} +14 -14
  28. package/dist/{templates/scripts/common/developer.sh.txt → .trellis/scripts/common/developer.sh} +13 -13
  29. package/dist/{templates/scripts/common/git-context.sh.txt → .trellis/scripts/common/git-context.sh} +8 -8
  30. package/dist/{templates/scripts/common/paths.sh.txt → .trellis/scripts/common/paths.sh} +4 -4
  31. package/dist/.trellis/scripts/common/phase.sh +150 -0
  32. package/dist/.trellis/scripts/common/worktree.sh +138 -0
  33. package/dist/{templates/scripts/feature.sh.txt → .trellis/scripts/feature.sh} +297 -0
  34. package/dist/.trellis/scripts/multi-agent/cleanup.sh +416 -0
  35. package/dist/.trellis/scripts/multi-agent/create-pr.sh +241 -0
  36. package/dist/.trellis/scripts/multi-agent/plan.sh +232 -0
  37. package/dist/.trellis/scripts/multi-agent/start.sh +344 -0
  38. package/dist/.trellis/scripts/multi-agent/status.sh +695 -0
  39. package/dist/.trellis/structure/backend/database-guidelines.md +51 -0
  40. package/dist/.trellis/structure/backend/directory-structure.md +209 -0
  41. package/dist/.trellis/structure/backend/error-handling.md +278 -0
  42. package/dist/.trellis/structure/backend/index.md +38 -0
  43. package/dist/.trellis/structure/backend/logging-guidelines.md +266 -0
  44. package/dist/.trellis/structure/backend/quality-guidelines.md +313 -0
  45. package/dist/.trellis/structure/frontend/component-guidelines.md +59 -0
  46. package/dist/.trellis/structure/frontend/directory-structure.md +54 -0
  47. package/dist/.trellis/structure/frontend/hook-guidelines.md +51 -0
  48. package/dist/.trellis/structure/frontend/index.md +39 -0
  49. package/dist/.trellis/structure/frontend/quality-guidelines.md +51 -0
  50. package/dist/.trellis/structure/frontend/state-management.md +51 -0
  51. package/dist/.trellis/structure/frontend/type-safety.md +51 -0
  52. package/dist/.trellis/structure/guides/code-reuse-thinking-guide.md +92 -0
  53. package/dist/.trellis/structure/guides/cross-layer-thinking-guide.md +94 -0
  54. package/dist/.trellis/structure/guides/index.md +79 -0
  55. package/dist/{templates/markdown/workflow.md.txt → .trellis/workflow.md} +6 -6
  56. package/dist/.trellis/worktree.yaml +49 -0
  57. package/dist/cli/index.js +1 -0
  58. package/dist/cli/index.js.map +1 -1
  59. package/dist/commands/init.d.ts.map +1 -1
  60. package/dist/commands/init.js +29 -15
  61. package/dist/commands/init.js.map +1 -1
  62. package/dist/configurators/claude.d.ts +17 -17
  63. package/dist/configurators/claude.d.ts.map +1 -1
  64. package/dist/configurators/claude.js +29 -59
  65. package/dist/configurators/claude.js.map +1 -1
  66. package/dist/configurators/cursor.d.ts +3 -3
  67. package/dist/configurators/cursor.d.ts.map +1 -1
  68. package/dist/configurators/cursor.js +11 -15
  69. package/dist/configurators/cursor.js.map +1 -1
  70. package/dist/configurators/opencode.d.ts +25 -0
  71. package/dist/configurators/opencode.d.ts.map +1 -0
  72. package/dist/configurators/opencode.js +54 -0
  73. package/dist/configurators/opencode.js.map +1 -0
  74. package/dist/configurators/workflow.d.ts +9 -0
  75. package/dist/configurators/workflow.d.ts.map +1 -1
  76. package/dist/configurators/workflow.js +32 -72
  77. package/dist/configurators/workflow.js.map +1 -1
  78. package/dist/templates/extract.d.ts +73 -8
  79. package/dist/templates/extract.d.ts.map +1 -1
  80. package/dist/templates/extract.js +149 -10
  81. package/dist/templates/extract.js.map +1 -1
  82. package/dist/templates/markdown/{agents.md.txt → agents.md} +1 -1
  83. package/dist/templates/markdown/index.d.ts +5 -1
  84. package/dist/templates/markdown/index.d.ts.map +1 -1
  85. package/dist/templates/markdown/index.js +54 -26
  86. package/dist/templates/markdown/index.js.map +1 -1
  87. package/dist/templates/markdown/{init-agent.md.txt → init-agent.md} +8 -8
  88. package/dist/templates/markdown/structure/backend/directory-structure.md.txt +6 -6
  89. package/dist/templates/markdown/structure/backend/error-handling.md.txt +8 -8
  90. package/dist/templates/markdown/structure/backend/index.md.txt +5 -5
  91. package/dist/templates/markdown/structure/backend/logging-guidelines.md.txt +8 -8
  92. package/dist/templates/markdown/structure/frontend/index.md.txt +6 -6
  93. package/dist/templates/markdown/structure/guides/cross-layer-thinking-guide.md.txt +5 -5
  94. package/dist/templates/markdown/structure/guides/index.md.txt +7 -7
  95. package/dist/templates/markdown/worktree.yaml.txt +58 -0
  96. package/dist/types/ai-tools.d.ts +2 -2
  97. package/dist/types/ai-tools.d.ts.map +1 -1
  98. package/dist/types/ai-tools.js +4 -0
  99. package/dist/types/ai-tools.js.map +1 -1
  100. package/package.json +1 -1
  101. package/dist/configurators/templates.d.ts +0 -40
  102. package/dist/configurators/templates.d.ts.map +0 -1
  103. package/dist/configurators/templates.js +0 -67
  104. package/dist/configurators/templates.js.map +0 -1
  105. package/dist/templates/agents/check.txt +0 -120
  106. package/dist/templates/agents/debug.txt +0 -121
  107. package/dist/templates/agents/implement.txt +0 -114
  108. package/dist/templates/agents/index.d.ts +0 -35
  109. package/dist/templates/agents/index.d.ts.map +0 -1
  110. package/dist/templates/agents/index.js +0 -71
  111. package/dist/templates/agents/index.js.map +0 -1
  112. package/dist/templates/agents/research.txt +0 -258
  113. package/dist/templates/commands/claude/start.md.txt +0 -127
  114. package/dist/templates/commands/cursor/start.md.txt +0 -94
  115. package/dist/templates/commands/index.d.ts +0 -46
  116. package/dist/templates/commands/index.d.ts.map +0 -1
  117. package/dist/templates/commands/index.js +0 -151
  118. package/dist/templates/commands/index.js.map +0 -1
  119. package/dist/templates/hooks/index.d.ts +0 -33
  120. package/dist/templates/hooks/index.d.ts.map +0 -1
  121. package/dist/templates/hooks/index.js +0 -53
  122. package/dist/templates/hooks/index.js.map +0 -1
  123. package/dist/templates/markdown/gitignore.txt +0 -3
  124. package/dist/templates/scripts/index.d.ts +0 -25
  125. package/dist/templates/scripts/index.d.ts.map +0 -1
  126. package/dist/templates/scripts/index.js +0 -28
  127. package/dist/templates/scripts/index.js.map +0 -1
  128. /package/dist/{templates/commands/common/before-backend-dev.txt → .claude/commands/before-backend-dev.md} +0 -0
  129. /package/dist/{templates/commands/common/before-frontend-dev.txt → .claude/commands/before-frontend-dev.md} +0 -0
  130. /package/dist/{templates/commands/common/break-loop.txt → .claude/commands/break-loop.md} +0 -0
  131. /package/dist/{templates/commands/common/check-backend.txt → .claude/commands/check-backend.md} +0 -0
  132. /package/dist/{templates/commands/common/check-frontend.txt → .claude/commands/check-frontend.md} +0 -0
  133. /package/dist/{templates/commands/common/create-command.txt → .claude/commands/create-command.md} +0 -0
  134. /package/dist/{templates/commands/common/finish-work.txt → .claude/commands/finish-work.md} +0 -0
  135. /package/dist/{templates/commands/common/integrate-skill.txt → .claude/commands/integrate-skill.md} +0 -0
  136. /package/dist/{templates/hooks → .claude}/settings.json +0 -0
  137. /package/dist/{templates/scripts/create-bootstrap.sh.txt → .trellis/scripts/create-bootstrap.sh} +0 -0
  138. /package/dist/{templates/scripts/get-context.sh.txt → .trellis/scripts/get-context.sh} +0 -0
  139. /package/dist/{templates/scripts/get-developer.sh.txt → .trellis/scripts/get-developer.sh} +0 -0
  140. /package/dist/{templates/scripts/init-developer.sh.txt → .trellis/scripts/init-developer.sh} +0 -0
@@ -0,0 +1,355 @@
1
+ You are a senior developer onboarding a new team member to this project's AI-assisted workflow system.
2
+
3
+ YOUR ROLE: Be a mentor and teacher. Don't just list steps - EXPLAIN the underlying principles, why each command exists, what problem it solves at a fundamental level.
4
+
5
+ ## CRITICAL INSTRUCTION - YOU MUST COMPLETE ALL SECTIONS
6
+
7
+ This onboarding has THREE equally important parts:
8
+
9
+ **PART 1: Core Concepts** (Sections: CORE PHILOSOPHY, SYSTEM STRUCTURE, COMMAND DEEP DIVE)
10
+ - Explain WHY this workflow exists
11
+ - Explain WHAT each command does and WHY
12
+
13
+ **PART 2: Real-World Examples** (Section: REAL-WORLD WORKFLOW EXAMPLES)
14
+ - Walk through ALL 5 examples in detail
15
+ - For EACH step in EACH example, explain:
16
+ - PRINCIPLE: Why this step exists
17
+ - WHAT HAPPENS: What the command actually does
18
+ - IF SKIPPED: What goes wrong without it
19
+
20
+ **PART 3: Customize Your Development Guidelines** (Section: CUSTOMIZE YOUR DEVELOPMENT GUIDELINES)
21
+ - Check if project guidelines are still empty templates
22
+ - If empty, guide the developer to fill them with project-specific content
23
+ - Explain the customization workflow
24
+
25
+ DO NOT skip any part. All three parts are essential:
26
+ - Part 1 teaches the concepts
27
+ - Part 2 shows how concepts work in practice
28
+ - Part 3 ensures the project has proper guidelines for AI to follow
29
+
30
+ After completing ALL THREE parts, ask the developer about their first task.
31
+
32
+ ---
33
+
34
+ ## CORE PHILOSOPHY: Why This Workflow Exists
35
+
36
+ AI-assisted development has three fundamental challenges:
37
+
38
+ ### Challenge 1: AI Has No Memory
39
+
40
+ Every AI session starts with a blank slate. Unlike human engineers who accumulate project knowledge over weeks/months, AI forgets everything when a session ends.
41
+
42
+ **The Problem**: Without memory, AI asks the same questions repeatedly, makes the same mistakes, and can't build on previous work.
43
+
44
+ **The Solution**: The `.trellis/agent-traces/` system captures what happened in each session - what was done, what was learned, what problems were solved. The `/start` command reads this history at session start, giving AI "artificial memory."
45
+
46
+ ### Challenge 2: AI Has Generic Knowledge, Not Project-Specific Knowledge
47
+
48
+ AI models are trained on millions of codebases - they know general patterns for React, TypeScript, databases, etc. But they don't know YOUR project's conventions.
49
+
50
+ **The Problem**: AI writes code that "works" but doesn't match your project's style. It uses patterns that conflict with existing code. It makes decisions that violate unwritten team rules.
51
+
52
+ **The Solution**: The `.trellis/structure/` directory contains project-specific guidelines. The `/before-*-dev` commands inject this specialized knowledge into AI context before coding starts.
53
+
54
+ ### Challenge 3: AI Context Window Is Limited
55
+
56
+ Even after injecting guidelines, AI has limited context window. As conversation grows, earlier context (including guidelines) gets pushed out or becomes less influential.
57
+
58
+ **The Problem**: AI starts following guidelines, but as the session progresses and context fills up, it "forgets" the rules and reverts to generic patterns.
59
+
60
+ **The Solution**: The `/check-*` commands re-verify code against guidelines AFTER writing, catching drift that occurred during development. The `/finish-work` command does a final holistic review.
61
+
62
+ ---
63
+
64
+ ## SYSTEM STRUCTURE
65
+
66
+ ```
67
+ .trellis/
68
+ |-- .developer # Your identity (gitignored)
69
+ |-- workflow.md # Complete workflow documentation
70
+ |-- agent-traces/ # "AI Memory" - session history
71
+ | |-- index.md # All developers' progress
72
+ | \-- {developer}/ # Per-developer directory
73
+ | |-- index.md # Personal progress index
74
+ | |-- features/ # Active feature tracking
75
+ | \-- traces-N.md # Session records (max 2000 lines)
76
+ |-- structure/ # "AI Training Data" - project knowledge
77
+ | |-- frontend/ # Frontend conventions
78
+ | |-- backend/ # Backend conventions
79
+ | \-- guides/ # Thinking patterns
80
+ \-- scripts/ # Automation tools
81
+ ```
82
+
83
+ ### Understanding structure/ subdirectories
84
+
85
+ **frontend/** - Single-layer frontend knowledge:
86
+ - Component patterns (how to write components in THIS project)
87
+ - State management rules (Redux? Zustand? Context?)
88
+ - Styling conventions (CSS modules? Tailwind? Styled-components?)
89
+ - Hook patterns (custom hooks, data fetching)
90
+
91
+ **backend/** - Single-layer backend knowledge:
92
+ - API design patterns (REST? GraphQL? tRPC?)
93
+ - Database conventions (query patterns, migrations)
94
+ - Error handling standards
95
+ - Logging and monitoring rules
96
+
97
+ **guides/** - Cross-layer thinking guides:
98
+ - Code reuse thinking guide
99
+ - Cross-layer thinking guide
100
+ - Pre-implementation checklists
101
+
102
+ ---
103
+
104
+ ## COMMAND DEEP DIVE
105
+
106
+ ### /start - Restore AI Memory
107
+
108
+ **WHY IT EXISTS**:
109
+ When a human engineer joins a project, they spend days/weeks learning: What is this project? What's been built? What's in progress? What's the current state?
110
+
111
+ AI needs the same onboarding - but compressed into seconds at session start.
112
+
113
+ **WHAT IT ACTUALLY DOES**:
114
+ 1. Reads developer identity (who am I in this project?)
115
+ 2. Checks git status (what branch? uncommitted changes?)
116
+ 3. Reads recent session history from `agent-traces/` (what happened before?)
117
+ 4. Identifies active features (what's in progress?)
118
+ 5. Understands current project state before making any changes
119
+
120
+ **WHY THIS MATTERS**:
121
+ - Without /start: AI is blind. It might work on wrong branch, conflict with others' work, or redo already-completed work.
122
+ - With /start: AI knows project context, can continue where previous session left off, avoids conflicts.
123
+
124
+ ---
125
+
126
+ ### /before-frontend-dev and /before-backend-dev - Inject Specialized Knowledge
127
+
128
+ **WHY IT EXISTS**:
129
+ AI models have "pre-trained knowledge" - general patterns from millions of codebases. But YOUR project has specific conventions that differ from generic patterns.
130
+
131
+ **WHAT IT ACTUALLY DOES**:
132
+ 1. Reads `.trellis/structure/frontend/` or `.trellis/structure/backend/`
133
+ 2. Loads project-specific patterns into AI's working context:
134
+ - Component naming conventions
135
+ - State management patterns
136
+ - Database query patterns
137
+ - Error handling standards
138
+
139
+ **WHY THIS MATTERS**:
140
+ - Without before-*-dev: AI writes generic code that doesn't match project style.
141
+ - With before-*-dev: AI writes code that looks like the rest of the codebase.
142
+
143
+ ---
144
+
145
+ ### /check-frontend and /check-backend - Combat Context Drift
146
+
147
+ **WHY IT EXISTS**:
148
+ AI context window has limited capacity. As conversation progresses, guidelines injected at session start become less influential. This causes "context drift."
149
+
150
+ **WHAT IT ACTUALLY DOES**:
151
+ 1. Re-reads the guidelines that were injected earlier
152
+ 2. Compares written code against those guidelines
153
+ 3. Runs type checker and linter
154
+ 4. Identifies violations and suggests fixes
155
+
156
+ **WHY THIS MATTERS**:
157
+ - Without check-*: Context drift goes unnoticed, code quality degrades.
158
+ - With check-*: Drift is caught and corrected before commit.
159
+
160
+ ---
161
+
162
+ ### /check-cross-layer - Multi-Dimension Verification
163
+
164
+ **WHY IT EXISTS**:
165
+ Most bugs don't come from lack of technical skill - they come from "didn't think of it":
166
+ - Changed a constant in one place, missed 5 other places
167
+ - Modified database schema, forgot to update the API layer
168
+ - Created a utility function, but similar one already exists
169
+
170
+ **WHAT IT ACTUALLY DOES**:
171
+ 1. Identifies which dimensions your change involves
172
+ 2. For each dimension, runs targeted checks:
173
+ - Cross-layer data flow
174
+ - Code reuse analysis
175
+ - Import path validation
176
+ - Consistency checks
177
+
178
+ ---
179
+
180
+ ### /finish-work - Holistic Pre-Commit Review
181
+
182
+ **WHY IT EXISTS**:
183
+ The `/check-*` commands focus on code quality within a single layer. But real changes often have cross-cutting concerns.
184
+
185
+ **WHAT IT ACTUALLY DOES**:
186
+ 1. Reviews all changes holistically
187
+ 2. Checks cross-layer consistency
188
+ 3. Identifies broader impacts
189
+ 4. Checks if new patterns should be documented
190
+
191
+ ---
192
+
193
+ ### /record-agent-flow - Persist Memory for Future
194
+
195
+ **WHY IT EXISTS**:
196
+ All the context AI built during this session will be lost when session ends. The next session's `/start` needs this information.
197
+
198
+ **WHAT IT ACTUALLY DOES**:
199
+ 1. Records session summary to `agent-traces/{developer}/traces-N.md`
200
+ 2. Captures what was done, learned, and what's remaining
201
+ 3. Updates index files for quick lookup
202
+
203
+ ---
204
+
205
+ ## REAL-WORLD WORKFLOW EXAMPLES
206
+
207
+ ### Example 1: Bug Fix Session
208
+
209
+ **[1/8] /start** - AI needs project context before touching code
210
+ **[2/8] ./.trellis/scripts/feature.sh create fix-bug** - Track work for future reference
211
+ **[3/8] /before-frontend-dev** - Inject project-specific frontend knowledge
212
+ **[4/8] Investigate and fix the bug** - Actual development work
213
+ **[5/8] /check-frontend** - Re-verify code against guidelines
214
+ **[6/8] /finish-work** - Holistic cross-layer review
215
+ **[7/8] Human tests and commits** - Human validates before code enters repo
216
+ **[8/8] /record-agent-flow** - Persist memory for future sessions
217
+
218
+ ### Example 2: Planning Session (No Code)
219
+
220
+ **[1/4] /start** - Context needed even for non-coding work
221
+ **[2/4] ./.trellis/scripts/feature.sh create planning-task** - Planning is valuable work
222
+ **[3/4] Review docs, create subtask list** - Actual planning work
223
+ **[4/4] /record-agent-flow (with --summary)** - Planning decisions must be recorded
224
+
225
+ ### Example 3: Code Review Fixes
226
+
227
+ **[1/6] /start** - Resume context from previous session
228
+ **[2/6] /before-backend-dev** - Re-inject guidelines before fixes
229
+ **[3/6] Fix each CR issue** - Address feedback with guidelines in context
230
+ **[4/6] /check-backend** - Verify fixes didn't introduce new issues
231
+ **[5/6] /finish-work** - Document lessons from CR
232
+ **[6/6] Human commits, then /record-agent-flow** - Preserve CR lessons
233
+
234
+ ### Example 4: Large Refactoring
235
+
236
+ **[1/5] /start** - Clear baseline before major changes
237
+ **[2/5] Plan phases** - Break into verifiable chunks
238
+ **[3/5] Execute phase by phase with /check-* after each** - Incremental verification
239
+ **[4/5] /finish-work** - Check if new patterns should be documented
240
+ **[5/5] Record with multiple commit hashes** - Link all commits to one feature
241
+
242
+ ### Example 5: Debug Session
243
+
244
+ **[1/6] /start** - See if this bug was investigated before
245
+ **[2/6] /before-backend-dev** - Guidelines might document known gotchas
246
+ **[3/6] Investigation** - Actual debugging work
247
+ **[4/6] /check-backend** - Verify debug changes don't break other things
248
+ **[5/6] /finish-work** - Debug findings might need documentation
249
+ **[6/6] Human commits, then /record-agent-flow** - Debug knowledge is valuable
250
+
251
+ ---
252
+
253
+ ## KEY RULES TO EMPHASIZE
254
+
255
+ 1. **AI NEVER commits** - Human tests and approves. AI prepares, human validates.
256
+ 2. **Guidelines before code** - /before-*-dev commands inject project knowledge.
257
+ 3. **Check after code** - /check-* commands catch context drift.
258
+ 4. **Record everything** - /record-agent-flow persists memory.
259
+
260
+ ---
261
+
262
+ # PART 3: Customize Your Development Guidelines
263
+
264
+ After explaining Part 1 and Part 2, check if the project's development guidelines need customization.
265
+
266
+ ## Step 1: Check Current Guidelines Status
267
+
268
+ Check if `.trellis/structure/` contains empty templates or customized guidelines:
269
+
270
+ ```bash
271
+ # Check if files are still empty templates (look for placeholder text)
272
+ grep -l "To be filled by the team" .trellis/structure/backend/*.md 2>/dev/null | wc -l
273
+ grep -l "To be filled by the team" .trellis/structure/frontend/*.md 2>/dev/null | wc -l
274
+ ```
275
+
276
+ ## Step 2: Determine Situation
277
+
278
+ **Situation A: First-time setup (empty templates)**
279
+
280
+ If guidelines are empty templates (contain "To be filled by the team"), this is the first time using Trellis in this project.
281
+
282
+ Explain to the developer:
283
+
284
+ "I see that the development guidelines in `.trellis/structure/` are still empty templates. This is normal for a new Trellis setup!
285
+
286
+ The templates contain placeholder text that needs to be replaced with YOUR project's actual conventions. Without this, `/before-*-dev` commands won't provide useful guidance.
287
+
288
+ **Your first task should be to fill in these guidelines:**
289
+
290
+ 1. Look at your existing codebase
291
+ 2. Identify the patterns and conventions already in use
292
+ 3. Document them in the guideline files
293
+
294
+ For example, for `.trellis/structure/backend/database-guidelines.md`:
295
+ - What ORM/query library does your project use?
296
+ - How are migrations managed?
297
+ - What naming conventions for tables/columns?
298
+
299
+ Would you like me to help you analyze your codebase and fill in these guidelines?"
300
+
301
+ **Situation B: Guidelines already customized**
302
+
303
+ If guidelines have real content (no "To be filled" placeholders), this is an existing setup.
304
+
305
+ Explain to the developer:
306
+
307
+ "Great! Your team has already customized the development guidelines. You can start using `/before-*-dev` commands right away.
308
+
309
+ I recommend reading through `.trellis/structure/` to familiarize yourself with the team's coding standards."
310
+
311
+ ## Step 3: Help Fill Guidelines (If Empty)
312
+
313
+ If the developer wants help filling guidelines, create a feature to track this:
314
+
315
+ ```bash
316
+ ./.trellis/scripts/feature.sh create fill-structure-guidelines
317
+ ```
318
+
319
+ Then systematically analyze the codebase and fill each guideline file:
320
+
321
+ 1. **Analyze the codebase** - Look at existing code patterns
322
+ 2. **Document conventions** - Write what you observe, not ideals
323
+ 3. **Include examples** - Reference actual files in the project
324
+ 4. **List forbidden patterns** - Document anti-patterns the team avoids
325
+
326
+ Work through one file at a time:
327
+ - `backend/directory-structure.md`
328
+ - `backend/database-guidelines.md`
329
+ - `backend/error-handling.md`
330
+ - `backend/quality-guidelines.md`
331
+ - `backend/logging-guidelines.md`
332
+ - `frontend/directory-structure.md`
333
+ - `frontend/component-guidelines.md`
334
+ - `frontend/hook-guidelines.md`
335
+ - `frontend/state-management.md`
336
+ - `frontend/quality-guidelines.md`
337
+ - `frontend/type-safety.md`
338
+
339
+ ---
340
+
341
+ ## Completing the Onboard Session
342
+
343
+ After covering all three parts, summarize:
344
+
345
+ "You're now onboarded to the Trellis workflow system! Here's what we covered:
346
+ - Part 1: Core concepts (why this workflow exists)
347
+ - Part 2: Real-world examples (how to apply the workflow)
348
+ - Part 3: Guidelines status (empty templates need filling / already customized)
349
+
350
+ **Next steps** (tell user):
351
+ 1. Run `/record-agent-flow` to record this onboard session
352
+ 2. [If guidelines empty] Start filling in `.trellis/structure/` guidelines
353
+ 3. [If guidelines ready] Start your first development task
354
+
355
+ What would you like to do first?"
@@ -0,0 +1,62 @@
1
+ [!] **Prerequisite**: This command should only be used AFTER the human has tested and committed the code.
2
+
3
+ **AI must NOT execute git commit** - only read history (`git log`, `git status`, `git diff`).
4
+
5
+ ---
6
+
7
+ ## Record Work Progress (Simplified - Only 2 Steps)
8
+
9
+ ### Step 1: Get Context
10
+
11
+ ```bash
12
+ ./.trellis/scripts/get-context.sh
13
+ ```
14
+
15
+ ### Step 2: One-Click Add Session
16
+
17
+ ```bash
18
+ # Method 1: Simple parameters
19
+ ./.trellis/scripts/add-session.sh \
20
+ --title "Session Title" \
21
+ --commit "hash1,hash2" \
22
+ --summary "Brief summary of what was done"
23
+
24
+ # Method 2: Pass detailed content via stdin
25
+ cat << 'EOF' | ./.trellis/scripts/add-session.sh --title "Title" --commit "hash"
26
+ | Feature | Description |
27
+ |---------|-------------|
28
+ | New API | Added user authentication endpoint |
29
+ | Frontend | Updated login form |
30
+
31
+ **Updated Files**:
32
+ - `packages/api/modules/auth/router.ts`
33
+ - `apps/web/modules/auth/components/login-form.tsx`
34
+ EOF
35
+ ```
36
+
37
+ **Auto-completes**:
38
+ - [OK] Appends session to traces-N.md
39
+ - [OK] Auto-detects line count, creates new file if >2000 lines
40
+ - [OK] Updates index.md (Total Sessions +1, Last Active, line stats, history)
41
+
42
+ ---
43
+
44
+ ## Archive Completed Feature (if any)
45
+
46
+ If a feature was completed this session:
47
+
48
+ ```bash
49
+ ./.trellis/scripts/feature.sh archive <feature-name>
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Script Command Reference
55
+
56
+ | Command | Purpose |
57
+ |---------|---------|
58
+ | `get-context.sh` | Get all context info |
59
+ | `add-session.sh --title "..." --commit "..."` | **One-click add session (recommended)** |
60
+ | `feature.sh create <name>` | Create new feature directory |
61
+ | `feature.sh archive <name>` | Archive completed feature |
62
+ | `feature.sh list` | List active features |
@@ -0,0 +1,157 @@
1
+ # Start Session
2
+
3
+ Initialize your AI development session and begin working on tasks.
4
+
5
+ ---
6
+
7
+ ## Operation Types
8
+
9
+ Operations in this document are categorized as:
10
+
11
+ | Marker | Meaning | Executor |
12
+ |--------|---------|----------|
13
+ | `[AI]` | Bash scripts or file reads executed by AI | You (AI) |
14
+ | `[USER]` | Slash commands executed by user | User |
15
+
16
+ ---
17
+
18
+ ## Initialization
19
+
20
+ ### Step 1: Understand Trellis Workflow `[AI]`
21
+
22
+ First, read the following files to understand the workflow system:
23
+
24
+ ```bash
25
+ cat init-agent.md # Project overview and initialization guide
26
+ cat .trellis/workflow.md # Development process and conventions
27
+ ```
28
+
29
+ ### Step 2: Get Current Status `[AI]`
30
+
31
+ ```bash
32
+ ./.trellis/scripts/get-context.sh
33
+ ```
34
+
35
+ This returns:
36
+ - Developer identity
37
+ - Git status (branch, uncommitted changes)
38
+ - Recent commits
39
+ - Active features
40
+ - Traces file status
41
+
42
+ ### Step 3: Read Project Guidelines `[AI]`
43
+
44
+ Based on the upcoming task, read appropriate structure docs:
45
+
46
+ **For Frontend Work**:
47
+ ```bash
48
+ cat .trellis/structure/frontend/index.md
49
+ ```
50
+
51
+ **For Backend Work**:
52
+ ```bash
53
+ cat .trellis/structure/backend/index.md
54
+ ```
55
+
56
+ **For Cross-Layer Features**:
57
+ ```bash
58
+ cat .trellis/structure/guides/index.md
59
+ cat .trellis/structure/guides/cross-layer-thinking-guide.md
60
+ ```
61
+
62
+ ### Step 4: Check Active Features `[AI]`
63
+
64
+ ```bash
65
+ ./.trellis/scripts/feature.sh list
66
+ ```
67
+
68
+ If continuing previous work, review the feature file.
69
+
70
+ ### Step 5: Report Ready Status and Ask for Tasks
71
+
72
+ Output a summary:
73
+
74
+ ```markdown
75
+ ## Session Initialized
76
+
77
+ | Item | Status |
78
+ |------|--------|
79
+ | Developer | {name} |
80
+ | Branch | {branch} |
81
+ | Uncommitted | {count} file(s) |
82
+ | Traces | {file} ({lines}/2000 lines) |
83
+ | Active Features | {count} |
84
+
85
+ Ready for your task. What would you like to work on?
86
+ ```
87
+
88
+ ---
89
+
90
+ ## Working on Tasks
91
+
92
+ ### For Simple Tasks
93
+
94
+ 1. Read relevant guidelines based on task type `[AI]`
95
+ 2. Implement the task directly `[AI]`
96
+ 3. Remind user to run `/finish-work` before committing `[USER]`
97
+
98
+ ### For Complex Tasks (Multi-Step Features)
99
+
100
+ #### Step 1: Create Feature `[AI]`
101
+
102
+ ```bash
103
+ ./.trellis/scripts/feature.sh create <name>
104
+ ```
105
+
106
+ #### Step 2: Implement and Verify `[AI]`
107
+
108
+ 1. Read relevant structure docs
109
+ 2. Implement the feature
110
+ 3. Run lint and type checks
111
+
112
+ #### Step 3: Complete
113
+
114
+ 1. Verify typecheck and lint pass `[AI]`
115
+ 2. Remind user to test
116
+ 3. Remind user to commit
117
+ 4. Remind user to run `/record-agent-flow` `[USER]`
118
+ 5. Archive feature `[AI]`:
119
+ ```bash
120
+ ./.trellis/scripts/feature.sh archive <feature-name>
121
+ ```
122
+
123
+ ---
124
+
125
+ ## User Available Commands `[USER]`
126
+
127
+ The following slash commands are for users (not AI):
128
+
129
+ | Command | Description |
130
+ |---------|-------------|
131
+ | `/start` | Start development session (this command) |
132
+ | `/before-frontend-dev` | Read frontend guidelines |
133
+ | `/before-backend-dev` | Read backend guidelines |
134
+ | `/check-frontend` | Check frontend code |
135
+ | `/check-backend` | Check backend code |
136
+ | `/check-cross-layer` | Cross-layer verification |
137
+ | `/finish-work` | Pre-commit checklist |
138
+ | `/record-agent-flow` | Record session progress |
139
+
140
+ ---
141
+
142
+ ## AI Executed Scripts `[AI]`
143
+
144
+ | Script | Purpose |
145
+ |--------|---------|
146
+ | `feature.sh create <name>` | Create feature directory |
147
+ | `feature.sh list` | List active features |
148
+ | `feature.sh archive <name>` | Archive feature |
149
+ | `get-context.sh` | Get session context |
150
+
151
+ ---
152
+
153
+ ## Session End Reminder
154
+
155
+ **IMPORTANT**: When a task or session is completed, remind the user:
156
+
157
+ > Before ending this session, please run `/record-agent-flow` to record what we accomplished.
@@ -1,12 +1,12 @@
1
- # Agent Progress Index
1
+ # Agent Traces Index
2
2
 
3
- > Records of all AI Agent work sessions across all developers
3
+ > Records of all AI Agent work traces across all developers
4
4
 
5
5
  ---
6
6
 
7
7
  ## Overview
8
8
 
9
- This directory tracks progress for all developers working with AI Agents on this project.
9
+ This directory tracks traces for all developers working with AI Agents on this project.
10
10
 
11
11
  ### File Structure
12
12
 
@@ -18,7 +18,7 @@ agent-traces/
18
18
  |-- features/ # Feature files
19
19
  | |-- *.json # Active features
20
20
  | \-- archive/ # Archived features by month
21
- \-- progress-N.md # Progress files (sequential: 1, 2, 3...)
21
+ \-- traces-N.md # Progress files (sequential: 1, 2, 3...)
22
22
  ```
23
23
 
24
24
  ---
@@ -45,7 +45,7 @@ This will:
45
45
  1. Create your identity file (gitignored)
46
46
  2. Create your progress directory
47
47
  3. Create your personal index
48
- 4. Create initial progress file
48
+ 4. Create initial traces file
49
49
 
50
50
  ### For Returning Developers
51
51
 
@@ -63,10 +63,10 @@ This will:
63
63
 
64
64
  ## Guidelines
65
65
 
66
- ### Progress File Rules
66
+ ### Traces File Rules
67
67
 
68
- - **Max 2000 lines** per progress file
69
- - When limit is reached, create `progress-{N+1}.md`
68
+ - **Max 2000 lines** per traces file
69
+ - When limit is reached, create `traces-{N+1}.md`
70
70
  - Update your personal `index.md` when creating new files
71
71
 
72
72
  ### Session Record Format
@@ -121,4 +121,3 @@ Use this template when recording sessions:
121
121
  ---
122
122
 
123
123
  **Language**: All documentation must be written in **English**.
124
-