Borrowing it
Nothing to install: this file belongs to dev-lou/PixelPilot. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/dev-lou/PixelPilot/main/vscode/.github/instructions/uiux-token-checker.instructions.mdgit clone --depth 1 https://github.com/dev-lou/PixelPilotWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/dev-lou/pixelpilot/uiux-token-checker)<a href="https://agentmods.dev/instructions/dev-lou/pixelpilot/uiux-token-checker"><img src="https://agentmods.dev/badge/instructions/dev-lou/pixelpilot/uiux-token-checker.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02980 | $0.02980 |
| Opus 5 | $0.01490 | $0.01490 |
| Sonnet 5 | $0.00596 | $0.00596 |
| Haiku 4.5 | $0.00298 | $0.00298 |
Grade A, and why
PixelPilot uiux-token-checker.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 490 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Token Checker Skill
Validate design token usage in generated code.
WHAT IT CHECKS
| Violation | Example | Fix |
|---|---|---|
| Undefined variable | var(--color-unknown) |
Use defined token or add to tokens |
| Hardcoded color | color: #3b82f6 |
Use var(--accent) |
| Hardcoded spacing | margin: 16px |
Use var(--space-4) |
| Hardcoded radius | border-radius: 8px |
Use var(--radius-md) |
| Hardcoded font | font-size: 14px |
Use var(--text-sm) |
CLI SCRIPT
scripts/check-tokens.js
#!/usr/bin/env node
/**
* Token Checker - Validates design token usage
*
* Usage:
* node scripts/check-tokens.js [path]
* node scripts/check-tokens.js src/
* node scripts/check-tokens.js --fix
*/
const fs = require('fs');
const path = require('path');
const glob = require('glob');
// Configuration
const CONFIG = {
// Files to check
patterns: ['**/*.css', '**/*.scss', '**/*.tsx', '**/*.jsx', '**/*.vue'],
ignore: ['**/node_modules/**', '**/dist/**', '**/build/**', '**/*.min.css'],
// Token file path (to extract defined tokens)
tokenFile: './src/tokens.css',
// Patterns for violations
violations: {
hardcodedColor: {
// Matches hex colors like #fff, #ffffff, #rrggbbaa
pattern: /#([0-9A-Fa-f]{3,8})\b/g,
message: 'Hardcoded color found. Use a token like var(--accent) instead.',
severity: 'error',
// Exceptions (e.g., in token definitions)
allowIn: ['tokens.css', 'tokens.scss', 'variables.css'],
},
hardcodedPx: {
// Matches px values (but not 0px)
pattern: /(?<![a-z-])([1-9]\d*|0\.\d+)px\b/gi,
message: 'Hardcoded pixel value. Use a spacing/size token.',
severity: 'warning',
allowIn: ['tokens.css'],
// Exceptions for common non-token values
allowValues: ['1px', '2px'], // Often used for borders
},
hardcodedRem: {
pattern: /(?<![a-z-])\d+(\.\d+)?rem\b/gi,
message: 'Consider using a token for rem values.',
severity: 'warning',
allowIn: ['tokens.css'],
},
},
};
// Extract defined CSS variables from token file
function extractDefinedTokens(tokenFile) {
if (!fs.existsSync(tokenFile)) {
console.warn(`⚠️ Token file not found: ${tokenFile}`);
return new Set();
}
const content = fs.readFileSync(tokenFile, 'utf8');
const tokens = new Set();
// Match CSS variable definitions
const varPattern = /--([\w-]+)\s*:/g;
let match;
while ((match = varPattern.exec(content)) !== null) {
tokens.add(`--${match[1]}`);
}
console.log(`📦 Found ${tokens.size} defined tokens`);
return tokens;
}
// Check for undefined CSS variables
function checkUndefinedVariables(content, definedTokens) {
const violations = [];
const varUsagePattern = /var\(\s*--([\w-]+)/g;
let match;
while ((match = varUsagePattern.exec(content)) !== null) {
const varName = `--${match[1]}`;
if (!definedTokens.has(varName)) {
violations.push({
type: 'undefined-variable',
value: varName,
index: match.index,
message: `Undefined CSS variable: var(${varName})`,
severity: 'error',
});
}
}
return violations;
}
// Check for hardcoded values
function checkHardcodedValues(content, filename) {
const violations = [];
for (const [type, config] of Object.entries(CONFIG.violations)) {
// Skip if file is in allowIn list
if (config.allowIn?.some(allowed => filename.includes(allowed))) {
continue;
}
let match;
while ((match = config.pattern.exec(content)) !== null) {
const value = match[0];
// Skip allowed values
if (config.allowValues?.includes(value)) {
continue;
}
violations.push({
type,
value,
index: match.index,
message: config.message,
severity: config.severity,
});
}
}
return violations;
}
// Get line number from index
function getLineNumber(content, index) {
const lines = content.substring(0, index).split('\n');
return lines.length;
}
// Format violation for output
function formatViolation(filename, content, violation) {
const line = getLineNumber(content, violation.index);
const icon = violation.severity === 'error' ? '❌' : '⚠️';
return `${icon} ${filename}:${line} - ${violation.message}\n Found: ${violation.value}`;
}
// Main check function
function checkFile(filepath, definedTokens) {
const content = fs.readFileSync(filepath, 'utf8');
const violations = [];
// Check for undefined variables
violations.push(...checkUndefinedVariables(content, definedTokens));
// Check for hardcoded values
violations.push(...checkHardcodedValues(content, filepath));
return violations;
}
// Main execution
function main() {
const args = process.argv.slice(2);
const targetPath = args.find(arg => !arg.startsWith('-')) || '.';
console.log('🔍 Token Checker\n');
// Extract defined tokens
const definedTokens = extractDefinedTokens(CONFIG.tokenFile);
// Find files to check
const files = [];
for (const pattern of CONFIG.patterns) {
const matches = glob.sync(path.join(targetPath, pattern), {
ignore: CONFIG.ignore,
});
files.push(...matches);
}
console.log(`📁 Checking ${files.length} files...\n`);
let totalViolations = 0;
let errorCount = 0;
let warningCount = 0;
for (const file of files) {
const violations = checkFile(file, definedTokens);
if (violations.length > 0) {
const content = fs.readFileSync(file, 'utf8');
for (const violation of violations) {
console.log(formatViolation(file, content, violation));
if (violation.severity === 'error') {
errorCount++;
} else {
warningCount++;
}
}
totalViolations += violations.length;
}
}
// Summary
console.log('\n' + '─'.repeat(50));
console.log(`\n📊 Summary:`);
console.log(` Files checked: ${files.length}`);
console.log(` Errors: ${errorCount}`);
console.log(` Warnings: ${warningCount}`);
if (errorCount > 0) {
console.log('\n❌ Token check failed!\n');
process.exit(1);
} else if (warningCount > 0) {
console.log('\n⚠️ Token check passed with warnings.\n');
process.exit(0);
} else {
console.log('\n✅ All tokens valid!\n');
process.exit(0);
}
}
main();
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 490 lines · 2,980 tokens per session scan A 24ba9e90bb0b
PixelPilot uiux-token-checker.instructions.md is an instructions file published in the GitHub repository dev-lou/PixelPilot (2 stars, last pushed 5mo ago), licensed MIT. It adds 2,980 tokens to every session, about $0.0149 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other instructions, from other repositories
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.