Code Coaching
Review "$ARGUMENTS" through the lens of a senior software engineer. Provide mentorship feedback on code quality, architecture patterns, security, performance, and testing.
See also /development-review for a pre-merge approve/request-changes verdict on a feature's changes, rather than mentoring feedback to learn from.
Arguments. $ARGUMENTS may contain the project name and optional flags. Derive <project> from the argument by taking its basename without extension and treat --skip-checks as a flag; never include flags in file paths. All paths below use <project>. If --skip-checks is present, skip the prerequisite check and, before writing any artifact, append one line to .singularskills/log.jsonl: {"ts":"<ISO timestamp>","skill":"coaching-code","workflow":"coaching","phase":null,"project":"<project>","event":"skipped","artifact":"<artifact file>","note":"<reason or \"none given\">"}.
Prerequisites
Stack. Before you build, test, lint, run or generate code, read the Stack section of the project's AGENTS.md, or of CLAUDE.md when AGENTS.md has none. Use its commands exactly as written, its layout for where files go and its rules as requirements. If it names a profile, also read the file <profile>.md in the stacks folder of this skill's bundled references for the full commands, layout and rules; the project's own keys win where both speak. If there is no Stack section, run the singular-detect skill, state what you inferred in one line, and offer to write the section with singular-init. Never assume a package manager, test runner or formatter the project did not declare.
None — this is a utility skill that can run anytime.
Process
Read the target:
- Read the source code files specified in "$ARGUMENTS"
- If it's a directory, read the key files
- Understand the context: what does this code do?
Read reference material:
- Read
references/code-principles.md for engineering principles
- Read
references/feedback-format.md for output structure
Evaluate against engineering principles:
- SOLID: Single responsibility, open/closed, Liskov, interface segregation, dependency inversion
- Clean code: Naming clarity, function size, abstraction levels, self-documenting code
- DRY/YAGNI/KISS: Appropriate abstraction level, no premature optimization
- Security: Input validation, injection prevention, secrets management, auth patterns
- Performance: N+1 queries, appropriate data structures, caching, lazy loading
- Database: Normalization, indexing, query patterns, transactions
- Testing: Coverage, behavior vs. implementation testing, test quality
- Error handling: Appropriate error types, no swallowed errors, graceful degradation
Write the coaching report to .singularskills/coaching/<project>/code-review.md following the feedback format.
References
references/stacks/bun-react-ts.md and references/stacks/rust-gpui.md: the shipped stack profiles
Output
The code coaching report written to .singularskills/coaching/<project>/code-review.md. Present the score and top 3 suggestions to the user.
1---2name: coaching-code3description: Review code as a senior engineer would — SOLID, clean code, security, performance, database and testing — in a scored coaching report with top suggestions. Use when the user wants mentoring feedback on a file or module they wrote to learn how to make it better. Not for a pre-merge review of a feature; see /development-review.4metadata:5 source: https://skillmd.com/skills/bromso/coaching-code6 argument-hint: "<file-or-topic> [--skip-checks]"7 stack-aware: true8---910# Code Coaching1112Review "$ARGUMENTS" through the lens of a senior software engineer. Provide mentorship feedback on code quality, architecture patterns, security, performance, and testing.1314See also `/development-review` for a pre-merge approve/request-changes verdict on a feature's changes, rather than mentoring feedback to learn from.1516**Arguments.** `$ARGUMENTS` may contain the project name and optional flags. Derive `<project>` from the argument by taking its basename without extension and treat `--skip-checks` as a flag; never include flags in file paths. All paths below use `<project>`. If `--skip-checks` is present, skip the prerequisite check and, **before writing any artifact**, append one line to `.singularskills/log.jsonl`: `{"ts":"<ISO timestamp>","skill":"coaching-code","workflow":"coaching","phase":null,"project":"<project>","event":"skipped","artifact":"<artifact file>","note":"<reason or \"none given\">"}`.1718## Prerequisites1920**Stack.** Before you build, test, lint, run or generate code, read the `Stack` section of the project's `AGENTS.md`, or of `CLAUDE.md` when `AGENTS.md` has none. Use its commands exactly as written, its `layout` for where files go and its `rules` as requirements. If it names a `profile`, also read the file `<profile>.md` in the `stacks` folder of this skill's bundled references for the full commands, layout and rules; the project's own keys win where both speak. If there is no `Stack` section, run the `singular-detect` skill, state what you inferred in one line, and offer to write the section with `singular-init`. Never assume a package manager, test runner or formatter the project did not declare.2122None — this is a utility skill that can run anytime.2324## Process25261. **Read the target:**27 - Read the source code files specified in "$ARGUMENTS"28 - If it's a directory, read the key files29 - Understand the context: what does this code do?30312. **Read reference material:**32 - Read `references/code-principles.md` for engineering principles33 - Read `references/feedback-format.md` for output structure34353. **Evaluate against engineering principles:**36 - **SOLID:** Single responsibility, open/closed, Liskov, interface segregation, dependency inversion37 - **Clean code:** Naming clarity, function size, abstraction levels, self-documenting code38 - **DRY/YAGNI/KISS:** Appropriate abstraction level, no premature optimization39 - **Security:** Input validation, injection prevention, secrets management, auth patterns40 - **Performance:** N+1 queries, appropriate data structures, caching, lazy loading41 - **Database:** Normalization, indexing, query patterns, transactions42 - **Testing:** Coverage, behavior vs. implementation testing, test quality43 - **Error handling:** Appropriate error types, no swallowed errors, graceful degradation44454. **Write the coaching report** to `.singularskills/coaching/<project>/code-review.md` following the feedback format.4647## References4849- `references/stacks/bun-react-ts.md` and `references/stacks/rust-gpui.md`: the shipped stack profiles5051## Output5253The code coaching report written to `.singularskills/coaching/<project>/code-review.md`. Present the score and top 3 suggestions to the user.