Frontend Typecheck & Lint Gate (frontend_typecheck)
This skill defines the Level 1 Verification Gate in the Autonomous Frontend Engineering Loop. It validates static typing, exports, prop contracts, nullability, and AST architectural constraints (raw HTML ban, compound dot-notation, layer boundaries, max lines) across the application.
Strict Invariants
- Never Disable Strict Mode: Do not alter
tsconfig.json flags to suppress errors.
- No Suppression Comments: Do NOT insert
// @ts-ignore, // @ts-expect-error, or // eslint-disable.
- No Unchecked Any: Avoid typing variables or props as
any. Always use concrete interfaces or type narrowing.
- AST Guardrails: All interactive elements must use design token primitives (no
<button>, <input>); compound components must use dot-notation (<Card.Header>).
Execution
Run Level 1 Gate
Execute the structured runner:
bash .agents/skills/frontend-typecheck/scripts/run_typecheck.sh
Or run the CLI commands directly:
npx tsc --noEmit && npx eslint .
Parse Structured Diagnostics
The runner outputs a structured JSON report combining type errors and lint rule violations:
{
"status": "failed",
"typeErrors": [
{
"file": "src/components/UserProfile.tsx",
"line": 42,
"column": 15,
"code": "TS2339",
"message": "Property 'avatarUrl' does not exist on type 'User'."
}
],
"lintErrors": [
{
"file": "src/components/features/ProfileCard.tsx",
"line": 14,
"column": 5,
"ruleId": "ui-guardrails/ban-raw-html-primitives",
"message": "Raw <button> is prohibited. Import the standardized design token primitive from '@/components/ui/Button' instead."
},
{
"file": "src/components/features/ProfileCard.tsx",
"line": 22,
"column": 9,
"ruleId": "ui-guardrails/enforce-compound-subcomponents",
"message": "Direct usage of flat subcomponent '<CardHeader>' is prohibited. Use the compound dot-notation '<Card.Header>' instead."
}
],
"totalErrors": 3
}
Self-Healing Instructions
- For
typeErrors: Locate file and line, inspect interfaces, supply missing properties or handle nullability.
- For
ban-raw-html-primitives: Replace <button>, <input>, etc., with <Button>, <Input> from @/components/ui/*.
- For
enforce-compound-subcomponents: Replace <CardHeader> with <Card.Header>, <DialogTitle> with <Dialog.Title>.
- For
boundaries/element-types: Ensure src/components/ui/ does not import from feature folders or pages.
- For
max-lines: Extract sub-components or move state/logic into a custom hook.
- Re-run
bash .agents/skills/frontend-typecheck/scripts/run_typecheck.sh to confirm resolution before advancing to Level 2 Verification.
1---2name: frontend-typecheck3description: Use this skill to run headless TypeScript verification and ESLint AST guardrails (Level 1 Verification Gate). Parses compilation error streams and ESLint rule violations into structured diagnostics for automated self-healing. Triggers after modifying TypeScript or TSX files, prior to running runtime/unit/E2E tests.4---56# Frontend Typecheck & Lint Gate (`frontend_typecheck`)78This skill defines the Level 1 Verification Gate in the Autonomous Frontend Engineering Loop. It validates static typing, exports, prop contracts, nullability, and AST architectural constraints (raw HTML ban, compound dot-notation, layer boundaries, max lines) across the application.910## Strict Invariants111. **Never Disable Strict Mode:** Do not alter `tsconfig.json` flags to suppress errors.122. **No Suppression Comments:** Do NOT insert `// @ts-ignore`, `// @ts-expect-error`, or `// eslint-disable`.133. **No Unchecked Any:** Avoid typing variables or props as `any`. Always use concrete interfaces or type narrowing.144. **AST Guardrails:** All interactive elements must use design token primitives (no `<button>`, `<input>`); compound components must use dot-notation (`<Card.Header>`).1516## Execution17181. **Run Level 1 Gate**19 Execute the structured runner:20 ```bash21 bash .agents/skills/frontend-typecheck/scripts/run_typecheck.sh22 ```23 Or run the CLI commands directly:24 ```bash25 npx tsc --noEmit && npx eslint .26 ```27282. **Parse Structured Diagnostics**29 The runner outputs a structured JSON report combining type errors and lint rule violations:30 ```json31 {32 "status": "failed",33 "typeErrors": [34 {35 "file": "src/components/UserProfile.tsx",36 "line": 42,37 "column": 15,38 "code": "TS2339",39 "message": "Property 'avatarUrl' does not exist on type 'User'."40 }41 ],42 "lintErrors": [43 {44 "file": "src/components/features/ProfileCard.tsx",45 "line": 14,46 "column": 5,47 "ruleId": "ui-guardrails/ban-raw-html-primitives",48 "message": "Raw <button> is prohibited. Import the standardized design token primitive from '@/components/ui/Button' instead."49 },50 {51 "file": "src/components/features/ProfileCard.tsx",52 "line": 22,53 "column": 9,54 "ruleId": "ui-guardrails/enforce-compound-subcomponents",55 "message": "Direct usage of flat subcomponent '<CardHeader>' is prohibited. Use the compound dot-notation '<Card.Header>' instead."56 }57 ],58 "totalErrors": 359 }60 ```61623. **Self-Healing Instructions**63 - For `typeErrors`: Locate file and line, inspect interfaces, supply missing properties or handle nullability.64 - For `ban-raw-html-primitives`: Replace `<button>`, `<input>`, etc., with `<Button>`, `<Input>` from `@/components/ui/*`.65 - For `enforce-compound-subcomponents`: Replace `<CardHeader>` with `<Card.Header>`, `<DialogTitle>` with `<Dialog.Title>`.66 - For `boundaries/element-types`: Ensure `src/components/ui/` does not import from feature folders or pages.67 - For `max-lines`: Extract sub-components or move state/logic into a custom hook.68 - Re-run `bash .agents/skills/frontend-typecheck/scripts/run_typecheck.sh` to confirm resolution before advancing to Level 2 Verification.