Skip to main content

Quick Start

Installation

# Global install
npm install -g @mindfoldhq/trellis@latest

# Navigate to your project directory
cd your-project
OS Requirements: Mac, Linux, and Windows are fully supported. All scripts have been migrated to Python for cross-platform compatibility.
Choose the init command based on your platform:
trellis init -u your-name — auto-detects Claude Code and configures .claude/ (commands, agents, hooks).
You can pass multiple platform flags in one command: trellis init --codex --gemini --copilot -u your-name. your-name becomes your developer identity and creates your personal workspace at .trellis/workspace/your-name/.

Platform Configuration

trellis init automatically detects and configures installed platforms:
PlatformConfig DirectoryCommand Format
Claude Code.claude/commands/trellis/, .claude/agents/, .claude/hooks//trellis:start
Cursor.cursor/commands/*.md/trellis-start
OpenCode.opencode/commands/trellis/, .opencode/agents/, .opencode/plugins//trellis:start
CodexAGENTS.md, .agents/skills/, .codex/agents/, .codex/hooks/$start
iFlow.iflow/commands/trellis/, .iflow/hooks//trellis:start
Gemini CLI.gemini/commands/trellis/*.toml/trellis:start
Kilo.kilocode/workflows//start.md
Kiro.kiro/skills/*/SKILL.md@start
Qoder.qoder/skills/skill auto-match
GitHub Copilot.github/copilot-instructions.md, .github/prompts/Run Prompt
Windsurf.windsurf/workflows/, .windsurf/rules/workflow picker
CodeBuddy.codebuddy/commands/trellis/*.md/trellis:start
Antigravity.agent/workflows/*.mdworkflow picker
Factory Droid.factory/commands/trellis/, .factory/agents/, .factory/hooks//trellis:start

Platform Capability Comparison (0.4.0 GA — 14 platforms)

CapabilityCCCursorOpenCodeCodexiFlowGeminiKiloKiroQoderCopilotWindsurfCodeBuddyAntigravityDroid
Session auto-injection
Sub-Agent spec injection
Ralph Loop quality gate
Multi-Agent Pipeline
CC = Claude Code. Legend: ✅ full / ⚡ partial / ❌ not supported. “Partial” means the capability exists via a manual invocation or an opt-in platform flag rather than built-in automation.

Three Steps to Get Started

# Step 1: Open the Claude Code terminal
# Hook auto-injects context — you can describe your task directly (or run /start to see the full flow)

# Step 2: Describe what you want to do

"Add user login feature"

# Step 3: AI works automatically

# AI reads specs → creates task → invokes Agent to implement → self-checks

# Once done, you test, commit, and record the session

Tabs above show the most-used platforms. The other 8 platforms (Gemini CLI, iFlow, Qoder, GitHub Copilot, Windsurf, CodeBuddy, Antigravity, Factory Droid) follow the same Claude-Code-style workflow once installed — see chapter 13 for per-platform details.

Remote Spec Templates

Instead of writing specs from scratch, you can pull pre-built spec templates during init.

Official Marketplace

# Interactive: browse and pick from available templates
trellis init -u your-name

# Non-interactive: specify a template by ID
trellis init -u your-name --template electron-fullstack
The interactive picker shows all templates from the official marketplace. Choose one or start with blank specs.

Custom Registry (--registry)

Pull specs from your own GitHub, GitLab, or Bitbucket repository:
# Direct download: repo directory becomes .trellis/spec/
trellis init --registry gh:myorg/myrepo/my-team-spec

# Marketplace mode: repo has index.json with multiple templates
trellis init --registry gh:myorg/myrepo/marketplace

# Pick a specific template from a custom marketplace
trellis init --registry gh:myorg/myrepo/marketplace --template my-template

# Specify a branch
trellis init --registry gh:myorg/myrepo/specs#develop

# GitLab or Bitbucket
trellis init --registry gitlab:myorg/myrepo/specs
trellis init --registry bitbucket:myorg/myrepo/specs
Source format: provider:user/repo[/subdir][#ref]
ProviderPrefix
GitHubgh: or github:
GitLabgitlab:
Bitbucketbitbucket:
The ref (branch/tag) defaults to main if omitted.

Handling Existing Specs

When .trellis/spec/ already exists, use a strategy flag:
FlagBehavior
--overwriteDelete existing spec directory, then download
--appendOnly copy files that don’t already exist
(neither)Interactive prompt asks what to do

Building a Custom Marketplace

Create an index.json in your repository:
{
  "version": 1,
  "templates": [
    {
      "id": "my-backend-spec",
      "type": "spec",
      "name": "My Backend Spec",
      "description": "Backend conventions for our team",
      "path": "marketplace/specs/my-backend-spec",
      "tags": ["backend", "node"]
    }
  ]
}
The path field is relative to the repository root. Only type: "spec" is supported currently.

Private Repositories

For private repos, set the GIGET_AUTH environment variable with a personal access token:
GIGET_AUTH=ghp_xxxxx trellis init --registry gh:myorg/private-repo/specs
For GitHub fine-grained tokens, you need Contents and Metadata read permissions.

Full Directory Structure

your-project/
├── .trellis/                          # Trellis core directory
│   ├── .developer                     # Developer identity (gitignored)
│   ├── .current-task                  # Active task pointer
│   ├── .version                       # Trellis version number
│   ├── .template-hashes.json          # Template file hashes (for update)
│   ├── workflow.md                    # Development workflow guide
│   ├── worktree.yaml                  # Multi-Agent worktree config
│   │
│   ├── spec/                          # Project spec library
│   │   ├── frontend/                  #   Frontend specs
│   │   │   ├── index.md               #     Spec index
│   │   │   ├── component-guidelines.md
│   │   │   ├── hook-guidelines.md
│   │   │   ├── state-management.md
│   │   │   ├── type-safety.md
│   │   │   ├── quality-guidelines.md
│   │   │   └── directory-structure.md
│   │   ├── 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
│   │
│   ├── workspace/                     # Developer workspace
│   │   ├── index.md                   #   Workspace master index
│   │   └── {developer-name}/          #   Per-developer directory
│   │       ├── index.md               #     Personal index
│   │       └── journal-N.md           #     Session journal
│   │
│   ├── tasks/                         # Task directory
│   │   ├── {MM-DD-task-name}/         #   Active tasks
│   │   │   ├── task.json              #     Task metadata
│   │   │   ├── prd.md                 #     Requirements document
│   │   │   ├── info.md                #     Technical design (optional)
│   │   │   ├── implement.jsonl        #     Implement Agent context
│   │   │   ├── check.jsonl            #     Check Agent context
│   │   │   └── debug.jsonl            #     Debug Agent context
│   │   └── archive/                   #   Archived tasks
│   │       └── {YYYY-MM}/
│   │
│   └── scripts/                       # Automation scripts
│       ├── task.py                    #   Task management (14 subcommands)
│       ├── get-context.py             #   Get session context
│       ├── get-developer.py           #   Get developer identity
│       ├── init-developer.py          #   Initialize developer
│       ├── add-session.py             #   Record session
│       ├── common/                    #   Shared libraries
│       │   ├── paths.py
│       │   ├── developer.py
│       │   ├── git-context.py
│       │   ├── task-utils.py
│       │   ├── task-queue.py
│       │   ├── phase.py
│       │   ├── registry.py
│       │   └── worktree.py
│       └── multi-agent/               #   Parallel development scripts
│           ├── plan.py
│           ├── start.py
│           ├── status.py
│           ├── create-pr.py
│           └── cleanup.py

├── .claude/                           # Claude Code configuration
│   ├── settings.json                  #   Hook and permission config
│   ├── commands/                      #   Slash commands
│   │   └── trellis/                   #     Trellis command set
│   │       ├── start.md
│   │       ├── parallel.md
│   │       ├── record-session.md
│   │       ├── finish-work.md
│   │       ├── onboard.md
│   │       ├── before-dev.md
│   │       ├── before-dev.md
│   │       ├── check.md
│   │       ├── check.md
│   │       ├── check-cross-layer.md
│   │       ├── break-loop.md
│   │       ├── create-command.md
│   │       └── integrate-skill.md
│   ├── agents/                        #   Agent definitions
│   │   ├── dispatch.md
│   │   ├── plan.md
│   │   ├── implement.md
│   │   ├── check.md
│   │   ├── debug.md
│   │   └── research.md
│   ├── hooks/                         #   Hook scripts
│   │   ├── session-start.py
│   │   ├── inject-subagent-context.py
│   │   └── ralph-loop.py
│   └── skills/                        #   Skill directory

├── .cursor/                           # Cursor configuration
│   └── commands/
│       └── trellis-*.md               #   Cursor command set

├── AGENTS.md                          # Codex entry file
├── .agents/                           # Agent Skills (Codex / OpenCode)
│   └── skills/

├── .kilocode/                         # Kilo Code configuration
│   ├── rules/                         #   Project rules (all modes)
│   ├── workflows/                     #   Workflow commands
│   └── skills/                        #   Agent Skills

├── .kiro/                             # Kiro configuration
│   ├── steering/                      #   Project context (Steering system)
│   ├── hooks/                         #   Agent Hooks (event-driven automation)
│   ├── prompts/                       #   Custom prompts
│   └── specs/                         #   Spec-Driven Development docs

├── .iflow/                            # iFlow configuration
│   ├── commands/trellis/              #   Slash commands
│   └── hooks/                         #   SessionStart hook

├── .gemini/                           # Gemini CLI configuration
│   └── commands/trellis/              #   TOML commands

├── .qoder/                            # Qoder configuration
│   └── skills/                        #   12 auto-trigger skills

├── .github/                           # GitHub Copilot configuration
│   ├── copilot-instructions.md        #   Always-loaded prelude
│   └── prompts/                       #   Per-command prompts

├── .windsurf/                         # Windsurf configuration
│   ├── workflows/                     #   Command workflows
│   └── rules/                         #   Always-on prelude

├── .codebuddy/                        # CodeBuddy configuration
│   └── commands/trellis/              #   12 slash commands

├── .agent/                            # Antigravity configuration
│   └── workflows/                     #   Workflow files

└── .factory/                          # Factory Droid configuration
    ├── commands/trellis/              #   Slash commands
    ├── agents/                        #   Sub-agent definitions
    └── hooks/                         #   SessionStart hook

Your First Task

Starting a Session

Open the Claude Code terminal. The session-start.py Hook fires automatically and context is injected. You can describe your task directly, or run /start to see the full flow.The AI automatically performs the following:
  1. Reads workflow.md to understand the development workflow
  2. Runs get-context.py to get current state (your identity, Git status, active tasks)
  3. Reads spec/frontend/index.md and spec/backend/index.md to understand project specs
  4. Asks you: “What would you like to work on?”

AI Creates the Task and Develops

You say: “Add user login feature”. The AI will:
1. Invoke Research Agent to analyze the codebase
   → Find relevant spec files and code patterns

2. Create a task directory
   → .trellis/tasks/02-27-user-login/
   → Generate task.json, prd.md, implement.jsonl, etc.

3. Activate the task
   → task.py start (set .current-task)

4. Invoke Implement Agent
   → Hook auto-injects all specs configured in implement.jsonl
   → Agent implements the feature following specs

5. Invoke Check Agent
   → Hook injects check specs configured in check.jsonl
   → Agent checks code quality and auto-fixes issues
   → Ralph Loop ensures lint/typecheck passes

Testing and Committing

After the AI finishes, it will prompt you:
# Run project tests
pnpm lint && pnpm typecheck && pnpm test

# Commit after confirming everything works
git add src/components/LoginForm.tsx src/api/auth.ts
git commit -m "feat(auth): add user login feature"

Recording the Session

/record-session
The AI calls add-session.py to append the session content to your journal file and update your personal index.

Coming Back the Next Day — Cross-Session Memory

The next day, open a new session and enter /start:
AI: "Hi Alice! Yesterday you completed the user login feature (commit abc1234),
     including: LoginForm component, JWT middleware, users table.
     What would you like to work on today?"
The AI reads your workspace journal through the session-start.py Hook, remembering what you worked on last time.
Platform differences: Claude Code and OpenCode automatically read journals via Hooks for cross-session memory. Cursor and Codex users need to manually trigger context loading via /start (or $start) to get cross-session memory.