Agent skill
rule-rule-processors
Rule mapping for rule-processors
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/rule-rule-processors
SKILL.md
Rule rule-processors
Apply this rule whenever work touches:
libs/methodologies/**/*.ts
Rule processors are the core units of methodology evaluation. Each processor validates a specific aspect of a document against Bold methodology requirements.
Directory structure
Every rule processor must contain the following files:
{rule-name}/
├── {rule-name}.processor.ts # Core logic
├── {rule-name}.lambda.ts # Lambda handler (thin wrapper)
├── {rule-name}.processor.spec.ts # Unit tests
├── {rule-name}.lambda.e2e.spec.ts # E2E tests
├── {rule-name}.test-cases.ts # Shared test data
├── index.ts # Public exports
├── project.json # Nx project config
└── jest.config.ts # Jest config
Scaffolding
Always use the CLI tool to create new rules:
# Create a new rule
pnpm create-rule vehicle-validation mass-id "Validates vehicle data"
# Apply the rule to a methodology
pnpm apply-methodology-rule carbon-organic geolocation-precision mass-id
Processor implementation
Processors extend ParentDocumentRuleProcessor<RuleSubject> and implement evaluateResult():
import { ParentDocumentRuleProcessor } from '@carrot-fndn/shared/rule';
import type { RuleSubject } from '@carrot-fndn/shared/rule';
export class VehicleValidationProcessor extends ParentDocumentRuleProcessor<RuleSubject> {
protected override evaluateResult(subject: RuleSubject): RuleOutput {
// Business logic here
}
}
Test organization
Define reusable test data in {rule-name}.test-cases.ts:
import { stubRuleInput } from '@carrot-fndn/shared/testing';
export const validInput = stubRuleInput({
// override only what this rule cares about
});
export const invalidInput = stubRuleInput({
// data that should cause the rule to fail
});
Both *.spec.ts and *.e2e.spec.ts files should import from the test-cases file to keep assertions consistent.
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?