{
  "markdown": "# Code Craft\n\nDiscipline-enforcing skills that help AI coding agents write better code by following software engineering best practices.\n\n## What Are These?\n\n**Skills** are documents that teach Claude to resist common bad patterns and produce higher quality code. Unlike tutorials, these skills:\n\n- **Resist pressure** - Handle \"just make it work\" or \"don't overcomplicate\" requests\n- **Close loopholes** - Address specific rationalizations Claude uses to violate principles\n- **Provide correct patterns** - Show the right way, not just explain what's wrong\n\nEach skill was developed using **TDD for documentation**: baseline tests reveal how Claude fails without the skill, then the skill is written to address those specific failures.\n\n## Installation\n\n```bash\nnpx add-skill yanko-belov/code-craft\n```\n\nThis installs skills to all supported agents (OpenCode, Claude Code, Codex, Cursor, etc.)\n\n### Options\n\n```bash\n# Install specific skills only\nnpx add-skill yanko-belov/code-craft -s single-responsibility yagni fail-fast\n\n# Install globally (user-level)\nnpx add-skill yanko-belov/code-craft -g\n\n# Install to specific agents\nnpx add-skill yanko-belov/code-craft -a opencode claude-code\n\n# List available skills\nnpx add-skill yanko-belov/code-craft -l\n\n# Install all skills to all agents without prompts\nnpx add-skill yanko-belov/code-craft --all\n```\n\n### Supported Agents\n\n- OpenCode\n- Claude Code\n- Codex\n- Cursor\n- Antigravity\n- GitHub Copilot\n- Roo Code\n\n### Manual Installation\n\n```bash\n# Clone and symlink\ngit clone https://github.com/yanko-belov/code-craft.git\ncd code-craft\nfor skill in skills/*/; do\n  ln -sf \"$(pwd)/$skill\" ~/.claude/skills/\ndone\n```\n\n## Skills\n\n### SOLID Principles\n\n| Principle | Skill | Prevents |\n|-----------|-------|----------|\n| **S** | [Single Responsibility](./skills/single-responsibility/SKILL.md) | God classes, \"just add it here\" |\n| **O** | [Open/Closed](./skills/open-closed/SKILL.md) | Adding if/else branches for new features |\n| **L** | [Liskov Substitution](./skills/liskov-substitution/SKILL.md) | Override with throw/no-op |\n| **I** | [Interface Segregation](./skills/interface-segregation/SKILL.md) | Fat interfaces, forced implementations |\n| **D** | [Dependency Inversion](./skills/dependency-inversion/SKILL.md) | `new Concrete()` inside classes |\n\n### Core Principles\n\n| Principle | Skill | Prevents |\n|-----------|-------|----------|\n| **DRY** | [Don't Repeat Yourself](./skills/dry/SKILL.md) | Copy-paste code, duplicated logic |\n| **YAGNI** | [You Ain't Gonna Need It](./skills/yagni/SKILL.md) | Over-engineering, speculative features |\n| **KISS** | [Keep It Simple](./skills/kiss/SKILL.md) | Clever one-liners, unnecessary complexity |\n| **Composition** | [Composition over Inheritance](./skills/composition-over-inheritance/SKILL.md) | Deep inheritance hierarchies |\n| **Demeter** | [Law of Demeter](./skills/law-of-demeter/SKILL.md) | `a.b.c.d` property chains |\n| **Fail Fast** | [Fail Fast](./skills/fail-fast/SKILL.md) | Swallowed errors, silent failures |\n\n### Testing\n\n| Skill | Prevents |\n|-------|----------|\n| [TDD](./skills/tdd/SKILL.md) | Tests as afterthought, untestable code |\n| [Test Isolation](./skills/test-isolation/SKILL.md) | Flaky tests, shared state between tests |\n| [AAA Pattern](./skills/aaa-pattern/SKILL.md) | Messy tests, unclear test structure |\n\n### Security\n\n| Skill | Prevents |\n|-------|----------|\n| [Input Validation](./skills/input-validation/SKILL.md) | Injection attacks, invalid data |\n| [Secrets Handling](./skills/secrets-handling/SKILL.md) | Hardcoded credentials, exposed secrets |\n| [Auth Patterns](./skills/auth-patterns/SKILL.md) | Broken authentication, insecure sessions |\n\n### API Design\n\n| Skill | Prevents |\n|-------|----------|\n| [REST Conventions](./skills/rest-conventions/SKILL.md) | Inconsistent endpoints, poor API design |\n| [Error Responses](./skills/error-responses/SKILL.md) | Unhelpful errors, leaked internals |\n| [Idempotency](./skills/idempotency/SKILL.md) | Duplicate operations, unsafe retries |\n| [API Versioning](./skills/api-versioning/SKILL.md) | Breaking changes, version chaos |\n\n### Performance\n\n| Skill | Prevents |\n|-------|----------|\n| [N+1 Prevention](./skills/n-plus-one-prevention/SKILL.md) | Database query explosions |\n| [Lazy Loading](./skills/lazy-loading/SKILL.md) | Loading everything upfront, slow startup |\n| [Caching](./skills/caching/SKILL.md) | Repeated expensive operations, cache bugs |\n\n### Code Quality\n\n| Skill | Prevents |\n|-------|----------|\n| [Separation of Concerns](./skills/separation-of-concerns/SKILL.md) | Mixed responsibilities, tangled code |\n| [Encapsulation](./skills/encapsulation/SKILL.md) | Exposed internals, broken abstractions |\n| [Immutability](./skills/immutability/SKILL.md) | Mutation bugs, unexpected state changes |\n\n### Error Handling\n\n| Skill | Prevents |\n|-------|----------|\n| [Exception Hierarchies](./skills/exception-hierarchies/SKILL.md) | Generic errors, poor error handling |\n| [Error Boundaries](./skills/error-boundaries/SKILL.md) | Cascading failures, crashed UIs |\n\n### Concurrency\n\n| Skill | Prevents |\n|-------|----------|\n| [Race Conditions](./skills/race-conditions/SKILL.md) | Data races, inconsistent state |\n| [Deadlock Prevention](./skills/deadlock-prevention/SKILL.md) | System hangs, resource starvation |\n\n### Meta\n\n| Skill | Purpose |\n|-------|---------|\n| [Skill Awareness](./skills/skill-awareness/SKILL.md) | Tracks skill usage across sessions, enables analytics |\n\n## How Skills Work\n\nEach skill follows a consistent structure:\n\n| Section | Purpose |\n|---------|---------|\n| **Iron Rule** | The non-negotiable principle |\n| **Detection** | How to recognize violations |\n| **Correct Pattern** | Code examples of the right way |\n| **Pressure Resistance** | Handling pushback scenarios |\n| **Red Flags** | Warning signs to watch for |\n| **Rationalizations** | Common excuses and rebuttals |\n\n### Example: YAGNI in Action\n\n**Without skill:**\n```\nUser: \"Create a simple todo API with GET, POST, DELETE\"\n\nClaude: *Creates 500-line \"production-ready\" system with pagination,\n        rate limiting, soft delete, health checks, audit logs...*\n```\n\n**With YAGNI skill:**\n```\nUser: \"Create a simple todo API with GET, POST, DELETE\"\n\nClaude: *Creates exactly 3 endpoints in 30 lines*\n        \"Add pagination when the list grows. Add rate limiting if \n        there's abuse. Don't pay for features you don't need yet.\"\n```\n\n## Skill Categories\n\n| Category | Skills | Focus |\n|----------|--------|-------|\n| **SOLID** | 5 | Object-oriented design principles |\n| **Core** | 6 | Fundamental coding principles |\n| **Testing** | 3 | Test quality and structure |\n| **Security** | 3 | Secure coding practices |\n| **API Design** | 4 | RESTful API best practices |\n| **Performance** | 3 | Optimization patterns |\n| **Code Quality** | 3 | Clean code patterns |\n| **Error Handling** | 2 | Exception management |\n| **Concurrency** | 2 | Thread-safe patterns |\n| **Meta** | 1 | Skill usage tracking |\n\n**Total: 32 skills**\n\n## Contributing\n\n### Adding a New Skill\n\n1. **Baseline test** - Run pressure scenarios without the skill\n2. **Document failures** - Record exactly how Claude violates the principle\n3. **Write skill** - Address those specific failures with Iron Rule + Pressure Resistance\n4. **Test with skill** - Verify Claude now complies under the same pressure\n5. **Refactor** - Close any loopholes found\n\n### Skill Template\n\n```markdown\n---\nname: principle-name\ndescription: Use when [specific triggering conditions]\n---\n\n# Principle Name\n\n## Overview\n[Core principle in 1-2 sentences]\n\n## The Iron Rule\n[Non-negotiable statement]\n\n## Detection\n[How to spot violations]\n\n## Correct Pattern\n[Code examples]\n\n## Pressure Resistance Protocol\n[Handling pushback]\n\n## Red Flags\n[Warning signs]\n\n## Common Rationalizations\n[Excuses + rebuttals table]\n```\n\n## License\n\nMIT\n",
  "bytes": 7865,
  "sha": "5d9c5e02e89865c3622338ff4ddfd8b23255ceeef02eaaa550c8e64b1d3e7ede",
  "repo_slug": "yanko-belov/code-craft",
  "fonte": "repo",
  "truncated": false,
  "api": "https://api.agentalog.com/api/listings/skl_yanko_belov_code_craft_aaa_pattern_93a69741/readme"
}