Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.trytrellis.app/llms.txt

Use this file to discover all available pages before exploring further.

Trellis is a Team-level Agent Harness with built-in LLM wiki. In implementation terms, that means two systems share the same project files:
  • Agent Harness: workflow state, hooks, skills, sub-agents, and platform adapters that control how AI coding work moves.
  • Built-in LLM wiki: specs, tasks, research, and journals stored in the repository so AI sessions can reload project knowledge from files.
  • Team-level layer: git-tracked workflow/spec/task files plus per-developer workspace memory, so multiple people and multiple AI tools operate against the same conventions.
This document maps that idea to the current Trellis feature set, the modules that implement each feature, and the files to inspect when customizing a generated project. For the user flow, see How It Works.
Trellis is AGPL-3.0 licensed. Internal team use is permitted. Commercial use of a Trellis-derived product or service requires prior contact: [email protected].

Design principles

Trellis treats AI coding as a workflow and knowledge-management problem, not a single chat session.
PrincipleImplementation rule
Make workflow state explicitTask status and [workflow-state:STATUS] blocks tell the main session what phase it is in.
Store durable knowledge in filesRequirements, specs, research, and journals live under .trellis/, not only in conversation history.
Split work by responsibilityResearch, implementation, and checking use separate agents or skills depending on platform capability.
Keep context scopedJSONL manifests list the spec/research files needed for the current task instead of dumping the whole repo.
Preserve the review boundaryImplement/check agents produce a clean diff; the main session proposes commits, and /trellis:finish-work only archives and journals.
Support teams and tool diversityThe same .trellis/ model is adapted into Claude Code, Cursor, Codex, OpenCode, Kiro, Gemini, Qoder, Copilot, Droid, Pi, Kilo, Antigravity, Windsurf, and related tools.

Feature overview

Agent Harness

FeatureWhat it does
Three-phase workflowDefines Plan, Execute, and Finish in .trellis/workflow.md.
Per-turn workflow-state breadcrumbInjects the current next-action rule into the main session on hook-capable platforms.
Task lifecycleStores requirements, status, assignee, branch, PR metadata, and subtask relationships in .trellis/tasks/<task>/.
Research / implement / check rolesSeparates investigation, code writing, and verification.
Read-before-write enforcementMakes implement/check paths read PRD and relevant specs before changing files.
Finish boundarySeparates final verification, spec update, work commit, task archive, and journal writing.

Built-in LLM wiki

FeatureWhat it stores
Spec libraryProject conventions and thinking guides under .trellis/spec/.
Task knowledgePRDs, research, info docs, and JSONL manifests under .trellis/tasks/.
Workspace memoryPer-developer journals under .trellis/workspace/<developer>/.
Workflow documentationThe executable workflow contract in .trellis/workflow.md.
Local customization mapBundled trellis-meta references explaining which generated files own each behavior.

Team-level behavior

FeatureWhat it enables
Git-tracked workflow/spec/task filesNew team members clone the same workflow and conventions.
Per-session active task pointersMultiple windows can work on different tasks without sharing one global current task.
Subtask treesParent tasks can hold shared requirements while child tasks run their own Plan -> Execute -> Finish loop.
Cross-platform adaptersTeams can use different AI tools while keeping the same .trellis/ facts.
Spec distillationLessons from one task can be promoted into .trellis/spec/ for future tasks.

Feature to module map

FeaturePrimary moduleLocal files to inspect
Workflow phases and routingWorkflow module.trellis/workflow.md
Per-turn next-action injectionWorkflow-state module[workflow-state:STATUS] blocks, inject-workflow-state.py or equivalent plugin
Task creation, status, archiveTask store module.trellis/tasks/<task>/task.json, .trellis/scripts/task.py, .trellis/scripts/common/task_store.py
Session-scoped current taskActive-task runtime.trellis/.runtime/sessions/<session-key>.json, .trellis/scripts/common/active_task.py
PRD/spec injectionContext-loading moduleimplement.jsonl, check.jsonl, inject-subagent-context.py, platform agent preludes
Research / implement / check rolesAgent and skill modulePlatform agents/, skills/, prompts, workflows
Team convention memorySpec module.trellis/spec/**/index.md, guideline files
Developer memoryWorkspace module.trellis/workspace/<developer>/journal-*.md
Platform supportPlatform adapter module.claude/, .codex/, .cursor/, .opencode/, .kiro/, .gemini/, .qoder/, .github/, .pi/, and related settings
Finish and archiveFinish module/trellis:finish-work, .trellis/scripts/add_session.py, task archive scripts

Workflow module

.trellis/workflow.md is the source of truth for Trellis’s Plan -> Execute -> Finish contract.
Phase 1: Plan    -> create a task, write prd.md, curate JSONL context
Phase 2: Execute -> implement, check, and repeat until green
Phase 3: Finish  -> final verification, spec update, work commit, archive
The file owns three things:
  • phase definitions and numbered steps
  • skill / sub-agent routing by platform capability
  • [workflow-state:STATUS] blocks used by the per-turn breadcrumb hook
Changing workflow behavior starts here. Platform commands, skills, and agent files may also need wording updates if they describe the same flow, but the workflow contract itself belongs in .trellis/workflow.md.

Workflow-state module

On hook-capable platforms, inject-workflow-state.py or the equivalent plugin runs on each user prompt. The runtime contract is:
  1. Resolve the Trellis root from cwd.
  2. Resolve the active task for the current session.
  3. Read task.json.status, or synthesize no_task when no task is active.
  4. Parse .trellis/workflow.md.
  5. Inject the matching [workflow-state:STATUS] body into <workflow-state>...</workflow-state>.
Marker syntax:
[workflow-state:planning]
...
[/workflow-state:planning]
The hook scripts are parser-only. They do not contain fallback copies of the breadcrumb text. If a matching block is missing, the hook emits Refer to workflow.md for current step. Default statuses:
StatusWriterNotes
no_taskSynthesized by the hookNo active task pointer for the current session.
planningtask.py createRequirements, research, and JSONL curation are active.
in_progresstask.py startImplementation, checking, and finish steps are active.
completedtask.py archiveWritten immediately before archive move; not normally visible as a live breadcrumb.
task.py create best-effort sets the current session’s active-task pointer, so planning is reachable during brainstorm and JSONL curation.

Task store module

Each task is one directory:
.trellis/tasks/<MM-DD-slug>/
├── task.json
├── prd.md
├── info.md
├── implement.jsonl
├── check.jsonl
└── research/
Important files:
FilePurpose
task.jsonStatus, priority, assignee, branch, PR URL, parent/child relationships, and extension metadata.
prd.mdRequirements and acceptance criteria.
info.mdOptional technical design.
implement.jsonlSpec and research files the implementation path must read first.
check.jsonlSpec and research files the verification path must read first.
research/Research artifacts written by trellis-research or the main planning flow.
Task lifecycle hooks are command events, not generic status watchers:
Lifecycle eventFires whenMeaning
after_createtask.py create finishesA task directory exists.
after_starttask.py start finishesThe task entered in_progress.
after_finishtask.py finish clears the session pointerThe current AI session detached from the task; the task may still be active elsewhere.
after_archivetask.py archive finishesThe task is archived; use this for external “done” sync.

Active-task runtime module

The current task is session-scoped:
.trellis/.runtime/sessions/<session-key>.json
That file points one AI session or window at one task. Different windows can work on different tasks in the same repository. .trellis/.current-task is a fallback for command-line contexts. Session-scoped runtime pointers take precedence when the platform provides a session identity.

Context-loading module

Trellis loads context through three paths:
Context typeSourceUsed by
Startup context.trellis/scripts/get_context.pyMain session startup report.
Per-turn workflow state.trellis/workflow.md blocksMain session next-action guidance.
Sub-agent task/spec contextprd.md, info.md, implement.jsonl, check.jsonl, research filesResearch, implement, and check roles.
JSONL rows are plain file references:
{"file": ".trellis/spec/docs-site/docs/style-guide.md", "reason": "Docs writing style"}
In the standard flow, implement.jsonl and check.jsonl list spec and research files. Seed rows without a file field are ignored. Source files are read during implementation and review, not pre-registered in JSONL.

Platform adapter module

Trellis uses each platform’s available primitives. The generated project files are the source of truth for an actual repository, but the default capability groups are:
GroupPlatformsStartup contextPer-turn workflow-stateImplementation/check context
Hook + hook-push sub-agentClaude Code, Cursor, OpenCode, CodeBuddy, Droid, PiHook, plugin, or extensionHook or equivalentHook injects PRD + JSONL files before sub-agent starts.
Hook + pull-prelude sub-agentGemini CLI, Qoder, CopilotHookHookSub-agent reads PRD + JSONL itself on startup.
CodexCodexAGENTS.md; SessionStart when features.hooks = true (legacy: codex_hooks = true)Optional hook when enabled (0.129+ also requires /hooks review)Pull-based prelude plus shared .agents/skills/.
KiroKiroSkill files under .kiro/No Trellis per-turn hook by defaultAgent/skill files read Trellis context.
Main-session workflow/skillKilo, Antigravity, WindsurfManual workflow or skill entryNo Trellis per-turn hook by defaultMain session reads specs and task files inline.
If the local settings file disagrees with this table, follow the local settings file. Trellis projects are intentionally customizable.

Agent and skill module

Trellis 0.5 ships three sub-agent roles when the platform supports sub-agents:
Sub-agentRolePrimary context
trellis-researchInvestigate code, docs, APIs, and alternatives; write findings under research/.Research prompt plus optional research context.
trellis-implementWrite the change against the PRD and relevant specs.prd.md, info.md, implement.jsonl.
trellis-checkReview, run checks, and self-fix findings.prd.md, check.jsonl, changed files.
Skills cover phases where the main session needs guidance: brainstorm, before-dev, check, update-spec, finish-work, and meta customization. On platforms without sub-agents, skills carry more of the execution path directly in the main session. Removed 0.4 mechanisms:
  • dispatch, plan, and debug sub-agents were replaced by skill routing.
  • The SubagentStop-based Ralph Loop was replaced by trellis-check owning its retry loop.
  • Trellis no longer ships its own /parallel worktree orchestrator; use the platform’s native worktree support.

LLM wiki modules

The wiki side is a set of repository files that AI sessions can reread.
ModulePathContents
Spec library.trellis/spec/Team conventions, package/layer rules, thinking guides.
Task knowledge.trellis/tasks/PRDs, research, technical notes, JSONL manifests, archive.
Workspace memory.trellis/workspace/<developer>/Per-developer journals and indexes.
Workflow reference.trellis/workflow.mdThe workflow contract and next-action prompt blocks.
Trellis meta referencebundled trellis-meta skillLocal architecture and customization map for generated Trellis files.
Stable team rules belong in .trellis/spec/. Task-specific facts belong in the task directory. Session notes belong in .trellis/workspace/<developer>/.

Finish module

Trellis separates implementation, work commits, and bookkeeping:
  1. Implement/check agents produce a clean diff.
  2. The main session runs final verification and trellis-update-spec.
  3. Phase 3.4 proposes a batched commit plan, waits for one user confirmation, stages the listed files, and runs git commit. It does not amend and does not push.
  4. /trellis:finish-work archives the task and writes the workspace journal. It refuses to run on a dirty tree.
/trellis:finish-work is not the command that commits feature code. Work commits happen first; archive and journal commits are bookkeeping after that.

Generated and protected files

trellis init and trellis update generate local files, but local edits matter:
PathRule of thumb
.trellis/workflow.mdProject workflow source of truth; update deliberately.
.trellis/spec/Team-owned; template updates do not overwrite package/layer specs.
.trellis/tasks/Work history; avoid manually deleting active tasks.
Platform directoriesTool adapters; inspect local settings before changing behavior.
.trellis/.template-hashes.jsonManaged hash index; edit only when repairing update state.
.trellis/.runtime/Runtime state; normally not edited by hand.
For local customization, use the bundled trellis-meta skill as the map. It tells an AI to read local architecture references first, inspect actual project files, and modify the project copy instead of changing node_modules or a global install.

Customization map

GoalFirst file to inspect
Change phase order, required steps, or next-action wording.trellis/workflow.md
Change task creation, status, archive, or lifecycle sync.trellis/scripts/common/task_store.py, .trellis/scripts/task.py, .trellis/config.yaml
Change spec loading or JSONL rules.trellis/workflow.md, .trellis/scripts/common/task_context.py, platform agent/prelude files
Change hook behaviorPlatform hook settings plus .trellis/scripts/ hook implementations
Change implement/check agent behaviorPlatform agent files and task JSONL context rules
Add team-specific coding rules.trellis/spec/ or a project-local skill