Skip to main content
Most teams do not need another command list. They need a way to keep project decisions from disappearing between AI sessions: new projects need early rules before patterns spread, brownfield repos hide conventions in old PRs, refactors need invariants, and production bugs need lessons that survive the fix. Each scenario below gives a starting prompt, the Trellis files to produce, the workflow to follow, and a concrete finish line. Pick the closest situation and adapt it into a task for your repo.
Trellis is skill-first. Treat the prompts below as task inputs; Trellis routes the work through the relevant skills for brainstorming, spec loading, checks, and knowledge capture. Use /trellis:start only when your platform needs a manual session entry point.

Scenario map

Optimize for one useful task before pushing a complete framework rollout. A small working spec and a clear task PRD teach the team more than a large empty spec library.

1. Start a new project

Use this when you are creating a product, service, package, or internal tool from zero.

1.1 Example situation

You are starting a B2B dashboard with authentication, team management, billing, and analytics. You want AI to help build quickly, but you do not want every session to invent a new folder layout, API style, or component pattern.

1.2 Starting prompt

1.3 Workflow

  1. Run trellis init once the project is initialized — it writes around 17 default spec templates under .trellis/spec/, split into backend/ / frontend/ / guides/ (directory structure, error handling, logging, component and hook guidelines, cross-layer thinking, etc.), and auto-creates a 00-bootstrap-guidelines task.
  2. Inside the bootstrap task, walk the AI through the product requirements and tech stack so it has full context before doing anything else.
  3. Optional: use the bundled trellis-spec-bootstarp skill to draft first-pass specs from the real codebase, plus any other skills that match the stack. Trellis installs this bundled skill automatically.
  4. Fill in the default spec templates produced by trellis init, focusing on what the current work needs; do not pre-design the whole project.
  5. Review the generated specs by hand for quality.
  6. Create one task for the smallest useful vertical slice.
  7. Type /trellis:continue repeatedly to drive the task to completion — Trellis routes through check / update-spec / finish per workflow.md.
  8. Run /trellis:finish-work to archive the task and record the session journal.

1.4 Done means

  • A new developer can read the first task PRD and understand what is in scope.
  • The repo has runnable validation commands.
  • The first specs describe decisions already made, not speculative architecture.
  • The session journal records why the stack and project shape were chosen.

2. Adopt an existing project

Use this when the codebase already has real behavior, but conventions live in old PRs, reviewer habits, scattered docs, or senior engineers’ memory.

2.1 Example situation

You inherit a three-year-old SaaS repo. There are many patterns for API routes, permissions, and forms. AI can make local changes, but it often misses project-specific details.

2.2 Starting prompt

2.3 Workflow

  1. Run trellis init — it writes the default spec templates and auto-creates a 00-bootstrap-guidelines task that drives the rest of this scenario.
  2. Inside the bootstrap task, walk the AI through the project context and have it scan the repo to extract actual patterns (API routes, auth checks, logging, tests, frontend forms, etc.), filling those findings into the default spec templates.
  3. Optional: use the bundled trellis-spec-bootstarp skill to draft first-pass specs from the real codebase, then review the output by hand. Trellis installs this bundled skill automatically.
  4. Ask the AI to cite file paths for every convention it writes.
  5. Review the specs like code. Delete rules that cannot be traced to real examples.
  6. Pick one pilot feature or bug fix.
  7. Run the pilot task and check whether the specs reduce repeated prompting.

2.4 Guardrails

  • Do not document aspirational standards as if the code already follows them.
  • Do not fill every template. False rules are more harmful than empty placeholders.

2.5 What a good spec looks like

Drawn from the trellis-update-spec skill’s writing principles:
  • Specific: cite real file paths and real code from the project — not vacuous slogans like “code should be clean and consistent”.
  • Explain why: state the concrete real-world purpose of the rule.
  • Show types: API signatures, field types, env vars, and error types spelled out.
  • Low coupling: each spec file covers a single topic; the spec library itself should be high-cohesion / low-coupling.
Examples:

2.6 Done means

  • The first specs cite real source files.
  • The pilot task needs fewer reminders about local patterns.
  • Reviewers can point to .trellis/spec/ instead of re-explaining conventions.

3. Ship a product feature

Use this when a feature crosses multiple layers: product behavior, UI state, API contracts, database changes, permissions, tests, and release notes.

3.1 Example situation

You need to add team invitations. The feature touches workspace permissions, invitation emails, API routes, database tables, frontend forms, and edge cases such as expired invites.

3.2 Starting prompt

3.3 PRD shape

3.4 Task and subtask split

The Trellis task is the feature boundary: one PRD, one implementation context, one check context, and one final reviewable diff.
Inside that task, split the work into bounded subtasks so agents can work in parallel without losing the shared product context: Keep these subtasks under the same Trellis task when they must ship together. Split a separate Trellis task only when the work has its own scope and release boundary, such as bulk CSV import, SSO provisioning, or role templates.

3.5 Workflow

  1. User describes the feature in natural language; answers clarifying questions and confirms scope as planning progresses → AI classifies the request and asks for Trellis task creation. After the user agrees, AI loads trellis-brainstorm, inspects relevant code/docs before asking repo-answerable questions, creates the task (task.py create), and captures clarified Goal / In scope / Out of scope / Acceptance criteria into prd.md (Phase 1.1).
  2. AI configures implement.jsonl / check.jsonl with the specs the task touches (Phase 1.3).
  3. User types /trellis:continueAI dispatches trellis-implement and builds the smallest end-to-end slice against the PRD (Phase 2.1).
  4. User types /trellis:continueAI dispatches trellis-check, reviewing cross-layer contracts via check.jsonl (UI input, API validation, database writes, email side effects, permission-failure paths) and fixing issues in place (Phase 2.2).
  5. User types /trellis:continueAI advances to Phase 3, checks whether the task produced any new reusable specs, and triggers trellis-update-spec to update .trellis/spec/ if it did.
  6. User types /trellis:finish-workAI archives the task and records the session journal.

4. Refactor a legacy module

Use this when code works but is hard to change. A Trellis refactor task should be behavior-preserving by default.

4.1 Example situation

src/billing/invoice-service.ts has grown to 1,200 lines. It calculates invoices, applies discounts, calls payment APIs, writes audit logs, and formats email content. You need to split it without changing billing behavior.

4.2 Starting prompt

4.3 Workflow

  1. User describes which module to refactor and which behaviors must not change in natural language; confirms the invariant list and extraction order during planning → AI classifies the request and asks for Trellis task creation. After the user agrees, AI loads trellis-brainstorm, inspects current responsibilities, callers, side effects, and existing test coverage, creates the task (task.py create), and records the discussion outcomes into prd.md (Phase 1.1).
  2. User spells out the “behavior must not change” contracts directly in the PRD (see 4.4 Refactor invariants); AI may draft, user must hand-review.
  3. AI configures implement.jsonl (caller paths, existing tests, relevant specs) and check.jsonl (behavior contracts, reviewer concerns) → User confirms (Phase 1.3).
  4. User (or AI-assisted) adds or confirms characterization tests and gets the baseline green before any extraction.
  5. User types /trellis:continueAI trellis-implement extracts one responsibility per round; public interfaces stay stable by default (Phase 2.1).
  6. User types /trellis:continueAI trellis-check runs the tests; failures trigger Phase 2.3 rollback of the current extraction.
  7. Repeat 5-6 once per responsibility; user reviews each round’s diff.
  8. User types /trellis:continueAI triggers trellis-update-spec to record the new module boundaries → User confirms which entries are long-term rules.
  9. User types /trellis:finish-workAI archives the task and records the session journal.

4.4 Refactor invariants

Put invariants directly in the PRD.

5. Fix a recurring bug

Use this when a patch fixes the symptom, but the same bug class is likely to return.

5.1 Example situation

A user reports that Claude Code’s SessionStart hook crashes with TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' on PEP 604 syntax (str | None). Their terminal python3 --version reports 3.11, so the syntax should have worked. The surface fix is to swap PEP 604 for Optional[str] or add from __future__ import annotations; the root cause is that AI-CLI hook subprocesses run with a minimal PATH that resolves python3 to system /usr/bin/python3 (3.9 on macOS), not the user’s shell-configured 3.11.

5.2 Starting prompt

5.3 Workflow

  1. User describes the bug, the known reproduction path, and the expected behavior in natural language; works with AI to narrow down root-cause hypotheses during planning → AI classifies the request and asks for Trellis task creation. After the user agrees, AI loads trellis-brainstorm, inspects the reproduction context before asking repo-answerable questions, creates the bug-fix task (task.py create), and records reproduction steps, root-cause hypothesis, and regression-test requirement into prd.md (Phase 1.1).
  2. AI configures check.jsonl to reference the relevant specs and testing conventions → User confirms the check context covers the edges that matter (Phase 1.3).
  3. User types /trellis:continueAI trellis-implement ships the smallest safe fix and adds the regression test before any broader cleanup (Phase 2.1).
  4. User types /trellis:continue and hand-reviews whether the patch actually addresses the reported behavior → AI trellis-check runs the tests; the regression test must pass with the patch and fail without it (Phase 2.2).
  5. User types /trellis:continueAI runs trellis-break-loop for root-cause analysis (Phase 3.2) → User confirms whether the conclusion really prevents recurrence.
  6. User types /trellis:continueAI routes the prevention into a spec, test helper, or checklist via trellis-update-specUser confirms whether each item is a long-term rule (Phase 3.3).
  7. User types /trellis:finish-workAI archives the task and records the session journal.

5.4 Done means

  • The patch fixes the reported behavior.
  • A regression test fails without the fix.
  • The root cause is documented.
  • A prevention mechanism exists outside the chat transcript.

6. Reduce repeated review feedback

Use this when reviewers keep writing the same comments: missing loading states, inconsistent errors, no regression tests, unsafe SQL, custom date formatting, or new helpers that duplicate existing utilities.

6.1 Starting prompt

6.2 Convert feedback into specs

6.3 Workflow

  1. User describes which PR feedback is worth capturing in natural language (pasting PR links or the comment list); groups the feedback with AI by engineering rule during planning → AI classifies the request and asks for Trellis task creation. After the user agrees, AI loads trellis-brainstorm, inspects the supplied feedback before asking repo-answerable questions, creates the spec-tightening task (task.py create), and records the target review patterns, scope, and acceptance criteria into prd.md (Phase 1.1).
  2. User collects repeated feedback from real PRs, groups it by engineering rule (one spec file per group), and pastes the grouping into the PRD.
  3. User types /trellis:continueAI trellis-update-spec adds each short rule to the most relevant spec file with a good/bad code example → User reviews wording for accuracy.
  4. AI wires the updated specs into the next development task’s check.jsonl so trellis-check can verify the rules catch issues.
  5. User runs a real task or two and observes which rules failed to catch issues or created noise → AI removes or rewrites those rules via trellis-update-spec.
  6. User types /trellis:finish-workAI archives the spec-tightening task and records the session journal.

7. Roll out to a team

Use this when Trellis adoption involves multiple developers, repos, or AI tools.

7.1 Example situation

A 50-person engineering department has Claude Code power users, Cursor users, and developers experimenting with other AI tools. Leadership wants shared conventions and reviewable AI work without forcing everyone into one IDE.

7.2 Starting prompt

7.3 Rollout phases

7.4 Success metrics

  • New AI sessions need less repeated explanation.
  • PRDs describe scope and out-of-scope work more clearly.
  • Repeated review comments decrease.
  • Teams can switch AI tools without losing conventions.
  • New developers complete a first task without relying on one senior engineer.
  • Bugs that trigger root-cause analysis become specs, tests, or checklist updates.

Pick the smallest next step

If you are unsure which scenario applies, start with one of these:

New repo

Bootstrap a small spec set and one foundation task.

Existing repo

Extract conventions from current code before changing behavior.

Refactor

Define invariants, tests, and module boundaries before editing.

Team rollout

Pilot Trellis in one repo before expanding usage.