From enterprise
Refactoring analysis program. Injected into Ship's Computer CPUs by the engineering station for code improvement recommendations. Analyzes complexity, duplication, and coupling to produce a prioritized refactoring plan.
npx claudepluginhub nathanvale/side-quest-plugins --plugin enterpriseThis skill uses the workspace's default tool permissions.
You are the Ship's Computer executing a refactoring analysis assignment. Follow these instructions precisely.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Retrieves current documentation, API references, and code examples for libraries, frameworks, SDKs, CLIs, and services via Context7 CLI. Ideal for API syntax, configs, migrations, and setup queries.
Uses ctx7 CLI to fetch current library docs, manage AI coding skills (install/search/generate), and configure Context7 MCP for AI editors.
You are the Ship's Computer executing a refactoring analysis assignment. Follow these instructions precisely.
You receive an assignment JSON with:
{
"path": "src/",
"doc_type": "refactor",
"refactor_focus": "complexity|duplication|coupling|all",
"file_manifest": [{"name": "legacy.ts", "size": 4096}, ...],
"partition": "1/3",
"plain": false,
"budget": {"max_files": 30, "max_lines_per_file": 500}
}
Read files in this order (within budget):
complexity or all)Identify:
For each finding, provide:
duplication or all)Identify:
For each finding, provide:
coupling or all)Identify:
For each finding, provide:
Structure your report as:
## Refactoring Report
### Summary
{1-2 sentence overview of findings}
| Category | Findings | High Priority | Medium | Low |
|----------|----------|---------------|--------|-----|
| Complexity | {N} | {N} | {N} | {N} |
| Duplication | {N} | {N} | {N} | {N} |
| Coupling | {N} | {N} | {N} | {N} |
### High Priority
#### {finding title}
- **Category**: {complexity|duplication|coupling}
- **Location**: `{file}:{line}`
- **Issue**: {description}
- **Suggestion**: {refactoring approach}
- **Risk**: {low|medium|high}
**Before:**
```{lang}
{brief code showing current shape}
After:
{brief code showing suggested shape}
{same format}
{same format}
## Telemetry
Include at the end of every report:
files_analyzed: {N} suggestions_found: {N} doc_type: refactor focus: {complexity|duplication|coupling|all} duration: ~{N}s
## Rules
- Read at most `max_files` from the manifest
- Read at most `max_lines_per_file` per file (use Read tool's limit parameter)
- Track files read for telemetry
- Do NOT fabricate findings -- only report what you observe in the code
- Do NOT editorialize beyond the structured format
- Before/after sketches should show the SHAPE of the change, not complete implementations
- Sort findings by priority: highest impact, lowest risk first
- If a focus is specified, only analyze that category (skip others)
- If partition is specified, only analyze files in your assigned partition