Focused Fix

Focused Fix

Use when the user asks to fix, debug, or make a specific feature/module/area work end-to-end. Triggers: 'make X work', 'fix the Y feature', 'the Z mod

Category: development Source: alirezarezvani/claude-skills

What Is Focused Fix?

The "Focused Fix" skill is a systematic approach designed specifically for deep-dive repair of entire features, modules, or functional areas within a codebase. Unlike single-bug debugging, Focused Fix is activated when users request comprehensive fixes—such as “make X work,” “fix the Y feature,” or “the Z module is broken.” This skill traces all relevant dependencies, reads relevant logs, checks associated tests, and maps out the full dependency graph to ensure that a problematic area works end-to-end. It is particularly useful when an isolated bug fix will not suffice and a thorough, cross-cutting investigation and remediation are required.

Why Use Focused Fix?

Modern applications are composed of interdependent components. When a feature or module fails, the root cause often spans multiple files, services, or configurations. Attempting to patch a symptom can leave underlying issues unresolved, leading to recurring failures or unpredictable behavior. Focused Fix addresses this by:

  • Providing a holistic view of the broken area, ensuring all dependencies are considered.
  • Systematically tracing issues across the feature's entire implementation.
  • Reducing technical debt by solving not just visible symptoms, but also underlying architectural or integration problems.
  • Improving reliability and maintainability by verifying that the repaired feature passes all relevant tests and meets business requirements.

Focused Fix is not intended for quick or isolated bug fixes. For those scenarios, a more targeted debugging skill should be employed. Focused Fix is reserved for cases where an entire area needs to be made robust and functional from start to finish.

How to Get Started

To effectively use the Focused Fix skill, follow these steps:

  1. Identify the Scope
    Clarify which feature, module, or area needs repair. Gather user reports, error logs, and test failures. Example triggers include:

    • “User authentication is broken.”
    • “The reports dashboard doesn’t load.”
    • “Data export needs to work end-to-end.”
  2. Map Dependencies
    Trace all files, services, and components involved in the feature. Tools like dependency graphs, module diagrams, or code search utilities can help.

  3. Reproduce the Issue
    Set up the environment to consistently reproduce the problem. Collect all error messages, stack traces, and relevant logs.

  4. Systematic Investigation
    Walk through code paths, configuration files, and integration points. Identify where breakdowns occur and document all findings.

  5. Implement Comprehensive Fixes
    Make necessary changes across all affected files and modules, ensuring that the entire feature works as intended.

  6. Verify with Tests
    Run existing tests and add new ones if coverage is insufficient. Confirm that all acceptance criteria are met.

Example:
Suppose users report that the “user registration” feature is failing. Instead of patching a single validation bug, you would:

## Example: Tracing the full registration feature in Django

## 1. Check views.py for registration logic
def register_user(request):
    if request.method == 'POST':
        form = RegistrationForm(request.POST)
        if form.is_valid():
            user = form.save()
            send_welcome_email(user.email)
            return redirect('success')
        else:
            return render(request, 'register.html', {'form': form})

## 2. Inspect RegistrationForm in forms.py for validation logic

## 3. Check models.py for user model constraints

## 4. Validate email sending in utils.py

## 5. Review related tests in tests.py

Key Features

  • Systematic Deep-Dive: Goes beyond surface-level bug fixes, addressing issues across the entire stack.
  • Dependency Mapping: Identifies and traces all dependencies, ensuring nothing is overlooked.
  • Test Integration: Verifies that all fixes are covered by automated tests to prevent regressions.
  • Root Cause Analysis: Focuses on underlying issues, not just immediate symptoms.
  • Comprehensive Documentation: Encourages documenting findings, fixes, and decisions made during the process.

Best Practices

  1. Communicate Scope Clearly
    Confirm with stakeholders which feature or module is being fixed, and what “working” means in this context.

  2. Work Iteratively
    Break down the investigation and repair into manageable sub-tasks to maintain clarity and momentum.

  3. Leverage Automated Tools
    Use static analysis, dependency mapping, and test automation tools to accelerate identification and verification.

  4. Maintain Clean Commits
    Structure code changes in logical commits, each addressing a specific aspect of the fix.

  5. Document Thoroughly
    Record what was broken, what was found, and how it was fixed. Update relevant documentation and code comments.

Important Notes

  • Focused Fix is not for single bugs:
    Use only when a feature or module needs systematic repair. For isolated issues, employ targeted debugging techniques instead.

  • Requires full context:
    Effective use demands thorough understanding of the feature’s architecture, dependencies, and business requirements.

  • May span multiple files or services:
    Be prepared to work across the full breadth of the affected area.

  • Testing is critical:
    Always validate with comprehensive tests to ensure the issue is truly resolved and no regressions are introduced.

  • Collaboration may be necessary:
    For complex features, coordinate with other engineers, QA, or DevOps to ensure all aspects are covered.

Focused Fix is an essential skill for maintaining robust, production-grade systems, ensuring that critical features and modules function reliably end-to-end.