thedaviddias/Front-End-Checklist / packages/cli
frontendchecklist
VerifiedReview 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.
| File | Kind | Size |
|---|---|---|
| .gitignore | other | 6 B |
| README.md | markdown | 2.4 KB |
| SKILL.md | skill md | 2.7 KB |
| package.json | manifest | 1.5 KB |
| scripts/build.ts | script | 1.9 KB |
| src/args.ts | script | 5.5 KB |
| src/commands/audit.ts | script | 2.8 KB |
| src/commands/lookup.ts | script | 5.0 KB |
| src/commands/review.ts | script | 3.9 KB |
| src/content.ts | script | 1.5 KB |
| src/index.ts | script | 2.9 KB |
| src/output.ts | script | 3.3 KB |
| src/spec.ts | script | 5.1 KB |
| tests/cli.test.mjs | script | 4.6 KB |
| tsconfig.json | config | 202 B |
src/index.ts
View on GitHub/**
* Front-End Checklist CLI — agent-first by design:
* JSON when piped, stable exit codes, no prompts, `schema` for discovery.
*/
import { type CliOptions, EXIT, parseCliArgs, UsageError } from './args'
import { runAudit } from './commands/audit'
import { runCategories, runChecklist, runChecklists, runRule, runSearch } from './commands/lookup'
import { runReview } from './commands/review'
import { loadContent } from './content'
import { writeJson } from './output'
import { buildSchema, readSkill, renderHelp } from './spec'
/** Replaced at build time; the dev fallback reads package.json. */
declare const __CLI_VERSION__: string | undefined
const VERSION = typeof __CLI_VERSION__ === 'string' ? __CLI_VERSION__ : '0.0.0-dev'
/**
* Run one command and return its exit code.
*
* @param options - Parsed CLI options.
* @returns Exit code.
*/
async function dispatch(options: CliOptions): Promise<number> {
switch (options.command) {
case 'schema':
writeJson(buildSchema(VERSION))
return EXIT.ok
case 'skill':
process.stdout.write(readSkill())
return EXIT.ok
case 'review':
return runReview(options, loadContent().rules)
case 'audit':
return runAudit(options, loadContent().rules)
case 'search':
return runSearch(options, loadContent())
case 'rule':
return runRule(options, loadContent())
case 'checklists':
return runChecklists(options, loadContent())
case 'checklist':
return runChecklist(options, loadContent())
case 'categories':
return runCategories(options, loadContent())
default:
throw new UsageError(
options.command ? `Unknown command "${options.command}".` : 'Missing command.'
)
}
}
/**
* Report an error in the active output mode and return the exit code.
*
* @param error - Thrown value.
* @param json - Whether output is JSON.
* @returns Exit code.
*/
function reportError(error: unknown, json: boolean): number {
const message = error instanceof Error ? error.message : String(error)
const usage = error instanceof UsageError
if (json) writeJson({ error: message, ...(usage ? { hint: 'frontendchecklist schema' } : {}) })
process.stderr.write(
`frontendchecklist: ${message}\n${usage ? 'Run `frontendchecklist --help`.\n' : ''}`
)
return EXIT.usage
}
/**
* Entry point.
*/
async function main(): Promise<void> {
const isTty = process.stdout.isTTY === true
let options: CliOptions
try {
options = parseCliArgs(process.argv.slice(2), isTty)
} catch (error) {
process.exitCode = reportError(error, !isTty)
return
}
if (options.version) {
process.stdout.write(`${VERSION}\n`)
return
}
if (options.help || (!options.command && isTty)) {
process.stdout.write(`${renderHelp(VERSION)}\n`)
return
}
try {
process.exitCode = await dispatch(options)
} catch (error) {
process.exitCode = reportError(error, options.format === 'json')
}
}
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 471k | Updated | Claude CodeCodex | Verified | Install |
| 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: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |