Agent skill
jmespath-for-kyverno
Master JMESPath for Kyverno policies. Query nested resources, build complex conditions, and validate Kubernetes workloads with production-tested patterns.
Install this agent skill to your Project
npx add-skill https://github.com/adaptive-enforcement-lab/claude-skills/tree/main/plugins/enforce/skills/jmespath-for-kyverno
SKILL.md
JMESPath for Kyverno
When to Use This Skill
Use JMESPath when:
- Pattern matching can't express your logic
- You need conditionals or transformations
- Validation depends on multiple fields
- You're filtering or comparing arrays
Skip JMESPath when:
- Simple pattern matching works (
pattern,anyPattern) - You're only checking field existence
- No cross-field validation needed
Test Before Deploying
Always test JMESPath expressions with
kyverno jpbefore adding them to policies. Syntax errors fail silently in audit mode and block resources in enforce mode.
Implementation
Install Kyverno CLI for testing:
# Install kyverno CLI
brew install kyverno/kyverno/kyverno
# Test JMESPath expression
kyverno jp query -i manifest.yaml 'spec.template.spec.containers[*].name'
Simple validation example:
See examples.md for detailed code examples.
What this does:
- Filters containers without memory limits:
containers[?!resources.limits.memory] - Extracts their names:
.name - Counts them:
| length(@) - Denies if count > 0
Examples
See examples.md for code examples.
References
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
batch-research
批量数据采集技能,负责分批并发调度 researcher agent 抓取所有数据源。
chinese-writing
专注科技周刊的中文写作与审稿技能指南,指导大模型生成与审核清晰、克制、无 AI 味的高质量周刊内容。
publish-weekly
使用 Payload REST API 将周刊发布到 CMS,正文不包含头部元数据,通过 users API Key 认证。
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
request-refactor-plan
Create a detailed refactor plan with tiny commits via user interview, then file it as a GitHub issue. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.
Didn't find tool you were looking for?