agentsclimarketplace

Business logic audit

Skill VictorAurelius/claude-starter-kit/skills/quality/business-logic-audit

Dùng khi user nói 'business audit', 'logic check', 'kiểm tra business logic', 'code đúng rules chưa', hoặc trước GA release. Verify code implement đúng rules.md + use-cases.md. 5 categories /100.From its SKILL.md

Install
npx -y skills add VictorAurelius/claude-starter-kit --skill business-logic-audit

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
  • runs commandsInstructs the agent to run 7 commands, including `ls documents/01-business/*/ | grep -v README` and 6 more.

SKILL.md

6.6 KB, ~1.8k tokens by cl100k_base, as published. Nobody here has run it

/business-logic-audit — Verify Code ↔ Business Rules

Score /100. Walk through every domain in documents/01-business/, verify code implements rules correctly. Adapt <modules> / <core-module> placeholders to your project layout.

Process

1. Collect Domains

ls documents/01-business/*/ | grep -v README

2. Primacy: bug-finding > scoring (BLOCKING)

An audit's purpose is to surface code-rules drift BEFORE production violates documented business policy (wrong pricing, wrong retention, wrong consent flow). A /100 score is less actionable than the same score + list of unimplemented BR-xxx + config-key drifts with file:line evidence. Per .claude/rules/audit-skill-rubric-business-logic-audit.md §4 (mirror of the security-audit bug-finding-primacy pattern).

Rules for every audit run:

  1. Enumerate ALL §3 sub-checks per category. NEVER skip.
  2. Each sub-check returns: PASS / FAIL / N/A-with-reason / ❓ UNCHECKED. No partial credit.
  3. Final output starts with bug list (every BR/config FAIL with rules.md:line + *.java:line evidence) BEFORE the score.
  4. Score is descriptive only; audit-level verdict = FAIL if ANY P0 sub-check FAILS.
  5. Cat 5 Stakeholder rules require human review — Claude flags FAIL, human decides closure.

3. Per-Domain: 5 Categories with per-check rubric

Every category binds to a per-check pass/fail rule. For EACH domain folder, read rules.md, use-cases.md, api-contract.md, then verify in code:

#Category (20pts)Per-check rubric file
1Rule Coverage.claude/rules/audit-skill-rubric-business-logic-audit.md §2.1 (6 sub-checks)
2Config Accuracy.claude/rules/audit-skill-rubric-business-logic-audit.md §2.2 (5 sub-checks)
3Edge Case Tests.claude/rules/audit-skill-rubric-business-logic-audit.md §2.3 (5 sub-checks)
4Cross-Domain Consistency.claude/rules/audit-skill-rubric-business-logic-audit.md §2.4 (5 sub-checks)
5Stakeholder Alignment.claude/rules/audit-skill-rubric-business-logic-audit.md §2.5 (5 sub-checks)

Per-check scoring (all 5 categories)

For each Category N:

  1. Walk through every §2 sub-check in the bound rule.
  2. Mark each sub-check PASS / FAIL / N/A-with-reason / ❓ UNCHECKED.
  3. Score = 20 - (failed_P0_count * 6) - (failed_P1_count * 3) - (failed_P2_count * 1), floor 0; cap 20 if all PASS.
  4. If ANY P0 sub-check fails → category total CAPPED at 16/20 AND audit-level verdict = FAIL.
  5. Each FAIL surfaces in bug list per §2 primacy.

Legacy scoring narrative: reference/scoring-guide.md retained for backward-compat only.

4. Output

Save to documents/audits/business-logic-audit-[date].md

5. Scripts

# Existing — checks 3-layer structure exists
scripts/verify-business-docs.sh

# Manual — verify each BR-xxx has code path
# Grep for config keys in application.yml

Grep Scope — CRITICAL

NEVER scope greps to only top-level module dirs — multi-module Maven/Gradle projects put classes/config in submodules (<core-module>/, <service-module>/). Narrow scope = silent false-positive ("class doesn't exist" when it does).

Safe patterns (use one):

# Option 1 (broad, preferred) — project root, filter by extension
grep -rnE "ClassName|BR-ID" --include="*.java"
grep -rn "config.key.name" --include="*.yml"

# Option 2 (explicit submodules) — glob all module src dirs
grep -rn "ClassName" <modules>/*/src/ --include="*.java"
grep -rn "config.key" <modules>/*/src/main/resources/ --include="*.yml"

Sanity check before filing "X doesn't exist" gap:

# If narrow grep returns 0 hits, re-run with broad scope before claiming absence
grep -rn "SuspectedMissingClass" --include="*.java" | head -5

Ref: .claude/rules/audit-to-gap-pipeline.md.

Context Management

Audit này có thể tốn 30-50K tokens nếu không kiểm soát. Tuân thủ:

  1. Output limiting — LUÔN pipe grep results qua | head -N:
    • BR-xxx grep: | head -30 (chỉ cần biết có/không, không cần xem hết)
    • Config key grep: | head -20
    • Test file count: dùng wc -l thay vì list full
  2. Per-domain staging — Nếu >5 domains, score 2 domains đầy đủ rồi apply pattern cho còn lại. Chỉ individually score domains có cấu trúc ĐẶC BIỆT.
  3. Subagent delegation — Nếu >8 domains hoặc codebase >500 source files:
    • Agent 1: nhóm domain A
    • Agent 2: nhóm domain B
    • Parent: aggregate scores
  4. Skip known-good — Domains không thay đổi từ audit trước → carry forward score, chỉ verify version match

Gotchas

  • Config keys are in application.yml AND application-test.yml — check both
  • Some BR-xxx implemented in gateway (rate-limit rules) not core — search all modules
  • Category 5 (Stakeholder) always requires human review — Claude flags, human decides
  • Grep output cho large codebase có thể 1000+ lines — LUÔN giới hạn
  • Multi-module scope trapgrep -r "X" <top-level-dirs> may silently miss submodule hits (e.g. <core-module>/). Follow "Grep Scope" section above.

Skill Contents

  • reference/scoring-guide.md — Detailed rubric per category with examples
  • data/eval-fixtures/ — 3 synthetic scenarios for self-test

Eval Fixtures

3 synthetic fixtures live under data/eval-fixtures/ to keep this skill honest when its body is edited (per eval-first guidance — keep a regression contract). Each fixture has a # Expected: PASS|FAIL header and a Which check fires annotation.

  • good.md — synthetic attendance domain where every BR-* maps to code + config aligns; expected output 100/100 Grade A.
  • bad-rule-not-implemented.mdBR-ATT-005 declared in rules.md but no @PreAuthorize / service guard exists; Category 1 must report -4.
  • edge-config-key-renamed.md — config key late-threshold-minutes renamed to late-grace-minutes in code, rules.md not updated; Category 2 must catch the silent drift.

Run: open the fixture and walk through the audit process steps mentally against the synthetic content; the Expected audit-report excerpt section in each fixture is the regression contract. When extending this skill, re-walk all 3 fixtures and confirm the expected outputs still hold.

What ships with it: 4 files

11.3 KB alongside SKILL.md

reference/

Gives 0 of the 12 instructions most quality gates skills give in ~1.8k tokens

Counted across 1,524 of the 2,830 authors here whose files we hold, read 2026-09-06

  • Read full output and check exit codein 45 of 1524, across 40 files
  • Verify output confirms the claimin 44 of 1524, across 39 files
  • Identify the command that proves the claimin 43 of 1524, across 39 files
  • Execute the full verification commandin 36 of 1524, across 30 files
  • Produce a verification reportin 34 of 1524, across 18 files
  • Review git diff changesin 30 of 1524, across 16 files
  • Fix build failures immediatelyin 29 of 1524, across 9 files
  • Group findings by severityin 28 of 1524
  • State claim only with evidencein 27 of 1524, across 22 files
  • Verify regression tests with red-green cyclein 26 of 1524, across 22 files
  • Run the full test suitein 26 of 1524, across 25 files
  • Run test suite with coveragein 25 of 1524, across 10 files

Said here and by no other author read

  • Enumerate all sub-checks per category
  • List bugs with file and line evidence before scoring
  • Mark each sub-check as PASS, FAIL, N/A, or UNCHECKED
  • Verify code against rules, use-cases, and api-contract files
  • Pipe grep results through head to limit output size
  • Use broad grep patterns to include all project submodules

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.