Skip to content
/

Trellis

trellis-mindfold · mindfold-ai/Trellis · ★ 8.5k · last commit 2026-05-26

Team-scale AI coding harness: shared specs auto-injected via hooks into sub-agents across 14 AI tools, with per-developer workspace journals and spec-learning loop.

Best whenSpecs injected, not remembered — PreToolUse hooks intercept sub-agent dispatch to inject curated JSONL context files automatically, eliminating spec drift ac…
Skip ifRemoving or weakening WORKFLOW GATE enforcement comments, Letting git commit inside implement sub-agent
vs seeds
openspec(multi-platform, per-feature spec folders) but Trellis adds PreToolUse hook-based automatic spec injection into sub-agen…
Primitive shape 18 total
Commands 1 Skills 9 Subagents 3 Hooks 5
00

Summary

Trellis — Summary

Trellis is a team-scale AI coding harness from Mindfold that provides a trellis CLI (npm), a 4-phase workflow (Plan → Implement → Verify → Finish), auto-injected per-task specs via Claude Code hooks, and support for 14 AI coding platforms — making it the broadest multi-platform framework in this corpus.

Problem it solves: Team AI coding workflows break down because standards aren't shared, each developer rebuilds context per session, and the same specs must be repeated across tools; Trellis puts structured specs, task PRDs, and workspace journals in the repo so all team members and all AI tools share the same guidelines automatically.

Distinctive trait: Hook-injected spec context — a PreToolUse hook on Task/Agent tool calls intercepts every sub-agent dispatch and injects the relevant curated spec files from .trellis/spec/ and task JSONL context, so sub-agents always have the right guidelines without the user needing to prompt for them.

Target audience: Teams using AI coding tools (Claude Code, Cursor, Codex, Kiro, Gemini CLI, etc.) who want shared standards, per-task context injection, and workspace memory across 14 platforms.

Production-readiness: Active and growing (8,467 stars, 25 contributors, v0.5.19, last pushed May 2026, AGPL-3.0).

Differs from seeds: Closest to openspec (multi-platform, spec-per-feature, delta files) but Trellis adds a CLI binary, hook-based automatic spec injection, per-developer workspace journals, and explicit multi-platform support for 14 tools — vs openspec's npm-package + manual spec loading.

01

Overview

Trellis — Overview

Origin

Mindfold (mindfold-ai organization), released as an AGPL-3.0 npm package @mindfoldhq/trellis. Currently v0.5.19. 8,467 GitHub stars, 25 contributors. Active as of May 2026.

Philosophy

Trellis is named for a garden trellis — a structure that guides growth. The tagline is: "AI capabilities grow like ivy — Trellis provides the structure to guide them along a disciplined path."

The core philosophy: specs injected, not remembered. Rather than asking the AI to recall guidelines from memory or repeat them in every prompt, Trellis injects the relevant context files at the moment of sub-agent dispatch, via hooks. This creates a "set it and forget it" spec injection system.

Five core principles (from workflow.md):

  1. Plan before code
  2. Specs injected, not remembered
  3. Persist everything — conversations get compacted, files don't
  4. Incremental development — one task at a time
  5. Capture learnings — review and write new knowledge back to spec

Key Differentiator

14 AI coding platforms supported: Claude Code, Cursor, OpenCode, Codex, Kiro, Kilo, Gemini CLI, Antigravity, Windsurf, Qoder, CodeBuddy, GitHub Copilot, Droid, Pi Agent. Setup:

trellis init --cursor --opencode --codex -u your-name

Manifesto-style quotes (from README)

"Make AI coding reliable at team scale."

"Specs live in the repo, so one person's hard-won workflow or rule can benefit the whole team."

"Personal workspace journals stay separate per developer, while shared specs and tasks stay in the repo where they can be reviewed and improved like any other project artifact."

02

Architecture

Trellis — Architecture

Distribution

npm package @mindfoldhq/trellis. TypeScript + Python scripts.

Install

npm install -g @mindfoldhq/trellis@latest
trellis init -u your-name                    # basic init
trellis init --cursor --opencode --codex -u your-name  # multi-platform

CLI Structure

packages/
├── cli/                  # TypeScript CLI (Commander.js)
│   └── bin/trellis.js    # Entry point
│   └── src/commands/
│       ├── init.ts       # trellis init
│       ├── update.ts     # trellis update
│       └── uninstall.ts  # trellis uninstall
├── docs-site/            # Documentation site
└── guides/               # User guides

Project Directory Tree (after trellis init)

.trellis/
├── .version              # Framework version
├── .template-hashes.json # Template tracking
├── config.yaml           # Configuration
├── workflow.md           # Core workflow doc
├── agents/               # 3 sub-agents
│   ├── implement.md      # Code implementation agent
│   ├── check.md          # Code quality check agent
│   └── research.md       # Research agent
├── spec/                 # Coding guidelines (organized by package/layer)
│   └── {package}/{layer}/
│       ├── index.md      # Entry point with Pre-Dev Checklist
│       └── *.md          # Spec files
├── tasks/                # Task directories
│   └── {MM-DD-name}/
│       ├── prd.md
│       ├── implement.jsonl
│       ├── check.jsonl
│       ├── task.json
│       └── research/
├── workspace/            # Per-developer journals
│   └── {developer}/
│       ├── journal-N.md  # Max 2000 lines per file
│       └── index.md
└── scripts/              # Python utility scripts
    ├── task.py           # Task lifecycle management
    ├── get_context.py    # Context retrieval
    ├── add_session.py    # Session journaling
    ├── init_developer.py # Developer identity setup
    └── hooks/            # Hook scripts

.claude/                  # Claude Code integration
├── settings.json         # Hooks config
├── skills/               # 9 skills
│   ├── trellis-brainstorm.md
│   ├── trellis-implement.md
│   ├── trellis-check.md
│   └── ...
├── commands/             # Claude commands
│   └── trellis.md
├── agents/               # Claude agents (mirrors .trellis/agents/)
└── hooks/                # Python hook scripts

.cursor/                  # Cursor integration (if --cursor)
.codex/                   # Codex integration (if --codex)
.opencode/                # OpenCode integration
.pi/                      # Pi Agent integration

Required Runtime

  • Node.js >= 18 (CLI)
  • Python >= 3.9 (scripts + hooks)

Target AI Tools

14 platforms: Claude Code, Cursor, OpenCode, Codex, Kiro, Kilo, Gemini CLI, Antigravity, Windsurf, Qoder, CodeBuddy, GitHub Copilot, Droid, Pi Agent.

03

Components

Trellis — Components

CLI Subcommands (binary: trellis / tl)

Command Purpose
trellis init -u <name> Initialize Trellis in repo, create developer identity
trellis update Update Trellis templates to latest version
trellis uninstall Remove Trellis from repo

Skills (9, in .claude/skills/)

Skill Purpose
trellis-brainstorm Phase 1 — PRD creation via one-question-at-a-time dialogue
trellis-implement Phase 2 — Dispatch implement sub-agent with injected context
trellis-check Phase 3 — Dispatch check sub-agent (diff review + self-fix)
trellis-update-spec Phase 4 — Promote learnings back to .trellis/spec/
trellis-before-dev Pre-development spec context loading
trellis-break-loop Break out of implementation loops
trellis-meta Trellis meta-operations
first-principles-thinking First-principles analysis
contribute Contribution workflow
python-design Python design guidelines

Sub-Agents (3, in .trellis/agents/ + .claude/agents/)

Agent Model Purpose
implement openrouter/minimax/minimax-m2.7 Code implementation from PRD + injected specs
check openrouter/minimax/minimax-m2.7 Diff review vs specs + self-fix lint/typecheck
research openrouter/minimax/minimax-m2.7 Internal/external research → populate JSONL context

Hooks (3, in .claude/hooks/)

Hook Event Script Purpose
SessionStart (startup) session-start.py Load workspace journals + active task context
SessionStart (clear) session-start.py Same on /clear
SessionStart (compact) session-start.py Same on /compact
PreToolUse (Task) inject-subagent-context.py Inject spec+task JSONL into sub-agent prompt
PreToolUse (Agent) inject-subagent-context.py Inject spec+task JSONL into agent prompt
UserPromptSubmit inject-workflow-state.py Inject workflow state breadcrumb on prompt

Python Scripts (.trellis/scripts/)

Script Purpose
task.py Full task lifecycle: create, start, finish, archive, list, PR
get_context.py Retrieve session runtime context (packages, spec layers, phase guides)
add_session.py Write session to workspace journal
init_developer.py Create developer identity + workspace directory

Commands (1, in .claude/commands/)

  • trellis.md — Claude Code command for Trellis operations + finish-work

Templates

Task directory template: prd.md, implement.jsonl, check.jsonl, task.json in .trellis/tasks/{MM-DD-name}/

05

Prompts

Trellis — Prompts

Excerpt 1: implement agent — No-Commit Discipline (verbatim)

File: .trellis/agents/implement.md Technique: Explicit forbidden operation list. The implement agent is constrained to code-only with no git operations.

---
name: implement
description: |
  Code implementation expert. Understands specs and requirements, then implements features. No git commit allowed.
tools: read, bash, edit, write, grep, find, ls, web_search
model: openrouter/minimax/minimax-m2.7
---

## Forbidden Operations

- `git commit`, `git push`, `git merge`

## Workflow

1. Read relevant specs based on task type
2. Read the task's prd.md and info.md
3. Implement features following specs and existing patterns
4. Run lint and typecheck to verify

## Code Standards

- Follow existing code patterns
- Don't add unnecessary abstractions
- Only do what's required, no over-engineering

Excerpt 2: check agent — Self-Fix Mandate (verbatim)

File: .trellis/agents/check.md Technique: Mandatory self-correction pattern — the agent must fix issues it finds, not merely report them.

---
name: check
description: |
  Code quality check expert. Reviews code changes against specs and self-fixes issues.
tools: read, bash, edit, write, grep, find, ls, web_search
model: openrouter/minimax/minimax-m2.7
---

**Fix issues yourself.** You have write and edit tools.

## Workflow

1. `git diff --name-only` — list changed files
2. `git diff` — view specific changes
3. Read relevant specs in `.trellis/spec/`
4. Check: directory structure, naming, code patterns, missing types, potential bugs
5. Fix issues directly with edit tool
6. Run lint and typecheck to verify

## Forbidden Changes

- Do NOT remove or weaken workflow enforcement directives (comments containing "WORKFLOW GATE", "[!] MUST", "[!] Do NOT")
- Do NOT change the workflow state machine logic unless explicitly asked

Excerpt 3: workflow.md — Core Principles (verbatim)

File: .trellis/workflow.md Technique: Numbered principle list establishing the framework's philosophy.

## Core Principles

1. **Plan before code** — figure out what to do before you start
2. **Specs injected, not remembered** — guidelines are injected via hook/skill, not recalled from memory
3. **Persist everything** — research, decisions, and lessons all go to files; conversations get compacted, files don't
4. **Incremental development** — one task at a time
5. **Capture learnings** — after each task, review and write new knowledge back to spec
09

Uniqueness

Trellis — Uniqueness

Differs from Seeds

Closest to openspec (multi-platform, per-feature spec folders) but with three structural advances: (1) Hook-injected spec contextPreToolUse on Task/Agent intercepts sub-agent dispatch and injects the right spec JSONL automatically (openspec uses manual spec loading); (2) Per-developer workspace journals.trellis/workspace/{dev}/journal-N.md separates personal memory from shared specs (openspec has no per-developer memory layer); (3) CLI binary (trellis init/update/uninstall) for template management (openspec is npm install only). The 14-platform support is also unmatched in the seed corpus — nearest is superpowers which supports ~7 tools but fewer with native hooks. The explicit sub-agent model differentiation (minimax for implement/check agents vs Claude for orchestration) is a cost-optimization pattern seen in Tsumiki but not in seed frameworks.

Positioning

Trellis positions as "the best agent harness" (from repo description) and "make AI coding reliable at team scale" — targeting teams rather than individual developers. The team-shared spec system and per-developer journal separation directly address team coordination failures.

Distinctive Opinion

"Specs injected, not remembered" — encapsulated in the hook injection architecture. The JSONL context files curated during planning are the mechanism: rather than asking the AI to recall guidelines or loading all specs on every turn, Trellis precisely injects only the relevant files at the moment of sub-agent dispatch.

Observable Failure Modes

  1. AGPL license: More restrictive than MIT — may block commercial embedding without license compliance review
  2. Platform adaptation varies: Hook injection works natively in Claude Code; on other platforms (Cursor, Codex), spec injection may degrade to manual
  3. minimax-m2.7 model: Sub-agents locked to a specific OpenRouter model — quality depends on that model's capability
  4. Task.py Python dependency: Requires Python >= 3.9 for task management scripts
  5. Team adoption overhead: Trellis adds significant structure overhead; solo developers may find it over-engineered
04

Workflow

Trellis — Workflow

4-Phase Loop

Phase Skill/Agent Action Artifact
1. Plan trellis-brainstorm One-question-at-a-time PRD creation; research sub-agent for heavy items; curate spec + research into JSONL files prd.md, implement.jsonl, check.jsonl
2. Implement trellis-implement → implement agent Dispatch implement sub-agent; hook injects spec JSONL; implement features from PRD; no git commit Modified source files
3. Verify trellis-check → check agent Dispatch check sub-agent; diff review vs specs; self-fix issues; run lint/typecheck Fixed source files
4. Finish trellis-update-spec /trellis:finish-work — final check, archive task, update journals, promote learnings to spec Updated .trellis/spec/, archived task

Task Lifecycle (task.py)

task.py create "Feature title"     # create task dir + prd.md
task.py start <name>               # set active task (session pointer)
task.py finish                     # clear active task pointer
task.py archive <name>             # move to archive/, status=completed
task.py list [--mine] [--status S] # list tasks
task.py create-pr [name]           # create PR with task context

Approval Gates

  1. PRD completion gate: Brainstorm step asks one question at a time until PRD is clear — no implementation until PRD is complete
  2. Check agent self-fix: Check agent fixes its own issues, then reports — human reviews final report
  3. Finish gate: /trellis:finish-work runs final check before archiving

Spec Learning Loop

After each task: trellis-update-spec promotes new patterns/conventions discovered during implementation back into .trellis/spec/. Next task starts with updated specs.

Session Start

SessionStart hook runs session-start.py which loads:

  • Active task context from .trellis/.runtime/sessions/
  • Developer workspace journals
  • Workflow state breadcrumb

Artifacts Map

Phase Artifact
Plan .trellis/tasks/{task}/prd.md, implement.jsonl, check.jsonl
Implement Modified source files
Verify Fixed source files
Finish archive/{year-month}/, updated workspace/{dev}/journal-N.md, updated spec
06

Memory Context

Trellis — Memory & Context

Primary Memory: .trellis/spec/

Per-package, per-layer coding guidelines. Index files list available specs; actual specs are .md files. The spec system is the framework's "long-term memory" — learnings from each task are promoted back via trellis-update-spec.

Task Context: JSONL Files

Per-task context files in .trellis/tasks/{task}/:

  • implement.jsonl — curated spec + research files for implement sub-agent (lines: {"action": "context", "file": "...", "reason": "..."})
  • check.jsonl — curated spec files for check sub-agent

These JSONL files are populated during planning and injected into sub-agents via inject-subagent-context.py hook.

Developer Journals: .trellis/workspace/{dev}/

Per-developer session logs:

  • journal-N.md — session log (max 2000 lines per file, auto-increments to journal-(N+1).md)
  • index.md — personal index (total sessions, last active)

Added via add_session.py --title "..." --commit "..." --summary "...".

Cross-Session Handoff

Yes — SessionStart hook loads:

  1. Developer workspace journals (most recent)
  2. Active task state from .trellis/.runtime/sessions/
  3. Workflow state breadcrumb

Context Compaction

Yes — SessionStart hook fires on both /clear and /compact, reinjecting context after compaction. This ensures spec injection survives context resets.

JSONL Architecture

JSONL context files are the key innovation: rather than injecting all specs into every prompt (token-expensive), Trellis curates the specific spec files relevant to each task into JSONL format, injected precisely at sub-agent dispatch time.

Memory Persistence Level

Project-scoped (.trellis/spec/, .trellis/tasks/) + per-developer (.trellis/workspace/{dev}/).

Session State

.trellis/.runtime/sessions/ — per-session active task pointer (gitignored, ephemeral).

07

Orchestration

Trellis — Orchestration

Multi-Agent

Yes. Three specialized sub-agents: implement, check, research. Each is a separate Claude Code agent with its own model specification and tool set.

Orchestration Pattern

Sequential. Plan → Implement (sub-agent) → Check (sub-agent) → Finish. Optional Research sub-agent dispatched during planning for heavy research items.

Spawn Mechanism

Claude Code Task/Agent tools. The PreToolUse hooks on Task/Agent tools intercept dispatch and inject JSONL context before the sub-agent starts.

Execution Mode

Interactive-loop (skills are triggered by user). Each phase runs to completion before next.

Isolation Mechanism

None (in-place edits). Implement agent is explicitly forbidden from git commits.

Multi-Model

Yes. All three sub-agents specify model: openrouter/minimax/minimax-m2.7 — a different model from the orchestrating Claude Code session. This is explicit sub-agent model differentiation (cost optimization: minimax is cheaper than Claude Sonnet for routine implementation).

Consensus Mechanism

None.

Prompt Chaining

Yes. PRD → implement.jsonl → implement agent → git diff → check.jsonl → check agent → spec update. Each phase's output feeds the next.

Hook-Based Injection

The inject-subagent-context.py hook intercepts Task/Agent tool calls and injects:

  1. Relevant spec files from implement.jsonl or check.jsonl
  2. Task PRD context This happens automatically at sub-agent boundary — no user action required.

Crash Recovery

Yes — session pointers in .trellis/.runtime/sessions/ + task state in task.json. SessionStart hook reloads context.

Context Compaction

Yes — SessionStart hook fires on /compact, reinjects workspace journals and active task context.

Cross-Platform Multi-Agent

On platforms without native hook support (Cursor, Codex, etc.), Trellis adapts: implement.jsonl and check.jsonl are still created, but injection may be manual or via platform-specific mechanisms.

08

Ui Cli Surface

Trellis — UI / CLI Surface

CLI Binary

Yes. Binary names: trellis and tl (alias).

Subcommands:

  • trellis init -u <name> — initialize with developer identity
  • trellis update — update templates
  • trellis uninstall — remove from project

Is thin wrapper: No — manages template installation, multi-platform config generation, version tracking.

Local UI

None (no web dashboard).

Documentation Site

https://docs.trytrellis.app/ — full documentation with guides, platform support, spec templates, changelog.

IDE Integration

14 platforms: Claude Code, Cursor, OpenCode, Codex, Kiro, Kilo, Gemini CLI, Antigravity, Windsurf, Qoder, CodeBuddy, GitHub Copilot, Droid, Pi Agent.

Multi-platform init:

trellis init --cursor --opencode --codex -u your-name

Python CLI (task management)

python3 .trellis/scripts/task.py create "title"
python3 .trellis/scripts/task.py list
python3 .trellis/scripts/task.py create-pr [name]
python3 .trellis/scripts/get_context.py  # full session context

Observability

  • .trellis/workspace/{dev}/journal-N.md — developer session logs
  • .trellis/tasks/{task}/task.json — task status + metadata
  • Archive in .trellis/tasks/archive/{year-month}/
  • Version tracking via .trellis/.version + .template-hashes.json

Discord

Active community: https://discord.com/invite/tWcCZ3aRHc

Related frameworks

same archetype · same primary tool · same memory type

cc-spec-driven ★ 27

Tracks specification changes as CRs through a draft→confirm→RC→archive lifecycle with LLM-evaluated hooks that enforce checklist…

DevTeam: Claude Code Multi-Agent Dev System
Atmosphere ★ 3.8k

JVM framework for building production-grade governed AI agents with streaming transports, HITL approvals, Cedar/Rego policy…

Superpowers ★ 207k

Enforces spec-first, TDD, and subagent-reviewed development as mandatory automatic workflows rather than optional practices.

Claude-Flow / Ruflo ★ 55k

Eliminates single-agent context limits and sequential bottlenecks by orchestrating fault-tolerant swarms of specialized AI agents…

BMAD-METHOD ★ 48k

Provides a full agile delivery lifecycle with named expert-persona AI collaborators that elicit the human's best thinking rather…