💡 摘要
该技能通过强制执行 SOLID 原则、测试驱动开发和整洁代码实践,将 AI 生成的代码转化为资深工程师质量的软件。
🎯 适合人群
🤖 AI 吐槽: “它承诺将初级代码变成资深水平,但请记住,一个有哲学学位的代码检查器终究只是个检查器。”
该技能本身是一套指导原则,不执行代码。主要风险是间接的:如果遵循这些原则的 AI 智能体被授予修改文件或执行命令的权限,糟糕的实现可能会引入漏洞。缓解措施:严格沙箱化智能体的执行环境,并对安全敏感更改实施代码审查。
Solid Skills
Professional software engineering skills for AI coding agents. Transforms code into senior-engineer quality software through SOLID principles, TDD, clean code practices, and professional software design.
Skills follow the Agent Skills format.
Available Skills
solid
Transform junior-level code into senior-engineer quality software. Primarily designed for TypeScript and NestJS projects, but applicable to any object-oriented codebase.
Use when:
- Writing any code (features, fixes, utilities)
- Refactoring existing code
- Planning or designing architecture
- Reviewing code quality
- Debugging issues
- Creating tests
- Making design decisions
Core principles:
| Principle | Focus | |-----------|-------| | TDD | Red-Green-Refactor cycle, tests before code | | SOLID | Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion | | Clean Code | Meaningful names, small functions, no comments needed | | Design Patterns | Creational, Structural, Behavioral patterns | | Architecture | Vertical slicing, dependency rule, clean architecture |
Reference documentation included:
solid-principles.md- SOLID principles with TypeScript examplestdd.md- Test-Driven Development practicestesting.md- Testing strategies and patternsclean-code.md- Clean code guidelinescode-smells.md- Code smell detection and fixesdesign-patterns.md- GoF patterns with examplesarchitecture.md- Clean architecture principlesobject-design.md- Object stereotypes and responsibilitiescomplexity.md- Managing essential vs accidental complexity
Key features:
- Enforces TDD workflow (write failing test first)
- Detects and fixes code smells automatically
- Applies SOLID principles to every class and function
- Uses value objects for domain primitives (IDs, emails, money)
- Follows Law of Demeter and Tell Don't Ask
- Keeps methods under 10 lines, classes under 50 lines
Installation
npx skills add ramziddin/solid-skills
Usage
Skills are automatically available once installed. The agent will use them when relevant tasks are detected.
Examples:
- "Implement a user registration feature"
- "Refactor this service to follow SOLID principles"
- "Review this code for quality issues"
- "Add tests for this module"
- "Design the architecture for a payment system"
Skill Structure
skills/
└── solid/
├── SKILL.md # Main skill instructions
└── references/ # Supporting documentation
├── solid-principles.md
├── tdd.md
├── testing.md
├── clean-code.md
├── code-smells.md
├── design-patterns.md
├── architecture.md
├── object-design.md
└── complexity.md
License
MIT
优点
- 提供关于关键软件工程原则的全面参考文档
- 通过自动化强制执行,促进高质量、可维护的代码
- 适用于软件开发生命周期的各个阶段
缺点
- 主要关注面向对象范式(如 TypeScript/NestJS)
- 对于简单项目或原型项目可能过于死板
- 依赖于智能体正确理解和应用指导原则的能力
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 ramziddin.
