# Refactoring From Analysis Implementation Plan > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [x]`) syntax for tracking. **Goal:** Add a durable, type-directed refactoring workspace whose performance items require retained baseline and after evidence. **Architecture:** `refactor-queue.yaml` orders bounded items, while `/shared/refactor-detail///work-item.json` owns detailed item metadata and evidence references. A dedicated verifier enforces type-specific hard gates, especially the performance baseline/after contract. **Tech Stack:** Markdown/YAML/JSON, Python unittest, existing `/shared` workspace. **Spec:** `docs/superpowers/specs/2026-08-28-refactoring-from-analysis-design.md` ## Global Constraints - Application source remains read-only during documentation/refactor planning. - Performance claims require retained raw baseline and after evidence under equivalent conditions. - Existing documentation and user files must not be deleted or reset. - No legacy workspace dependency may be introduced. --- ### Task 1: WorkItem evidence verifier **Files:** - Create: `tools/verify_refactor_work_item.py` - Test: `tools/tests/test_verify_refactor_work_item.py` - [x] **Step 1: Write failing tests for type validation and performance evidence gates** - [x] **Step 2: Run tests and observe missing verifier failure** - [x] **Step 3: Implement the verifier** - [x] **Step 4: Run verifier tests green** ### Task 2: Refactoring skill and contracts **Files:** - Create: `.agents/skills/refactoring-from-analysis/SKILL.md` - Create: `.agents/skills/refactoring-from-analysis/references/work-item-contract.md` - Create: `.agents/skills/refactoring-from-analysis/references/type-strategies.md` - Create: `.agents/skills/refactoring-from-analysis/references/performance-evidence-contract.md` - Create: `.agents/skills/refactoring-from-analysis/references/evidence-contract.md` - [x] **Step 1: Encode queue eligibility and one-bounded-item rule** - [x] **Step 2: Encode type-directed execution and verification** - [x] **Step 3: Encode performance evidence hard gate** ### Task 3: Durable queue/detail templates **Files:** - Create: `/shared/codebase/refactor-queue.yaml` - Create: `/shared/refactor-detail/README.md` - Create: `/shared/refactor-detail/_templates/work-item.json` - Create: `/shared/refactor-detail/_templates/plan.md` - Create: evidence and verification template directories - [x] **Step 1: Create queue SSOT** - [x] **Step 2: Create WorkItem/evidence templates** ### Task 4: Pipeline integration and verification **Files:** - Modify: `AGENTS.md` - Modify: `tools/verify_pipeline.py` - Modify: `tools/tests/test_verify_pipeline.py` - [x] **Step 1: Add refactor paths to pipeline verification** - [x] **Step 2: Add instructions for the new stage** - [x] **Step 3: Run all verifier and terminal renderer tests** - [x] **Step 4: Run live workspace verification**