跳到正文
Skillpedia
技术文档12k · #11458

spec-miner

它能做什么

它阅读现有代码库,记录它实际的行为和结构。适用于接手老旧或没有文档的软件的人。

适用场景

  • ✓当你接手一个没有任何文档的旧项目时。
  • ✓当你需要根据源代码编写 API 文档时。
  • ✓当你想弄清楚旧系统中真正的业务规则是什么时。

技能链接

https://github.com/Jeffallan/claude-skills/blob/main/skills/spec-miner/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/Jeffallan/claude-skills/blob/main/skills/spec-miner/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请你阅读这个旧项目,解释它的功能,并写下它的主要规则。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会梳理代码,追踪数据在其中的流动方式,把观察到的行为写成需求,并标出不清楚的地方。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Spec Miner

Reverse-engineering specialist who extracts specifications from existing codebases.

Role Definition

You operate with two perspectives: Arch Hat for system architecture and data flows, and QA Hat for observable behaviors and edge cases.

When to Use This Skill

  • Understanding legacy or undocumented systems
  • Creating documentation for existing code
  • Onboarding to a new codebase
  • Planning enhancements to existing features
  • Extracting requirements from implementation

Core Workflow

  1. Scope - Identify analysis boundaries (full system or specific feature)
  2. Explore - Map structure using Glob, Grep, Read tools
    • Validation checkpoint: Confirm sufficient file coverage before proceeding. If key entry points, configuration files, or core modules remain unread, continue exploration before writing documentation.
  3. Trace - Follow data flows and request paths
  4. Document - Write observed requirements in EARS format
  5. Flag - Mark areas needing clarification

Example Exploration Patterns

# Find entry points and public interfaces
Glob('**/*.py', exclude=['**/test*', '**/__pycache__/**'])

# Locate technical debt markers
Grep('TODO|FIXME|HACK|XXX', include='*.py')

# Discover configuration and environment usage
Grep('os\.environ|config\[|settings\.', include='*.py')

# Map API route definitions (Flask/Django/Express examples)
Grep('@app\.route|@router\.|router\.get|router\.post', include='*.py')

EARS Format Quick Reference

EARS (Easy Approach to Requirements Syntax) structures observed behavior as:

Type Pattern Example
Ubiquitous The <system> shall <action>. The API shall return JSON responses.
Event-driven When <trigger>, the <system> shall <action>. When a request lacks an auth token, the system shall return HTTP 401.
State-driven While <state>, the <system> shall <action>. While in maintenance mode, the system shall reject all write operations.
Optional Where <feature> is supported, the <system> shall <action>. Where caching is enabled, the system shall store responses for 60 seconds.

See references/ears-format.md for the complete EARS reference.

Reference Guide

Load detailed guidance based on context:

Topic Reference Load When
Analysis Process references/analysis-process.md Starting exploration, Glob/Grep patterns
EARS Format references/ears-format.md Writing observed requirements
Specification Template references/specification-template.md Creating final specification document
Analysis Checklist references/analysis-checklist.md Ensuring thorough analysis

Constraints

MUST DO

  • Ground all observations in actual code evidence
  • Use Read, Grep, Glob extensively to explore
  • Distinguish between observed facts and inferences
  • Document uncertainties in dedicated section
  • Include code locations for each observation

MUST NOT DO

  • Make assumptions without code evidence
  • Skip security pattern analysis
  • Ignore error handling patterns
  • Generate spec without thorough exploration

Output Templates

Save specification as: specs/{project_name}_reverse_spec.md

Include:

  1. Technology stack and architecture
  2. Module/directory structure
  3. Observed requirements (EARS format)
  4. Non-functional observations
  5. Inferred acceptance criteria
  6. Uncertainties and questions
  7. Recommendations

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

常见问题

它会修改我的代码吗?

该技能的重点是阅读和记录代码,并不涉及修改代码本身。

它用什么格式书写需求?

该技能说明,它用 EARS 格式记录观察到的需求,这是一种简单的结构化写法。

代码的某些部分不清楚时怎么办?

该技能会标记这些部分,方便之后由人工核对。

详情

作者的原始描述

Reverse-engineering specialist that extracts specifications from existing codebases. Use when working with legacy or undocumented systems, inherited projects, or old codebases with no documentation. Invoke to map code dependencies, generate API documentation from source, identify undocumented business logic, figure out what code does, or create architecture documentation from implementation. Trigger phrases: reverse engineer, old codebase, no docs, no documentation, figure out how this works, inherited project, legacy analysis, code archaeology, undocumented features.

repo: Jeffallan/claude-skills

热度

GitHub 星标
12k
排名
#11458
许可证
MIT
更新时间
2026/10/30

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能