Skip to main content

Complete Command Reference

Trellis 0.4.0 provides 11 slash commands (Claude Code), organized into 6 categories. The Cursor version has 10 (excluding /parallel).

Cross-Platform Command Reference

FunctionClaude Code / OpenCodeCursorCodex
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:
  1. Read workflow.md to understand the workflow
  2. Run get-context.py to get context (identity, Git status, active tasks)
  3. Read spec indexes to understand project specs
  4. Report context and ask: โ€œWhat would you like to work on?โ€
Task classification decisions:
TypeCriteriaWorkflow
Q&AUser asks about code or architectureAnswer directly
Quick fixTypo fix, single-line change, < 5 minutesEdit directly
Development taskLogic changes, new features, bug fixes, multi-file changesUse 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:
  1. Assess whether requirements are clear (may reject, see Chapter 6)
  2. Invoke Research Agent to analyze the codebase
  3. Create task directory and configure JSONL context
  4. 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:
  1. Core concept walkthrough (spec / workspace / task / hook)
  2. 5 hands-on exercises (bug fix, planning session, Code Review fix, large refactor, debugging session)
  3. 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:
  1. git status to view changes
  2. Re-read the relevant spec layer(s) for the changed files
  3. Compare code against specs line by line
  4. 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:
  1. Data flow consistency โ€” Frontend, API, Database, API, Frontend
  2. Type definition sync โ€” Frontend and backend interfaces match
  3. Error handling continuity โ€” Errors properly propagated across layers
  4. Constant synchronization โ€” Shared constants between frontend and backend
  5. Code reuse โ€” No duplicate implementations
  6. 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:
  1. Root Cause Classification:
    • A โ€” Missing Spec
    • B โ€” Cross-layer Contract Violation
    • C โ€” Change Propagation Failure
    • D โ€” Test Coverage Gap
    • E โ€” Implicit Assumption
  2. Why Fixes Failed โ€” Analyze why previous fix attempts failed
  3. Prevention Mechanisms (6 types):
    • Spec update
    • Type constraints
    • Lint rules
    • Test cases
    • Code review checklist items
    • Documentation updates
  4. Systematic Expansion โ€” Search for other potential issues with the same pattern
  5. 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:
  1. Code quality (lint, type-check, test)
  2. Documentation sync
  3. API changes
  4. Database changes
  5. Cross-layer verification
  6. 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 TypeTrigger ConditionExample
Unclear or VagueNo specific outcome definedโ€Make it betterโ€, โ€œFix the bugsโ€
Incomplete InformationMissing critical implementation detailsReferences unknown systems
Out of ScopeDoes not belong to this projectRequires modifying external systems
Potentially HarmfulSecurity riskIntentionally creating backdoors
Too LargeShould be splitRequesting 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

EventFires WhenUse Case
after_createtask.py create completesCreate linked issue in project tracker
after_starttask.py start sets the current taskUpdate issue status to โ€œIn Progressโ€
after_finishtask.py finish clears the current taskNotify team, trigger review
after_archivetask.py archive moves the taskMark issue as โ€œDoneโ€

Environment Variables

Each hook receives:
VariableValue
TASK_JSON_PATHAbsolute 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:
ActionTriggerEffect
createafter_createCreates a Linear issue from task.json (title, priority, assignee, parent)
startafter_startUpdates the linked issue to โ€œIn Progressโ€
archiveafter_archiveUpdates the linked issue to โ€œDoneโ€
syncManualPushes prd.md content to the Linear issue description
Prerequisites:
  1. Install the linearis CLI and set LINEAR_API_KEY
  2. 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:
TriggerUpdate FrequencyExample
Fixed a non-obvious bugImmediatelyAdd to โ€œCommon Mistakesโ€
Discovered a better practiceSame dayAdd to โ€œPatternsโ€
Team agrees on new conventionSame dayAdd to โ€œConventionsโ€
Routine improvementsWeeklyRefine 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

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
# โœ… 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"