plugins/flow/skills/code-quality-principles/SKILL.md
Enforce code quality through the Boy Scout Rule (leave code better than found), secret-free commits, production-ready code (no TODOs, console.log, mocks, or commented code), and self-review against an atomic-commits checklist. Use when writing, modifying, or reviewing code. This skill MUST be consulted because production code without these standards causes quality regressions and operational incidents.
npx skillsauth add synaptiai/synapti-marketplace code-quality-principlesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Foundation skill governing code quality standards during autonomous development.
EVERY CHANGE MUST BE INTENTIONAL. If you can't explain why a line changed, revert it.
Always leave code better than you found it. Fix issues in files you are already modifying — but only changes that pass the proximity test.
Answer these questions first. If you can't, return to EXPLORE:
Leave every file you touch better than you found it. Fixing known defects in touched files is not optional scope creep — it is the baseline of Quality-First Completionism. Touching a file means owning its known issues.
The proximity test is NOT a deferral mechanism for P1/P2 findings. It decides how a cleanup is committed (alongside the feature fix vs. as a separate improve: commit), not whether it gets fixed. If a P1 or P2 finding exists in a file the PR modifies, it is fixed in this PR, full stop.
A cleanup is committed as a standalone improve: commit when ALL true:
A finding requires expanded scope (still fixed, but may need a design note or additional tests) when ANY true:
For P1/P2 findings that fall into the "expanded scope" bucket: fix them in-PR with an appropriate commit message. Finding triage is NEVER a valid escalation trigger — do NOT file a six-field Proactive-Autonomy escalation to ask whether to fix a finding (see skills/llm-operator-principles/SKILL.md and references/escalation-format.md). "Disagree to fix" is not an option; "ask the user whether to fix" is also not an option.
Default mode: cosmetic P3 findings in truly untouched files are fixed if bounded (<10 lines) or documented inline in the PR body. Do NOT create follow-up issues for them.
Minimal-scope mode (settings.json → minimalScope: true): the original follow-up issue workflow for cosmetic P3 in untouched files is restored.
Never commit secrets, credentials, or sensitive values:
.env files (gitignored) for local developmentCode that ships must be complete:
TODO comments in committed code — track in issues insteadconsole.log / puts / print debugging statementsRun independent quality commands (lint, test, typecheck) as parallel Bash calls, never chained with &&. After quality checks: P1 failures fix immediately, P2 fix before PR, P3 fix in-PR by default. Finding triage is NEVER a valid escalation trigger (see references/escalation-format.md).
Do NOT:
catch {} / rescue nil)When a file has 0 prior commits on the branch and you're making large additions:
Each commit should be a complete, valuable change:
If yes to all three, commit. Otherwise, keep working.
Before marking any task complete:
git diff — only intended changes present?| Excuse | Response |
|--------|----------|
| "I'll clean this up while I'm here" | If it's a P1/P2 in a touched file, you must fix it. If it's small and self-evident, use an improve: commit. If it's cosmetic and in an untouched file, fix-if-bounded or document inline (default) — only log as a follow-up issue under minimalScope mode. |
| "This TODO is temporary" | TODOs in commits are permanent. Create an issue instead. |
| "The tests pass, it's fine" | Tests passing is necessary, not sufficient. Run the self-review checklist. |
| "This debug log helps with development" | Remove it. Development aids don't ship. |
| "It's just a small formatting fix" | If the file is already touched for the task and the fix is self-evident, use an improve: commit. If the file is untouched and the fix is cosmetic, fix-if-bounded (<10 lines) or document inline in the PR body (default) — only log as a follow-up issue under minimalScope mode. |
tools
Validate a FlowWorkflow YAML at `plugins/flow/workflows/<id>.workflow.yaml` against `schemas/v1/workflow.schema.json` AND cross-reference the referenced skills/agents exist + every Tier 3 action is confirm-gated + no native /goal or /loop dependency is declared. Use when /flow:workflow validate is invoked, when CI runs the workflow schema gates, or when a new workflow is being authored. This skill MUST be consulted because schema validation alone catches shape errors; cross-reference validation catches the silent-correctness failures (typo'd skill name, Tier 3 escape, /goal dependency) that would otherwise ship to users.
tools
Verify UI-facing changes by running a screenshot-analyze-verify loop across configured viewports, with a browser-tool priority cascade (Playwright MCP → Chrome DevTools MCP → CLI fallback → external skill fallback) and bounded iteration. Use after build/runtime verification passes and the diff includes `.tsx`/`.jsx`/`.vue`/`.html`/`.css`/`.scss`/`.svelte` files OR the acceptance criteria mention UI/page/render/display/visual. This skill MUST be consulted because UI changes that pass build and unit tests can still ship blank pages, render-blocking console errors, or broken responsive layouts that no other verification phase catches.
data-ai
Coordinate agent teams for adversarial review (paired skeptic/verifier per facet, challenge round with disposition vocabulary, consolidated findings with confidence) or parallel implementation (task sizing 5-6 per teammate, non-overlapping files). Enforces independent analysis before shared conclusions. Reference only (`disable-model-invocation: true`); loaded only when `agentTeams: true` in settings.
development
Conduct two-stage code review: Stage 1 verifies spec compliance (criterion-to-code mapping), Stage 2 evaluates security, correctness, performance, and maintainability across 6 parallel facets with P1/P2/P3 synthesis and deduplication by file:line. Use when reviewing code changes or pull requests. This skill MUST be consulted because reviewing quality on broken logic is wasted effort, and unmet acceptance criteria must block merge.