refactor Cursor ruleA

refactor from darknecrocities/skillbuilder is a Cursor rule: instructions the Cursor agent follows in that repo.

Install it, pinned
mdr add darknecrocities/skillbuilder/.cursor/rules/refactor.mdc@git:20261029.1aa6bef

Pins git:20261029.1aa6bef in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 14 of 14 checks passed
Kind
Cursor rule
Repository
darknecrocities/skillbuilder
Path
.cursor/rules/refactor.mdc
Versions recorded
1
Latest version
git:20261029.1aa6bef, committed Oct 29, 2026
Size
5,830 bytes
Repository stars
13
License
none declared

Safe refactoring and technical debt remediation skill. Enforces Strangler Fig patterns, characterization testing, and decomposition of bloated files.

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# Safe Refactoring & Technical Debt Remediation (`/refactor`)

> **Philosophy**: *Never refactor without tests. Change behavior or change structure, never both in the same turn. Decompose god files before they hit 500 lines. Strangler Fig over big-bang rewrites.*

This skill establishes disciplined patterns for paying down technical debt, decomposing bloated modules, and modernizing legacy code without introducing regressions or downtime.

---

## 1. Quick Navigation & Progressive Disclosure

| Resource Type | Document | Description |
| :--- | :--- | :--- |
| **Reference** | [references/strangler-fig-pattern.md](references/strangler-fig-pattern.md) | Phased execution steps, abstraction facades, rollback safety nets. |
| **Reference** | [references/characterization-testing.md](references/characterization-testing.md) | Pinning down legacy behavior, boundary assertion protocols, regression prevention. |
| **Utility** | [scripts/detect_refactor_opportunities.py](scripts/detect_refactor_opportunities.py) | Scans codebase for files $>350$ lines, functions $>40$ lines, and nesting $>3$ levels. |

---

## 2. The Two-Hat Refactoring Protocol

```mermaid
flowchart TD
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add darknecrocities/skillbuilder/.cursor/rules/refactor.mdc@sha256:1bca591a6a83c59f

The line at the top of this page pins the label git:20261029.1aa6bef, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_24aynr4ptz6izw27.svg)](https://markdownregistry.com/a/art_24aynr4ptz6izw27)

1 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 1 version of this file, committed on Oct 29, 2026.

versioncommittedcommitsizeaudit
git:20261029.1aa6bef latest2026-10-29 1aa6bef 5,830 BA view

Audit of the latest version

A  14 of 14 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Size between 200 bytes and 200 KB (5830 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

darknecrocities/skillbuilder · 13 stars · license none declared · pushed 2026-10-29 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_24aynr4ptz6izw27
GET https://markdownregistry.com/api/v1/resolve?ref=darknecrocities/skillbuilder/.cursor/rules/refactor.mdc
GET https://markdownregistry.com/api/v1/blob/1bca591a6a83c59f7af33df4dc29786e6d68ca93be40b9eecebe3e7c7629759d

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: Cursor rules vs AGENTS.md · which agent file does what.

More from darknecrocities/skillbuilder

3d Cursor rule
darknecrocities/skillbuilder · .cursor/rules/3d.mdc · Interactive 3D WebGL, Three.js, and React Three Fiber (R3F) engineering skill. Enforces 60fps budgets, PBR materials…
git:20261029.1aa6bef · audit A · 13 stars
ai Cursor rule
darknecrocities/skillbuilder · .cursor/rules/ai.mdc · Architect, implement, and maintain production AI systems, Gemini API agents, Antigravity multi-agent orchestration…
git:20261029.1aa6bef · audit A · 13 stars
anti-slop Cursor rule
darknecrocities/skillbuilder · .cursor/rules/anti-slop.mdc · Anti-AI-slop and clean craftsmanship skill. Eliminates decorative badges, fake mock databases, neon gradients, obvious…
git:20261029.1aa6bef · audit A · 13 stars
antigravity-automation Cursor rule
darknecrocities/skillbuilder · .cursor/rules/antigravity-automation.mdc · Automate recurring, background, event-driven, and multi-agent workflows in Google Antigravity. Crafts scheduled…
git:20261029.1aa6bef · audit A · 13 stars
api-design Cursor rule
darknecrocities/skillbuilder · .cursor/rules/api-design.mdc · API contract design and OpenAPI 3.1 specification skill. Enforces RFC 7807 problem details, idempotency headers, and…
git:20261029.1aa6bef · audit A · 13 stars
aws Cursor rule
darknecrocities/skillbuilder · .cursor/rules/aws.mdc · Amazon Web Services resilient cloud architecture, serverless Lambda execution, S3 bucket security, DynamoDB…
git:20261029.1aa6bef · audit A · 13 stars
backend Cursor rule
darknecrocities/skillbuilder · .cursor/rules/backend.mdc · Architect, implement, and maintain resilient backend services, clean architecture, REST/gRPC API contracts, strict…
git:20261029.1aa6bef · audit A · 13 stars
continuous-learning Cursor rule
darknecrocities/skillbuilder · .cursor/rules/continuous-learning.mdc · Continuous conversational learning protocol (CLP) skill. Persists user corrections and project conventions to…
git:20261029.1aa6bef · audit A · 13 stars
data-pipelines Cursor rule
darknecrocities/skillbuilder · .cursor/rules/data-pipelines.mdc · Data pipeline engineering, streaming ETL with backpressure, Apache Arrow memory structures, DuckDB in-process…
git:20261029.1aa6bef · audit A · 13 stars
database Cursor rule
darknecrocities/skillbuilder · .cursor/rules/database.mdc · Architect, implement, and maintain resilient relational and NoSQL databases, zero-downtime schema migrations…
git:20261029.1aa6bef · audit A · 13 stars
devops Cursor rule
darknecrocities/skillbuilder · .cursor/rules/devops.mdc · Architect, implement, and maintain secure cloud infrastructure on GCP/AWS, multi-stage non-root Docker containers…
git:20261029.1aa6bef · audit A · 13 stars
firebase Cursor rule
darknecrocities/skillbuilder · .cursor/rules/firebase.mdc · Firebase serverless architecture, Cloud Firestore schema design, Security Rules (firestore.rules, storage.rules)…
git:20261029.1aa6bef · audit A · 13 stars

Every file in darknecrocities/skillbuilder

Other files named refactor

refactor SKILL.md skill
code-yeongyu/oh-my-openagent · packages/shared-skills/skills/refactor/SKILL.md · Guides a refactor, cleanup, or restructure with the right decomposition. Use when the user asks to refactor, simplify…
git:20261023.af359db · audit A · 70,648 stars
refactor SKILL.md skill
sethgammon/citadel · skills/refactor/SKILL.md · Safe multi-file refactoring with automatic rollback. Establishes a type/test baseline, plans all changes, executes…
git:20260611.0f3f8e7 · audit A · 929 stars
refactor SKILL.md skill
dcouple/pane · main/src/services/paneChatBundle/skills/refactor/SKILL.md · Post-PR refactor pass. Sizes the diff against the remote default branch, fans out refactor-simple (and refactor-deep on…
git:20260924.c3bd4b5 · audit A · 601 stars
refactor SKILL.md skill
greenfield-inc/pane · main/src/services/paneChatBundle/skills/refactor/SKILL.md · Post-PR refactor pass. Sizes the diff against the remote default branch, fans out refactor-simple (and refactor-deep on…
git:20260924.c3bd4b5 · audit A · 600 stars
refactor SKILL.md skill
rsmdt/the-startup · plugins/start/skills/refactor/SKILL.md · Refactor, simplify, or clean up code for improved maintainability without changing business logic
git:20261011.48bd3ee · audit A · 577 stars
refactor SKILL.md skill
boshu2/agentops · skills/refactor/SKILL.md · Restructure or clean up code with no behavior change, proved by before-and-after checks. Use when: asked to clean up…
git:20261021.71bc1e4 · audit A · 450 stars
refactor SKILL.md skill
boshu2/agentops · plugin/skills/refactor/SKILL.md · Restructure or clean up code with no behavior change, proved by before-and-after checks. Use when: asked to clean up…
git:20261026.1b5f59a · audit A · 450 stars
refactor SKILL.md skill
justxor/claude-code-pro-course · starter-kit/.claude/skills/refactor/SKILL.md · Безопасный рефакторинг маленькими шагами без изменения поведения. Используй, когда просят отрефакторить, упростить…
git:20260930.76c4189 · audit A · 334 stars

Browse by kind, by grade A, or by owner.