Agent skill
Create Rule Processor
Scaffold a new rule processor, implement the evaluation logic, and write tests.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/create-rule-carrot-foundation-methodology-rules
SKILL.md
-
Scaffold the rule using the built-in script:
bashpnpm create-rule <name> <scope> <description><name>: kebab-case rule name (e.g.,vehicle-validation)<scope>: processor group (mass-id,credit-order, ormass-id-certificate)<description>: short description of what the rule validates
This creates the standard file structure:
{rule-name}/ ├── {rule-name}.processor.ts ├── {rule-name}.lambda.ts ├── {rule-name}.processor.spec.ts ├── {rule-name}.lambda.e2e.spec.ts ├── {rule-name}.test-cases.ts ├── index.ts ├── project.json └── jest.config.ts -
Implement the processor: In
{rule-name}.processor.ts, implement theevaluateResult()method. The processor extendsParentDocumentRuleProcessor<RuleSubject>. -
Write test cases: In
{rule-name}.test-cases.ts, define shared test data using@faker-js/fakerandzocker. Never use real data (no real company names, tax IDs, addresses, etc.). -
Write unit tests: In
{rule-name}.processor.spec.ts, test the core evaluation logic using the shared test cases. -
Write e2e tests: In
{rule-name}.lambda.e2e.spec.ts, test the Lambda handler end-to-end. -
Apply to a methodology (if needed):
bashpnpm apply-methodology-rule <methodology> <rule> <scope>Example:
pnpm apply-methodology-rule carbon-organic vehicle-validation mass-id -
Verify: Run
pnpm lint:affected && pnpm ts:affected && pnpm test:affectedto confirm everything passes.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?