From universe
Detects architectural drift by comparing code modules' original git commit state to current, measuring changes in purpose, exports, imports, responsibilities, and size.
npx claudepluginhub mbwsims/claude-universe --plugin universeThis skill is limited to using the following tools:
Detect architectural drift — when code quietly evolves away from its original purpose.
Traces evolution of files or functions through git history to identify structural commits adding complexity. Helps assess necessity for refactoring.
Analyzes git history to detect codebase hotspots (frequent changes/bug fixes), decay signals (accelerating churn), and inconsistencies (multiple authors/patterns). Use before refactoring or investigating recurring bugs.
Analyzes git history to find code hotspots, temporal coupling between files, contributor knowledge distribution, and bus factor risks. Useful for queries on code ownership, frequent changes, or evolution.
Share bugs, ideas, or general feedback.
Detect architectural drift — when code quietly evolves away from its original purpose. A utility module that accumulated business logic. A handler that grew a database layer. A focused service that became a god object. Drift is invisible in any single commit but obvious when you compare the first version to the current one.
timewarp_history (if available) or git log to find
files whose scope appears to have changed the most. Analyze the top 3 most-drifted modules.
If MCP is unavailable, pick the 3 largest files in core source directories and analyze
those.timewarp_history data boundary:
timewarp_historyreturns commit counts, authors, most-changed files, and file change frequency. It does NOT return export counts, import counts, or file content. You must read each file directly (via Read) to count exports, imports, and assess responsibilities. This applies to both auto-detect and targeted analysis.
Read the current code. Document:
Use git to find the earliest meaningful version:
# Find the first commit that created/significantly shaped this file
git log --oneline --diff-filter=A --follow -- {file}
git log --oneline --reverse --follow -- {file} | head -5
Read the file at that early commit:
git show {early-commit}:{file}
Document the same attributes: purpose, exports, imports, responsibilities, size.
Compare original vs current across dimensions (see references/drift-patterns.md):
| Dimension | Original | Current | Drift |
|---|---|---|---|
| Purpose | {original purpose} | {current purpose} | {shifted/same} |
| Exports | {n} | {n} | {growth %} |
| Imports | {n} | {n} | {growth %} |
| Responsibilities | {n} | {n} | {scope creep?} |
| Lines | {n} | {n} | {growth %} |
Classify the drift type:
Find the commits that shifted the boundary:
git log --oneline --stat --follow -- {file}
Look for commits with large diffs that added new concerns rather than extending existing ones. For the top 3-5 drift commits, note WHAT was added and WHY (from commit message).
Read .timewarp/ for existing forecast or trend data on this module. If forecast shows
this module's complexity is accelerating, note it — drift + growth acceleration is a
strong signal that intervention is needed. If timewarp_trends is available, call it for
the target module to quantify that acceleration instead of inferring it from cached files alone.
Report format:
## Drift Report — {module}
**Drift Level: {Significant / Moderate / Minimal}**
### Then vs Now
| Dimension | Original ({date}) | Current | Change |
|-----------|-------------------|---------|--------|
| Purpose | {description} | {description} | {shifted/same} |
| Exports | {n} | {n} | +{n}% |
| Imports | {n} | {n} | +{n}% |
| Lines | {n} | {n} | +{n}% |
### Drift Type
{Classification: scope creep / layer violation / god module / purpose shift}
{Explanation of how and why}
### Key Drift Commits
1. **{hash}** ({date}) — {new concern introduced and why}
2. **{hash}** ({date}) — {boundary widened or dependency added}
3. Continue only for materially distinct drift moments.
### Recommendations
- {Specific recommendation: split, refactor, accept and document, etc.}
- {If forecast data exists: trend context}
Save results to .timewarp/drift-{module}-{date}.json.
.timewarp/directory: Create the directory if it doesn't exist. Results older than 30 days are stale — prefer re-running the analysis over consuming old data. Other Timewarp skills may read these files to cross-reference findings (e.g.,/forecastchecks for drift data on trending files).
When timewarp_history is unavailable, degrade gracefully:
git log --oneline --stat to identify files with the most commitsgit log --reverse --follow -- {file} to find the first versiongit show {hash}:{file}/dissect — Trace when specific complexity was added to a drifted module/forecast — See if the drift is accelerating/map — Understand where the module fits in the architecturereferences/drift-patterns.md — Common drift types with detection strategies