trellis-update-spec
Skill này làm gì
Skill ghi lại những gì bạn học được khi làm việc vào tài liệu spec của dự án. Dành cho nhóm muốn các phiên sau bắt đầu với những bài học đó.
Khi nào nên dùng
- ✓Khi bạn hoàn thành một tác vụ hoặc sửa một lỗi và học được điều gì đáng giữ lại.
- ✓Khi bạn phát hiện một mẫu hoặc quy ước mới trong codebase.
- ✓Khi một thay đổi chạm vào lệnh, API, cơ sở dữ liệu hoặc tích hợp và hợp đồng của nó cần được ghi lại.
Liên kết skill
https://github.com/mindfold-ai/Trellis/blob/main/.agents/skills/trellis-update-spec/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chúng ta vừa thay đổi API upload. Hãy cập nhật spec để công việc sau này tuân theo hợp đồng mới.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent tìm file spec khớp với bài học và viết một mục cụ thể gồm chữ ký hàm, hợp đồng, bảng lỗi và xác thực, ví dụ đúng và sai, cùng các test cần kiểm tra. Nó giữ spec cụ thể thay vì chỉ có các nguyên tắc chung.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 |
Câu hỏi thường gặp
Code-spec là gì?
Một spec chứa chữ ký, trường dữ liệu và hành vi lỗi cụ thể có thể kiểm thử, không chỉ các nguyên tắc chung.
Khi nào bắt buộc dùng định dạng sâu hơn?
Skill yêu cầu nó khi thay đổi lệnh, hợp đồng API, schema cơ sở dữ liệu hoặc tích hợp hạ tầng.
Có những phần nào?
Phạm vi, chữ ký, hợp đồng, bảng xác thực và lỗi, ví dụ đúng và sai so với cách làm đúng, và các test cần có.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 15k
- Vị trí xếp hạng
- #11035
- Giấy phép
- AGPL-3.0
- Cập nhật
- 29/9/2026
Bình luận
- …
Thêm skill từ kho mã này
first-principles-thinking
15kGiúp agent kiểm tra kế hoạch hoặc thiết kế bằng cách chia nó thành sự thật cơ bản và suy luận từ đó, thay vì dựa vào thói quen hay quy ước.
python-design
15kGiúp agent viết và review script dòng lệnh Python với module rõ ràng, giao diện đơn giản và ít sự phức tạp ẩn.
trellis-before-dev
15kGiúp agent đọc các hướng dẫn viết code và ghi chú công việc của dự án trước khi bắt đầu viết code, để nó làm theo quy ước của nhóm.
trellis-brainstorm
15kGiúp agent làm rõ một tính năng mới hoặc tác vụ chưa rõ bằng cách hỏi một câu hữu ích mỗi lần, kiểm tra code và thống nhất phạm vi hẹp.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.