agentleFS
martincjarvismartincjarvis/development-skills/skills/broken-window/SKILL.md

broken-window

Skill4 starsChanged 10 months agoMITView on GitHub

Use when warnings/errors occur during git operations, package management, builds, or when reviewing completed work for standards violations. Fix immediately unless impact doubles delivery time.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before declaring work complete

    line 26
  2. Distinctive:

    If fix time >= 2x remaining work, create tech-debt issue with steps to replicate

    line 36
  3. Distinctive:

    Verify warning/error is resolved or issue is created

    line 37
  4. Distinctive:

    If fix time < 2x → Fix immediately

    line 67
  5. Very specific:

    If fix time ≥ 2x → Create tech-debt issue (label: tech-debt, include steps to replicate, fix estimate)

    line 68
  6. Distinctive:

    Verify warning gone or issue created

    line 69
  7. Distinctive:

    Check for: tests, documentation, code patterns, linting

    line 74
  8. Distinctive:

    Check for AGENTS.md with skills-first-workflow

    line 83
  9. Distinctive:

    Verify superpowers installed and required skills loaded

    line 84
  10. Distinctive:

    Use this script to quickly address multiple broken windows before commits.

    line 130

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Broken Window

Overview

Fix warnings, errors, and standards violations immediately. Broken windows—small signs of neglect—compound into technical debt. The 2x rule: fix now unless fix time > 2x remaining work.

Violating the letter of these rules IS violating the spirit of these rules. The 2x threshold is objective and measurable—there is no "spirit vs letter" escape.

REQUIRED BACKGROUND: superpowers:verification-before-completion, superpowers:systematic-debugging

When to Use

Always triggered for:

  • Warnings/errors during git, npm, build, or test operations
  • Before declaring work complete
  • Standards violations detected during code review
  • Skills-first repos: Before starting work (validate prerequisites)

Core Workflow

  1. Detect warning, error, or standards violation
  2. Investigate root cause and document finding
  3. Estimate fix time and remaining work time
  4. Apply 2x rule: if fix time < 2x remaining work, fix immediately
  5. If fix time >= 2x remaining work, create tech-debt issue with steps to replicate
  6. Verify warning/error is resolved or issue is created
  7. Continue with original task

The 2x Rule

digraph fix_decision {
    "Warning/Error Detected" [shape=box];
    "Estimate Fix Time" [shape=box];
    "Estimate Remaining Work" [shape=box];
    "Fix Time < 2x Remaining?" [shape=diamond];
    "Fix Immediately" [shape=box, style=filled, fillcolor=lightgreen];
    "Create Tech-Debt Issue" [shape=box, style=filled, fillcolor=yellow];

    "Warning/Error Detected" -> "Estimate Fix Time";
    "Estimate Fix Time" -> "Estimate Remaining Work";
    "Estimate Remaining Work" -> "Fix Time < 2x Remaining?";
    "Fix Time < 2x Remaining?" -> "Fix Immediately" [label="yes"];
    "Fix Time < 2x Remaining?" -> "Create Tech-Debt Issue" [label="no"];
}

Example: Remaining work = 15 minutes. Fix takes 10 minutes. Ratio = 0.67x. Fix immediately.

Required Actions

When Warning/Error Appears

  1. Investigate root cause
  2. Estimate fix time vs remaining work
  3. If fix time < 2x → Fix immediately
  4. If fix time ≥ 2x → Create tech-debt issue (label: tech-debt, include steps to replicate, fix estimate)
  5. Verify warning gone or issue created

Before Declaring Complete

  1. Review against repository standards (README, CONTRIBUTING, docs/)
  2. Check for: tests, documentation, code patterns, linting
  3. Apply 2x rule to each violation
  4. Fix or create tech-debt issue for each violation
  5. Then declare complete

Skills-First Repositories

Before starting implementation:

  1. Check for AGENTS.md with skills-first-workflow
  2. Verify superpowers installed and required skills loaded
  3. Load missing skills before proceeding

Red Flags - STOP

  • "It's just a warning" / "Normal behaviour" / "Can fix later"
  • "No time now" (without 2x calculation)
  • "User didn't ask for tests/docs"
  • "Scope creep" / "Need to balance"
  • "I'll set up linting/verification tools later"
  • Working in repo with package.json but no node_modules

All mean: Apply 2x rule. Fix or create tech-debt issue. No ignoring.

See references/rationalizations.md for complete excuse table and brownfield strategies.

Quick-Fix Scripts

Common broken window scenarios with immediate fixes:

ScenarioFix CommandDescription
Format violationsnpm run lint:fix / dotnet formatAuto-fix formatting issues
Spelling errorsUpdate cspell.json words listAdd valid technical terms
Missing dependenciesnpm ci / dotnet restoreRestore package dependencies
Outdated lockfilenpm installRegenerate package-lock.json

Quick-Fix Script Template

For projects with multiple fix commands, create scripts/fix-all.sh:

#!/usr/bin/env bash
# fix-all.sh - Fix common broken window issues
set -euo pipefail

echo "=== Restoring dependencies ==="
npm ci 2>/dev/null || dotnet restore 2>/dev/null || echo "No package manager detected"

echo "=== Fixing formatting ==="
npm run lint:fix 2>/dev/null || dotnet format 2>/dev/null || echo "No formatter configured"

echo "=== Done ==="
echo "Run 'npm run lint' or equivalent to verify all issues resolved"

Use this script to quickly address multiple broken windows before commits.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.