

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1234567# Audit Code8> **HARD GATE** — **HARD GATE** — Audit must check for: bugs (correctness), security, performance, and clarity. Do NOT skip security review if the code touches user data, auth, or external APIs.91011Run this self-review before asking anyone else to look at the code. The goal is to catch everything that is clearly wrong or missing — so the reviewer can focus on design and architecture, not hygiene.1213**Distinct from `request-review`:** This is the coding agent checking its own work. No second agent is involved. Run this first; run `request-review` after this passes.1415## Look-here-first (churn heuristic)1617Before the checklist, rank changed files by git churn and review **high-churn hotspots first** — they carry the most latent risk regardless of diff size.1819```bash20bash scripts/bp-churn-rank.sh --since 90.days --limit 1521```2223Apply the full checklist to churn-ranked files in descending order. Files with zero recent commits but large diffs still get reviewed; churn only sets priority, not scope.2425## Modes2627- Default: full checklist28- --quick: Run only Supply Chain and Test Coverage. Use for changes under 50 LOC.29- --gate: Non-interactive mode for automated CI gating (used by build-epic step 6). Exit with non-zero status code (`exit 1`) on ANY checklist failure; `exit 0` only if ALL items pass. Produces a compact pass/fail summary to stderr. On failure, list every ✗ item with reason.30- --parallel: Run checklist sections in **isolated git worktrees** (e45s18) so concurrent checks cannot corrupt each other's working tree:3132```bash33bash scripts/lib/parallel-review-worktrees.sh audit-code34```353637## Checklist3839### Supply Chain & Security4041- [ ] slopcheck run for new dependencies; packages tagged in plan-work: `[OK]`, `[SUS]`, or `[SLOP]`42- [ ] No `[SLOP]` packages without documented human approval43- [ ] No secrets in diff (`sk-`, `ghp_`, `AKIA`, `.env` values) — see `guard-git` patterns44- [ ] OWASP Top 10 spot-check: injection, broken auth, sensitive data exposure, misconfiguration (see `docs/references/security-threats.md`)45- [ ] Security: diff scanned — no unaddressed HIGH findings (or deviations documented in `specs/security/EXCEPTIONS.md`)4647### Provenance & Metadata4849- [ ] New plan artefacts include `type:` and `context:` metadata50- [ ] Implementation steps reference ADR or commit SHA where decisions were made5152### Law of Demeter5354- [ ] No method chains through unrelated objects (e.g. `a.getB().getC().doX()`)55- [ ] Collaborators talk to immediate neighbors only; law violations need explicit justification5657### CONVENTIONS.md Compliance5859- [ ] All output files are in `specs/` (no docs written to project root)60- [ ] No `gh issue create` calls anywhere in new/modified skills or scripts61- [ ] `gh` used only for PRs and repo clone operations62- [ ] No GitHub REST API called directly (no curl/fetch to api.github.com)6364### Scope6566- [ ] Changes are limited to what was asked — nothing extra refactored or reorganized67- [ ] No speculative features added68- [ ] No files touched outside the stated scope69- [ ] **Discovered defects:** Reproducible gate failures (Preflight, CI, golden suite) require fix-or-log — `quick-fix` or `fix-bug` — even when "outside" the story scope. Scope-minimization does not waive Always Green.70- [ ] Boy Scout Rule applies to files opened to fix a gate failure; it does not excuse skipping red Preflight7172### Boy Scout Rule7374- [ ] Every file I touched is cleaner than when I found it75- [ ] No dead code left behind76- [ ] No commented-out code blocks7778### Types and Safety7980- [ ] No `any` types introduced (TypeScript) or untyped public functions (Python/Go/etc.)81- [ ] No `@ts-ignore` or `// eslint-disable` added82- [ ] No `as unknown as X` casts that bypass type safety8384### Test Coverage8586- [ ] Every new function has at least one test87- [ ] Every bug fix has a regression test88- [ ] Tests verify behavior through public interfaces (not implementation details)89- [ ] Tests are F.I.R.S.T compliant (per CONVENTIONS.md §Tests; use `enforce-first` if unsure)9091### SOLID and Heuristics9293- [ ] Single Responsibility: no function or module doing two unrelated things94- [ ] Open/Closed: extended through interfaces, not by modifying stable code95- [ ] Dependency Inversion: dependencies injected, not imported globally where avoidable96- [ ] **Chapter 17 Heuristics**: Code is free of smells documented in `audit-code/HEURISTICS.md` (G, N, C, T)9798### Refactoring Smells (Fowler)99100Explicitly name any detected smells: Mysterious Name, Duplicated Code, Feature Envy, Data Clumps, Primitive Obsession, Message Chains, Middle Man.101102### Code Style (CONVENTIONS.md)103104- [ ] Functions: 4–20 lines; split if longer105- [ ] Functions: descend exactly one level of abstraction (The Stepdown Rule / G34)106- [ ] Files: under 300 lines (ideally 200–300)107- [ ] Names: specific and unique (grep returns < 5 hits for each name)108- [ ] No duplication — shared logic extracted (DRY / G5)109- [ ] Early returns over nested ifs; max 2 levels of indentation110- [ ] Conditionals: expressed as positives (G29)111- [ ] Comments explain WHY, not WHAT112113### Red Flags114115Before reporting, name any rationalization you caught yourself making for skipping a checklist item. Silence is not acceptable — if you skipped an item, state the reason explicitly.116117## Output118119Report the checklist with ✓ / ✗ per item. For each ✗, describe what needs to be fixed.120121If all items pass: suggest running `request-review` for an independent second opinion.122If any items fail: fix them before proceeding.123124In `--gate` mode, print one summary line per checklist section (`PASS Supply Chain` / `FAIL Provenance (2 items)`). Exit `0` only if all PASS. Write full report to `specs/verifications/AUDIT-<epic>-<story>.md`.125126## Verify127128→ verify: `test -f CONVENTIONS.md && test -d skills/enforce-first && test -d skills/request-review`129130## Handoff131132Gate: READY -> next: commit-message133Writes: state.yaml handoff.next_skill = commit-message134135136<!-- story: e01s02 -->137<!-- story: e06s03 -->138<!-- story: e07s01 -->139140---141142# Clean Code Heuristics (Chapter 17)143144A summary of Robert C. Martin's catalogue of code smells and heuristics, used as the technical benchmark for `audit-code`.145146## Comments (C)147- **C1: Inappropriate Information**: Comments should only hold technical notes. Metadata (author, change history) belongs in Git.148- **C2: Obsolete Comment**: Update or delete comments that are no longer accurate.149- **C3: Redundant Comment**: Don't describe code that adequately describes itself (e.g., `i++; // increment i`).150- **C4: Poorly Written Comment**: If you write a comment, spend time making it the best it can be.151- **C5: Commented-Out Code**: Delete it. Git remembers it.152153## Environment (E)154- **E1: Build Requires More Than One Step**: Building should be a single trivial operation (e.g., `bash install.sh`).155- **E2: Tests Require More Than One Step**: Running all tests should be one simple command (e.g., `npm test`).156157## Functions (F)158- **F1: Too Many Arguments**: 0 is ideal, 1-2 is fine, 3 requires special justification. Never > 3.159- **F2: Output Arguments**: Avoid them. If a function changes state, it should change the state of its owning object.160- **F3: Flag Arguments**: Boolean arguments are a smell that the function does > 1 thing.161- **F4: Dead Function**: Discard methods that are never called.162163## General (G)164- **G1: Multiple Languages in One Source File**: Try to minimize the mixing of languages (e.g., HTML inside Java).165- **G5: Duplication (DRY)**: **The root of all evil.** Every time you see duplication, it's a missed opportunity for abstraction.166- **G6: Code at Wrong Level of Abstraction**: High-level concepts in base classes; low-level details in derivatives.167- **G25: Replace Magic Numbers with Named Constants**: No "naked" numbers or strings.168- **G28: Encapsulate Conditionals**: Prefer `if (shouldBePublished())` over complex boolean logic.169- **G29: Avoid Negative Conditionals**: Prefer `if (buffer.shouldCompact())` over `if (!buffer.shouldNotCompact())`.170- **G30: Functions Should Do One Thing**: If a function can be split into sections, it's doing too much.171- **G31: Hidden Temporal Couplings**: If execution order matters, make the dependency explicit via arguments.172- **G34: Functions Should Descend Only One Level of Abstraction**: The Stepdown Rule.173174## Naming (N)175- **N1: Choose Descriptive Names**: Names should reveal intent and be updated as code evolves.176- **N4: Unambiguous Names**: Names should make the working of a function/variable clear.177- **N7: Names Should Describe Side-Effects**: Describe everything the function is or does.178179## Tests (T)180- **T1: Insufficient Tests**: A test suite should test everything that could possibly break.181- **T4: An Ignored Test Is a Question about an Ambiguity**: Document the reason for `@Ignore`.182- **T5: Test Boundary Conditions**: Most bugs happen at the boundaries; test them exhaustively.183- **T8: Test Coverage Patterns Can Be Revealing**: Analyze what code is *not* executed to find gaps.184- **T9: Tests Should Be Fast**: Slow tests don't get run.185
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| danielvm-git/bigpowers.cursor/rules/simple-english.mdc · 134 | Cursor rules | styletypesgitdatabase+6 | 47/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/build-epic.mdc · 134 | Cursor rules | buildgit | 58/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/extract-design.mdc · 134 | Cursor rules | lint-formatstyledependenciesui | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/plan-tests.mdc · 134 | Cursor rules | teststyletesting-strategyagent-behaviour | 66/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/plan-release.mdc · 134 | Cursor rules | testlint-formatarchdeployment | 74/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/request-review.mdc · 134 | Cursor rules | git | 62/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/research-first.mdc · 134 | Cursor rules | buildarchdependencies | 70/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/run-benchmark.mdc · 134 | Cursor rules | styleperformance | 58/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/reset-baseline.mdc · 134 | Cursor rules | no sections | 40/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/define-language.md · 134 | Windsurf rules | lint-formatdo-not | 65/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/context7-mcp.md · 134 | Windsurf rules | style | 54/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/delegate-task.md · 134 | Windsurf rules | git | 62/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/extract-design.md · 134 | Windsurf rules | lint-formatstyledependenciesui | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/security-review.md · 134 | Windsurf rules | lint-formattesting-strategygitsecurity+2 | 60/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/verify-work.md · 134 | Windsurf rules | buildtestlint-formatagent-behaviour | 74/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/wire-ci.md · 134 | Windsurf rules | buildtestlint-formatstyle+1 | 81/100 | 14 days ago | |
| danielvm-git/bigpowerswebsite/AGENTS.md · 134 | AGENTS.md | docs | 31/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/terse-mode.md · 134 | Windsurf rules | styledo-not | 56/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/trace-requirement.md · 134 | Windsurf rules | buildtesting-strategy | 54/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/align-grid.mdc · 134 | Cursor rules | lint-formatdo-notagent-behaviour | 65/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| danielvm-git/bigpowers.windsurf/rules/organize-workspace.md · 134 | Windsurf rules | buildstylegitdeployment+2 | 89/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/guard-git.md · 134 | Windsurf rules | stylearchgitsecurity+2 | 89/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/develop-tdd.md · 134 | Windsurf rules | teststylearchtesting-strategy+5 | 85/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/quick-fix.md · 134 | Windsurf rules | teststylegitdeployment+1 | 85/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/session-state.md · 134 | Windsurf rules | lint-formatstyleagent-behaviour | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/extract-design.md · 134 | Windsurf rules | lint-formatstyledependenciesui | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/commit-message.md · 134 | Windsurf rules | lint-formatstyletypesgit+3 | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/wire-ci.md · 134 | Windsurf rules | buildtestlint-formatstyle+1 | 81/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/danielvm-git-bigpowers-windsurf-rules-audit-code)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.