# Trellis Update Spec

Captures executable contracts and coding conventions into .trellis/spec/ documents.

- Repository: https://github.com/mindfold-ai/Trellis (15078 stars)
- Category: Testing
- License: AGPL-3.0
- Last updated: 2026-09-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add mindfold-ai/Trellis --skill trellis-update-spec -g -a claude-code -y`
Codex: `npx skills add mindfold-ai/Trellis --skill trellis-update-spec -g -a codex -y`
Cursor: `npx skills add mindfold-ai/Trellis --skill trellis-update-spec -g -a cursor -y`
Gemini CLI: `npx skills add mindfold-ai/Trellis --skill trellis-update-spec -g -a gemini-cli -y`

## Description

Captures executable contracts and coding conventions into .trellis/spec/ documents. Use when learning something valuable from debugging, implementing, or discussion that should be preserved for future sessions.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Update Code-Spec - Capture Executable Contracts

When you learn something valuable (from debugging, implementing, or discussion), use this to update the relevant code-spec documents.

**Timing**: After completing a task, fixing a bug, or discovering a new pattern

---

## Code-Spec First Rule (CRITICAL)

In this project, "spec" for implementation work means **code-spec**:
- Executable contracts (not principle-only text)
- Concrete signatures, payload fields, env keys, and boundary behavior
- Testable validation/error behavior

If the change touches infra or cross-layer contracts, code-spec depth is mandatory.

### Mandatory Triggers

Apply code-spec depth when the change includes any of:
- New/changed command or API signature
- Cross-layer request/response contract change
- Database schema/migration change
- Infra integration (storage, queue, cache, secrets, env wiring)

### Mandatory Output (7 Sections)

For triggered tasks, include all sections below:
1. Scope / Trigger
2. Signatures (command/API/DB)
3. Contracts (request/response/env)
4. Validation & Error Matrix
5. Good/Base/Bad Cases
6. Tests Required (with assertion points)
7. Wrong vs Correct (at least one pair)

---

## When to Update Code-Specs

The rest: https://github.com/mindfold-ai/Trellis/blob/HEAD/.agents/skills/trellis-update-spec/SKILL.md
