code-principles

Software engineering principles for code review, planning validation, and learning. Covers SOLID, DRY, YAGNI, design heuristics, testing, API design, architecture patterns, and React best practices. Use when reviewing code, validating plans/specs, injecting review criteria into council sessions, or when user asks about a specific principle. Triggers on "principles", "code review checklist", "SOLID", "DRY", "design heuristics", "review criteria", "best practices", or any named principle like "Law of Demeter", "Liskov", "YAGNI", etc.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "code-principles" with this command: npx skills add wiseiodev/skills/wiseiodev-skills-code-principles

Code Principles

Principle Index

PrincipleGroupOne-liner
SRPsolidOne reason to change
OCPsolidOpen for extension, closed for modification
LSPsolidSubtypes must be substitutable
ISPsolidSmall interfaces > fat interfaces
DIPsolidDepend on abstractions
DRYsimplicityDon't repeat yourself
YAGNIsimplicityYou aren't gonna need it
AHAsimplicityAvoid hasty abstractions
Rule of ThreesimplicityAbstract after 3 occurrences
CQSdesignCommands mutate, queries return
Law of DemeterdesignDon't talk to strangers
Tell Don't AskdesignPush logic to the object
POLAdesignCode should behave as expected
Composition > InheritancedesignCompose behavior from small pieces
IoCdesignFramework calls you
Fail FastresilienceValidate early, throw early
Robustness PrincipleresilienceLiberal in, strict out
Least PrivilegeresilienceMinimum access needed
Hyrum's LawmetaAll observable behavior becomes API
ConnascencemetaMeasure and minimize coupling
Locality of BehaviormetaUnderstand code in one place
Pit of SuccessmetaEasiest path = correct path
TDDtestingRed-green-refactor
AAAtestingArrange-Act-Assert
Test IsolationtestingTests don't affect each other
Test BehaviortestingTest what, not how
Testing PyramidtestingMany unit, fewer integration, few e2e
Idempotencyapi-designSame request = same result
Backwards Compatapi-designDon't break existing consumers
Semverapi-designCommunicate change impact
Defensive Codingapi-designValidate at boundaries
SoCarchitectureEach layer handles one concern
CQRSarchitectureSeparate read and write models
Hexagonal ArchitecturearchitecturePorts and adapters
Bounded ContextsarchitectureExplicit domain boundaries
Feature DirectoriesreactOrganize by feature, not type
Component SRPreactOne job per component
ColocationreactKeep related files together
Unidirectional FlowreactData down, events up
State PlacementreactState at lowest common ancestor
Barrel ExportsreactPublic API via index.ts

Usage Modes

1. Checklist mode (default)

Scan code or a plan against relevant principles. Read the reference files for the groups most relevant to the task, then output a checklist:

- [ ] SRP: Does each module have one reason to change?
- [ ] DRY: Is logic duplicated unnecessarily?
- [x] YAGNI: No speculative features found
...

Select groups based on context:

  • Code review → solid, simplicity, design, testing
  • Architecture/design review → architecture, design, resilience, meta
  • API review → api-design, design, resilience
  • React review → react, solid, simplicity

2. Council mode

Generate a review criteria block for injection into review-council prompts. Read the reference files for the persona's relevant groups (see review-council personas), extract the "Review question" from each principle, and format as:

## Code Principles Review Criteria
- SRP: Does each class/module have exactly one reason to change?
- OCP: Can behavior be extended without modifying existing code?
...

3. Deep-dive mode

When user asks about a specific principle ("what is the Law of Demeter?", "explain CQS"), read the relevant reference file and present the full entry: rule, violation example, correct example, when to break it.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

gt

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

graphite

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-principles

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

Self Updater

⭐ OPEN SOURCE! GitHub: github.com/GhostDragon124/openclaw-self-updater ⭐ ONLY skill with Cron-aware + Idle detection! Auto-updates OpenClaw core & skills, an...

Registry SourceRecently Updated
1171Profile unavailable