Skip to content

thedaviddias/Front-End-Checklist / packages/cli

frontendchecklist

Verified

Review frontend code and live pages against the Front-End Checklist (380+ rules for accessibility, performance, SEO, security, HTML, CSS, JavaScript, images, i18n, privacy, testing) using the `frontendchecklist` CLI. Use when writing, reviewing, or shipping HTML/CSS/JS/JSX/TSX/Vue/Svelte/Astro code, before a commit or PR, or when asked to audit a public URL.

FileKindSize
.gitignoreother6 B
README.mdmarkdown2.4 KB
SKILL.mdskill md2.7 KB
package.jsonmanifest1.5 KB
scripts/build.tsscript1.9 KB
src/args.tsscript5.5 KB
src/commands/audit.tsscript2.8 KB
src/commands/lookup.tsscript5.0 KB
src/commands/review.tsscript3.9 KB
src/content.tsscript1.5 KB
src/index.tsscript2.9 KB
src/output.tsscript3.3 KB
src/spec.tsscript5.1 KB
tests/cli.test.mjsscript4.6 KB
tsconfig.jsonconfig202 B

src/content.ts

View on GitHub
import { existsSync, readFileSync } from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { loadLocalChecklists, loadLocalRules } from '@repo/mcp/content-loader'
import type { CuratedChecklist, Rule } from '@repo/types'

export interface Content {
  rules: Rule[]
  checklists: CuratedChecklist[]
}

const HERE = path.dirname(fileURLToPath(import.meta.url))

/**
 * Check whether parsed JSON has the bundled content shape.
 *
 * @param value - Parsed JSON.
 * @returns True when it has rule and checklist arrays.
 */
function isContent(value: unknown): value is Content {
  return (
    typeof value === 'object' &&
    value !== null &&
    Array.isArray(Reflect.get(value, 'rules')) &&
    Array.isArray(Reflect.get(value, 'checklists'))
  )
}

/**
 * Load the rule corpus and checklists.
 *
 * Published builds ship a `content.json` snapshot next to the bundle, so the
 * CLI works offline and matches the version you installed. Inside the
 * monorepo (no snapshot), it reads the canonical MDX content directly.
 *
 * @returns Rules and checklists.
 */
export function loadContent(): Content {
  const bundled = path.join(HERE, 'content.json')
  if (existsSync(bundled)) {
    const parsed: unknown = JSON.parse(readFileSync(bundled, 'utf-8'))
    if (isContent(parsed)) return parsed
    throw new Error(`Corrupt content snapshot: ${bundled}`)
  }

  const repoRoot = path.resolve(HERE, '../../..')
  return { rules: loadLocalRules(), checklists: loadLocalChecklists(repoRoot) }
}
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall