trellis-update-spec
What it does
The skill records what you learned while working into the project's spec documents. It is for teams who want future sessions to start with those lessons.
When to use it
- βWhen you finish a task or fix a bug and learned something worth keeping.
- βWhen you discover a new pattern or convention in the codebase.
- βWhen a change touches a command, API, database, or integration and its contract should be documented.
Skill link
https://github.com/mindfold-ai/Trellis/blob/main/.agents/skills/trellis-update-spec/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βWe just changed the upload API. Update the spec so future work follows the new contract.β
5 new skills a week. 1 minute to read.
How it works
The agent finds the spec file that matches the lesson and writes a concrete entry with signatures, contracts, error cases, examples, and tests to check. It keeps the spec specific rather than limited to general principles.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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:
- Scope / Trigger
- Signatures (command/API/DB)
- Contracts (request/response/env)
- Validation & Error Matrix
- Good/Base/Bad Cases
- Tests Required (with assertion points)
- Wrong vs Correct (at least one pair)
When to Update Code-Specs
| Trigger | Example | Target Spec |
|---|---|---|
| Implemented a feature | Added a new integration or module | Relevant spec file |
| Made a design decision | Chose extensibility pattern over simplicity | Relevant spec + "Design Decisions" section |
| Fixed a bug | Found a subtle issue with error handling | Relevant spec (e.g., error-handling docs) |
| Discovered a pattern | Found a better way to structure code | Relevant spec file |
| Hit a gotcha | Learned that X must be done before Y | Relevant spec + "Common Mistakes" section |
| Established a convention | Team agreed on naming pattern | Quality guidelines |
| New thinking trigger | "Don't forget to check X before doing Y" | guides/*.md (as a checklist item) |
Key Insight: Code-spec updates are NOT just for problems. Every feature implementation contains design decisions and contracts that future AI/developers need to execute safely.
Spec Structure Overview
.trellis/spec/
βββ <layer>/ # Per-layer coding standards (e.g., backend/, frontend/, api/)
β βββ index.md # Overview and links
β βββ *.md # Topic-specific guidelines
βββ guides/ # Thinking checklists (NOT coding specs!)
βββ index.md # Guide index
βββ *.md # Topic-specific guides
CRITICAL: Code-Spec vs Guide - Know the Difference
| Type | Location | Purpose | Content Style |
|---|---|---|---|
| Code-Spec | <layer>/*.md |
Tell AI "how to implement safely" | Signatures, contracts, matrices, cases, test points |
| Guide | guides/*.md |
Help AI "what to think about" | Checklists, questions, pointers to specs |
Decision Rule: Ask yourself:
- "This is how to write the code" β Put in a spec layer directory
- "This is what to consider before writing" β Put in
guides/
Example:
| Learning | Wrong Location | Correct Location |
|---|---|---|
| "Use API X not API Y for this task" | β guides/ (too specific for a thinking guide) |
β Relevant spec file (concrete convention) |
| "Remember to check X when doing Y" | β Spec file (too abstract for a spec) | β
guides/ (thinking checklist) |
Guides should be short checklists that point to specs, not duplicate the detailed rules.
Update Process
Step 1: Identify What You Learned
Answer these questions:
- What did you learn? (Be specific)
- Why is it important? (What problem does it prevent?)
- Where does it belong? (Which spec file?)
Step 2: Classify the Update Type
| Type | Description | Action |
|---|---|---|
| Design Decision | Why we chose approach X over Y | Add to "Design Decisions" section |
| Project Convention | How we do X in this project | Add to relevant section with examples |
| New Pattern | A reusable approach discovered | Add to "Patterns" section |
| Forbidden Pattern | Something that causes problems | Add to "Anti-patterns" or "Don't" section |
| Common Mistake | Easy-to-make error | Add to "Common Mistakes" section |
| Convention | Agreed-upon standard | Add to relevant section |
| Gotcha | Non-obvious behavior | Add warning callout |
FAQ
What is a code-spec?
A spec that holds concrete signatures, data fields, and error behavior that can be tested, not only general principles.
When is the deeper format required?
The skill requires it for changes to commands, API contracts, database schemas, or infrastructure integrations.
What sections does it include?
Scope, signatures, contracts, a validation and error table, good and bad cases, required tests, and a wrong-versus-correct example.
Details
Original description by the author
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.
repo: mindfold-ai/Trellis
Popularity
- GitHub stars
- 15k
- Ranking position
- #11035
- License
- AGPL-3.0
- Updated
- 9/29/2026
Comments
- β¦
More skills from this repository
first-principles-thinking
15kHelps your agent test a plan or design by breaking it into basic truths and reasoning up from them, instead of relying on habit or convention.
python-design
15kHelps your agent write and review Python command-line scripts with clear modules, simple interfaces, and fewer hidden complications.
trellis-before-dev
15kHelps your agent read the project's coding guidelines and task notes before it starts writing code, so it follows the team's conventions.
trellis-brainstorm
15kHelps your agent clarify a new feature or unclear task by asking one useful question at a time, checking the code, and agreeing on a narrow scope.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.