用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/yreidev/fluxseek --skill trellis-update-spec命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
实现开始前,从 .trellis/spec/ 发现并注入项目特定编码指南。读取目标 package 的 spec indexes、开发前检查清单和共享思考指南。开始新编码 task、写任何代码前、切换到不同 package 或需要刷新项目约定与标准时使用。
实现前引导协作式需求发现。创建 task 目录、初始化 PRD、一次提出一个高价值问题、研究技术选择,并收敛到 MVP scope。当需求不清晰、存在多种有效方案,或用户描述新功能/复杂 task 时使用。
深度 bug 分析,用于打破修复-遗忘-重复循环。分析 root cause 分类、fixes 失败原因、预防机制,并将知识捕获到 specs。修复 bug 后用于防止同类 bug。
基于 SOC 职业分类
正在显示 SKILL.md
| name | trellis-update-spec |
| description | 将可执行契约和编码约定捕获到 .trellis/spec/ 文档中。当你从 debugging、implementing 或讨论中学到值得为未来 sessions 保留的内容时使用。 |
当你学到有价值的内容(来自 debugging、implementing 或讨论)时,使用此 skill 更新相关 code-spec 文档。
时机:完成 task、修复 bug 或发现新 pattern 后
在本项目中,实现工作的 “spec” 指 code-spec:
如果变更触及 infra 或 cross-layer contracts,必须达到 code-spec 深度。
当变更包含以下任一内容时,应用 code-spec 深度:
对触发的 tasks,包含以下全部 sections:
| 触发 | 示例 | 目标 Spec |
|---|---|---|
| 实现了 feature | 添加新 integration 或 module | 相关 spec file |
| 作出 design decision | 为 extensibility pattern 放弃 simplicity | 相关 spec + "Design Decisions" section |
| 修复了 bug | 发现 error handling 的隐蔽问题 | 相关 spec(例如 error-handling docs) |
| 发现 pattern | 找到更好的 code 组织方式 | 相关 spec file |
| 踩到 gotcha | 学到 X 必须在 Y 前完成 | 相关 spec + "Common Mistakes" section |
| 建立 convention | 团队同意命名 pattern | Quality guidelines |
| 新 thinking trigger | “做 Y 前别忘了检查 X” | guides/*.md(作为 checklist item) |
关键洞察:Code-spec updates 不只是为问题准备。每个 feature implementation 都包含未来 AI/developers 安全执行所需的 design decisions 和 contracts。
.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
| 类型 | 位置 | 目的 | 内容风格 |
|---|---|---|---|
| Code-Spec | <layer>/*.md | 告诉 AI “如何安全实现” | 签名、contracts、matrices、cases、test points |
| Guide | guides/*.md | 帮助 AI “该思考什么” | Checklists、questions、指向 specs 的 pointers |
决策规则:问自己:
guides/示例:
| 学到的内容 | 错误位置 | 正确位置 |
|---|---|---|
| “此 task 使用 API X 而非 API Y” | ❌ guides/(对 thinking guide 太具体) | ✅ 相关 spec file(具体 convention) |
| “做 Y 时记得检查 X” | ❌ Spec file(对 spec 太抽象) | ✅ guides/(thinking checklist) |
Guides 应该是指向 specs 的短 checklists,而不是重复详细规则。
回答这些问题:
| 类型 | 描述 | 动作 |
|---|---|---|
| Design Decision | 为什么选择 approach X 而不是 Y | 添加到 "Design Decisions" section |
| Project Convention | 本项目如何做 X | 添加到相关 section,并带 examples |
| New Pattern | 发现的可复用 approach | 添加到 "Patterns" section |
| Forbidden Pattern | 会引发问题的东西 | 添加到 "Anti-patterns" 或 "Don't" section |
| Common Mistake | 容易犯的错误 | 添加到 "Common Mistakes" section |
| Convention | 已达成一致的标准 | 添加到相关 section |
| Gotcha | 非显而易见的行为 | 添加 warning callout |
编辑前,读取当前 code-spec 以:
cat .trellis/spec/<category>/<file>.md
遵循这些原则:
如果你添加了新 section 或 code-spec status 发生变化,更新该 category 的 index.md。
## Scenario: <name>
### 1. 范围 / 触发
- Trigger: <why this requires code-spec depth>
### 2. 签名
- Backend command/API/DB signature(s)
### 3. 契约
- Request fields (name, type, constraints)
- Response fields (name, type, constraints)
- Environment keys (required/optional)
### 4. 验证与错误矩阵
- <condition> -> <error>
### 5. Good/Base/Bad 案例
- Good: ...
- Base: ...
- Bad: ...
### 6. 必需测试
- Unit/Integration/E2E with assertion points
### 7. 错误 vs 正确
#### Wrong
...
#### Correct
...
### Design Decision: [Decision Name]
**Context**: What problem were we solving?
**Options Considered**:
1. Option A - brief description
2. Option B - brief description
**Decision**: We chose Option X because...
**示例**:
\`\`\`typescript
// How it's implemented
code example
\`\`\`
**Extensibility**: How to extend this in the future...
### Convention: [Convention Name]
**What**: Brief description of the convention.
**Why**: Why we do it this way in this project.
**示例**:
\`\`\`typescript
// How to follow this convention
code example
\`\`\`
**Related**: Links to related conventions or specs.
### Pattern Name
**Problem**: What problem does this solve?
**Solution**: Brief description of the approach.
**示例**:
\`\`\`
// Good
code example
// Bad
code example
\`\`\`
**Why**: Explanation of why this works better.
### Don't: Pattern Name
**Problem**:
\`\`\`
// Don't do this
bad code example
\`\`\`
**Why it's bad**: Explanation of the issue.
**Instead**:
\`\`\`
// Do this instead
good code example
\`\`\`
### 常见错误:说明
**症状**:出现什么问题
**原因**:为什么会发生
**修复**:如何纠正
**预防**:未来如何避免
> **Warning**: Brief description of the non-obvious behavior.
>
> Details about when this happens and how to handle it.
如果你不确定要更新什么,回答这些 prompts:
你刚完成了什么?
你学到或决定了什么?
未来 AI/developers 是否需要知道这件事?
它与哪个 area 相关?
完成 code-spec update 前:
Development Flow:
Learn something → `update-spec` (Trellis command) → Knowledge captured
↑ ↓
`break-loop` (Trellis command) ←──────────────────── Future sessions benefit
(deep bug analysis)
(Trellis command) - 深度分析 bugs,经常揭示需要 spec updates (Trellis command) - 实际执行更新 (Trellis command) - 提醒你检查 specs 是否需要更新Code-specs 是活文档。每次 debugging session、每个 “aha moment” 都是让 implementation contract 更清晰的机会。
目标是组织记忆: