Agent skill

policyengine-plugin-maintenance

Use this skill when updating the PolicyEngine skills source repo or the generated policyengine-claude wrapper — adding skills, fixing skill routing, updating years in code examples, reordering skills, or tuning skill descriptions. Triggers: "update plugin", "fix skill", "wrong skill loaded", "update year", "plugin maintenance", "skill routing", "skill description", "policyengine-claude plugin", "policyengine-skills".

Stars 26
Forks 5

Install this agent skill to your Project

npx add-skill https://github.com/PolicyEngine/policyengine-claude/tree/main/skills/documentation/policyengine-plugin-maintenance-skill

SKILL.md

PolicyEngine skills and Claude wrapper maintenance

This skill is for maintaining the PolicyEngine skills source repo and Claude wrapper, not for using PolicyEngine.

Plugin architecture

  • Canonical source: PolicyEngine/policyengine-skills
  • Generated wrapper repo: PolicyEngine/policyengine-claude
  • Marketplace source checkout: ~/.claude/plugins/marketplaces/policyengine-claude/
  • Installed cache: ~/.claude/plugins/cache/policyengine-claude/complete/<version>/
  • Plugin registry: ~/.claude/plugins/installed_plugins.json
  • Claude manifest: targets/claude/marketplace.template.json + bundles/*.json in source, rendered to .claude-plugin/marketplace.json in the generated wrapper

How skill matching works

  1. Each skill has a SKILL.md with YAML frontmatter containing name and description
  2. Skill descriptions are listed in the system prompt at session start
  3. Order matters: skills listed earlier in marketplace.json appear first in the system prompt and may get matched preferentially
  4. Claude decides whether to invoke a skill via the Skill tool based on matching the user query against descriptions
  5. If Claude thinks it can handle the task without the skill, it may skip invocation entirely

Skill description best practices

Making a skill load reliably

Use "ALWAYS LOAD THIS SKILL FIRST" language (proven pattern from microsimulation skill):

yaml
description: |
  ALWAYS LOAD THIS SKILL FIRST before writing any PolicyEngine-US code.
  Contains the correct situation dictionary structure, entity names, variable names...

Preventing a skill from loading for wrong queries

Use "ONLY use" + "DO NOT use" pattern:

yaml
description: |
  ONLY use this skill when users explicitly ask about [specific topic].
  DO NOT use for [common mismatched query type] — use [correct skill] instead.

Trigger phrases

List explicit trigger phrases in the description. Copy the microsimulation skill's pattern:

yaml
description: |
  Triggers: "keyword1", "keyword2", "phrase one", "phrase two".

Skill ordering in bundle manifests

The bundles/complete.json file determines Claude system prompt order for the generated complete wrapper.

Current priority order (most commonly needed first):

  1. policyengine-us-skill / policyengine-uk-skill (household calculations)
  2. policyengine-user-guide-skill (web app usage)
  3. policyengine-microsimulation-skill (population analysis)
  4. Other tools-and-apis skills
  5. policyengine-python-client-skill (last among tools — only for explicit API questions)

Rule: Skills that match common user queries should be listed before niche/technical skills.

Annual year update checklist

Every January (or when the year changes), update ALL code examples:

Files to update

  1. US skill: skills/domain-knowledge/policyengine-us-skill/SKILL.md

    • All {YEAR: keys in situation dictionaries
    • All .calculate("var", YEAR) calls
    • All "period": YEAR in axes
    • All "YEAR-01-01.2100-12-31" in reform definitions
    • The "IMPORTANT" callout year reference
  2. UK skill: skills/domain-knowledge/policyengine-uk-skill/SKILL.md

    • Same pattern as US
    • Also update "Key Parameters and Values (YEAR/YY)" heading
  3. Python client skill: skills/tools-and-apis/policyengine-python-client-skill/SKILL.md

    • All "YEAR" string keys
    • All "YEAR-01-01.2100-12-31" reform dates
  4. Microsimulation skill: skills/tools-and-apis/policyengine-microsimulation-skill/SKILL.md

    • All period=YEAR in calc() calls

Quick update commands

bash
# Find all year references across skills
grep -rn "2026" skills/ | grep -v ".git"

# Bulk replace (use with care — review diff before committing)
# Replace year in situation keys
find skills/ -name "SKILL.md" -exec sed -i '' 's/{2026:/{2027:/g' {} +
# Replace year in calculate calls
find skills/ -name "SKILL.md" -exec sed -i '' 's/, 2026)/, 2027)/g' {} +
# Replace year in string keys
find skills/ -name "SKILL.md" -exec sed -i '' 's/"2026"/"2027"/g' {} +

Don't forget

  • Update the "IMPORTANT" callout in each skill: not 2025 or 2026not 2026 or 2027
  • Update reform date ranges: "2026-01-01.2100-12-31""2027-01-01.2100-12-31"
  • The UK "Key Parameters and Values" heading with tax year
  • Rebuild the Claude wrapper after changing source files

Making changes effective

CRITICAL: Cache invalidation

Claude Code caches plugins and does NOT pick up file edits automatically. Manually editing files in the cache directory (~/.claude/plugins/cache/) has no effect — Claude Code rebuilds the cache from the marketplace repo's git state on session start.

To test local changes:

bash
# 1. Make changes in the source repo and commit
cd /path/to/policyengine-skills
# ... edit files, git add, git commit ...

# 2. Rebuild the generated Claude wrapper locally
python3 scripts/build_claude_wrapper.py --source-root . --output-root build/policyengine-claude

# 3. Clear the plugin cache (this is the key step)
rm -rf ~/.claude/plugins/cache/policyengine-claude

# 4. Start a new Claude Code session — it rebuilds from the synced marketplace repo

To publish changes for all users:

  1. Create branch in policyengine-skills, make changes, commit, push
  2. Create and merge PR to main
  3. Let CI sync the generated output to PolicyEngine/policyengine-claude
  4. Clear cache: rm -rf ~/.claude/plugins/cache/policyengine-claude
  5. Start new session to verify

Common issues

Wrong skill loads for household questions

Symptoms: policyengine-python-client loads instead of policyengine-us Fix:

  • Strengthen US/UK descriptions with "ALWAYS LOAD THIS SKILL FIRST"
  • Restrict python-client with "ONLY use when explicitly asked about API"
  • Ensure US/UK are listed BEFORE python-client in marketplace.json skill order

Code examples use wrong year

Symptoms: Generated code uses 2024/2025 instead of current year Fix: Run the annual year update checklist above

Skill loads but model ignores its content

Symptoms: Skill loads (shown in output) but generated code doesn't match patterns Fix: Add "IMPORTANT" callout boxes with specific instructions at the top of the skill body, not just in the description

Expand your agent's capabilities with these related and highly-rated skills.

PolicyEngine/policyengine-claude

policyengine-healthcare

Healthcare program modeling in PolicyEngine-US — Medicaid, ACA marketplace, CHIP, and Medicare. Covers encoding rules, running analyses, and navigating the unique complexity of US healthcare programs. Triggers: "healthcare", "health insurance", "Medicaid", "ACA", "CHIP", "Medicare", "marketplace", "premium tax credit", "APTC", "PTC", "SLCSP", "benchmark plan", "rating area", "age curve", "family tier", "coverage gap", "Medicaid expansion", "MAGI", "medicaid_magi", "aca_magi", "medicaid_income_level", "medicaid_category", "enrollment", "takeup", "take-up", "per capita", "CSR", "cost sharing", "insurance premium", "second lowest silver", "required contribution percentage", "42 CFR", "IRC 36B", "categorical eligibility", "expansion adult", "healthcare reform", "healthcare analysis", "health policy".

26 5
Explore
PolicyEngine/policyengine-claude

policyengine-us

ALWAYS LOAD THIS SKILL FIRST before writing any PolicyEngine-US code. Contains the correct API patterns for household calculations and population simulations using the new policyengine package. Covers US federal and state taxes/benefits. Triggers: "what would", "how much would a", "benefit be", "eligible for", "qualify for", "single parent", "married couple", "family of", "household of", "if they earn", "earning $", "making $", "calculate benefits", "calculate taxes", "benefit for a", "what would I get", "what is the maximum", "what is the rate", "poverty line", "income limit", "benefit amount", "maximum benefit", "compare states", "TANF", "SNAP", "EITC", "CTC", "SSI", "WIC", "Section 8", "Medicaid", "ACA", "child tax credit", "earned income", "supplemental security", "housing voucher", "microsimulation", "population", "reform", "policy impact", "budgetary", "decile".

26 5
Explore
PolicyEngine/policyengine-claude

policyengine-uk

ALWAYS LOAD THIS SKILL FIRST before writing any PolicyEngine-UK code. Contains the correct API patterns for household calculations and population simulations using the new policyengine package (not policyengine_uk directly). Triggers: "what would", "how much would a", "benefit be", "eligible for", "qualify for", "single parent", "married couple", "family of", "household of", "if they earn", "with income of", "earning £", "making £", "calculate benefits", "calculate taxes", "benefit for a", "tax for a", "what would I get", "what would they get", "what is the rate", "what is the threshold", "personal allowance", "maximum benefit", "income limit", "benefit amount", "how much is", "Universal Credit", "child benefit", "pension credit", "housing benefit", "council tax", "income tax", "national insurance", "JSA", "ESA", "PIP", "disability living allowance", "working tax credit", "child tax credit", "Scotland", "Wales", "UK", "microsimulation", "population", "reform", "policy impact", "budgetary", "decile".

26 5
Explore
PolicyEngine/policyengine-claude

policyengine-canada

ALWAYS LOAD THIS SKILL FIRST before writing any PolicyEngine-Canada code. Contains Canadian federal and provincial tax/benefit rules for household calculations. IMPORTANT: PolicyEngine-Canada does NOT have representative population microdata. Do NOT attempt microsimulation or population-level estimates for Canada. Only provide household-level analysis (single-family impacts, eligibility, benefit amounts). Triggers: "what would", "how much would a", "benefit be", "eligible for", "qualify for", "single parent", "married couple", "family of", "household of", "if they earn", "earning $", "making $", "calculate benefits", "calculate taxes", "benefit for a", "what would I get", "what is the maximum", "what is the rate", "income limit", "benefit amount", "maximum benefit", "compare provinces", "CCB", "Canada Child Benefit", "GST credit", "HST credit", "GST/HST", "OAS", "Old Age Security", "GIS", "Guaranteed Income Supplement", "CWB", "Canada Workers Benefit", "EI", "Employment Insurance", "CPP", "Canada Pension Plan", "RRSP", "TFSA", "Ontario Child Benefit", "OCB", "Ontario Trillium Benefit", "OTB", "BC Climate Action", "Alberta Child Benefit", "Quebec", "CRA", "Canada Revenue Agency", "Canadian", "Canada", "Ontario", "British Columbia", "Alberta", "Saskatchewan", "Manitoba", "Nova Scotia", "New Brunswick", "PEI", "Newfoundland", "Yukon", "NWT", "Nunavut", "provincial tax", "federal tax Canada".

26 5
Explore
PolicyEngine/policyengine-claude

policyengine-ui-kit-consumer

This skill should be used when setting up a new project that uses @policyengine/ui-kit, debugging CSS or styling issues in a consumer app, or when Tailwind utility classes are not being generated. Also use when creating globals.css, configuring PostCSS, or troubleshooting "no styles", "no spacing", or "no layout" problems. Triggers: "ui-kit import", "globals.css setup", "Tailwind not working", "styles not applying", "utility classes missing", "setup ui-kit", "PostCSS config", "no styling", "CSS broken", "import ui-kit", "theme.css", "no layout", "no spacing", "@tailwindcss/postcss"

26 5
Explore
PolicyEngine/policyengine-claude

policyengine-tailwind-shadcn

Tailwind CSS v4 + shadcn/ui integration patterns for PolicyEngine frontend projects. Covers @theme namespaces, CSS variable conventions, SVG var() usage, and common mistakes. Triggers: "Tailwind v4", "@theme", "shadcn", "CSS variables", "design tokens CSS", "theme.css", "@theme inline"

26 5
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results