audit-code-consistency — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited audit-code-consistency (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Inconsistent code is the most common byproduct of AI-assisted development. When a site is built across multiple sessions, by multiple agents, or iteratively over time, patterns drift. Selectors that worked one way become exceptions. Functions get duplicated with slight variations. CSS variables get hardcoded when someone is in a hurry. This audit finds all of it.
The goal is not aesthetic perfection — it is that any developer (or agent) reading any file in the project can immediately understand the system, predict where things live, and extend it without introducing new inconsistencies.
Every finding in this audit traces back to one of these principles:
| Level | Description | Action |
|---|---|---|
| Critical | Breaks the system or causes conflicts that affect functionality | Fix immediately |
| High | Creates maintainability problems that will compound over time | Fix before launch |
| Medium | Inconsistency that reduces readability and predictability | Fix within current sprint |
| Low | Minor style deviation with minimal practical impact | Fix when convenient |
Every value that belongs to the design system must live in variables.css and be consumed through var() everywhere else.
What to check — scan all CSS files for hardcoded values that should be variables:
/* ❌ Hardcoded — will drift from the system */
.card {
background-color: #0D0D14;
font-family: 'DM Sans', sans-serif;
border-radius: 12px;
transition: opacity 200ms ease;
}
/* ✅ System-compliant */
.card {
background-color: var(--bg-surface);
font-family: var(--font-sans);
border-radius: var(--radius-md);
transition: opacity var(--transition-normal);
}Flag every instance of: hex colors outside variables.css, font family strings, hardcoded spacing values matching the scale, transition durations, border radius values.
Verify the file structure is respected:
variables.css — only custom properties, nothing elsebase.css — only reset, body, typography globals, no component stylescomponents.css — only reusable componentsanimations.css — only keyframes and transition definitions[page].css — only styles specific to that page, no globalsFlag: component styles inside base.css, page-specific styles inside components.css, variables declared outside variables.css, duplicate declarations across files.
The entire project must use BEM throughout:
/* ✅ Consistent BEM */
.card { }
.card__title { }
.card__description { }
.card--featured { }
/* ❌ Mixed conventions in the same project */
.card-title { } /* kebab without BEM */
.cardTitle { } /* camelCase */
.card_title { } /* snake_case */
.card.featured { } /* modifier as separate class */Flag: classes using camelCase/snake_case/PascalCase, modifiers as separate classes instead of BEM --, elements without BEM __, inconsistent hyphen usage for modifiers.
CSS property order must be consistent across all rules:
.component {
/* 1. Positioning */
position: relative;
z-index: 1;
/* 2. Box model */
display: flex;
width: 100%;
padding: var(--space-6);
/* 3. Visual */
background-color: var(--bg-surface);
border: 1px solid var(--border-default);
border-radius: var(--radius-md);
/* 4. Typography */
font-family: var(--font-sans);
font-size: 1rem;
color: var(--text-primary);
/* 5. Transitions */
transition: border-color var(--transition-normal);
}Flag rules where typography appears before box model, or transitions in the middle of visual properties.
What to check:
!important declarations — each one is a specificity problem patched instead of solvednav ul li a span)#element) used for styling instead of classes/* ❌ Specificity problems */
#hero .card .card__title span { color: red !important; }
/* ✅ Flat, specific, no !important needed */
.hero-card__title { color: var(--text-primary); }What to check:
Full code examples for all JS patterns: see references/javascript-patterns.mdEvery identifier must follow established conventions without exception:
| Element | Convention | Example |
|---|---|---|
| Constants | UPPER_SNAKE_CASE | const MAX_RETRIES = 3; |
| Variables | camelCase | const chatContainer = ...; |
| Functions | verb + noun, camelCase | function showTypingIndicator() {} |
| Booleans | question form | isActive, hasLoaded, canSubmit |
Flag: single-letter variables outside loop counters, abbreviations requiring mental decoding (btn, el, tmp), functions without a verb, booleans not in question form, constants in camelCase.
Each function must do exactly one thing. Functions longer than 20 lines signal that something may be doing too much. A function that validates, sends, updates DOM, and handles errors should be split into single-responsibility functions.
Full before/after refactoring example: see references/javascript-patterns.mdDeep nesting is a readability problem. Guard clauses eliminate nesting by returning early:
/* ❌ Deep nesting */
async function sendMessage(message) {
if (message) {
if (message.length > 0) {
if (!isLoading) {
// actual logic — buried 3 levels deep
}
}
}
}
/* ✅ Guard clauses — flat and readable */
async function sendMessage(message) {
if (!message || message.length === 0) return;
if (isLoading) return;
// actual logic — immediately visible
}Flag: functions with more than 2 levels of nesting, if blocks wrapping the entire function body, nested if/else chains convertible to guard clauses.
Flag: hardcoded strings used more than once, hardcoded numbers with no obvious meaning, URLs/IDs/class names written inline, configuration values not extracted to named constants.
/* ❌ Magic values */
setTimeout(() => { }, 200);
if (message.length > 500) { }
/* ✅ Named constants */
const TYPING_ANIMATION_DELAY_MS = 200;
const MAX_MESSAGE_LENGTH = 500;What to check:
fetch calls wrapped in try/catchconsole.log(error) with no user feedbackresponse.ok checked before parsingWhat to check:
console.log statements left from developmentWhat to check:
What to check:
<h2> for section titles everywhere, not mixedAttributes should follow a consistent order across all elements:
Contáctanos
What to check:
<img> vs <img />, pick oneWhat to check:
style="" attributes in HTML (except dynamically set via JS)<style> blocks inside HTML files — all styles belong in CSS file structureEach file should read top-to-bottom from general to specific:
CSS files: Variables → resets → layout → components → modifiers → states → media queries
JavaScript files: Constants → DOM references → main functions → helper functions → event listeners
Flag: helper functions before the main functions that use them, event listeners scattered instead of grouped at bottom, constants defined inline instead of at top.
Comments should explain WHY — not WHAT. If a comment explains what the code does, the code should be rewritten to be self-explanatory.
/* ❌ Explains what — the code already says this */
// Get the chat container element
const chatContainer = document.getElementById('chat-container');
/* ✅ Explains why — context the code cannot provide */
// Delay before showing response to feel more natural — immediate
// response feels robotic and breaks the conversational experience
setTimeout(() => showResponse(data), RESPONSE_DELAY_MS);
// N8N webhook requires snake_case keys — camelCase returns 400
const payload = { user_question: message, session_id: sessionId };Flag: comments restating what code already says, commented-out code blocks, // TODO without date or owner, console.log with // debug or // remove later.
What to check:
<head> structure and CSS files in the same orderBefore declaring this audit complete, verify:
| Check | Question |
|---|---|
| ✅ All CSS files reviewed | Were variables.css, base.css, components.css, animations.css, and all page CSS files checked? |
| ✅ All JS files reviewed | Were all JavaScript files checked for naming, structure, and duplication? |
| ✅ All HTML files reviewed | Were all pages checked for structural consistency? |
| ✅ Cross-file patterns | Were inconsistencies between files identified, not just within them? |
| ✅ Dead code removed | Were unused classes, functions, and variables deleted — not just flagged? |
| ✅ Boy Scout applied | Is the code cleaner now than before the audit started? |
Code Consistency Audit — [Project Name]
Date: [Date]
Summary
Critical issues: X
High priority: X
Medium priority: X
Low priority: X
Files reviewed: X
Overall consistency assessment: [Consistent / Needs work / Fragmented]
Critical Issues
[Issue title]
File: [filename.css / filename.js / filename.html]
Line: [line number if applicable]
Principle violated: [DRY / KISS / YAGNI / Single Responsibility]
Issue: [What is wrong]
Fix: [Specific correction with code example]
High Priority
[Same format]
Medium Priority
[Same format]
Low Priority
[Same format]
Patterns Found (recurring issues)
[List issues that appear in multiple files — systemic problems
that should be fixed with a find-and-replace approach]
Recommended Fix Order
[First because it affects the most files...]
[Then...]
[Finally...]Full quick-reference checklist: see references/checklist.md~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.