agent-rules-skill-auth…
Maintain WebDev Agent Kit source rules, skills, metadata, and validators. Excludes upgrading installed copies.
Perform bounded, behavior-preserving frontend refactors such as component extraction, file moves, prop or interface cleanup, state simplification, and TypeScript tightening. Excludes bugfixes, features, redesign, packages, and unapproved behavior changes.
$ npx -y skills add ytvee-dev/webdev-agent-kit --skill frontend-refactor-surgeon --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/frontend-refactor-surgeonContext preview
The summary Claude sees to decide when to auto-load this skill.
Perform bounded, behavior-preserving frontend refactors such as component extraction, file moves, prop or interface cleanup, state simplification, and TypeScript tightening. Excludes bugfixes, features, redesign, packages, and unapproved behavior changes.
name: frontend-refactor-surgeon
description: 'Perform bounded, behavior-preserving frontend refactors such as component extraction, file moves, prop or interface cleanup, state simplification, and TypeScript tightening. Excludes bugfixes, features, redesign, packages, and unapproved behavior changes.'
id: 'agents.skills.frontend-refactor-surgeon.skill'
title: 'Frontend Refactor Surgeon'
doc_type: 'skill'
layer: 'skill'
status: 'active'
publishable: true
local_only: false
skill: 'frontend-refactor-surgeon'
tags:
- 'agents/skill-package'
- 'frontend/refactor'
- 'workflow/refactor'
parent: []
related:
- '[[common/frontend-design-system-rules|Frontend Design System Rules]]'
- '[[common/component-substitution-rules|Component Substitution Rules]]'
- '[[common/refactor-safety-rules|Refactor Safety Rules]]'
- '[[common/approved-patterns|Approved Patterns]]'
- '[[common/anti-patterns|Common Anti-Patterns]]'
- '[[common/agent-loop-policy|Agent Loop Policy]]'
- '[[common/verification-loop-rules|Verification Loop Rules]]'
- '[[common/bounded-retry-rules|Bounded Retry Rules]]'
- '[[common/typescript-discipline|TypeScript Discipline]]'
- '[[common/state-ownership-rules|State Ownership Rules]]'
- '[[skills/frontend-linter-manager/SKILL|Frontend Linter Manager]]'
- '[[skills/frontend-visual-qa/SKILL|Frontend Visual QA]]'
- '[[skills/frontend-quality-reviewer/SKILL|Frontend Quality Reviewer]]'
depends_on:
- '[[AGENTS|Canonical Agent Policy]]'Refactor frontend code while preserving behavior, rendered output, and public contracts unless the user explicitly approves a behavior change.
Refactor verification may use a bounded loop for related failures, but the refactor must not expand into feature work or broad rewrite.
Use this skill when the user asks to simplify or reorganize frontend code, extract components, hooks, utilities, or styles, tighten TypeScript types, remove duplication within a clear frontend boundary, decompose mixed-responsibility components, or prepare code for a future change without adding the feature yet.
Do not use this skill for bugfix-first debugging, new feature implementation, design/spec work, visual QA only, broad rewrites without a boundary, backend refactors, package installation, or testing workflow creation.
Use `frontend-bugfix-debugger` when the primary goal is to fix a defect.
1. Read `AGENTS.md`. 2. Read `common/prompt-intent-routing-rules.md` when workflow level is unclear. 3. Read `common/refactor-safety-rules.md`. 4. Read `common/approved-patterns.md` for component decomposition rules. 5. Read `common/anti-patterns.md` and relevant anti-pattern templates when the refactor touches components. 6. Read `common/verification-loop-rules.md` and `common/bounded-retry-rules.md` when verification repair is in scope. 7. Read `common/typescript-discipline.md`. 8. Read relevant boundary docs such as `common/state-ownership-rules.md` when the refactor touches state. 9. Read project overlays and affected source files needed to define the behavior boundary.
When shared UI or compatible component wrappers are in scope, read `common/frontend-design-system-rules.md` and `common/component-substitution-rules.md`. Apply purpose-specific naming from `common/frontend-implementation-boundaries.md` to changed project-owned code.
1. Define the refactor boundary and behavior contract. 2. Identify public APIs, rendered output, route behavior, state ownership, accessibility, and TypeScript contracts that must remain stable. 3. Identify whether the refactor requires decomposition. 4. Split the refactor into small mechanical steps. 5. Edit one boundary at a time. 6. Preserve project naming, folder, styling, and state conventions. 7. Do not create or preserve components that mix routing, data access, state orchestration, transformations, form logic, repeated markup, large JSX, and side effects in one file. 8. Do not hide missing decomposition behind `renderXxx`, `xxxRender`, nested array pipelines, component-body JSX preparation, oversized custom hooks, or unnecessary `useCallback`. 9. Run the smallest relevant verification after meaningful edits. 10. If verification fails because of the current refactor, fix related failures using bounded retry rules and keep the behavior contract unchanged. 11. Use `frontend-linter-manager` after code-changing work when a lint command exists. 12. Use `frontend-visual-qa` when rendered UI could have changed. 13. Use `frontend-quality-reviewer` when the refactor is standard or deep, involved retry, or the user asks for review. 14. Stop and ask before behavior change, architecture expansion, dependency changes, or broad rewrite.
Final response: return only facts that affect the user's understanding, confidence, or next action. Omit empty fields and workflow narration.
Refactor boundary: Behavior preserved: Decomposition applied: Changes made: Attempts: Verification: Rendered QA: Deferred work: Risks:
A cross-platform frontend kit for Codex, Claude Code, Cursor, OpenCode, etc. It helps AI coding agents work predictably and safely with existing frontend projects.
Repo: ytvee-dev/webdev-agent-kit
Maintain WebDev Agent Kit source rules, skills, metadata, and validators. Excludes upgrading installed copies.
Inspect Figma links through MCP or browser computer use, or analyze screenshots and selected-layer properties. Produce frontend specs and clarify unresolved…
Create, resume, analyze, or converge standard and deep frontend execution plans with traceable slices, evidence, and stop/resume state. Skip lightweight…
Plan architecture and ownership for standard or deep React/Next.js work across routing, state, data, styling, forms, builds, migrations, and implementation…
Diagnose and fix frontend defects from evidence, including unclear UI/runtime errors, broken routes, styling regressions, and hydration or client issues.…
Set subject-grounded visual direction for standard or deep UI work, redesign, polish, critique, anti-template review, or design handoff. Skip technical…