Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
cygnusfear avatar

Domain First Architecture Delphi

  • 16 installs
  • Updated January 1, 1970
  • cygnusfear/agent-skills

Refactors component-based code toward domain ownership when responsibility is split across technical buckets, fixing god files and hidden dependency flow.

About

Domain-first-architecture-delphi is a Claude Code skill for when a codebase feels component-based but ownership is scattered across technical buckets like tables, init, and debug - producing god files, duplicate paths, and hidden dependency flow. A solo builder uses it to restructure the code around domains so ownership and dependencies become clear.

  • Shifts to domain-first ownership
  • Breaks up god files
  • Untangles hidden dependency flow

Domain First Architecture Delphi by the numbers

  • 16 all-time installs (skills.sh)
  • Ranked #10,994 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cygnusfear/agent-skills --skill domain-first-architecture-delphi

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs16
Last updatedJanuary 1, 1970
Repositorycygnusfear/agent-skills

What it does

Refactors component-based code toward domain ownership when responsibility is split across technical buckets, fixing god files and hidden dependency flow.

Who is it for?

Restructuring scattered ownership

Skip if: Greenfield projects

Files

SKILL.mdMarkdownGitHub ↗

Domain-First Architecture Delphi

Overview

Use Delphi to expose one specific structural failure: the code claims domain modeling, but ownership is organized by technical buckets (all tables together, all init together, all debug together).

This skill does not ask “what files are big?” It asks: 1. What is the canonical path per concept? 2. Where are alternate paths? 3. Which alternates are duplicates vs diverged behavior? 4. What is the minimum replace→wire→delete sequence?

REQUIRED SUB-SKILL: delphi

---

Use This Skill When

Use when 2+ are true:

  • A single file defines many domains (or 1000+ lines with unrelated ownership).
  • Init logic for multiple domains is fused into one orchestration block.
  • Adding one domain feature touches 4+ files across 3+ directories.
  • You see repeated “must match X in Y” comments.
  • You suspect multiple sources of truth for one concept.
  • You need ticketable seams, not generic “refactor” advice.

Do not use for style cleanup, naming cleanup, or lint-only reviews.

---

Required Artifacts (Non-Negotiable)

Every run must produce these artifacts.

1) Concept Inventory

ConceptCanonical PathAlternate Paths FoundDivergence TypeEvidence

Divergence types:

  • DUP_PATH — copy of same logic
  • DIVERGENT_PATH — same concept with behavior drift
  • MULTI_SOURCE — multiple sources of truth
  • LAYER_MISMATCH — ownership split by layer bucket
  • HIDDEN_DAG — init dependency exists but not explicit

2) Architectural Mismatch Matrix

DomainSchema OwnerInit OwnerRuntime OwnerDebug OwnerFiles Touched for One ChangeMismatchSeverity

3) Init Dependency DAG (with payloads)

Must include data carried by each edge, not just control flow.

Example:

spawn_planets -> planet_entity_ids
planet_entity_ids -> seed_markets
planet_entity_ids -> spawn_npcs

4) Replace→Wire→Delete Map (per finding)

Replace: old_fn_a, old_fn_b
Wire: callers X/Y/Z -> canonical_fn
Delete: old_fn_a, old_fn_b after verification

No map = no actionable finding.

---

Process

Phase 0 — RED Baseline (Before Guidance)

Run 3 workers without this skill prompt. Force scenario tasks: 1. Planet feature change crossing map+zone+market 2. Ship/module change crossing spawn+tactics+loot 3. NPC debug command + trace change

Record:

  • Files touched
  • Dirs touched
  • Cross-layer hops
  • Worker rationalizations (verbatim)

Phase 1 — Parallel Delphi Lenses

Run 5 workers in parallel using worker-prompts.md:

  • Domain ownership mismatch
  • Change-coupling / friction
  • Init DAG extraction
  • False-constraint audit (framework myths vs real constraints)
  • Safe seam extraction

Phase 2 — Synthesis

Merge findings into the 4 required artifacts. Reject any finding lacking file/symbol evidence.

Phase 3 — Ticketization

Create: 1. One synthesis ticket 2. One ticket per P0/P1 finding

Each ticket must contain:

  • Goal
  • Exact seam boundary
  • First move-only step
  • Acceptance criteria
  • Verification commands
  • Dependencies

---

Scoring Rules

Per finding:

  • Severity: P0 | P1 | P2
  • Friction score: files_touched + (dirs_touched * 2) + (cross_layer_hops * 3)
  • Blast radius: low | medium | high
  • Confidence: high | medium | low
  • Evidence: file + symbol + line range

If score or evidence is missing, drop the finding.

---

Guardrails

  • Do not propose “lint rules” as primary solution for semantic duplication.
  • Do not substitute PR process templates for architectural detection.
  • Do not open with monolithic rewrites.
  • Start with move-only splits + re-exports, then extraction, then behavior changes.
  • Re-run concept inventory after each stage and compare deltas.

Success means alternate paths shrink and divergence labels resolve.

Related skills

AI & Agent Buildingbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.