@synapta/skills 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -4
- package/package.json +3 -4
- package/skills/ATTRIBUTION.md +80 -0
- package/skills/accessibility-audit/SKILL.md +325 -0
- package/skills/accessibility-audit/reference/wcag-checklist.md +103 -0
- package/skills/apns-notifier/SKILL.md +86 -0
- package/skills/approval-policy-enforcer/SKILL.md +66 -0
- package/skills/apps-sdk-builder/LICENSE.txt +201 -0
- package/skills/apps-sdk-builder/SKILL.md +328 -0
- package/skills/apps-sdk-builder/agents/openai.yaml +13 -0
- package/skills/apps-sdk-builder/references/app-archetypes.md +132 -0
- package/skills/apps-sdk-builder/references/apps-sdk-docs-workflow.md +135 -0
- package/skills/apps-sdk-builder/references/interactive-state-sync-patterns.md +113 -0
- package/skills/apps-sdk-builder/references/repo-contract-and-validation.md +93 -0
- package/skills/apps-sdk-builder/references/search-fetch-standard.md +67 -0
- package/skills/apps-sdk-builder/references/upstream-example-workflow.md +79 -0
- package/skills/apps-sdk-builder/references/window-openai-patterns.md +79 -0
- package/skills/apps-sdk-builder/scripts/scaffold_node_ext_apps.mjs +606 -0
- package/skills/architecture-selector/SKILL.md +64 -0
- package/skills/backlog-planner/SKILL.md +68 -0
- package/skills/carplay-entitlement-checker/SKILL.md +82 -0
- package/skills/concept-deepener/SKILL.md +86 -0
- package/skills/concept-discovery/SKILL.md +517 -0
- package/skills/concept-discovery/assets/sample-analysis.json +81 -0
- package/skills/concept-discovery/expected_outputs/sample-enum-dictionary.md +25 -0
- package/skills/concept-discovery/expected_outputs/sample-page-user-list.md +83 -0
- package/skills/concept-discovery/expected_outputs/sample-prd-readme.md +43 -0
- package/skills/concept-discovery/references/framework-patterns.md +228 -0
- package/skills/concept-discovery/references/prd-quality-checklist.md +65 -0
- package/skills/concept-discovery/scripts/codebase_analyzer.py +732 -0
- package/skills/concept-discovery/scripts/prd_scaffolder.py +435 -0
- package/skills/dast-zap/SKILL.md +453 -0
- package/skills/dast-zap/assets/.gitkeep +9 -0
- package/skills/dast-zap/assets/github_action.yml +207 -0
- package/skills/dast-zap/assets/gitlab_ci.yml +226 -0
- package/skills/dast-zap/assets/zap_automation.yaml +196 -0
- package/skills/dast-zap/assets/zap_context.xml +192 -0
- package/skills/dast-zap/references/EXAMPLE.md +40 -0
- package/skills/dast-zap/references/api_testing_guide.md +475 -0
- package/skills/dast-zap/references/authentication_guide.md +431 -0
- package/skills/dast-zap/references/false_positive_handling.md +427 -0
- package/skills/dast-zap/references/owasp_mapping.md +255 -0
- package/skills/dep-sbom-scan/SKILL.md +466 -0
- package/skills/deploy-cloudflare/SKILL.md +930 -0
- package/skills/deploy-docker/SKILL.md +55 -0
- package/skills/deploy-fly/SKILL.md +228 -0
- package/skills/deploy-k8s/SKILL.md +108 -0
- package/skills/deploy-k8s/assets/logo.png +0 -0
- package/skills/deploy-k8s/docs/README.md +29 -0
- package/skills/deploy-k8s/docs/SUMMARY.md +56 -0
- package/skills/deploy-k8s/docs/advanced/token-efficiency.md +61 -0
- package/skills/deploy-k8s/docs/architecture/multi-tenancy.md +96 -0
- package/skills/deploy-k8s/docs/architecture/storage-and-state.md +102 -0
- package/skills/deploy-k8s/docs/architecture/workload-patterns.md +87 -0
- package/skills/deploy-k8s/docs/book.json +16 -0
- package/skills/deploy-k8s/docs/community/changelog.md +34 -0
- package/skills/deploy-k8s/docs/community/contributing.md +67 -0
- package/skills/deploy-k8s/docs/core-concepts/failure-modes.md +153 -0
- package/skills/deploy-k8s/docs/core-concepts/philosophy.md +83 -0
- package/skills/deploy-k8s/docs/core-concepts/workflow.md +124 -0
- package/skills/deploy-k8s/docs/examples/bad-patterns.md +47 -0
- package/skills/deploy-k8s/docs/examples/do-dont-checklist.md +37 -0
- package/skills/deploy-k8s/docs/examples/good-patterns.md +49 -0
- package/skills/deploy-k8s/docs/failure-modes/api-drift.md +104 -0
- package/skills/deploy-k8s/docs/failure-modes/fragile-rollouts.md +99 -0
- package/skills/deploy-k8s/docs/failure-modes/insecure-workload-defaults.md +80 -0
- package/skills/deploy-k8s/docs/failure-modes/network-exposure.md +98 -0
- package/skills/deploy-k8s/docs/failure-modes/privilege-sprawl.md +91 -0
- package/skills/deploy-k8s/docs/failure-modes/resource-starvation.md +85 -0
- package/skills/deploy-k8s/docs/getting-started/installation.md +152 -0
- package/skills/deploy-k8s/docs/getting-started/quick-start.md +115 -0
- package/skills/deploy-k8s/docs/guides/helm-patterns.md +71 -0
- package/skills/deploy-k8s/docs/guides/kustomize-patterns.md +65 -0
- package/skills/deploy-k8s/docs/guides/observability.md +67 -0
- package/skills/deploy-k8s/docs/guides/security-hardening.md +59 -0
- package/skills/deploy-k8s/docs/guides/validation-and-policy.md +66 -0
- package/skills/deploy-k8s/docs/integrations/mcp-integration.md +52 -0
- package/skills/deploy-k8s/docs/package-lock.json +2892 -0
- package/skills/deploy-k8s/docs/package.json +13 -0
- package/skills/deploy-k8s/references/api-drift.md +298 -0
- package/skills/deploy-k8s/references/conditional/aks-patterns.md +70 -0
- package/skills/deploy-k8s/references/conditional/eks-patterns.md +79 -0
- package/skills/deploy-k8s/references/conditional/gitops-controllers.md +71 -0
- package/skills/deploy-k8s/references/conditional/gke-patterns.md +74 -0
- package/skills/deploy-k8s/references/conditional/observability-stacks.md +80 -0
- package/skills/deploy-k8s/references/conditional/openshift-patterns.md +67 -0
- package/skills/deploy-k8s/references/daemonset-operator-patterns.md +155 -0
- package/skills/deploy-k8s/references/deployment-patterns.md +146 -0
- package/skills/deploy-k8s/references/do-dont-patterns.md +87 -0
- package/skills/deploy-k8s/references/examples-bad.md +282 -0
- package/skills/deploy-k8s/references/examples-good.md +440 -0
- package/skills/deploy-k8s/references/fragile-rollouts.md +303 -0
- package/skills/deploy-k8s/references/helm-patterns.md +203 -0
- package/skills/deploy-k8s/references/insecure-workload-defaults.md +300 -0
- package/skills/deploy-k8s/references/job-patterns.md +120 -0
- package/skills/deploy-k8s/references/kustomize-patterns.md +239 -0
- package/skills/deploy-k8s/references/multi-tenancy.md +343 -0
- package/skills/deploy-k8s/references/network-exposure.md +481 -0
- package/skills/deploy-k8s/references/observability.md +302 -0
- package/skills/deploy-k8s/references/privilege-sprawl.md +273 -0
- package/skills/deploy-k8s/references/resource-starvation.md +374 -0
- package/skills/deploy-k8s/references/security-hardening.md +209 -0
- package/skills/deploy-k8s/references/stateful-patterns.md +130 -0
- package/skills/deploy-k8s/references/storage-and-state.md +330 -0
- package/skills/deploy-k8s/references/validation-and-policy.md +242 -0
- package/skills/deploy-railway/SKILL.md +235 -0
- package/skills/deploy-railway/references/analyze-db-mongo.md +84 -0
- package/skills/deploy-railway/references/analyze-db-mysql.md +254 -0
- package/skills/deploy-railway/references/analyze-db-postgres.md +479 -0
- package/skills/deploy-railway/references/analyze-db-redis.md +208 -0
- package/skills/deploy-railway/references/analyze-db.md +344 -0
- package/skills/deploy-railway/references/configure.md +309 -0
- package/skills/deploy-railway/references/deploy.md +195 -0
- package/skills/deploy-railway/references/operate.md +214 -0
- package/skills/deploy-railway/references/request.md +248 -0
- package/skills/deploy-railway/references/setup.md +312 -0
- package/skills/deploy-railway/scripts/analyze-mongo.py +1549 -0
- package/skills/deploy-railway/scripts/analyze-mysql.py +1195 -0
- package/skills/deploy-railway/scripts/analyze-postgres.py +3058 -0
- package/skills/deploy-railway/scripts/analyze-redis.py +1090 -0
- package/skills/deploy-railway/scripts/dal.py +671 -0
- package/skills/deploy-railway/scripts/enable-pg-stats.py +170 -0
- package/skills/deploy-railway/scripts/pg-extensions.py +370 -0
- package/skills/deploy-railway/scripts/railway-api.sh +52 -0
- package/skills/deploy-ssh/SKILL.md +91 -0
- package/skills/deploy-vercel/SKILL.md +304 -0
- package/skills/deploy-vercel/resources/deploy-codex.sh +301 -0
- package/skills/deploy-vercel/resources/deploy.sh +301 -0
- package/skills/docs-runbooks/SKILL.md +399 -0
- package/skills/drive-status-renderer/SKILL.md +62 -0
- package/skills/iac-scan/SKILL.md +680 -0
- package/skills/iac-scan/assets/.gitkeep +9 -0
- package/skills/iac-scan/assets/checkov_config.yaml +94 -0
- package/skills/iac-scan/assets/github_actions.yml +199 -0
- package/skills/iac-scan/assets/gitlab_ci.yml +218 -0
- package/skills/iac-scan/assets/pre_commit_config.yaml +92 -0
- package/skills/iac-scan/references/EXAMPLE.md +40 -0
- package/skills/iac-scan/references/compliance_mapping.md +237 -0
- package/skills/iac-scan/references/custom_policies.md +460 -0
- package/skills/iac-scan/references/suppression_guide.md +431 -0
- package/skills/incident-briefing/SKILL.md +66 -0
- package/skills/incident-triage/SKILL.md +481 -0
- package/{LICENSE → skills/mcp-builder/LICENSE.txt} +15 -14
- package/skills/mcp-builder/SKILL.md +244 -0
- package/skills/mcp-builder/reference/evaluation.md +602 -0
- package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
- package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
- package/skills/mcp-builder/scripts/connections.py +151 -0
- package/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/skills/mobile-pairing/SKILL.md +52 -0
- package/skills/ops-sre/SKILL.md +297 -0
- package/skills/playwright-qa/LICENSE.txt +201 -0
- package/skills/playwright-qa/NOTICE.txt +14 -0
- package/skills/playwright-qa/SKILL.md +156 -0
- package/skills/playwright-qa/agents/openai.yaml +6 -0
- package/skills/playwright-qa/assets/playwright-small.svg +3 -0
- package/skills/playwright-qa/assets/playwright.png +0 -0
- package/skills/playwright-qa/references/cli.md +116 -0
- package/skills/playwright-qa/references/workflows.md +95 -0
- package/skills/playwright-qa/scripts/playwright_cli.sh +25 -0
- package/skills/release-publish/SKILL.md +85 -0
- package/skills/repo-bootstrap/SKILL.md +92 -0
- package/skills/repo-bootstrap/assets/example-workflows/validate-agents.yml +89 -0
- package/skills/repo-bootstrap/assets/root-thin.md +141 -0
- package/skills/repo-bootstrap/assets/root-verbose.md +149 -0
- package/skills/repo-bootstrap/assets/scoped/backend-go.md +107 -0
- package/skills/repo-bootstrap/assets/scoped/backend-php.md +94 -0
- package/skills/repo-bootstrap/assets/scoped/backend-python.md +84 -0
- package/skills/repo-bootstrap/assets/scoped/backend-typescript.md +89 -0
- package/skills/repo-bootstrap/assets/scoped/claude-code-skill.md +101 -0
- package/skills/repo-bootstrap/assets/scoped/cli.md +83 -0
- package/skills/repo-bootstrap/assets/scoped/concourse.md +196 -0
- package/skills/repo-bootstrap/assets/scoped/ddev.md +68 -0
- package/skills/repo-bootstrap/assets/scoped/docker.md +160 -0
- package/skills/repo-bootstrap/assets/scoped/documentation.md +98 -0
- package/skills/repo-bootstrap/assets/scoped/examples.md +96 -0
- package/skills/repo-bootstrap/assets/scoped/frontend-typescript.md +88 -0
- package/skills/repo-bootstrap/assets/scoped/github-actions.md +174 -0
- package/skills/repo-bootstrap/assets/scoped/gitlab-ci.md +174 -0
- package/skills/repo-bootstrap/assets/scoped/oro-bundle.md +209 -0
- package/skills/repo-bootstrap/assets/scoped/oro-project.md +170 -0
- package/skills/repo-bootstrap/assets/scoped/python-modern.md +170 -0
- package/skills/repo-bootstrap/assets/scoped/resources.md +96 -0
- package/skills/repo-bootstrap/assets/scoped/skill-repo.md +139 -0
- package/skills/repo-bootstrap/assets/scoped/symfony.md +168 -0
- package/skills/repo-bootstrap/assets/scoped/testing.md +87 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-docs.md +103 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-extension.md +133 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-project.md +137 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-testing.md +80 -0
- package/skills/repo-bootstrap/checkpoints.yaml +279 -0
- package/skills/repo-bootstrap/evals/evals.json +385 -0
- package/skills/repo-bootstrap/references/ai-contribution-guidelines.md +63 -0
- package/skills/repo-bootstrap/references/ai-tool-compatibility.md +223 -0
- package/skills/repo-bootstrap/references/directory-coverage.md +82 -0
- package/skills/repo-bootstrap/references/examples/coding-agent-cli/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/coding-agent-cli/go.mod +3 -0
- package/skills/repo-bootstrap/references/examples/coding-agent-cli/scripts-AGENTS.md +389 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/.env.example +13 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/AGENTS.md +91 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/package.json +33 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/pnpm-lock.yaml +3 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/AGENTS.md +91 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/config.ts +28 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/controllers/userController.ts +74 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/index.ts +26 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/middleware/errorHandler.ts +45 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/middleware/requestLogger.ts +18 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/routes/health.ts +18 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/routes/users.ts +13 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/utils/errors.ts +40 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/utils/logger.ts +14 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/tsconfig.json +24 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/.env.example +19 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/AGENTS.md +92 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/pyproject.toml +88 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/AGENTS.md +85 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/__init__.py +3 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/config.py +49 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/main.py +66 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/__init__.py +13 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/item.py +43 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/user.py +40 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/__init__.py +5 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/health.py +20 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/items.py +61 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/users.py +55 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/__init__.py +6 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/item_service.py +77 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/user_service.py +69 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/uv.lock +4 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/.scopes +3 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/AGENTS.md +86 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/admin/package.json +20 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/admin/src/App.tsx +5 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/cmd/api/main.go +7 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/go.mod +2 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/main.go +7 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/.scopes +3 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/AGENTS.md +89 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/go.mod +2 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/AGENTS.md +90 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/package.json +17 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/App.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Button.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Footer.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Header.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Sidebar.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/main.go +7 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/package-lock.json +0 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/package.json +12 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/go.mod +3 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/internal-AGENTS.md +371 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/internal-web-AGENTS.md +448 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/.scopes +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/AGENTS.md +91 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/composer.json +8 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/package.json +15 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/pnpm-lock.yaml +0 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/src/Controller.php +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/AGENTS.md +92 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/package.json +26 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/App.tsx +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Button.tsx +10 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Footer.tsx +9 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Header.tsx +9 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/main.tsx +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/tsconfig.json +13 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/AGENTS.md +75 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/package.json +7 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/packages/web/package.json +11 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/packages/web/src/index.ts +11 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/pnpm-lock.yaml +42 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/pnpm-workspace.yaml +2 -0
- package/skills/repo-bootstrap/references/examples/simple-ldap-go/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/simple-ldap-go/examples-AGENTS.md +45 -0
- package/skills/repo-bootstrap/references/examples/simple-ldap-go/go.mod +3 -0
- package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/Classes-AGENTS.md +392 -0
- package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/composer.json +8 -0
- package/skills/repo-bootstrap/references/feedback-memory-schema.md +135 -0
- package/skills/repo-bootstrap/references/git-hooks-setup.md +79 -0
- package/skills/repo-bootstrap/references/output-structure.md +124 -0
- package/skills/repo-bootstrap/references/scripts-guide.md +175 -0
- package/skills/repo-bootstrap/references/verification-guide.md +137 -0
- package/skills/repo-bootstrap/scripts/analyze-git-history.sh +315 -0
- package/skills/repo-bootstrap/scripts/check-freshness.sh +230 -0
- package/skills/repo-bootstrap/scripts/detect-golden-samples.sh +161 -0
- package/skills/repo-bootstrap/scripts/detect-heuristics.sh +93 -0
- package/skills/repo-bootstrap/scripts/detect-project.sh +486 -0
- package/skills/repo-bootstrap/scripts/detect-scopes.sh +330 -0
- package/skills/repo-bootstrap/scripts/detect-utilities.sh +133 -0
- package/skills/repo-bootstrap/scripts/extract-adrs.sh +194 -0
- package/skills/repo-bootstrap/scripts/extract-agent-configs.sh +331 -0
- package/skills/repo-bootstrap/scripts/extract-architecture-rules.sh +522 -0
- package/skills/repo-bootstrap/scripts/extract-ci-commands.sh +385 -0
- package/skills/repo-bootstrap/scripts/extract-ci-rules.sh +384 -0
- package/skills/repo-bootstrap/scripts/extract-commands.sh +358 -0
- package/skills/repo-bootstrap/scripts/extract-documentation.sh +308 -0
- package/skills/repo-bootstrap/scripts/extract-github-rulesets.sh +96 -0
- package/skills/repo-bootstrap/scripts/extract-github-settings.sh +88 -0
- package/skills/repo-bootstrap/scripts/extract-ide-settings.sh +228 -0
- package/skills/repo-bootstrap/scripts/extract-platform-files.sh +290 -0
- package/skills/repo-bootstrap/scripts/extract-quality-configs.sh +442 -0
- package/skills/repo-bootstrap/scripts/generate-agents.sh +2424 -0
- package/skills/repo-bootstrap/scripts/generate-file-map.sh +153 -0
- package/skills/repo-bootstrap/scripts/lib/config-root.sh +211 -0
- package/skills/repo-bootstrap/scripts/lib/summary.sh +244 -0
- package/skills/repo-bootstrap/scripts/lib/template.sh +397 -0
- package/skills/repo-bootstrap/scripts/validate-structure.sh +324 -0
- package/skills/repo-bootstrap/scripts/verify-commands.sh +615 -0
- package/skills/repo-bootstrap/scripts/verify-content.sh +302 -0
- package/skills/schema-api-contracts/SKILL.md +56 -0
- package/skills/secret-hygiene/SKILL.md +511 -0
- package/skills/secret-hygiene/assets/.gitkeep +9 -0
- package/skills/secret-hygiene/assets/config-balanced.toml +81 -0
- package/skills/secret-hygiene/assets/config-custom.toml +178 -0
- package/skills/secret-hygiene/assets/config-strict.toml +48 -0
- package/skills/secret-hygiene/assets/github-action.yml +181 -0
- package/skills/secret-hygiene/assets/gitlab-ci.yml +257 -0
- package/skills/secret-hygiene/assets/precommit-config.yaml +70 -0
- package/skills/secret-hygiene/references/EXAMPLE.md +40 -0
- package/skills/secret-hygiene/references/compliance_mapping.md +538 -0
- package/skills/secret-hygiene/references/detection_rules.md +276 -0
- package/skills/secret-hygiene/references/false_positives.md +598 -0
- package/skills/secret-hygiene/references/remediation_guide.md +530 -0
- package/skills/stack-selector/SKILL.md +56 -0
- package/skills/telegram-control/SKILL.md +110 -0
- package/skills/telegram-control/references/architecture.md +184 -0
- package/skills/telegram-control/references/convex.md +173 -0
- package/skills/telegram-control/references/error_handling.md +212 -0
- package/skills/telegram-control/references/initial_setup.md +165 -0
- package/skills/telegram-control/references/telegram_api.md +156 -0
- package/skills/telegram-control/scripts/cancel_message.ts +53 -0
- package/skills/telegram-control/scripts/list_scheduled.ts +103 -0
- package/skills/telegram-control/scripts/logger.ts +121 -0
- package/skills/telegram-control/scripts/proxy-util.ts +11 -0
- package/skills/telegram-control/scripts/schedule_message.ts +216 -0
- package/skills/telegram-control/scripts/send_message.ts +115 -0
- package/skills/telegram-control/scripts/setup.ts +185 -0
- package/skills/telegram-control/scripts/types.ts +75 -0
- package/skills/telegram-control/scripts/view_history.ts +74 -0
- package/skills/test-strategy/SKILL.md +352 -0
- package/skills/threat-model/SKILL.md +303 -0
- package/skills/threat-model/examples/example-output.md +196 -0
- package/skills/threat-model/template.md +96 -0
- package/skills/ts-lint/SKILL.md +80 -0
- package/skills/ui-flow/SKILL.md +668 -0
- package/skills/voice-command-router/SKILL.md +51 -0
- package/skills/widget-live-activity-sync/SKILL.md +66 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# StatefulSet Patterns -- Stateful Workloads
|
|
2
|
+
|
|
3
|
+
**Load this reference when generating:** StatefulSet, headless Service, PersistentVolumeClaim (stateful apps), VolumeSnapshot, or any workload requiring stable identity or persistent storage.
|
|
4
|
+
|
|
5
|
+
## When to Use a StatefulSet
|
|
6
|
+
When pods need: **stable network identity** (predictable DNS per pod), **stable per-pod storage** (PVC follows the pod across reschedules), or **ordered deployment** (sequential create/delete). Common: PostgreSQL, MySQL, Kafka, RabbitMQ, etcd, ZooKeeper, Redis Sentinel, Cassandra.
|
|
7
|
+
|
|
8
|
+
## StatefulSet vs Deployment
|
|
9
|
+
| Concern | Deployment | StatefulSet |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Pod identity | Random suffix, interchangeable | Ordinal index, stable hostname |
|
|
12
|
+
| Storage | Shared PVC or none | Per-pod PVC via volumeClaimTemplates |
|
|
13
|
+
| Scaling | All pods equal | Ordered creation/deletion |
|
|
14
|
+
| DNS | Via Service only | Per-pod DNS via headless Service |
|
|
15
|
+
|
|
16
|
+
**Anti-pattern:** Using StatefulSet when a Deployment + single PVC (RWX) or external database suffices. If you only need storage (not per-pod identity), a Deployment with a PVC is simpler.
|
|
17
|
+
|
|
18
|
+
## Stable Network Identity
|
|
19
|
+
A headless Service (`clusterIP: None`) is **required**. It creates per-pod DNS: `<pod>.<headless-svc>.<ns>.svc.cluster.local`. Example: `postgres-0.postgres-headless.database.svc.cluster.local`.
|
|
20
|
+
|
|
21
|
+
## volumeClaimTemplates
|
|
22
|
+
Creates one PVC per pod. PVCs are **never auto-deleted** on scale-down (protects data).
|
|
23
|
+
- **StorageClass**: verify it matches durability needs. Never rely on the default class in prod.
|
|
24
|
+
- **Access mode**: `ReadWriteOnce` for databases. `ReadWriteOncePod` (1.27+ GA) for stricter guarantees.
|
|
25
|
+
- **Size**: plan for growth. PVCs can expand (if `allowVolumeExpansion: true`) but never shrink.
|
|
26
|
+
|
|
27
|
+
## Pod Management Policy
|
|
28
|
+
- `OrderedReady` (default): sequential 0, 1, 2... each must be Ready before next starts. Use for consensus systems.
|
|
29
|
+
- `Parallel`: all pods launch simultaneously. Use when pods initialize independently (Cassandra).
|
|
30
|
+
|
|
31
|
+
## Update Strategy
|
|
32
|
+
- **RollingUpdate**: reverse ordinal order. Set `partition` for canary -- pods >= partition get the new version.
|
|
33
|
+
- **OnDelete**: manual control. Pods update only when you delete them. Use for databases needing careful upgrade sequencing.
|
|
34
|
+
|
|
35
|
+
## Backup and Restore
|
|
36
|
+
- **VolumeSnapshot**: CSI snapshots for point-in-time backups. Automate with CronJobs or Velero.
|
|
37
|
+
- **Application-level**: always run logical backups (pg_dump, mysqldump) alongside snapshots -- snapshots alone can be crash-inconsistent.
|
|
38
|
+
- Test restores regularly. A backup never restored is not a backup.
|
|
39
|
+
|
|
40
|
+
## Example: PostgreSQL StatefulSet
|
|
41
|
+
```yaml
|
|
42
|
+
apiVersion: v1
|
|
43
|
+
kind: Service
|
|
44
|
+
metadata:
|
|
45
|
+
name: postgres-headless
|
|
46
|
+
spec:
|
|
47
|
+
clusterIP: None
|
|
48
|
+
selector: { app.kubernetes.io/name: postgres, app.kubernetes.io/component: database }
|
|
49
|
+
ports: [{ port: 5432, targetPort: 5432, protocol: TCP }]
|
|
50
|
+
---
|
|
51
|
+
apiVersion: apps/v1
|
|
52
|
+
kind: StatefulSet
|
|
53
|
+
metadata:
|
|
54
|
+
name: postgres
|
|
55
|
+
labels: { app.kubernetes.io/name: postgres, app.kubernetes.io/component: database }
|
|
56
|
+
spec:
|
|
57
|
+
serviceName: postgres-headless
|
|
58
|
+
replicas: 3
|
|
59
|
+
podManagementPolicy: OrderedReady
|
|
60
|
+
updateStrategy: { type: RollingUpdate, rollingUpdate: { partition: 0 } }
|
|
61
|
+
selector:
|
|
62
|
+
matchLabels: { app.kubernetes.io/name: postgres, app.kubernetes.io/component: database }
|
|
63
|
+
template:
|
|
64
|
+
metadata:
|
|
65
|
+
labels: { app.kubernetes.io/name: postgres, app.kubernetes.io/component: database }
|
|
66
|
+
spec:
|
|
67
|
+
securityContext:
|
|
68
|
+
runAsNonRoot: true
|
|
69
|
+
runAsUser: 999
|
|
70
|
+
runAsGroup: 999
|
|
71
|
+
fsGroup: 999
|
|
72
|
+
seccompProfile: { type: RuntimeDefault }
|
|
73
|
+
terminationGracePeriodSeconds: 120
|
|
74
|
+
containers:
|
|
75
|
+
- name: postgres
|
|
76
|
+
image: postgres:16.2-bookworm
|
|
77
|
+
ports: [{ containerPort: 5432, protocol: TCP }]
|
|
78
|
+
env:
|
|
79
|
+
- { name: PGDATA, value: /var/lib/postgresql/data/pgdata }
|
|
80
|
+
- name: POSTGRES_PASSWORD
|
|
81
|
+
valueFrom:
|
|
82
|
+
secretKeyRef: { name: postgres-credentials, key: password }
|
|
83
|
+
resources:
|
|
84
|
+
requests: { cpu: 500m, memory: 1Gi }
|
|
85
|
+
limits: { cpu: "2", memory: 2Gi }
|
|
86
|
+
securityContext:
|
|
87
|
+
allowPrivilegeEscalation: false
|
|
88
|
+
readOnlyRootFilesystem: true
|
|
89
|
+
capabilities: { drop: ["ALL"] }
|
|
90
|
+
readinessProbe:
|
|
91
|
+
exec: { command: ["pg_isready", "-U", "postgres"] }
|
|
92
|
+
initialDelaySeconds: 10
|
|
93
|
+
periodSeconds: 10
|
|
94
|
+
livenessProbe:
|
|
95
|
+
exec: { command: ["pg_isready", "-U", "postgres"] }
|
|
96
|
+
initialDelaySeconds: 30
|
|
97
|
+
periodSeconds: 30
|
|
98
|
+
volumeMounts:
|
|
99
|
+
- { name: data, mountPath: /var/lib/postgresql/data }
|
|
100
|
+
- { name: tmp, mountPath: /tmp }
|
|
101
|
+
- { name: run, mountPath: /var/run/postgresql }
|
|
102
|
+
volumes:
|
|
103
|
+
- { name: tmp, emptyDir: {} }
|
|
104
|
+
- { name: run, emptyDir: {} }
|
|
105
|
+
volumeClaimTemplates:
|
|
106
|
+
- metadata: { name: data }
|
|
107
|
+
spec:
|
|
108
|
+
accessModes: ["ReadWriteOnce"]
|
|
109
|
+
storageClassName: gp3-encrypted
|
|
110
|
+
resources: { requests: { storage: 50Gi } }
|
|
111
|
+
---
|
|
112
|
+
apiVersion: policy/v1
|
|
113
|
+
kind: PodDisruptionBudget
|
|
114
|
+
metadata:
|
|
115
|
+
name: postgres
|
|
116
|
+
spec:
|
|
117
|
+
maxUnavailable: 1
|
|
118
|
+
selector:
|
|
119
|
+
matchLabels: { app.kubernetes.io/name: postgres, app.kubernetes.io/component: database }
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## LLM Mistake Checklist
|
|
123
|
+
1. **Missing headless Service.** StatefulSet requires `clusterIP: None`. Without it, pods get no stable DNS and `serviceName` validation fails.
|
|
124
|
+
2. **Forgetting `serviceName`.** Must match the headless Service name exactly. Omitting it is an API error.
|
|
125
|
+
3. **volumeClaimTemplates nested under `template.spec`.** It is a peer of `template`, not inside it.
|
|
126
|
+
4. **Expecting PVCs deleted on scale-down.** They are retained intentionally. Delete manually or set `persistentVolumeClaimRetentionPolicy` (1.27+).
|
|
127
|
+
5. **ReadWriteMany for single-node databases.** Use `ReadWriteOnce` or `ReadWriteOncePod`. RWX adds complexity and is rarely supported by performant storage.
|
|
128
|
+
6. **Low terminationGracePeriodSeconds.** Default 30s is insufficient for databases. Set 60-120s for clean shutdown.
|
|
129
|
+
7. **Omitting PGDATA subdirectory.** PostgreSQL needs the data dir as a subdirectory of the mount (e.g., `.../data/pgdata`) because the mount root may contain `lost+found`.
|
|
130
|
+
8. **No PodDisruptionBudget.** Stateful workloads are disruption-sensitive. Always create a PDB with `maxUnavailable: 1`.
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# Storage and State
|
|
2
|
+
|
|
3
|
+
**Directive:** When generating or reviewing any workload that persists data, ALWAYS configure StorageClass, PVC sizing, access modes, and reclaim policies correctly. Data loss from misconfigured storage is irreversible. Default security posture is PSS "restricted" profile.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
Consult this reference whenever the task involves:
|
|
8
|
+
- Any workload with persistent data (databases, file storage, caches)
|
|
9
|
+
- Creating or modifying PersistentVolumeClaims or StorageClasses
|
|
10
|
+
- Configuring StatefulSet volumeClaimTemplates
|
|
11
|
+
- Volume snapshots, backup/restore, or data migration
|
|
12
|
+
- Choosing between ephemeral and persistent storage
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## PersistentVolume and PersistentVolumeClaim Model
|
|
17
|
+
|
|
18
|
+
- **PersistentVolume (PV):** A piece of storage provisioned in the cluster, either manually or dynamically.
|
|
19
|
+
- **PersistentVolumeClaim (PVC):** A request for storage by a workload. Binds to a PV that satisfies its requirements.
|
|
20
|
+
- **Dynamic provisioning** is the default and preferred approach. Manual PV creation is only needed for pre-existing storage (NFS shares, existing cloud disks).
|
|
21
|
+
|
|
22
|
+
The binding flow: PVC specifies `storageClassName`, size, and access mode. The provisioner for that StorageClass creates a PV automatically and binds it to the PVC.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## StorageClass Configuration
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
apiVersion: storage.k8s.io/v1
|
|
30
|
+
kind: StorageClass
|
|
31
|
+
metadata:
|
|
32
|
+
name: fast-retain
|
|
33
|
+
provisioner: ebs.csi.aws.com # or pd.csi.storage.gke.io, disk.csi.azure.com
|
|
34
|
+
parameters:
|
|
35
|
+
type: gp3 # cloud-specific volume type
|
|
36
|
+
encrypted: "true"
|
|
37
|
+
reclaimPolicy: Retain # CRITICAL for production data
|
|
38
|
+
volumeBindingMode: WaitForFirstConsumer # bind PV only when a pod needs it
|
|
39
|
+
allowVolumeExpansion: true # allow PVC resize without recreation
|
|
40
|
+
mountOptions:
|
|
41
|
+
- noatime # reduce unnecessary metadata writes
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Key fields:
|
|
45
|
+
|
|
46
|
+
| Field | Production value | Why |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| `reclaimPolicy` | `Retain` | `Delete` (the default!) destroys the underlying volume when the PVC is deleted. Use `Retain` for any data you care about. |
|
|
49
|
+
| `volumeBindingMode` | `WaitForFirstConsumer` | `Immediate` (the default) provisions the volume before a pod is scheduled, which can place the volume in a different availability zone than the pod. `WaitForFirstConsumer` provisions in the same zone as the pod. |
|
|
50
|
+
| `allowVolumeExpansion` | `true` | Without this, you must delete and recreate the PVC to resize -- causing data loss if `reclaimPolicy` is `Delete`. |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Access Modes
|
|
55
|
+
|
|
56
|
+
| Mode | Abbreviation | Meaning | Typical support |
|
|
57
|
+
|---|---|---|---|
|
|
58
|
+
| `ReadWriteOnce` | RWO | One node can mount read-write | All block storage (EBS, PD, Azure Disk) |
|
|
59
|
+
| `ReadOnlyMany` | ROX | Many nodes can mount read-only | NFS, CephFS, cloud file storage |
|
|
60
|
+
| `ReadWriteMany` | RWX | Many nodes can mount read-write | NFS, CephFS, EFS, Azure Files -- NOT block storage |
|
|
61
|
+
| `ReadWriteOncePod` | RWOP | Exactly one pod can mount read-write (k8s 1.29+) | CSI drivers that support it |
|
|
62
|
+
|
|
63
|
+
Common mistake: requesting `ReadWriteMany` with a block storage provisioner (EBS, GCE PD). Block storage is physically attached to one node -- it cannot be RWX. Use a file storage solution for shared access.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Volume Expansion
|
|
68
|
+
|
|
69
|
+
To expand a PVC, the StorageClass must have `allowVolumeExpansion: true`. Then patch the PVC:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
kubectl patch pvc data-postgres-0 -n databases \
|
|
73
|
+
-p '{"spec":{"resources":{"requests":{"storage":"100Gi"}}}}'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
For file systems, expansion happens online. For block storage, some CSI drivers require the pod to be restarted. Always check your CSI driver documentation.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## VolumeSnapshot for Backup and Restore
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
apiVersion: snapshot.storage.k8s.io/v1
|
|
84
|
+
kind: VolumeSnapshot
|
|
85
|
+
metadata:
|
|
86
|
+
name: postgres-snapshot-2025-03-15
|
|
87
|
+
namespace: databases
|
|
88
|
+
spec:
|
|
89
|
+
volumeSnapshotClassName: csi-snapclass
|
|
90
|
+
source:
|
|
91
|
+
persistentVolumeClaimName: data-postgres-0
|
|
92
|
+
---
|
|
93
|
+
# Restore from snapshot into a new PVC
|
|
94
|
+
apiVersion: v1
|
|
95
|
+
kind: PersistentVolumeClaim
|
|
96
|
+
metadata:
|
|
97
|
+
name: data-postgres-restored
|
|
98
|
+
namespace: databases
|
|
99
|
+
spec:
|
|
100
|
+
storageClassName: fast-retain
|
|
101
|
+
dataSource:
|
|
102
|
+
name: postgres-snapshot-2025-03-15
|
|
103
|
+
kind: VolumeSnapshot
|
|
104
|
+
apiGroup: snapshot.storage.k8s.io
|
|
105
|
+
accessModes:
|
|
106
|
+
- ReadWriteOnce
|
|
107
|
+
resources:
|
|
108
|
+
requests:
|
|
109
|
+
storage: 50Gi
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Rule:** Always take a VolumeSnapshot before any destructive operation -- PVC deletion, StorageClass migration, or major application upgrade.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Ephemeral Storage: emptyDir
|
|
117
|
+
|
|
118
|
+
`emptyDir` volumes are tied to the pod lifecycle -- they are deleted when the pod is removed. Use them for scratch space, caches, and temporary files:
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
volumes:
|
|
122
|
+
- name: tmp
|
|
123
|
+
emptyDir:
|
|
124
|
+
sizeLimit: 100Mi # ALWAYS set sizeLimit
|
|
125
|
+
- name: cache
|
|
126
|
+
emptyDir:
|
|
127
|
+
medium: Memory # backed by RAM (tmpfs), counts against memory limits
|
|
128
|
+
sizeLimit: 256Mi
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Critical rule:** ALWAYS set `sizeLimit` on `emptyDir` volumes. Without it, a runaway process can fill the node's disk and cause eviction of all pods on that node.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## CSI Drivers Overview
|
|
136
|
+
|
|
137
|
+
| Environment | Default CSI driver | Notes |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| AWS EKS | `ebs.csi.aws.com` | Block storage (RWO only). Use EFS CSI for RWX. |
|
|
140
|
+
| GKE | `pd.csi.storage.gke.io` | Block storage. Use Filestore CSI for RWX. |
|
|
141
|
+
| Azure AKS | `disk.csi.azure.com` | Block storage. Use `file.csi.azure.com` for RWX. |
|
|
142
|
+
| Bare metal | Longhorn, Rook-Ceph, OpenEBS | Longhorn is simplest. Rook-Ceph for production-grade distributed storage. |
|
|
143
|
+
|
|
144
|
+
All major cloud CSI drivers support snapshots, volume expansion, and encryption.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Data Protection Rules
|
|
149
|
+
|
|
150
|
+
1. **Production StorageClass must use `reclaimPolicy: Retain`.** `Delete` is acceptable only for ephemeral environments (CI, preview deploys).
|
|
151
|
+
2. **Take VolumeSnapshots before destructive changes.** PVC deletion, resize, migration.
|
|
152
|
+
3. **Test restore procedures regularly.** A backup you have never restored is not a backup.
|
|
153
|
+
4. **Encrypt volumes at rest.** Use CSI driver `parameters.encrypted: "true"` or cloud provider defaults.
|
|
154
|
+
5. **Use `ReadWriteOncePod` for databases.** Prevents accidental multi-attach that corrupts data.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## StatefulSet volumeClaimTemplates
|
|
159
|
+
|
|
160
|
+
StatefulSets create a PVC per replica automatically. See **stateful-patterns.md** for full StatefulSet configuration:
|
|
161
|
+
|
|
162
|
+
```yaml
|
|
163
|
+
apiVersion: apps/v1
|
|
164
|
+
kind: StatefulSet
|
|
165
|
+
metadata:
|
|
166
|
+
name: postgres
|
|
167
|
+
namespace: databases
|
|
168
|
+
spec:
|
|
169
|
+
serviceName: postgres
|
|
170
|
+
replicas: 3
|
|
171
|
+
selector:
|
|
172
|
+
matchLabels:
|
|
173
|
+
app: postgres
|
|
174
|
+
volumeClaimTemplates:
|
|
175
|
+
- metadata:
|
|
176
|
+
name: data
|
|
177
|
+
spec:
|
|
178
|
+
storageClassName: fast-retain
|
|
179
|
+
accessModes: ["ReadWriteOnce"]
|
|
180
|
+
resources:
|
|
181
|
+
requests:
|
|
182
|
+
storage: 50Gi
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
This creates PVCs named `data-postgres-0`, `data-postgres-1`, `data-postgres-2`. PVCs created by `volumeClaimTemplates` are NOT deleted when the StatefulSet is deleted -- this is intentional to protect data.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## GOOD: StorageClass + PVC + Deployment
|
|
190
|
+
|
|
191
|
+
```yaml
|
|
192
|
+
apiVersion: storage.k8s.io/v1
|
|
193
|
+
kind: StorageClass
|
|
194
|
+
metadata:
|
|
195
|
+
name: standard-retain
|
|
196
|
+
provisioner: ebs.csi.aws.com
|
|
197
|
+
parameters:
|
|
198
|
+
type: gp3
|
|
199
|
+
encrypted: "true"
|
|
200
|
+
reclaimPolicy: Retain
|
|
201
|
+
volumeBindingMode: WaitForFirstConsumer
|
|
202
|
+
allowVolumeExpansion: true
|
|
203
|
+
---
|
|
204
|
+
apiVersion: v1
|
|
205
|
+
kind: PersistentVolumeClaim
|
|
206
|
+
metadata:
|
|
207
|
+
name: app-data
|
|
208
|
+
namespace: production
|
|
209
|
+
spec:
|
|
210
|
+
storageClassName: standard-retain
|
|
211
|
+
accessModes:
|
|
212
|
+
- ReadWriteOnce
|
|
213
|
+
resources:
|
|
214
|
+
requests:
|
|
215
|
+
storage: 20Gi
|
|
216
|
+
---
|
|
217
|
+
apiVersion: apps/v1
|
|
218
|
+
kind: Deployment
|
|
219
|
+
metadata:
|
|
220
|
+
name: file-processor
|
|
221
|
+
namespace: production
|
|
222
|
+
spec:
|
|
223
|
+
replicas: 1 # RWO -- single replica only
|
|
224
|
+
selector:
|
|
225
|
+
matchLabels:
|
|
226
|
+
app: file-processor
|
|
227
|
+
template:
|
|
228
|
+
metadata:
|
|
229
|
+
labels:
|
|
230
|
+
app: file-processor
|
|
231
|
+
spec:
|
|
232
|
+
automountServiceAccountToken: false
|
|
233
|
+
securityContext:
|
|
234
|
+
runAsNonRoot: true
|
|
235
|
+
runAsUser: 10000
|
|
236
|
+
runAsGroup: 10000
|
|
237
|
+
fsGroup: 10000 # ensures mounted volume is writable by this GID
|
|
238
|
+
seccompProfile:
|
|
239
|
+
type: RuntimeDefault
|
|
240
|
+
containers:
|
|
241
|
+
- name: processor
|
|
242
|
+
image: registry.example.com/file-processor:v2.1.0
|
|
243
|
+
securityContext:
|
|
244
|
+
allowPrivilegeEscalation: false
|
|
245
|
+
readOnlyRootFilesystem: true
|
|
246
|
+
capabilities:
|
|
247
|
+
drop: ["ALL"]
|
|
248
|
+
volumeMounts:
|
|
249
|
+
- name: data
|
|
250
|
+
mountPath: /data
|
|
251
|
+
- name: tmp
|
|
252
|
+
mountPath: /tmp
|
|
253
|
+
resources:
|
|
254
|
+
requests:
|
|
255
|
+
cpu: 200m
|
|
256
|
+
memory: 256Mi
|
|
257
|
+
limits:
|
|
258
|
+
memory: 512Mi
|
|
259
|
+
volumes:
|
|
260
|
+
- name: data
|
|
261
|
+
persistentVolumeClaim:
|
|
262
|
+
claimName: app-data
|
|
263
|
+
- name: tmp
|
|
264
|
+
emptyDir:
|
|
265
|
+
sizeLimit: 100Mi
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## BAD: Common Storage Mistakes
|
|
269
|
+
|
|
270
|
+
```yaml
|
|
271
|
+
# PROBLEMATIC - DO NOT USE
|
|
272
|
+
apiVersion: v1
|
|
273
|
+
kind: PersistentVolumeClaim
|
|
274
|
+
metadata:
|
|
275
|
+
name: shared-data
|
|
276
|
+
spec:
|
|
277
|
+
# no storageClassName -- uses cluster default, which likely has reclaimPolicy: Delete
|
|
278
|
+
accessModes:
|
|
279
|
+
- ReadWriteMany # block storage CSI does not support RWX -- PVC stays Pending
|
|
280
|
+
resources:
|
|
281
|
+
requests:
|
|
282
|
+
storage: 10Gi
|
|
283
|
+
---
|
|
284
|
+
apiVersion: apps/v1
|
|
285
|
+
kind: Deployment
|
|
286
|
+
metadata:
|
|
287
|
+
name: app
|
|
288
|
+
spec:
|
|
289
|
+
replicas: 3
|
|
290
|
+
selector:
|
|
291
|
+
matchLabels:
|
|
292
|
+
app: myapp
|
|
293
|
+
template:
|
|
294
|
+
metadata:
|
|
295
|
+
labels:
|
|
296
|
+
app: myapp
|
|
297
|
+
spec:
|
|
298
|
+
containers:
|
|
299
|
+
- name: app
|
|
300
|
+
image: myapp:latest
|
|
301
|
+
volumeMounts:
|
|
302
|
+
- name: data
|
|
303
|
+
mountPath: /data
|
|
304
|
+
- name: scratch
|
|
305
|
+
mountPath: /tmp
|
|
306
|
+
# no securityContext, no resources
|
|
307
|
+
volumes:
|
|
308
|
+
- name: data
|
|
309
|
+
persistentVolumeClaim:
|
|
310
|
+
claimName: shared-data
|
|
311
|
+
- name: scratch
|
|
312
|
+
emptyDir: {} # no sizeLimit -- can fill the node disk
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Problems: no explicit StorageClass (defaults to Delete reclaim), RWX on block storage (will never bind), no `sizeLimit` on `emptyDir`, no `fsGroup` (mounted volume may not be writable by the non-root user), `:latest` image tag.
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## LLM Mistake Checklist
|
|
320
|
+
|
|
321
|
+
Before finalizing any storage-related manifest, verify each item:
|
|
322
|
+
|
|
323
|
+
- [ ] **StorageClass `reclaimPolicy`** is `Retain` for production -- not the default `Delete`.
|
|
324
|
+
- [ ] **`volumeBindingMode: WaitForFirstConsumer`** is set to avoid cross-zone volume/pod mismatch.
|
|
325
|
+
- [ ] **Access mode matches the CSI driver** -- do not request `ReadWriteMany` from block storage.
|
|
326
|
+
- [ ] **`allowVolumeExpansion: true`** is set on the StorageClass to allow future resizing.
|
|
327
|
+
- [ ] **`emptyDir` volumes have `sizeLimit`** set -- an unbounded emptyDir can evict all pods on the node.
|
|
328
|
+
- [ ] **`fsGroup`** is set in the pod security context so the non-root user can write to mounted volumes.
|
|
329
|
+
- [ ] **VolumeSnapshot** is taken before any destructive operation (PVC deletion, migration).
|
|
330
|
+
- [ ] **Deployment replicas match access mode** -- do not set `replicas > 1` with `ReadWriteOnce` PVCs unless using `ReadWriteOncePod` or StatefulSet per-replica volumes.
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Validation and Policy Enforcement
|
|
2
|
+
|
|
3
|
+
> When validating Kubernetes manifests, enforcing policies, or integrating checks
|
|
4
|
+
> into CI pipelines, follow these patterns. Default security posture is PSS
|
|
5
|
+
> "restricted" profile.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Validation Layers
|
|
10
|
+
|
|
11
|
+
Apply in order, each catches different classes of errors:
|
|
12
|
+
|
|
13
|
+
1. **Client-side schema validation** (kubeconform/kubeval) -- catches structural YAML errors, unknown fields, wrong types.
|
|
14
|
+
2. **Policy enforcement** (Kyverno/OPA Gatekeeper) -- catches organizational rule violations.
|
|
15
|
+
3. **Server-side dry-run** (kubectl --dry-run=server) -- catches admission webhook rejections, quota violations, naming conflicts.
|
|
16
|
+
|
|
17
|
+
## kubeconform
|
|
18
|
+
|
|
19
|
+
Fast, offline schema validation against specific Kubernetes versions.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Validate all manifests against K8s 1.29
|
|
23
|
+
kubeconform \
|
|
24
|
+
-kubernetes-version 1.29.0 \
|
|
25
|
+
-strict \
|
|
26
|
+
-summary \
|
|
27
|
+
-output json \
|
|
28
|
+
manifests/
|
|
29
|
+
|
|
30
|
+
# With CRD schema support (e.g., for Prometheus Operator)
|
|
31
|
+
kubeconform \
|
|
32
|
+
-kubernetes-version 1.29.0 \
|
|
33
|
+
-strict \
|
|
34
|
+
-schema-location default \
|
|
35
|
+
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \
|
|
36
|
+
manifests/
|
|
37
|
+
|
|
38
|
+
# Validate Helm rendered output
|
|
39
|
+
helm template my-release ./chart -f values-prod.yaml | \
|
|
40
|
+
kubeconform -kubernetes-version 1.29.0 -strict
|
|
41
|
+
|
|
42
|
+
# Validate Kustomize rendered output
|
|
43
|
+
kustomize build overlays/production | \
|
|
44
|
+
kubeconform -kubernetes-version 1.29.0 -strict
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- Always use `-strict` to reject unknown fields.
|
|
48
|
+
- Pin `-kubernetes-version` to the target cluster version.
|
|
49
|
+
- Use CRD schema registries for custom resources; without them, CRDs are silently skipped.
|
|
50
|
+
|
|
51
|
+
## kubectl Dry-Run
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Client-side: basic YAML parsing, no server contact
|
|
55
|
+
kubectl apply -f manifest.yaml --dry-run=client
|
|
56
|
+
|
|
57
|
+
# Server-side: full admission chain minus persistence
|
|
58
|
+
kubectl apply -f manifest.yaml --dry-run=server
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- `--dry-run=client` catches only syntax errors. It does not validate against the cluster schema.
|
|
62
|
+
- `--dry-run=server` runs through all admission webhooks and validations. Requires cluster access.
|
|
63
|
+
- Server-side dry-run is the final gate before actual apply.
|
|
64
|
+
|
|
65
|
+
## Kyverno
|
|
66
|
+
|
|
67
|
+
YAML-native policy engine. Policies are Kubernetes resources.
|
|
68
|
+
|
|
69
|
+
### Require Resource Limits
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
apiVersion: kyverno.io/v1
|
|
73
|
+
kind: ClusterPolicy
|
|
74
|
+
metadata:
|
|
75
|
+
name: require-resource-limits
|
|
76
|
+
annotations:
|
|
77
|
+
policies.kyverno.io/title: Require Resource Limits
|
|
78
|
+
policies.kyverno.io/severity: medium
|
|
79
|
+
spec:
|
|
80
|
+
validationFailureAction: Enforce
|
|
81
|
+
background: true
|
|
82
|
+
rules:
|
|
83
|
+
- name: check-limits
|
|
84
|
+
match:
|
|
85
|
+
any:
|
|
86
|
+
- resources:
|
|
87
|
+
kinds:
|
|
88
|
+
- Pod
|
|
89
|
+
validate:
|
|
90
|
+
message: "All containers must have memory and cpu limits."
|
|
91
|
+
pattern:
|
|
92
|
+
spec:
|
|
93
|
+
containers:
|
|
94
|
+
- resources:
|
|
95
|
+
limits:
|
|
96
|
+
memory: "?*"
|
|
97
|
+
cpu: "?*"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Require Standard Labels
|
|
101
|
+
|
|
102
|
+
```yaml
|
|
103
|
+
apiVersion: kyverno.io/v1
|
|
104
|
+
kind: ClusterPolicy
|
|
105
|
+
metadata:
|
|
106
|
+
name: require-labels
|
|
107
|
+
spec:
|
|
108
|
+
validationFailureAction: Enforce
|
|
109
|
+
rules:
|
|
110
|
+
- name: check-labels
|
|
111
|
+
match:
|
|
112
|
+
any:
|
|
113
|
+
- resources:
|
|
114
|
+
kinds:
|
|
115
|
+
- Deployment
|
|
116
|
+
- StatefulSet
|
|
117
|
+
- DaemonSet
|
|
118
|
+
validate:
|
|
119
|
+
message: "Must include app.kubernetes.io/name and app.kubernetes.io/version labels."
|
|
120
|
+
pattern:
|
|
121
|
+
metadata:
|
|
122
|
+
labels:
|
|
123
|
+
app.kubernetes.io/name: "?*"
|
|
124
|
+
app.kubernetes.io/version: "?*"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
- `ClusterPolicy` applies cluster-wide; `Policy` is namespace-scoped.
|
|
128
|
+
- `validationFailureAction: Enforce` blocks non-compliant resources; `Audit` only logs.
|
|
129
|
+
- Kyverno supports validate, mutate, generate, and verifyImages rule types.
|
|
130
|
+
|
|
131
|
+
## OPA Gatekeeper
|
|
132
|
+
|
|
133
|
+
Policy engine using Rego. Uses a two-object model: ConstraintTemplate defines the logic, Constraint applies it.
|
|
134
|
+
|
|
135
|
+
### Disallow Privileged Containers
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
apiVersion: templates.gatekeeper.sh/v1
|
|
139
|
+
kind: ConstraintTemplate
|
|
140
|
+
metadata:
|
|
141
|
+
name: k8sdisallowprivileged
|
|
142
|
+
spec:
|
|
143
|
+
crd:
|
|
144
|
+
spec:
|
|
145
|
+
names:
|
|
146
|
+
kind: K8sDisallowPrivileged
|
|
147
|
+
targets:
|
|
148
|
+
- target: admission.k8s.gatekeeper.sh
|
|
149
|
+
rego: |
|
|
150
|
+
package k8sdisallowprivileged
|
|
151
|
+
violation[{"msg": msg}] {
|
|
152
|
+
container := input.review.object.spec.containers[_]
|
|
153
|
+
container.securityContext.privileged == true
|
|
154
|
+
msg := sprintf("Container '%v' must not be privileged", [container.name])
|
|
155
|
+
}
|
|
156
|
+
violation[{"msg": msg}] {
|
|
157
|
+
container := input.review.object.spec.initContainers[_]
|
|
158
|
+
container.securityContext.privileged == true
|
|
159
|
+
msg := sprintf("Init container '%v' must not be privileged", [container.name])
|
|
160
|
+
}
|
|
161
|
+
---
|
|
162
|
+
apiVersion: constraints.gatekeeper.sh/v1beta1
|
|
163
|
+
kind: K8sDisallowPrivileged
|
|
164
|
+
metadata:
|
|
165
|
+
name: no-privileged-containers
|
|
166
|
+
spec:
|
|
167
|
+
match:
|
|
168
|
+
kinds:
|
|
169
|
+
- apiGroups: [""]
|
|
170
|
+
kinds: ["Pod"]
|
|
171
|
+
parameters: {}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
- ConstraintTemplate defines reusable policy logic in Rego.
|
|
175
|
+
- Constraint instances apply the template with specific match criteria and parameters.
|
|
176
|
+
- Always check both `containers` and `initContainers` in Rego rules.
|
|
177
|
+
|
|
178
|
+
## Polaris
|
|
179
|
+
|
|
180
|
+
Score-based configuration auditing. Good for baseline posture assessment.
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# CLI audit against manifests
|
|
184
|
+
polaris audit --audit-path manifests/ --format pretty
|
|
185
|
+
|
|
186
|
+
# Generate a score for CI gating
|
|
187
|
+
polaris audit --audit-path manifests/ --format score
|
|
188
|
+
# Fails CI if score < threshold (default 0)
|
|
189
|
+
polaris audit --audit-path manifests/ --set-exit-code-on-danger
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## CI Pipeline Integration
|
|
193
|
+
|
|
194
|
+
Run validations in this order:
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
validate (kubeconform) -> lint (helm lint / kustomize build) -> policy-check (kyverno/polaris) -> dry-run (server)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### GitHub Actions Example
|
|
201
|
+
|
|
202
|
+
```yaml
|
|
203
|
+
name: Validate Kubernetes Manifests
|
|
204
|
+
on: [pull_request]
|
|
205
|
+
|
|
206
|
+
jobs:
|
|
207
|
+
validate:
|
|
208
|
+
runs-on: ubuntu-latest
|
|
209
|
+
steps:
|
|
210
|
+
- uses: actions/checkout@v4
|
|
211
|
+
|
|
212
|
+
- name: Install tools
|
|
213
|
+
run: |
|
|
214
|
+
curl -sL https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz | tar xz
|
|
215
|
+
sudo mv kubeconform /usr/local/bin/
|
|
216
|
+
|
|
217
|
+
- name: Render manifests
|
|
218
|
+
run: |
|
|
219
|
+
helm template my-release ./chart -f values-prod.yaml > rendered.yaml
|
|
220
|
+
|
|
221
|
+
- name: Schema validation
|
|
222
|
+
run: |
|
|
223
|
+
kubeconform -kubernetes-version 1.29.0 -strict -summary rendered.yaml
|
|
224
|
+
|
|
225
|
+
- name: Policy check
|
|
226
|
+
uses: kyverno/action-install-cli@v0.2
|
|
227
|
+
with:
|
|
228
|
+
release: "v1.12.0"
|
|
229
|
+
- run: |
|
|
230
|
+
kyverno apply policies/ --resource rendered.yaml
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## LLM Mistake Checklist
|
|
234
|
+
|
|
235
|
+
1. **Used `--dry-run` without `=client` or `=server`** -- bare `--dry-run` is deprecated and defaults to client; always be explicit.
|
|
236
|
+
2. **Forgot CRD schemas in kubeconform** -- custom resources pass validation silently with no schema, hiding errors.
|
|
237
|
+
3. **Kyverno `validationFailureAction: Audit` in production** -- logs violations but does not block them; use `Enforce`.
|
|
238
|
+
4. **Gatekeeper ConstraintTemplate missing `initContainers` check** -- privileged init containers bypass the policy.
|
|
239
|
+
5. **Policy match on `Pod` only** -- misses workloads created by Deployments; match the controller kind or use Kyverno auto-gen.
|
|
240
|
+
6. **kubeconform without `-strict`** -- unknown/misspelled fields pass validation silently.
|
|
241
|
+
7. **Skipped server-side dry-run in CI** -- client-side validation cannot catch webhook rejections or quota violations.
|
|
242
|
+
8. **Policy tested only on `apply`, not on `create`** -- some admission policies behave differently on update vs create operations.
|