project-fix
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseproject-fix
project-fix
Implements the corrections found by /project-audit. Reads audit-report.md as a spec and executes each required action.
Triggers: , apply audit corrections, fix claude project, implement audit
/project-fix执行/project-audit工具发现的修正内容。读取audit-report.md作为规范并执行每项必要操作。
触发方式:、应用审计修正、修复Claude项目、执行审计修正
/project-fixRole in the SDD meta-configuration flow
在SDD元配置流程中的角色
This skill is the equivalent of the APPLY phase of the SDD cycle, applied to project configuration:
/project-audit → audit-report.md → /project-fix → /project-audit (verify)
(spec) (artifact) (apply) (verify)The generated by is the INPUT of this skill. Without that artifact, this skill cannot operate.
audit-report.md/project-auditAbsolute rule: This skill NEVER invents corrections. It only implements what is in from audit-report.md.
FIX_MANIFEST本技能相当于SDD周期中的APPLY阶段,应用于项目配置:
/project-audit → audit-report.md → /project-fix → /project-audit (验证)
(规范) (产物) (应用) (验证)由生成的是本技能的输入。没有该产物,本技能无法运行。
/project-auditaudit-report.md绝对规则:本技能绝不会自行发明修正内容,仅执行audit-report.md中里的内容。
FIX_MANIFESTPrerequisite: audit-report.md
前置条件:audit-report.md
Before anything else, I verify that exists.
.claude/audit-report.mdIf it does NOT exist:
❌ .claude/audit-report.md not found
This skill requires /project-audit to have been run first.
The audit report is the specification I implement.
Please run: /project-auditIf it exists but is more than 7 days old:
⚠️ The audit-report.md is [N] days old (generated: [date])
Options:
1. Use the existing report anyway (may be outdated)
2. Run /project-audit first for a fresh diagnosis
How would you like to proceed?在执行任何操作前,我会先验证是否存在。
.claude/audit-report.md如果该文件不存在:
❌ .claude/audit-report.md 未找到
本技能需要先运行/project-audit。
审计报告是我执行操作的规范依据。
请运行:/project-audit如果文件存在但已超过7天:
⚠️ audit-report.md 已过期[N]天(生成时间:[日期])
选项:
1. 仍使用现有报告(可能已过时)
2. 先运行/project-audit获取最新诊断结果
您希望如何操作?Execution Model
执行模型
project-fix| Stage | Responsibility | Output |
|---|---|---|
| Manifest intake | Read and validate | Parsed action lists, readiness to execute |
| Phase execution | Apply the permitted actions in severity and phase order | Created files, modified files, skip/failure outcomes |
| Final reporting | Record the run and present the resulting state | |
The execution model is intentionally stable. Detailed handlers may evolve, but the command remains: intake, execute, report.
project-fix| 阶段 | 职责 | 输出 |
|---|---|---|
| 清单导入 | 读取并验证 | 解析后的操作列表、执行就绪状态 |
| 阶段执行 | 按严重程度和阶段顺序执行允许的操作 | 创建的文件、修改的文件、跳过/失败结果 |
| 最终报告 | 记录运行情况并展示最终状态 | |
执行模型设计为稳定可靠。具体处理逻辑可能会演进,但核心命令始终是:导入、执行、报告。
Action Classes
操作类别
project-fix| Class | Typical examples | Side effects | Confirmation model |
|---|---|---|---|
| Automatic actions | create missing files, append missing sections, add safe markers | Yes | Executed inside the approved phase flow |
| Guided actions | delete duplicate local skills, optional phase execution decisions | Yes | Explicit confirmation required |
| Informational actions | | No automatic side effects | Report only |
Notes:
- The class is more important than the specific handler name. Handlers are implementations of one of these three behavior types.
- Informational actions may still be important, but they never acquire automatic mutation behavior just because they appear in the manifest.
project-fix| 类别 | 典型示例 | 副作用 | 确认机制 |
|---|---|---|---|
| 自动操作 | 创建缺失文件、追加缺失章节、添加安全标记 | 有 | 在已批准的阶段流程中自动执行 |
| 引导式操作 | 删除重复的本地技能、可选阶段执行决策 | 有 | 需要明确的用户确认 |
| 信息类操作 | | 无自动副作用 | 仅进行报告 |
注意事项:
- 操作类别比具体处理程序名称更重要。处理程序是这三类行为类型的具体实现。
- 信息类操作可能仍然很重要,但绝不会因为出现在清单中就自动获得修改权限。
Compatibility Policy
兼容性政策
Compatibility behavior is a separate policy layer of , not an implicit side effect of individual handlers.
project-fixCompatibility rules currently include:
- Stale-manifest compatibility: if an older audit report contains deprecated action types, the command preserves safety first and avoids speculative edits.
- Deprecated mechanism compatibility: any action that targets is skipped because commands/ is deprecated.
.claude/commands/ - Two-tier placement compatibility: remains informational only; no automated writes to
move-to-globalare allowed.~/.claude/skills/ - Unknown-action compatibility: unsupported or unknown action types are downgraded to skip-or-recommendation behavior, never automatic mutation.
This policy MUST be explicit whenever compatibility behavior affects whether an action is executed.
兼容性行为是的独立政策层,并非单个处理程序的隐式副作用。
project-fix当前的兼容性规则包括:
- 过时清单兼容性:如果旧版审计报告包含已弃用的操作类型,命令会优先保障安全,避免推测性编辑。
- 已弃用机制兼容性:任何针对的操作都会被跳过,因为commands/已被弃用。
.claude/commands/ - 双层放置兼容性:仅作为信息类操作;不允许自动写入
move-to-global。~/.claude/skills/ - 未知操作兼容性:不支持或未知的操作类型会降级为跳过或建议行为,绝不会自动执行修改。
当兼容性行为影响操作是否执行时,必须明确说明。
Process
流程
Step 1 — Read and parse the FIX_MANIFEST
步骤1 — 读取并解析FIX_MANIFEST
I read the block from . I extract:
FIX_MANIFESTaudit-report.mdrequired_actions.critical[]required_actions.high[]required_actions.medium[]required_actions.low[]missing_global_skills[]orphaned_changes[]violations[]- (Dimension 9 — may be absent if D9 was skipped)
skill_quality_actions[]
I normalize the parsed items into action classes:
- Automatic: safe file creation or additive update actions described by the manifest
- Guided: destructive or user-choice actions that require explicit confirmation before side effects
- Informational: recommendation-only, deprecated, or unknown action types that must not execute automatically
If an action type is deprecated, unsupported, or unknown:
- I do NOT execute it automatically
- I report it as or
skippedrecommendation only - I preserve the rest of the fix run
I present the user a summary of what I am going to do:
📋 Fix Plan — [Project Name]
Based on audit from [date]
Current score: [XX]/100
Actions to execute:
❌ Critical : [N] actions
⚠️ High : [N] actions
ℹ️ Medium : [N] actions
💡 Low : [N] actions (optional)
Execute all corrections? (critical + high + medium)
S → Execute all recommended
C → Critical only (minimum for functional SDD)
R → Review one by one
N → CancelI wait for the user's response before continuing.
我会读取audit-report.md中的块,提取以下内容:
FIX_MANIFESTrequired_actions.critical[]required_actions.high[]required_actions.medium[]required_actions.low[]missing_global_skills[]orphaned_changes[]violations[]- (维度9 — 如果跳过D9则不存在)
skill_quality_actions[]
我会将解析后的条目归类为操作类别:
- 自动操作:清单中描述的安全文件创建或增量更新操作
- 引导式操作:破坏性或需要用户选择的操作,执行前需明确确认
- 信息类操作:仅建议、已弃用或未知的操作类型,绝不会自动执行
如果操作类型已弃用、不支持或未知:
- 我不会自动执行
- 会将其标记为或
已跳过仅建议 - 继续执行其他修复操作
我会向用户展示即将执行的操作摘要:
📋 修复计划 — [项目名称]
基于[日期]的审计结果
当前得分:[XX]/100
待执行操作:
❌ 严重 : [N] 项
⚠️ 高优先级 : [N] 项
ℹ️ 中优先级 : [N] 项
💡 低优先级 : [N] 项(可选)
是否执行所有修正?(严重 + 高优先级 + 中优先级)
S → 执行所有推荐操作
C → 仅执行严重级别(SDD可用的最低要求)
R → 逐项审核
N → 取消我会等待用户回复后再继续。
Step 2 — Execute by phases
步骤2 — 分阶段执行
I process actions in order of severity. Each phase has a checkpoint.
我会按严重程度顺序处理操作,每个阶段都有检查点。
Phase 1 — Critical Corrections (block SDD)
阶段1 — 严重修正(阻碍SDD运行)
Mode detection (run once):
Check if Engram MCP is reachable () → if yes: active mode = ; if no: active mode = .
mem_contextengramnoneI execute in this order:
1.1 Create missing global SDD skills
yaml
type: install_skill
target: "[skill-name]"If any global SDD skill is missing from , I notify the user — I cannot create them automatically, but I indicate exactly what is missing and where they should be.
~/.claude/skills/1.2 Update CLAUDE.md — add SDD section
yaml
type: update_file
target: .claude/CLAUDE.md
section: sdd_sectionIf CLAUDE.md does not mention , I add this section at the end of CLAUDE.md:
/sdd-*markdown
undefined模式检测(仅运行一次):
检查Engram MCP是否可达()→ 如果可达:激活模式 = ;如果不可达:激活模式 = 。
mem_contextengramnone我会按以下顺序执行:
1.1 创建缺失的全局SDD技能
yaml
type: install_skill
target: "[技能名称]"如果中缺失任何全局SDD技能,我会通知用户 — 我无法自动创建它们,但会明确指出缺失的技能及其安装位置。
~/.claude/skills/1.2 更新CLAUDE.md — 添加SDD章节
yaml
type: update_file
target: .claude/CLAUDE.md
section: sdd_section如果CLAUDE.md未提及命令,我会在CLAUDE.md末尾添加以下章节:
/sdd-*markdown
undefinedSDD — Spec-Driven Development
SDD — 规范驱动开发
This project uses SDD. Artifacts are persisted to Engram.
| Command | Action |
|---|---|
| Explore without committing to changes |
| Create a change proposal |
| Implement the task plan |
| Validate implementation against specs |
| View status of active changes |
Multi-phase flows (explore → propose → spec+design → tasks, or the full cycle) are handled by the orchestrator as meta-commands — type them directly in conversation, they do not appear as skills.
Full flow: explore → propose → spec + design → tasks → apply → verify → archive
**Checkpoint**: I present the critical actions executed and ask for confirmation to continue with high-priority ones.
---本项目使用SDD。产物将持久化到Engram。
| 命令 | 操作 |
|---|---|
| 探索项目但不提交变更 |
| 创建变更提案 |
| 执行任务计划 |
| 根据规范验证实现效果 |
| 查看活跃变更的状态 |
多阶段流程(探索 → 提案 → 规范+设计 → 任务,或完整周期)由编排器作为元命令处理 — 直接在对话中输入即可,不会作为技能显示。
完整流程:探索 → 提案 → 规范 + 设计 → 任务 → 应用 → 验证 → 归档
**检查点**:我会展示已执行的严重操作,并请求用户确认是否继续执行高优先级操作。
---Phase 2 — High Corrections (degrade quality)
阶段2 — 高优先级修正(影响质量)
2.1 Create missing memory files
yaml
type: create_file
target: ai-context/[file].md
template: [stack|architecture|conventions|known-issues|changelog-ai]For each missing file, I generate real content based on what I can detect from the project:
- stack.md: I read /
package.json, generate dependency table with real versionspyproject.toml - architecture.md: I read folder structure and config files, document the detected pattern
- conventions.md: I read 3-5 existing code files, infer and document real conventions
- known-issues.md: Start with a "Production Safety Rules" section and leave structure to be filled
- changelog-ai.md: Create with initial entry documenting this fix
2.2 Update stack in CLAUDE.md
yaml
type: update_file
target: .claude/CLAUDE.md
section: tech_stackIf the declared versions do not match package.json, I update the Tech Stack table with the real values.
2.3 Fix Skills registry
yaml
type: add_registry_entry / remove_registry_entry
target: .claude/CLAUDE.md
section: skills_registry- Add to the registry the skills that are on disk but not listed
- Mark as the skills listed but without a file (do not remove them, inform)
[MISSING FILE]
Checkpoint: I present high-priority actions executed. I ask for confirmation to continue with medium-priority ones.
2.1 创建缺失的内存文件
yaml
type: create_file
target: ai-context/[文件].md
template: [stack|architecture|conventions|known-issues|changelog-ai]对于每个缺失的文件,我会根据项目检测到的内容生成真实内容:
- stack.md:读取/
package.json,生成包含真实版本的依赖表pyproject.toml - architecture.md:读取文件夹结构和配置文件,记录检测到的架构模式
- conventions.md:读取3-5个现有代码文件,推断并记录真实的编码规范
- known-issues.md:以“生产安全规则”章节开头,预留后续填充的结构
- changelog-ai.md:创建文件并添加记录本次修复的初始条目
2.2 更新CLAUDE.md中的技术栈
yaml
type: update_file
target: .claude/CLAUDE.md
section: tech_stack如果声明的版本与package.json不符,我会更新技术栈表格中的真实版本值。
2.3 修复技能注册表
yaml
type: add_registry_entry / remove_registry_entry
target: .claude/CLAUDE.md
section: skills_registry- 将磁盘上存在但未列出的技能添加到注册表
- 对已列出但无对应文件的技能标记为(不删除,仅通知)
[MISSING FILE]
检查点:我会展示已执行的高优先级操作,请求用户确认是否继续执行中优先级操作。
Phase 3 — Medium Corrections
阶段3 — 中优先级修正
3.1 Add missing sections in CLAUDE.md
If sections such as Unbreakable Rules, Plan Mode Rules, Quick Reference are missing — I add the corresponding ones with content inferred from the project.
3.2 Update Folder Structure in CLAUDE.md
If directories exist in that are not documented in CLAUDE.md, I add them to the Folder Structure table.
.claude/3.3 Fix broken cross-references
For broken references where the destination file does NOT exist and should: I create it with minimal content. For references where the file exists but the path is misspelled: I fix the path.
Checkpoint: I present medium-priority actions. I offer to execute low-priority ones.
3.1 补充CLAUDE.md中缺失的章节
如果存在Unbreakable Rules、Plan Mode Rules、Quick Reference等缺失章节 — 我会添加相应章节,并根据项目内容推断填充内容。
3.2 更新CLAUDE.md中的文件夹结构
如果中存在的目录未在CLAUDE.md中记录,我会将其添加到文件夹结构表格中。
.claude/3.3 修复损坏的交叉引用
对于目标文件不存在但应存在的损坏引用:我会创建包含最小内容的文件。对于文件存在但路径拼写错误的引用:我会修正路径。
检查点:我会展示已执行的中优先级操作,询问用户是否执行低优先级操作。
Phase 4 — Low Corrections (optional, I ask first)
阶段4 — 低优先级修正(可选,需先询问用户)
4.1 Install recommended global tech skills
For each recommended global skill not installed locally:
Recommended skill: react-19
Available at: ~/.claude/skills/react-19/SKILL.md
To install it in this project: /skill-add react-19I do not install automatically — I only inform with the exact command.
4.2 Notify architecture violations
Violations found in Dimension 7 are NOT auto-corrected — they are code changes that require human review. I present them with context:
⚠️ Architecture violations (require manual review):
- src/pages/api/payment.js:45 — Business logic in API route
- src/components/Cart.jsx:23 — Direct service import (should use hook)4.1 安装推荐的全局技术技能
对于每个未在本地安装的推荐全局技能:
推荐技能:react-19
获取路径:~/.claude/skills/react-19/SKILL.md
在本项目中安装:/skill-add react-19我不会自动安装 — 仅告知用户准确的安装命令。
4.2 通知架构违规情况
在维度7中发现的违规情况不会自动修正 — 这些是需要人工审核的代码变更。我会附带上下文展示:
⚠️ 架构违规(需人工审核):
- src/pages/api/payment.js:45 — API路由中包含业务逻辑
- src/components/Cart.jsx:23 — 直接导入服务(应使用Hook)Phase 5 — Dimension 9 Corrections (Project Skills Quality)
阶段5 — 维度9修正(项目技能质量)
5.1 Parse
skill_quality_actionsRead from FIX_MANIFEST.
skill_quality_actions[]If the key is absent or the list is empty:
- Skip Phase 5 silently — no output, no prompt
If actions are present, present the Phase 5 checkpoint:
Phase 5 — Skill Quality Actions
[N] actions found in Dimension 9
Actions to process:
[N] delete_duplicate — local skills that duplicate a global skill
[N] add_missing_section — local skills missing structural sections
[N] flag_irrelevant — skills potentially irrelevant to current stack (INFO)
[N] flag_language — skills with non-English content (INFO — manual fix)
[N] move-to-global — skills recommended for promotion to global catalog (manual)
Proceed with Phase 5? [Y/n]If user declines, skip Phase 5 entirely.
5.2 handler
delete_duplicateFor each action with :
action_type: delete_duplicate⚠️ Duplicate skill found:
Local : [local_path]
Global : [global_counterpart]
Detail : [detail]
Delete local copy? [y/N]- On : delete
ydirectory recursively. Log to.claude/skills/<name>/.ai-context/changelog-ai.md - On : mark
N. Continue to next action.skipped (user declined) - If directory no longer exists: mark . Continue.
skipped (already deleted)
5.3 handler
add_missing_sectionFor each action with :
action_type: add_missing_section- Check if the target file exists. If not: mark and notify user. Continue.
failed (file not found) - Read current content of local .
SKILL.md - Determine format type: parse YAML frontmatter block (content between first pair). Extract
---value. If absent or unrecognized → treat asformat:. This step reads the skill file at repair time; do NOT rely solely on the FIX_MANIFEST entry for the format value.procedural - For each section in :
missing_sections[]- Check if section heading already exists (idempotency guard) — if yes: mark .
skipped (section already present) - Check for marker — if present: mark
<!-- AUDIT: stub added by project-fix.skipped (stub already added) - Otherwise: select stub template matching the resolved format (see table below) and append it at the end of the file.
- Check if section heading already exists (idempotency guard) — if yes: mark
Format-aware stub selection (authoritative contract in ):
docs/format-types.md| Resolved format | Missing section being added | Stub to insert |
|---|---|---|
| | Process stub (see below) |
| | Patterns stub (see below) |
| | Anti-patterns stub (see below) |
| any format | | Rules stub (see below) |
| any format | | Triggers stub (see below) |
Stub templates:
For missing :
## Rulesmarkdown
<!-- AUDIT: stub added by project-fix [YYYY-MM-DD] — fill in before using this skill -->5.1 解析
skill_quality_actions读取FIX_MANIFEST中的。
skill_quality_actions[]如果该键不存在或列表为空:
- 静默跳过阶段5 — 不输出、不提示
如果存在操作,展示阶段5检查点:
阶段5 — 技能质量操作
在维度9中发现[N]项操作
待处理操作:
[N] delete_duplicate — 与全局技能重复的本地技能
[N] add_missing_section — 缺失结构章节的本地技能
[N] flag_irrelevant — 可能与当前技术栈无关的技能(仅通知)
[N] flag_language — 包含非英文内容的技能(仅通知 — 需手动修复)
[N] move-to-global — 建议升级到全局目录的技能(需手动操作)
是否继续执行阶段5?[Y/n]如果用户拒绝,则完全跳过阶段5。
5.2 处理程序
delete_duplicate对于每个的操作:
action_type: delete_duplicate⚠️ 发现重复技能:
本地 : [本地路径]
全局 : [全局对应技能]
详情 : [详情]
是否删除本地副本?[y/N]- 输入:递归删除
y目录。记录到.claude/skills/<name>/。ai-context/changelog-ai.md - 输入:标记为
N,继续处理下一个操作。已跳过(用户拒绝) - 如果目录已不存在:标记为,继续处理下一个操作。
已跳过(已删除)
5.3 处理程序
add_missing_section对于每个的操作:
action_type: add_missing_section- 检查目标文件是否存在。如果不存在:标记为并通知用户,继续处理下一个操作。
失败(文件未找到) - 读取本地的当前内容。
SKILL.md - 确定格式类型:解析YAML前置块(第一个对之间的内容),提取
---值。如果不存在或无法识别 → 视为format:。此步骤在修复时读取技能文件,请勿仅依赖FIX_MANIFEST条目中的格式值。procedural - 对于中的每个章节:
missing_sections[]- 检查章节标题是否已存在(幂等性检查)— 如果存在:标记为。
已跳过(章节已存在) - 检查是否存在标记 — 如果存在:标记为
<!-- AUDIT: stub added by project-fix。已跳过(已添加占位内容) - 否则:选择与解析格式匹配的占位模板(见下表)并追加到文件末尾。
- 检查章节标题是否已存在(幂等性检查)— 如果存在:标记为
感知格式的占位模板选择(权威定义在中):
docs/format-types.md| 解析后的格式 | 待添加的缺失章节 | 插入的占位内容 |
|---|---|---|
| | 流程占位模板(见下文) |
| | 模式占位模板(见下文) |
| | 反模式占位模板(见下文) |
| 任意格式 | | 规则占位模板(见下文) |
| 任意格式 | | 触发方式占位模板(见下文) |
占位模板:
缺失时:
## Rulesmarkdown
<!-- AUDIT: stub added by project-fix [YYYY-MM-DD] — 使用此技能前请填充内容 -->Rules
Rules
Scaffold note: replace this text with the concrete constraints and invariants for this skill.
For missing `## Process` (format: procedural or absent):
```markdown
<!-- AUDIT: stub added by project-fix [YYYY-MM-DD] -->脚手架提示:替换此文本为该技能的具体约束和规则。
缺失`## Process`时(格式为procedural或不存在):
```markdown
<!-- AUDIT: stub added by project-fix [YYYY-MM-DD] -->Process
Process
Scaffold note: replace this text with the real step-by-step process instructions.
For missing `## Patterns` (format: reference):
```markdown
<!-- AUDIT: stub added by project-fix [YYYY-MM-DD] -->脚手架提示:替换此文本为真实的分步流程说明。
缺失`## Patterns`时(格式为reference):
```markdown
<!-- AUDIT: stub added by project-fix [YYYY-MM-DD] -->Patterns
Patterns
Scaffold note: replace this text with the core patterns and examples for this technology or library.
For missing `## Anti-patterns` (format: anti-pattern):
```markdown
<!-- AUDIT: stub added by project-fix [YYYY-MM-DD] -->脚手架提示:替换此文本为该技术或库的核心模式及示例。
缺失`## Anti-patterns`时(格式为anti-pattern):
```markdown
<!-- AUDIT: stub added by project-fix [YYYY-MM-DD] -->Anti-patterns
Anti-patterns
Scaffold note: replace this text with the anti-patterns to avoid and their corrections.
For missing `**Triggers**`:
```markdown
<!-- AUDIT: stub added by project-fix [YYYY-MM-DD] -->
**Triggers**: Replace this scaffold text with the slash command and natural-language triggers for this skill.Log each modification to .
ai-context/changelog-ai.md5.4 handler
flag_irrelevantFor each action with :
action_type: flag_irrelevant- Read current content of local .
SKILL.md - Check if is already the first line — if yes: mark
<!-- AUDIT: skill may be irrelevant.skipped (already flagged) - Otherwise: prepend the following comment block as the first line of the file:
markdown
<!-- AUDIT: skill may be irrelevant to current project stack. Review and delete if unused. Added by project-fix [YYYY-MM-DD] -->Log to .
ai-context/changelog-ai.mdflag_languageFor each action with :
action_type: flag_language- Report to user:
ℹ️ Language violation in: [local_path] Detail: [detail] Action required: translate content to English manually. This file has NOT been modified. - Log the finding to .
ai-context/changelog-ai.md - Do NOT modify the SKILL.md file.
move-to-globalBefore listing individual skills, print the following note once per fix run (not once per skill):
ℹ️ Two-tier skill model reminder:
.claude/skills/ is project-local (versioned in repo — team-visible).
~/.claude/skills/ is machine-global (available across all projects but not present for collaborators who clone).For each action with disposition :
move-to-globalℹ️ Manual action required — [local_path]
This skill may be a candidate for promotion to the global catalog.
To promote manually:
1. Copy: cp [local_path] ~/.claude/skills/[skill_name]/SKILL.md
2. Register in agent-config repo: skills/[skill_name]/SKILL.md
3. Run install.sh to deploy
4. Run /skill-add [skill_name] in the original project to add a registry reference
5. Delete the local copy after verifying the global version worksNo automated action taken.
Checkpoint after Phase 5:
Phase 5 complete — [N] actions processed
✅ deleted : [N]
✅ stubs added : [N]
✅ flagged irrelevant : [N]
ℹ️ language violations : [N] (manual fix required)
ℹ️ move-to-global : [N] (manual — see instructions above)
⏭️ skipped : [N]
❌ failed : [N]脚手架提示:替换此文本为需要避免的反模式及修正方法。
缺失`**Triggers**`时:
```markdown
<!-- AUDIT: stub added by project-fix [YYYY-MM-DD] -->
**触发方式**:替换此脚手架文本为该技能的斜杠命令和自然语言触发词。将每项修改记录到。
ai-context/changelog-ai.md5.4 处理程序
flag_irrelevant对于每个的操作:
action_type: flag_irrelevant- 读取本地的当前内容。
SKILL.md - 检查第一行是否已存在— 如果存在:标记为
<!-- AUDIT: skill may be irrelevant。已跳过(已标记) - 否则:在文件第一行添加以下注释块:
markdown
<!-- AUDIT: skill may be irrelevant to current project stack. Review and delete if unused. Added by project-fix [YYYY-MM-DD] -->记录到。
ai-context/changelog-ai.mdflag_language对于每个的操作:
action_type: flag_language- 向用户报告:
ℹ️ 语言违规文件:[本地路径] 详情:[详情] 需执行操作:手动将内容翻译为英文。 本文件未被修改。 - 将发现记录到。
ai-context/changelog-ai.md - 不修改SKILL.md文件。
move-to-global在列出单个技能前,每次修复运行仅打印一次以下提示(而非每个技能打印一次):
ℹ️ 双层技能模型提示:
.claude/skills/ 是项目本地技能(在仓库中版本化 — 团队可见)。
~/.claude/skills/ 是机器全局技能(可在所有项目中使用,但克隆仓库的协作者无法看到)。对于每个标记为的操作:
move-to-globalℹ️ 需手动操作 — [本地路径]
此技能可能适合升级到全局目录。
手动升级步骤:
1. 复制:cp [本地路径] ~/.claude/skills/[技能名称]/SKILL.md
2. 在agent-config仓库中注册:skills/[技能名称]/SKILL.md
3. 运行install.sh部署
4. 在原项目中运行/skill-add [技能名称]添加注册表引用
5. 验证全局版本可用后删除本地副本不执行自动化操作。
阶段5完成后检查点:
阶段5完成 — 已处理[N]项操作
✅ 已删除 : [N]
✅ 已添加占位内容 : [N]
✅ 已标记无关 : [N]
ℹ️ 语言违规 : [N](需手动修复)
ℹ️ 需升级到全局 : [N](需手动操作 — 见上述说明)
⏭️ 已跳过 : [N]
❌ 失败 : [N]Step 3 — Record in changelog
步骤3 — 记录到变更日志
When done, I add an entry to :
ai-context/changelog-ai.mdmarkdown
undefined完成所有操作后,我会向添加一条条目:
ai-context/changelog-ai.mdmarkdown
undefined[YYYY-MM-DD] — project-fix executed
[YYYY-MM-DD] — 执行project-fix
Score before: [XX]/100
Actions executed: [N] critical, [N] high, [N] medium
Files created: [list]
Files modified: [list]
SDD Readiness: [FULL|PARTIAL|NOT CONFIGURED] → [final state]
Notes: [any important decision made]
---修复前得分: [XX]/100
已执行操作: [N]项严重、[N]项高优先级、[N]项中优先级
已创建文件: [列表]
已修改文件: [列表]
SDD就绪状态: [完全就绪|部分就绪|未配置] → [最终状态]
备注: [任何重要决策]
---Step 4 — Final report
步骤4 — 最终报告
✅ Fix completed — [Project Name]
Actions executed:
✅ [N] critical
✅ [N] high
✅ [N] medium
⏭️ [N] low (informed, not auto-executed)
Files created: [list]
Files modified: [list]
SDD Status: [FULL / PARTIAL / NOT CONFIGURED]
- Engram: [✅ reachable | ❌ not reachable]
- Global SDD skills: [✅ complete | ⚠️ missing: list]
- CLAUDE.md mentions /sdd-*: [✅ yes | ✅ added]
To verify the result:
→ /project-audit (should show a higher score)
→ To start development with SDD: /sdd-explore <topic> or /sdd-propose <change-name>
Changes recorded in: ai-context/changelog-ai.md✅ 修复完成 — [项目名称]
已执行操作:
✅ [N]项严重
✅ [N]项高优先级
✅ [N]项中优先级
⏭️ [N]项低优先级(仅通知,未自动执行)
已创建文件: [列表]
已修改文件: [列表]
SDD状态: [完全就绪 / 部分就绪 / 未配置]
- Engram: [✅ 可达 | ❌ 不可达]
- 全局SDD技能: [✅ 完整 | ⚠️ 缺失: 列表]
- CLAUDE.md提及/sdd-*: [✅ 是 | ✅ 已添加]
验证修复结果:
→ /project-audit (应显示更高得分)
→ 开始使用SDD开发:/sdd-explore <主题> 或 /sdd-propose <变更名称>
变更记录已保存至: ai-context/changelog-ai.mdInternal templates
内部模板
Template: SDD section
模板:SDD章节
See Step 2 — 1.2 above for the CLAUDE.md SDD section template.
见步骤2 — 1.2中的CLAUDE.md SDD章节模板。
Template: changelog entry
模板:变更日志条目
markdown
undefinedmarkdown
undefined[YYYY-MM-DD] — [description of the change]
[YYYY-MM-DD] — [变更描述]
Type: [Feature|Bug Fix|Refactor|Config|Documentation]
Agent: Claude [model]
Modified files:
- — [what was done]
path/file.ext
Decisions made:
- [decision and its reason]
Notes: [anything important for future sessions]
---类型: [功能新增|Bug修复|重构|配置更新|文档更新]
代理: Claude [模型]
已修改文件:
- — [操作说明]
path/file.ext
已做决策:
- [决策内容及原因]
备注: [对未来会话重要的信息]
---Rules
规则
- Without audit-report.md I do not operate — I ask the user to run first
/project-audit - I only implement what is in FIX_MANIFEST — I never invent additional corrections
- Checkpoint between phases — I never execute the next phase without user confirmation
- I do not fix production code — I report architecture violations but do not touch them
- I always record in changelog — each fix is documented in
ai-context/changelog-ai.md - If a file already has more complete content than the template, I do not overwrite it — I do an intelligent merge or add only the missing sections
- Idempotent: running twice on the same project must not cause duplications
/project-fix - When done, I always suggest: "Run to verify the new score"
/project-audit - NEVER touch — commands/ is a deprecated mechanism; this skill does not create, modify, or delete files under that path. Any FIX_MANIFEST action of type
.claude/commands/or targetingfix_commands_registryMUST be skipped and noted in the output as 'skipped — commands/ is deprecated'..claude/commands/ - Unknown or deprecated action types never gain automatic side effects — if an action cannot be mapped to a supported handler safely, it is downgraded to a skip or recommendation outcome.
- 无audit-report.md则无法运行 — 我会要求用户先运行
/project-audit - 仅执行FIX_MANIFEST中的内容 — 绝不会自行添加额外修正
- 阶段间设置检查点 — 未获得用户确认绝不会执行下一阶段
- 不修复生产代码 — 仅报告架构违规情况,不修改代码
- 始终记录到变更日志 — 每次修复都记录在中
ai-context/changelog-ai.md - 如果文件已有比模板更完整的内容,不覆盖 — 执行智能合并或仅添加缺失章节
- 幂等性:在同一项目中运行两次不会导致重复内容
/project-fix - 完成后始终建议:"运行验证新得分"
/project-audit - 绝不修改— commands/是已弃用的机制;本技能不会在该路径下创建、修改或删除文件。任何针对
.claude/commands/或类型为.claude/commands/的FIX_MANIFEST操作必须跳过,并在输出中注明'已跳过 — commands/已弃用'。fix_commands_registry - 未知或已弃用的操作类型绝不会自动执行修改 — 如果操作无法安全映射到支持的处理程序,将降级为跳过或建议结果。