- Home
- Skills
- Getcosmos
- Agent Skills
- Cosmos Coding Standards
cosmos-coding-standards_skill
0
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill getcosmos/agent-skills --skill cosmos-coding-standards- SKILL.md3.4 KB
Overview
This skill codifies coding standards for readable, maintainable, and testable code, covering SOLID, clean code practices, Domain-Driven Design (DDD), and Test-Driven Development (TDD). It focuses on concrete habits and rules teams can apply during feature work, refactors, and code reviews. The guidance includes formatting, naming, architectural boundaries, dependency management, and UI testing requirements.
How this skill works
The skill inspects code practices and recommends changes to improve clarity, reduce coupling, and increase testability. It emphasizes automated formatting and linting, descriptive naming, small single-purpose functions, and replacing magic values with constants. Architectural checks promote SOLID, separation of concerns, and DDD patterns, while testability checks encourage dependency injection, isolated unit tests, and predictable I/O. For frontend changes, it mandates manual browser-based UI verification alongside automated tests.
When to use it
- Implementing new features to ensure consistent design and testability from the start.
- Refactoring code to reduce complexity, remove god objects, and improve cohesion.
- Performing code reviews to enforce naming, formatting, and architectural rules.
- Writing or updating tests to keep units isolated and reliable.
- Making frontend changes that require visual and functional UI validation.
Best practices
- Enforce automated formatting and linting in CI so code is not merged with style errors.
- Prefer descriptive, intent-revealing names; avoid abbreviations and magic numbers (use named constants).
- Keep functions and classes small and single-purpose; apply SOLID principles consistently.
- Design domain logic independent of frameworks (DDD) and separate I/O from business rules.
- Use dependency injection to enable mockable units and write isolated, repeatable tests.
- Require browser-based UI checks for frontend changes in addition to automated tests.
Example use cases
- Creating a new service: define a single-responsibility class, inject its dependencies, and cover it with isolated unit tests.
- Refactoring a large controller: extract domain logic into domain services and replace direct database calls with repository interfaces.
- Code review checklist: verify naming, small functions, no magic numbers, SOLID adherence, and presence of tests.
- Onboarding new team members: use these standards to align code style, architecture expectations, and testing practices.
- Frontend change rollout: run unit and E2E tests, then perform targeted manual browser checks for visual regressions.
FAQ
Apply pragmatic judgment: keep fixes minimal but avoid introducing anti-patterns. If a quick change reveals design issues, file a follow-up refactor ticket.
When should I prefer DDD over simpler layering?
Use DDD when business rules are complex and evolving. For simple CRUD features, clear separation of concerns and SOLID principles are usually sufficient.