Coding Best Practices, topic router
Core Principle
General coding guidance is a map, not a monolith. Route each topic to one leaf skill or one mechanical gate; steer outcomes with checks, not walls of prose.
When to Use / NOT
- Use when: the user explicitly asks for best practices, standards, or quality guidance ("what are best practices for X?"), onboarding someone to how this catalog expects work to flow, or choosing which quality skill to load next.
- Use when: the question spans naming, docs, Git, testing, security, or AI-generated code and you need the right pointer fast.
- NOT when: a normal implementation task starts, the ordinary loop (inspect, implement, verify) needs no router; load this only when standards guidance is the actual request.
- NOT when: the task is TypeScript-only, load
typescript-coding-practices(style/modules) andtypescript-coding-standards(domain modeling) instead of this router alone. - NOT when: declaring work complete, load
agent-code-quality-gateand the project's verification commands from itsAGENTS.mdor contributor docs. - NOT when: opening or updating a PR, load
push-pr. - NOT when: deep Git conventions from community guides, load
awesome-guidelines. - NOT when: authoring a new skill, load
writing-skills.
Workflow
- Classify the topic using
references/topic-index.md(naming, docs, errors, Git, AI, performance, principles). - Load the leaf cited on that row, never paste the whole guide inline.
- Implement under
code-discipline(scope, verification, one source of truth). - Test under
test-generation,test-driven-development, ortesting-anti-patternsas appropriate. - Review under
code-review-and-qualitybefore merge when human or agent review is in scope. - Enforce recurring exact contracts via
practices-to-ciwhen the value exceeds maintenance and false-positive cost. - Ship via
push-pronly when delivery is requested and the branch is ready. - Stop when the topic is answered by the loaded leaf and any applicable gate has exit 0 evidence.
Topic → leaf (quick map)
| Topic | Load first | Mechanical gate |
|---|---|---|
| Scope, verification, design taste | code-discipline |
project CI + agent-code-quality-gate |
| Naming, formatting, readability | references/naming-and-formatting.md |
linter/formatter + typescript-coding-practices / javascript-coding-practices when stack-specific |
| README, docstrings, comments | references/documentation-and-readme.md |
repo-hygiene (catalog) |
| Errors, resilience | references/error-handling-and-resilience.md |
behavior tests |
| Git, branches, PRs | references/git-and-collaboration.md |
push-pr, conventional commits |
| AI-generated code | references/ai-assisted-coding.md |
agent-code-quality-gate |
| Performance / data efficiency | references/performance-and-data-efficiency.md |
profile-first; benchmark in CI when stable |
| Security | security-and-hardening |
secret scan, dependency audit |
| Turn practice into CI | practices-to-ci |
the project's PR quality workflow |
Red Flags
- Repeatedly prompting for an exact, valuable invariant that should be owned by
a maintained CI check (
practices-to-ci). - Loading this router and then ignoring the cited leaf, the router has no rules of its own beyond routing.
- Treating DRY/KISS/YAGNI/SOLID as behavioral walls; use them as decision hints, then verify with project gates.
Verification
- The chosen topic row from
references/topic-index.mdnames a leaf skill or reference file you opened. - For implementation work:
agent-code-quality-gatefive checks recorded before claiming done. - For template catalog edits: inspect local skill metadata and run the relevant hard-contract checks documented by that repository.
References
references/topic-index.md, full topic-to-skill and gate table.references/naming-and-formatting.md, names, conventions, comments, whitespace.references/documentation-and-readme.md, README, docstrings, why-not-what comments.references/error-handling-and-resilience.md, errors at boundaries, tests over try/except alone.references/git-and-collaboration.md, Git, branches, commits, PRs.references/ai-assisted-coding.md, reviewing generated code, context files, no blind trust.references/performance-and-data-efficiency.md, profile first, vectorize/chunk when measured.awesome-guidelines, archived cold library; itsreferences/capsules feed the*-coding-practicesleaves (no new ingestion).deep-module-design, structural quality review when the topic is module boundaries or interface complexity.