PixelPilot: Instructions file for GitHub Copilot

vscode/.github/instructions/uiux-token-checker.instructions.md

PixelPilot uiux-token-checker.instructions.md is an instructions file for GitHub Copilot from dev-lou/PixelPilot. It costs 2,980 tokens per session, scanned A, original, MIT.

A code check that finds undefined CSS variables and fixed colors, spacing, corner sizes, or font sizes that should use shared design tokens.

In plain words
What is it for?
Use it to scan CSS, Sass, React, JSX, and Vue files for design-token violations.
Why use it?
It catches inconsistent styling before code is committed or built in continuous integration (CI).

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file. Also seen: positional $N argument.

This is dev-lou/PixelPilot's own configuration. It tells GitHub Copilot how to work on PixelPilot itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything PixelPilot configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is * node scripts/check-tokens.js [path].

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/dev-lou/PixelPilot/main/vscode/.github/instructions/uiux-token-checker.instructions.md
Clone the repo
git clone --depth 1 https://github.com/dev-lou/PixelPilot

Made for: GitHub Copilot.

Wrote 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.

agentmods badge for PixelPilot uiux-token-checker.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dev-lou/pixelpilot/uiux-token-checker.svg)](https://agentmods.dev/instructions/dev-lou/pixelpilot/uiux-token-checker)
Your own site
<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>
Per session 2,980 This file is loaded in full into every session.
When invoked 2,980 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 3d ago against content hash 24ba9e90bb0b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

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.

vscode/.github/instructions/uiux-token-checker.instructions.md · 490 lines

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();

Read the full file on GitHub · 490 lines

Changes

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.

  1. 3d ago First seen · 490 lines · 2,980 tokens per session scan A 24ba9e90bb0b

Subscribe to this mod's changes

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.

Related

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.

openai/codex · 5,182 tokens

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).

microsoft/vscode · 6,785 tokens

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.

vercel/next.js · 7,296 tokens

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.

langchain-ai/langchain · 4,469 tokens

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).

microsoft/vscode · 5,001 tokens

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.

github/spec-kit · 7,104 tokens