Two-axis review of the diff between HEAD and a fixed point the user supplies: -…
- User
Two-axis review of the diff between
HEADand a fixed point the user supplies:- Standards — does the code conform to this repo's documented coding standards?
- Spec — does the code faithfully implement the originating issue / PRD / spec?
Both axes run as parallel sub-agents so they don't pollute each other's context, then this skill aggregates their findings.
The issue tracker should have been provided to you — run
/setup-matt-pocock-skillsifdocs/agents/issue-tracker.mdis missing.Process
1. Pin the fixed point
Whatever the user said is the fixed point — a commit SHA, branch name, tag,
main,HEAD~5, etc. If they didn't specify one, ask for it.Capture the diff command once:
git diff <fixed-point>...HEAD(three-dot, so the comparison is against the merge-base). Also note the list of commits viagit log <fixed-point>..HEAD --oneline.Before going further, confirm the fixed point resolves (
git rev-parse <fixed-point>) and the diff is non-empty. A bad ref or empty diff should fail here — not inside two parallel sub-agents.2. Identify the spec source
Look for the originating spec, in this order:
- Issue references in the commit messages (
#123,Closes #45, GitLab!67, etc.) — fetch via the workflow indocs/agents/issue-tracker.md. - A path the user passed as an argument.
- A PRD/spec file under
docs/,specs/, or.scratch/matching the branch name or feature. - If nothing is found, ask the user where the spec is. If they say there isn't one, the Spec sub-agent will skip and report "no spec available".
3. Identify the standards sources
Anything in the repo that documents how code should be written, such as
CODING_STANDARDS.mdorCONTRIBUTING.md.On top of whatever the repo documents, the Standards axis always carries the smell baseline below — a fixed set of Fowler code smells (Refactoring, ch.3) that applies even when a repo documents nothing. Two rules bind it:
- The repo overrides. A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell.
- Always a judgement call. Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation — and, like any standard here, skip anything tooling already enforces.
Assistant
Need a fixed point to compare against
HEAD— e.g.main, a commit SHA, a tag,HEAD~5, or a branch name. What would you like to use?- User
the uncommited changes
Assistant
No originating spec found for the uncommitted changes in
src/logic/banking.rs:- No issue references in recent commits
- No PRD/spec file under
docs/,specs/, or.scratch/ ghisn't authenticated, so I can't query GitHub issues
What's the spec source for this change? Options:
- A GitHub issue number
- A path to a spec/PRD file
- A short description I can use
- No spec — I'll run a Standards-only review
- User
4
Assistant
Standards
Reviewed against
AGENTS.md.Documented-standard violations (hard)
pretty_assertionsnot used in new tests. AGENTS.md requires: "Inline#[cfg(test)]modules; usepretty_assertions." The new tests (test_easter_sunday_known_values,test_is_sepa_banking_day,test_add_sepa_banking_days_skips_weekend,test_sepa_lead_days_matches_epc_core_rulebook, and the new assertion intest_generate_sepa_xml_structure) all use plainassert_eq!/assert!.pretty_assertionsis already a dev dependency.
Baseline smells (judgement calls)
-
Primitive Obsession.
sepa_lead_days(seq_tp: &str)matches on raw strings for a SEPA domain concept (sequence type). A small enum would be more honest:
- User
let's improve Primitive Obsession. sepa_lead_days(seq_tp: &str) matches on raw strings for a SEPA domain concept (sequence type). A small enum would be more honest: fn sepa_lead_days(seq_tp: SepaSequenceType) -> u32 Mysterious Name. The closure in test_is_sepa_banking_day is named ok, which hides its meaning: let ok = |y, m, d| is_sepa_banking_day(NaiveDate::from_ymd_opt(y, m, d).unwrap()); is_banking_day would be clearer. Duplicated Code. In easter_sunday, the expression (h + l - 7 * m + 114) is computed twice: let month = ((h + l - 7 * m + 114) / 31) as u32; let day = (((h + l - 7 * m + 114) % 31) + 1) as u32;
Assistant
Done. Three changes in
src/logic/banking.rs:-
Primitive Obsession — replaced raw
&strsequence type with a typed enum:#[derive(Debug, Clone, Copy)] #[allow(dead_code)] enum SepaSequenceType { First, OneOff, Recurring, }sepa_lead_daysnow takesSepaSequenceType, andgenerate_sepa_xmlusesSepaSequenceType::RecurringwithAsRef<str>to write the XML value. Theallow(dead_code)is needed because onlyRecurringis currently emitted; the other variants are valid SEPA domain values the helper still supports. -
Mysterious Name — renamed the
okclosure intest_is_sepa_banking_daytois_banking_day. -
Duplicated Code — extracted the repeated Easter expression into
let base = h + l - 7 * m + 114;.
Verification:
cargo fmt— cleancargo clippy --all-features— no issuescargo test— 100 passed
-