# Prompt Refactor

> Scan a prompt file for layer violations and structural problems, then fix them. Use when user wants to clean up documentation files or mentions /prompt-refactor command. Use when this capability is needed.

- Skill: `tomevault-io/prompt-refactor` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/prompt-refactor`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/prompt-refactor/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/prompt-refactor

---


# /prompt-refactor - Scan & Fix Documentation Files

Orchestrates prompt-refactor-agent to find and fix structural and layer placement issues in documentation files.

## Usage
```
/prompt-refactor refactor-agent.md              # Scan specific file
/prompt-refactor .claude/agents/red-agent.md    # Full path
/prompt-refactor                                # Scan all agents + skills
```

## Workflow

1. Parse user input (target file or "all")
2. Load agent instructions from `.claude/agents/prompt-refactor-agent.md`
3. Agent loads scan checklist from `.claude/templates/documentation/prompt-scan-checklist.md`
4. Execute scan → identify smells → fix one at a time
5. Return result: violations found, fixes applied, final state

## Layer-Specific

- Classification rules: `.claude/rules/prompt-rules.md`
- Two-layer structure: `.claude/rules/technology-loading.md`
- Scan checklist: `.claude/templates/documentation/prompt-scan-checklist.md`

## Next Step

After refactoring: review the diff to confirm fixes are clean.

---
> Source: [rakovi4/continue-framework](https://github.com/rakovi4/continue-framework) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-23 -->

