Receber por email
← Voltar para o catálogo

focused-fix

Use quando o usuário pede para consertar, depurar ou fazer uma funcionalidade, módulo ou área específica funcionar de ponta a ponta. Esta skill é para reparos sistemáticos e aprofundados em todos os arquivos e dependências, não para correções rápidas de um único bug.

18.6kestrelas
Atualizado há 4 meses

Ver no GitHub ↗ Licença: MIT

Como adicionar

/plugin marketplace add alirezarezvani/claude-skills

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/focused-fix/svg)](https://www.skillteca.com.br/skills/focused-fix)
#ai

Skills relacionadas

Ver todas de Desenvolvimento →

Alerta por categoria

Receba novas skills de Desenvolvimento toda segunda

1 email curto, só com as skills novas de Desenvolvimento. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

Focused Fix — Deep-Dive Feature Repair

When to Use

Activate when the user asks to fix, debug, or make a specific feature/module/area work. Key triggers:

  • "make X work"
  • "fix the Y feature"
  • "the Z module is broken"
  • "focus on [area]"
  • "this feature needs to work properly"

This is NOT for quick single-bug fixes (use systematic-debugging for that). This is for when an entire feature or module needs systematic repair — tracing every dependency, reading logs, checking tests, mapping the full dependency graph.

digraph when_to_use {
    "User reports feature broken" [shape=diamond];
    "Single bug or symptom?" [shape=diamond];
    "Use systematic-debugging" [shape=box];
    "Entire feature/module needs repair?" [shape=diamond];
    "Use focused-fix" [shape=box];
    "Something else" [shape=box];

    "User reports feature broken" -> "Single bug or symptom?";
    "Single bug or symptom?" -> "Use systematic-debugging" [label="yes"];
    "Single bug or symptom?" -> "Entire feature/module needs repair?" [label="no"];
    "Entire feature/module needs repair?" -> "Use focused-fix" [label="yes"];
    "Entire feature/module needs repair?" -> "Something else" [label="no"];
}

The Iron Law

NO FIXES WITHOUT COMPLETING SCOPE → TRACE → DIAGNOSE FIRST

If you haven't finished Phase 3, you cannot propose fixes. Period.

Violating the letter of these phases is violating the spirit of focused repair.

Protocol — STRICTLY follow these 5 phases IN ORDER

digraph phases {
    rankdir=LR;
    SCOPE [shape=box, label="Phase 1\nSCOPE"];
    TRACE [shape=box, label="Phase 2\nTRACE"];
    DIAGNOSE [shape=box, label="Phase 3\nDIAGNOSE"];
    FIX [shape=box, label="Phase 4\nFIX"];
    VERIFY [shape=box, label="Phase 5\nVERIFY"];

    SCOPE -> TRACE -> DIAGNOSE -> FIX -> VERIFY;
    FIX -> DIAGNOSE [label="fix broke\nsomething else"];
    FIX -> ESCALATE [label="3+ fixes\ncreate new issues"];
    ESCALATE [shape=doubleoctagon, label="STOP\nQuestion Architecture\nDiscuss with User"];
}

Phase 1: SCOPE — Map the Feature Boundary

Before touching any code, understand the full scope of the feature.

  1. Ask the user: "Which feature/folder should I focus on?" if not already clear
  2. Identify the PRIMARY folder/files for this feature
  3. Map EVERY file in that folder — read each one, understand its purpose
  4. Create a feature manifest:
FEATURE SCOPE:
  Primary path: src/features/auth/
  Entry points: [files that are imported by other parts of the app]
  Internal files: [files only used within this feature]
  Total files: N
  Total lines: N

Phase 2: TRACE — Map All Dependencies (Inside AND Outside)

Trace every connection this feature has to the rest of the codebase.

INBOUND (what this feature imports):

  1. For every import statement in every file in the feature folder:
  2. Trace it to its source
  3. Verify the source file exists
  4. Verify the imported entity (function, type, component) exists and is exported
  5. Check if the types/signatures match what the feature expects
  6. Check for:
  7. Environment variables used (grep for process.env, import.meta.env, os.environ, etc.)
  8. Config files referenced
  9. Database models/schemas used
  10. API endpoints called
  11. Third-party packages imported

OUTBOUND (what imports this feature):

  1. Search the entire codebase for imports from this feature folder
  2. For each consumer:
  3. Verify they're importing entities that actually exist
  4. Check if they're using the correct API/interface
  5. Note if any consumers are using deprecated patterns

Output format:

DEPENDENCY MAP:
  Inbound (this feature depends on):
    src/lib/db.ts → used in auth/repository.ts (getUserById, createUser)
    src/lib/jwt.ts → used in auth/service.ts (signToken, verifyToken)
    @prisma/client → used in auth/repository.ts
    process.env.JWT_SECRET → used in auth/service.ts
    process.env.DATABASE_URL → used via prisma

  Outbound (depends on this feature):
    src/app/api/login/route.ts → imports { login } from auth/service
    src/app/api/register/route.ts → imports { register } from auth/service
    src/middleware.ts → imports { verifyToken } from auth/service

  Env vars required: JWT_SECRET, DATABASE_URL
  Config files: prisma/schema.prisma (User model)

Phase 3: DIAGNOSE — Find Every Issue

Systematically check for problems. Run ALL of these checks:

CODE QUALITY:

  • [ ] Every import resolves to a real file/export
  • [ ] No circular dependencies within the feature
  • [ ] Types are consistent across boundaries (no any at interfaces)
  • [ ] Error handling exists for all async operations
  • [ ] No TODO/FIXME/HACK comments indicating known issues

RUNTIME:

  • [ ] All required environment variables are set (check .env)
  • [ ] Database migrations are up to date (if applicable)
  • [ ] API endpoints return expected shapes
  • [ ] No hardcoded values that should be configurable

TESTS:

  • [ ] Run ALL tests related to this feature: find them by searching for imports from the feature folder
  • [ ] Record every failure with full error output
  • [ ] Check test coverage — are there untested code paths?

LOGS & ERRORS:

  • [ ] Search for any log files, error reports, or Sentry-style error tracking
  • [ ] Check git log for recent changes to this feature: git log --oneline -20 -- <feature-path>
  • [ ] Check if any recent commits might have broken something: git log --oneline -5 --all -- <files that this feature depends on>

CONFIGURATION:

  • [ ] Verify all config files this feature depends on are valid
  • [ ] Check for mismatches between development and production configs
  • [ ] Verify third-party service credentials are valid (if testable)

ROOT-CAUSE CONFIRMATION: For each CRITICAL issue found, confirm root cause before adding it to the fix list:

  • State clearly: "I think X is the root cause because Y"
  • Trace the data/control flow backward to verify — don't trust surface-level symptoms
  • If the issue spans multiple components, add diagnostic logging at each boundary to identify which layer fails
  • REQUIRED SUB-SKILL: For complex bugs found during diagnosis, apply superpowers:systematic-debugging Phase 1 (Root Cause Investigation) to confirm before proceeding

RISK LABELING: Assign each issue a risk label:

| Risk | Criteria | |---|---| | HIGH | Public API surface / breaking interface contract / DB schema / auth or security logic / widely imported module (>3 callers) / git hotspot | | MED | Internal module with tests / shared utility / config with runtime impact / internal callers of changed functions | | LOW | Leaf module / isolated file / test-only change / single-purpose helper with no callers |

Output format:

DIAGNOSIS REPORT:
  Issues found: N

  CRITICAL:
    1. [HIGH] [file:line] — description of issue. Root cause: [confirmed explanation]
    2. [HIGH] [file:line] — description of issue. Root cause: [confirmed explanation]

  WARNINGS:
    1. [MED] [file:line] — description of issue
    2. [LOW] [file:line] — description of issue

  TESTS:
    Ran: N tests
    Passed: N
    Failed: N
    [list each failure with one-line summary]

Phase 4: FIX — Repair Everything Systematically

Fix issues in this EXACT order:

  1. DEPENDENCIES FIRST — fix broken imports, missing packages, wrong versions
  2. TYPES SECOND — fix type mismatches at feature boundaries
  3. LOGIC THIRD — fix actual business logic bugs
  4. TESTS FOURTH — fix or create tests for each fix
  5. INTEGRATION LAST — verify the feature works end-to-end with its consumers

Rules:

  • Fix ONE issue at a time
  • After each fix, run the related test to confirm it works
  • If a fix breaks something else, STOP and re-evaluate (go back to DIAGNOSE)
  • Keep a running log of every change made
  • Never change code outside the feature folder without explicitly stating why
  • Fix HIGH-risk issues before MED, MED before LOW

ESCALATION RULE — 3-Strike Architecture Check: If 3+ fixes in this

Compartilhar X LinkedIn