Enforces code quality standards (type-checking, linting, formatting)
Enforces JavaScript/TypeScript quality standards with type-checking, linting, and formatting validation.
/plugin marketplace add IvanTorresEdge/molcajete.ai/plugin install js@Molcajete.aiExecutes quality enforcement workflows while following code-quality-standards, eslint-flat-config, biome-setup, pre-commit-hooks, and post-change-verification skills.
MUST reference these skills for guidance:
code-quality-standards skill:
eslint-flat-config skill:
biome-setup skill:
pre-commit-hooks skill:
post-change-verification skill:
The Quality Guardian agent establishes and maintains the quality infrastructure that code-modifying agents use during Post-Change Verification:
The verification steps in this agent align with the Post-Change Verification Protocol:
Package Manager Detection:
Check for lock files in order: pnpm-lock.yaml -> yarn.lock -> package-lock.json -> bun.lockb
Use <pkg> as placeholder for the detected package manager.
Type Checking:
# Check types without emitting
<pkg> run type-check
# or
npx tsc --noEmit
Linting (Biome):
# Check for issues
<pkg> run lint
# or
npx biome check .
# Auto-fix issues
npx biome check --write .
Linting (ESLint):
# Check for issues
<pkg> run lint
# or
npx eslint .
# Auto-fix issues
npx eslint --fix .
Formatting:
# Check formatting (Biome)
<pkg> run format:check
# or
npx biome format .
# Apply formatting (Biome)
<pkg> run format
# or
npx biome format --write .
# Check formatting (Prettier)
npx prettier --check .
# Apply formatting (Prettier)
npx prettier --write .
Full Validation:
# Run all quality checks
<pkg> run validate
# Typical validate script
# "validate": "<pkg> run type-check && <pkg> run lint && <pkg> run format:check && <pkg> test"
package.json:
{
"scripts": {
"prepare": "husky"
},
"lint-staged": {
"*.{ts,tsx}": [
"biome check --write",
"biome format --write"
],
"*.{json,md}": [
"biome format --write"
]
}
}
.husky/pre-commit:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged
npm run type-check
When reporting quality check results, use the Post-Change Verification output format:
=== POST-CHANGE VERIFICATION ===
Format: [PASSED | FAILED | SKIPPED (reason)]
Lint: [PASSED | FAILED] ([X] errors, [Y] warnings)
Type-check: [PASSED | FAILED] ([X] errors)
Tests: [PASSED | FAILED] ([X]/[Y] passed)
Pre-existing issues: [NONE | count listed below]
[If issues exist, list them here]
=== [TASK COMPLETE | VERIFICATION FAILED] ===
When quality gates fail, provide clear messages:
=== POST-CHANGE VERIFICATION ===
Format: PASSED
Lint: FAILED (1 error, 0 warnings)
Type-check: FAILED (1 error)
Tests: PASSED (15/15)
Issues found:
- src/utils/format.ts(12,5): error TS2322: Type 'string' is not assignable to type 'number'
- src/api/client.ts:15:10 - error: Unexpected any. Specify a different type
=== VERIFICATION FAILED - FIX ISSUES BEFORE COMPLETING ===
GitHub Actions Example:
name: Quality Checks
on: [push, pull_request]
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- run: npm ci
- run: npm run type-check
- run: npm run lint
- run: npm run format:check
- run: npm test
// ❌ Error: Parameter 'data' implicitly has an 'any' type
function process(data) { }
// ✅ Fix: Add explicit type
function process(data: unknown) { }
// ❌ Error: 'unused' is declared but never used
const unused = 'value';
// ✅ Fix: Remove or use the variable, or prefix with underscore
const _intentionallyUnused = 'value';
// ❌ Error: Missing return type on function
function calculate(x: number) {
return x * 2;
}
// ✅ Fix: Add explicit return type
function calculate(x: number): number {
return x * 2;
}
Use this agent to verify that a Python Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a Python Agent SDK app has been created or modified.
Use this agent to verify that a TypeScript Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a TypeScript Agent SDK app has been created or modified.