/digital-innovation-agents:dia-realignfrom digital-innovation-agents
Onboards repositories to current DIA conventions by detecting repo state and executing a reverse walk, script pass, or gap walk. Targets brownfield codebases and legacy DIA upgrades.
Ships in digital-innovation-agents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Successor of the retired /reverse-engineering and /dia-migration
skills. You bring a repo that predates current DIA conventions in
line with them: reverse-engineer V-Model artifacts from the code,
migrate legacy DIA artifacts with the scripts under
tools/migration/, or both.
Writing style, three-layer model, frontmatter spec. See
skills/project-conventions/SKILL.md#canonical-specs; binding for
every artifact this skill produces. Status, phase, last-change, and
claim live in the backlog row, not in artifact frontmatter.
Run python3 tools/migration/detect_state.py and pick the mode from
the JSON report:
| Detection result | Mode |
|---|---|
No _devprocess/ (recommendation brownfield-call-dia-realign-first) | A: full reverse walk |
Legacy DIA signals: old IDs, HANDOFFS.md, v1/v2 layout (recommendation run-full-migration) | B: script pass, then gap walk |
Current artifacts (recommendation v2-clean-no-migration-needed) | C: gap walk and deprecations only |
empty-repo | Not this skill. Greenfield starts at /business-analysis. |
Confirm the detected mode with the user before writing anything. Mixed states resolve toward B: the script pass is idempotent.
Standard ritual, full rules in
skills/project-conventions/references/team-workflow.md: Mode A runs
on feature/realign-<repo-name> (multi-item exception: one branch
bootstraps the whole backlog, per-item branches start AFTER merge;
full exception rules:
skills/project-conventions/references/branch-protection.md);
Modes B and C run on chore/dia-realign-<YYYY-MM-DD>. Refuse on
main / master / dev (AskUserQuestion to create and switch), no
per-item issues or phase tags during the walk, write
.git/dia-active-skill so subsequent invocations stay silent.
Every artifact this skill creates lands in one of four categories
before writing: FEATURE (observed capability), ADR (decision
inferred from code or docs), IMP (improvement candidate), FIX
(bug or drift surfaced by the scan). Frontmatter feature: and
epic: are mandatory for FIX and IMP. A DIA-Triage trailer on a
prior commit for an item answers the category question for that item.
Core rule: every claim is sourced (path:line for code,
doc:section for documentation); nothing is invented. Code tells
you what exists, not whether it solves the right problem. The gates
at the end check compliance.
Source: line. Formats:
Source: src/api/auth/handlers.ts:42-58,
Source: README.md § "Getting Started",
Source: package.json "dependencies.prisma". The BA draft is
stricter: every non-placeholder sentence carries Source:.[NEEDS USER INPUT. No evidence found in {searched sources}. /business-analysis will fill this in.] instead of a "reasonable
assumption".source: /dia-realign on {date} in frontmatter. Realign artifacts additionally carry the
tolerated draft markers from the defaults table below
(Anticipated | Observed | Inferred | Draft (reverse-engineered,
preserved by /consistency-check per N-10/N-11 until validation);
the BACKLOG row owns lifecycle status.Everything produced is draft, observed, inferred, or snapshot.
/business-analysis validates claim by claim afterwards; the
realigned artifacts are the Phase 0 state for the forward walk.
Every artifact also lands as a row in
_devprocess/context/BACKLOG.md. Sync chain (binding order): 1.
backlog row, 2. artifact body, 3. explicit /consistency-check mode
A at the end of the run. Defaults for reverse-engineered artifacts:
| Item | BACKLOG Status | Frontmatter status | BACKLOG Phase |
|---|---|---|---|
| Epic anticipated | Backlog | Anticipated (not yet validated) | Planned |
| Feature observed (shipped) | Done | Observed (not validated) | Released |
| Feature observed (partial) | In Progress | Observed (not validated) | Building |
| ADR inferred | In Progress | Inferred from codebase | Building |
| BA draft | Backlog | Draft (reverse-engineered) | (n/a) |
| Scan finding (Phase A6) | Backlog | (none) | Building |
Any artifact MAY carry depends-on: [ID, ...] (acyclic, existing
targets). Hypothesis statements and HMW headings are full prose,
never leftover template placeholders.
Walk the V backwards, one phase at a time. Detail formats for every
artifact: references/artifact-formats.md (binding).
Ask the scope tier (same tiers as /business-analysis): Simple
Test (single module, minimal artifacts, 30-60 min), PoC (full
stack extraction, 3-8 ADRs, 5-15 features, BA draft, 1-3 h), MVP
(full arc42-REFERENCE, 8+ ADRs, 15+ features, complete backlog
seed, 3-8 h). Then scan and report a Codebase Map: manifests,
top-level directories, entry points, test setup, CI config, lint
config, existing documentation. This inventory is the source pool
for the rest of the walk.
Primary outputs, templates under skills/architecture/templates/:
src/ARCHITECTURE.map (one row per entry-point file), JSDoc
headers in entry-point files, module READMEs for src/ dirs with
more than 3 source files or a cross-module API._devprocess/rules/ (hard cap 500 lines total): technical.md
(stack from manifests, build commands, conventions visible in 10+
files), design.md (only with UI surface), domain.md (glossary
from class/module names, invariants in code). In the lean profile
(profile = "lean" in .dia/config.toml) seed
_devprocess/SYSTEM-MAP.md and decisions/README.md instead._devprocess/requirements/handoff/plan-context.md from
plan-context-TEMPLATE.md: a pure reference index, cap 20 lines.
It names where decisions live; stack facts go into
rules/technical.md, never into plan-context.Identify decisions that are visible and consequential AND
non-obvious from framework defaults; skip the rest. One ADR per
decision from ADR-TEMPLATE.md with kind: post-hoc (Context,
Decision, Consequences, Sources; Considered Options omitted). Code
paths that embody the decision go into ## Sources. Frontmatter
status Proposed plus the provenance marker. Write to
_devprocess/architecture/ADR-{nn}-{slug}.md.
Then produce _devprocess/architecture/arc42-REFERENCE.md from
arc42-REFERENCE-TEMPLATE.md (post-code, cap-exempt). Fill only
sections you can back with sources; omit sections without substance.
Do NOT write arc42-CONSTRAINTS (that is a pre-code artifact; a
later /architecture run creates it when new work starts).
Sources for capabilities: routes, controllers, CLI commands, public API, rendered pages, public exports, test descriptions.
EPIC-{nn}-{slug}.md per cluster with
status: Anticipated (not yet validated) and an Evidence list.
No obvious clusters: single EPIC-01-observed-capabilities.md.FEAT-{ee}-{ff}-{slug}.md per
observable capability, Status: Observed in the backlog sense,
description sourced, Benefits Hypothesis / User Stories / Success
Criteria as [NEEDS USER INPUT]. Short capability names; never
lump capabilities.[AWAITING BA] unless the code
declares a deterministic target (timeouts, rate limits, perf
assertions), then the observed value goes in with Source:.
Satisfies invariant N-4 (every feature has at least one SC).The most constrained phase. Read README, docs/, manifest
description/keywords, CHANGELOG, landing copy, issue/PR templates,
contributing guides. Build _devprocess/analysis/BA-{PROJECT}.md
from the 40-line BA-TEMPLATE.md (five questions). Each section is
either evidence-backed (every sentence with Source:) or a
[NEEDS USER INPUT] placeholder. Count filled-from-sources and
needs-user-input in the header so /business-analysis knows the
remaining work. Long-form sections (BA-EXTENDED) only on request.
Scan for TODO/FIXME/HACK/XXX, skipped tests, undocumented env vars,
missing test coverage on observed features, outdated dependencies,
missing CI steps. Verify before filing: read code AND doc the
finding points at; drop findings whose target is already satisfied.
Each survivor becomes a Standalone Items row: Status = Backlog,
Prio = P2, Source = REV, Evidence = path:line, Typ = Chore
(or Security / Bug-Followup), Notes = anticipated; needs verification: code-vs-doc. Title column carries the bare title
only (the ID lives in column 1). If the skill seeds the backlog
file, copy the template headers from
skills/requirements-engineering/templates/BACKLOG-TEMPLATE.md
first and update dashboard counts after all rows. Phase mapping:
Released (fully implemented), Building (partial or awaiting
validation, the default for realigned items), Planned
(anticipated, needs refinement).
Brings an existing DIA repo to current conventions, then fills gaps.
| Script | Step | Purpose |
|---|---|---|
detect_state.py | 0 | Inventory the repo, classify v1/v2/mixed/brownfield. JSON output. |
strip_frontmatter_status.py | 2a | Remove status: / phase: / last_updated: from YAML frontmatter. |
strip_body_status.py | 2b | Remove body-level **Status:** / > **Status**: lines. |
migrate_naming.py | 3 | Rename ID schemas (FEATURE-NNNN to FEAT-EE-FF, EPIC-NNN to EPIC-NN, ADR/PLAN leading zeros, Item-BA filenames), rewrite cross-refs. |
flatten_analysis.py | 4 | Flatten analysis/ to four prefixes (BA, EXPLORE, RESEARCH, AUDIT) plus sources/; move legacy mini-BAs. |
build_backlog.py | 5 | Regenerate BACKLOG.md from artifact scan; restore ba-ref:; previous version saved as BACKLOG.md.preMigration. |
migrate_status_vocabulary.py | 5b | Map legacy Status values to the GitHub-aligned vocabulary. |
migrate_skill_names.py | 6 | Rewrite legacy skill names to current ones (includes the two predecessors of this skill). |
shrink_artifacts_v3.py | 6b | Align existing artifacts with the shrunk v3.6 templates; dry-run default, --apply to write. |
All scripts accept the project root as argument, print a summary, are idempotent, and exit non-zero on error so the pipeline stops.
build_backlog.py writes
BACKLOG.md.preMigration; per-step commits
(chore(dia-realign): step N -- summary) keep every step
reversible via git reset --hard HEAD.src/ARCHITECTURE.map and
optional module READMEs; JSDoc headers are proposed, not
auto-written. Files outside _devprocess/ and src/ stay
untouched. Deletes are listed before execution.Each step is one script call plus confirmation; each is independently re-runnable and commits on success.
detect_state.py: present the one-page plan, get confirmation._devprocess/rules/ and
src/ARCHITECTURE.map from skills/architecture/templates/,
create requirements/{epics,features,fixes,improvements,handoff}/,
move context/fixes|improvements/ under requirements/. Lean
profile: SYSTEM-MAP and DECISIONS-README templates instead of
the rules files.strip_frontmatter_status.py, then strip_body_status.py:
status truth moves to the backlog.migrate_naming.py: show the rename plan, then execute (file
renames, then global ref rewrite). Numbering collisions: the
series with more external references wins, the smaller one is
renumbered with a header note. Duplicate topics merge under the
newer structure with a "Previous variants" note; no silent
deletes.flatten_analysis.py: show the move list, then execute.build_backlog.py: show the backlog preview, confirm overwrite.
Then migrate_status_vocabulary.py (edits only the Status
column).migrate_skill_names.py, then shrink_artifacts_v3.py all./consistency-check mode A with --fix for safe drift
types; human-triage findings become BL-NNN rows with
Source = CONSISTENCY-CHECK.A failing script exits non-zero; the skill stops before the next
step. git reset --hard HEAD undoes the failed step (previous
steps are committed); re-running /dia-realign re-detects state
and resumes at the first dirty step. Backlog-only rollback: restore
BACKLOG.md.preMigration over BACKLOG.md.
For repos whose artifacts are already current. Run the gap walk (Mode B step 8) for anything missing, then make the deprecation offers. Offers only, never forced; each via AskUserQuestion with a "keep as is" option.
DIA-Phase, DIA-Handoff, DIA-Triage; spec:
skills/project-conventions/references/canonical-specs.md,
"Phase-end commit trailers"). Offer: prepend a deprecation header
("retired, replaced by DIA commit trailers, kept as audit trail")
and optionally move the file to
_devprocess/context/archive/HANDOFFS-legacy.md. Never rewrite
or delete its entries.arc42.md files, and prose-style plan-context.md files count
as "legacy format, valid". No forced migration; offer the split
(BA to 40-line core plus BA-EXTENDED, arc42 to CONSTRAINTS plus
REFERENCE, plan-context to the 20-line ref index) only when the
user asks for it or actively reworks the artifact.The anti-fabrication anchor. Before the handoff ritual, every FEATURE spec and every ADR produced in Mode A (and every artifact the gap walk touched) gets an explicit verification against the codebase. This lifts claims from "we wrote it down" to "we checked it against reality".
Per FEATURE and ADR, append a verification footer:
Codebase-Verifikation {date}: Released, no drift.## Codebase-Verifikation ({date})
**Phase:** {Released | Building | Planned | Candidates}
**Refinement-Bedarf:** {none | reason}
**Verifikations-Befund:**
- Source-Pfade geprueft: {n/m existieren}
- Success-Criteria-Stichprobe (Features) oder Kern-Decision (ADRs): {n/m belegt}
- Drift-Findings: {"Doc: X / Code: Y / Einschaetzung: ..."}
**Backlog-Vorschlag:** {none | concrete FIX/IMP text}
Large projects (20+ FEATUREs, 30+ ADRs): split into 3-6 concurrent agents with non-overlapping file slices; consolidate phase counts into the Backlog Dashboard. Every drift finding that is not a one-line doc edit becomes a backlog row.
Verify the Phase A6 findings too. Per Standalone row with
Source = REV and the needs verification: code-vs-doc marker:
target already satisfied means Status = Done, Phase = Released,
marker removed, note verified {date}: already present in <ref>;
gap confirmed means marker removed, Status = Backlog stays;
undecidable means marker stays plus needs refinement: {reason},
escalate. No finding reaches GitHub while it still carries the
marker.
Facts that a canonical carrier already holds are never restated in realign artifacts; the artifact points at the carrier instead.
| Fact class | Canonical carrier | In realign artifacts |
|---|---|---|
| Stack versions, dependencies | manifests (package.json, ...) | pointer from rules/technical.md |
| Current file paths, entry points | src/ARCHITECTURE.map | pointer only |
| Directory tree | the repo itself | never repeated (also not in arc42) |
| Status, phase, claim | BACKLOG row | never in frontmatter or body |
| History, authorship | git log / PRs | never |
| Behavior under test | test files | referenced as SC evidence |
/consistency-check mode A (the
pre-commit hook covers day-to-day; this run is one of the
mandated explicit invocations). --deep only at MVP scope with
a valid BA.python3 tools/renumber-for-merge.py --target <realign-branch> --source-ref <branch> --list-conflicts; report id collisions
in the console and the BACKLOG Notes. Report only; never modify
other branches.skills/project-conventions/references/team-workflow.md,
"Phase-end commit (binding)"). Canonical message:chore(realign): <repo-name> realign complete
<N FEATUREs, M ADRs, BA draft, K backlog rows>
Refs: <repo-name>
DIA-Handoff: <repo-name> -> business-analysis
Realign is not a V-phase, so the commit carries no DIA-Phase
trailer and sets no phase tag; item-level tags
(<id-lower>/realigned) are set later by /dia-guide during the
item promotion. Skip silently on a clean
tree.
6. Transition question.
"Technical context is captured. The BA draft is evidence-based but NOT validated; {N} sections are
[NEEDS USER INPUT]. Next:/dia-guideruns the post-realign item promotion (issues, tags), then/business-analysisvalidates the draft. Start now, or review the artifacts first?"
On agreement: /dia-guide for item promotion, then
/business-analysis (Validation Mode auto-detects the draft BA).
On rejection: pause; artifacts stay in _devprocess/.
Simple Test: A1-A3 only, no BA draft; output is plan-context, rules seed, 1-3 ADRs. PoC: A1-A5, arc42-REFERENCE reduced to context and solution strategy, no exhaustive backlog scan. MVP: all phases, full rigor. Do not over- or under-produce.
Follows /project-conventions. Root detection before writing:
docs/adr/ or docs/architecture/ means docs/ root;
_devprocess/ is canonical; CLAUDE.md hints win; default
_devprocess/. Ensure the standard directory tree exists
(mkdir -p {ROOT}/{analysis,requirements/{epics,features,fixes,improvements,handoff},architecture,adr,context,implementation/plans}).
adr/ is canonical for ADRs; consolidate architecture/ADR-*.md
into adr/ during the script pass. Do not create HANDOFFS.md
(retired; see Mode C).
realign, reverse engineering, existing project, legacy codebase, brownfield, onboard existing, we already have code, extract artifacts, DIA migration, upgrade DIA, migrate v1, migrate v2, restructure backlog, FEATURE to FEAT, status drift cleanup, bestehendes Projekt, existierender Code, Legacy-Projekt
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub pssah4/digital-innovation-agents --plugin digital-innovation-agents13 skills in this plugin
/architectureCreates architecture decision records (post-hoc by default, full MADR for constraints), the arc42 constraints doc, navigation artifacts (SYSTEM-MAP, decisions router), and plan-context.md as ref index. Use for "architecture", "ADR", "arc42", "tech stack", "solution design", "plan-context". Proposals only; /coding decides.
/business-analysisCondenses a structured dialog about problem, users, and scope into a short BA record that feeds requirements engineering. Use when the user mentions "Business Analysis", "BA", "Problem Analysis", "Personas", "Define Scope", "Explore", "How might we", "Value Proposition", or starts a new project without a clear requirement.
/codingHandoff and bug-capture skill: loads plan-context and design artifacts, reviews them critically against the real codebase, and keeps artifacts in sync during and after implementation. TDD is the default. Use for "implement", "code", "build feature", "realize plan-context", "Bug gefunden", "es gibt einen Fehler", "Fix erfassen".
/consistency-checkVerifies the V-Model artifact graph: Epics, Features, ADRs, PLANs, Backlog, Wayfinder rows, code refs. Syntactic and semantic modes. Explicit user command for "consistency check", "graph check", "dead links", "orphan features", or before a release; routine enforcement runs via the pre-commit hook, not per phase.
/dia-bootstrapBootstrap context for the Digital Innovation Agents V-Model workflow. Auto-loaded at session start by the SessionStart hook (unless mode = off). Carries the entry-point catalog, the helper-script path resolution rule, the activation contract, and opt-out behaviour. The user does not invoke this skill manually./dia-guideGuides users through the V-Model workflow: takes stock of the project state, recommends the next phase skill, audits handoff state, and runs the Closing Handoff after a green security audit. Explicit user command for "where do I start", "what comes next", "wo bin ich gerade", "was kommt jetzt". Never for individual phase work.
Other plugins' skills for the same job