trellis-update-spec
できること
このスキルは、作業中に分かったことをプロジェクトの仕様文書に記録します。今後のセッションがその知見から始められるようにしたいチーム向けです。
使う場面
- ✓タスクを終えたとき、またはバグを直し、残す価値のある知見を得たとき。
- ✓コードベースで新しいパターンや規約を見つけたとき。
- ✓コマンド、API、データベース、外部連携の変更があり、その契約を文書化する必要があるとき。
スキルのリンク
https://github.com/mindfold-ai/Trellis/blob/main/.agents/skills/trellis-update-spec/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“アップロードAPIを変更したところです。今後の作業が新しい契約に従うよう、仕様を更新してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、その知見に対応する仕様ファイルを探し、シグネチャ、契約、エラーケース、例、確認すべきテストを含む具体的な項目を書きます。一般的な原則だけでなく、具体的な内容に保ちます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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 |
よくある質問
コード仕様とは何ですか?
一般的な原則だけでなく、テストできる具体的なシグネチャ、データ項目、エラーの動作を記した仕様です。
より詳しい形式はいつ必要ですか?
コマンド、APIの契約、データベースのスキーマ、インフラ連携を変更する場合に、このスキルが必要とします。
どのセクションを含みますか?
範囲、シグネチャ、契約、検証とエラーの表、良い例と悪い例、必要なテスト、誤りと正しい例の比較です。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 15k
- ランキング
- #11035
- ライセンス
- AGPL-3.0
- 更新日
- 2026/9/29
コメント
- …
このリポジトリの他のスキル
first-principles-thinking
15k計画や設計を基本的な真理に分解し、そこから積み上げて検討することで、慣習や習慣に頼らずに、それが本当に最良の方法かを確かめるよう、エージェントを手助けします。
python-design
15k明確なモジュール、単純なインターフェース、隠れた複雑さの少ないPythonのコマンドラインスクリプトを、エージェントが書きレビューするのを手助けします。
trellis-before-dev
15k書き始める前に、プロジェクトのコーディングのガイドラインとタスクのメモを読み、エージェントがチームの慣例に従うよう手助けします。
trellis-brainstorm
15k新しい機能や不明確なタスクを、一度に一つの有益な質問をし、コードを確認し、狭いスコープに合意することで、明確にする手助けをします。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。