Atomic audit
Use when assessing how far a repo — or a whole portfolio of repos — has adopted atomic design; when design-token, primitive-layer, catalog, or enforcement maturity needs an evidence-backed score; when /sge:sge-align needs its L2 Design System signal (check C10); or before planning a design-system investment, extraction, or migration roadmap. Advisory and read-only — not for making changes.From its SKILL.md
npx -y skills add WealthTechPros/sge-public --skill atomic-auditAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 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.
SKILL.md
18.6 KB, as published. Nobody here has run it
Atomic Audit — Atomic-Design Adoption Assessment
Role
Score a repo's atomic design adoption across six dimensions, produce a maturity tier (L0–L3), and emit a prioritised remediation roadmap — advisory-only, no changes.
Out of scope
- Implementing atomic-design changes (advisory only)
- Assessing non-UI repos (no detectable UI stack → graceful N/A)
- Making any writes to the repo
Point this at any repo and find out how far it has adopted atomic design — and what to do next.
It auto-detects the UI stack (web and mobile/native), scores adoption across six dimensions, rolls up to an atomic maturity tier (L0–L3), and prints a remediation roadmap. For a finished adoption run end-to-end, see the worked example.
Advisory and read-only. It reports; it never commits, opens issues, or modifies repo files. Safe to run repeatedly — same repo, same report (anchored by the deterministic scanner below).
Execution model
This skill runs as a forked, read-only subagent (context: fork, with
allowed-tools restricted to reads). The fork returns the full report to the
caller; mutations are impossible by construction. Two consequences:
--out <file>— the fork itself writes nothing. If--outwas passed, the caller (main conversation) writes the returned markdown to<file>after the fork returns.- Headless consumption — orchestrators (notably
/sge:sge-align) invoke it with--jsonand consume the structured result without any interaction.
Usage
/sge:atomic-audit [path] [--stack <key>] [--out <file>] [--json] [--fleet <repos…>]
$ARGUMENTS carries everything: the first non-flag token is the path
(default: repo root / cwd); the rest are flags.
| Arg / flag | Effect |
|---|---|
path | Directory to audit (default: repo root / cwd). |
--stack | Force a stack instead of auto-detecting. Values: auto (default), react, vue, svelte, angular, swiftui, compose, flutter, generic. |
--out <file> | Caller writes the markdown report to <file> after the fork returns (the only file ever written, and not by the fork). |
--json | Emit the structured scores as JSON (schema in Step 4) in addition to the report. This is the mode /sge:sge-align check C10 consumes. |
--fleet <repos…> | Portfolio mode — audit several repos and aggregate (see Portfolio mode). |
Stack signals (collected at invocation):
!ls package.json pubspec.yaml Package.swift 2>/dev/null; ls -d *.xcodeproj 2>/dev/null; grep -ls "androidx.compose" build.gradle build.gradle.kts settings.gradle settings.gradle.kts 2>/dev/null; true
Step 0 — Learn this repo's conventions
Atomic-design artefacts live in different places per repo and stack. Read the
repo's CLAUDE.md (and any docs/ design notes) first to locate, in this
repo's terms:
- the token source of truth (theme config, asset catalog, CSS vars)
- the primitive/component layer vs feature widgets
- the component catalog (Storybook, Previews, Widgetbook)
- the test locations and the repo's quality-suite commands
Never assume a layout — confirm it. If CLAUDE.md is silent, fall back to the
detection signals below.
Step 1 — Detect the UI stack
Detect from manifests at path (the preloaded stack signals above are the
first read); --stack overrides. A repo may expose more than one UI surface
(e.g. a web app and an iOS app) — score each separately and report them as
sections.
| Signal | Stack key |
|---|---|
package.json deps include react / react-dom | react |
package.json deps include vue | vue |
package.json deps include svelte | svelte |
package.json deps include @angular/core | angular |
Package.swift / *.xcodeproj / *.swift importing SwiftUI | swiftui |
build.gradle(.kts) with androidx.compose deps | compose |
pubspec.yaml with a flutter: section | flutter |
| none of the above | generic |
When detection is ambiguous, ask. If detection lands on generic, or the
repo has multiple UI surfaces and neither --stack nor an explicit instruction
narrows it, present an AskUserQuestion: one option per detected/likely
surface (with the signal that suggested it as the description), plus "all
surfaces" and "generic heuristics". In headless mode (--json consumer, no
user), skip the question: audit all detected surfaces, or generic if none.
Generic fallback (stack unknown / non-mainstream): use only language-neutral
signals — directory names (tokens, theme, design-system, atoms, ui,
primitives, components), presence of any component catalog, and
duplicated-markup heuristics. State explicitly in the report that generic
heuristics were used, so scores are read with appropriate confidence.
Record what you detected and what you scanned (paths, file counts) — it goes in the report header.
Step 2 — Run the deterministic scanner, then score the six dimensions
First, run the bundled scanner — its key=value output is the evidence
base that anchors the idempotency claim:
bash "${CLAUDE_PLUGIN_ROOT:-$(git rev-parse --show-toplevel)}/skills/atomic-audit/scan.sh" <path>
It is read-only, pure grep/find, makes no stack assumptions beyond common
naming patterns, and degrades every probe to 0 when a pattern is absent.
Quote its numbers in the evidence cells (e.g. literals.raw_hex=284,
primitives.files=23). Supplement — never replace — its counts with the
stack-specific probes below; if the script is unavailable, gather the same
counts manually and say so in the report header.
Score each dimension 0–3 and, for each, record the evidence (paths +
counts) and the one-line gap behind the score — the report must be auditable,
never a bare number. (Evidence and gap feed the Step 4 report columns and the
--json output directly.)
| Score | Level | Meaning |
|---|---|---|
| 0 | Absent | No sign of this dimension. |
| 1 | Partial | Exists in places / ad-hoc / inconsistent. |
| 2 | Established | Present and used consistently across the codebase. |
| 3 | Enforced | Present, consistent, and mechanically guarded (lint/CI/test). |
The six dimensions (probes vary by stack):
-
Design tokens — a tokenised source of truth.
- web: Tailwind
theme/ CSS custom properties / Style Dictionary - swiftui:
Color/Fontasset catalogs, a tokens enum - compose: a
MaterialTheme/customThemewith color/typography - flutter:
ThemeData/ a tokens file - 3 if values are referenced via tokens everywhere (no raw hex/px sprinkled in components).
- web: Tailwind
-
Primitive layer (atoms/molecules) — a dedicated presentational layer distinct from feature widgets (
ui/,components/atoms, a SwiftUI/Compose component library, a Flutter widget library).- 3 if the boundary is explicit and primitives are clearly presentational.
- Denominator: wherever this dimension (and dim 4) compares primitives or
stories against "component count", use the scanner's
components.files(source component files under the repo's component root, excluding tests and catalog/story files). State the denominator you used in the evidence cell so the ratio is reproducible.
-
Composition discipline — do feature components compose primitives, or re-roll markup? This dimension is scored against two measured sub-metrics, and the dimension score is the lower of the two (floor-biased, like the tier roll-up):
-
Raw-literal density =
(literals.raw_hex + literals.raw_px) / components.filesfrom the scanner (per component file):Density Sub-score < 0.5 3 0.5 – < 2.0 2 2.0 – < 5.0 1 ≥ 5.0 0 -
Composition rate = % of feature components (component files outside the primitive layer) that import/compose at least one primitive — grep imports referencing the primitive layer's path/module (web), or uses of library components vs re-rolled view code (native):
Rate Sub-score ≥ 80% 3 50–79% 2 20–49% 1 < 20% 0
Note duplicated pattern clusters (repeated card/badge/modal class clusters on web; repeated view-modifier chains on SwiftUI) as supporting evidence, but the score comes from the thresholds, not vibes. For non-web surfaces where raw-px is meaningless, score density on raw colour/spacing constants in view files instead, and say so in the evidence cell.
-
-
Catalog / docs — a live component catalog and its coverage vs component count: Storybook/Styleguidist (web), SwiftUI
#Preview, Compose@Preview, Widgetbook (flutter). Scanner inputs:catalog.story_files,catalog.swift_previews,catalog.compose_previews.- 3 if (near-)every primitive has a catalog entry.
-
Primitive testing — unit / interaction / visual-regression / a11y coverage targeting the primitive layer (not just feature tests). Scanner inputs:
tests.primitive_test_filesvsprimitives.files.- 3 if primitives are broadly covered incl. a11y or visual regression.
-
Enforcement — automated guardrails keeping the layering honest: import/lint rules (e.g.
no-restricted-importsbarring primitives from data/store/router modules), architecture tests, CI catalog/coverage gates. Scanner input:enforce.import_rule_files(presence signal only).- 3 if a guardrail actively fails the build on a violation. Confirm the guardrail is wired into a build-failing CI job (not lint-config presence alone) before scoring 3.
Step 3 — Roll up to an atomic maturity tier (L0–L3)
Disambiguation — two different L-scales. The tiers below are atomic maturity tiers L0–L3 (Ad-hoc → Enforced). They are not the SGE governance layers L0–L8 (Vision → Cortex). Always write the tier as e.g. "atomic maturity L1 (Emerging)" — never a bare "L1" — so the two numbering schemes can't be confused downstream.
The overall tier is floor-biased — a missing foundation caps the tier, no matter how strong other dimensions are. Evaluate the rules top-down (L3 → L0) and assign the highest tier whose rule is satisfied. Report the tier with the reason.
| Tier | Name | Rule |
|---|---|---|
| L0 | Ad-hoc | dimension 1 or 2 scores 0 |
| L1 | Emerging | dimensions 1 and 2 ≥ 1 (tokens + a primitive layer exist) |
| L2 | Established | all dimensions ≥ 2 |
| L3 | Enforced | all dimensions ≥ 2 and dimension 6 = 3 |
Step 4 — Produce the report
Print this markdown to chat. With --out <file>, the caller writes it to
<file> after the fork returns. With --json, additionally emit the
structured result:
{
"repo": "<repo name or path>",
"stack": "react",
"dimensions": [
{ "n": 1, "name": "Design tokens", "score": 2, "level": "Established",
"evidence": "tailwind.config.js theme; literals.raw_hex=284 across 52 files", "gap": "tokens not enforced in feature code" }
],
"tier": "L2"
}
repo, stack, dimensions[].name, dimensions[].score (bare integer 0–3),
dimensions[].evidence, and tier are required — this is the schema
/sge:sge-align check C10 validates and consumes. n, level, and gap are
included for human readers. Multi-surface repos emit one object per surface.
# Atomic-Design Adoption — <repo/path>
**Stack:** <detected stack(s)> · **Scanned:** <paths, file counts>
**Atomic maturity tier:** <L0–L3 name> — <one-line reason>
| # | Dimension | Score | Level | Evidence | Gap |
|---|-----------|:-----:|-------|----------|-----|
| 1 | Design tokens | 2/3 | Established | `tailwind.config.js` theme; 0 raw-hex in ui/ | tokens not enforced in feature code |
| 2 | Primitive layer | 2/3 | Established | `src/components/ui/` (7 primitives) | only 7 of ~110 components are primitives |
| 3 | Composition discipline | 1/3 | Partial | density 2.8/file; composition rate 31% | features re-roll markup |
| 4 | Catalog / docs | 1/3 | Partial | Storybook present; 5/110 stories | thin catalog coverage |
| 5 | Primitive testing | 1/3 | Partial | 30 test files; 4 target ui/ | primitives under-tested |
| 6 | Enforcement | 3/3 | Enforced | `no-restricted-imports` on `ui/**`, CI-gated | — |
(The row values above are an illustrative example, not fixed output — fill each cell from the actual evidence gathered in Step 2.)
Step 5 — Remediation roadmap
Output discipline — focus over overwhelm. Lead the roadmap with the 1–2 highest-leverage slices (the weakest dimension that caps the tier, then the cheapest win that raises it). The full ordered checklist below supports these — it is context, not the headline. If you find yourself leading with more than 2 slices, pick the top 2 by tier-impact; the rest follow in the ordered list.
Always emit S0 first (the inventory audit is the foundation for everything else). Then, for every dimension scoring < 2, emit its slice — presented in the dependency order below, sized S/M/L. Skip the slice for any dimension scoring ≥ 2 unless its Step-2 gap names a concrete, cheap remediation — then include it and mark it "polish".
| If weak… | Recommended slice | Effort |
|---|---|---|
| (always first) | S0 — inventory audit: catalogue duplication, finalise the primitive list, document the layering contract | S |
| dim 1 tokens | Tokens — establish/extend the token source of truth; replace raw values | S–M |
| dim 2 primitive layer | Primitives — extract the duplicated patterns into a presentational layer | M–L |
| dim 4 catalog | Catalog — add catalog entries (stories/previews) per primitive | M |
| dim 5 testing | Testing — add unit/interaction/a11y/visual coverage to primitives | M |
| dim 3 composition | Compose — migrate feature widgets onto primitives; delete duplicated markup | M–L |
| dim 6 enforcement | Enforce — add an import/lint/architecture guardrail + CI gate | S |
Present the roadmap as an ordered checklist the user can lift straight into issues. Do not create the issues — that is the user's call (see Principles). (For how one repo executed this exact slice order, see the worked example.)
Portfolio mode (--fleet)
For a portfolio owner ("how mature are our 12 repos?"), fan out instead of auditing serially:
Target repo — cross-repo / control-session invocation. Prefer an existing local checkout over a fresh clone for each
--fleetslug: resolve it via${CLAUDE_PLUGIN_ROOT:-$(git rev-parse --show-toplevel)}/scripts/with-repo-cwd.sh resolve owner/repo, which finds a checkout underSGE_CHECKOUT_ROOTS/the hub sibling layout by matchingorigin— a repo already checked out is audited from there, not re-cloned. Fall back togh repo cloneinto a temp dir only when the helper reports no match. Seegh-repo.
- Resolve the repo list from
--fleet <repos…>(paths orowner/reposlugs; clone slugs read-only to a temp dir viagh repo clone). - One audit agent per repo, in parallel (Workflow-style fan-out; cap
concurrency sensibly, ~4–8). Each agent runs Steps 0–4 for its repo,
headless, and must return the Step 4 JSON —
{repo, stack, dimensions:[{name, score, evidence}], tier}— schema-validated: reject and re-request a result missing required fields rather than guessing. - Aggregate into a maturity table, worst-first:
| Repo | Stack | Tier | Weakest dimension | Headline gap |
|------|-------|:----:|-------------------|--------------|
| acme/web-app | react | L1 | Composition (1/3) | features re-roll markup |
| acme/ios-app | swiftui | L0 | Tokens (0/3) | no token source of truth |
- Follow with per-repo reports (or
--outthem) and a portfolio-level observation: shared weakest dimension, candidate shared design-system investment, which repo to remediate first.
SGE cascade linkage
This skill is the L2 Design System probe in the SGE governance cascade
(layers L0 Vision → L1 Capability Model → L2 Design System → L3 Feature
Specs → … → L8). /sge:sge-align check C10 invokes it in --json mode as
a forked read-only subagent and consumes the tier field as the repo's L2
signal: atomic maturity L2 (Established) or better passes; L0/L1 raises
a drift gap; no detectable UI stack makes C10 N/A.
Keep the two scales straight when reporting into that cascade: this skill's L0–L3 are atomic maturity tiers; the cascade's L0–L8 are governance layers. Always qualify ("atomic maturity L1"), per the Step 3 callout.
Principles
- Advisory & read-only. Report only. Never commit, open issues, or modify
repo files (the fork cannot write at all;
--outis written by the caller). Creating work items is the user's decision. - Evidence over opinion. Every score cites paths + counts — anchored by
scan.shoutput. No bare numbers. - Stack-agnostic. No hardcoded paths; honour the repo's
CLAUDE.mdand quality-suite conventions. Degrade gracefully togenericheuristics. - Floor-biased tiering. A missing foundation (tokens or primitive layer) caps the maturity tier regardless of other strengths.
- Idempotent. Same repo state, same report — the deterministic scanner is the anchor.
Related skills
/sge:sge-align— governance-cascade drift (Vision→Code); its check C10 consumes this skill's--jsontier as the L2 signal/sge:refactor— execute the extraction/migration slices this audit recommends/sge:implement-issue <N>— build a remediation slice once it's an issue