laws-of-software-los
Laws of Software (LOS)
Apply this skill when software work needs principal-level judgment, explicit tradeoffs, and a credible validation path.
This skill is original synthesis inspired by the public law list at https://lawsofsoftwareengineering.com/. Use the source site for canonical law descriptions and updates.
Use when
- choosing or reviewing architecture, system design, APIs, service boundaries, or infrastructure direction
- reviewing an RFC, ADR, migration plan, incident, codebase structure, or technical strategy
- making code changes where data safety, compatibility, reliability, security, or operability matter
- answering questions about distributed systems, scalability, performance, technical debt, testing, rollout, rollback, or team ownership
Do not use for:
- tiny syntax fixes or rote formatting
- purely mechanical conversions or summaries
- non-software domain work
Operating contract
For code-producing tasks:
- Prefer the smallest reversible design. Do not add speculative frameworks or abstractions.
- Preserve compatibility by default. Treat observed behavior as part of the contract unless you have a migration plan.
- Assume failure in remote or distributed paths. Add timeouts, retry bounds, idempotency, backpressure, and observability where they matter.
- Treat data changes as dangerous. Define source of truth, invariants, migration safety, reconciliation, and rollback.
- Keep security baseline intact. No secret leaks, auth bypasses, unsafe dynamic execution, or injection patterns.
- Add focused tests when behavior changes, or say what narrower validation substitute ran and why.
- Ship operability with production paths: logs, metrics, traces, alerts, owners, and rollback criteria when relevant.
- Name the tradeoffs. Do not present code or designs as production-ready while hiding risk.
Workflow
- Frame the real problem. State the goal, actors, constraints, non-goals, success metrics, and time horizon. If a missing fact would not change the answer, make a minimal assumption and proceed.
- Map the current system before changing it. Inspect the existing code, boundaries, data ownership, dependencies, trust boundaries, runtime environment, and failure domains.
- Generate the smallest credible path. For architecture work, compare 2-4 viable options and always include the simplest one. For code work, prefer the smallest safe patch.
- Stress-test with law lenses.
Use
references/law-index.mdfor the full checklist. Pick only the few laws that materially change the recommendation. - Decide, implement, and document.
Make rationale, rollout, rollback, and validation explicit. Use templates from
assets/when they save time. - Verify before finalizing.
Run relevant scripts from
scripts/when files are available, then run the repo checks that matter for the change. - Close with evidence. State what changed or what you recommend, what was validated, and the remaining material risk.
Law groups
Use references/law-index.md when you need the full 56-law pass. Common groups:
- architecture and distributed systems
- teams and ownership
- planning and estimation
- quality, testing, and evolution
- scale and performance
- local design and code clarity
- decision quality and bias
Do not law-dump. Use the 3-8 laws that change the answer.
Optional Codex hooks
Use repo or machine hooks only when the user explicitly wants LOS guardrails to stay active across a session or repository.
Install from the skill root:
python3 scripts/install_codex_hooks.py --repo /path/to/repo
python3 scripts/install_codex_hooks.py --scope global
Read references/codex-hooks.md before changing hook behavior. The hooks are guardrails, not a security boundary. Current Codex docs do not support the hook flow on Windows.
Scripts
Run these from the skill root when they fit the artifact in front of you:
python3 scripts/los_code_gate.py --repo . --changed
python3 scripts/los_code_gate.py --repo . --changed --json
python3 scripts/los_code_gate.py --input path/to/file.py
python3 scripts/los_code_gate.py --stdin < assistant-output.md
python3 scripts/arch_law_check.py --input path/to/design.md
python3 scripts/arch_law_check.py --input path/to/design.md --json
python3 scripts/adr_lint.py --input path/to/adr.md
Use the scripts as heuristic reviewers. They help catch omissions; they do not replace judgment.
Templates and references
Load only what the task needs:
references/architecture-playbook.mdfor concrete system-design guidancereferences/review-rubrics.mdfor architecture, API, migration, planning, or code-structure reviewsreferences/decision-frameworks.mdfor technology choices, metrics, and cognitive trapsreferences/prompts-and-templates.mdfor polished answer structuresreferences/codex-hooks.mdfor hook installation or tuningreferences/evaluation-guide.mdfor trigger and output evaluation
Useful templates in assets/:
assets/adr-template.mdassets/architecture-review-template.mdassets/incident-architecture-review-template.mdassets/migration-plan-template.mdassets/risk-register-template.mdassets/system-design-brief-template.md
Hard gotchas
- Microservices are not the default. Prefer a modular monolith or narrower extraction until ownership, deploy cadence, scale, compliance, or isolation forces the split.
- Rewrites are guilty until proven necessary. Favor strangler, branch-by-abstraction, or targeted replacement.
- Performance claims without workload, SLO, profile, benchmark, or cost model are guesses.
- "Future-proofing" needs a near-term scenario. Otherwise keep it as a simple extension point or defer it.
- Metrics need guardrails or they get gamed.
- Distributed flows need timeouts, retries, idempotency, backpressure, consistency decisions, and observability.
- A design with no owner, runbook, migration plan, or rollback is not production-ready.
- A code change with no tests or explicit validation is not production-ready.
More from mylesmcook/mcook-skills
adversarial-review
Use this skill when you need a serious code review, diff review, or implementation-plan review from independent reviewers. In Codex hosts, prefer a fresh Codex subagent for the Codex reviewer; otherwise use the Codex, Claude Code, and Gemini reviewer paths when available. Return a PASS, CONTESTED, or REJECT verdict.
13subagent-driven-development
Use after an implementation plan is approved to execute mostly independent tasks through fresh subagents with scoped context, harness-aware model routing, proportional review gates, and mandatory controller verification.
10brainerd
>
10simple-code
Reduce incidental complexity in code and design. Use when shaping APIs, module boundaries, refactors, tests, naming, and architecture tradeoffs with a bias toward concrete, local, reversible solutions.
7git-it-out
Use this skill when the user explicitly wants final end-of-session closeout and no more branch or PR limbo: proper verification, proper commits, main/mainline landing, push, repo-native merge/release/deploy/publish steps, tracker updates, Entire/checkpoint handling when configured, and a concise handoff. Reach for it on prompts like 'git it out', 'get it out', 'ship this', 'I'm done', 'I'm going to bed', 'take this off my plate', 'finish the session', or 'get this into production'. Do not use it for greenfield implementation, open-ended debugging, broad refactors, or inventing a release process from scratch.
7laws-of-taste
>-
6