From digital-innovation-agents
Migrates existing DIA v1/v2 repos to current conventions: detects state, strips status duplicates, renames IDs (FEATURE-NNNN→FEAT-EE-FF), flattens analysis/, regenerates BACKLOG.md, updates references, runs consistency check. Idempotent.
npx claudepluginhub pssah4/digital-innovation-agents --plugin digital-innovation-agentsThis skill uses the workspace's default tool permissions.
Convenience wrapper that brings an **existing DIA repo** to current
Reverse-engineers existing codebases into V-Model artifacts: plan-context.md, ADRs, arc42 snapshot, FEATURE inventory, backlog seed, evidence-based BA draft. Use for brownfield projects or when V-Model artifacts are missing.
Plans and executes phased migrations for framework upgrades, API bumps, dependency major versions, and deprecations with compatibility verification.
Migrates existing projects to AgenticDev structure using AI analysis to discover, categorize docs, generate frontmatter, update links, and preserve git history. For brownfield projects with ad-hoc documentation.
Share bugs, ideas, or general feedback.
Convenience wrapper that brings an existing DIA repo to current
conventions. Not a brownfield onboarding skill -- for that, use
/reverse-engineering, which contains the same migration mechanics
plus a full code-walk for missing artefacts.
Designed for two starting states:
For brownfield without V-Model artefacts (code exists, no
_devprocess/ directory): the answer is /reverse-engineering.
That skill detects pre-existing partial artefacts, runs the same
migration scripts as Phase -1.5, then walks the code to produce
the missing artefacts. Do not start with /dia-migration for
brownfield -- you would only get the migration step without the
artefact-bootstrap from code.
The skill is idempotent. Running it on an already-current repo performs the consistency check and exits without changes.
Migration is a cross-cutting maintenance operation, not a V-Model phase. It does not target a backlog item; it touches many artefacts across the repo. Therefore migration runs on a dedicated branch and does not set V-Model phase tags.
Branch convention: chore/dia-migration-<YYYY-MM-DD>.
Check at start (full rules:
skills/project-conventions/references/team-workflow.md):
main / master / dev: refuse, AskUserQuestion to
create chore/dia-migration-<YYYY-MM-DD> and switch.chore/* /
feature/* branch the user explicitly confirms): silent continue.GitHub integration: migration does NOT create a per-item issue or
draft PR. The migration commits go in as a single chore PR
(chore/dia-migration-<date> -> dev). The user opens that PR
manually after Phase 7 completes.
Phase tags: migration does NOT set V-Model phase tags
(<id>/ba-done etc. are reserved for backlog items). It does
write progress markers via per-phase commits with the message
prefix chore(dia-migration): phase <N> -- <summary> so the
history is reviewable.
State stored in .git/dia-active-skill so subsequent invocations
of the migration loop stay silent if everything matches.
This skill orchestrates the scripts under tools/migration/ in the
DIA repo:
| Script | Phase | Purpose |
|---|---|---|
tools/migration/detect_state.py | 0 | Inventory the repo, classify v1/v2/mixed. |
tools/migration/strip_frontmatter_status.py | 2a | Remove status: / phase: from YAML frontmatter. |
tools/migration/strip_body_status.py | 2b | Remove body-level **Status:** / > **Status**: lines. |
tools/migration/migrate_naming.py | 3 | Rename ID schemas (FEATURE-NNNN -> FEAT-EE-FF, etc.). |
tools/migration/flatten_analysis.py | 4 | Flatten analysis/ to BA / EXPLORE / RESEARCH / AUDIT. |
tools/migration/build_backlog.py | 5 | Regenerate BACKLOG.md from artefact scan. |
tools/migration/migrate_skill_names.py | 6 | Rewrite /business-analyse -> /business-analysis, |
/v-model-workflow -> /dia-guide. |
/reverse-engineering reuses the same scripts under Phase -1.5.
Both skills share the canonical implementation; this one wraps it
with a phase-by-phase confirmation loop, the other one runs them
silently as part of the backwards walk.
Every artifact this skill writes follows the rules in
skills/project-conventions/SKILL.md under "Writing style for every
artifact". No em dashes, no AI vocabulary, no negative parallelisms,
sentence case in headings.
User says:
Or: another skill (typically /dia-guide on first run against
a non-conforming repo) calls /dia-migration to bring the structure
in line before continuing.
The skill operates on a feature branch. It does not push, it does not touch source code, and it does not delete user-authored content without explicit confirmation. Concrete rules:
main, master, or
dev. The user must create a migration branch first
(git checkout -b feature/dia-migration is the typical name).src/ (or the project's code root) is only
edited to add src/ARCHITECTURE.map and optional
src/{module}/README.md files. JSDoc headers in .ts/.js
files are NOT auto-written. The skill proposes a list and asks._devprocess/ and src/ are not touched.archive/ folders, the
legacy 20_bugs.md, and superseded handoff files are removed
only after the user sees the list.The skill walks seven phases. Each phase is independently re-runnable. If a phase fails, the next one is not started.
Inventory the repo and classify it. Outputs a one-page plan for user review.
_devprocess/, docs/, or none.FEATURE-NNNN (4-digit) -> v1FEAT-NN-NN -> v2_devprocess/context/fixes/ -> v1_devprocess/requirements/fixes/ -> v2_devprocess/context/20_bugs.md -> v1archive/ directory under _devprocess/ -> v1status: or phase: fields -> v1**Status:** headers in artifacts -> v1_devprocess/ and no docs/) -> hand off to
/reverse-engineering first, then continue hereThe plan is saved as a Markdown report at
_devprocess/context/HANDOFFS.md under a new entry
dia-migration plan {date} and printed for the user.
Create the layers that DIA v2 requires regardless of starting state.
_devprocess/rules/ with technical.md (always),
design.md (only if the project has UI surface), domain.md
(always). Seeded from
skills/architecture/templates/RULES-*-TEMPLATE.md. If files
already exist, leave them in place but check the line budget
(max 500 lines total).src/ARCHITECTURE.map seeded from
skills/architecture/templates/ARCHITECTURE-MAP-TEMPLATE.md. If
a map already exists, validate it; otherwise scan src/ for
entry-point candidates (large files containing class,
interface, Manager, Service, Registry, Pipeline in
their names) and propose initial rows. The user confirms before
writing._devprocess/requirements/{epics,features,fixes,improvements,handoff}/
directories. Move existing _devprocess/context/fixes/ to
_devprocess/requirements/fixes/ and same for improvements/._devprocess/analysis/ flattened: analysis/security/AUDIT-*
moves to analysis/ root, archive/ deleted (with the file
list shown to the user first)._devprocess/context/20_bugs.md deleted. The backlog regenerated
in Phase 5 carries the FIX status.Every artifact under _devprocess/requirements/, architecture/,
implementation/plans/, context/fixes/, context/improvements/
gets two passes:
status:, phase:, last_updated:,
last-updated:, lastUpdated: lines from the YAML frontmatter.
Multi-line values are removed entirely.**Status:** X, > **Status:** X,
Status: Implemented, Status: Akzeptiert, etc. Also
**Last Updated:** ... and German equivalents.Run via tools/migration/strip_frontmatter_status.py and
tools/migration/strip_body_status.py (both live under tools/migration/ in the DIA repo).
After this phase, the repo's status truth lives ONLY in the backlog.
Renames artifact files and updates all cross-references in
.md-files plus src/ARCHITECTURE.map. Idempotent.
| Old pattern | New pattern | Notes |
|---|---|---|
EPIC-NNN-{slug}.md | EPIC-{nn}-{slug}.md | strip leading zero, fits in 2 digits |
FEATURE-NNNN-{slug}.md | FEAT-{ee}-{ff}-{slug}.md | prefix change FEATURE -> FEAT, hyphen split |
FEATURE-NNN-{slug}.md | FEAT-{ee}-{ff}-{slug}.md | legacy 3-digit (e.g. FEATURE-400) gets normalized |
FIX-{eeff}-{nn}-{slug}.md | FIX-{ee}-{ff}-{nn}-{slug}.md | hyphen split for clarity |
IMP-{eeff}-{nn}-{slug}.md | IMP-{ee}-{ff}-{nn}-{slug}.md | analog |
ADR-NNN-{slug}.md | ADR-{nn}-{slug}.md | strip leading zero |
PLAN-NNN-{slug}.md | PLAN-{nn}-{slug}.md | strip leading zero |
BA-NNN-{slug}.md | BA-{nn}-{slug}.md | strip leading zero |
EXPLORE-NNN-{slug}.md | EXPLORE-{nn}-{slug}.md | strip leading zero |
RESEARCH-NNN-{slug}.md | RESEARCH-{nn}-{slug}.md | strip leading zero |
| handoff files | architect-handoff-FEAT-{ee}-{ff}.md, plan-context-FEAT-{ee}-{ff}.md | per active feature stream |
Run via tools/migration/migrate_naming.py. The script does two passes: first
the file renames, then a global text replacement of references using
the rename map. A second sweep catches body references to IDs that
do not have a corresponding file (e.g. an EPIC-023 mentioned in
prose but never created).
When the file count exceeds 99 in any class, the script suggests
extending that class to 3-digit (e.g. EPIC-100). The user confirms
before applying. Until then, 2-digit is the default.
The append-only _devprocess/context/HANDOFFS.md is exempt from
the body sweep. Historical entries keep their original IDs as
audit-trail records.
Reduces the analysis/ directory to four flat prefixes (BA-,
EXPLORE-, RESEARCH-, AUDIT-) at the root, plus a single
sources/ subfolder for user-provided source documents.
CODEBASE-NNN, DESIGN-NNN, SECURITY-NNN, SPIKE-NNN,
FINDING-, ROOT-CAUSE-, GAP-ANALYSE-, SOLUTION-PROPOSAL-,
SCAFFOLD-, MOBILE-, STANDALONE-, TEMPLATE-, REVIEW-,
ANALYSIS-, HANDOFF- -> renamed to RESEARCH-NN-{originalprefix-slug},
preserving the old prefix in the slug for traceability.analysis/security/AUDIT-*.md -> moved to analysis/AUDIT-*.md
(flat).analysis/security/ and analysis/archive/ directories deleted
(archive content has typically been replaced by the backlog).analysis/SOURCE-* (any extension) -> moved to analysis/sources/SOURCE-*.
This is the only subfolder that survives the flatten because
user-provided sources are not engineered artefacts and benefit
from a clean separation._devprocess/articles/ if present.Run via tools/migration/flatten_analysis.py.
Build _devprocess/context/BACKLOG.md from scratch by scanning
all artifacts. The new backlog is the single source of truth for
status, phase, claim, and Refs.
last_shipped_adr + 1, asked from the user once).epic:,
adr-refs:, feature-refs:, related:, supersedes:,
superseded-by:.BACKLOG.md is overwritten only after the
user confirms (the script saves the previous version under
BACKLOG.md.preMigration for one-step rollback).Run via tools/migration/build_backlog.py. The script is parameterized
through a small YAML config that the user can edit before the run
(epic cutoffs, status overrides for known exceptions).
If the repo references the old skill names (/business-analyse,
/v-model-workflow), this phase rewrites them to the current names
(/business-analysis, /dia-guide). It also updates skill
folder references in CLAUDE.md, README, and any inline scripts.
This phase is a no-op for repos that already use v2 skill names.
Runs /consistency-check mode A (syntactic) and reports findings.
Auto-fix is applied for the safe drift types:
status: or phase: fields lingering anywhere_devprocess/Findings that need human triage (orphan ADRs, ADR abstraction
violations, true semantic conflicts) are listed in the final
report and parked as BL-NNN rows in the backlog with
Source = CONSISTENCY-CHECK.
If the consistency check passes, the skill writes a final entry to
_devprocess/context/HANDOFFS.md:
## dia-migration {YYYY-MM-DD} -- migration complete
Phases run: 0 (detection), 1 (foundation), 2 (status cleanup),
3 (naming), 4 (analysis flatten), 5 (backlog), 6 (skill renames),
7 (consistency).
Counts after migration:
- Artifacts: {N}
- Backlog rows: {N}
- ADR catalog entries: {N}
- Status drift remaining: 0
- archive/ folders remaining: 0
The migration scripts live in the DIA repo at tools/migration/ and are shared with /reverse-engineering:
| Script | Purpose |
|---|---|
tools/migration/detect_state.py | Phase 0 detection. Returns a JSON report. |
tools/migration/strip_frontmatter_status.py | Phase 2a. Removes status fields from YAML frontmatter. |
tools/migration/strip_body_status.py | Phase 2b. Removes status headers from artifact bodies. |
tools/migration/migrate_naming.py | Phase 3. Renames files and updates references. |
tools/migration/flatten_analysis.py | Phase 4. Reduces analysis/ to four prefixes. |
tools/migration/build_backlog.py | Phase 5. Regenerates the backlog from all artifacts. |
tools/migration/migrate_skill_names.py | Phase 6. Updates /business-analyse and /v-model-workflow references. |
All scripts:
detect_state.py, present the plan to the
user, get confirmation. Stop if user declines./consistency-check mode A
with --fix. Final report.Each phase ends with a commit message:
chore(dia-migration): phase N -- {short summary}.
The user can interrupt between phases. Re-running /dia-migration
picks up at the next dirty phase based on the detection output.
At the end of a successful run:
DIA migration complete on branch {branch}.
Summary:
- Phases executed: 7/7
- Files renamed: {N}
- References updated: {N}
- Status fields cleaned: {N}
- archive/ folders removed: {N}
- Backlog rows: {N}
Next steps:
1. Review the migration commits.
2. Merge the branch when satisfied.
3. /dia-guide picks up the project state from here.
If a phase fails:
git reset --hard HEAD to undo the failed phase
(the previous phases are already committed)./dia-migration re-detects state and resumes at the
first dirty phase.For Phase 5 specifically (backlog overwrite), the previous backlog
is preserved as BACKLOG.md.preMigration. To roll back the
backlog rewrite without rolling back commits:
mv _devprocess/context/BACKLOG.md.preMigration \
_devprocess/context/BACKLOG.md
DIA migration, V-Model migration, repo migration, DIA v1, DIA v2, upgrade conventions, restructure backlog, status drift cleanup, filename migration, FEATURE to FEAT, EPIC numbering, ADR numbering, analysis flattening, archive cleanup, brownfield to V-Model.