@jetrabbits/agentic 0.0.1
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/AGENTS.md +143 -0
- package/README.md +154 -0
- package/agentic +1615 -0
- package/areas/devops/ci-cd/AGENTS.md +48 -0
- package/areas/devops/ci-cd/PROMPTS.md +7 -0
- package/areas/devops/ci-cd/prompts/onboard-repo.md +97 -0
- package/areas/devops/ci-cd/prompts/pipeline-debug.md +103 -0
- package/areas/devops/ci-cd/prompts/release-pipeline.md +115 -0
- package/areas/devops/ci-cd/rules/pipeline-standards.md +33 -0
- package/areas/devops/ci-cd/rules/quality-gates.md +24 -0
- package/areas/devops/ci-cd/rules/supply-chain-security.md +34 -0
- package/areas/devops/ci-cd/skills/artifact-management/SKILL.md +157 -0
- package/areas/devops/ci-cd/skills/build-optimization/SKILL.md +168 -0
- package/areas/devops/ci-cd/skills/github-actions-patterns/SKILL.md +190 -0
- package/areas/devops/ci-cd/skills/gitlab-ci-patterns/SKILL.md +169 -0
- package/areas/devops/ci-cd/skills/pipeline-security/SKILL.md +161 -0
- package/areas/devops/ci-cd/workflows/onboard-repo.md +73 -0
- package/areas/devops/ci-cd/workflows/pipeline-debug.md +66 -0
- package/areas/devops/ci-cd/workflows/release-pipeline.md +115 -0
- package/areas/devops/database-ops/AGENTS.md +47 -0
- package/areas/devops/database-ops/prompts/backup-verify.md +83 -0
- package/areas/devops/database-ops/prompts/db-incident.md +127 -0
- package/areas/devops/database-ops/rules/access-control.md +20 -0
- package/areas/devops/database-ops/rules/backup-policy.md +33 -0
- package/areas/devops/database-ops/rules/migration-runbook.md +32 -0
- package/areas/devops/database-ops/skills/backup-restore/SKILL.md +226 -0
- package/areas/devops/database-ops/skills/db-performance/SKILL.md +205 -0
- package/areas/devops/database-ops/skills/migration-safety/SKILL.md +155 -0
- package/areas/devops/database-ops/skills/postgres-operations/SKILL.md +156 -0
- package/areas/devops/database-ops/skills/redis-operations/SKILL.md +174 -0
- package/areas/devops/database-ops/workflows/backup-verify.md +107 -0
- package/areas/devops/database-ops/workflows/db-incident.md +86 -0
- package/areas/devops/devsecops/AGENTS.md +47 -0
- package/areas/devops/devsecops/prompts/policy-onboard.md +79 -0
- package/areas/devops/devsecops/prompts/security-scan-pipeline.md +131 -0
- package/areas/devops/devsecops/rules/container-security.md +22 -0
- package/areas/devops/devsecops/rules/policy-as-code.md +37 -0
- package/areas/devops/devsecops/rules/shift-left-policy.md +26 -0
- package/areas/devops/devsecops/skills/container-hardening/SKILL.md +146 -0
- package/areas/devops/devsecops/skills/opa-policies/SKILL.md +188 -0
- package/areas/devops/devsecops/skills/sbom-supply-chain/SKILL.md +165 -0
- package/areas/devops/devsecops/skills/secret-detection/SKILL.md +190 -0
- package/areas/devops/devsecops/skills/sigstore-signing/SKILL.md +184 -0
- package/areas/devops/devsecops/workflows/policy-onboard.md +104 -0
- package/areas/devops/devsecops/workflows/security-scan-pipeline.md +155 -0
- package/areas/devops/infrastructure/AGENTS.md +50 -0
- package/areas/devops/infrastructure/prompts/destroy-environment.md +81 -0
- package/areas/devops/infrastructure/prompts/drift-remediation.md +71 -0
- package/areas/devops/infrastructure/prompts/module-development.md +69 -0
- package/areas/devops/infrastructure/prompts/provision-environment.md +121 -0
- package/areas/devops/infrastructure/rules/iac-standards.md +80 -0
- package/areas/devops/infrastructure/rules/immutability.md +28 -0
- package/areas/devops/infrastructure/rules/secret-hygiene.md +53 -0
- package/areas/devops/infrastructure/rules/state-management.md +47 -0
- package/areas/devops/infrastructure/skills/ansible-playbooks/SKILL.md +174 -0
- package/areas/devops/infrastructure/skills/cost-optimization/SKILL.md +177 -0
- package/areas/devops/infrastructure/skills/drift-detection/SKILL.md +178 -0
- package/areas/devops/infrastructure/skills/state-management/SKILL.md +159 -0
- package/areas/devops/infrastructure/skills/terraform-modules/SKILL.md +169 -0
- package/areas/devops/infrastructure/workflows/destroy-environment.md +96 -0
- package/areas/devops/infrastructure/workflows/drift-remediation.md +66 -0
- package/areas/devops/infrastructure/workflows/module-development.md +101 -0
- package/areas/devops/infrastructure/workflows/provision-environment.md +96 -0
- package/areas/devops/kubernetes/AGENTS.md +57 -0
- package/areas/devops/kubernetes/PROMPTS.md +9 -0
- package/areas/devops/kubernetes/prompts/cluster-bootstrap.md +67 -0
- package/areas/devops/kubernetes/prompts/debug-workload.md +91 -0
- package/areas/devops/kubernetes/prompts/onboard-service.md +101 -0
- package/areas/devops/kubernetes/prompts/upgrade-cluster.md +63 -0
- package/areas/devops/kubernetes/rules/cluster-standards.md +51 -0
- package/areas/devops/kubernetes/rules/resource-governance.md +80 -0
- package/areas/devops/kubernetes/rules/upgrade-policy.md +52 -0
- package/areas/devops/kubernetes/rules/workload-security.md +64 -0
- package/areas/devops/kubernetes/skills/cluster-operations/SKILL.md +136 -0
- package/areas/devops/kubernetes/skills/helm-charts/SKILL.md +152 -0
- package/areas/devops/kubernetes/skills/network-policies/SKILL.md +169 -0
- package/areas/devops/kubernetes/skills/pod-troubleshooting/SKILL.md +129 -0
- package/areas/devops/kubernetes/skills/rbac-design/SKILL.md +148 -0
- package/areas/devops/kubernetes/skills/resource-tuning/SKILL.md +156 -0
- package/areas/devops/kubernetes/workflows/cluster-bootstrap.md +194 -0
- package/areas/devops/kubernetes/workflows/debug-workload.md +108 -0
- package/areas/devops/kubernetes/workflows/onboard-service.md +124 -0
- package/areas/devops/kubernetes/workflows/upgrade-cluster.md +165 -0
- package/areas/devops/networking/AGENTS.md +47 -0
- package/areas/devops/networking/prompts/onboard-ingress.md +119 -0
- package/areas/devops/networking/prompts/service-mesh-onboard.md +77 -0
- package/areas/devops/networking/rules/ingress-standards.md +17 -0
- package/areas/devops/networking/rules/network-segmentation.md +24 -0
- package/areas/devops/networking/rules/tls-policy.md +32 -0
- package/areas/devops/networking/skills/dns-management/SKILL.md +169 -0
- package/areas/devops/networking/skills/ingress-patterns/SKILL.md +165 -0
- package/areas/devops/networking/skills/service-mesh/SKILL.md +206 -0
- package/areas/devops/networking/skills/tls-termination/SKILL.md +198 -0
- package/areas/devops/networking/skills/vpc-design/SKILL.md +132 -0
- package/areas/devops/networking/workflows/onboard-ingress.md +64 -0
- package/areas/devops/networking/workflows/service-mesh-onboard.md +122 -0
- package/areas/devops/observability/AGENTS.md +48 -0
- package/areas/devops/observability/prompts/alert-investigation.md +117 -0
- package/areas/devops/observability/prompts/observability-stack-setup.md +99 -0
- package/areas/devops/observability/prompts/onboard-service-monitoring.md +79 -0
- package/areas/devops/observability/rules/alerting-standards.md +36 -0
- package/areas/devops/observability/rules/data-retention.md +19 -0
- package/areas/devops/observability/rules/golden-signals.md +28 -0
- package/areas/devops/observability/skills/distributed-tracing/SKILL.md +149 -0
- package/areas/devops/observability/skills/grafana-dashboards/SKILL.md +201 -0
- package/areas/devops/observability/skills/log-aggregation/SKILL.md +159 -0
- package/areas/devops/observability/skills/prometheus-alertmanager/SKILL.md +188 -0
- package/areas/devops/observability/skills/slo-implementation/SKILL.md +189 -0
- package/areas/devops/observability/workflows/alert-investigation.md +98 -0
- package/areas/devops/observability/workflows/observability-stack-setup.md +156 -0
- package/areas/devops/observability/workflows/onboard-service-monitoring.md +83 -0
- package/areas/devops/sre/AGENTS.md +48 -0
- package/areas/devops/sre/prompts/incident-response.md +129 -0
- package/areas/devops/sre/prompts/postmortem.md +101 -0
- package/areas/devops/sre/prompts/slo-review.md +125 -0
- package/areas/devops/sre/rules/error-budget-policy.md +25 -0
- package/areas/devops/sre/rules/on-call-standards.md +25 -0
- package/areas/devops/sre/rules/slo-policy.md +31 -0
- package/areas/devops/sre/skills/capacity-planning/SKILL.md +162 -0
- package/areas/devops/sre/skills/chaos-engineering/SKILL.md +186 -0
- package/areas/devops/sre/skills/incident-command/SKILL.md +119 -0
- package/areas/devops/sre/skills/postmortem-analysis/SKILL.md +104 -0
- package/areas/devops/sre/skills/slo-sli-design/SKILL.md +145 -0
- package/areas/devops/sre/workflows/incident-response.md +66 -0
- package/areas/devops/sre/workflows/postmortem.md +90 -0
- package/areas/devops/sre/workflows/slo-review.md +95 -0
- package/areas/software/backend/AGENTS.md +59 -0
- package/areas/software/backend/PROMPTS.md +50 -0
- package/areas/software/backend/README.md +48 -0
- package/areas/software/backend/prompts/add-migration.md +93 -0
- package/areas/software/backend/prompts/create-endpoint.md +97 -0
- package/areas/software/backend/prompts/debug-issue.md +87 -0
- package/areas/software/backend/prompts/develop-epic.md +83 -0
- package/areas/software/backend/prompts/develop-feature.md +91 -0
- package/areas/software/backend/prompts/refactor-module.md +79 -0
- package/areas/software/backend/prompts/test-feature.md +89 -0
- package/areas/software/backend/rules/architecture.md +20 -0
- package/areas/software/backend/rules/data_access.md +20 -0
- package/areas/software/backend/rules/security.md +20 -0
- package/areas/software/backend/rules/testing.md +19 -0
- package/areas/software/backend/skills/api-design/SKILL.md +170 -0
- package/areas/software/backend/skills/async-processing/SKILL.md +152 -0
- package/areas/software/backend/skills/database-modeling/SKILL.md +173 -0
- package/areas/software/backend/skills/observability/SKILL.md +162 -0
- package/areas/software/backend/skills/troubleshooting/SKILL.md +139 -0
- package/areas/software/backend/workflows/add-migration.md +79 -0
- package/areas/software/backend/workflows/create-endpoint.md +89 -0
- package/areas/software/backend/workflows/debug-issue.md +77 -0
- package/areas/software/backend/workflows/develop-epic.md +78 -0
- package/areas/software/backend/workflows/develop-feature.md +98 -0
- package/areas/software/backend/workflows/refactor-module.md +73 -0
- package/areas/software/backend/workflows/test-feature.md +67 -0
- package/areas/software/data-engineering/AGENTS.md +59 -0
- package/areas/software/data-engineering/PROMPTS.md +32 -0
- package/areas/software/data-engineering/prompts/backfill-data.md +107 -0
- package/areas/software/data-engineering/prompts/data-quality-incident.md +109 -0
- package/areas/software/data-engineering/prompts/lineage-trace.md +121 -0
- package/areas/software/data-engineering/prompts/new-model.md +117 -0
- package/areas/software/data-engineering/prompts/schema-migration.md +111 -0
- package/areas/software/data-engineering/rules/data-governance.md +11 -0
- package/areas/software/data-engineering/rules/pii-handling.md +19 -0
- package/areas/software/data-engineering/rules/pipeline-integrity.md +11 -0
- package/areas/software/data-engineering/rules/schema-management.md +21 -0
- package/areas/software/data-engineering/skills/data-modeling/SKILL.md +49 -0
- package/areas/software/data-engineering/skills/dbt-patterns/SKILL.md +43 -0
- package/areas/software/data-engineering/skills/lineage-governance/SKILL.md +38 -0
- package/areas/software/data-engineering/skills/orchestration/SKILL.md +35 -0
- package/areas/software/data-engineering/skills/quality-checks/SKILL.md +50 -0
- package/areas/software/data-engineering/skills/sql-optimization/SKILL.md +47 -0
- package/areas/software/data-engineering/skills/streaming-patterns/SKILL.md +48 -0
- package/areas/software/data-engineering/workflows/backfill-data.md +59 -0
- package/areas/software/data-engineering/workflows/data-quality-incident.md +64 -0
- package/areas/software/data-engineering/workflows/lineage-trace.md +56 -0
- package/areas/software/data-engineering/workflows/new-model.md +71 -0
- package/areas/software/data-engineering/workflows/schema-migration.md +67 -0
- package/areas/software/frontend/AGENTS.md +60 -0
- package/areas/software/frontend/PROMPTS.md +32 -0
- package/areas/software/frontend/prompts/a11y-fix.md +75 -0
- package/areas/software/frontend/prompts/bundle-analyze.md +75 -0
- package/areas/software/frontend/prompts/release-prep.md +83 -0
- package/areas/software/frontend/prompts/scaffold-component.md +69 -0
- package/areas/software/frontend/prompts/visual-regression.md +73 -0
- package/areas/software/frontend/rules/accessibility.md +16 -0
- package/areas/software/frontend/rules/architecture.md +29 -0
- package/areas/software/frontend/rules/performance.md +23 -0
- package/areas/software/frontend/rules/quality.md +12 -0
- package/areas/software/frontend/skills/a11y-audit/SKILL.md +61 -0
- package/areas/software/frontend/skills/api-integration/SKILL.md +58 -0
- package/areas/software/frontend/skills/component-design/SKILL.md +171 -0
- package/areas/software/frontend/skills/css-architecture/SKILL.md +146 -0
- package/areas/software/frontend/skills/error-handling/SKILL.md +55 -0
- package/areas/software/frontend/skills/performance-tuning/SKILL.md +58 -0
- package/areas/software/frontend/skills/state-management/SKILL.md +54 -0
- package/areas/software/frontend/skills/testing-patterns/SKILL.md +69 -0
- package/areas/software/frontend/workflows/a11y-fix.md +63 -0
- package/areas/software/frontend/workflows/bundle-analyze.md +56 -0
- package/areas/software/frontend/workflows/release-prep.md +66 -0
- package/areas/software/frontend/workflows/scaffold-component.md +67 -0
- package/areas/software/frontend/workflows/visual-regression.md +65 -0
- package/areas/software/full-stack/AGENTS.md +72 -0
- package/areas/software/full-stack/PROMPTS.md +66 -0
- package/areas/software/full-stack/prompts/backend-project-full-cycle.md +141 -0
- package/areas/software/full-stack/prompts/debug-issue.md +115 -0
- package/areas/software/full-stack/prompts/develop-feature.md +119 -0
- package/areas/software/full-stack/prompts/feature-implementation-flow.md +137 -0
- package/areas/software/full-stack/prompts/testing-ci-pipeline.md +119 -0
- package/areas/software/full-stack/rules/api-design-guide.md +24 -0
- package/areas/software/full-stack/rules/async-concurrency-guide.md +21 -0
- package/areas/software/full-stack/rules/backend-architecture-rule.md +41 -0
- package/areas/software/full-stack/rules/background-jobs-guide.md +20 -0
- package/areas/software/full-stack/rules/code-quality-guide.md +22 -0
- package/areas/software/full-stack/rules/database-access-guide.md +24 -0
- package/areas/software/full-stack/rules/database-migrations-guide.md +24 -0
- package/areas/software/full-stack/rules/domain-models-guide.md +28 -0
- package/areas/software/full-stack/rules/e2e-test-guide.md +18 -0
- package/areas/software/full-stack/rules/env-settings-guide.md +34 -0
- package/areas/software/full-stack/rules/error-handling-guide.md +20 -0
- package/areas/software/full-stack/rules/logging-observability-guide.md +22 -0
- package/areas/software/full-stack/rules/project-guide.md +34 -0
- package/areas/software/full-stack/rules/python-venv-guide.md +23 -0
- package/areas/software/full-stack/rules/security-guide.md +22 -0
- package/areas/software/full-stack/rules/svt-test-guide.md +17 -0
- package/areas/software/full-stack/rules/testing-ci-guide.md +25 -0
- package/areas/software/full-stack/skills/api-design-principles/SKILL.md +125 -0
- package/areas/software/full-stack/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/areas/software/full-stack/skills/api-design-principles/assets/rest-api-template.py +182 -0
- package/areas/software/full-stack/skills/api-design-principles/references/graphql-schema-design.md +583 -0
- package/areas/software/full-stack/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/areas/software/full-stack/skills/api-design-principles/resources/implementation-playbook.md +513 -0
- package/areas/software/full-stack/skills/api-patterns/SKILL.md +81 -0
- package/areas/software/full-stack/skills/api-patterns/api-style.md +42 -0
- package/areas/software/full-stack/skills/api-patterns/auth.md +24 -0
- package/areas/software/full-stack/skills/api-patterns/documentation.md +26 -0
- package/areas/software/full-stack/skills/api-patterns/graphql.md +41 -0
- package/areas/software/full-stack/skills/api-patterns/rate-limiting.md +31 -0
- package/areas/software/full-stack/skills/api-patterns/response.md +37 -0
- package/areas/software/full-stack/skills/api-patterns/rest.md +40 -0
- package/areas/software/full-stack/skills/api-patterns/scripts/api_validator.py +211 -0
- package/areas/software/full-stack/skills/api-patterns/security-testing.md +122 -0
- package/areas/software/full-stack/skills/api-patterns/trpc.md +41 -0
- package/areas/software/full-stack/skills/api-patterns/versioning.md +22 -0
- package/areas/software/full-stack/skills/app-builder/SKILL.md +135 -0
- package/areas/software/full-stack/skills/app-builder/agent-coordination.md +71 -0
- package/areas/software/full-stack/skills/app-builder/feature-building.md +53 -0
- package/areas/software/full-stack/skills/app-builder/project-detection.md +34 -0
- package/areas/software/full-stack/skills/app-builder/scaffolding.md +118 -0
- package/areas/software/full-stack/skills/app-builder/tech-stack.md +40 -0
- package/areas/software/full-stack/skills/app-builder/templates/SKILL.md +39 -0
- package/areas/software/full-stack/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/areas/software/full-stack/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/areas/software/full-stack/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/areas/software/full-stack/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/areas/software/full-stack/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/areas/software/full-stack/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/areas/software/full-stack/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/areas/software/full-stack/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
- package/areas/software/full-stack/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/areas/software/full-stack/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/areas/software/full-stack/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
- package/areas/software/full-stack/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/areas/software/full-stack/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/areas/software/full-stack/skills/backend-developer/SKILL.md +58 -0
- package/areas/software/full-stack/skills/bash-pro/SKILL.md +310 -0
- package/areas/software/full-stack/skills/blackbox-test/SKILL.md +84 -0
- package/areas/software/full-stack/skills/prompt-project-planner/SKILL.md +130 -0
- package/areas/software/full-stack/skills/prompt-project-planner/output.schema.md +68 -0
- package/areas/software/full-stack/skills/prompt-project-planner/questions.md +80 -0
- package/areas/software/full-stack/skills/python-pro/SKILL.md +158 -0
- package/areas/software/full-stack/skills/skill-creator/LICENSE.txt +202 -0
- package/areas/software/full-stack/skills/skill-creator/SKILL.md +356 -0
- package/areas/software/full-stack/skills/skill-creator/references/output-patterns.md +82 -0
- package/areas/software/full-stack/skills/skill-creator/references/workflows.md +28 -0
- package/areas/software/full-stack/skills/skill-creator/scripts/init_skill.py +303 -0
- package/areas/software/full-stack/skills/skill-creator/scripts/package_skill.py +110 -0
- package/areas/software/full-stack/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/areas/software/full-stack/workflows/backend-project-full-cycle.md +132 -0
- package/areas/software/full-stack/workflows/debug-issue.md +70 -0
- package/areas/software/full-stack/workflows/develop-feature.md +85 -0
- package/areas/software/full-stack/workflows/feature-implementation-flow.md +78 -0
- package/areas/software/full-stack/workflows/testing-ci-pipeline.md +65 -0
- package/areas/software/general/AGENTS.md +68 -0
- package/areas/software/general/prompts/code-review-workflow.md +87 -0
- package/areas/software/general/prompts/development-cycle-workflow.md +83 -0
- package/areas/software/general/prompts/project-setup-workflow.md +93 -0
- package/areas/software/general/rules/code-style-guide.md +31 -0
- package/areas/software/general/rules/docker-compose-guide.md +27 -0
- package/areas/software/general/rules/git-workflow-guide.md +27 -0
- package/areas/software/general/rules/github-workflow-guide.md +27 -0
- package/areas/software/general/rules/gitlab-ci-guide.md +27 -0
- package/areas/software/general/rules/lint-format-guide.md +29 -0
- package/areas/software/general/rules/makefile-guide.md +34 -0
- package/areas/software/general/rules/readme-sync-guide.md +40 -0
- package/areas/software/general/rules/sdlc-methodology-guide.md +27 -0
- package/areas/software/general/rules/sdlc-role-responsibilities.md +108 -0
- package/areas/software/general/skills/general-dev-tools/SKILL.md +324 -0
- package/areas/software/general/workflows/code-review-workflow.md +84 -0
- package/areas/software/general/workflows/development-cycle-workflow.md +85 -0
- package/areas/software/general/workflows/project-setup-workflow.md +94 -0
- package/areas/software/mlops/AGENTS.md +57 -0
- package/areas/software/mlops/PROMPTS.md +32 -0
- package/areas/software/mlops/prompts/champion-challenger.md +87 -0
- package/areas/software/mlops/prompts/deploy-endpoint.md +91 -0
- package/areas/software/mlops/prompts/evaluate-model.md +87 -0
- package/areas/software/mlops/prompts/model-incident.md +87 -0
- package/areas/software/mlops/prompts/train-experiment.md +83 -0
- package/areas/software/mlops/rules/data-integrity.md +9 -0
- package/areas/software/mlops/rules/model-governance.md +9 -0
- package/areas/software/mlops/rules/production-safety.md +9 -0
- package/areas/software/mlops/rules/reproducibility.md +9 -0
- package/areas/software/mlops/skills/experiment-tracking/SKILL.md +29 -0
- package/areas/software/mlops/skills/feature-engineering/SKILL.md +44 -0
- package/areas/software/mlops/skills/inference-serving/SKILL.md +35 -0
- package/areas/software/mlops/skills/model-evaluation/SKILL.md +40 -0
- package/areas/software/mlops/skills/model-monitoring/SKILL.md +32 -0
- package/areas/software/mlops/workflows/champion-challenger.md +65 -0
- package/areas/software/mlops/workflows/deploy-endpoint.md +70 -0
- package/areas/software/mlops/workflows/evaluate-model.md +63 -0
- package/areas/software/mlops/workflows/model-incident.md +64 -0
- package/areas/software/mlops/workflows/train-experiment.md +56 -0
- package/areas/software/mobile/AGENTS.md +58 -0
- package/areas/software/mobile/PROMPTS.md +32 -0
- package/areas/software/mobile/prompts/crash-triage.md +63 -0
- package/areas/software/mobile/prompts/device-testing.md +83 -0
- package/areas/software/mobile/prompts/ota-update.md +75 -0
- package/areas/software/mobile/prompts/release-build.md +67 -0
- package/areas/software/mobile/prompts/store-submission.md +79 -0
- package/areas/software/mobile/rules/offline-first.md +10 -0
- package/areas/software/mobile/rules/performance-budget.md +20 -0
- package/areas/software/mobile/rules/platform-compliance.md +17 -0
- package/areas/software/mobile/rules/security-mobile.md +9 -0
- package/areas/software/mobile/skills/app-store-prep/SKILL.md +27 -0
- package/areas/software/mobile/skills/mobile-testing/SKILL.md +36 -0
- package/areas/software/mobile/skills/native-modules/SKILL.md +38 -0
- package/areas/software/mobile/skills/navigation-patterns/SKILL.md +49 -0
- package/areas/software/mobile/skills/push-notifications/SKILL.md +40 -0
- package/areas/software/mobile/skills/state-sync/SKILL.md +48 -0
- package/areas/software/mobile/workflows/crash-triage.md +63 -0
- package/areas/software/mobile/workflows/device-testing.md +54 -0
- package/areas/software/mobile/workflows/ota-update.md +54 -0
- package/areas/software/mobile/workflows/release-build.md +67 -0
- package/areas/software/mobile/workflows/store-submission.md +63 -0
- package/areas/software/platform/AGENTS.md +67 -0
- package/areas/software/platform/PROMPTS.md +32 -0
- package/areas/software/platform/prompts/cost-audit.md +117 -0
- package/areas/software/platform/prompts/deploy-production.md +109 -0
- package/areas/software/platform/prompts/drift-check.md +107 -0
- package/areas/software/platform/prompts/incident-response.md +121 -0
- package/areas/software/platform/prompts/provision-env.md +113 -0
- package/areas/software/platform/rules/cost-governance.md +11 -0
- package/areas/software/platform/rules/immutability.md +17 -0
- package/areas/software/platform/rules/reliability.md +19 -0
- package/areas/software/platform/rules/security-posture.md +12 -0
- package/areas/software/platform/skills/ci-cd-pipelines/SKILL.md +58 -0
- package/areas/software/platform/skills/incident-response/SKILL.md +41 -0
- package/areas/software/platform/skills/k8s-manifests/SKILL.md +56 -0
- package/areas/software/platform/skills/networking/SKILL.md +44 -0
- package/areas/software/platform/skills/observability-setup/SKILL.md +49 -0
- package/areas/software/platform/skills/secrets-management/SKILL.md +43 -0
- package/areas/software/platform/skills/terraform-patterns/SKILL.md +75 -0
- package/areas/software/platform/workflows/cost-audit.md +61 -0
- package/areas/software/platform/workflows/deploy-production.md +67 -0
- package/areas/software/platform/workflows/drift-check.md +61 -0
- package/areas/software/platform/workflows/incident-response.md +69 -0
- package/areas/software/platform/workflows/provision-env.md +77 -0
- package/areas/software/qa/AGENTS.md +58 -0
- package/areas/software/qa/PROMPTS.md +32 -0
- package/areas/software/qa/prompts/flakiness-investigation.md +61 -0
- package/areas/software/qa/prompts/performance-audit.md +65 -0
- package/areas/software/qa/prompts/regression-suite.md +61 -0
- package/areas/software/qa/prompts/smoke-test.md +65 -0
- package/areas/software/qa/prompts/test-coverage-report.md +61 -0
- package/areas/software/qa/rules/flakiness-policy.md +12 -0
- package/areas/software/qa/rules/quality-gates.md +28 -0
- package/areas/software/qa/rules/test-data.md +9 -0
- package/areas/software/qa/rules/test-strategy.md +11 -0
- package/areas/software/qa/skills/accessibility-testing/SKILL.md +139 -0
- package/areas/software/qa/skills/api-testing/SKILL.md +140 -0
- package/areas/software/qa/skills/e2e-patterns/SKILL.md +152 -0
- package/areas/software/qa/skills/performance-testing/SKILL.md +177 -0
- package/areas/software/qa/skills/test-data-management/SKILL.md +161 -0
- package/areas/software/qa/skills/test-pyramid/SKILL.md +127 -0
- package/areas/software/qa/workflows/flakiness-investigation.md +63 -0
- package/areas/software/qa/workflows/performance-audit.md +59 -0
- package/areas/software/qa/workflows/regression-suite.md +59 -0
- package/areas/software/qa/workflows/smoke-test.md +64 -0
- package/areas/software/qa/workflows/test-coverage-report.md +57 -0
- package/areas/software/security/AGENTS.md +58 -0
- package/areas/software/security/PROMPTS.md +32 -0
- package/areas/software/security/prompts/compliance-report.md +113 -0
- package/areas/software/security/prompts/pen-test-sim.md +113 -0
- package/areas/software/security/prompts/secret-rotation.md +115 -0
- package/areas/software/security/prompts/security-scan.md +91 -0
- package/areas/software/security/prompts/threat-model-review.md +105 -0
- package/areas/software/security/rules/compliance-baseline.md +23 -0
- package/areas/software/security/rules/dependency-policy.md +12 -0
- package/areas/software/security/rules/secrets-policy.md +22 -0
- package/areas/software/security/rules/secure-coding.md +22 -0
- package/areas/software/security/skills/auth-patterns/SKILL.md +42 -0
- package/areas/software/security/skills/crypto-standards/SKILL.md +42 -0
- package/areas/software/security/skills/dependency-audit/SKILL.md +29 -0
- package/areas/software/security/skills/sast-dast-interpretation/SKILL.md +33 -0
- package/areas/software/security/skills/security-headers/SKILL.md +29 -0
- package/areas/software/security/skills/threat-modeling/SKILL.md +36 -0
- package/areas/software/security/workflows/compliance-report.md +57 -0
- package/areas/software/security/workflows/pen-test-sim.md +63 -0
- package/areas/software/security/workflows/secret-rotation.md +67 -0
- package/areas/software/security/workflows/security-scan.md +64 -0
- package/areas/software/security/workflows/threat-model-review.md +62 -0
- package/areas/template/AGENTS-area.tmpl.md +61 -0
- package/areas/template/AGENTS.tmpl.md +67 -0
- package/areas/template/GUIDE.md +102 -0
- package/areas/template/PROMPTS.tmpl.md +29 -0
- package/areas/template/README.md +57 -0
- package/areas/template/README.tmpl.md +51 -0
- package/areas/template/prompt.tmpl.md +101 -0
- package/areas/template/rule.tmpl.md +71 -0
- package/areas/template/skill.tmpl.md +108 -0
- package/areas/template/workflow.tmpl.md +104 -0
- package/bin/agentic.js +24 -0
- package/extensions/antigravity/GEMINI.md +10 -0
- package/extensions/claude/CLAUDE.md +10 -0
- package/extensions/codex/AGENTS.override.md +93 -0
- package/extensions/gemini/GEMINI.md +10 -0
- package/extensions/opencode/agents/designer.md +65 -0
- package/extensions/opencode/agents/developer.md +63 -0
- package/extensions/opencode/agents/devops-engineer.md +69 -0
- package/extensions/opencode/agents/pm.md +61 -0
- package/extensions/opencode/agents/product-owner.md +76 -0
- package/extensions/opencode/agents/qa.md +66 -0
- package/extensions/opencode/agents/team-lead.md +67 -0
- package/extensions/opencode/commands/feature.md +75 -0
- package/extensions/opencode/opencode.json +93 -0
- package/extensions/opencode/plugins/model-checker.json +14 -0
- package/extensions/opencode/plugins/model-checker.ts +279 -0
- package/extensions/opencode/plugins/sound-notification.ts +13 -0
- package/extensions/opencode/plugins/telegram-notification.ts +86 -0
- package/extensions/opencode/skills/code_review_expert/SKILL.md +144 -0
- package/extensions/opencode/skills/design_expert/SKILL.md +42 -0
- package/extensions/opencode/skills/qa_expert/SKILL.md +116 -0
- package/package.json +19 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
workflow: debug-issue
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Prompt: `/debug-issue`
|
|
6
|
+
|
|
7
|
+
Use when: diagnosing a bug in a FastAPI / SQLAlchemy service — from stack trace or symptom through to root cause, fix, and regression test.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Example 1 — Production error with stack trace
|
|
12
|
+
|
|
13
|
+
**EN:**
|
|
14
|
+
```
|
|
15
|
+
/debug-issue
|
|
16
|
+
|
|
17
|
+
Service: order-service (FastAPI + SQLAlchemy async)
|
|
18
|
+
Error: 500 Internal Server Error on POST /api/v1/orders
|
|
19
|
+
Affected users: 100% of users who apply a discount code; 0% for regular checkout
|
|
20
|
+
First seen: 2024-09-13 14:30 UTC (correlates with v2.4.1 deploy at 14:22 UTC)
|
|
21
|
+
Stack trace:
|
|
22
|
+
File "src/services/order_service.py", line 147, in create_order
|
|
23
|
+
total = subtotal - order_data['discount_amount']
|
|
24
|
+
KeyError: 'discount_amount'
|
|
25
|
+
Logs (request_id=req_abc123):
|
|
26
|
+
INFO order.validation_passed user_id=42 discount_code=SUMMER20
|
|
27
|
+
INFO discount.applied code=SUMMER20 amount=15.00
|
|
28
|
+
ERROR order.creation_failed KeyError: 'discount_amount'
|
|
29
|
+
Suspected cause: discount service returns Decimal amount but order_service expects field 'discount_amount';
|
|
30
|
+
PR #204 renamed field from 'discount' to 'discount_amount' in discount-service but order-service not updated
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**RU:**
|
|
34
|
+
```
|
|
35
|
+
/debug-issue
|
|
36
|
+
|
|
37
|
+
Сервис: order-service (FastAPI + SQLAlchemy async)
|
|
38
|
+
Ошибка: 500 Internal Server Error на POST /api/v1/orders
|
|
39
|
+
Затронутые пользователи: 100% пользователей применяющих код скидки; 0% при обычном оформлении
|
|
40
|
+
Первое появление: 2024-09-13 14:30 UTC (совпадает с деплоем v2.4.1 в 14:22 UTC)
|
|
41
|
+
Stack trace:
|
|
42
|
+
File "src/services/order_service.py", line 147, in create_order
|
|
43
|
+
total = subtotal - order_data['discount_amount']
|
|
44
|
+
KeyError: 'discount_amount'
|
|
45
|
+
Логи (request_id=req_abc123):
|
|
46
|
+
INFO order.validation_passed user_id=42 discount_code=SUMMER20
|
|
47
|
+
INFO discount.applied code=SUMMER20 amount=15.00
|
|
48
|
+
ERROR order.creation_failed KeyError: 'discount_amount'
|
|
49
|
+
Предполагаемая причина: discount сервис возвращает Decimal сумму но order-service ожидает поле 'discount_amount';
|
|
50
|
+
PR #204 переименовал поле с 'discount' на 'discount_amount' в discount-service но order-service не обновлён
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Example 2 — Performance regression (no error)
|
|
56
|
+
|
|
57
|
+
**EN:**
|
|
58
|
+
```
|
|
59
|
+
/debug-issue
|
|
60
|
+
|
|
61
|
+
Service: product-service
|
|
62
|
+
Symptom: GET /api/v1/products p99 latency went from 85ms to 4 200ms after migration PR #198
|
|
63
|
+
No errors in logs — just extreme latency
|
|
64
|
+
Migration PR #198 added: products_tags junction table (many-to-many between products and tags)
|
|
65
|
+
Observed: slow queries only when tags are present; products without tags still fast (85ms)
|
|
66
|
+
DB metrics: PostgreSQL CPU 8% (not saturated); query count per request jumped from 3 to ~47
|
|
67
|
+
Diagnosis direction: N+1 query — each product loads its tags in a separate query; need joinedload()
|
|
68
|
+
Reproduce: run EXPLAIN ANALYZE on GET /products with tags; count SELECT statements in a single request
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**RU:**
|
|
72
|
+
```
|
|
73
|
+
/debug-issue
|
|
74
|
+
|
|
75
|
+
Сервис: product-service
|
|
76
|
+
Симптом: p99 задержка GET /api/v1/products выросла с 85ms до 4 200ms после миграции PR #198
|
|
77
|
+
Ошибок в логах нет — только экстремальная задержка
|
|
78
|
+
Миграция PR #198 добавила: junction таблицу products_tags (many-to-many между products и tags)
|
|
79
|
+
Наблюдение: медленные запросы только когда есть теги; продукты без тегов по-прежнему быстрые (85ms)
|
|
80
|
+
Метрики БД: PostgreSQL CPU 8% (не насыщен); количество запросов на запрос выросло с 3 до ~47
|
|
81
|
+
Направление диагностики: N+1 запрос — каждый продукт загружает теги отдельным запросом; нужен joinedload()
|
|
82
|
+
Воспроизвести: запустить EXPLAIN ANALYZE на GET /products с тегами; подсчитать SELECT операторы в одном запросе
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Example 3 — Intermittent / Race condition
|
|
88
|
+
|
|
89
|
+
**EN:**
|
|
90
|
+
```
|
|
91
|
+
/debug-issue
|
|
92
|
+
|
|
93
|
+
Service: payment-service
|
|
94
|
+
Symptom: ~2% of payments marked as FAILED despite Stripe confirming payment succeeded
|
|
95
|
+
Pattern: only happens when user clicks "Pay" twice quickly (double-submit)
|
|
96
|
+
Error log: "IntegrityError: duplicate key value violates unique constraint payments_idempotency_key"
|
|
97
|
+
The payment actually succeeds on first attempt; second attempt raises IntegrityError which is propagated as 500
|
|
98
|
+
Root issue: IntegrityError not caught — should return 200 with existing payment, not 500
|
|
99
|
+
Fix direction: catch IntegrityError on idempotency key collision → query existing payment → return it
|
|
100
|
+
Test: write test that sends two concurrent requests with same idempotency key; verify both return 200 with same payment_id
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**RU:**
|
|
104
|
+
```
|
|
105
|
+
/debug-issue
|
|
106
|
+
|
|
107
|
+
Сервис: payment-service
|
|
108
|
+
Симптом: ~2% платежей помечаются как FAILED несмотря на то что Stripe подтверждает успешную оплату
|
|
109
|
+
Паттерн: происходит только когда пользователь быстро дважды нажимает "Оплатить" (двойная отправка)
|
|
110
|
+
Лог ошибки: "IntegrityError: duplicate key value violates unique constraint payments_idempotency_key"
|
|
111
|
+
Платёж фактически проходит с первой попытки; вторая попытка вызывает IntegrityError которая возвращается как 500
|
|
112
|
+
Корневая проблема: IntegrityError не перехватывается — должен возвращать 200 с существующим платежом, не 500
|
|
113
|
+
Направление исправления: перехватить IntegrityError при коллизии idempotency key → запросить существующий платёж → вернуть его
|
|
114
|
+
Тест: написать тест отправляющий два одновременных запроса с одинаковым idempotency key; убедиться что оба возвращают 200 с одинаковым payment_id
|
|
115
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
workflow: develop-feature
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Prompt: `/develop-feature`
|
|
6
|
+
|
|
7
|
+
Use when: implementing a feature end-to-end in an existing full-stack Python/FastAPI + Next.js project — DB model through API to UI.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Example 1 — Full-stack feature with DB and UI
|
|
12
|
+
|
|
13
|
+
**EN:**
|
|
14
|
+
```
|
|
15
|
+
/develop-feature
|
|
16
|
+
|
|
17
|
+
Feature: "Product wishlists"
|
|
18
|
+
Stack: FastAPI (Python 3.12) + SQLAlchemy async + Next.js (App Router) + Tailwind
|
|
19
|
+
Acceptance criteria:
|
|
20
|
+
- Users can add / remove products from their wishlist (POST/DELETE /api/v1/wishlist/{product_id})
|
|
21
|
+
- GET /api/v1/wishlist returns user's wishlist (paginated, cursor-based)
|
|
22
|
+
- Product detail page shows "Add to wishlist" / "Remove" button (heart icon) — auth required to use
|
|
23
|
+
- Wishlist page (/wishlist) lists all saved products with thumbnail, name, price
|
|
24
|
+
- Wishlist count shown in navigation header (badge)
|
|
25
|
+
DB changes: create wishlist_items table (user_id, product_id, created_at); unique constraint
|
|
26
|
+
Constraints: wishlist is user-scoped (cannot see others'); limit 500 items per user
|
|
27
|
+
Tests: service unit tests (add duplicate = 409, over limit = 400) + API integration + E2E (add → see on page)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**RU:**
|
|
31
|
+
```
|
|
32
|
+
/develop-feature
|
|
33
|
+
|
|
34
|
+
Фича: "Списки желаний продуктов"
|
|
35
|
+
Стек: FastAPI (Python 3.12) + SQLAlchemy async + Next.js (App Router) + Tailwind
|
|
36
|
+
Критерии приёмки:
|
|
37
|
+
- Пользователи могут добавлять / удалять продукты из списка желаний (POST/DELETE /api/v1/wishlist/{product_id})
|
|
38
|
+
- GET /api/v1/wishlist возвращает список желаний пользователя (пагинация, cursor-based)
|
|
39
|
+
- Страница продукта показывает кнопку "Добавить в список желаний" / "Убрать" (иконка сердца) — для использования требуется auth
|
|
40
|
+
- Страница /wishlist перечисляет все сохранённые продукты с миниатюрой, названием, ценой
|
|
41
|
+
- Количество в списке желаний отображается в навигационном заголовке (badge)
|
|
42
|
+
Изменения БД: создать таблицу wishlist_items (user_id, product_id, created_at); уникальное ограничение
|
|
43
|
+
Ограничения: список желаний привязан к пользователю (нельзя видеть чужие); лимит 500 позиций на пользователя
|
|
44
|
+
Тесты: unit тесты сервиса (добавить дубликат = 409, превышение лимита = 400) + API интеграция + E2E (добавить → увидеть на странице)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Example 2 — API-only feature (no frontend)
|
|
50
|
+
|
|
51
|
+
**EN:**
|
|
52
|
+
```
|
|
53
|
+
/develop-feature
|
|
54
|
+
|
|
55
|
+
Feature: "Bulk order status update (admin API)"
|
|
56
|
+
Stack: FastAPI + SQLAlchemy async (no UI changes)
|
|
57
|
+
Endpoint: PATCH /api/v1/admin/orders/bulk-status
|
|
58
|
+
Auth: admin role required (scope: admin:orders:write)
|
|
59
|
+
Request: { order_ids: list[int] (max 100), status: OrderStatus, reason: str }
|
|
60
|
+
Business rules:
|
|
61
|
+
- All order_ids must belong to the same tenant (400 if mixed tenants)
|
|
62
|
+
- Only allowed transitions: PENDING → PROCESSING, PROCESSING → SHIPPED
|
|
63
|
+
- Invalid transition returns 422 with per-order error detail
|
|
64
|
+
- Successful updates emit OrderStatusChanged event per order
|
|
65
|
+
- Returns: { updated: int, failed: list[{order_id, error}] } (partial success allowed)
|
|
66
|
+
DB: bulk UPDATE with RETURNING; wrap in single transaction (all-or-nothing if any fail: configurable)
|
|
67
|
+
Tests: test partial failure scenario; test tenant isolation; test unauthorised access (403)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**RU:**
|
|
71
|
+
```
|
|
72
|
+
/develop-feature
|
|
73
|
+
|
|
74
|
+
Фича: "Массовое обновление статуса заказов (admin API)"
|
|
75
|
+
Стек: FastAPI + SQLAlchemy async (без изменений UI)
|
|
76
|
+
Эндпоинт: PATCH /api/v1/admin/orders/bulk-status
|
|
77
|
+
Auth: требуется роль admin (scope: admin:orders:write)
|
|
78
|
+
Запрос: { order_ids: list[int] (макс 100), status: OrderStatus, reason: str }
|
|
79
|
+
Бизнес правила:
|
|
80
|
+
- Все order_ids должны принадлежать одному tenant (400 если смешанные tenants)
|
|
81
|
+
- Разрешённые переходы только: PENDING → PROCESSING, PROCESSING → SHIPPED
|
|
82
|
+
- Недопустимый переход возвращает 422 с детализацией ошибок по заказу
|
|
83
|
+
- Успешные обновления отправляют событие OrderStatusChanged на каждый заказ
|
|
84
|
+
- Возвращает: { updated: int, failed: list[{order_id, error}] } (частичный успех допускается)
|
|
85
|
+
БД: массовый UPDATE с RETURNING; обернуть в одну транзакцию (всё или ничего при любом сбое: настраивается)
|
|
86
|
+
Тесты: тест сценария частичного сбоя; тест изоляции tenant; тест несанкционированного доступа (403)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Example 3 — Quick / Small change
|
|
92
|
+
|
|
93
|
+
**EN:**
|
|
94
|
+
```
|
|
95
|
+
/develop-feature
|
|
96
|
+
|
|
97
|
+
Feature: "Archive products (soft-delete)"
|
|
98
|
+
Change scope: small — adds 'archived' status and filters
|
|
99
|
+
Endpoints affected:
|
|
100
|
+
- PATCH /api/v1/products/{id}: add {"status": "archived"} as valid transition (admin only)
|
|
101
|
+
- GET /api/v1/products: exclude archived by default; add ?include_archived=true param for admin
|
|
102
|
+
DB: add archived_at TIMESTAMP column to products (nullable; non-breaking migration)
|
|
103
|
+
No frontend changes needed (admin uses API directly)
|
|
104
|
+
Tests: verify archived products hidden from public listing; visible to admin with param
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**RU:**
|
|
108
|
+
```
|
|
109
|
+
/develop-feature
|
|
110
|
+
|
|
111
|
+
Фича: "Архивирование продуктов (soft-delete)"
|
|
112
|
+
Скоуп изменения: небольшой — добавляет статус 'archived' и фильтры
|
|
113
|
+
Затронутые эндпоинты:
|
|
114
|
+
- PATCH /api/v1/products/{id}: добавить {"status": "archived"} как допустимый переход (только admin)
|
|
115
|
+
- GET /api/v1/products: исключать archived по умолчанию; добавить параметр ?include_archived=true для admin
|
|
116
|
+
БД: добавить столбец archived_at TIMESTAMP в products (nullable; non-breaking миграция)
|
|
117
|
+
Изменений frontend не нужно (admin использует API напрямую)
|
|
118
|
+
Тесты: убедиться что архивированные продукты скрыты из публичного листинга; видны admin с параметром
|
|
119
|
+
```
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
workflow: feature-implementation-flow
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Prompt: `/feature-implementation-flow`
|
|
6
|
+
|
|
7
|
+
Use when: implementing a single feature in an existing FastAPI/SQLAlchemy service — following the layered architecture (model → repo → service → endpoint).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Example 1 — State transition with business rules
|
|
12
|
+
|
|
13
|
+
**EN:**
|
|
14
|
+
```
|
|
15
|
+
/feature-implementation-flow
|
|
16
|
+
|
|
17
|
+
Feature: "Refund order"
|
|
18
|
+
Existing codebase: src/ (FastAPI + SQLAlchemy async, layered architecture)
|
|
19
|
+
Endpoint: POST /api/v1/orders/{order_id}/refund
|
|
20
|
+
Request body: { reason: str, amount: Decimal (optional, defaults to full order total) }
|
|
21
|
+
Business rules:
|
|
22
|
+
- Only orders with status PAID can be refunded
|
|
23
|
+
- Partial refund: amount must be > 0 and ≤ order total
|
|
24
|
+
- Full refund if amount not provided
|
|
25
|
+
- On refund: create RefundRecord, update order status → REFUNDED, emit OrderRefunded event
|
|
26
|
+
- Idempotency: same order_id + reason within 1 hour = return existing refund (no duplicate)
|
|
27
|
+
Error responses:
|
|
28
|
+
- 404 if order not found
|
|
29
|
+
- 403 if order belongs to different user
|
|
30
|
+
- 400 if order not in PAID status (code: ORDER_NOT_REFUNDABLE)
|
|
31
|
+
- 400 if amount > total (code: REFUND_EXCEEDS_TOTAL)
|
|
32
|
+
Tests required: service unit tests (all business rules) + API integration tests (all error codes)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**RU:**
|
|
36
|
+
```
|
|
37
|
+
/feature-implementation-flow
|
|
38
|
+
|
|
39
|
+
Фича: "Возврат заказа"
|
|
40
|
+
Существующий код: src/ (FastAPI + SQLAlchemy async, layered architecture)
|
|
41
|
+
Эндпоинт: POST /api/v1/orders/{order_id}/refund
|
|
42
|
+
Тело запроса: { reason: str, amount: Decimal (необязательно, по умолчанию полная сумма заказа) }
|
|
43
|
+
Бизнес правила:
|
|
44
|
+
- Возврат возможен только для заказов со статусом PAID
|
|
45
|
+
- Частичный возврат: amount должен быть > 0 и ≤ итогу заказа
|
|
46
|
+
- Полный возврат если amount не указан
|
|
47
|
+
- При возврате: создать RefundRecord, обновить статус заказа → REFUNDED, отправить событие OrderRefunded
|
|
48
|
+
- Идемпотентность: одинаковые order_id + reason в течение 1 часа = вернуть существующий возврат (без дублирования)
|
|
49
|
+
Ответы ошибок:
|
|
50
|
+
- 404 если заказ не найден
|
|
51
|
+
- 403 если заказ принадлежит другому пользователю
|
|
52
|
+
- 400 если заказ не в статусе PAID (code: ORDER_NOT_REFUNDABLE)
|
|
53
|
+
- 400 если amount > total (code: REFUND_EXCEEDS_TOTAL)
|
|
54
|
+
Обязательные тесты: unit тесты сервиса (все бизнес правила) + API интеграционные тесты (все коды ошибок)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Example 2 — New resource with relationships
|
|
60
|
+
|
|
61
|
+
**EN:**
|
|
62
|
+
```
|
|
63
|
+
/feature-implementation-flow
|
|
64
|
+
|
|
65
|
+
Feature: "Product reviews"
|
|
66
|
+
Existing codebase: src/ (order-service extended with product catalog)
|
|
67
|
+
Endpoints:
|
|
68
|
+
POST /api/v1/products/{product_id}/reviews → create review (auth required)
|
|
69
|
+
GET /api/v1/products/{product_id}/reviews → paginated list, newest first (no auth)
|
|
70
|
+
DELETE /api/v1/reviews/{review_id} → delete own review (auth required)
|
|
71
|
+
Business rules:
|
|
72
|
+
- One review per user per product (409 if already reviewed)
|
|
73
|
+
- Rating: integer 1–5 (validated)
|
|
74
|
+
- Text: 10–1000 characters
|
|
75
|
+
- User cannot review their own product
|
|
76
|
+
- Product average_rating and review_count cached on Product model (updated on create/delete)
|
|
77
|
+
DB changes: create reviews table; add average_rating + review_count columns to products
|
|
78
|
+
Performance: GET list uses cursor pagination; N+1 safeguard (eager-load author username)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**RU:**
|
|
82
|
+
```
|
|
83
|
+
/feature-implementation-flow
|
|
84
|
+
|
|
85
|
+
Фича: "Отзывы на продукты"
|
|
86
|
+
Существующий код: src/ (order-service расширенный каталогом продуктов)
|
|
87
|
+
Эндпоинты:
|
|
88
|
+
POST /api/v1/products/{product_id}/reviews → создать отзыв (требуется auth)
|
|
89
|
+
GET /api/v1/products/{product_id}/reviews → пагинированный список, сначала новые (без auth)
|
|
90
|
+
DELETE /api/v1/reviews/{review_id} → удалить свой отзыв (требуется auth)
|
|
91
|
+
Бизнес правила:
|
|
92
|
+
- Один отзыв от пользователя на продукт (409 если уже оставлен отзыв)
|
|
93
|
+
- Оценка: целое число 1–5 (валидируется)
|
|
94
|
+
- Текст: 10–1000 символов
|
|
95
|
+
- Пользователь не может оставить отзыв на свой продукт
|
|
96
|
+
- average_rating и review_count продукта кэшируются в модели Product (обновляются при создании/удалении)
|
|
97
|
+
Изменения БД: создать таблицу reviews; добавить столбцы average_rating + review_count в products
|
|
98
|
+
Производительность: GET список использует cursor пагинацию; защита от N+1 (eager-load имя автора)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Example 3 — Background / async job feature
|
|
104
|
+
|
|
105
|
+
**EN:**
|
|
106
|
+
```
|
|
107
|
+
/feature-implementation-flow
|
|
108
|
+
|
|
109
|
+
Feature: "Send order confirmation email (async)"
|
|
110
|
+
Trigger: OrderPaid event consumed from RabbitMQ queue
|
|
111
|
+
Implementation: ARQ worker task, not a FastAPI endpoint
|
|
112
|
+
Task: send_order_confirmation_email(order_id: int)
|
|
113
|
+
- Load order + user email from DB
|
|
114
|
+
- Render email template (templates/order_confirmation.html)
|
|
115
|
+
- Send via SendGrid API (SENDGRID_API_KEY from env)
|
|
116
|
+
- Mark order.confirmation_sent = True
|
|
117
|
+
Retry: 3 attempts, exponential backoff (30s, 90s, 270s)
|
|
118
|
+
Dead-letter: after 3 failures → log error with order_id + push to failed_notifications queue
|
|
119
|
+
Tests: mock SendGrid client; test retry logic; test dead-letter on repeated failure
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**RU:**
|
|
123
|
+
```
|
|
124
|
+
/feature-implementation-flow
|
|
125
|
+
|
|
126
|
+
Фича: "Отправка email подтверждения заказа (async)"
|
|
127
|
+
Триггер: событие OrderPaid потребляемое из очереди RabbitMQ
|
|
128
|
+
Реализация: ARQ worker задача, не FastAPI эндпоинт
|
|
129
|
+
Задача: send_order_confirmation_email(order_id: int)
|
|
130
|
+
- Загрузить заказ + email пользователя из БД
|
|
131
|
+
- Отрисовать email шаблон (templates/order_confirmation.html)
|
|
132
|
+
- Отправить через SendGrid API (SENDGRID_API_KEY из env)
|
|
133
|
+
- Отметить order.confirmation_sent = True
|
|
134
|
+
Повторные попытки: 3 попытки, exponential backoff (30s, 90s, 270s)
|
|
135
|
+
Dead-letter: после 3 неудач → логировать ошибку с order_id + поместить в очередь failed_notifications
|
|
136
|
+
Тесты: mock SendGrid клиент; тест логики повторных попыток; тест dead-letter при повторных сбоях
|
|
137
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
workflow: testing-ci-pipeline
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Prompt: `/testing-ci-pipeline`
|
|
6
|
+
|
|
7
|
+
Use when: running the full CI validation pipeline — lint, type check, unit tests, integration tests, E2E — or diagnosing a CI failure.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Example 1 — Full pipeline on PR
|
|
12
|
+
|
|
13
|
+
**EN:**
|
|
14
|
+
```
|
|
15
|
+
/testing-ci-pipeline
|
|
16
|
+
|
|
17
|
+
Project type: backend (Python / FastAPI)
|
|
18
|
+
Test scope: all
|
|
19
|
+
Trigger: PR #187 ready for review
|
|
20
|
+
Pipeline stages (in order):
|
|
21
|
+
1. lint: ruff check src/ tests/ — zero tolerance
|
|
22
|
+
2. types: mypy src/ --strict
|
|
23
|
+
3. unit: pytest tests/unit/ -x --tb=short (fail fast)
|
|
24
|
+
4. integration: pytest tests/integration/ --cov=src --cov-report=term-missing
|
|
25
|
+
5. e2e: pytest tests/e2e/ (Docker Compose stack: app + postgres + redis)
|
|
26
|
+
Coverage threshold: 80% lines on src/ — fail CI if below
|
|
27
|
+
Environment: GitHub Actions (ubuntu-latest); secrets from GitHub Secrets
|
|
28
|
+
Artefacts to upload: coverage/html/, test-results/junit.xml
|
|
29
|
+
Expected duration: < 8 minutes total
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**RU:**
|
|
33
|
+
```
|
|
34
|
+
/testing-ci-pipeline
|
|
35
|
+
|
|
36
|
+
Тип проекта: backend (Python / FastAPI)
|
|
37
|
+
Скоуп тестов: все
|
|
38
|
+
Триггер: PR #187 готов к ревью
|
|
39
|
+
Этапы pipeline (по порядку):
|
|
40
|
+
1. lint: ruff check src/ tests/ — нулевая терпимость
|
|
41
|
+
2. types: mypy src/ --strict
|
|
42
|
+
3. unit: pytest tests/unit/ -x --tb=short (завершение при первом сбое)
|
|
43
|
+
4. integration: pytest tests/integration/ --cov=src --cov-report=term-missing
|
|
44
|
+
5. e2e: pytest tests/e2e/ (Docker Compose стек: app + postgres + redis)
|
|
45
|
+
Порог покрытия: 80% строк в src/ — не прохождение CI если ниже
|
|
46
|
+
Окружение: GitHub Actions (ubuntu-latest); секреты из GitHub Secrets
|
|
47
|
+
Артефакты для загрузки: coverage/html/, test-results/junit.xml
|
|
48
|
+
Ожидаемая длительность: < 8 минут всего
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Example 2 — CI failure investigation
|
|
54
|
+
|
|
55
|
+
**EN:**
|
|
56
|
+
```
|
|
57
|
+
/testing-ci-pipeline
|
|
58
|
+
|
|
59
|
+
Mode: diagnose failure
|
|
60
|
+
Project type: frontend (TypeScript / React)
|
|
61
|
+
Failed CI run: https://github.com/myorg/myapp/actions/runs/9876543210
|
|
62
|
+
Failure stage: integration tests (unit passed)
|
|
63
|
+
Error output (from CI log):
|
|
64
|
+
FAIL src/features/checkout/__tests__/CheckoutStepper.test.tsx
|
|
65
|
+
● CheckoutStepper › step 3 payment › renders Stripe Elements
|
|
66
|
+
TypeError: Cannot read properties of undefined (reading 'create')
|
|
67
|
+
at Object.<anonymous> (src/features/checkout/CheckoutStepper.tsx:47:22)
|
|
68
|
+
Context: Stripe mock was working yesterday; PR only changed styling (no logic changes)
|
|
69
|
+
Hypothesis: Stripe mock not restored between tests — shared state pollution
|
|
70
|
+
Investigate: check jest.mock() setup in test file; check if other test modified Stripe global
|
|
71
|
+
Fix: ensure jest.resetAllMocks() in afterEach or use jest.isolateModules()
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**RU:**
|
|
75
|
+
```
|
|
76
|
+
/testing-ci-pipeline
|
|
77
|
+
|
|
78
|
+
Режим: диагностика сбоя
|
|
79
|
+
Тип проекта: frontend (TypeScript / React)
|
|
80
|
+
Неудачный CI запуск: https://github.com/myorg/myapp/actions/runs/9876543210
|
|
81
|
+
Этап сбоя: integration тесты (unit прошли)
|
|
82
|
+
Вывод ошибки (из CI лога):
|
|
83
|
+
FAIL src/features/checkout/__tests__/CheckoutStepper.test.tsx
|
|
84
|
+
● CheckoutStepper › step 3 payment › renders Stripe Elements
|
|
85
|
+
TypeError: Cannot read properties of undefined (reading 'create')
|
|
86
|
+
at Object.<anonymous> (src/features/checkout/CheckoutStepper.tsx:47:22)
|
|
87
|
+
Контекст: Stripe mock работал вчера; PR изменил только стили (без изменений логики)
|
|
88
|
+
Гипотеза: Stripe mock не восстанавливается между тестами — загрязнение shared state
|
|
89
|
+
Расследовать: проверить настройку jest.mock() в файле теста; проверить изменял ли другой тест Stripe global
|
|
90
|
+
Исправление: обеспечить jest.resetAllMocks() в afterEach или использовать jest.isolateModules()
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Example 3 — Scope: unit only (quick check)
|
|
96
|
+
|
|
97
|
+
**EN:**
|
|
98
|
+
```
|
|
99
|
+
/testing-ci-pipeline
|
|
100
|
+
|
|
101
|
+
Project type: backend
|
|
102
|
+
Test scope: unit only (fast feedback during development)
|
|
103
|
+
Command: pytest tests/unit/ -x -q --tb=short
|
|
104
|
+
Target: verify that new OrderService.refund() method passes all unit tests before pushing
|
|
105
|
+
Expected: < 60 seconds; no Docker, no DB, no network calls
|
|
106
|
+
Coverage: skip (coverage only on full run)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**RU:**
|
|
110
|
+
```
|
|
111
|
+
/testing-ci-pipeline
|
|
112
|
+
|
|
113
|
+
Тип проекта: backend
|
|
114
|
+
Скоуп тестов: только unit (быстрая обратная связь при разработке)
|
|
115
|
+
Команда: pytest tests/unit/ -x -q --tb=short
|
|
116
|
+
Цель: убедиться что новый метод OrderService.refund() проходит все unit тесты перед push
|
|
117
|
+
Ожидается: < 60 секунд; без Docker, без БД, без сетевых вызовов
|
|
118
|
+
Покрытие: пропустить (покрытие только при полном запуске)
|
|
119
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: model_decision
|
|
3
|
+
glob: api-design-guide
|
|
4
|
+
description: API contracts must be explicit, validated, and versioned
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# API Design Rule
|
|
8
|
+
|
|
9
|
+
**Rules:**
|
|
10
|
+
|
|
11
|
+
- Use Pydantic for request/response validation; enforce strict types, no raw dicts.
|
|
12
|
+
- Implement `/liveness` and `/readiness` for K8s probes.
|
|
13
|
+
- Implement `/metrics` for FastAPI using PrometheusMiddleware.
|
|
14
|
+
- Version APIs in path or headers (v1, v2…).
|
|
15
|
+
- Sanitize input; output must be explicit.
|
|
16
|
+
- Document all endpoints with OpenAPI/Swagger.
|
|
17
|
+
- No side effects in GET requests.
|
|
18
|
+
- Responses must include status codes and error details.
|
|
19
|
+
|
|
20
|
+
**Violations:**
|
|
21
|
+
|
|
22
|
+
- API schemas are implicit.
|
|
23
|
+
- Validation is ad-hoc.
|
|
24
|
+
- Endpoints mutate state unexpectedly.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: model_decision
|
|
3
|
+
glob: async-concurrency-guide
|
|
4
|
+
description: isolate async code, use tasks safely
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Async & Concurrency Rule
|
|
8
|
+
|
|
9
|
+
**Rules:**
|
|
10
|
+
|
|
11
|
+
- Isolate async/TaskGroup logic from sync code.
|
|
12
|
+
- Do not block event loop with heavy computation.
|
|
13
|
+
- Catch only expected exceptions in async tasks.
|
|
14
|
+
- Ensure idempotency for retried tasks.
|
|
15
|
+
- Implement logic to debug event loop delays.
|
|
16
|
+
|
|
17
|
+
**Violations:**
|
|
18
|
+
|
|
19
|
+
- Async tasks share mutable state.
|
|
20
|
+
- Root Exception is caught.
|
|
21
|
+
- Tasks are non-idempotent.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
glob: backend-architecture-rule
|
|
4
|
+
description: enforce layered architecture and dependency rules for backend services
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Backend Architecture Rule
|
|
8
|
+
|
|
9
|
+
**Goal:** Maintain clean separation of concerns and testability.
|
|
10
|
+
|
|
11
|
+
**Layers:**
|
|
12
|
+
|
|
13
|
+
1. **API Layer (Entry Points):**
|
|
14
|
+
- Handles HTTP requests, websocket events, or CLI commands.
|
|
15
|
+
- Validates input using Pydantic schemas.
|
|
16
|
+
- Calls Service Layer.
|
|
17
|
+
- **Allowed Imports:** Service Layer, Schemas.
|
|
18
|
+
- **Forbidden Imports:** Repository Layer, direct DB access.
|
|
19
|
+
|
|
20
|
+
2. **Service Layer (Business Logic):**
|
|
21
|
+
- Contains pure business logic and orchestration.
|
|
22
|
+
- Transaction boundaries are defined here.
|
|
23
|
+
- **Allowed Imports:** Repository Layer, Schemas, Domain Models.
|
|
24
|
+
- **Forbidden Imports:** API Layer, frameworks (FastAPI/Flask) specific objects.
|
|
25
|
+
|
|
26
|
+
3. **Repository Layer (Data Access):**
|
|
27
|
+
- Abstracts database queries and external service calls.
|
|
28
|
+
- Returns Domain Models or Pydantic Schemas.
|
|
29
|
+
- **Allowed Imports:** Domain Models, Database Drivers (SQLAlchemy/AsyncPG).
|
|
30
|
+
- **Forbidden Imports:** API/Service Layers.
|
|
31
|
+
|
|
32
|
+
4. **Domain Models / Schemas:**
|
|
33
|
+
- Pure data structures.
|
|
34
|
+
- **Allowed Imports:** None (should be dependency-free).
|
|
35
|
+
|
|
36
|
+
**Violations:**
|
|
37
|
+
|
|
38
|
+
- API layer directly accessing database.
|
|
39
|
+
- Service layer returning SQLAlchemy models directly (leaking implementation details).
|
|
40
|
+
- Circular dependencies between layers.
|
|
41
|
+
- Business logic inside API handlers.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: model_decision
|
|
3
|
+
glob: background-jobs-guide
|
|
4
|
+
description: manage background tasks safely and reliably
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Background Jobs Rule
|
|
8
|
+
|
|
9
|
+
**Rules:**
|
|
10
|
+
|
|
11
|
+
- Use queues for async jobs (Celery, RQ, etc.).
|
|
12
|
+
- Ensure idempotency for retried jobs.
|
|
13
|
+
- Log errors and metrics for each task.
|
|
14
|
+
- Limit concurrency and handle exceptions explicitly.
|
|
15
|
+
|
|
16
|
+
**Violations:**
|
|
17
|
+
|
|
18
|
+
- Jobs are non-idempotent.
|
|
19
|
+
- Exceptions crash the worker.
|
|
20
|
+
- No logging/metrics for task execution.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
glob: code-quality-guide
|
|
4
|
+
description: enforce code formatting, linting, and static typing after code changes
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code Quality Rule
|
|
8
|
+
|
|
9
|
+
**Rules:**
|
|
10
|
+
|
|
11
|
+
- After writing or modifying code, always run formatters and linters.
|
|
12
|
+
- Execute formatting tools and fix all formatting issues.
|
|
13
|
+
- Execute linting tools and fix all lint/type errors until passed.
|
|
14
|
+
- For Python projects, use standard tools (e.g. `ruff`, `black`, `mypy`) via the project's dependency manager.
|
|
15
|
+
- All tools must be installed and run inside the project's virtual environment.
|
|
16
|
+
|
|
17
|
+
**Violations:**
|
|
18
|
+
|
|
19
|
+
- Skipping formatting or linting.
|
|
20
|
+
- Ignoring formatter or linter errors.
|
|
21
|
+
- Running tools outside the virtual environment.
|
|
22
|
+
- Missing standard quality tools in dependencies.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: model_decision
|
|
3
|
+
glob: database-access-guide
|
|
4
|
+
description: safe, efficient, maintainable DB access.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Database Access Rule
|
|
8
|
+
|
|
9
|
+
**Purpose:** Safe, efficient, maintainable DB access.
|
|
10
|
+
|
|
11
|
+
**Rules:**
|
|
12
|
+
|
|
13
|
+
- Use repository/DAO layer; no direct DB calls in business logic.
|
|
14
|
+
- Prefer ORM; raw SQL only if necessary, always parameterized.
|
|
15
|
+
- Batch queries; avoid N+1 problems.
|
|
16
|
+
- Use caching carefully; keep invalidation consistent.
|
|
17
|
+
- Use separate schema per project.
|
|
18
|
+
- Run `EXPLAIN` for complex queries; save in `sqlplans`.
|
|
19
|
+
|
|
20
|
+
**Violations:**
|
|
21
|
+
|
|
22
|
+
- Unsafe SQL or in business logic.
|
|
23
|
+
- Repeated queries/N+1 issues.
|
|
24
|
+
- Mutable DB state leaks outside DAL.
|