@mindfoldhq/trellis 0.1.4 → 0.1.6
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/README.md +757 -135
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -7
- package/dist/commands/init.js.map +1 -1
- package/dist/templates/claude/agents/check.md +32 -8
- package/dist/templates/claude/agents/debug.md +5 -8
- package/dist/templates/claude/agents/dispatch.md +7 -2
- package/dist/templates/claude/agents/implement.md +1 -6
- package/dist/templates/claude/agents/research.md +1 -1
- package/dist/templates/claude/commands/finish-work.md +1 -1
- package/dist/templates/claude/commands/onboard-developer.md +3 -3
- package/dist/templates/claude/commands/parallel.md +4 -4
- package/dist/templates/claude/commands/record-agent-flow.md +1 -1
- package/dist/templates/claude/commands/start.md +6 -6
- package/dist/templates/claude/hooks/inject-subagent-context.py +82 -4
- package/dist/templates/claude/hooks/ralph-loop.py +374 -0
- package/dist/templates/claude/settings.json +12 -0
- package/dist/templates/cursor/commands/finish-work.md +1 -1
- package/dist/templates/cursor/commands/onboard-developer.md +3 -3
- package/dist/templates/cursor/commands/record-agent-flow.md +1 -1
- package/dist/templates/cursor/commands/start.md +4 -5
- package/dist/templates/markdown/index.d.ts +0 -1
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +0 -1
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/structure/guides/cross-layer-thinking-guide.md.txt +5 -5
- package/dist/templates/markdown/structure/guides/index.md.txt +7 -7
- package/dist/templates/trellis/backlog/.gitkeep +0 -0
- package/dist/templates/trellis/gitignore.txt +2 -0
- package/dist/templates/trellis/scripts/common/backlog.sh +220 -0
- package/dist/templates/trellis/scripts/common/feature-utils.sh +194 -0
- package/dist/templates/trellis/scripts/common/git-context.sh +51 -0
- package/dist/templates/trellis/scripts/common/paths.sh +17 -0
- package/dist/templates/trellis/scripts/common/registry.sh +247 -0
- package/dist/templates/trellis/scripts/common/worktree.sh +0 -10
- package/dist/templates/trellis/scripts/feature.sh +113 -42
- package/dist/templates/trellis/scripts/multi-agent/cleanup.sh +56 -76
- package/dist/templates/trellis/scripts/multi-agent/plan.sh +2 -1
- package/dist/templates/trellis/scripts/multi-agent/start.sh +4 -35
- package/dist/templates/trellis/scripts/multi-agent/status.sh +35 -9
- package/dist/templates/trellis/workflow.md +85 -10
- package/dist/templates/trellis/worktree.yaml +6 -8
- package/package.json +1 -1
- package/dist/templates/markdown/init-agent.md +0 -315
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
# AI Agent Initialization Guide
|
|
2
|
-
|
|
3
|
-
> **Purpose**: Quick onboarding document for new AI Agent sessions. Read this first to understand the project and workflow.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Quick Start (Do This First)
|
|
8
|
-
|
|
9
|
-
### Step 0: Initialize Developer Identity (First Time Only)
|
|
10
|
-
|
|
11
|
-
> **Multi-developer support**: Each developer/Agent needs to initialize their identity first
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
# Check if already initialized
|
|
15
|
-
./.trellis/scripts/get-developer.sh
|
|
16
|
-
|
|
17
|
-
# If not initialized, run:
|
|
18
|
-
./.trellis/scripts/init-developer.sh <your-name>
|
|
19
|
-
# Example: ./.trellis/scripts/init-developer.sh cursor-agent
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
This creates:
|
|
23
|
-
- `.trellis/.developer` - Your identity file (gitignored, not committed)
|
|
24
|
-
- `.trellis/agent-traces/<your-name>/` - Your personal traces directory
|
|
25
|
-
|
|
26
|
-
**Naming suggestions**:
|
|
27
|
-
- Human developers: Use your name, e.g., `john-doe`
|
|
28
|
-
- Cursor AI: `cursor-agent` or `cursor-<feature>`
|
|
29
|
-
- Claude Code: `claude-agent` or `claude-<feature>`
|
|
30
|
-
|
|
31
|
-
### Step 1: Understand Current Context (5 min)
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
# Get full context in one command
|
|
35
|
-
./.trellis/scripts/get-context.sh
|
|
36
|
-
|
|
37
|
-
# Or check manually:
|
|
38
|
-
./.trellis/scripts/get-developer.sh # Your identity
|
|
39
|
-
./.trellis/scripts/feature.sh list # Active features
|
|
40
|
-
git status && git log --oneline -10 # Git state
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Step 2: Read Project Guidelines (10 min) [MANDATORY]
|
|
44
|
-
|
|
45
|
-
**CRITICAL**: Read BOTH frontend and backend guideline indexes to understand the project:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
# Read frontend guidelines index (REQUIRED - even for backend tasks)
|
|
49
|
-
cat .trellis/structure/frontend/index.md
|
|
50
|
-
|
|
51
|
-
# Read backend guidelines index (REQUIRED - even for frontend tasks)
|
|
52
|
-
cat .trellis/structure/backend/index.md
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**Why read both?**
|
|
56
|
-
- Understand the full project architecture
|
|
57
|
-
- Know coding standards for the entire codebase
|
|
58
|
-
- See how frontend and backend interact
|
|
59
|
-
- Learn the overall code quality requirements
|
|
60
|
-
|
|
61
|
-
### Step 3: Read Workflow Guide (5 min)
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
cat .trellis/workflow.md
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
**CRITICAL**: This document defines the entire development workflow. You MUST follow it.
|
|
68
|
-
|
|
69
|
-
### Step 4: Before Coding - Read Specific Guidelines (Required)
|
|
70
|
-
|
|
71
|
-
Based on your task, read the **detailed** guidelines:
|
|
72
|
-
|
|
73
|
-
**Frontend Task**:
|
|
74
|
-
```bash
|
|
75
|
-
cat .trellis/structure/frontend/hook-guidelines.md # For hooks
|
|
76
|
-
cat .trellis/structure/frontend/component-guidelines.md # For components
|
|
77
|
-
cat .trellis/structure/frontend/type-safety.md # For types
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
**Backend Task**:
|
|
81
|
-
```bash
|
|
82
|
-
cat .trellis/structure/backend/database-guidelines.md # For DB operations
|
|
83
|
-
cat .trellis/structure/backend/type-safety.md # For Zod/types
|
|
84
|
-
cat .trellis/structure/backend/logging-guidelines.md # For logging
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Project Overview
|
|
90
|
-
|
|
91
|
-
### What is This Project?
|
|
92
|
-
|
|
93
|
-
[Fill in your project description here after running `trellis init`]
|
|
94
|
-
|
|
95
|
-
### Tech Stack
|
|
96
|
-
|
|
97
|
-
[Fill in your tech stack here]
|
|
98
|
-
|
|
99
|
-
### Key Information
|
|
100
|
-
|
|
101
|
-
- **Main Branch**: Check with `git branch`
|
|
102
|
-
- **Current Branch**: Check `git status`
|
|
103
|
-
- **Package Manager**: Check for package-lock.json (npm), yarn.lock (yarn), or pnpm-lock.yaml (pnpm)
|
|
104
|
-
- **Linter**: Check package.json scripts
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## Directory Structure
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
your-project/
|
|
112
|
-
├── .trellis/ # [!] Agent-Human collaboration system
|
|
113
|
-
│ ├── workflow.md # Workflow guide (MUST READ)
|
|
114
|
-
│ ├── scripts/ # Workflow scripts
|
|
115
|
-
│ │ ├── common/ # Shared utilities
|
|
116
|
-
│ │ ├── feature.sh # Feature management
|
|
117
|
-
│ │ ├── get-context.sh # Get session context
|
|
118
|
-
│ │ └── add-session.sh # Record session
|
|
119
|
-
│ ├── agent-traces/ # Work traces records
|
|
120
|
-
│ │ └── {developer}/ # Per-developer directories
|
|
121
|
-
│ │ ├── features/ # Feature directories
|
|
122
|
-
│ │ │ └── {day}-{name}/
|
|
123
|
-
│ │ │ └── feature.json
|
|
124
|
-
│ │ └── traces-N.md
|
|
125
|
-
│ ├── structure/ # [!] Development guidelines (MUST READ)
|
|
126
|
-
│ │ ├── frontend/
|
|
127
|
-
│ │ │ ├── index.md # Frontend guidelines index
|
|
128
|
-
│ │ │ └── *.md # Topic-specific docs
|
|
129
|
-
│ │ ├── backend/
|
|
130
|
-
│ │ │ ├── index.md # Backend guidelines index
|
|
131
|
-
│ │ │ └── *.md # Topic-specific docs
|
|
132
|
-
│ │ └── guides/ # Thinking guides
|
|
133
|
-
├── init-agent.md # This initialization guide
|
|
134
|
-
└── AGENTS.md # Compatible with agents.md protocol
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## Development Workflow System
|
|
140
|
-
|
|
141
|
-
### Overview
|
|
142
|
-
|
|
143
|
-
This project uses a structured workflow system based on [Anthropic's best practices](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents).
|
|
144
|
-
|
|
145
|
-
### Core Files
|
|
146
|
-
|
|
147
|
-
| File | Purpose | When to Update |
|
|
148
|
-
|------|---------|----------------|
|
|
149
|
-
| `.trellis/workflow.md` | Complete workflow guide | Read at session start |
|
|
150
|
-
| `.trellis/agent-traces/{developer}/features/` | Feature tracking | When creating/completing features |
|
|
151
|
-
| `.trellis/agent-traces/{developer}/traces-N.md` | Session work records | After each session |
|
|
152
|
-
|
|
153
|
-
### Key Rules (CRITICAL - Must Follow)
|
|
154
|
-
|
|
155
|
-
**1. Read Guidelines Before Coding**
|
|
156
|
-
- Frontend: `.trellis/structure/frontend/index.md` -> specific docs
|
|
157
|
-
- Backend: `.trellis/structure/backend/index.md` -> specific docs
|
|
158
|
-
- This is **mandatory**, not optional
|
|
159
|
-
|
|
160
|
-
**2. Document Limits** **CRITICAL RULE**
|
|
161
|
-
- `agent-traces/{developer}/traces-N.md` max 2000 lines
|
|
162
|
-
- **IMPORTANT: Only create new file when current file EXCEEDS 2000 lines**
|
|
163
|
-
- File naming: Use sequential numbers (`traces-1.md`, `traces-2.md`...)
|
|
164
|
-
|
|
165
|
-
**3. Update Tracking Files**
|
|
166
|
-
- After completing work: Update `agent-traces` (include commit hashes)
|
|
167
|
-
- When feature changes: Use `feature.sh` commands
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## How to Use the Workflow System
|
|
172
|
-
|
|
173
|
-
### At Session Start
|
|
174
|
-
|
|
175
|
-
1. **Get context** - Run `./.trellis/scripts/get-context.sh`
|
|
176
|
-
2. **Read ALL guideline indexes** (see Quick Start Step 2 above)
|
|
177
|
-
- **MANDATORY**: Read both frontend AND backend indexes
|
|
178
|
-
3. **Read workflow guide** - `cat .trellis/workflow.md`
|
|
179
|
-
4. **Identify your task** from feature list
|
|
180
|
-
5. **Read specific guidelines** for your task
|
|
181
|
-
6. **Create or select feature** to work on
|
|
182
|
-
|
|
183
|
-
### During Development
|
|
184
|
-
|
|
185
|
-
1. **Create feature** (if new)
|
|
186
|
-
```bash
|
|
187
|
-
./.trellis/scripts/feature.sh create <feature-name>
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
2. **Follow guidelines strictly**
|
|
191
|
-
- Frontend: Type safety, Hook standards, Component standards
|
|
192
|
-
- Backend: Directory structure, Type safety, Database operations
|
|
193
|
-
|
|
194
|
-
3. **Test before commit**
|
|
195
|
-
```bash
|
|
196
|
-
npm run lint # or pnpm lint / yarn lint - Must pass
|
|
197
|
-
npm run type-check # or pnpm type-check - Must pass
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
4. **Commit with convention**
|
|
201
|
-
```bash
|
|
202
|
-
git commit -m "type(scope): description"
|
|
203
|
-
# Types: feat, fix, docs, refactor, test, chore
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### At Session End (REQUIRED)
|
|
207
|
-
|
|
208
|
-
**Record your session**:
|
|
209
|
-
```bash
|
|
210
|
-
./.trellis/scripts/add-session.sh \
|
|
211
|
-
--title "Session Title" \
|
|
212
|
-
--commit "abc1234" \
|
|
213
|
-
--summary "Brief summary"
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
This automatically:
|
|
217
|
-
- Appends session to current traces file
|
|
218
|
-
- Creates new file if 2000-line limit exceeded
|
|
219
|
-
- Updates index.md
|
|
220
|
-
|
|
221
|
-
**Archive completed feature**:
|
|
222
|
-
```bash
|
|
223
|
-
./.trellis/scripts/feature.sh archive <feature-name>
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## Common Commands
|
|
229
|
-
|
|
230
|
-
### Workflow Scripts
|
|
231
|
-
```bash
|
|
232
|
-
./.trellis/scripts/get-context.sh # Get full context
|
|
233
|
-
./.trellis/scripts/get-developer.sh # Get current developer
|
|
234
|
-
./.trellis/scripts/init-developer.sh <name> # Initialize developer
|
|
235
|
-
./.trellis/scripts/feature.sh list # List features
|
|
236
|
-
./.trellis/scripts/feature.sh create <name> # Create feature
|
|
237
|
-
./.trellis/scripts/feature.sh archive <name># Archive feature
|
|
238
|
-
./.trellis/scripts/add-session.sh # Record session
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
### Development
|
|
242
|
-
```bash
|
|
243
|
-
npm run dev # Start dev server
|
|
244
|
-
npm run build # Production build
|
|
245
|
-
npm run lint # Run linter
|
|
246
|
-
npm run format # Format code
|
|
247
|
-
npm run type-check # Type checking
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### Git
|
|
251
|
-
```bash
|
|
252
|
-
git status
|
|
253
|
-
git log --oneline -20
|
|
254
|
-
git diff main...HEAD
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
---
|
|
258
|
-
|
|
259
|
-
## Critical Reminders
|
|
260
|
-
|
|
261
|
-
### DO (Follow These)
|
|
262
|
-
|
|
263
|
-
1. **Read BOTH guideline indexes** at session start (frontend AND backend)
|
|
264
|
-
2. **Read .trellis/workflow.md** at session start
|
|
265
|
-
3. **Read specific docs** before coding (based on task)
|
|
266
|
-
4. **Update tracking files** after work
|
|
267
|
-
5. **Test thoroughly** before committing
|
|
268
|
-
6. **Follow guidelines strictly**
|
|
269
|
-
|
|
270
|
-
### DON'T (Avoid These)
|
|
271
|
-
|
|
272
|
-
1. **Don't skip reading guideline indexes** at initialization (CRITICAL VIOLATION)
|
|
273
|
-
2. **Don't skip reading specific guidelines** before coding
|
|
274
|
-
3. **Don't exceed 2000 lines** in agent-traces files
|
|
275
|
-
4. **Don't commit with lint errors**
|
|
276
|
-
5. **Don't use non-null assertions** (`!`)
|
|
277
|
-
6. **Don't skip updating tracking files**
|
|
278
|
-
7. **Don't execute `git commit`** - AI should not commit code (only suggest)
|
|
279
|
-
|
|
280
|
-
---
|
|
281
|
-
|
|
282
|
-
## Your First Task Checklist
|
|
283
|
-
|
|
284
|
-
### Before You Start Coding
|
|
285
|
-
|
|
286
|
-
- [ ] Run `./.trellis/scripts/get-context.sh` - Understand context
|
|
287
|
-
- [ ] Read `.trellis/workflow.md` - Understand the workflow
|
|
288
|
-
- [ ] Read `.trellis/structure/[frontend|backend]/index.md` - Find relevant guidelines
|
|
289
|
-
- [ ] Read specific guideline docs based on your task
|
|
290
|
-
- [ ] Create or select a feature with `feature.sh`
|
|
291
|
-
- [ ] Start coding following the guidelines
|
|
292
|
-
|
|
293
|
-
### After Completing Your Work
|
|
294
|
-
|
|
295
|
-
- [ ] Run lint and type-check - Must pass
|
|
296
|
-
- [ ] Commit with proper message format
|
|
297
|
-
- [ ] Run `add-session.sh` to record session
|
|
298
|
-
- [ ] Archive feature if completed with `feature.sh archive`
|
|
299
|
-
|
|
300
|
-
---
|
|
301
|
-
|
|
302
|
-
## Success Criteria
|
|
303
|
-
|
|
304
|
-
You're doing well if:
|
|
305
|
-
|
|
306
|
-
- [x] All lint and type checks pass
|
|
307
|
-
- [x] Code follows the guidelines
|
|
308
|
-
- [x] Session is recorded via `add-session.sh`
|
|
309
|
-
- [x] Features are tracked via `feature.sh`
|
|
310
|
-
- [x] Commits are well-formatted
|
|
311
|
-
- [x] Documentation is up-to-date
|
|
312
|
-
|
|
313
|
-
---
|
|
314
|
-
|
|
315
|
-
**Ready to start? Follow the Quick Start section at the top!**
|