This document defines the coding standards, conventions, and quality requirements for this repository.
- Directories and files: kebab-case (e.g.,
skill-creator/,writing-skills/) - Skill names: letters, numbers, and hyphens only (no parentheses, special characters)
- Documentation files: Descriptive names with
.mdextension
-
One concept per file: Keep files small and focused
-
Skill structure:
skills/ skill-name/ SKILL.md # Main specification (required) references/ # Heavy reference material (optional) supporting-file.* # Tools, examples (only if needed) -
Documentation structure:
docs/ *.md # Human-readable topic docs adr/ # Architecture Decision Records
Skills must support progressive loading:
- Main SKILL.md: <300 words for frequently-loaded skills, <500 for others
- Heavy content: Move to
references/subdirectory - Cross-references: Link to existing skills instead of duplicating
- Formatting: Use
.editorconfigsettings - Line length: Soft wrap acceptable, prioritize readability
- Headings: Use ATX style (
#,##, etc.) - Lists: Consistent bullet/numbering style
- Code blocks: Always specify language for syntax highlighting
Skills must follow agentskills.io specification:
Required YAML frontmatter:
---
name: skill-name-with-hyphens # Only letters, numbers, hyphens
description: Use when {triggering conditions ONLY - third person, <500 chars}
---Description rules (Critical for Claude Search Optimization):
- Start with "Use when..." to focus on triggering conditions
- Include specific symptoms, situations, and contexts
- NEVER summarize the skill's process or workflow (agents may follow description instead of reading full skill)
- Keep under 500 characters if possible
- Third person voice
Required sections:
- Overview (what is this, core principle)
- When to Use (triggers and symptoms)
- Core Pattern or Implementation
- Quick Reference (table or list)
- Common Mistakes
- Evidence/verification requirements
Optional but recommended:
- Red Flags list (for discipline skills)
- Rationalizations table (for discipline skills)
- Real-World Impact examples
When updating documentation as result of applying skills:
- Use human terminology: "Clean Architecture", not "architecture-testing"
- Update appropriate doc:
architecture-overview.md,coding-standards.md,testing-strategy.md - Don't create skill-specific files: No
conventions/architecture-testing.md - Aggregate related info: Group by topic, not by skill
CRITICAL: Zero warnings or errors when committing changes.
During development:
- No unresolved warnings in git commits or package operations
- Warnings must be resolved immediately, not deferred
- Failed quality checks block commits
Before committing:
- Linting passes cleanly
- Static analysis passes cleanly
- All tests pass (BDD checklists verified)
- Documentation updated and consistent
Objective threshold for fixing vs documenting issues:
When warnings, errors, or standards violations occur:
- Investigate root cause (don't just ignore or suppress)
- Estimate fix time vs remaining work time
- Apply 2x threshold:
- If fix time < 2x remaining work → Fix immediately
- If fix time ≥ 2x remaining work → Document in
docs/known-issues.mdwith justification
- Verify resolution (warning gone or properly documented)
Example: Remaining work = 30 minutes. Fix takes 15 minutes. Ratio = 0.5x. Fix immediately.
Common rationalizations to reject:
- "It's just a warning, not an error" → Warnings indicate problems
- "This is normal behaviour" → Normal warnings still indicate configuration issues
- "Can fix it later" → "Later" rarely happens; fix unless >2x impact
- "No time now" → Must calculate 2x ratio first, not subjective
- "That's scope creep" → Fixing issues is part of the work
Documentation requirement:
- Fixed issues: Update this file with configuration/pattern applied
- Deferred issues (>2x threshold): Create tech-debt issue with:
- Issue description and impact
- Fix time estimate showing >2x threshold exceeded
- Steps to replicate
- Priority and timeline for resolution
- Label:
tech-debt
- Explicitly approved exclusions: Document in
docs/known-issues.mdONLY if:- User/stakeholder explicitly approved not fixing
- Justification for permanent exclusion documented
- Regular issues should be tickets, not known-issues entries
Before declaring work complete, verify against repository standards:
- Code quality: Tests exist, documentation updated, follows patterns
- Linting: No warnings or errors
- Standards: Matches conventions in README, CONTRIBUTING, this file
- Repository: Feature branch used, issue updated, PR created if required
- Apply 2x rule to any violations found
- Fix or document each issue
- Then declare complete
TDD is mandatory for all changes, including documentation.
For features/bug fixes:
- Write failing test first
- Write minimal code to pass test
- Refactor while keeping tests green
- No code without failing test first
For documentation:
- Create BDD checklist of expected statements
- Verify checklist fails against current docs
- Record failure reason (missing section, incorrect wording)
- Edit documentation to make checklist pass
- No documentation edits without failing checklist first
No "verify after" changes: Tests/checklists must fail before implementation.
RED-GREEN-REFACTOR methodology:
-
RED Phase - Baseline Testing:
- Run scenarios WITHOUT skill present
- Document agent behaviour verbatim
- Identify rationalizations and failure patterns
- 3+ pressure scenarios (time, sunk cost, exhaustion combinations)
-
GREEN Phase - Minimal Implementation:
- Write skill addressing specific baseline failures
- Verify concrete BDD scenarios pass
- Include exact expected inputs/outputs
-
REFACTOR Phase - Close Loopholes:
- Identify new rationalizations
- Add explicit counters
- Build rationalizations table
- Create red flags list
- Re-verify under pressure
Iron Law: No skill without failing test first. No exceptions.
GitHub Flow:
- Feature branches from
main:feature/issue-{number}-{brief-description} - Sub-task branches from feature:
feature/issue-{number}-subtask-{description} - Never commit directly to
main - Delete branches after merge
Conventional Commits format:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation onlyrefactor: Code refactoring (no behaviour change)test: Adding or updating testschore: Maintenance tasks
Examples:
feat(skills): add architecture-testing skill spec
Add skill for automated architecture boundary enforcement
following RED-GREEN-REFACTOR methodology.
Refs: #1
docs: update coding standards with TDD requirements
Add explicit TDD requirements for documentation changes
and skill development process.
Refs: #42
Before merging:
- Rebase on latest
main - Resolve all conflicts
- Verify clean build
- Ensure all checks pass
Merge approach:
- Squash and merge: If excessive commits for scope
- Fast-forward only: Otherwise (preferred for clean history)
Squash commit messages:
- Must be Conventional Commits format
- Concise description of PR changes
- Include ticket reference in footer:
Refs: #123
- Never commit secrets or API keys
- Use environment variables for sensitive config
- Add sensitive files to
.gitignore - Review PRs for accidental secrets
- Keep prerequisites explicit: List all required tools, access, credentials
- Document where to obtain access
- Specify version requirements
Instead of duplicating content, cross-reference:
**REQUIRED SUB-SKILL:** superpowers:test-driven-development
**REQUIRED SUB-SKILL:** superpowers:verification-before-completion
For detailed TDD methodology, see superpowers:test-driven-development.Link to existing documentation instead of repeating:
- ✅ "See architecture-overview.md for architectural patterns"
- ❌ Copying architecture patterns into multiple files
Frequently-loaded content must be concise:
- Getting-started workflows: <150 words each
- Frequently-loaded skills: <200 words total
- Other skills: <500 words
Techniques:
- Move heavy details to
references/subdirectory - Cross-reference existing skills/docs
- Compress examples (remove verbosity)
- Eliminate redundancy
For skills and processes:
- ✅
creating-skills(notskill-creation) - ✅
condition-based-waiting(notasync-test-helpers) - ✅
using-git-worktrees(notgit-worktree-usage)
Gerunds (-ing) for processes:
testing-skills,debugging-with-logs,writing-plans- Active voice describes the action being taken
Use words users would search for:
- Error messages: "Hook timed out", "ENOTEMPTY"
- Symptoms: "flaky", "hanging", "zombie"
- Tools: Actual command names, library names
- Patterns: Industry-standard terminology
One excellent example beats many mediocre ones.
Good examples are:
- Complete and runnable (no placeholders)
- Well-commented explaining WHY (not just what)
- From real scenarios (not contrived)
- Show pattern clearly
- Ready to adapt (concrete, not generic template)
Don't:
- Implement in 5+ languages
- Create fill-in-the-blank templates
- Write contrived toy examples
- Add examples that don't demonstrate the core pattern
Choose most relevant language for the domain:
- Testing techniques → TypeScript/JavaScript
- System debugging → Shell/Python
- Data processing → Python
- .NET patterns → C#
Use flowcharts ONLY for:
- Non-obvious decision points
- Process loops where agents might stop too early
- "When to use A vs B" decisions
Never use flowcharts for:
- Reference material (use tables, lists)
- Code examples (use markdown blocks)
- Linear instructions (use numbered lists)
- Labels without semantic meaning (
step1,helper2)
Format: Graphviz DOT notation
- docs/architecture-overview.md - Architectural patterns and structure
- docs/testing-strategy.md - Testing approach
- CONTRIBUTING.md - Contribution process
- README.md - Repository standards overview
- AGENTS.md - Agent-specific rules