Get the FREE Ultimate OpenClaw Setup Guide →

architecture

Scanned
npx machina-cli add skill NorthShoreAutomation/trellis/architecture --openclaw
Files (1)
SKILL.md
9.6 KB

Trellis Architecture

Trellis is an AI-native development workflow plugin for Claude Code. It provides a two-command lifecycle: scope (branch + build + verify + PR) and release (merge + tag + publish). After a single user approval, Trellis executes autonomously -- dispatching specialized agents in parallel, running verification, and committing incrementally.

Data Flow

User intent (natural language)
    |
    v
/trellis:scope
    |-- creates branch
    |-- /trellis:implement (autonomous)
    |       |-- specialized agents (parallel)
    |       |-- verification (tests, lint, visual)
    |       |-- incremental commits
    |-- push + PR
    |
    v
/trellis:release
    |-- merge PR
    |-- tag version
    |-- GitHub release

Plugin Structure

skills/              # Skill definitions (*/SKILL.md)
  scope/             # Primary entry point -- branch, build, verify, PR
  implement/         # Autonomous build engine
  status/            # Project health + ready work
  codemap/           # Codebase navigation map (recommended starting point)
  push/              # Manual commit + push
  pr/                # Manual PR creation
  release/           # Merge, tag, publish
  hybrid-search/     # [knowledge] Hybrid search systems (PostgreSQL + OpenSearch)
  library-assistant/ # [knowledge] Conversational library assistant design
  architecture/      # [knowledge] Plugin structure and data flow
  style/             # [knowledge] Working conventions
agents/              # Specialized subagents
  backend-architect  # System design and API architecture
  frontend-developer # UI components and client-side logic
  database-architect # Schema design and migrations
  golang-pro         # Go implementation
  python-pro         # Python implementation
  typescript-pro     # TypeScript implementation
  general-purpose    # Cross-cutting and misc tasks
  code-reviewer      # Review and quality checks
  test-runner        # Test execution and verification
.claude-plugin/      # Plugin manifest (plugin.json)

Core Invariants

These rules must be preserved across all skills and agents:

  1. Scope creates branches; release merges them. These are the only two user-facing lifecycle commands. Everything else is either an implementation detail or a manual escape hatch.

  2. Implement runs autonomously after one approval. Once the user confirms the scope, no further prompts should interrupt execution. Errors are self-corrected or reported at the end.

  3. Agents are dispatched in parallel where possible. Independent work units run concurrently via the Task tool. Dependent work is sequenced automatically.

  4. Verification is layered and optional. The verification sequence is: tests, then lint, then visual. Each layer runs only if applicable to the project. Failure at any layer triggers self-correction before moving on.

  5. Self-correction is bounded. A failing step may be retried up to 3 times. After that, the failure is reported to the user rather than looping indefinitely.

  6. Beads is optional. When the bd CLI is available, Trellis uses it for session recovery and dependency tracking. When unavailable, Trellis skips beads operations silently and relies on git commits alone.

  7. Commits are incremental. Each logical work unit produces its own commit. Do not batch all changes into a single commit at the end.

Component Roles

Skills

Skills are either user-invocable commands or knowledge resources referenced by other skills and agents.

SkillTypePurpose
scopecommandBranch, build, verify, PR -- the primary workflow
implementcommandAutonomous build engine (usually called by scope)
statuscommandProject health overview and ready work
codemapcommandGenerate/update CODEMAP.yaml for navigation (recommended starting point)
pushcommandManual commit and push
prcommandManual PR creation
releasecommandMerge, tag, publish
hybrid-searchknowledgeHybrid search (PostgreSQL + OpenSearch + Cohere embeddings)
library-assistantknowledgeConversational media library assistant design (RAG, prompts, patterns)
architectureknowledgePlugin structure and data flow (this file)
styleknowledgeWorking conventions for git, commits, safety

Agents

Agents are specialized executors. Implementation agents are dispatched by the implement skill; utility agents serve verification and review roles outside the implementation dispatch.

AgentDomainRole
backend-architectSystem design, API architecture, service structureImplementation
frontend-developerUI components, client-side logic, stylingImplementation
database-architectSchema design, migrations, query optimizationImplementation
golang-proGo implementation following Go idiomsImplementation
python-proPython implementation following Python conventionsImplementation
typescript-proTypeScript implementation with type safetyImplementation
general-purposeCross-cutting changes, config, infrastructureImplementation
code-reviewerCode review, quality checks, style enforcementUtility
test-runnerTest execution, coverage, verificationUtility

Beads (Optional)

When the bd CLI is available, Trellis uses it for persistent state:

bd create --title="..." --type=task   # Track scope as issue
bd update <id> --status=in_progress   # Mark progress
bd close <id>                         # Complete work
bd ready                              # Find unblocked work
bd sync                               # Persist state to git

When beads is unavailable, Trellis proceeds without it. No errors are raised. Git commits serve as the sole record of progress.

Skill Interactions

Primary Workflow (scope + release)

/trellis:scope "add user authentication"
    |
    |-- git checkout -b feat/user-authentication
    |-- /trellis:implement
    |       |-- dispatch: typescript-pro (API routes)
    |       |-- dispatch: database-architect (schema)
    |       |-- dispatch: frontend-developer (login form)
    |       |-- verify: run tests + lint (shell)
    |       |-- commit per work unit
    |-- git push + create PR
    |
    v
/trellis:release
    |-- merge PR
    |-- git tag v1.2.0
    |-- GitHub release with notes

Manual Escape Hatches

SkillWhen to Use
pushNeed to commit and push without a full scope cycle
prNeed a PR without going through scope
statusCheck project state, find ready work, review health
codemapGenerate or update navigation map (recommended first step for new projects)

Skill Dependencies

SkillRequiresProduces
scopeUser intentBranch, code changes, PR
implementBranch, work descriptionCode changes, commits, CODEMAP.yaml update
statusGit repoHealth report
codemapSource filesCODEMAP.yaml
pushStaged/unstaged changesCommits, remote push
prRemote branchPull request
releasePR (or creates one)Merge, tag, GitHub release

Session Management

Starting a Session

  • /trellis:status -- shows branch state, uncommitted changes, and project health
  • /trellis:codemap -- generate or update the codebase navigation map (recommended for new projects)
  • If beads is available: bd ready shows unblocked work; bd list --status=in_progress shows interrupted work

During a Session

Implement runs autonomously. Agents are dispatched, verification runs, and commits are made without user intervention. The user is only interrupted if:

  • A verification failure cannot be self-corrected after 3 retries
  • A destructive operation requires confirmation (see style knowledge skill)

Ending a Session

Code is committed and pushed by scope automatically. For manual sessions:

git status            # Check for uncommitted changes
git add <files>       # Stage changes
git commit -m "..."   # Commit
git push              # Push to remote

If beads is available: bd sync to persist issue state.

Work is not complete until git push succeeds.

Session Recovery

If a session is interrupted mid-work:

  1. /trellis:status -- shows branch state and uncommitted changes
  2. git log --oneline -10 -- shows recent commits on the branch
  3. If beads is available: bd list --status=in_progress -- shows interrupted work
  4. Resume with /trellis:implement or manual work

Error Handling

Common Issues

ErrorCauseResolution
Branch already existsRe-scoping same workDelete branch or use a different name
Push rejectedRemote has divergedPull and rebase, then push
Agent task failedImplementation errorCheck error output, retry or fix manually
Verification failed 3xPersistent test/lint failureReport to user with details for manual fix
bd command not foundBeads not installedIgnore; Trellis works without beads
PR creation failedNo remote, auth issueCheck gh auth status, verify remote exists
Merge conflictParallel branch changesResolve conflicts manually, then continue

Recovery Steps

For most failures, the recovery path is:

  1. Check /trellis:status for current state
  2. Review git log and diff to understand what completed
  3. Fix the issue (resolve conflict, fix test, etc.)
  4. Resume with /trellis:implement or /trellis:push

Source

git clone https://github.com/NorthShoreAutomation/trellis/blob/main/skills/architecture/SKILL.mdView on GitHub

Overview

Trellis is a plugin-based AI workflow for Claude Code, organizing scope and release lifecycles. It defines how agents run in parallel, verify steps, and commit incrementally. The architecture document outlines core invariants and component roles to ensure reliable, autonomous operation.

How This Skill Works

User initiates the lifecycle with scope, which creates a branch and triggers autonomous implementation via implement. Specialized agents run in parallel, followed by layered verification (tests, lint, visual) with self-correction if needed, and incremental commits. When ready, release merges the PR, tags the version, and publishes a GitHub release.

When to Use It

  • You want to initialize a Trellis workflow with scope and autonomous implement steps.
  • You need parallel agent execution to speed up building and verification.
  • You rely on a layered verification sequence (tests, lint, visual) with self-correction.
  • You want incremental commits per logical unit rather than a single monolithic commit.
  • You plan to merge, tag, and publish a release automatically after approval.

Quick Start

  1. Step 1: Review the core invariants and identify independent work units for parallel execution.
  2. Step 2: Run /trellis:scope to create a branch and trigger /trellis:implement, then monitor autonomous agents.
  3. Step 3: After successful verification, run /trellis:release to merge, tag, and publish the GitHub release.

Best Practices

  • Define independent work units to maximize parallelism and minimize cross-step dependencies.
  • Always separate scope vs release boundaries; treat scope as the primary lifecycle and release as the final publishing step.
  • Design steps to be idempotent so re-running does not cause adverse effects.
  • Configure verification layers to fit project needs and quality standards.
  • Document the plugin structure and data flow to aid maintenance and onboarding.

Example Use Cases

  • Architect a Trellis workflow for a Claude Code project, organizing scope → implement → verify → PR.
  • Dispatch parallel agents to handle feature work, tests, and lint concurrently.
  • Create incremental commits for each feature or bug fix rather than batching all changes.
  • Use layered verification to catch issues early and auto-correct where possible.
  • Generate CODEMAP.yaml via codemap to improve codebase navigation and onboarding.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers