Pack assessment
Use when user mentions Rego, Conftest, OPA, AMPEL, "generate policy", or "assessment logic" in the context of Gemara catalogs. Generates policies from Gemara Control Catalogs for Kubernetes (Deployments, Pods, DaemonSets, StatefulSets, CronJobs, Jobs, Services, NetworkPolicies, Ingress, RBAC, ConfigMaps, Secrets), CI/CD pipelines (GitHub Actions, GitLab CI, Azure Pipelines), Conftest, OPA, or AMPELFrom its SKILL.md
npx -y skills add complytime/complypack --skill pack-assessmentAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
9.7 KB, as published. Nobody here has run it
/comply:pack-assessment — Rego Policy Generation and Assessment
Internal skill — invoked by
comply:build-assessment, not directly by users. Use/comply:build-assessmentor/comply:build-assessment batchinstead.
Generate Rego policies from Gemara Control Catalogs that enforce compliance requirements.
Core principle: Read control definitions from source → Generate policy to satisfy approved tests → Verify it works.
Quick Reference
| Step | Action | Output |
|---|---|---|
| 1. Scope | Call get_automation_triage, filter to automated plans | Requirement list |
| 2. Read control | Get definition from catalog (MCP) | Control text, ID, title |
| 3. Get parameters | Extract assessment requirements | Thresholds, values |
| 4. Read schema | Get platform schema (MCP) | Platform schema |
| 5. Choose format | Select evaluator output convention | Policy structure |
| 6. Generate policy | Write Rego against schema contract | .rego file |
| 7. Write to disk | Save to policy/ | File on disk |
| 8. Generate provider mapping | Create provider-specific mapping file | complytime-mapping.json (OPA) or complytime-ampel-policy.json (Ampel) |
| 9. Validate | Contract check then test | Pass/fail results |
Step 1: Scope — Filter to Automated Requirements
Call get_automation_triage with the policy name to get the automation split:
- The tool returns
automatedandmanuallists with requirement IDs, evaluation methods, and executor details - Generate policies only for requirements in the
automatedlist - List
manualrequirements for the user — these need human review
If no policy is loaded in the MCP server, proceed with all requested requirements.
Steps 2-5: Read and Prepare
DO NOT generate from general knowledge. Always read the actual control text from MCP.
- Read control — get the definition from the catalog via MCP (
complypack://catalog/*) - Get parameters — call
get_assessment_requirementsto extract thresholds and accepted values - Read schema — get the platform schema via MCP (
complypack://schema/*) - Choose format — select evaluator output convention (e.g., OPA
denyrules for Conftest)
Step 6: Generate Policy — Reusability Rules
Write policies against the platform schema contract, not sample inputs:
- Unique package namespace per file. Each
.regofile MUST declare a unique package namespace derived from the requirement (e.g.,package kubernetes.run_as_nonroot). Do NOT usepackage main. The OPA provider passes this namespace asconftest --namespacefor per-requirement evaluation — a shared namespace makes individual requirement evaluation impossible. Test files (_test.rego) must use the same package as their corresponding policy file. The namespace must be a valid Rego identifier — each dot-separated segment must start with a letter and contain only letters, digits, and underscores (e.g., replace hyphens with underscores). - Write
input.*paths from the schema. Readcomplypack://schema/*and use the paths it defines. Do NOT reverse-engineer paths from sample manifests intargets/. - No hardcoded values from test data. Do not embed names, image refs, step names, or other values from sample inputs. Use parameter values from
get_assessment_requirementsfor thresholds and accepted values. - One file per assessment requirement. Name the file after the requirement (e.g.,
run_as_nonroot.rego). - Identify the subject in denial messages. Use fields from the schema that identify the resource being checked (e.g.,
input.metadata.namefor Kubernetes,input.namefor CI jobs). Do not hardcode expected values in messages.
Step 7: Write to Disk
Save to policy/ directory.
Step 8: Generate Provider-Specific Mapping File
After writing policy files to disk, generate the mapping file that links assessment plan requirement IDs to their generated policy files. The file format depends on the configured evaluator-id in complypack.yaml. This file is bundled with the policy files when published as a ComplyPack OCI artifact.
OPA provider (evaluator-id: opa) — complytime-mapping.json
Maps Gemara Policy assessment plan requirement IDs to the Rego package namespaces of the generated checks. The opa-provider uses this file at scan time to match incoming assessment configurations to the correct Rego policies.
Build the mapping from existing rego files. Before generating, scan the policy output directory (e.g., policy/) for .rego files and read the package declaration from each one. Use these actual package namespaces as the id values — do not invent or assume namespaces.
- List all
.regofiles in the policy directory - For each file, extract the
packagedeclaration (e.g.,package kubernetes.tls_version) - Match each package namespace to its corresponding
requirement-idfrom the Policy'sadherence.assessment-plans - Write the mapping file
{
"version": "1",
"mappings": [
{
"id": "kubernetes.tls_version",
"requirement_id": "CTL-TLS-001-AR1"
},
{
"id": "kubernetes.tls_ciphers",
"requirement_id": "CTL-TLS-001-AR2"
}
]
}
id— the Regopackagenamespace declared in the.regofile (e.g.,package kubernetes.tls_version→"kubernetes.tls_version")requirement_id— the Gemara requirement-id fromadherence.assessment-plans[].requirement-idin the Policy- One entry per rego file; no duplicates in either field
- Write to
complytime-mapping.jsonin the policy output directory alongside the.regofiles
Ampel provider (evaluator-id: ampel) — granular policy files + complytime-ampel-policy.json
Generate one JSON file per assessment requirement (granular policy), then merge them into a single complytime-ampel-policy.json bundle.
Granular policy file (one per requirement, e.g., require-pull-request.json):
{
"id": "require-pull-request",
"meta": {
"description": "Validate branch protection settings require pull/merge requests",
"controls": [
{
"framework": "repo-branch-protection",
"class": "source-code",
"id": "pull-request-enforcement"
}
]
},
"tenets": [
{
"id": "01",
"code": "<CEL expression>",
"predicates": {
"types": ["<attestation predicate type URI>"]
},
"assessment": {
"message": "Direct pushes are disabled. Pull/Merge requests required."
},
"error": {
"message": "Direct pushes are enabled so Pull/Merge requests are not required.",
"guidance": "Create a branch ruleset and enable 'Restrict updates'."
}
}
]
}
Merged bundle (complytime-ampel-policy.json):
{
"id": "complytime-ampel-policy",
"meta": {
"frameworks": [
{ "id": "ComplyTime-AMPEL-Policy", "name": "ComplyTime AMPEL Policy" }
]
},
"policies": [ /* all granular policies merged here */ ]
}
idin each granular policy is the policy's semantic identity, matched against the Gemara requirement-id at scan timetenets[].codecontains CEL expressions evaluated against attestation predicatestenets[].predicates.typeslists the attestation predicate type URIs the tenet evaluates- Write granular files to the policy output directory, then merge into
complytime-ampel-policy.json
Step 9: Validate — Contract Check Then Test Suite
- Run
validate_policy— confirm zero contract violations against the platform schema - If contract violations: fix the
input.*paths to match the schema. The schema is the source of truth, not test data. - Run
test_policywith the combined policy + test content aspolicyContent— both are in the same package, so OPA compiles and runs them together - If tests fail: revise the policy, not the tests. The tests were human-approved by
comply:test-driven-assessmentand represent the requirement. - Do not write the final policy artifact until all tests pass
Safety
DO NOT generate from general knowledge. Always read the actual control text from MCP.
MCP Resources and Tools
complypack://catalog/*— Control Catalogs, Guidance Catalogs, Policiescomplypack://schema/*— Platform schemascomplypack://evaluator— Available evaluatorsget_automation_triage— Classify assessment plans as Automated or Manual with executor detailsget_assessment_requirements— Extract assessment requirements with parametersvalidate_policy— Validate policy syntax and contract compliancetest_policy— Run policy tests against sample data
Red Flags - STOP AND FIX IF THERE ARE ISSUES
- Does every
input.*reference exist in the platform schema? - Are there hardcoded values from sample inputs that should be parameters?
- Did you run
validate_policybeforetest_policy? - Is each
.regofile scoped to a single assessment requirement? - Did you read control text from MCP, not from general knowledge?
- Did you call
get_automation_triageto determine which plans are automated? - Did you generate the provider-specific mapping file (
complytime-mapping.jsonfor OPA,complytime-ampel-policy.jsonfor Ampel)? - Did you avoid modifying approved test cases to make the policy pass?
- Does every
.regofile declare a unique package namespace (notpackage main)?