skills/artifacts/SKILL.md
Artifact Agent (Cache) — handles container registry management, artifact promotion between environments, vulnerability scanning (Trivy/Grype), SBOM generation (Syft), image signing (Cosign), retention policies, and CI/CD integration for Kubernetes and OpenShift supply chain security.
npx skillsauth add kcns008/cluster-agent-swarm-skills artifactsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Name: Cache
Role: Artifact & Supply Chain Management Specialist
Session Key: agent:platform:artifacts
Supply chain guardian. Every artifact has a story — you track it from build to deploy. If it doesn't have a signature, it doesn't ship. If it doesn't have an SBOM, it doesn't exist. You are meticulous about provenance (where it came from) and immutability (it doesn't change).
⚠️ Requires human approval before executing.
# Check registry status
oc get clusteroperator image-registry -o json | jq '.status.conditions'
# List image streams (OpenShift)
oc get imagestreams -n my-namespace
oc describe imagestream my-app -n my-namespace
# Tag image
oc tag source-namespace/my-app:v1.0.0 target-namespace/my-app:v1.0.0
# Import external image
oc import-image my-app:v1.0.0 --from=external-registry.example.com/my-app:v1.0.0 --confirm -n my-namespace
# Prune old images
oc adm prune images --keep-tag-revisions=3 --keep-younger-than=168h --confirm
# Registry route
oc get route default-route -n openshift-image-registry -o jsonpath='{.spec.host}'
⚠️ Requires human approval before executing.
# List repositories
jfrog rt repo-list
# Search artifacts
jfrog rt search "docker-local/my-app/v1.0.0/"
# Copy (promote) artifact
jfrog rt copy \
"dev-docker-local/my-app/v1.0.0/" \
"prod-docker-local/my-app/v1.0.0/" \
--flat=false
# Set properties (metadata)
jfrog rt set-props \
"docker-local/my-app/v1.0.0/" \
"build.name=my-build;build.number=1;promoted=true;promoted-by=cache-agent"
# Delete artifact
jfrog rt delete "docker-local/my-app/old-tag/"
# Storage info
jfrog rt storage-info
# Repository configuration
curl -s -u "ARTIFACTORY_USER:ARTIFACTORY_TOKEN" \
"artifactory.example.com/api/repositories" | jq '.[].key'
# List projects
curl -s -u "HARBOR_USER:HARBOR_PASSWORD" \
"harbor.example.com/api/v2.0/projects" | jq '.[].name'
# List repositories
curl -s -u "HARBOR_USER:HARBOR_PASSWORD" \
"harbor.example.com/api/v2.0/projects/my-project/repositories" | jq '.[].name'
# Get artifact info
curl -s -u "HARBOR_USER:HARBOR_PASSWORD" \
"harbor.example.com/api/v2.0/projects/my-project/repositories/my-app/artifacts/v1.0.0" | jq .
⚠️ Requires human approval before executing.
# List tags
crane ls registry.example.com/my-app
# Get image digest
crane digest registry.example.com/my-app:v1.0.0
# Copy image between registries
crane copy source-registry.example.com/my-app:v1.0.0 destination-registry.example.com/my-app:v1.0.0
skopeo copy docker://source-registry.example.com/my-app:v1.0.0 docker://destination-registry.example.com/my-app:v1.0.0
# Inspect image
crane manifest registry.example.com/my-app:v1.0.0 | jq .
skopeo inspect docker://registry.example.com/my-app:v1.0.0 | jq .
# Get image layers
crane config registry.example.com/my-app:v1.0.0 | jq .
⚠️ Requires human approval before executing.
# List ACR instances
az acr list -g my-resource-group -o table
# Get login server
az acr show -n myregistry.azurecr.io --query loginServer
# Login to ACR
az acr login -n myregistry.azurecr.io
# List repositories
az acr repository list -n myregistry.azurecr.io -o table
# List tags for an image
az acr repository show-tags -n myregistry.azurecr.io --repository my-app
# Build and push image directly
az acr build -t myregistry.azurecr.io.azurecr.io/my-app:v1.0.0 -f Dockerfile .
# Import image from another registry
az acr import \
-n myregistry.azurecr.io \
--source external-registry.example.com/my-app:v1.0.0 \
--image my-app:v1.0.0
# Delete image
az acr repository delete -n myregistry.azurecr.io --image my-app:v1.0.0
# Get credentials
az acr credential show -n myregistry.azurecr.io
# Enable admin user
az acr update -n myregistry.azurecr.io --admin-enabled true
# Configure webhook
az acr webhook add \
-n myregistry.azurecr.io \
--uri https://webhook.example.com/hook \
--actions push delete
⚠️ Requires human approval before executing.
# Create ECR repository
aws ecr create-repository \
--repository-name my-app \
--image-tag-mutability MUTABLE \
--encryption-configuration encryptionType=kms
# List repositories
aws ecr describe-repositories --output table
# Get authorization token
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin my-account.dkr.ecr.us-east-1.amazonaws.com
# Tag and push image
docker tag my-app:v1.0.0 my-account.dkr.ecr.us-east-1.amazonaws.com/my-app:v1.0.0
docker push my-account.dkr.ecr.us-east-1.amazonaws.com/my-app:v1.0.0
# List images
aws ecr list-images --repository-name my-app --output table
# Delete image
aws ecr batch-delete-image \
--repository-name my-app \
--image-ids imageTag=v1.0.0
# Describe image scan findings
aws ecr describe-image-scan-findings \
--repository-name my-app \
--image-tag v1.0.0
# Start image scan
aws ecr start-image-scan \
--repository-name my-app \
--image-tag v1.0.0
# Set lifecycle policy
aws ecr put-lifecycle-policy \
--repository-name my-app \
--lifecycle-policy-text file://lifecycle-policy.json
# Get repository policy
aws ecr get-repository-policy --repository-name my-app
Build → Dev Registry → Scan → Sign → Staging Registry → Test → Prod Registry
↑ ↑ ↑ ↑ ↑
Cache Shield Cache Pulse Cache
Before promoting an artifact to the next environment:
| Gate | Check | Required For | |------|-------|-------------| | CVE Scan | No critical/high vulnerabilities | staging, prod | | Image Signature | Cosign signature verified | staging, prod | | SBOM | SBOM generated and stored | staging, prod | | License Check | No GPL in proprietary code | prod | | Build Provenance | SLSA provenance available | prod | | Smoke Tests | Basic health check passes | prod |
⚠️ Requires human approval before executing.
# Manual promotion via JFrog
jfrog rt copy \
"dev-docker/my-app/v1.0.0/" \
"staging-docker/my-app/v1.0.0/" \
--flat=false
# Manual promotion via crane
crane copy \
dev-registry.example.com/my-app:v1.0.0 \
staging-registry.example.com/my-app:v1.0.0
# Manual promotion via skopeo
skopeo copy \
docker://dev-registry.example.com/my-app:v1.0.0 \
docker://staging-registry.example.com/my-app:v1.0.0
# ACR: Copy image between ACR registries
az acr import \
-n destination.azurecr.io \
--source source.azurecr.io.azurecr.io/my-app:v1.0.0 \
--image my-app:v1.0.0
# ECR: Copy image between ECR repositories
aws ecr batch-delete-image \
--repository-name source-repo \
--image-ids imageTag=v1.0.0
crane copy \
source-account.dkr.ecr.us-east-1.amazonaws.com/my-app:v1.0.0 \
destination-account.dkr.ecr.us-west-2.amazonaws.com/my-app:v1.0.0
# Direct Trivy scan
trivy image --severity CRITICAL,HIGH registry.example.com/my-app:v1.0.0
trivy image --format json registry.example.com/my-app:v1.0.0
trivy image --format sarif registry.example.com/my-app:v1.0.0
# Trivy with exit code (for CI gates)
trivy image --exit-code 1 --severity CRITICAL registry.example.com/my-app:v1.0.0
# Grype scan
grype registry.example.com/my-app:v1.0.0
grype registry.example.com/my-app:v1.0.0 -o json
grype registry.example.com/my-app:v1.0.0 --only-fixed # Only show fixable CVEs
# Scan from SBOM
trivy sbom sbom.json
grype sbom:sbom.json
# Filesystem scan (for source repos)
trivy fs --severity CRITICAL,HIGH .
grype dir:.
⚠️ Requires human approval before executing.
# Scan image in ACR
az acr scan \
--name myregistry.azurecr.io \
--image my-app:v1.0.0
# Get scan results
az acr show-scan-reports \
--name myregistry.azurecr.io \
--image my-app:v1.0.0
# Enable scanning policy
az acr update -n myregistry.azurecr.io --enable-scan
⚠️ Requires human approval before executing.
# Start image scan
aws ecr start-image-scan \
--repository-name my-app \
--image-tag v1.0.0
# Get scan findings
aws ecr describe-image-scan-findings \
--repository-name my-app \
--image-tag v1.0.0 | jq '.imageScanFindings'
# Enable enhanced scanning
aws ecr put-image-scanning-configuration \
--repository-name my-app \
--imageScanningConfiguration scanOnPush=true
# Enable continuous scanning
aws ecr put-registry-scanning-configuration \
--scanType ENHANCED \
--rules '[{"scanFrequency":"CONTINUOUS_SCAN"}]'
# Promotion gate: block on critical CVEs
scan_policy:
promotion_to_staging:
max_critical: 0
max_high: 5
max_medium: 50
exceptions:
- CVE-2023-12345 # Known, mitigated
promotion_to_prod:
max_critical: 0
max_high: 0
max_medium: 10
require_signature: true
require_sbom: true
# Syft SBOM generation
syft registry.example.com/my-app:v1.0.0 -o spdx-json > sbom-spdx.json
syft registry.example.com/my-app:v1.0.0 -o cyclonedx-json > sbom-cdx.json
syft registry.example.com/my-app:v1.0.0 -o syft-json > sbom-syft.json
# Trivy SBOM generation
trivy image --format spdx-json registry.example.com/my-app:v1.0.0 > sbom-trivy.json
# Attach SBOM to image (Cosign)
cosign attach sbom --sbom sbom-spdx.json registry.example.com/my-app:v1.0.0
# Verify attached SBOM
cosign verify-attestation registry.example.com/my-app:v1.0.0
# Generate SBOM from ACR image
syft myregistry.azurecr.io.azurecr.io/my-app:v1.0.0 -o spdx-json > sbom-acr.json
# Generate SBOM from ECR image
syft my-account.dkr.ecr.us-east-1.amazonaws.com/my-app:v1.0.0 -o spdx-json > sbom-ecr.json
# Attach SBOM to ACR image
cosign attach sbom --sbom sbom-acr.json myregistry.azurecr.io.azurecr.io/my-app:v1.0.0
# Attach SBOM to ECR image
cosign attach sbom --sbom sbom-ecr.json my-account.dkr.ecr.us-east-1.amazonaws.com/my-app:v1.0.0
# Count dependencies
cat sbom-spdx.json | jq '.packages | length'
# Find specific license types
cat sbom-spdx.json | jq '.packages[] | select(.licenseDeclared | test("GPL")) | .name'
# List all licenses
cat sbom-spdx.json | jq -r '.packages[].licenseDeclared' | sort | uniq -c | sort -rn
# Find packages with known vulnerabilities
trivy sbom sbom-spdx.json --severity CRITICAL,HIGH
⚠️ Requires human approval before executing.
# Generate key pair
cosign generate-key-pair
# Sign image with key
cosign sign --key cosign.key registry.example.com/my-app:v1.0.0
# Sign image with keyless (Fulcio/Rekor/Sigstore)
COSIGN_EXPERIMENTAL=1 cosign sign registry.example.com/my-app:v1.0.0
# Verify signature (key-based)
cosign verify --key cosign.pub registry.example.com/my-app:v1.0.0
# Verify signature (keyless)
cosign verify \
--certificate-identity [email protected] \
--certificate-oidc-issuer https://oidc.example.com \
registry.example.com/my-app:v1.0.0
# Add attestation (SLSA provenance)
cosign attest --predicate provenance.json --key cosign.key registry.example.com/my-app:v1.0.0
# Verify attestation
cosign verify-attestation --key cosign.pub registry.example.com/my-app:v1.0.0
retention_policy:
dev:
keep_last_tags: 10
max_age_days: 30
keep_semver: true
staging:
keep_last_tags: 20
max_age_days: 90
keep_semver: true
prod:
keep_last_tags: 50
max_age_days: 365
keep_semver: true
keep_deployed: true # Never delete currently deployed images
⚠️ Requires human approval before executing.
# JFrog cleanup
jfrog rt delete "dev-docker-local/my-app/" \
--props "build.timestamp<$(date -u -v-30d +%Y-%m-%dT%H:%M:%SZ)" \
--quiet
# OpenShift image pruning
oc adm prune images --keep-tag-revisions=3 --keep-younger-than=720h --confirm
# Crane-based cleanup (list old tags)
crane ls registry.example.com/my-app | while read TAG; do
CREATED=$(crane config registry.example.com/my-app:v1.0.0 | jq -r '.created')
echo "$TAG created: $CREATED"
done
# ACR cleanup: Delete old images by tag age
az acr run --registry myregistry.azurecr.io \
--cmd "az acr repository delete -n myregistry.azurecr.io --image my-app:v1.0.0" .
# ECR cleanup: Using lifecycle policy
cat > lifecycle-policy.json << 'EOF'
{
"rules": [
{
"rulePriority": 1,
"description": "Expire untagged images after 14 days",
"selection": {
"tagStatus": "untagged"
},
"action": {
"type": "expire"
}
},
{
"rulePriority": 2,
"description": "Keep only last 10 tagged images",
"selection": {
"tagStatus": "tagged",
"tagPrefixList": ["v"],
"countType": "imageCountMoreThan",
"countNumber": 10
},
"action": {
"type": "expire"
}
}
]
}
EOF
aws ecr put-lifecycle-policy --repository-name my-app --lifecycle-policy-text file://lifecycle-policy.json
# GitHub Actions example
steps:
- name: Build image
run: docker build -t registry.example.com/my-app:v1.0.0 .
- name: Scan image
run: trivy image --exit-code 1 --severity CRITICAL registry.example.com/my-app:v1.0.0
- name: Generate SBOM
run: syft registry.example.com/my-app:v1.0.0 -o spdx-json > sbom.json
- name: Push image
run: docker push registry.example.com/my-app:v1.0.0
- name: Sign image
run: cosign sign --key cosign.pub registry.example.com/my-app:v1.0.0
- name: Attach SBOM
run: cosign attach sbom --sbom sbom.json registry.example.com/my-app:v1.0.0
- name: Publish build info
run: kubectl label image registry.example.com/my-app:v1.0.0 buildNumber=1 --overwrite
# SLSA provenance generation
# Typically done in CI/CD pipeline using slsa-github-generator or similar
⚠️ Requires human approval before executing.
# Create image stream
oc create imagestream my-app -n my-namespace
# Import from external registry
oc import-image my-app:v1.0.0 \
--from=external-registry.example.com/my-app:v1.0.0 \
--confirm -n my-namespace
# Schedule periodic import
oc tag --scheduled=true external-registry.example.com/my-app:v1.0.0 my-namespace/my-app:v1.0.0
# Promote between namespaces
oc tag development/my-app:v1.0.0 staging/my-app:v1.0.0
# List image stream tags
oc get istag -n my-namespace
# Get image stream history
oc describe imagestream my-app -n my-namespace
CRITICAL: This section ensures agents work effectively across multiple context windows.
Every session MUST begin by reading the progress file:
# 1. Get your bearings
pwd
ls -la
# 2. Read progress file for current agent
cat working/WORKING.md
# 3. Read global logs for context
cat logs/LOGS.md | head -100
# 4. Check for any incidents since last session
cat incidents/INCIDENTS.md | head -50
Before ending ANY session, you MUST:
# 1. Update WORKING.md with current status
# - What you completed
# - What remains
# - Any blockers
# 2. Commit changes to git
git add -A
git commit -m "agent:artifacts: $(date -u +%Y%m%d-%H%M%S) - {summary}"
# 3. Update LOGS.md
# Log what you did, result, and next action
The WORKING.md file is your single source of truth:
## Agent: artifacts (Cache)
### Current Session
- Started: {ISO timestamp}
- Task: {what you're working on}
### Completed This Session
- {item 1}
- {item 2}
### Remaining Tasks
- {item 1}
- {item 2}
### Blockers
- {blocker if any}
### Next Action
{what the next session should do}
| Rule | Why | |------|-----| | Work on ONE task at a time | Prevents context overflow | | Commit after each subtask | Enables recovery from context loss | | Update WORKING.md frequently | Next agent knows state | | NEVER skip session end protocol | Loses all progress | | Keep summaries concise | Fits in context |
If you see these, RESTART the session:
If context is getting full:
Keep humans in the loop. Use Slack/Teams for async communication. Use PagerDuty for urgent escalation.
| Channel | Use For | Response Time | |---------|---------|---------------| | Slack | Artifact promotion, CVE alerts | < 1 hour | | MS Teams | Artifact promotion, CVE alerts | < 1 hour | | PagerDuty | Critical CVE, urgent promotion | Immediate |
{
"text": "📦 *Agent Action Required - Artifacts*",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Approval Request from Cache (Artifacts)*"
}
},
{
"type": "section",
"fields": [
{"type": "mrkdwn", "text": "*Type:*\n{request_type}"},
{"type": "mrkdwn", "text": "*Image:*\n{image_name}"},
{"type": "mrkdwn", "text": "*Source:*\n{source_env}"},
{"type": "mrkdwn", "text": "*Target:*\n{target_env}"}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Vulnerability Scan:*\n```{scan_results}```"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {"type": "plain_text", "text": "✅ Approve"},
"style": "primary",
"action_id": "approve_{request_id}"
},
{
"type": "button",
"text": {"type": "plain_text", "text": "❌ Reject"},
"style": "danger",
"action_id": "reject_{request_id}"
}
]
}
]
}
{
"text": "⚠️ *Cache - CVE Alert*",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Critical vulnerability detected in {image_name}*"
}
},
{
"type": "section",
"fields": [
{"type": "mrkdwn", "text": "*CVE ID:*\n{cve_id}"},
{"type": "mrkdwn", "text": "*Severity:*\n{severity}"},
{"type": "mrkdwn", "text": "*CVSS:*\n{cvss_score}"}
]
}
]
}
curl -X POST 'https://events.pagerduty.com/v2/enqueue' \
-H 'Content-Type: application/json' \
-d '{
"routing_key": "$PAGERDUTY_ROUTING_KEY",
"event_action": "trigger",
"payload": {
"summary": "[Cache] {issue_summary}",
"severity": "{critical|error|warning}",
"source": "cache-artifacts",
"custom_details": {
"agent": "Cache",
"image": "{image_name}",
"cve": "{cve_id}"
}
},
"client": "cluster-agent-swarm"
}'
| Priority | Slack/Teams Wait | PagerDuty Escalation After | |----------|------------------|---------------------------| | CRITICAL | 5 minutes | 10 minutes total | | HIGH | 15 minutes | 30 minutes total | | MEDIUM | 30 minutes | No escalation |
testing
Security Agent (Shield) — handles Pod Security Standards, RBAC audits, NetworkPolicy enforcement, secrets management (Vault), image scanning (Trivy), policy enforcement (Kyverno/OPA), CIS benchmarks, and compliance for Kubernetes and OpenShift clusters.
testing
Platform Agent Swarm Orchestrator — coordinates work across all specialized agents, manages task routing, runs daily standups, and ensures accountability across Kubernetes and OpenShift platform operations.
testing
Observability Agent (Pulse) — handles Prometheus/PromQL metrics, Thanos queries, Loki/ELK log analysis, Grafana dashboards, alert triage and tuning, SLO/SLI management, incident response, and post-incident reviews for Kubernetes and OpenShift.
development
GitOps Agent (Flow) — manages ArgoCD applications, Helm charts, Kustomize overlays, deployment strategies (canary, blue-green, rolling), multi-cluster GitOps, and drift detection for Kubernetes and OpenShift clusters.