Help us improve
Share bugs, ideas, or general feedback.
From harness-claude
Audits brand compliance by detecting token misuse in forbidden contexts (BRAND-T001) and forbidden phrases in UI copy (BRAND-V001) from DESIGN.md and tokens metadata.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeHow this skill is triggered — by the user, by Claude, or both
Slash command
/harness-claude:audit-brand-complianceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Rule-based brand-semantics audit. Detects (a) tokens used in forbidden contexts per their `$extensions.harness.brand.forbidden_contexts` metadata (BRAND-T001) and (b) UI copy containing phrases listed in `DESIGN.md ## Brand Rules → voice.forbidden_phrases` (BRAND-V001). The 4th composed verifier in `harness check-design`, alongside audit-component-anatomy, design-craft critique, and detect-de...
Validates brand compliance across visual (colors, logos, typography), verbal (tone, voice, terminology), legal (claims, disclosures), and accessibility (WCAG AA) dimensions, generating scored reports with fixes.
Captures aesthetic intent, generates DESIGN.md with anti-patterns and platform notes, reviews components against guidelines, and enforces design constraints at configurable strictness levels.
Scans codebases for token compliance violations: hardcoded raw values, wrong-tier token references, inconsistent application. Produces reports with file references and remediation guidance.
Share bugs, ideas, or general feedback.
Rule-based brand-semantics audit. Detects (a) tokens used in forbidden contexts per their
$extensions.harness.brand.forbidden_contextsmetadata (BRAND-T001) and (b) UI copy containing phrases listed inDESIGN.md ## Brand Rules → voice.forbidden_phrases(BRAND-V001). The 4th composed verifier inharness check-design, alongside audit-component-anatomy, design-craft critique, and detect-design-drift.
DESIGN.md ## Brand Rules — verify the new constraints are enforceable on the existing codebase$extensions.harness.brand metadata to a token — discover existing call sites in forbidden contextsharness validate (fast-mode hook, gated by design.audit.brandCompliance.enabled)harness check-design (the unified design check)harness-design skill to draft DESIGN.md sections)Read project configuration. Check harness.config.json for:
design.strictness — strict / standard / permissive (default standard)design.audit.brandCompliance.enabled — gate (default true)design.audit.brandCompliance.rules.{tokenMisuse,voice} — per-rule togglesLoad design-system/DESIGN.md ## Brand Rules. The parser extracts:
voice.forbiddenPhrases: string[] — used by BRAND-V001 in v1voice.constant, voice.readingLevel, voice.maxSentenceWords — parsed but unused in v1 (forward-compat)toneByContext, assets, semanticTokenAliases — parsed but unused (v1.x)null when DESIGN.md absent or ## Brand Rules section missing → BRAND-V001 silently skips.Load design-system/tokens.json $extensions.harness.brand. Walks the DTCG token tree capturing per-token role, approved_contexts, forbidden_contexts. Returns null when no token carries the extension → BRAND-T* silently skips.
BRAND-T001 — token misuse (regex-based). For each token whose forbidden_contexts is non-empty:
tokens.X.Y.Z (JS accessor)var(--X-Y-Z) (CSS var, kebab-cased)'X.Y.Z' / "X.Y.Z" (string literal)cta, selection, focus, data-visualization, decorative, background, text, border, error, success, warning.BRAND-V001 — forbidden phrases (TS Compiler API). For each .tsx/.jsx file:
JsxText node: case-insensitive substring scan for any forbiddenPhrase.JsxAttribute whose initializer is a string literal: same scan.(file, line, phrase).Severity from design.strictness (uses severityFor):
strict — all findings errorstandard — BRAND-T001 error (declared violation), BRAND-V001 warn (copy nuance)permissive — all findings infoAggregate bySeverity and byCode into the standard Verifier shape: { findings, summary, catalog, meta }.
Persist findings to the graph (when composed by check-design). check-design routes brand findings through DesignConstraintAdapter.recordFindings() alongside anatomy / craft / drift. v1 uses the shared VIOLATES_design edge; v1.x may add a brand-specific edge.
harness validate — Fast-mode hook gated by design.audit.brandCompliance.enabled. Degrades gracefully on failure (single warning; other checks continue).harness check-design — Composes brand as the 4th verifier alongside audit-anatomy, design-craft critique, and detect-design-drift. This is the canonical invocation path.mcp__harness__audit_brand — MCP tool. Input: { path, mode, files?, designStrictness?, rules? }. Output: { findings, summary, catalog, meta }. Consumed by check-design and the (future) #5 design-pipeline orchestrator.DesignConstraintAdapter.recordFindings() — Generic graph persistence entry point shipped in PR #390. Brand findings reuse the adapter (no graph schema changes in v1).harness-design skill — Authors DESIGN.md ## Brand Rules. audit-brand-compliance is the matching enforcer.Verifier<F> interface — Extracted in this PR at the 4th-verifier threshold. Lives at packages/cli/src/shared/verifier.ts. Adding a 5th verifier requires only a type-alias declaration of conformance.See docs/changes/design-pipeline/audit-brand-compliance/proposal.md for the full 34 success criteria. Highlights:
null when section absent (silent-skip pattern)null when no token carries $extensions.harness.brandtokens.X, var(--x), and 'X' reference forms(file, line, phrase)harness check-design test extended for 4-verifier composition (zero regressions)Input:
design-system/tokens.json:
{
"color": {
"brand": {
"500": {
"$type": "color",
"$value": "#3b82f6",
"$extensions": {
"harness": {
"brand": {
"role": "primary",
"approved_contexts": ["cta", "selection", "focus"],
"forbidden_contexts": ["data-visualization", "decorative"]
}
}
}
}
}
}
}
src/Chart.tsx:
// data-visualization color palette
const palette = [tokens.color.brand.500, ...];
Output:
BRAND-T001 [error] src/Chart.tsx:2 — Token "color.brand.500" is used in forbidden context "data-visualization"
Fix: Token "color.brand.500" is not approved for the "data-visualization" context.
Use an approved token (allowed contexts: cta, selection, focus), or update
tokens.json $extensions.harness.brand if the policy is wrong.
Input:
DESIGN.md:
## Brand Rules
### Voice
forbidden_phrases:
- "click here"
- "best-in-class"
src/Cta.tsx:
export const Cta = () => <a href="/x">Click here</a>;
Output:
BRAND-V001 [warn] src/Cta.tsx:1 — UI copy contains forbidden phrase "click here" — declared at DESIGN.md ## Brand Rules → Voice → forbidden_phrases
Fix: Rewrite to avoid "click here". If the phrase is unavoidable for this context,
remove it from voice.forbidden_phrases (or scope the audit) — but the default
policy is that brand voice trumps convenience.
$extensions.harness.brand absent on every token → BRAND-T001 skips silently. Either resolver returning null is NOT a verifier failure..ts/.js file scans for BRAND-V001. Only .jsx/.tsx (user-visible JSX). Doc copy in .md is a different audience.align-brand-compliance fix-side skill is deferred until detect signals demand.VIOLATES_design via recordFindings(). v1.x may add VIOLATES_brand edge for queryability.design.strictness from harness.config.json; default standard if absent.$extensions shape: v1 reads only harness.brand. Document the actual shape your project uses and add it to the schema sketch in ADR 0028 — DTCG $extensions namespaces are vendor-prefixed and additions are forward-compatible.harness validate runtime exceeds 3 seconds: Set design.audit.brandCompliance.fastMode.maxFiles to cap the scope. The MCP tool ignores the cap (fast/full equivalent in v1).v1 — in implementation. See:
docs/changes/design-pipeline/audit-brand-compliance/proposal.mddocs/knowledge/decisions/0028-brand-guidelines-source-of-truth.mddesign-pipeline sub-project #3 in docs/roadmap.mdaudit-component-anatomy (#2), detect-design-drift (#1)Verifier<F> interface at packages/cli/src/shared/verifier.ts (deferred until 4th data point — this is it)