Skip to content

spec-rule-miner

从目标仓库真实代码证据中挖掘项目级 AI 编码规则,并写入独立规则文件与 host 入口 pointer。

ASCII 链路图

text
Codebase -> Spec -> Plan -> Tasks -> Code -> Review -> Knowledge
    |
    v
    spec-rule-miner
    entry: standalone skill
    type: standalone-skill

基本信息

字段内容
Skillspec-rule-miner
类型standalone-skill
研发链路位置Codebase
当前入口standalone skill
兼容别名不适用
Sourceskills/spec-rule-miner/SKILL.md
Governancesrc/cli/contracts/dual-host-governance/skills-governance.json(supported-host skills governance)

描述

Use this standalone skill when the user asks to mine a repo's existing coding conventions for future AI coding, generate or refresh project rules with AGENTS.md/CLAUDE.md pointers, create Cursor or Qoder rule files from actual code evidence, or make AI-generated code follow a specific project's habits. Do not use for confirmed team policy governance, normal code review/debug/refactor work, linter/formatter configuration, generic best practices, unsupported tool rule files such as .cursorrules or .kiro/steering rules, or generated runtime mirror edits.

Source 契约摘要

该 source skill 未声明标准 Workflow Contract Summary 小节;本页以 frontmatter、supported-host governance 和维护者补充元数据为准。

何时使用

  • 用户要分析项目风格、学习代码规范或挖掘编码习惯。
  • 需要生成 AGENTS.md / CLAUDE.md pointer 或 Cursor/Qoder 规则文件。
  • 希望让 AI 生成代码更贴近当前项目习惯。

工作步骤

  • 读取 host、项目说明、运行时配置和本地工具状态。
  • 判断当前事实是否足够支撑下游 workflow。
  • 写出 setup、runtime、workspace 或版本状态等可检查证据。
  • 把 ready、blocked 或 degraded 结论交给 Spec、Plan、Code 或 Review 阶段。

输出

  • 项目 readiness、runtime 或 project guidance 事实。
  • 可复用的下一步入口建议。
  • 当环境不可用时,输出明确的 blocked / degraded 修复项。

Agent 调度

  • 默认优先使用确定性脚本、本地文件和 provider 状态。
  • 只有在需要解释代码库惯例、历史背景或规范漂移时,才引入研究或审查类 agents。

本 skill 当前没有 skill-local references/agentsreferences/personas 文件;默认由 orchestrator 直接完成,或按阶段需要临时调用其他 skill 的专家。

边界

  • 不做普通代码 review、debug、refactor 或 lint/formatter 配置。
  • 不治理 docs/standards/** confirmed team standards。
  • 不写 unsupported tool rule files 或 generated runtime mirrors。

源码校准

  • 本页由 website/scripts/generate-skill-detail-pages.js 从上游 source skill 生成。
  • 当前入口、兼容别名与宿主投递 metadata 来自 src/cli/contracts/dual-host-governance/skills-governance.json
  • 当 source skill 或 governance contract 变化后,应重新运行 npm run reference:pages 并执行 npm run content:audit