$npx -y skills add pssah4/digital-innovation-agents --skill reverse-engineeringBrownfield entry point for the V-Model workflow. Reverse-engineers an existing codebase into the standard V-Model artifacts: plan-context.md, ADRs, arc42 snapshot, FEATURE inventory, backlog seed, and an evidence-based BA draft. Walks the V backwards from Coding up to Business An
| 1 | # Reverse Engineering |
| 2 | |
| 3 | ## MANDATORY Pre-Phase 0: Branch check (multi-item exception) |
| 4 | |
| 5 | RE bootstraps the entire backlog in one run, so it is the exception |
| 6 | to the per-item branching rule. All RE artefacts land on |
| 7 | `feature/reverse-engineer-<repo-name>`. Per-item branches kick in |
| 8 | AFTER RE merges. |
| 9 | |
| 10 | Branch check at start: |
| 11 | |
| 12 | - On `main` / `master` / `dev`: refuse; AskUserQuestion to create |
| 13 | the RE branch and switch. |
| 14 | - On expected branch: silent continue. |
| 15 | - On another branch: AskUserQuestion -- switch or rename. |
| 16 | |
| 17 | RE does not create per-item GitHub issues or per-item phase tags |
| 18 | during Phase 0-7. After RE, `/dia-guide` runs the one-shot pass |
| 19 | that creates issues and tags `<item-id>/reverse-engineered`. |
| 20 | |
| 21 | State in `.git/dia-active-skill`. Full rules: |
| 22 | `skills/project-conventions/references/team-workflow.md` and |
| 23 | `branch-protection.md`. |
| 24 | |
| 25 | ## MANDATORY Phase 0: Artifact triage |
| 26 | |
| 27 | Reverse engineering scans existing code to produce artifacts. Every |
| 28 | artifact this skill creates lands in one of these categories: |
| 29 | |
| 30 | - **FEATURE** (observed capability with user-facing surface) |
| 31 | - **ADR** (decision inferred from code patterns or external docs) |
| 32 | - **IMP** (technical debt or improvement candidate surfaced by the |
| 33 | scan) |
| 34 | - **FIX** (bug or drift surfaced by the scan) |
| 35 | |
| 36 | The skill assigns each artifact to its category before writing. |
| 37 | Frontmatter `feature:` and `epic:` are mandatory for FIX and IMP. |
| 38 | |
| 39 | ## MANDATORY: Backlog as single source of truth |
| 40 | |
| 41 | Every artifact this skill creates also lands as a backlog row in |
| 42 | `_devprocess/context/BACKLOG.md`. Status, phase, last-change, and |
| 43 | claim live in the row, NOT in the artifact frontmatter. |
| 44 | |
| 45 | **Defaults for reverse-engineered artifacts.** The BACKLOG |
| 46 | `Status` column uses the GitHub-aligned vocabulary |
| 47 | (`Backlog | Ready | In Progress | In Review | Done`). The ADR |
| 48 | frontmatter and the BA frontmatter carry their own status fields. |
| 49 | |
| 50 | | Item | BACKLOG Status default | Frontmatter status | BACKLOG Phase | |
| 51 | |---|---|---|---| |
| 52 | | Feature observed in code (shipped) | `Done` | (none) | `Released` | |
| 53 | | Feature observed in code (partial) | `In Progress` | (none) | `Building` | |
| 54 | | ADR inferred | `In Progress` | `Proposed` (ADR / MADR) | `Building` | |
| 55 | | BA draft | `Backlog` | `Draft (Reverse-Engineered)` | (n/a) | |
| 56 | |
| 57 | Reverse-engineered features marked `Done` go straight to phase |
| 58 | `Released` so the post-RE BA validation walk picks them up |
| 59 | correctly. |
| 60 | |
| 61 | **Sync chain (binding order):** |
| 62 | |
| 63 | 1. Create the backlog row |
| 64 | 2. Create the artifact body |
| 65 | 3. Run `/consistency-check` mode A at the end of the skill phase |
| 66 | |
| 67 | ## MANDATORY: Wayfinder + rules layer as primary outputs |
| 68 | |
| 69 | Wayfinder (templates under `skills/architecture/templates/`): |
| 70 | |
| 71 | - `src/ARCHITECTURE.map`: one row per entry-point file. |
| 72 | - JSDoc headers in every entry-point file. |
| 73 | - Module READMEs for every `src/` directory with more than 3 source |
| 74 | files or any cross-module API. |
| 75 | |
| 76 | Rules layer at `_devprocess/rules/` (hard cap 500 lines total): |
| 77 | |
| 78 | - `technical.md`: stack (from manifests), build commands, test setup, |
| 79 | conventions visible in 10+ files. |
| 80 | - `design.md` (if UI surface exists): tokens, component patterns. |
| 81 | - `domain.md`: glossary from class/module names, invariants in code. |
| 82 | |
| 83 | |
| 84 | You ingest an existing codebase and produce the V-Model artifacts that |
| 85 | *should* have existed from day one, so the team gets a stable, shared |
| 86 | project context. You walk the V backwards, from Coding up through |
| 87 | Architecture, Requirements, and Business Analysis, and fill each level |
| 88 | only with what can be **proven** from the code or from existing |
| 89 | documentation. |
| 90 | |
| 91 | The result is not a product. It is a foundation: a set of artifacts |
| 92 | every team member can trust, ready to be validated and carried forward |
| 93 | through the normal V-Model phases. |
| 94 | |
| 95 | **Writing style.** See `skills/project-conventions/SKILL.md#canonical-specs` (Writing style). Applies to every artifact this skill produces. |
| 96 | |
| 97 | **Three-layer model and frontmatter spec.** See `skills/project-conventions/SKILL.md#canonical-specs` (Three-layer model boundaries, Frontmatter spec). Status, phase, last-change, and claim live in the backlog row, not in artifact frontmatter. |
| 98 | |
| 99 | |
| 100 | ## MANDATORY: FIX/IMP and depends-on |
| 101 | |
| 102 | Work outside a Feature is either FIX-{ee}-{ff}-{nn} (bug) at |
| 103 | `_devprocess |