aposd-maintaining-design-quality
Enforce strategic programming discipline when modifying existing code. Guide through STOP-ASK-DECIDE-VERIFY workflow with urgency tier assessment (trivial/minor/standard/emergency). Include when NOT to refactor (Chesterton's Fence, performance-critical, no tests) and block tactical shortcuts via anti-rationalization tables. Use when fixing bugs, extending features, or tempted to make quick fixes. Triggers on: modify code, fix bug, extend feature, quick fix, tactical change.
Best use case
aposd-maintaining-design-quality is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Enforce strategic programming discipline when modifying existing code. Guide through STOP-ASK-DECIDE-VERIFY workflow with urgency tier assessment (trivial/minor/standard/emergency). Include when NOT to refactor (Chesterton's Fence, performance-critical, no tests) and block tactical shortcuts via anti-rationalization tables. Use when fixing bugs, extending features, or tempted to make quick fixes. Triggers on: modify code, fix bug, extend feature, quick fix, tactical change.
Teams using aposd-maintaining-design-quality should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/aposd-maintaining-design-quality/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How aposd-maintaining-design-quality Compares
| Feature / Agent | aposd-maintaining-design-quality | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Enforce strategic programming discipline when modifying existing code. Guide through STOP-ASK-DECIDE-VERIFY workflow with urgency tier assessment (trivial/minor/standard/emergency). Include when NOT to refactor (Chesterton's Fence, performance-critical, no tests) and block tactical shortcuts via anti-rationalization tables. Use when fixing bugs, extending features, or tempted to make quick fixes. Triggers on: modify code, fix bug, extend feature, quick fix, tactical change.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Skill: aposd-maintaining-design-quality ## STOP - The Design Rule **If you're not making the design better, you're probably making it worse.** Working code is not a high enough standard. **Zero Tolerance:** There is no acceptable threshold for making design worse. Even "small" compromises accumulate invisibly—dozens of tactical decisions compound into unmaintainable systems. --- ## Urgency Tiers Not all changes need equal analysis. Match effort to impact: | Tier | Examples | Required Analysis | |------|----------|-------------------| | **Trivial** | Typo fixes, whitespace, comment corrections | None—just do it | | **Minor** | Bug fix <5 lines, config tweak, dependency bump | Quick check: does this fit cleanly? | | **Standard** | New feature, refactoring, multi-file change | Full workflow: STOP-ASK-DECIDE-VERIFY | | **Emergency** | Production down, security breach, data loss | Minimal fix + TODO + 24hr follow-up | --- ## Strategic Modification Workflow ``` BEFORE making any change to existing code: 1. RESIST the temptation to make a quick fix 2. ASK: "Is the current system design still the best one, given the change I need to make?" 3. IF NO: Refactor so you end up with the best possible design Goal: After this change, the system should have the structure it would have had if designed from the start with this in mind 4. IF YES: Make the change within the existing design But verify: does your change fit cleanly? 5. BEFORE COMMIT: Scan all changes to verify documentation reflects them ``` --- ## The Investment Mindset | Approach | Short-Term | Long-Term | |----------|------------|-----------| | **Tactical** | 10-20% faster | Permanently slower (20%+ productivity loss) | | **Strategic** | 10-20% slower | Benefits in months; eventually free | **Recommended investment:** About 10-20% of development time on design improvements. ### Why Strategic Wins ``` Tactical path: - Each "quick fix" adds small complexity - Complexities accumulate (dozens/hundreds of small things) - Eventually: system is hard to understand and modify - Result: development slows permanently Strategic path: - Each change improves or maintains design - Past investments save time for future investments - Eventually: strategic investments become FREE - Result: development accelerates over time ``` --- ## Design Evolution Principle A system's design cannot be conceived correctly at the outset. The design of a mature system is determined **more by changes made during evolution** than by initial conception. **Implication:** Every modification matters. Your changes ARE the design. --- ## When Refactoring Seems Impractical Even under tight deadlines, ask: ``` "Is this the best I can possibly do to create a clean system design, given my current constraints?" ``` | If... | Then... | |-------|---------| | Large refactoring is impractical | Look for alternatives that are almost as clean but faster | | Cannot do proper cleanup now | Create accountability plan (see below) | | Refactoring creates incompatibilities | Seek middle-ground solutions | **Never acceptable:** Making the design worse without a plan to fix it. ### Accountability for Deferred Refactoring If you defer refactoring, it MUST be tracked: ``` 1. CREATE a ticket/issue with specific scope 2. TIMEBOX: Must be addressed within 2 sprints (or equivalent) 3. ADD a code comment: // TODO(YYYY-MM-DD): [ticket-id] - [what needs fixing] 4. ESCALATE if 3+ deferrals exist in same area → refactoring becomes MANDATORY ``` **"I'll do it later" without these steps = you won't do it.** --- ## When NOT to Refactor Refactoring is not always the right choice: | Scenario | Why Refactoring Hurts | What to Do Instead | |----------|----------------------|-------------------| | **Chesterton's Fence code** | Looks bad but handles subtle edge cases | Investigate WHY before changing | | **Performance-critical paths** | Clean abstractions add overhead | Document why it's intentionally ugly | | **Regulatory/audited code** | Changes trigger expensive re-certification | Get explicit approval first | | **Legacy with no tests** | Refactoring without tests is dangerous | Add tests first, or freeze | | **Code with external quirk dependencies** | Other systems rely on undocumented behavior | Coordinate with dependents | | **Near end-of-life systems** | Investing in dying code is waste | Document, don't improve | | **During incident response** | Changing more increases blast radius | Minimal fix only | | **When you don't understand domain** | "Better design" reflects misunderstanding | Learn first, refactor later | **Key question:** Do I understand WHY the code is the way it is? --- ## Emergency Bypass Criteria Skip the normal workflow ONLY when ALL of these conditions are true: 1. Production is down RIGHT NOW (not "might break soon") 2. Users are actively impacted, security breach in progress, OR data loss occurring 3. The fix is minimal (rollback or single-line change) 4. You commit to returning for proper implementation within 24 hours **Emergency does NOT mean:** - "Demo in 30 minutes" — That's planning failure - "CEO is asking" — Authority pressure ≠ emergency - "Team is blocked" — They can wait for you to think - "We need this fast" — Speed pressure is when discipline matters MOST --- ## Red Flags | Red Flag | Symptom | What It Signals | |----------|---------|-----------------| | **Quick Fix Mentality** | "Just make it work for now" | Tactical programming—design will degrade | | **Complexity Creep** | Adding special cases, conditionals, dependencies | Design is getting worse, not better | | **Patch Stacking** | Workarounds on top of workarounds | Technical debt accumulating | | **Tactical Tornado** | Very fast developer leaving messes | Others will pay for their speed | | **Stale Comments** | Comments no longer match code | Trust erosion; documentation debt | | **Deferred Cleanup** | "We'll refactor later" | Later never comes; delay becomes permanent | --- ## Anti-Rationalization Table ### Classic Rationalizations | Tempting Shortcut | Why It Feels Right | Why It's Wrong | |-------------------|-------------------|----------------| | "Just make it work" | Faster now | Creates technical debt forever; 20%+ productivity loss | | "Don't touch working code" | Risk averse | Prevents improvement; design decays anyway | | "We'll refactor later" | Deferred pain | Later never comes; there's always another crunch | | "This is just a quick fix" | Scope limiting | Quick fixes accumulate; complexity is incremental | | "I don't have time" | Deadline pressure | 10-20% investment now saves more later | | "It's not that bad" | Normalizing decay | Each small compromise adds up to major complexity | ### Responsibility-Avoidance Rationalizations | Tempting Shortcut | Why It Feels Right | Why It's Wrong | |-------------------|-------------------|----------------| | "I'm not the owner of this module" | Not my responsibility | If you're touching it, you're responsible for it | | "The original author did it this way" | Appeal to authority | Original author might have been wrong, or context changed | | "This matches the existing pattern" | Consistency | Consistently following a bad pattern spreads the problem | ### "It Doesn't Count" Rationalizations | Tempting Shortcut | Why It Feels Right | Why It's Wrong | |-------------------|-------------------|----------------| | "This is temporary/experimental code" | It's throwaway | Nothing is as permanent as temporary code | | "The tests pass" | Correctness verified | Passing tests ≠ good design | | "I'll document the tech debt" | I'm being responsible | Documentation is not remediation | --- ## Comment Maintenance When modifying code, keep comments synchronized: | Rule | Why | |------|-----| | Position comments close to code they describe | Developers see them when modifying | | Avoid duplicating documentation | One source of truth | | Document each decision exactly once | Find the single most obvious place | | Scan all changes before commit | Catch stale comments early | --- ## Technical Debt Reality | Myth | Reality | |------|---------| | "We'll pay it back" | Most technical debt is never fully repaid | | "It's a fair trade" | Amount paid back exceeds amount borrowed | | "Just this once" | Once you start, it's difficult to change | | "Everyone does it" | Complexity accumulates rapidly if everyone programs tactically | --- ## Quick Reference ``` EVERY TIME you modify existing code: 1. STOP - Resist the quick fix temptation 2. ASK - "Is this design still optimal for what I need?" 3. DECIDE: - Design is optimal? Make change cleanly - Design needs work? Refactor first - Can't refactor now? Plan when you will 4. VERIFY - Comments updated? Design improved or maintained? 5. COMMIT - Only when design is better or at least not worse THE RULE: "If you're not making the design better, you're probably making it worse." INVESTMENT MATH: - 10-20% slower now → faster forever - "Quick fix" now → 20%+ slower forever ``` --- ## Chain | After | Next | |-------|------| | Design assessment done | Back to task checklist |
Related Skills
aposd-verifying-correctness
Verify code correctness before claiming done or committing. Run 6-dimension checklist: requirements coverage, concurrency safety, error handling, resource management, boundary conditions, and security. Output PASS/FAIL per dimension with final DONE/NOT DONE verdict. Use after implementation as pre-commit gate. Triggers on: is it done, ready to commit, verify correctness, did I miss anything, pre-commit check.
aposd-simplifying-complexity
Simplify complex code through the Error Reduction Hierarchy: Define out > Mask > Aggregate > Crash. Use when code is too complex, has scattered error handling, configuration explosion, or callers doing module work. Produce technique analysis table with gate checks before simplified code. Triggers on: too complex, simplify, scattered errors, configuration proliferation, verbose error handling. Complements cc-defensive-programming with design-level error elimination.
aposd-reviewing-module-design
Evaluate module design using APOSD principles with 40-item checklist. Detect complexity symptoms (change amplification, cognitive load, unknown unknowns), shallow modules, information leakage, pass-through methods, and structural anti-patterns. Produce categorized design review (Critical/Moderate/Observations/Positive). Use when reviewing code, assessing interfaces, during PR review, or evaluating 'is this too complex?' Triggers on: code review, design review, module complexity, interface assessment, PR review, structural analysis.
aposd-optimizing-critical-paths
Optimize performance through mandatory measure-first workflow with 3 stages: MEASURE (gate) -> FUNDAMENTAL FIX -> CRITICAL PATH REDESIGN. Use when code is too slow, laggy, hangs, doesn't scale, has timeouts, OOM errors, or high CPU/memory. Emphasize that simpler code usually runs faster. Triggers on: performance issues, optimization needed, takes forever, profiling. Produces profiling-backed optimization with verified improvement.
aposd-improving-code-clarity
Enforce comments-first workflow for new code and improve naming/documentation for existing code. Use when writing new classes, methods, or functions; when code is 'confusing' or 'hard to understand'; when naming precision is poor; or when variable documentation lacks units, bounds, or ownership. Triggers on: new code, comments-first, naming review, documentation review, not obvious, hard to understand. Produces well-documented code with precise naming, or identifies design problems when comments/names are hard to write.
aposd-designing-deep-modules
Enforce Design-It-Twice workflow: generate 2-3 radically different approaches, compare them, then implement. Use when designing modules, APIs, or classes before implementation. Triggers on: design, create class, add module, implement feature, new service, API design, before implementing. Produces structured design document with approaches, comparison table, choice rationale, and depth check.
api-design
API tasarımı, GraphQL schema, OpenAPI spec, versioning. ⚠️ Tasarım aşaması için kullan. Uygulama/security için → backend-api.
api-designer
REST and GraphQL API architect for designing robust, scalable APIs. Use when designing new APIs or improving existing ones.
api-design-skill
REST/GraphQL API design patterns - resource naming, HTTP methods, error handling, pagination, versioning. Use when: design API, REST endpoints, GraphQL schema, error responses, pagination, rate limiting, API documentation.
api-design-principles
Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.
api-design-patterns
Design robust APIs with RESTful patterns, GraphQL schemas, versioning strategies, and error handling conventions. Supports OpenAPI/Swagger documentation and SDK generation patterns. Triggers on API design, schema definition, endpoint architecture, or developer experience requests.
anysystem-design
LLM Agent Skill for AnySystem Design React component library