/p8-engine-plugin:specfrom p8-engine-plugin
Creates a Chinese design document (spec) before code changes to make decisions explicit. Automatically activates when adding features, refactoring, or fixing non-trivial bugs.
Ships in p8-engine-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
直接跳进代码改会让用户失去决策点。Spec 的本质是把决策从隐式变成显式—— 让用户在动代码之前,先看到「我们要解决什么问题、怎么解决、改哪些文件、 验收标准是什么」,然后点头或调整。
写 spec 不是为了仪式感,而是为了:
触发(满足任一):
不触发:
边界模糊时,默认触发——写一份薄 spec 比跳过 spec 便宜。
第一次在本项目触发 spec skill 时,specs/ 目录可能还没建。先检查、缺什么补什么,再进入第 1 步。
检查(用 Glob 模式 specs/** 或 Bash ls specs/):
specs/ 目录存在specs/features/、specs/refactors/、specs/bugfixes/ 三个 bucket 都存在specs/README.md 存在bootstrap 动作(缺什么做什么,全有就跳过本步骤):
| 缺什么 | 做什么 |
|---|---|
specs/ 或某个 bucket 目录 | 创建缺失的目录;每个 bucket 加 .gitkeep 占位(空目录才能进 git) |
specs/README.md | 从 .claude/skills/spec/assets/spec-readme.md 复制到 specs/README.md |
复制 README 后必须做一次项目适配:
<!-- TODO --> 标注的位置package.json 的 scripts 字段(或 Makefile / Cargo.toml / pyproject.toml 等本项目实际用的构建配置)注意:bootstrap 完成后直接进入第 1 步分类——不要为 bootstrap 单独暂停。用户注意力应集中在即将写的 spec 内容上。
判断本次改动属于哪一类:
| 类别 | 目录 | 判定 |
|---|---|---|
| feature | specs/features/ | 新增用户可感知的能力 |
| refactor | specs/refactors/ | 不改外部行为的内部改造 |
| bugfix | specs/bugfixes/ | 修复已有功能异常 |
选一个 kebab-case 主题名,简短、描述性。例如:
cowork-session-persistencego-backend-graceful-shutdownreact-window-resize-fix如果改动跨多个主题,拆成多个 spec,不要一份 spec 包揽。
路径模板:
specs/<bucket>/<topic>/<YYYY-MM-DD>-<topic>-design.md
<YYYY-MM-DD> 用今天日期(不要用 commit 日期)specs/<bucket>/ 已就绪如果 <topic>/ 目录已存在旧版 spec:
完整模板(章节可按内容增减,但「概述」「验收标准」必须有):
# <主题>设计文档
## 1. 概述
### 1.1 问题 / 背景
<!-- 为什么要做这件事?现状哪里不够好?引用具体的用户反馈、报错日志、性能数据 -->
### 1.2 目标
<!-- 做完之后,世界应该变成什么样。用 1-3 句话讲清楚 -->
### 1.3 非目标(可选)
<!-- 明确不做什么,防止范围蔓延 -->
## 2. 用户场景
### 场景 1: <场景标题>
**Given** 初始状态...
**When** 用户/系统做了某动作...
**Then** 预期结果...
### 场景 2: ...
## 3. 功能需求
### FR-1: <需求标题>
<具体要求>
### FR-2: ...
## 4. 实现方案
### 4.1 <模块 / 步骤>
<!-- 关键设计决策、伪代码、接口签名、数据结构 -->
### 4.2 <...>
## 5. 边界情况
| 场景 | 处理方式 |
|------|---------|
| 用户中断操作 | ... |
| 网络断开 | ... |
| 跨平台差异(Win/Mac/Linux) | ... |
## 6. 涉及文件
| 文件 | 变更说明 |
|------|---------|
| `src/main/xxx.ts` | 新增 YYY 函数 |
| `frontend/src/...` | 修改 ZZZ 组件 |
## 7. 验收标准
- [ ] 场景 1 的 Given/When/Then 通过
- [ ] 通过 oxlint + prettier
- [ ] 通过 `npm test`
- [ ] 通过 `npm run test:go`(如涉及后端)
- [ ] 通过手动验证:...
填充原则:
在写任何业务代码之前,把 spec 内容展示给用户,明确询问:
「这份 spec 看起来对吗?需要调整哪里?确认无误后我开始实现。」
如果用户要求改动,改 spec,再确认。不要在脑子里改了之后跳过这一步。
只有用户明确说「OK / 开始 / 确认 / go」之类,才能进入第 5 步。
AGENTS.md(lint / i18n / 共享常量 / commit 规范)实现完成后:
npm run check(lint + format + test + test:go)specs/README.md(如存在):目录/命名规则的权威说明AGENTS.md(项目根):代码层面的规范.github/PULL_REQUEST_TEMPLATE.md(如存在):PR 模板What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub darven-cs/p8-engine --plugin p8-engine3 skills in this plugin
/inject-memoryInject lightweight AI memory system into any project. Creates memory/ directory with structured templates, appends memory usage rules to CLAUDE.md, configures PostToolUse hook for auto-syncing index timestamps, and performs atomic git commit. Trigger on: /inject-memory, 'inject memory', 'init memory', 'set up AI memory', '给这个项目加记忆系统', '注入记忆系统'./p8-engineEngineering methodology skill for all tasks. Core behaviors: clarify before assuming, investigate before asking, verify before delivering, review full dependency chains, match existing code style. Trigger on: any task start, code development, debugging, multi-step work. Do NOT skip just because the task looks easy.Other plugins' skills for the same job