platform-skills
Copilot instructions61 starsChanged 2 months agoApache-2.0View on GitHub
Use when troubleshooting, implementing, reviewing, or auditing platform infrastructure as a system — where Kubernetes, GitOps, CI/CD, and security concerns intersect. Apply these patterns when generating or reviewing code across Kubernetes, Flux CD, Argo CD, Terraform, GitHub Actions (composite actions, OIDC, SHA pinning), AWS, Azure, GKE, Linkerd, KEDA, supply chain security (Cosign, SBOM, SLSA), Falco, Chaos Engineering, DORA metrics, Datadog/Dynatrace/LLM observability, SOC 2, and PR review. Every answer includes blast radius, validation steps, and rollback plan. If the user mentions…
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/keda.mdcCursor rule
- .cursor/rules/kubernetes.mdcCursor rule
- .cursor/rules/platform-skills.mdcCursor rule
- .cursor/rules/terraform.mdcCursor rule
- platform-skillsSkill
- platform-skillsSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
15 rules. About 0 are common, 9 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Production-first: Always include blast radius, rollback plan, and validation steps
- Distinctive: line 24
Least privilege by default: Never suggest wildcard IAM actions or resources
- Distinctive: line 30
When generating infrastructure code, respect these boundaries:
- Distinctive: line 41
Always generate workloads with:
- Distinctive: line 95
Prefer the current Flux CD API shape:
- Very specific: line 96
Use chartRef for OCIRepository-backed charts when available
- Distinctive: line 97
Keep source auth, image automation, and workload reconciliation ownership separate
- Distinctive: line 127
Always prefer IRSA (EKS), Workload Identity (AKS), or Workload Identity Federation/WIF (GKE) over static credentials.
- Distinctive: line 133
Always include variable validation:
- Very specific: line 160
Never use pull_request_target with code checkout from forks.
- Very specific: line 166
Never use helm upgrade --set to pass secrets.
- Very specific: line 185
Always use the new CEL-based policy types — never kyverno.io/v1 ClusterPolicy for new work:
- Very specific: line 236
Always add import rego.v1.
- Very specific: line 269
Never add Co-authored-by: Claude or any AI attribution.
- Distinctive: line 273
When reviewing any PR that touches infrastructure, check all six dimensions:
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Platform Engineering Instructions for GitHub Copilot
Version: 1.42.0
Source: https://github.com/nitinjain999/platform-skills
Scope: project-level — applies to every Copilot Chat session in this workspace
Install: ./install.sh --copilot --target /path/to/your-project
Upgrade: git pull in the platform-skills clone → rerun install.sh or copy this file → commit
Use when troubleshooting, implementing, reviewing, or auditing platform infrastructure as a system — where Kubernetes, GitOps, CI/CD, and security concerns intersect. Apply these patterns when generating or reviewing code across Kubernetes, Flux CD, Argo CD, Terraform, GitHub Actions (composite actions, OIDC, SHA pinning), AWS, Azure, GKE, Linkerd, KEDA, supply chain security (Cosign, SBOM, SLSA), Falco, Chaos Engineering, DORA metrics, Datadog/Dynatrace/LLM observability, SOC 2, and PR review. Every answer includes blast radius, validation steps, and rollback plan.
If the user mentions "platform-skills", asks for a platform/DevOps/cloud/SRE review, or asks for production readiness, apply these instructions even if they do not reference this file explicitly. In Copilot Chat, slash commands such as /platform-skills:preflight are not required; translate them into the equivalent natural-language workflow.
Response Contract
- For reviews: lead with findings ordered by severity, then give validation and rollback notes
- For generation: include runnable code, assumptions, validation commands, and rollback path
- For troubleshooting: use evidence-first diagnosis before proposing changes
- For risky production changes: state blast radius before the change plan
- For uncertain or environment-specific advice: ask for the missing fact or mark the assumption clearly
Core Principles
- Production-first: Always include blast radius, rollback plan, and validation steps
- Root-cause over symptoms: Explain why a problem occurs, not just how to fix it
- Least privilege by default: Never suggest wildcard IAM actions or resources
- GitOps pull model: Cluster state lives in Git, not in pipeline scripts
- Explicit over implicit: Make security choices, environment differences, and promotion flows visible
Layer Ownership
When generating infrastructure code, respect these boundaries:
| Layer | Owns | Does NOT Own |
| Terraform | Cloud primitives, cluster bootstrap, IAM, networking, secrets backends | In-cluster workloads, Helm releases |
| Flux / Argo CD | In-cluster state, Helm releases, workload promotion | Cloud resources, IAM roles |
| GitHub Actions | CI checks, plan gates, artifact publish, promotion triggers | Long-lived environment state |
| Kubernetes | Workload specs, RBAC, network policy, resource limits | Cloud account structure |
Kubernetes & OpenShift
Always generate workloads with:
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
memory: "256Mi" # Always set memory limit; omit cpu limit — causes throttling
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
securityContext:
runAsNonRoot: true
runAsUser: 1000 # Omit on OpenShift — SCC assigns the UID
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]Flux CD
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
spec:
interval: 10m
chart:
spec:
version: "1.2.3" # Never use "*" or ranges
install:
remediation:
retries: 3
upgrade:
remediation:
retries: 3
remediateLastFailure: trueTroubleshooting order: source → artifact → reconciliation → chart rendering → runtime
Prefer the current Flux CD API shape:
- Use
chartReffor OCIRepository-backed charts when available - Keep source auth, image automation, and workload reconciliation ownership separate
- For stuck reconciliations, inspect
GitRepository/OCIRepository, artifact status,Kustomization,HelmRelease, and controller logs in that order
Argo CD
spec:
project: platform # Never leave as "default"
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- PruneLast=trueAWS IAM
// ❌ Never generate
{ "Action": "s3:*", "Resource": "*" }
// ✅ Always generate
{
"Action": ["s3:GetObject", "s3:ListBucket"],
"Resource": ["arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/*"]
}Always prefer IRSA (EKS), Workload Identity (AKS), or Workload Identity Federation/WIF (GKE) over static credentials.
Terraform
Module structure: main.tf, variables.tf (with validation blocks), outputs.tf, versions.tf, README.md.
Always include variable validation:
variable "environment" {
type = string
validation {
condition = contains(["dev", "staging", "production"], var.environment)
error_message = "environment must be dev, staging, or production"
}
}Pipeline order: terraform fmt -check → terraform validate → tflint → checkov/tfsec → plan.
GitHub Actions
# ❌ Never
- uses: actions/checkout@v4
# ✅ Always — pin to full SHA
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
permissions:
contents: read
id-token: write # only if OIDC is requiredNever use pull_request_target with code checkout from forks.
Helm
Validation pipeline order: helm lint --strict → helm template --debug → kubeconform -strict -summary → checkov → helm test.
Never use helm upgrade --set to pass secrets. selectorLabels must NOT include app.kubernetes.io/version — it is immutable after creation.
KEDA
For event-driven autoscaling, require explicit minReplicaCount, maxReplicaCount, cooldown, fallback behavior where supported, and trigger authentication ownership. For AWS triggers on EKS, prefer IRSA over static keys. For Prometheus triggers, validate query cardinality and failure behavior before recommending scale-to-zero.
Supply Chain and Runtime Security
For container and deployment pipelines, prefer:
- Cosign keyless signing and verification
- Syft SBOM generation and attestation
- Trivy or Grype severity gates
- SLSA provenance for build artifacts
- Kyverno image verification at admission
For runtime security, treat Falco findings as signals that need triage, ownership, severity, and follow-up policy where appropriate. Do not convert every runtime signal directly into a blocking admission policy without checking noise, scope, and rollout plan.
Kyverno (policies.kyverno.io/v1)
Always use the new CEL-based policy types — never kyverno.io/v1 ClusterPolicy for new work:
apiVersion: policies.kyverno.io/v1
kind: ValidatingPolicy
metadata:
name: require-team-labels
annotations:
policies.kyverno.io/title: Require team labels
policies.kyverno.io/severity: medium
spec:
validationActions: [Audit] # Always start in Audit; promote to Deny after zero violations
matchConstraints:
resourceRules:
- apiGroups: ["apps"]
apiVersions: ["v1"]
resources: ["deployments"]
operations: ["CREATE", "UPDATE"]
matchConditions:
- name: exclude-system-namespaces
expression: "!(['kube-system','kube-public','flux-system'].exists(ns, ns == object.metadata.namespace))"
validations:
- expression: "object.metadata.labels != null && 'app.kubernetes.io/team' in object.metadata.labels"
message: "Deployment must have app.kubernetes.io/team label"Promotion: kubectl patch validatingpolicy <name> --type merge -p '{"spec":{"validationActions":["Deny"]}}' — only after confirmed zero violations in PolicyReport.
Never generate:
validationFailureAction: Enforce— usevalidationActions: [Deny]insteadspec.rules[].match.any[].resources— usematchConstraints.resourceRulesinstead
OPA / Conftest (Rego)
# METADATA
# title: IAM least privilege
# entrypoint: true
package terraform.iam
import rego.v1
deny contains msg if {
some name
policy := input.resource.aws_iam_policy[name]
some statement in policy.policy.Statement
statement.Action == "*"
msg := sprintf("IAM policy '%s' must not use wildcard Action", [name])
}Always add import rego.v1. Rules must be named deny, warn, or violation.
Pipeline: conftest fmt --check → regal lint → conftest verify → conftest test.
SOC 2 Compliance (Terraform)
Never generate:
publicly_accessible = trueon RDS, Redshift, or OpenSearchencrypted = falseon any storage resourceskip_final_snapshot = trueon production databasesdeletion_protection = falseon production databasesis_multi_region_trail = falseon CloudTrailenable_log_file_validation = falseon CloudTrailenable = falseon GuardDuty- Images tagged
:latest
Always include:
resource "aws_kms_key" "..." { enable_key_rotation = true } # CC6.7
resource "aws_cloudtrail" "..." {
is_multi_region_trail = true
enable_log_file_validation = true
} # CC7.2
resource "aws_guardduty_detector" "..." { enable = true } # CC7.1
resource "aws_db_instance" "..." {
backup_retention_period = 35
deletion_protection = true
} # A1.2Conventional Commits
Subject line: <type>(<scope>): <imperative WHY, ≤72 chars, lowercase, no period>.
Types: feat, fix, refactor, chore, ci, docs, test, perf.
Never add Co-authored-by: Claude or any AI attribution.
PR Review dimensions
When reviewing any PR that touches infrastructure, check all six dimensions:
- Cost — replica count, instance type, storage, NAT Gateways, data transfer
- Drift — dev/staging/prod overlay and values file alignment
- Ownership — CODEOWNERS coverage, team labels, Terraform README
- Compliance — SOC 2 CC6.1–CC8.1 control impact
- Upgrade — deprecated K8s APIs, loose Terraform provider constraints,
:latestimages - Rollback — score each change: FULL / PARTIAL / MANUAL / NONE × LOCAL / CLUSTER / PLATFORM / DATA
Troubleshooting Structure
- Symptom — exact error and observable behavior
- Evidence to collect — exact commands to run
- Root cause — why this happens
- Fix — specific change with justification
- Validation — how to verify it worked
- Prevention — how to avoid in future
- Rollback — how to safely undo
Reference Files
references/kubernetes.md— cluster baselines, RBAC, network policyreferences/openshift.md— routes, SCCs, operatorsreferences/fluxcd.md— GitOps reconciliation, troubleshootingreferences/fluxcd-helmrelease.md— HelmRelease chartRef, drift detection, remediationreferences/fluxcd-kustomization.md— CEL readyExpr, postBuild, SOPS, SSA annotationsreferences/fluxcd-security.md— source auth, OCI supply chain, RBAC, image automationreferences/fluxcd-troubleshooting.md— controller-specific incident diagnosisreferences/argocd.md— app design, ApplicationSetsreferences/aws.md— IAM, EKS, account modelreferences/aws-cloudfront.md— CloudFront distributions, OAC, cache/security policiesreferences/aws-waf.md— Web ACLs, managed rules, rate limiting, Shield/FMSreferences/aws-mcp-profiles.md— AWS MCP profile management and multi-account authreferences/azure.md— AKS, workload identity, RBACreferences/terraform.md— module design, state, testingreferences/github-actions.md— workflow security, OIDCreferences/composite-actions.md— composite actions patterns, multi-cloud k8s deploy (EKS/AKS/GKE OIDC), private repo access, reusable-workflow decision guidereferences/platform-operating-model.md— cross-cutting architecturereferences/platform-mindset.md— DevEx, RFC/ADR, incident communicationreferences/secrets.md— External Secrets Operator, Sealed Secrets, provider setupreferences/compliance.md— SOC 2 controls in Terraformreferences/helm.md— chart scaffolding, lint pipelinereferences/mcp.md— MCP protocol, TypeScript/Python SDKsreferences/observability.md— logging, metrics, tracing, alertingreferences/documentation.md— docstrings, OpenAPI 3.1, doc sitesreferences/datadog.md— Agent setup, APM, monitors, SLOsreferences/dynatrace.md— Operator, instrumentation, SLOsreferences/conventional-commits.md— commit spec, toolingreferences/opa.md— Rego v1, rule types, testing, Conftest CLIreferences/kyverno.md— CEL policies, Audit→Deny, PolicyExceptionreferences/pr-review.md— cost, drift, ownership, compliance, upgrade, rollbackreferences/keda.md— ScaledObject, ScaledJob, TriggerAuthentication, all scalers, IRSA, GitOps integrationreferences/agent-self-improve.md—.learnings/setup, WAL protocol, VFM scoring, proactive agent behaviorreferences/supply-chain.md— Cosign signing, Syft SBOM, Trivy CVE gates, SLSA Level 2, Kyverno enforcementreferences/trivy.md— image/fs/repo/SBOM/cluster CVE scanning, severity gating, Trivy Operator via Flux HelmReleasereferences/zizmor.md— GitHub Actions workflow/action security audit, personas,zizmor.ymlpolicy, exit-code gating, auto-fix, SARIF, pre-commitreferences/runtime-security.md— Falco eBPF, custom rules, Falcosidekick alert routing, Kyverno bridgereferences/chaos.md— Litmus Chaos v3, Chaos Mesh v2, steady-state hypothesis, GameDay workflowreferences/dora.md— Deployment Frequency, Lead Time, Change Failure Rate, MTTR — GitHub Actions + Prometheusreferences/llm-observability.md— Datadog LLMObs instrumentation, eval bootstrap, trace RCAreferences/awesome-docs.md— animated GitHub-safe SVG doc generation, 4 patterns, timing math, GitHub constraintsreferences/renovate.md— dependency update automation, regex managers, private registriesexamples/— working, production-ready code examples
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

