@mindfoldhq/trellis 0.1.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.
- package/LICENSE +110 -0
- package/README.md +149 -0
- package/bin/trellis.js +3 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +42 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/init.d.ts +11 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +236 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/configurators/claude.d.ts +35 -0
- package/dist/configurators/claude.d.ts.map +1 -0
- package/dist/configurators/claude.js +83 -0
- package/dist/configurators/claude.js.map +1 -0
- package/dist/configurators/cursor.d.ts +8 -0
- package/dist/configurators/cursor.d.ts.map +1 -0
- package/dist/configurators/cursor.js +22 -0
- package/dist/configurators/cursor.js.map +1 -0
- package/dist/configurators/templates.d.ts +40 -0
- package/dist/configurators/templates.d.ts.map +1 -0
- package/dist/configurators/templates.js +67 -0
- package/dist/configurators/templates.js.map +1 -0
- package/dist/configurators/workflow.d.ts +16 -0
- package/dist/configurators/workflow.d.ts.map +1 -0
- package/dist/configurators/workflow.js +169 -0
- package/dist/configurators/workflow.js.map +1 -0
- package/dist/constants/paths.d.ts +69 -0
- package/dist/constants/paths.d.ts.map +1 -0
- package/dist/constants/paths.js +80 -0
- package/dist/constants/paths.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/agents/check.txt +120 -0
- package/dist/templates/agents/debug.txt +121 -0
- package/dist/templates/agents/dispatch.txt +201 -0
- package/dist/templates/agents/implement.txt +114 -0
- package/dist/templates/agents/index.d.ts +35 -0
- package/dist/templates/agents/index.d.ts.map +1 -0
- package/dist/templates/agents/index.js +71 -0
- package/dist/templates/agents/index.js.map +1 -0
- package/dist/templates/agents/research.txt +258 -0
- package/dist/templates/commands/claude/start.md.txt +127 -0
- package/dist/templates/commands/common/before-backend-dev.txt +13 -0
- package/dist/templates/commands/common/before-frontend-dev.txt +13 -0
- package/dist/templates/commands/common/break-loop.txt +107 -0
- package/dist/templates/commands/common/check-backend.txt +13 -0
- package/dist/templates/commands/common/check-cross-layer.txt +153 -0
- package/dist/templates/commands/common/check-frontend.txt +13 -0
- package/dist/templates/commands/common/create-command.txt +154 -0
- package/dist/templates/commands/common/finish-work.txt +129 -0
- package/dist/templates/commands/common/integrate-skill.txt +219 -0
- package/dist/templates/commands/common/onboard-developer.txt +355 -0
- package/dist/templates/commands/common/record-agent-flow.txt +62 -0
- package/dist/templates/commands/cursor/start.md.txt +94 -0
- package/dist/templates/commands/index.d.ts +46 -0
- package/dist/templates/commands/index.d.ts.map +1 -0
- package/dist/templates/commands/index.js +151 -0
- package/dist/templates/commands/index.js.map +1 -0
- package/dist/templates/extract.d.ts +22 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +34 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/hooks/index.d.ts +33 -0
- package/dist/templates/hooks/index.d.ts.map +1 -0
- package/dist/templates/hooks/index.js +53 -0
- package/dist/templates/hooks/index.js.map +1 -0
- package/dist/templates/hooks/inject-subagent-context.py +620 -0
- package/dist/templates/hooks/settings.json +16 -0
- package/dist/templates/markdown/agent-traces-index.md.txt +124 -0
- package/dist/templates/markdown/agents.md.txt +18 -0
- package/dist/templates/markdown/gitignore.txt +3 -0
- package/dist/templates/markdown/index.d.ts +26 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +33 -0
- package/dist/templates/markdown/index.js.map +1 -0
- package/dist/templates/markdown/init-agent.md.txt +315 -0
- package/dist/templates/markdown/structure/backend/database-guidelines.md.txt +51 -0
- package/dist/templates/markdown/structure/backend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/structure/backend/error-handling.md.txt +51 -0
- package/dist/templates/markdown/structure/backend/index.md.txt +38 -0
- package/dist/templates/markdown/structure/backend/logging-guidelines.md.txt +51 -0
- package/dist/templates/markdown/structure/backend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/structure/frontend/component-guidelines.md.txt +59 -0
- package/dist/templates/markdown/structure/frontend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/structure/frontend/hook-guidelines.md.txt +51 -0
- package/dist/templates/markdown/structure/frontend/index.md.txt +39 -0
- package/dist/templates/markdown/structure/frontend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/structure/frontend/state-management.md.txt +51 -0
- package/dist/templates/markdown/structure/frontend/type-safety.md.txt +51 -0
- package/dist/templates/markdown/structure/guides/code-reuse-thinking-guide.md.txt +92 -0
- package/dist/templates/markdown/structure/guides/cross-layer-thinking-guide.md.txt +94 -0
- package/dist/templates/markdown/structure/guides/index.md.txt +79 -0
- package/dist/templates/markdown/workflow.md.txt +335 -0
- package/dist/templates/scripts/add-session.sh.txt +384 -0
- package/dist/templates/scripts/common/developer.sh.txt +130 -0
- package/dist/templates/scripts/common/git-context.sh.txt +237 -0
- package/dist/templates/scripts/common/paths.sh.txt +201 -0
- package/dist/templates/scripts/create-bootstrap.sh.txt +298 -0
- package/dist/templates/scripts/feature.sh.txt +700 -0
- package/dist/templates/scripts/get-context.sh.txt +7 -0
- package/dist/templates/scripts/get-developer.sh.txt +15 -0
- package/dist/templates/scripts/index.d.ts +25 -0
- package/dist/templates/scripts/index.d.ts.map +1 -0
- package/dist/templates/scripts/index.js +28 -0
- package/dist/templates/scripts/index.js.map +1 -0
- package/dist/templates/scripts/init-developer.sh.txt +34 -0
- package/dist/types/ai-tools.d.ts +35 -0
- package/dist/types/ai-tools.d.ts.map +1 -0
- package/dist/types/ai-tools.js +31 -0
- package/dist/types/ai-tools.js.map +1 -0
- package/dist/utils/file-writer.d.ts +23 -0
- package/dist/utils/file-writer.d.ts.map +1 -0
- package/dist/utils/file-writer.js +140 -0
- package/dist/utils/file-writer.js.map +1 -0
- package/dist/utils/project-detector.d.ts +16 -0
- package/dist/utils/project-detector.d.ts.map +1 -0
- package/dist/utils/project-detector.js +186 -0
- package/dist/utils/project-detector.js.map +1 -0
- package/package.json +71 -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
|
+
| \-- progress-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}/progress-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 progress-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,94 @@
|
|
|
1
|
+
# Initialize AI Agent Session
|
|
2
|
+
|
|
3
|
+
Read project context and prepare for development work.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Execution Steps
|
|
8
|
+
|
|
9
|
+
### Step 1: Get Session Context
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
./.trellis/scripts/get-context.sh
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This returns:
|
|
16
|
+
- Developer identity
|
|
17
|
+
- Git status (branch, uncommitted changes)
|
|
18
|
+
- Recent commits
|
|
19
|
+
- Active features
|
|
20
|
+
- Progress file status
|
|
21
|
+
|
|
22
|
+
### Step 2: Read Relevant Guidelines
|
|
23
|
+
|
|
24
|
+
Based on the upcoming task, read appropriate structure docs:
|
|
25
|
+
|
|
26
|
+
**For Frontend Work**:
|
|
27
|
+
```bash
|
|
28
|
+
cat .trellis/structure/frontend/index.md
|
|
29
|
+
```
|
|
30
|
+
Then read specific docs based on task type.
|
|
31
|
+
|
|
32
|
+
**For Backend Work**:
|
|
33
|
+
```bash
|
|
34
|
+
cat .trellis/structure/backend/index.md
|
|
35
|
+
```
|
|
36
|
+
Then read specific docs based on task type.
|
|
37
|
+
|
|
38
|
+
**For Cross-Layer Features**:
|
|
39
|
+
```bash
|
|
40
|
+
cat .trellis/structure/guides/index.md
|
|
41
|
+
cat .trellis/structure/guides/cross-layer-thinking-guide.md
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Step 3: Check Active Features
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
./.trellis/scripts/feature.sh list
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If continuing previous work, review the feature file.
|
|
51
|
+
|
|
52
|
+
### Step 4: Report Ready Status
|
|
53
|
+
|
|
54
|
+
Output a summary:
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
## Session Initialized
|
|
58
|
+
|
|
59
|
+
| Item | Status |
|
|
60
|
+
|------|--------|
|
|
61
|
+
| Developer | {name} |
|
|
62
|
+
| Branch | {branch} |
|
|
63
|
+
| Uncommitted | {count} file(s) |
|
|
64
|
+
| Progress | {file} ({lines}/2000 lines) |
|
|
65
|
+
| Active Features | {count} |
|
|
66
|
+
|
|
67
|
+
### Available Commands
|
|
68
|
+
- `/before-frontend-dev` - Read frontend guidelines
|
|
69
|
+
- `/before-backend-dev` - Read backend guidelines
|
|
70
|
+
- `/check-cross-layer` - Cross-layer verification
|
|
71
|
+
- `/finish-work` - Pre-commit checklist
|
|
72
|
+
- `/record-agent-flow` - Record session progress
|
|
73
|
+
|
|
74
|
+
Ready for your task. What would you like to work on?
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Quick Reference
|
|
80
|
+
|
|
81
|
+
| Scenario | Next Step |
|
|
82
|
+
|----------|-----------|
|
|
83
|
+
| New feature | Run `./.trellis/scripts/feature.sh create <name>` |
|
|
84
|
+
| Continue feature | Read feature file, continue work |
|
|
85
|
+
| Bug fix | Investigate, fix, then remind user to run `/break-loop` |
|
|
86
|
+
| First time | Remind user to run `/onboard-developer` for full setup |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Notes
|
|
91
|
+
|
|
92
|
+
- Always read structure guidelines before coding
|
|
93
|
+
- One feature at a time
|
|
94
|
+
- At session end, remind user to run `/record-agent-flow` to record progress
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command templates for Trellis workflow
|
|
3
|
+
*
|
|
4
|
+
* All templates are in common/ and work with all supported AI tools.
|
|
5
|
+
* The claude/ directory is reserved for future Claude-specific commands.
|
|
6
|
+
*/
|
|
7
|
+
import type { AITool, TemplateDir } from "../../types/ai-tools.js";
|
|
8
|
+
export declare const claudeStartTemplate: string;
|
|
9
|
+
export declare const cursorStartTemplate: string;
|
|
10
|
+
export declare const recordAgentFlowTemplate: string;
|
|
11
|
+
export declare const onboardDeveloperTemplate: string;
|
|
12
|
+
export declare const checkFrontendTemplate: string;
|
|
13
|
+
export declare const checkBackendTemplate: string;
|
|
14
|
+
export declare const checkCrossLayerTemplate: string;
|
|
15
|
+
export declare const beforeFrontendDevTemplate: string;
|
|
16
|
+
export declare const beforeBackendDevTemplate: string;
|
|
17
|
+
export declare const finishWorkTemplate: string;
|
|
18
|
+
export declare const breakLoopTemplate: string;
|
|
19
|
+
export declare const createCommandTemplate: string;
|
|
20
|
+
export declare const integrateSkillTemplate: string;
|
|
21
|
+
/**
|
|
22
|
+
* Command template definition
|
|
23
|
+
*/
|
|
24
|
+
export interface CommandTemplate {
|
|
25
|
+
/** Command name (used for filename) */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Template content */
|
|
28
|
+
content: string;
|
|
29
|
+
/** Human-readable description */
|
|
30
|
+
description: string;
|
|
31
|
+
/** Which directory this template belongs to */
|
|
32
|
+
category: TemplateDir;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get command templates available for a specific AI tool
|
|
36
|
+
*/
|
|
37
|
+
export declare function getTemplatesForTool(tool: AITool): CommandTemplate[];
|
|
38
|
+
/**
|
|
39
|
+
* Get all command templates
|
|
40
|
+
*/
|
|
41
|
+
export declare function getAllTemplates(): CommandTemplate[];
|
|
42
|
+
/**
|
|
43
|
+
* Get a specific template by name
|
|
44
|
+
*/
|
|
45
|
+
export declare function getTemplateByName(name: string): CommandTemplate | undefined;
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAmBnE,eAAO,MAAM,mBAAmB,EAAE,MAGjC,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,MAGjC,CAAC;AAOF,eAAO,MAAM,uBAAuB,EAAE,MAGrC,CAAC;AACF,eAAO,MAAM,wBAAwB,EAAE,MAGtC,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,MAGnC,CAAC;AACF,eAAO,MAAM,oBAAoB,EAAE,MAGlC,CAAC;AACF,eAAO,MAAM,uBAAuB,EAAE,MAGrC,CAAC;AAGF,eAAO,MAAM,yBAAyB,EAAE,MAGvC,CAAC;AACF,eAAO,MAAM,wBAAwB,EAAE,MAGtC,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,MAGhC,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,MAG/B,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,MAGnC,CAAC;AACF,eAAO,MAAM,sBAAsB,EAAE,MAGpC,CAAC;AAMF;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,QAAQ,EAAE,WAAW,CAAC;CACvB;AA0FD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,EAAE,CAGnE;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,eAAe,EAAE,CAEnD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAE3E"}
|