From data-science
Agent that enforces PolicyEngine implementation standards for rules engineering and review, including citation hierarchy, parameter metadata, vectorized formulas, and integration test documentation.
How this agent operates — its isolation, permissions, and tool access model
Agent reference
data-science:agents/shared/policyengine-standardsThe summary Claude sees when deciding whether to delegate to this agent
This document contains the shared standards and guidelines that all PolicyEngine agents must follow, particularly the Rules Engineer and Reviewer agents. Sources must be cited in this order of preference: 1. **Statutes/Laws** (e.g., 42 USC § 1382) 2. **Regulations** (e.g., 7 CFR 273.9) 3. **Official Program Manuals** 4. **Government websites** (only as last resort) Every parameter and variable ...
This document contains the shared standards and guidelines that all PolicyEngine agents must follow, particularly the Rules Engineer and Reviewer agents.
Sources must be cited in this order of preference:
Every parameter and variable MUST have:
description: Federal minimum wage # ACTIVE VOICE, no "The" prefix
values:
2024-01-01: 7.25
metadata:
unit: currency-USD
period: hour
reference:
- title: 29 USC § 206(a)(1) # Law first
href: https://www.law.cornell.edu/uscode/text/29/206
- title: DOL Minimum Wage # Agency guidance second
href: https://www.dol.gov/agencies/whd/minimum-wage
class variable_name(Variable):
value_type = float
entity = Person
label = "Clear, concise label" # ACTIVE VOICE
unit = USD
definition_period = YEAR
reference = "https://www.law.cornell.edu/cfr/text/7/273.9" # SPECIFIC section with full URL
# NOTE: Do NOT use documentation field - use reference URL instead
where(), select(), or boolean multiplicationmax_(0, value) to prevent negative values- name: Descriptive test name matching scenario
period: 2024
input:
# Complete inputs needed
output:
# Expected values with comments showing calculation
# Per 7 CFR 273.9: $1,000 - $100 = $900
variable_name: 900
Every non-trivial test should include:
Non-vectorized code (if-elif-else)
# ✅ OK - parameter condition only
if p.program.enabled:
rate = p.program.rate
else:
rate = 0
# ❌ WRONG - depends on household data
if person("age") > 65:
benefit = amount
where(), select(), or boolean multiplicationHardcoded values in formulas
if income > 50000: (hardcoded threshold)if income > p.income_threshold (parameter)Missing defined_for when needed
defined_fordefined_for = "is_ssi_eligible"Not using adds for aggregation
adds in metadataadds = ["gov.irs.income.wages", "gov.irs.income.interest"]Missing thousands separators
income: 50000income: 50_000Incorrect period format
period: 2024-01-01period: 2024 (for annual)period: 2024-01 (for monthly)Parameter doesn't match cited source
Missing primary sources
Calculation doesn't follow regulation order
Description style
Variable naming
Test clarity
Always check:
The goal is to ensure every calculation in PolicyEngine can be traced back to authoritative law or regulation. When in doubt:
npx claudepluginhub policyengine/policyengine-claude --plugin analysis-toolsReviews government program implementations (TANF, SNAP, LIHEAP, tax credits) for regulatory correctness. Researches regulations first, then validates code and tests against legal requirements.
Surgical 1-2 file editor for typo fixes, single-function rewrites, mechanical renames, comment removal, format tweaks. Refuses 3+ files, new features, cross-file changes. Returns caveman diff receipt.
Trains, evaluates, and ships RuView models: WiFlow pose, camera-supervised pose, RuVector embeddings, domain generalization, and SNN adaptation. Handles GPU training on GCloud and Hugging Face publishing.