tophtab/nga-just-works/trellis-update-spec
Claude Code and agent skill by tophtab/nga-just-works
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install tophtab/nga-just-works/trellis-update-specSKILL.md
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
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 |
Step 3: Read the Target Code-Spec
Before editing, read the current code-spec to:
- Understand existing structure
- Avoid duplicating content
- Find the right section for your update
Step 4: Make the Update
Follow these principles:
- Be Specific: Include concrete examples, not just abstract rules
- Explain Why: State the problem this prevents
- Show Contracts: Add signatures, payload fields, and error behavior
- Show Code: Add code snippets for key patterns
- Keep it Short: One concept per section
Step 5: Update the Index (if needed)
If you added a new section or the code-spec status changed, update the category's index.md.
Update Templates
Mandatory Template for Infra/Cross-Layer Work
Adding a Design Decision
Adding a Project Convention
Adding a New Pattern
Adding a Forbidden Pattern
Adding a Common Mistake
Adding a Gotcha
Interactive Mode
If you're unsure what to update, answer these prompts:
- What did you just finish?
- [ ] Fixed a bug
- [ ] Implemented a feature
- [ ] Refactored code
- [ ] Had a discussion about approach
- What did you learn or decide?
- Design decision (why X over Y)
- Project convention (how we do X)
- Non-obvious behavior (gotcha)
- Better approach (pattern)
- Would future AI/developers need to know this?
- To understand how the code works → Yes, update spec
- To maintain or extend the feature → Yes, update spec
- To avoid repeating mistakes → Yes, update spec
- Purely one-off implementation detail → Maybe skip
- Which area does it relate to?
- [ ] Backend code
- [ ] Frontend code
- [ ] Cross-layer data flow
- [ ] Code organization/reuse
- [ ] Quality/testing
Quality Checklist
Before finishing your code-spec update:
- [ ] Is the content specific and actionable?
- [ ] Did you include a code example?
- [ ] Did you explain WHY, not just WHAT?
- [ ] Did you include executable signatures/contracts?
- [ ] Did you include validation and error matrix?
- [ ] Did you include Good/Base/Bad cases?
- [ ] Did you include required tests with assertion points?
- [ ] Is it in the right code-spec file?
- [ ] Does it duplicate existing content?
- [ ] Would a new team member understand it?
Relationship to Other Commands
/trellis-break-loop- Analyzes bugs deeply, often reveals spec updates needed/trellis-update-spec- Actually makes the updates/trellis-finish-work- Reminds you to check if specs need updates
Core Philosophy
Code-specs are living documents. Every debugging session, every "aha moment" is an opportunity to make the implementation contract clearer.
The goal is institutional memory:
- What one person learns, everyone benefits from
- What AI learns in one session, persists to future sessions
- Mistakes become documented guardrails
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.grok/skills/trellis-update-spec/SKILL.md
Popularity
- Repository stars
- 64
- Repository forks
- 4
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tophtab/nga-just-works/trellis-update-spec)