Complete Command Reference
Trellis 0.4.0 provides 11 slash commands (Claude Code), organized into 6 categories. The Cursor version has 10 (excluding /parallel).
| Function | Claude Code / OpenCode | Cursor | Codex |
|---|
| Start session | /start (optional, Hook auto-injects) | /start (required) | $start |
| Development prep | /before-dev (optional) | /trellis-before-dev (recommended) | $before-dev |
| Code check | /check (Ralph Loop auto-triggers) | /trellis-check (manual) | $check |
| Cross-layer check | /check-cross-layer | /trellis-check-cross-layer | $check-cross-layer |
| Finish checklist | /finish-work | /trellis-finish-work | $finish-work |
| Parallel orchestration | /parallel | โ Not supported | โ Not supported |
| Record session | /record-session | /trellis-record-session | $record-session |
| Brainstorm | /brainstorm | /trellis-brainstorm | $brainstorm |
| Bug analysis | /break-loop | /trellis-break-loop | $break-loop |
| New member onboarding | /onboard | /trellis-onboard | $onboard |
| Create command | /create-command | /trellis-create-command | $create-command |
| Integrate Skill | /integrate-skill | /trellis-integrate-skill | $integrate-skill |
0.4.0 merged the type-specific /before-backend-dev + /before-frontend-dev into a unified /before-dev, and /check-backend + /check-frontend + /check-cross-layer are consolidated so the command matrix doesnโt explode alongside package count in monorepos. The type routing is handled by the spec layer (.trellis/spec/backend/ vs .trellis/spec/frontend/) based on which package youโre working in.
Session Management
/start โ Start a Development Session
When to use: Every time you open your AI coding assistant to start work. Claude Code users have context auto-injected via Hooks, so /start is optional (but recommended for first-time use to see the full flow). Cursor users must run /start.
Execution flow:
- Read
workflow.md to understand the workflow
- Run
get-context.py to get context (identity, Git status, active tasks)
- Read spec indexes to understand project specs
- Report context and ask: โWhat would you like to work on?โ
Task classification decisions:
| Type | Criteria | Workflow |
|---|
| Q&A | User asks about code or architecture | Answer directly |
| Quick fix | Typo fix, single-line change, < 5 minutes | Edit directly |
| Development task | Logic changes, new features, bug fixes, multi-file changes | Use Task Workflow |
When in doubt, use Task Workflow. Task Workflow ensures Agents receive spec injection, resulting in higher code quality.
/parallel โ Multi-Agent Parallel Orchestration
Claude Code only. Cursor, Codex, and other platforms do not support Multi-Agent Pipeline.
When to use:
- High task complexity, requiring > 30 minutes
- Can be split into multiple independent subtasks
- Needs isolation in independent worktrees
Two-phase flow:
Phase 1: Plan
./.trellis/scripts/multi-agent/plan.py \
--name "feature-name" \
--type "backend|frontend|fullstack" \
--requirement "User requirement description"
The Plan Agent will:
- Assess whether requirements are clear (may reject, see Chapter 6)
- Invoke Research Agent to analyze the codebase
- Create task directory and configure JSONL context
- Generate the prd.md requirements document
Phase 2: Execute
./.trellis/scripts/multi-agent/start.py "$TASK_DIR"
Automatically creates a Git worktree. The Dispatch Agent executes implement, check, finish, and create-pr in sequence.
Monitoring commands:
./.trellis/scripts/multi-agent/status.py # Overview
./.trellis/scripts/multi-agent/status.py --log <name> # View logs
./.trellis/scripts/multi-agent/status.py --watch <name> # Live monitoring
./.trellis/scripts/multi-agent/cleanup.py <branch> # Clean up worktree
/record-session โ Record a Session
When to use: After the user has tested and committed code.
Prerequisite: The AI does not execute git commit; it only reads git history.
Execution flow:
./.trellis/scripts/add-session.py \
--title "Session Title" \
--commit "hash1,hash2" \
--summary "What was accomplished in this session"
Automatically completes:
- Appends session record to
journal-N.md
- Detects line count and auto-creates a new file when exceeding 2,000 lines
- Updates
index.md (session count +1, last active time, history table)
/onboard โ New Member Onboarding
When to use: When a new team member joins.
Includes three parts:
- Core concept walkthrough (spec / workspace / task / hook)
- 5 hands-on exercises (bug fix, planning session, Code Review fix, large refactor, debugging session)
- Spec customization guidance
Development Preparation
/before-dev โ Development Prep
Reads the relevant spec index (backend or frontend, auto-detected from the current taskโs dev_type) and related guideline documents (directory structure, error handling, logging, type safety, quality guidelines, components, hooks, state management). Ensures the AI understands project coding standards before writing code.
In monorepo projects the spec read is scoped to the current package (.trellis/spec/<package>/<layer>/), so cross-package conventions donโt leak in.
Quality Checks
/check โ Code Check
Execution flow:
git status to view changes
- Re-read the relevant spec layer(s) for the changed files
- Compare code against specs line by line
- Auto-fix violations (Ralph Loop driven, up to 3 rounds)
Check items cover both backend and frontend conventions based on which layer the diff touches: directory structure, database operations, error handling, logging, type definitions, component naming, Props interfaces, Hook usage, state management, no console.log / any / non-null assertions, ESLint errors, unused imports.
/check-cross-layer โ Cross-Layer Consistency Check
Reads the cross-layer thinking guide and analyzes 6 dimensions:
- Data flow consistency โ Frontend, API, Database, API, Frontend
- Type definition sync โ Frontend and backend interfaces match
- Error handling continuity โ Errors properly propagated across layers
- Constant synchronization โ Shared constants between frontend and backend
- Code reuse โ No duplicate implementations
- Import path correctness โ No broken references
Parallel Development
/parallel
See section 5.1.
Knowledge Accumulation
/break-loop โ Deep Bug Analysis
When to use: After resolving a tricky bug, to perform deep analysis and prevent similar issues.
5-Dimension Analysis Framework:
-
Root Cause Classification:
- A โ Missing Spec
- B โ Cross-layer Contract Violation
- C โ Change Propagation Failure
- D โ Test Coverage Gap
- E โ Implicit Assumption
-
Why Fixes Failed โ Analyze why previous fix attempts failed
-
Prevention Mechanisms (6 types):
- Spec update
- Type constraints
- Lint rules
- Test cases
- Code review checklist items
- Documentation updates
-
Systematic Expansion โ Search for other potential issues with the same pattern
-
Knowledge Capture โ Solidify analysis results into specs
Core philosophy:
The value of debugging is not fixing this bug, but ensuring this class of bugs never happens again.
Utility Commands
/finish-work โ Pre-Commit Checklist
6-dimension check before committing:
- Code quality (lint, type-check, test)
- Documentation sync
- API changes
- Database changes
- Cross-layer verification
- Manual testing
/create-command โ Create Custom Commands
Generates dual-IDE command files under .claude/commands/trellis/ and .cursor/commands/. See Chapter 9 for details.
/integrate-skill โ Integrate External Skills
Integrates community Skills into your project, creating a unified /use-[skill-name] command. See Chapter 12 for details.
Task Management Workflow
Task Lifecycle
create โ init-context โ add-context โ start โ implement/check โ finish โ archive
โ โ โ โ โ โ โ
โ โ โ โ โ โ โ
โผ โผ โผ โผ โผ โผ โผ
Create Init JSONL Add context Set as Development/ Clear Archive to
directory config files entries current check cycle current archive/
task.json task ptr task
task.py 14 Subcommands Explained
Task Creation
# Create a task
TASK_DIR=$(./.trellis/scripts/task.py create "Add user login" \
--slug user-login \ # Directory name suffix (optional, auto-slugifies otherwise)
--assignee alice \ # Assignee (optional)
--priority P1 \ # Priority: P0/P1/P2/P3 (optional, default P2)
--description "Implement JWT login") # Description (optional)
# Created directory: .trellis/tasks/02-27-user-login/
# Created file: task.json
Context Configuration
# Initialize JSONL config
./.trellis/scripts/task.py init-context "$TASK_DIR" backend
# dev_type: backend | frontend | fullstack | test | docs
# Optional: --platform cursor (default claude)
# Add extra context entries
./.trellis/scripts/task.py add-context "$TASK_DIR" implement \
"src/services/auth.ts" "Existing auth patterns"
# Target: implement | check | debug (shorthand, auto-appends .jsonl)
# Automatically detects whether it's a file or directory
# Validate all JSONL-referenced files exist
./.trellis/scripts/task.py validate "$TASK_DIR"
# View all JSONL entries
./.trellis/scripts/task.py list-context "$TASK_DIR"
Task Control
# Set as current task (Hook reads this pointer for injection)
./.trellis/scripts/task.py start "$TASK_DIR"
# Clear current task (no arguments needed, auto-reads .current-task)
./.trellis/scripts/task.py finish
# Set Git branch name
./.trellis/scripts/task.py set-branch "$TASK_DIR" "feature/user-login"
# Set PR target branch
./.trellis/scripts/task.py set-base-branch "$TASK_DIR" "main"
# Set scope (used in commit messages: feat(scope): ...)
./.trellis/scripts/task.py set-scope "$TASK_DIR" "auth"
Task Management
# List active tasks
./.trellis/scripts/task.py list
./.trellis/scripts/task.py list --mine # Only show your own
./.trellis/scripts/task.py list --status review # Filter by status
# Archive completed tasks
./.trellis/scripts/task.py archive user-login
# Moves to archive/2026-02/
# List archived tasks
./.trellis/scripts/task.py list-archive
./.trellis/scripts/task.py list-archive 2026-02 # Filter by month
# Create PR (delegates to multi-agent/create-pr.py)
./.trellis/scripts/task.py create-pr
task.json Schema
{
"id": "02-27-user-login",
"name": "user-login",
"title": "Add user login",
"description": "Implement JWT login flow",
"status": "in_progress",
"dev_type": "backend",
"scope": "auth",
"priority": "P1",
"creator": "alice",
"assignee": "alice",
"createdAt": "2026-02-27T10:00:00Z",
"completedAt": null,
"branch": "feature/user-login",
"base_branch": "main",
"worktree_path": null,
"current_phase": 1,
"next_action": [
{ "phase": 1, "action": "implement" },
{ "phase": 2, "action": "check" },
{ "phase": 3, "action": "finish" },
{ "phase": 4, "action": "create-pr" }
],
"commit": null,
"pr_url": null,
"subtasks": [],
"relatedFiles": [],
"notes": ""
}
Status transitions:
planning โ in_progress โ review โ completed
โ rejected
JSONL Context Configuration in Practice
Auto-Generated Default Configuration
task.py init-context generates default JSONL files based on dev_type:
backend type default implement.jsonl:
{"file": ".trellis/workflow.md", "reason": "Project workflow and conventions"}
{"file": ".trellis/spec/shared/index.md", "reason": "Shared coding standards"}
{"file": ".trellis/spec/backend/index.md", "reason": "Backend development guide"}
{"file": ".trellis/spec/backend/api-module.md", "reason": "API module conventions"}
{"file": ".trellis/spec/backend/quality.md", "reason": "Code quality requirements"}
backend type default check.jsonl (Claude Code platform):
{"file": ".claude/commands/trellis/finish-work.md", "reason": "Finish work checklist"}
{"file": ".trellis/spec/shared/index.md", "reason": "Shared coding standards"}
{"file": ".claude/commands/trellis/check.md", "reason": "Backend check spec"}
fullstack type includes both frontend and backend spec files.
Adding Custom Context
# Add existing code as reference (file)
./.trellis/scripts/task.py add-context "$TASK_DIR" implement \
"src/services/user.ts" "Existing user service patterns"
# Add an entire directory (auto-reads all .md files)
./.trellis/scripts/task.py add-context "$TASK_DIR" implement \
"src/services/" "Existing service patterns"
# Add custom check context
./.trellis/scripts/task.py add-context "$TASK_DIR" check \
".trellis/spec/guides/cross-layer-thinking-guide.md" "Cross-layer verification"
Plan Agent and Requirements Assessment
The Plan Agent performs strict assessment before accepting requirements, and may reject them.
5 rejection categories:
| Rejection Type | Trigger Condition | Example |
|---|
| Unclear or Vague | No specific outcome defined | โMake it betterโ, โFix the bugsโ |
| Incomplete Information | Missing critical implementation details | References unknown systems |
| Out of Scope | Does not belong to this project | Requires modifying external systems |
| Potentially Harmful | Security risk | Intentionally creating backdoors |
| Too Large | Should be split | Requesting 6 features at once |
On rejection:
task.json status set to "rejected"
REJECTED.md generated with reasons and improvement suggestions
- Task directory preserved for user review
Rejection example:
Input: "Add user authentication, authorization, password reset,
2FA, OAuth integration, and audit logging"
=== PLAN REJECTED ===
Reason: Too Large / Should Be Split
Details:
This requirement bundles 6 distinct features:
1. User authentication (login/logout)
2. Authorization (roles/permissions)
3. Password reset flow
4. Two-factor authentication
5. OAuth integration
6. Audit logging
Suggestions:
- Start with basic authentication first
- Create separate features for each capability
Monorepo Support
0.4.0โs headline feature: trellis init auto-detects monorepo layouts and creates per-package spec directories, so every package enforces its own coding conventions.
my-monorepo/
โโโ packages/
โ โโโ api/
โ โโโ web/
โ โโโ shared/
โโโ .trellis/
โโโ spec/
โ โโโ api/ # API package conventions
โ โ โโโ backend/index.md
โ โ โโโ ...
โ โโโ web/ # Web package conventions
โ โ โโโ frontend/index.md
โ โ โโโ ...
โ โโโ shared/ # Shared package conventions
โ โโโ guides/ # Shared thinking guides
โโโ tasks/...
Creating a task scoped to one package
# Explicit
python3 ./.trellis/scripts/task.py create "Add login endpoint" \
--slug add-login \
--package api
# Directory: .trellis/tasks/MM-DD-add-login/ (task.json.package = "api")
Initializing context for the package
python3 ./.trellis/scripts/task.py init-context "$TASK_DIR" backend --package api
# Populates implement.jsonl with .trellis/spec/api/backend/* entries only
Inferred package
If you omit --package, Trellis reads .trellis/config.yamlโs default_package (set at init time). This is handy when most of your work lives in one package but you want the schema to stay monorepo-aware.
Per-package conventions
The --package <name> flag enforces isolation: a task scoped to api loads only .trellis/spec/api/..., never .trellis/spec/web/.... Cross-package tasks (--package shared, or no --package on an explicitly cross-cutting task) load the shared spec instead.
When you trellis init in a monorepo, Trellis writes .trellis/config.yaml listing every detected package and its type (backend / frontend / fullstack). Add packages manually if detection misses any โ the packages: key accepts any name โ { path, type } mapping.
Task Lifecycle Hooks
You can configure shell commands that run automatically when task lifecycle events occur. This enables integrations like syncing tasks to Linear, posting to Slack, or triggering CI pipelines.
Configuration
Add a hooks block to .trellis/config.yaml:
hooks:
after_create:
- 'python3 .trellis/scripts/hooks/linear_sync.py create'
after_start:
- 'python3 .trellis/scripts/hooks/linear_sync.py start'
after_finish:
- "echo 'Task finished'"
after_archive:
- 'python3 .trellis/scripts/hooks/linear_sync.py archive'
The default config.yaml ships with the hooks section commented out. Uncomment and edit to
activate.
Supported Events
| Event | Fires When | Use Case |
|---|
after_create | task.py create completes | Create linked issue in project tracker |
after_start | task.py start sets the current task | Update issue status to โIn Progressโ |
after_finish | task.py finish clears the current task | Notify team, trigger review |
after_archive | task.py archive moves the task | Mark issue as โDoneโ |
Environment Variables
Each hook receives:
| Variable | Value |
|---|
TASK_JSON_PATH | Absolute path to the taskโs task.json |
All other environment variables from the parent process are inherited.
Execution Behavior
- Working directory: Repository root
- Shell: Commands run through the system shell (
shell=True)
- Failures donโt block: A failing hook prints a
[WARN] message to stderr but does not prevent the task operation from completing
- Sequential: Multiple hooks per event execute in list order; a failure in one does not skip the rest
- stdout captured: Hook stdout is not displayed to the user โ use stderr for diagnostic output
The after_archive hook receives TASK_JSON_PATH pointing to the archived location (e.g.,
.trellis/tasks/archive/2026-03/task-name/task.json), not the original path.
Example: Linear Sync Hook
Trellis ships with an example hook at .trellis/scripts/hooks/linear_sync.py that syncs task lifecycle events to Linear.
What it does:
| Action | Trigger | Effect |
|---|
create | after_create | Creates a Linear issue from task.json (title, priority, assignee, parent) |
start | after_start | Updates the linked issue to โIn Progressโ |
archive | after_archive | Updates the linked issue to โDoneโ |
sync | Manual | Pushes prd.md content to the Linear issue description |
Prerequisites:
- Install the
linearis CLI and set LINEAR_API_KEY
- Create
.trellis/hooks.local.json (gitignored) with your team config:
{
"linear": {
"team": "ENG",
"project": "My Project",
"assignees": {
"alice": "linear-user-id-for-alice"
}
}
}
The hook writes the Linear issue identifier back to task.json under meta.linear_issue (e.g., "ENG-123"), making subsequent events idempotent.
Writing Specs
Spec Directory Structure and Layering
.trellis/spec/
โโโ frontend/ # Frontend specs
โ โโโ index.md # Index: lists all specs and their status
โ โโโ component-guidelines.md # Component specs
โ โโโ hook-guidelines.md # Hook specs
โ โโโ state-management.md # State management
โ โโโ type-safety.md # Type safety
โ โโโ quality-guidelines.md # Quality guidelines
โ โโโ directory-structure.md # Directory structure
โ
โโโ backend/ # Backend specs
โ โโโ index.md
โ โโโ database-guidelines.md
โ โโโ error-handling.md
โ โโโ logging-guidelines.md
โ โโโ quality-guidelines.md
โ โโโ directory-structure.md
โ
โโโ guides/ # Thinking guides
โโโ index.md
โโโ cross-layer-thinking-guide.md
โโโ code-reuse-thinking-guide.md
Layering principles:
index.md is 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
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
# See how existing code is organized
ls src/components/ # Component structure
ls src/services/ # Service structure
Step 2: Write down your conventions
# Component Guidelines
## File Structure
- One component per file
- Use PascalCase for filenames: `UserProfile.tsx`
- Co-locate styles: `UserProfile.module.css`
- Co-locate tests: `UserProfile.test.tsx`
## Patterns
### Required
- Functional components + hooks (no class components)
- TypeScript with explicit Props interface
- `export default` for page components, named export for shared
### Forbidden
- No `any` type in Props
- No inline styles (use CSS Modules)
- No direct DOM manipulation
Step 3: Add code examples
### Good Example
```tsx
interface UserProfileProps {
userId: string;
onUpdate: (user: User) => void;
}
export function UserProfile({ userId, onUpdate }: UserProfileProps) {
// ...
}
Bad Example
// Don't: no Props interface, using any
export default function UserProfile(props: any) {
// ...
}
**Step 4**: Update index.md status
```markdown
| Guideline | File | Status |
|-----------|------|--------|
| Component Guidelines | component-guidelines.md | **Filled** |
| Hook Guidelines | hook-guidelines.md | To fill |
Good Specs vs Bad Specs
Good specs (specific, with code, with reasoning):
### Database Query Pattern
**Always use parameterized queries** to prevent SQL injection.
```sql
-- Good
SELECT * FROM users WHERE id = $1
-- Bad
SELECT * FROM users WHERE id = '${userId}'
Why: Parameterized queries are automatically escaped by the database driver.
**Bad specs** (too vague, no code, no reasoning):
```markdown
### Database
- Use good query patterns
- Be careful with SQL
- Follow best practices
Over-specified specs (too granular, stifles creativity):
### Variable Naming
- All boolean variables must start with `is` or `has`
- All arrays must end with `List`
- All functions must be less than 20 lines
- All files must be less than 200 lines
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.
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 |
Evolution flywheel:
Develop โ Discover pattern/issue โ Manually update Spec file โ git push
โ
Entire team benefits โ Hook auto-injects โ Next session auto-loads โ git pull
Real-World Scenarios
Simple Feature Development (Single Session)
Task: Add user login feature
# 1. Open terminal (Hook auto-injects context, can skip /start)
# 2. Describe the task
"Add user login feature"
# 3. AI works automatically...
# Hook injects specs โ creates task โ invokes Implement Agent โ Check Agent โ Ralph Loop verification
# 4. Test
pnpm lint && pnpm typecheck && pnpm test
# 5. Commit
git add .
git commit -m "feat(auth): add user login feature"
# 6. Record session
/record-session
# 1. Start session (required)
/start
# 2. Describe the task
"Add user login feature"
# 3. AI works automatically...
# Reads specs โ implements feature
# 4. Manually check code quality
/trellis-check
# 5. Test
pnpm lint && pnpm typecheck && pnpm test
# 6. Commit
git add .
git commit -m "feat(auth): add user login feature"
# 7. Record session
/trellis-record-session
Complex Parallel Development (Multi-Agent Worktree)
This scenario is Claude Code only. Cursor, Codex, and other platforms do not support Multi-Agent Pipeline.
Task: Develop three independent features in parallel
# 1. Start parallel mode
/parallel
# 2. Describe requirements
"I need to develop three features in parallel:
1. User profile page
2. Email notification system
3. Data export feature"
# 3. AI automatically creates a worktree for each feature and starts Agents
# 4. Monitor progress
./.trellis/scripts/multi-agent/status.py
# Task 1: user-profile โ
Complete (PR #123)
# Task 2: email-notify ๐ In Progress (Check phase)
# Task 3: data-export ๐ In Progress (Implement phase)
# 5. Review and merge PRs
# 6. Clean up worktrees
./.trellis/scripts/multi-agent/cleanup.py user-profile
Cross-Layer Feature Development
Task: Add product review feature (database + API + frontend)
# 1. Open terminal (Hook auto-injects)
# 2. Describe the task
"Add product review feature, requiring database, API, and frontend"
# 3. AI automatically reads the cross-layer thinking guide
# mapping: UI โ API โ DB โ API โ UI
# 4. AI develops layer by layer
# Phase 1: Database (comments table)
# Phase 2: Backend API (POST /api/comments)
# Phase 3: Frontend (CommentForm component)
# 5. Cross-layer check (Hook auto-triggers, or run manually)
/check-cross-layer
# 1. Start (required)
/start
# 2. Load backend + frontend specs
/trellis-before-dev
/trellis-before-dev
# 3. Describe the task
"Add product review feature, requiring database, API, and frontend"
# 4. AI develops layer by layer...
# 5. Manual cross-layer check
/trellis-check-cross-layer
# โ
Database Layer: comments table created
# โ
API Layer: POST /api/comments endpoint
# โ
UI Layer: CommentForm component
# โ
Data Flow: UI โ API โ DB โ
# 6. Test, commit, record
Team Collaboration
The core mechanisms for team collaboration (Spec sharing, task assignment) are platform-agnostic. Team members on different platforms can share the same Spec library.
# Alice develops and documents specs (Claude Code example, Cursor uses /start)
trellis init -u alice
/start
# ... develop authentication system ...
# Manually write auth best practices into specs
git add .trellis/spec/
git commit -m "docs: add auth guidelines"
git push
# Bob pulls and automatically benefits
git pull
trellis init -u bob
/start
"Add permission management"
# AI auto-reads Alice's auth guidelines
# Bob's code automatically follows Alice's specs
Bug Debugging with break-loop
# 1. Start
/start
# 2. Fix the bug
"Users can't log in under certain conditions"
# 3. AI debugs and fixes...
# 4. Deep analysis
/break-loop
# AI output:
# Root Cause: B - Cross-layer Contract Violation
# Token format sent by frontend doesn't match backend expectations
#
# Prevention:
# - Update spec: define token format contract
# - Add type constraint: shared Token interface
# - Add test: token format validation
# 5. Manually update specs
# Write token format contract into .trellis/spec/ files
Spec Iteration Flywheel
# Discover a pattern
# AI discovers during development: all API errors should return a uniform format
# { error: string, code: number, details?: any }
# Manually update specs
# Write this pattern into .trellis/spec/backend/error-handling.md
# Next time anyone does API development
# Hook auto-injects error-handling.md
# AI automatically follows the uniform error format
# โ All API errors are consistently formatted
Building a New Project from Scratch
# 1. Create project
mkdir my-app && cd my-app
git init
# 2. Install Trellis
npm install -g @mindfoldhq/trellis@latest
trellis init -u your-name
# 3. trellis init has auto-created the bootstrap guide task (00-bootstrap-guidelines)
/start
# AI auto-detects the bootstrap task, analyzes your codebase, and helps fill in specs
# 4. Manually supplement core specs
# Edit .trellis/spec/backend/index.md, etc.
# Write down your tech stack choices, coding conventions, directory structure
# 5. Start developing
/start
"Set up the project foundation"