/app-development:refactor app-namefrom app-development
Rework existing data model and engineering decisions using Apple best practices
Ships in app-development. Installing the plugin adds it to Claude Code.
You are reworking an app whose data model, persistence strategy, or performance approach needs revision. You read the existing engineering decisions, compare against what Apple actually recommends, keep what's good, and fix what's wrong.
These are non-negotiable.
engineering/entities/<entity-name>.md. No monolithic files.engineering/relationships.md.Same as the model command:
engineering/
requirements.md # Data requirements (updated if changed)
persistence.md # Strategy rationale (current truth)
relationships.md # Entity relationship graph (current truth)
migrations.md # Schema migration plan (appended)
performance.md # Performance plan (updated if exists)
monitoring.md # Monitoring plan (updated if exists)
entities/
<name>.md # One file per entity (current truth)
.claude/app-development.local.md for project contextengineering/requirements.md for data requirementsengineering/persistence.md for current persistence strategyengineering/requirements.md or engineering/persistence.md are missing, tell the user to run /app-development:model first — STOP hereengineering/relationships.mdengineering/migrations.mdengineering/performance.md (if exists)engineering/monitoring.md (if exists)engineering/entities/${CLAUDE_PLUGIN_ROOT}/skills/apple-engineering/SKILL.md for the reference structuredesign/features.md → current feature listdesign/screens/*.md → current screen specsengineering/requirements.md (if present)If design drift is detected, present it before Step 0:
"Design drift detected since your last engineering pass:"
- New in design: [features/screens added since engineering was defined]
- Removed from design: [features/screens no longer in design — check for orphaned entities]
- Unchanged: [features/screens still aligned]
Walk through the data requirements with the user to check for drift since the original model.
For each requirement in engineering/requirements.md:
If requirements have changed, update engineering/requirements.md before proceeding.
Do NOT proceed until the user confirms understanding of ALL requirements.
Read ${CLAUDE_PLUGIN_ROOT}/skills/apple-engineering/indexes/data-by-need.md.
Read existing engineering/persistence.md. Compare the current strategy against what Apple's reference docs actually recommend for the (possibly updated) requirements.
Read the FULL reference from ${CLAUDE_PLUGIN_ROOT}/skills/apple-engineering/references/data/ for each candidate.
In the conversation, present analysis with Apple quotes. Explicitly state KEPT / CHANGED for the persistence strategy. Present alternatives with citations.
Ask: "Is the current persistence approach still right, or should we change it?"
engineering/persistence.mdCurrent truth only. No comparison notes.
Read existing entity files from engineering/entities/.
For each entity, assess:
In the conversation, present each entity with KEPT / CHANGED / NEW / REMOVED status:
### [Entity Name] — [KEPT / CHANGED / NEW / REMOVED]
**Reason**: [Why this decision]
**Apple says**: "[Direct quote if relevant]"
**Changes**: [List specific property/relationship changes, or "No changes"]
Ask the user to confirm before saving each entity.
engineering/entities/<entity-name>.mdCurrent truth only. Delete entity files for entities that no longer exist. Create new files for new entities.
After entity changes, rebuild the relationship graph.
Read the relationship documentation from the reference files.
In the conversation, compare the old graph with the new:
Walk through cascade analysis for any changed delete rules.
engineering/relationships.mdCurrent truth only — updated graph, table, cascade analysis.
This is the one file that DOES accumulate history — each schema version builds on the previous.
Read engineering/migrations.md. Append the new version:
### V[N] — [Description of changes]
**Changes from V[N-1]**:
- [Entity added/removed/changed]
- [Property added/removed/changed]
- [Relationship changed]
**Migration type**: [Lightweight / Staged / Heavyweight]
**Migration steps** (if staged/heavyweight):
1. [Step 1]
2. [Step 2]
**Test plan**:
- [ ] Upgrade from V[N-1] with production-size data
- [ ] Verify no data loss
- [ ] Verify CloudKit schema compatibility (if syncing)
If engineering/performance.md and engineering/monitoring.md exist, review them in light of the model changes:
In the conversation, note which performance/monitoring items need updating. Update files with current truth.
Present a summary of what changed:
"Here's your refactored data model for [App Name]:"
Files updated:
engineering/requirements.md — Requirements (if changed)engineering/persistence.md — Persistence strategyengineering/relationships.md — Entity relationship graphengineering/migrations.md — Migration plan (new version appended)engineering/entities/*.md — Per-entity specsengineering/performance.md — Performance plan (if applicable)engineering/monitoring.md — Monitoring plan (if applicable)What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
5 commands in this plugin
/debugiOS DebuggingDiagnose and fix issues using Apple's debugging tools — LLDB, Instruments, crash logs/engineerApp Development — Full WorkflowFull App development workflow — check progress and continue from where you left off/modeliOS Data ModelingDefine data model — entities, relationships, persistence strategy, and migrationsOther plugins' commands for the same job
npx claudepluginhub pproenca/dot-claude --plugin app-development