opst-code-anysic
分析已归档的 OpenSpec 变更代码,提取业务逻辑并自动归档到 openspec/<领域>/<模块>/ 知识库。继承 code2doc-kunge2013 的五段式文档生成逻辑,并扩展为版本化归档、三级索引维护。当用户提到"代码归档"、"业务逻辑归档"、"code-anysic"、"分析变更代码"时使用此技能。
Skill by fangkun
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/fangkunx-opst-code-anysic
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/opst-code-anysic
What's inside
- Skill name
opst-code-anysic- Description
- 分析已归档的 OpenSpec 变更代码,提取业务逻辑并自动归档到 openspec/<领域>/<模块>/ 知识库。继承 code2doc-kunge2013 的五段式文档生成逻辑,并扩展为版本化归档、三级索引维护。当用户提到"代码归档"、"业务逻辑归档"、"code-anysic"、"分析变更代码"时使用此技能。
- License
- MIT
- Compatibility
- Requires openspec CLI and git.
- Metadata
- author: fangkun · version: 1.0 · generatedBy: openspec-trace@1.0.0
- Instructions
- 228 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
分析已归档的 OpenSpec 变更代码,提取业务逻辑并自动归档到 openspec/<领域>/<模块>/ 知识库。
## 工作流
### 步骤 1:确定分析目标
若用户未提供变更名称,列出已归档的变更供选择:
```bash
ls -t openspec/changes/archive/
```
使用 **AskUserQuestion** 让用户从列表中选择目标变更。
**重要**:必须经用户确认后才能继续。
### 步骤 2:读取变更上下文
并行读取以下文件,提取功能描述、技术领域、模块名称:
- `openspec/changes/archive/<变更名>/proposal.md`
- `openspec/changes/archive/<变更名>/design.md`
- `openspec/changes/archive/<变更名>/tasks.md`
### 步骤 3:分析代码变更
通过 git log 定位该变更对应的 commit 范围,获取涉及的文件列表:
```bash
git log --oneline -20
git diff <base-commit>..<head-commit> --name-only
```
将文件按层次分类:
| 分类 | 匹配模式 |
|------|----------|
| Controller | `*Controller.java` |
| Service | `*Service.java`, `*ServiceImpl.java` |
| Mapper | `*Mapper.java` |
| XML | `*Mapper.xml` |
| Entity | `*Entity.java`, `*DO.java`, `*PO.java` |
使用 **Grep** 提取关键注解:
- `@TableName` → 数据表映射
- `@RequestMapping` → API 路径前缀
- `@PostMapping` / `@GetMapping` / `@PutMapping` / `@DeleteMapping` → HTTP 方法与路径
### 步骤 4:确定领域与模块
从 Java 包名推导领域和模块,规则如下:
| 包名示例 | 领域推导 | 模块推导 |
|----------|----------|----------|
| `com.example.bill.payment` | `billing` | `payment-processing` |
| `com.example.invoice.calc` | `invoice` | `calculation` |
| `com.example.order.service` | `order` | `order-management` |
使用 **AskUserQuestion** 让用户确认或覆盖推导结果(领域名 + 模块名)。
### 步骤 5:生成五段式设计文档
读取各层源码文件(Controller → Service → ServiceImpl → Entity/Mapper → XML),
继承 code2doc-kunge2013 的五段式结构生成设计文档。
**文档结构**:
```
---
domain: <领域>
module: <模块>
version: <N>
date: <YYYY-MM-DD>
change: <变更名称>
keywords: [<kw1>, <kw2>, ...]
code-entry: <Controller类名>(<HTTP方法> <路径>)
---
# <模块名> — v<N>(<YYYY-MM-DD>)
## 1. 接口定义
| 字段 | 值 |
|------|----|
| URL | `<HTTP方法> <路径>` |
| Controller | `<类名>.<方法名>()` |
| 入参 | ```json\n{...}\n``` |
| 出参 | ```json\n{...}\n``` |
## 2. 业务流程图
```mermaid
flowchart TD
...
```
## 3. 业务逻辑详情
(SQL 查询 + Java 代码逻辑详解,覆盖核心分支)
## 4. 表结构 ER 图
```mermaid
erDiagram
...
```
## 5. 源码文件清单
| 文件 | 类型 | 说明 |
|------|------|------|
| ... | ... | ... |
```
**版本号确定**:
```
Glob: openspec/<领域>/<模块>/v*.mdFrom fangkunx/skills, MIT.
More from fangkunx/skills
- 0.474score
processkiller
fangkunx
Identify and terminate processes by port number, process name, or PID.
SkillCFreshness: CClaude Code +9 - 0.469score
npm-publish
fangkunx
Publish npm packages with full troubleshooting for 2FA, token types, registry mirrors, and cross-platform issues.
SkillCFreshness: CClaude Code +9 - 0.469score
opst-business-search
fangkun
检索 openspec/<领域>/<模块>/ 知识库中已归档的业务逻辑文档。支持关键词检索、领域浏览、精确模块查看三种模式。当用户提到"业务检索"、"搜索业务逻辑"、"business-search"、"查找模块"时使用此技能。
SkillCFreshness: CClaude Code +9 - 0.247score
skill-loader
fangkunx
No description from the publisher yet.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jun 26, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0
- License
- MIT
- Repository
- github.com/fangkunx/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from fangkun
Cite this page
opst-code-anysic skill. Agent Mart. https://agentmart.dev/skills/fangkunx-opst-code-anysic (last updated 2026-10-24)