Reverse engineers existing code into detailed specifications, Gherkin scenarios, and TDD coverage reports. Supports spec, bdd, and tdd subcommands.
How this command is triggered — by the user, by Claude, or both
Slash command
/universal-dev-standards:reverseThe summary Claude sees in its command listing — used to decide when to auto-load this command
# Reverse Engineering | 反向工程 Reverse engineer existing code or tests into specifications and scenarios. 將現有代碼或測試反向工程為規格和場景。 ## Usage | 用法 ### Subcommands | 子命令 | Subcommand | Input | Output | Description | |------------|-------|--------|-------------| | `spec` | Code files/dirs | `SPEC-XXX.md` | Create SDD Spec from code | | `bdd` | `SPEC-XXX.md` | `.feature` | Convert Spec ACs to Gherkin | | `tdd` | `.feature` | Coverage Report | Analyze TDD coverage of features | ### Options | 選項 | Option | Description | |--------|-------------| | `--output` | Output file path | | `--include-test...
Reverse engineer existing code or tests into specifications and scenarios.
將現有代碼或測試反向工程為規格和場景。
/reverse [subcommand] <input> [options]
| Subcommand | Input | Output | Description |
|---|---|---|---|
spec | Code files/dirs | SPEC-XXX.md | Create SDD Spec from code |
bdd | SPEC-XXX.md | .feature | Convert Spec ACs to Gherkin |
tdd | .feature | Coverage Report | Analyze TDD coverage of features |
| Option | Description |
|---|---|
--output | Output file path |
--include-tests | Include test files in analysis (for spec) |
--review | Trigger review after generation |
/reverse spec src/auth/ --output specs/SPEC-AUTH.md
Analyzes code logic to create a functional specification.
/reverse bdd specs/SPEC-AUTH.md --output features/auth.feature
Converts Acceptance Criteria from the spec into Gherkin scenarios.
/reverse tdd features/auth.feature
Checks if the scenarios in the feature file have corresponding unit tests.
[Confirmed], [Inferred], [Unknown] tags in output.file:line for all reversed logic.Follows AI Command Behavior Standards
| Input | AI Action |
|---|---|
/reverse | 詢問使用者要執行哪個子命令(spec/bdd/tdd)和目標 |
/reverse <subcommand> <input> | 直接對指定目標執行指定子命令 |
/reverse <subcommand> | 執行子命令,詢問目標檔案/目錄 |
/reverse-sdd、/reverse-bdd、/reverse-tddDecision: 子命令選擇
spec → 分派到 /reverse-sddbdd → 分派到 /reverse-bddtdd → 分派到 /reverse-tdd🛑 STOP: 結果展示後等待使用者確認
| Stop Point | 等待內容 |
|---|---|
| 反向工程結果展示後 | 確認結果正確並寫入 |
| Error Condition | AI Action |
|---|---|
| 目標檔案/目錄不存在 | 告知並詢問正確路徑 |
| 子命令無效 | 列出可用子命令(spec/bdd/tdd) |
| 目標為空目錄或空檔案 | 告知無內容可分析 |
npx claudepluginhub asiaostrich/universal-dev-standards --plugin universal-dev-standards/rev-specsAnalyzes existing codebases to reverse-engineer test cases and specification documents from business logic, APIs, and UI components. Outputs test plans, test case lists, and generated test code.
/detective-specExtracts executable specs (module contracts, business rules, flows, ADRs) from legacy codebases without source modifications, producing traceable markdown files and checkpoints.
/code-analysis-flowReverse-engineer a codebase into grounded architecture docs and requirements. Classifies small vs large codebases, partitions large workspaces, gates unknowns via questioning, and produces docs under docs/<feature>/.