skills/angular-pr-complexity/SKILL.md
Analyze a git merge commit for PR complexity. Use when: 'analyze this PR', 'how complex is this commit', 'PR complexity for', 'score this merge'.
npx skillsauth add ryan-mahoney/ryan-llm-skills angular-pr-complexityInstall 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.
Analyzes a git merge commit hash and produces a complexity scorecard covering size, spread, cognitive load, and risk signals. Designed for an Angular/Nx monorepo with HTML, SCSS, TypeScript, and spec files.
commit — A git commit hash (short or full). Should be a merge commit representing a PR.git cat-file -t <commit>git rev-list --parents -1 <commit> (merge commits have 2+ parents)# For merge commits, diff against the first parent to get the PR's actual changes
git diff --numstat <commit>^1 <commit>
git diff --stat <commit>^1 <commit>
git show --format="%s%n%b" --no-patch <commit>
Capture:
Calculate and report:
| Metric | Formula | |--------|---------| | Lines Changed | additions + deletions | | Net Lines | additions − deletions | | Files Changed | count of files in diff | | Churn Ratio | deletions / additions (0 = pure addition, >1 = mostly rewrite) |
| Lines Changed | Label | |---------------|-------| | 1–50 | Trivial | | 51–200 | Small | | 201–500 | Medium | | 501–1000 | Large | | 1001+ | XL |
From the file paths in the diff, calculate:
| Metric | How |
|--------|-----|
| Distinct libraries touched | Unique libs/<team>/<lib> or libs/<category>/<lib> prefixes (e.g., libs/teams/internal-crm/case-admin) |
| Distinct apps touched | Unique apps/ prefixes |
| Directory depth | Count unique parent directories of changed files |
| Cross-team | Whether files span multiple libs/teams/<team> directories |
| Libraries Touched | Label | |-------------------|-------| | 1 | Focused | | 2–3 | Moderate spread | | 4+ | Wide spread |
Flag Cross-team = true as a review risk signal.
Categorize every changed file by extension and report counts + line changes per category:
| Category | Extensions |
|----------|------------|
| Template | .html |
| Style | .css, .scss |
| Logic | .ts, .js (excluding .spec.ts, .test.ts) |
| Test | .spec.ts, .test.ts |
| Config | .json, .yaml, .yml |
| Other | everything else |
Calculate:
Test Ratio = test lines changed / logic lines changed
< 0.3 → Low test coverage for changes (flag as risk)0.3–1.0 → Adequate> 1.0 → Test-heavy (good)Template-to-Logic Ratio = template lines / logic lines
Identify and flag:
| Signal | Detection | Risk |
|--------|-----------|------|
| Large single file | Any file with > 150 lines changed | Hard to review in isolation |
| New components | New .component.ts files | New concepts to understand |
| New modules | New .module.ts files | Architectural addition |
| New services | New .service.ts files | New shared state/logic |
| Modified barrel exports | Changes to index.ts or public-api.ts | Public API surface change |
| Modified routing | Changes to *routing* or *routes* files | Navigation impact |
| Modified guards/resolvers | Changes to *.guard.ts or *.resolver.ts | Auth/data flow impact |
| Config changes | Changes to *.json, *.yaml outside src | Build/CI impact |
Present results as a structured report:
## PR Complexity Scorecard: <short commit subject>
**Commit:** `<hash>`
**Author:** <name>
**Date:** <date>
### Size
- Lines changed: X (Label)
- Net lines: +X / -Y
- Files changed: N
- Churn ratio: X.XX
### Spread
- Libraries touched: N (Label)
- Apps touched: N
- Cross-team: Yes/No
- Directories: N unique
### File Type Breakdown
| Category | Files | +Lines | -Lines |
|----------|-------|--------|--------|
| Logic | | | |
| Template | | | |
| Style | | | |
| Test | | | |
| Config | | | |
- Test ratio: X.XX (Label)
- Template-to-logic ratio: X.XX
### Cognitive Load Signals
- [list any flags from Step 5]
### Overall Complexity: <Trivial | Low | Moderate | High | Very High>
Score each dimension 0–3, then sum:
| Dimension | 0 | 1 | 2 | 3 | |-----------|---|---|---|---| | Size | Trivial | Small | Medium | Large/XL | | Spread | 1 lib | 2–3 libs | 4+ libs | Cross-team | | New Concepts | 0 new files | 1–2 new components | 3+ new components or new module | New module + service + routing | | Test Coverage | Ratio > 1.0 | 0.3–1.0 | < 0.3 | No tests |
| Total Score | Label | |-------------|-------| | 0–2 | Trivial | | 3–4 | Low | | 5–7 | Moderate | | 8–9 | High | | 10–12 | Very High |
libs/teams/<team>/<lib>/src/lib/... or libs/<category>/<lib>/src/lib/... patterns (e.g., libs/teams/internal-crm/case-admin/src/lib/components/...).apps/<app-name>/..component.ts, .component.html, .component.scss, .component.spec.ts.Merged in <branch> (pull request #NNNN).git diff <commit>^..<commit> instead of diffing against ^1.testing
This skill should be used when the user asks to "run the spec", "implement the spec", or "execute the spec". Implements every step in a SpecOps implementation spec by delegating each step (or logical group of adjacent steps) to a sequential subagent, conventional-committing each one independently, and — when `roborev` is on the path — running `roborev check` on every commit and `roborev fix` (with spec context, so the fix cannot silently drift the implementation away from the spec) on any commit that fails.
development
Exhaustively audit a top-level UI implementation component against an HTML prototype and produce a grouped markdown checklist of corrections. Use when a user asks for UI parity review, visual QA, design implementation audit, pixel-level drift detection, or behavior/style mismatch analysis between prototype HTML and shipped component code.
development
Audit a SpecOps implementation spec against its source analysis spec to find requirements, policies, contracts, edge cases, error modes, invariants, defaults, side effects, or implementation steps that the implementation has dropped, weakened, contradicted, or silently changed — then patch the implementation spec to restore them. Use this skill whenever the user mentions auditing, comparing, conforming, reconciling, or checking an implementation spec against an analysis spec, finding gaps between two specs, ensuring an implementation spec preserves analysis behavior, or verifying spec derivation or traceability. Also trigger when the user describes "did the implementation spec lose anything from the analysis," "does the implementation match the analysis," "verify the implementation spec covers everything," or asks to confirm one spec is faithful to another. Run this before generating code from an implementation spec and after either spec is edited.
development
Audit a set of SpecOps analysis specs for cross-spec coherence — establish a dependency-ordered implementation sequence, then verify pairwise integration contracts at module boundaries plus three cross-cutting consistency dimensions (shared data models, side-effect ownership, terminology) — and patch the affected specs to resolve gaps. Use this skill whenever the user mentions cross-spec consistency, integration gaps between specs, conflicts between specs, duplicate work across specs, implementation order, dependency order for migration, building an implementation-order checklist, ensuring specs interoperate, terminology drift across specs, or shared data model conflicts. Also trigger when the user describes "do my specs agree with each other," "what order should I implement these in," "find inconsistencies across all my specs," or asks to audit a folder of analysis specs as a set rather than individually. Run this once after generating a full set of analysis specs, before deriving implementation specs.