Skip to content
Skills Library
Programming · Analysis

reverse

/reverse

[UDS] System archeology — reverse engineer an existing system across the Logic, Data, and Runtime dimensions. Use when: documenting an undocumented system, recovering specifications from existing code, mapping an unknown data model or runtime topology. Not for: assessing health and risk before a feature — use /discover; deriving tests forward from an approved spec — use /spec-derive. Keywords: reverse engineering, system archeology, legacy code, spec extraction, data model, runtime, 反向工程, 系統考古, 規格提取.

Licence
MIT
Last repository change
27.10.2026

Assessment and security

95/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
5
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

[UDS] System archeology — reverse engineer an existing system across the Logic, Data, and Runtime dimensions. Use when: documenting an undocumented system, recovering specifications from existing code, mapping an unknown data model or runtime topology. Not for: assessing health and risk before a feature — use /discover; deriving tests forward from an approved spec — use /spec-derive. Keywords: reverse engineering, system archeology, legacy code, spec extraction, data model, runtime, 反向工程, 系統考古, 規格提取.

Arguments

/reverse [spec|data|runtime|bdd|tdd] <input>
Original author description

[UDS] System archeology — reverse engineer an existing system across the Logic, Data, and Runtime dimensions. Use when: documenting an undocumented system, recovering specifications from existing code, mapping an unknown data model or runtime topology. Not for: assessing health and risk before a feature — use /discover; deriving tests forward from an approved spec — use /spec-derive. Keywords: reverse engineering, system archeology, legacy code, spec extraction, data model, runtime, 反向工程, 系統考古, 規格提取.

How it works

  1. Three Dimensions | 三大維度
  2. Subcommands | 子命令
  3. Full Analysis Mode | 全面分析模式
  4. Dimension Details | 維度詳情
  5. Anti-Hallucination Rules | 防幻覺規則
  6. Usage | 使用方式
  7. Next Steps Guidance | 下一步引導
  8. Reference | 參考
  9. AI Agent Behavior | AI 代理行為
Original SKILL.md headings · 127 lines, 791 words
SKILL.md preview
---
name: reverse
scope: partial
description: |
  [UDS] System archeology — reverse engineer an existing system across the Logic, Data, and Runtime dimensions.
  Use when: documenting an undocumented system, recovering specifications from existing code, mapping an unknown data model or runtime topology.
  Not for: assessing health and risk before a feature — use /discover; deriving tests forward from an approved spec — use /spec-derive.
  Keywords: reverse engineering, system archeology, legacy code, spec extraction, data model, runtime, 反向工程, 系統考古, 規格提取.
allowed-tools: Read, Grep, Glob, Bash(pg_dump:*), Bash(mysql:*), Bash(sqlite3:*), Bash(npm run:*), Bash(cat:*), Bash(docker:*)
argument-hint: "[spec|data|runtime|bdd|tdd] <input>"
status: stable
# 2026-08-18: `disable-model-invocation: true` removed, and a status recorded.
#
# The flag was applied by d415937e alongside the description rewrite and, like
# the two lifted on 2026-08-17, followed no stateable rule. These eight were
# left alone that day for a reason that was correct at the time: the rule
# settled on was "a reference is model-invocable", and none of them carried a
# `status` at all, so lifting them would have replaced one unruled state with
# one unruled action.
#
# Measured 2026-08-18, which is what closed it: all eight carry a full
# `Use when:` trigger and a `Not for:` exclusion, all eight describe an action
# rather than reference material, and all eight already have a slash command —
# which is exactly the shape of `code-review-assistant`, whose paired `/code-review`
# was ruled not to justify the flag. `journey-test-assistant` is the standing
# precedent: same "Generate X" shape, `status: stable`, never disabled.
#
# `stable` rather than a new value: `skills/` uses reference, stable and
# experimental, and inventing a fourth would be the same unruled-action mistake
# in different clothing.
#
# The cost of being wrong is asymmetric and observable in only one direction.
# Over-triggering shows up and is undone by deleting a line; a skill that is
# structurally unable to fire produces no signal at all. (XSPEC-378 R5)
---

# Reverse Engineering Assistant | 反向工程助手

System archeology framework: reverse engineer existing systems across three dimensions — **Logic**, **Data**, and **Runtime**.

系統考古框架:從三個維度反向工程既有系統——**邏輯**、**資料**、**執行環境**。

## Three Dimensions | 三大維度

```
┌─────────────────────────────────────────────────────────┐
│              System Archeology Framework                   │
├──────────┬──────────────┬────────────────────────────────┤
│  Logic   │     Data     │          Runtime               │
│ (spec)   │    (data)    │         (runtime)              │
├──────────┼──────────────┼────────────────────────────────┤
│ APIs     │ DB Schemas   │ Logs & Error Patterns          │
│ Modules  │ ORMs/Models  │ Config & Environment           │
│ Flows    │ Migrations   │ Metrics & Performance          │
│ Tests    │ Seed Data    │ Infra & Deployment             │
└──────────┴──────────────┴────────────────────────────────┘
```

## Subcommands | 子命令

| Subcommand | Dimension | Input | Output | 說明 |
|------------|-----------|-------|--------|------|
| *(none)* | All | Project root | Full Archeology Report | 三維度全面分析 |
| `spec` | Logic | Code files/dirs | `SPEC-XXX.md` | 從程式碼提取規格 |
| `data` | Data | DB schemas, ORMs, migrations | Data Model Spec | 分析資料模型與結構 |
| `runtime` | Runtime | Logs, configs, metrics | Runtime Baseline | 分析執行環境基準 |
| `bdd` | — | `SPEC-XXX.md` | `.feature` | 將 AC 轉為 Gherkin |
| `tdd` | — | `.feature` | Coverage Report | 分析測試覆蓋率 |

## Full Analysis Mode | 全面分析模式

When `/reverse` is invoked without a subcommand, execute all three dimensions sequentially:

1. **Data** → Scan schemas, ORMs, migrations
2. **Runtime** → Analyze logs, configs, deployment
3. **Logic (spec)** → Extract APIs, flows, tests → Generate SPEC

Output: Integrated **System Archeology Report** combining all three dimensions.

## Dimension Details | 維度詳情

### spec: Logic Dimension (既有)

1. **Scan** - Read source files and identify public APIs, data flows, and business logic
2. **Classify** - Tag each finding as `[Confirmed]`, `[Inferred]`, or `[Unknown]`
3. **Structure** - Organize into SDD spec format with Acceptance Criteria
4. **Attribute** - Cite every reversed item with `file:line` source reference

### data: Data Dimension (新增)

1. **Discover** - Find database schemas, ORM models, migration files, seed data
2. **Map** - Build entity-relationship model from code evidence
3. **Classify** - Tag relationships as `[Confirmed]` (FK constraints) or `[Inferred]` (code patterns)
4. **Report** - Output data model spec with:
   - Entity list with fields and types
   - Relationship map (1:1, 1:N, M:N)
   - Index and constraint inventory
   - Migration history summary
   - Data flow paths (write → read)

**Evidence sources**: `schema.prisma`, `*.migration.*`, `models/`, `entities/`, `knexfile.*`, `sequelize`, `typeorm`, SQL files, `docker-compose.yml` (DB services)

### runtime: Runtime Dimension (新增)

1. **Scan configs** - Environment variables, config files, feature flags
2. **Analyze logs** - Log patterns, error frequency, log levels
3. **Check infra** - Docker configs, CI/CD pipelines, deployment manifests
4. **Baseline** - Output runtime baseline with:
   - Environment variable inventory (names only, **never values/secrets**)
   - Config file map and hierarchy
   - External service dependencies (APIs, queues, caches)
   - Deployment topology (containers, services)
   - Health check and monitoring endpoints

**Evidence sources**: `.env.example`, `docker-compose.yml`, `Dockerfile`, `*.config.*`, CI/CD files, `k8s/`, log files (patterns only)

**Security**: NEVER output actual secret values. Only list variable names and describe their purpose.

## Anti-Hallucination Rules | 防幻覺規則

| Rule | Requirement | 要求 |
|------|-------------|------|
| **Certainty Tags** | Use `[Confirmed]`, `[Inferred]`, `[Unknown]` for all findings | 所有發現須標注確定性 |
| **Source Attribution** | Cite `file:line` for every reversed item | 每項反向結果須引用來源 |
| **No Fabrication** | Never invent APIs or behaviors not found in code | 不得捏造程式碼中不存在的 API 或行為 |
| **No Secrets** | Never output secret values from configs or env files | 不得輸出設定檔或環境變數的密鑰值 |

## Usage | 使用方式

```
/reverse                              - Full 3-dimension analysis | 三維度全面分析
/reverse spec src/auth/               - Logic: extract spec | 邏輯:提取規格
/reverse data                         - Data: analyze schemas & models | 資料:分析結構
/reverse runtime                      - Runtime: analyze configs & infra | 執行環境:分析配置
/reverse bdd specs/SPEC-AUTH.md       - Convert spec ACs to Gherkin
/reverse tdd features/auth.feature    - Analyze test coverage
```

## Next Steps Guidance | 下一步引導

After `/reverse` (full or `spec`) completes, the AI assistant should suggest:

> **系統考古完成。建議下一步 / System archeology complete. Suggested next steps:**
> - 執行 `/sdd` 審查並核准此規格 ⭐ **Recommended / 推薦** — Review and approve the generated spec
> - 執行 `/derive` 從規格推導測試 — Derive tests from spec (requires approval first)
> - 審查規格中的 `[Inferred]` 和 `[Unknown]` 標記 — Review uncertainty tags manually

## Reference | 參考

- [BDD Extraction Workflow Guide](./bdd-extraction.md) — Read it when extracting BDD scenarios out of an existing spec.
- [TDD Analysis Workflow Guide](./tdd-analysis.md) — Read it when analysing test coverage against scenarios and finding the gaps.
- Step-by-step workflow: [workflow.md](./workflow.md) — the reverse-engineering phases in order (code scanning, data models, configuration, test analysis, coverage). Read it when actually running the process rather than deciding whether to.
- Detailed guide: [guide.md](./guide.md)
- Core standard: [reverse-engineering-standards.md](../../core/reverse-engineering-standards.md)


## AI Agent Behavior | AI 代理行為

> 完整的 AI 行為定義請參閱對應的命令文件:[`/reverse`](../commands/reverse.md#ai-agent-behavior--ai-代理行為)
>
> For complete AI agent behavior definition, see the corresponding command file: [`/reverse`](../commands/reverse.md#ai-agent-behavior--ai-代理行為)
Files in this package (5)
  • SKILL.md 9 KB
  • bdd-extraction.md 16 KB
  • guide.md 20 KB
  • tdd-analysis.md 17 KB
  • workflow.md 14 KB

Versions

RepositoryScoreLicence
This page · AsiaOstrich/universal-dev-standards95MIT
soummyaanon/engineering-os100MIT
AsiaOstrich/universal-dev-standards95MIT

Database snapshot: 13.11.2026 · package version ee58feb5fa74 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 84reverse-engineer
    [UDS] 系统考古——从逻辑、数据、运行时三个维度对既有系统做逆向工程。 Use when: 为没有文档的系统补上文档、从既有代码回推规格、绘制未知的数据模型或运行时拓扑。 Not for: 动工前评估健康度与风险——请用 /discover;从已批准的规格正向推导测试——请用 /spec-derive。 Keywords: reverse engineering, system archeology, legacy code, spec extraction, data model, runtime, 逆向工程, 系统考古, 规格提取, 数据模型.
  • 100reverse-engineer
    [UDS] 系統考古——從邏輯、資料、執行環境三個維度對既有系統做反向工程。 Use when: 為沒有文件的系統補上文件、從既有程式碼回推規格、繪製未知的資料模型或執行環境拓樸。 Not for: 動工前評估健康度與風險——請用 /discover;從已核准的規格正向推導測試——請用 /spec-derive。 Keywords: reverse engineering, system archeology, legacy code, spec extraction, data model, runtime, 反向工程, 系統考古, 規格提取, 資料模型.
  • 100reverse-spec
    Use to extract a spec FROM existing code. Inverse of "build from spec" — given the code, recover what it does. Useful for: legacy systems, undocumented modules, post-hoc compliance evidence.
  • 100code-to-spec
    Reverse-engineer a SPEC document from an existing project. Analyzes code, config, tests, and structure to produce a comprehensive specification. Triggers on: code-to-spec, reverse spec, generate spec, 逆向规格, 生成规格文档, 生成设计文档, 生成设计方案, extract spec, document this project, what does this project do.
  • 100spec-miner
    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,…
  • 100spec-miner
    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,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.