Writing Specs
7.1 Spec Directory Structure and Layering
index.mdis the entry point, listing all spec files and their status- Each file focuses on a single topic, 200-500 lines
- Each section 20-50 lines
- Write in English (technical terms are naturally English); Chinese projects may use Chinese
7.2 From Empty Templates to Complete Specs
trellis init generates empty templates marked “(To be filled by the team)”. Here’s how to fill them:
Step 1: Extract patterns from actual code
Bad Example
7.3 Good Specs vs Bad Specs
Good specs (specific, with code, with reasoning):7.4 Bootstrap Guided Initial Fill
trellis init automatically creates a bootstrap guide task (00-bootstrap-guidelines). The AI detects it during the first /start and guides you through filling in the blank spec files.
During this guided task, the AI analyzes your codebase, extracts existing patterns, and auto-fills spec templates.
7.5 Continuous Spec Evolution
Specs are not written once and forgotten; they evolve continuously with development:| Trigger | Update Frequency | Example |
|---|---|---|
| Fixed a non-obvious bug | Immediately | Add to “Common Mistakes” |
| Discovered a better practice | Same day | Add to “Patterns” |
| Team agrees on new convention | Same day | Add to “Conventions” |
| Routine improvements | Weekly | Refine wording, add examples |