ciembor/agent-rules-books / code-complete
code-complete
UnverifiedApply Steve McConnell-inspired construction rules when implementing routines, variables, classes, control flow, defensive code, or tests.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 659 B |
| code-complete.md | markdown | 12.1 KB |
| code-complete.mini.md | markdown | 6.6 KB |
| code-complete.nano.md | markdown | 2.5 KB |
code-complete.nano.md
View on GitHub# OBEY Code Complete by Steve McConnell
## When to use
Use as a compact always-on construction discipline for implementation, review, debugging, refactoring, and tuning.
## Primary bias to correct
Working code is not enough. Construction must lower defect risk, control complexity, and make human inspection cheap.
## Decision rules
- Clarify requirements, architecture fit, risks, conventions, and major construction decisions before coding from a solution idea.
- Choose clarity, locality, explicitness, simple control flow, and consistent style over clever compactness or fashionable idioms.
- Keep routines, classes, and modules cohesive, precisely named, small at the interface, encapsulated, and hard to misuse.
- Make data meaning visible with names, constants, stronger types, closed states, deliberate initialization, units, and ownership.
- Validate trust boundaries; use assertions, invariants, and contracts for programmer assumptions; keep error handling explicit and diagnosable.
- Keep branches, loops, exits, exceptions, and table-driven logic simple enough to verify.
- Build, test, review, debug, refactor, integrate, and tune in small evidence-based loops: root cause before fixes, behavior protection before refactoring, measurement before optimization.
- Use comments, documentation, tools, and standards to reduce reader or manual effort, never to hide poor structure.
## Trigger rules
- When a solution appears before the problem is clear, restate the requirement, constraints, and construction risks.
- When readers must decode names, flags, primitives, units, states, or layout, model the meaning explicitly.
- When a routine mixes phases or has a hard-to-use interface, split concerns or change the data model.
- When input crosses a trust boundary, decide validation, rejection, recovery, assertion, and diagnostics.
- When control flow, loops, exceptions, or branching tables are hard to inspect, simplify before adding logic.
- When tests only prove happy paths, add boundary, invalid-input, defensive-check, contract, and data-driven cases.
- When debugging, refactoring, or performance work starts from a guess, get evidence first.
- When comments repeat obvious mechanics, rewrite the code or delete the comment; keep comments for intent and constraints.
## Final checklist
- Clear construction context?
- Inspectable code shape?
- Explicit data meaning?
- Defended boundaries and diagnosable failures?
- Simple flow?
- Defect-finding tests and reviews?
- Evidence before fixes, refactors, and tuning?
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 195k | Updated | Claude CodeCodex | Verified | Install |
| webapp-testinganthropics/skillsToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs. | Stars: 195k | Updated | Claude CodeCodex | Verified | Install |
| browser-testing-with-devtoolsaddyosmani/agent-skillsTests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| ci-cd-and-automationaddyosmani/agent-skillsAutomates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |