/planning-backend-refactor
Planning a backend refactor: audits an existing Go or TypeScript backend against Ring/Lerian standards and produces a prioritized task list (findings.md + tasks.md) ready for ring:running-dev-cycle. Plans only — no edits. Use when an existing backend service needs to meet
$ npx -y skills add LerianStudio/ring --skill planning-backend-refactor --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/planning-backend-refactor
Context preview
The summary Claude sees to decide when to auto-load this skill.
Planning a backend refactor: audits an existing Go or TypeScript backend against Ring/Lerian standards and produces a prioritized task list (findings.md + tasks.md) ready for ring:running-dev-cycle. Plans only — no edits. Use when an existing backend service needs to meet
SKILL.md
planning-backend-refactor.SKILL.mdname: ring:planning-backend-refactor
description: "Planning a backend refactor: audits an existing Go or TypeScript backend against Ring/Lerian standards and produces a prioritized task list (findings.md + tasks.md) ready for ring:running-dev-cycle. Plans only — no edits. Use when an existing backend service needs to meet standards or an audit is requested. Skip for greenfield projects, single-file fixes, or frontend (use ring:planning-frontend-refactor)."
Dev Refactor Skill
When to use
- User wants to refactor existing project to follow standards
- Legacy codebase needs modernization
- Project audit requested
Skip when
- Greenfield project → Use ring:planning-large-features or ring:planning-small-features instead
- Single file fix → Use ring:running-dev-cycle directly
- Frontend project → Use ring:planning-frontend-refactor
Analyzes existing backend codebase against Ring/Lerian standards and generates refactoring tasks for ring:running-dev-cycle.
You orchestrate. Agents analyze. NEVER run Bash/Grep/Read to analyze code directly — dispatch agents.
Gap Principle
Every divergence from Ring standards = a mandatory gap to implement. No exceptions.
All divergences → FINDING-XXX → REFACTOR-XXX task → ring:running-dev-cycle input.
Architecture Pattern Applicability
| Service Type | Apply Hexagonal/Lerian Pattern? | |---|---| | CRUD API | ✅ YES | | Complex business logic | ✅ YES | | Event-driven systems | ✅ YES | | CLI tools / scripts | ❌ NO | | Workers / background jobs | ❌ NO | | Simple lambdas | ❌ NO |
Execution Steps
Step 1: Validate Prerequisites
- Check `docs/PROJECT_RULES.md` exists → STOP if missing
- Detect stack: `go.mod` → Go; `package.json` + Express/Fastify/NestJS (no React) → TypeScript
- If `package.json` + React/Next.js → STOP: use `ring:planning-frontend-refactor`
Step 2: Generate Codebase Report
Dispatch `ring:codebase-explorer`:
Generate comprehensive codebase report: project structure, architecture pattern,
tech stack, code patterns (config, database, handlers, errors, telemetry, testing),
key files inventory with file:line references, code snippets.
Output: docs/ring:planning-backend-refactor/{timestamp}/codebase-report.mdStep 3: Dispatch Specialist Agents (parallel)
Verify `codebase-report.md` exists before dispatching.
**For Go projects — dispatch backend analysis:**
Task 1: ring:backend-go (MODE: ANALYSIS only)
- Load golang.md via WebFetch
- Check all sections per shared-patterns/standards-coverage-table.md
- Flag framework/library mismatches vs standards
- File size enforcement: >1000 lines = ISSUE-XXX (HIGH), >1500 = CRITICAL
- Multi-tenant analysis per shared-patterns/multi-tenant-analysis.md
- Check tests, coverage, docker-compose/local runtime, and observability as backend-owned responsibilities
- Output: Standards Coverage Table + ISSUE-XXX per finding
**For TypeScript projects:** Use `ring:backend-ts` with the same analysis contract.
Step 4: Map Findings → Tasks
After all agents complete:
1. Save individual agent reports to `docs/ring:planning-backend-refactor/{timestamp}/` 2. Map each ISSUE-XXX → FINDING-XXX (normalize severity, add file:line, current vs expected) 3. Generate `docs/ring:planning-backend-refactor/{timestamp}/findings.md` 4. Map each FINDING-XXX → one REFACTOR-XXX task (1:1 mapping) 5. Generate `docs/ring:planning-backend-refactor/{timestamp}/tasks.md` (ring:running-dev-cycle compatible)
**Findings template:**
# {project-name} Refactor Findings
## FINDING-001: {Pattern Name} in {file_path}
- **Severity:** CRITICAL | HIGH | MEDIUM | LOW
- **File:** {path}:{line}
- **Current:** {code or description}
- **Expected:** {Ring standard}
- **Standard Reference:** {standards doc section}**Tasks template:**
# {project-name} Refactor Tasks
## REFACTOR-001: {Pattern Name} in {file_path}
- **Finding:** FINDING-001
- **Estimated Complexity:** trivial | moderate | complex
- **Acceptance Criteria:**
- [ ] {specific, testable criteria}Step 5: Visual Change Report + User Approval
Generate visual HTML summary of KILL/CHANGE/ADD operations → dispatch `ring:visualizing`.
Present to user for approval. Wait for explicit APPROVED.
Step 6: Save + Handoff
Save all artifacts to `docs/ring:planning-backend-refactor/{timestamp}/`.
Handoff to `ring:running-dev-cycle`: feed tasks.md as input.
Agent Analysis Report Template
# {Agent Name} Analysis Report
## EXPLORATION SUMMARY
High-level architecture assessment
## KEY FINDINGS
ISSUE-XXX list with file:line, current, expected
## ARCHITECTURE INSIGHTS
Patterns detected, notable deviations
## RELEVANT FILES
Files most impacted by findings
## RECOMMENDATIONS
Priority order for refactoringRead more
name: ring:planning-backend-refactor description: "Planning a backend refactor: audits an existing Go or TypeScript backend against Ring/Lerian standards and produces a prioritized task list (findings.md + tasks.md) ready for ring:running-dev-cycle. Plans only — no edits. Use when an existing backend service needs to meet standards or an audit is requested. Skip for greenfield projects, single-file fixes, or frontend (use ring:planning-frontend-refactor)."
Dev Refactor Skill
When to use
- User wants to refactor existing project to follow standards
- Legacy codebase needs modernization
- Project audit requested
Skip when
- Greenfield project → Use ring:planning-large-features or ring:planning-small-features instead
- Single file fix → Use ring:running-dev-cycle directly
- Frontend project → Use ring:planning-frontend-refactor
Analyzes existing backend codebase against Ring/Lerian standards and generates refactoring tasks for ring:running-dev-cycle.
You orchestrate. Agents analyze. NEVER run Bash/Grep/Read to analyze code directly — dispatch agents.
Gap Principle
Every divergence from Ring standards = a mandatory gap to implement. No exceptions.
All divergences → FINDING-XXX → REFACTOR-XXX task → ring:running-dev-cycle input.
Architecture Pattern Applicability
| Service Type | Apply Hexagonal/Lerian Pattern? | |---|---| | CRUD API | ✅ YES | | Complex business logic | ✅ YES | | Event-driven systems | ✅ YES | | CLI tools / scripts | ❌ NO | | Workers / background jobs | ❌ NO | | Simple lambdas | ❌ NO |
Execution Steps
Step 1: Validate Prerequisites
- Check `docs/PROJECT_RULES.md` exists → STOP if missing
- Detect stack: `go.mod` → Go; `package.json` + Express/Fastify/NestJS (no React) → TypeScript
- If `package.json` + React/Next.js → STOP: use `ring:planning-frontend-refactor`
Step 2: Generate Codebase Report
Dispatch `ring:codebase-explorer`:
Generate comprehensive codebase report: project structure, architecture pattern,
tech stack, code patterns (config, database, handlers, errors, telemetry, testing),
key files inventory with file:line references, code snippets.
Output: docs/ring:planning-backend-refactor/{timestamp}/codebase-report.mdStep 3: Dispatch Specialist Agents (parallel)
Verify `codebase-report.md` exists before dispatching.
**For Go projects — dispatch backend analysis:**
Task 1: ring:backend-go (MODE: ANALYSIS only) - Load golang.md via WebFetch - Check all sections per shared-patterns/standards-coverage-table.md - Flag framework/library mismatches vs standards - File size enforcement: >1000 lines = ISSUE-XXX (HIGH), >1500 = CRITICAL - Multi-tenant analysis per shared-patterns/multi-tenant-analysis.md - Check tests, coverage, docker-compose/local runtime, and observability as backend-owned responsibilities - Output: Standards Coverage Table + ISSUE-XXX per finding
**For TypeScript projects:** Use `ring:backend-ts` with the same analysis contract.
Step 4: Map Findings → Tasks
After all agents complete:
1. Save individual agent reports to `docs/ring:planning-backend-refactor/{timestamp}/` 2. Map each ISSUE-XXX → FINDING-XXX (normalize severity, add file:line, current vs expected) 3. Generate `docs/ring:planning-backend-refactor/{timestamp}/findings.md` 4. Map each FINDING-XXX → one REFACTOR-XXX task (1:1 mapping) 5. Generate `docs/ring:planning-backend-refactor/{timestamp}/tasks.md` (ring:running-dev-cycle compatible)
**Findings template:**
# {project-name} Refactor Findings
## FINDING-001: {Pattern Name} in {file_path}
- **Severity:** CRITICAL | HIGH | MEDIUM | LOW
- **File:** {path}:{line}
- **Current:** {code or description}
- **Expected:** {Ring standard}
- **Standard Reference:** {standards doc section}**Tasks template:**
# {project-name} Refactor Tasks
## REFACTOR-001: {Pattern Name} in {file_path}
- **Finding:** FINDING-001
- **Estimated Complexity:** trivial | moderate | complex
- **Acceptance Criteria:**
- [ ] {specific, testable criteria}Step 5: Visual Change Report + User Approval
Generate visual HTML summary of KILL/CHANGE/ADD operations → dispatch `ring:visualizing`.
Present to user for approval. Wait for explicit APPROVED.
Step 6: Save + Handoff
Save all artifacts to `docs/ring:planning-backend-refactor/{timestamp}/`.
Handoff to `ring:running-dev-cycle`: feed tasks.md as input.
Agent Analysis Report Template
# {Agent Name} Analysis Report
## EXPLORATION SUMMARY
High-level architecture assessment
## KEY FINDINGS
ISSUE-XXX list with file:line, current, expected
## ARCHITECTURE INSIGHTS
Patterns detected, notable deviations
## RELEVANT FILES
Files most impacted by findings
## RECOMMENDATIONS
Priority order for refactoringProven engineering practices, enforced through skills. Ring is a comprehensive skills library and workflow system for AI agents that transforms how AI assistants approach software development.
Repo: LerianStudio/ring
Other skills on ring.
- /analyzing-options
Analyzing different approaches for a task or problem with structured comparisons, effort estimates, and recommendations. Use when facing strategic decisions, architecture choices, or multiple viable approaches. Skip when there's an obvious single approach or the decision is
Open skill - /auditing-production-readiness
Auditing a service's production readiness against Ring engineering standards across base dimensions plus a conditional multi-tenant dimension, then emitting a scored report and an HTML dashboard. Use before production deploy, periodic review, onboarding, or a major release. Skip
Open skill - /cleaning-comments
Cleaning redundant and obvious comments following clean code principles while preserving meaningful documentation. Supports git scope filtering (staged, unstaged, branch, commit-range). Use when code has excessive comments, during code review, or post-refactor cleanup. Skip when
Open skill - /committing-changes
Commit changes with scope allowlist enforcement, atomic grouping, GPG-signed conventional commits, and trailer management. Detects the repo's PR-validation scope policy before proposing any message. Use when the user asks to commit or has changes ready to record. Skip when the
Open skill - /creating-handoffs
Creating a handoff document that captures session state (completed work, decisions, open items, next steps) and delivering it via Plan Mode so the user gets the native 'clear context and continue implementing' resume option. Use when ending a session, when context grows large,
Open skill - /creating-worktrees
Creating an isolated git worktree for parallel branch work: selects the directory by priority order, verifies/adds .gitignore safety, auto-installs the detected toolchain's dependencies, runs a baseline test, and reports readiness. Use before a feature that needs isolation from
Open skill

