@cubocicloide/stack-react-django 3.0.4
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/LICENSE +33 -0
- package/README.md +66 -0
- package/dist/commands/lint/checks/BE/001.d.ts +6 -0
- package/dist/commands/lint/checks/BE/001.js +94 -0
- package/dist/commands/lint/checks/BE/001.js.map +1 -0
- package/dist/commands/lint/checks/BE/002.d.ts +6 -0
- package/dist/commands/lint/checks/BE/002.js +136 -0
- package/dist/commands/lint/checks/BE/002.js.map +1 -0
- package/dist/commands/lint/checks/BE/003.d.ts +6 -0
- package/dist/commands/lint/checks/BE/003.js +89 -0
- package/dist/commands/lint/checks/BE/003.js.map +1 -0
- package/dist/commands/lint/checks/BE/004.d.ts +6 -0
- package/dist/commands/lint/checks/BE/004.js +68 -0
- package/dist/commands/lint/checks/BE/004.js.map +1 -0
- package/dist/commands/lint/checks/BE/005.d.ts +6 -0
- package/dist/commands/lint/checks/BE/005.js +55 -0
- package/dist/commands/lint/checks/BE/005.js.map +1 -0
- package/dist/commands/lint/checks/BE/006.d.ts +6 -0
- package/dist/commands/lint/checks/BE/006.js +95 -0
- package/dist/commands/lint/checks/BE/006.js.map +1 -0
- package/dist/commands/lint/checks/BE/007.d.ts +6 -0
- package/dist/commands/lint/checks/BE/007.js +53 -0
- package/dist/commands/lint/checks/BE/007.js.map +1 -0
- package/dist/commands/lint/checks/BE/008.d.ts +6 -0
- package/dist/commands/lint/checks/BE/008.js +70 -0
- package/dist/commands/lint/checks/BE/008.js.map +1 -0
- package/dist/commands/lint/checks/BE/009.d.ts +6 -0
- package/dist/commands/lint/checks/BE/009.js +112 -0
- package/dist/commands/lint/checks/BE/009.js.map +1 -0
- package/dist/commands/lint/checks/BE/010.d.ts +6 -0
- package/dist/commands/lint/checks/BE/010.js +76 -0
- package/dist/commands/lint/checks/BE/010.js.map +1 -0
- package/dist/commands/lint/checks/BE/011.d.ts +6 -0
- package/dist/commands/lint/checks/BE/011.js +76 -0
- package/dist/commands/lint/checks/BE/011.js.map +1 -0
- package/dist/commands/lint/checks/BE/012.d.ts +6 -0
- package/dist/commands/lint/checks/BE/012.js +61 -0
- package/dist/commands/lint/checks/BE/012.js.map +1 -0
- package/dist/commands/lint/checks/BE/013.d.ts +6 -0
- package/dist/commands/lint/checks/BE/013.js +98 -0
- package/dist/commands/lint/checks/BE/013.js.map +1 -0
- package/dist/commands/lint/checks/BE/014.d.ts +6 -0
- package/dist/commands/lint/checks/BE/014.js +64 -0
- package/dist/commands/lint/checks/BE/014.js.map +1 -0
- package/dist/commands/lint/checks/E2E/001.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/001.js +35 -0
- package/dist/commands/lint/checks/E2E/001.js.map +1 -0
- package/dist/commands/lint/checks/E2E/002.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/002.js +37 -0
- package/dist/commands/lint/checks/E2E/002.js.map +1 -0
- package/dist/commands/lint/checks/E2E/003.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/003.js +42 -0
- package/dist/commands/lint/checks/E2E/003.js.map +1 -0
- package/dist/commands/lint/checks/E2E/004.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/004.js +37 -0
- package/dist/commands/lint/checks/E2E/004.js.map +1 -0
- package/dist/commands/lint/checks/E2E/005.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/005.js +47 -0
- package/dist/commands/lint/checks/E2E/005.js.map +1 -0
- package/dist/commands/lint/checks/E2E/006.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/006.js +28 -0
- package/dist/commands/lint/checks/E2E/006.js.map +1 -0
- package/dist/commands/lint/checks/E2E/007.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/007.js +47 -0
- package/dist/commands/lint/checks/E2E/007.js.map +1 -0
- package/dist/commands/lint/checks/FE/001.d.ts +6 -0
- package/dist/commands/lint/checks/FE/001.js +56 -0
- package/dist/commands/lint/checks/FE/001.js.map +1 -0
- package/dist/commands/lint/checks/FE/002.d.ts +6 -0
- package/dist/commands/lint/checks/FE/002.js +80 -0
- package/dist/commands/lint/checks/FE/002.js.map +1 -0
- package/dist/commands/lint/checks/FE/003.d.ts +6 -0
- package/dist/commands/lint/checks/FE/003.js +65 -0
- package/dist/commands/lint/checks/FE/003.js.map +1 -0
- package/dist/commands/lint/checks/FE/004.d.ts +6 -0
- package/dist/commands/lint/checks/FE/004.js +72 -0
- package/dist/commands/lint/checks/FE/004.js.map +1 -0
- package/dist/commands/lint/checks/FE/005.d.ts +6 -0
- package/dist/commands/lint/checks/FE/005.js +103 -0
- package/dist/commands/lint/checks/FE/005.js.map +1 -0
- package/dist/commands/lint/checks/FE/006.d.ts +6 -0
- package/dist/commands/lint/checks/FE/006.js +102 -0
- package/dist/commands/lint/checks/FE/006.js.map +1 -0
- package/dist/commands/lint/checks/FE/007.d.ts +6 -0
- package/dist/commands/lint/checks/FE/007.js +60 -0
- package/dist/commands/lint/checks/FE/007.js.map +1 -0
- package/dist/commands/lint/checks/FE/008.d.ts +6 -0
- package/dist/commands/lint/checks/FE/008.js +115 -0
- package/dist/commands/lint/checks/FE/008.js.map +1 -0
- package/dist/commands/lint/checks/FE/009.d.ts +6 -0
- package/dist/commands/lint/checks/FE/009.js +83 -0
- package/dist/commands/lint/checks/FE/009.js.map +1 -0
- package/dist/commands/lint/checks/FE/010.d.ts +6 -0
- package/dist/commands/lint/checks/FE/010.js +105 -0
- package/dist/commands/lint/checks/FE/010.js.map +1 -0
- package/dist/commands/lint/checks/FE/011.d.ts +6 -0
- package/dist/commands/lint/checks/FE/011.js +43 -0
- package/dist/commands/lint/checks/FE/011.js.map +1 -0
- package/dist/commands/lint/checks/FE/012.d.ts +6 -0
- package/dist/commands/lint/checks/FE/012.js +150 -0
- package/dist/commands/lint/checks/FE/012.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3436 -0
- package/dist/index.js.map +1 -0
- package/dude.stack.json +13 -0
- package/package.json +43 -0
- package/templates/aws-ecs/backend/Dockerfile.prod +34 -0
- package/templates/aws-ecs/docs/docs/deploy.md.hbs +54 -0
- package/templates/aws-ecs/frontend/Dockerfile.prod +28 -0
- package/templates/aws-ecs/frontend/nginx.conf +21 -0
- package/templates/aws-ecs/iac/README.md.hbs +75 -0
- package/templates/aws-ecs/iac/_gitignore +14 -0
- package/templates/aws-ecs/iac/runner/Dockerfile +35 -0
- package/templates/aws-ecs/iac/terraform/bootstrap/main.tf.hbs +102 -0
- package/templates/aws-ecs/iac/terraform/bootstrap/outputs.tf +19 -0
- package/templates/aws-ecs/iac/terraform/bootstrap/variables.tf.hbs +17 -0
- package/templates/aws-ecs/iac/terraform/environments/dev/backend.hcl.hbs +12 -0
- package/templates/aws-ecs/iac/terraform/environments/dev/terraform.tfvars.hbs +43 -0
- package/templates/aws-ecs/iac/terraform/main.tf.hbs +949 -0
- package/templates/aws-ecs/iac/terraform/outputs.tf.hbs +71 -0
- package/templates/aws-ecs/iac/terraform/providers.tf +19 -0
- package/templates/aws-ecs/iac/terraform/variables.tf.hbs +113 -0
- package/templates/aws-ecs/iac/terraform/versions.tf +19 -0
- package/templates/base/.claude/agents/issue-fixer.md +190 -0
- package/templates/base/.claude/agents/security-fixer.md +250 -0
- package/templates/base/.claude/rules/BE/001.md +19 -0
- package/templates/base/.claude/rules/BE/002.md +21 -0
- package/templates/base/.claude/rules/BE/003.md +19 -0
- package/templates/base/.claude/rules/BE/004.md +16 -0
- package/templates/base/.claude/rules/BE/005.md +23 -0
- package/templates/base/.claude/rules/BE/006.md +13 -0
- package/templates/base/.claude/rules/BE/007.md +24 -0
- package/templates/base/.claude/rules/BE/008.md +19 -0
- package/templates/base/.claude/rules/BE/009.md +18 -0
- package/templates/base/.claude/rules/BE/010.md +15 -0
- package/templates/base/.claude/rules/BE/011.md +17 -0
- package/templates/base/.claude/rules/BE/012.md +18 -0
- package/templates/base/.claude/rules/BE/013.md +22 -0
- package/templates/base/.claude/rules/BE/014.md +15 -0
- package/templates/base/.claude/rules/E2E/001.md +13 -0
- package/templates/base/.claude/rules/E2E/002.md +14 -0
- package/templates/base/.claude/rules/E2E/003.md +10 -0
- package/templates/base/.claude/rules/E2E/004.md +23 -0
- package/templates/base/.claude/rules/E2E/005.md +15 -0
- package/templates/base/.claude/rules/E2E/006.md +13 -0
- package/templates/base/.claude/rules/E2E/007.md +18 -0
- package/templates/base/.claude/rules/FE/001.md +22 -0
- package/templates/base/.claude/rules/FE/002.md +39 -0
- package/templates/base/.claude/rules/FE/003.md +19 -0
- package/templates/base/.claude/rules/FE/004.md +21 -0
- package/templates/base/.claude/rules/FE/005.md +33 -0
- package/templates/base/.claude/rules/FE/006.md +24 -0
- package/templates/base/.claude/rules/FE/007.md +19 -0
- package/templates/base/.claude/rules/FE/008.md +26 -0
- package/templates/base/.claude/rules/FE/009.md +30 -0
- package/templates/base/.claude/rules/FE/010.md +25 -0
- package/templates/base/.claude/rules/FE/011.md +22 -0
- package/templates/base/.claude/rules/FE/012.md +32 -0
- package/templates/base/.claude/settings.json +53 -0
- package/templates/base/.claude/skills/clean-branches/SKILL.md +100 -0
- package/templates/base/.claude/skills/create/SKILL.md +47 -0
- package/templates/base/.claude/skills/create-jira-issue/SKILL.md +174 -0
- package/templates/base/.claude/skills/create-page/SKILL.md +195 -0
- package/templates/base/.claude/skills/create-route/SKILL.md +156 -0
- package/templates/base/.claude/skills/draft-email/SKILL.md +104 -0
- package/templates/base/.claude/skills/fix-issues/SKILL.md +238 -0
- package/templates/base/.claude/skills/security-scan/SKILL.md +297 -0
- package/templates/base/.claude/skills/verify-security-fixes/SKILL.md +180 -0
- package/templates/base/.dude/commands/README.md +85 -0
- package/templates/base/.dude/commands/hello.ts +34 -0
- package/templates/base/.dude/lint/checks/PRJ/001.ts +26 -0
- package/templates/base/.dude/lint/checks/README.md +69 -0
- package/templates/base/.vscode/tasks.json +44 -0
- package/templates/base/.worktreeinclude +2 -0
- package/templates/base/CLAUDE.md.hbs +391 -0
- package/templates/base/README.md.hbs +188 -0
- package/templates/base/_env.example.hbs +39 -0
- package/templates/base/_env.hbs +35 -0
- package/templates/base/_gitignore +31 -0
- package/templates/base/_npmrc +2 -0
- package/templates/base/backend/Dockerfile +16 -0
- package/templates/base/backend/README.md.hbs +90 -0
- package/templates/base/backend/_dockerignore +12 -0
- package/templates/base/backend/apps/__init__.py +0 -0
- package/templates/base/backend/apps/core/__init__.py +0 -0
- package/templates/base/backend/apps/core/apps.py +6 -0
- package/templates/base/backend/apps/core/serializers.py +7 -0
- package/templates/base/backend/apps/core/tests/__init__.py +0 -0
- package/templates/base/backend/apps/core/tests/test_views.py +16 -0
- package/templates/base/backend/apps/core/urls.py +9 -0
- package/templates/base/backend/apps/core/views.py +24 -0
- package/templates/base/backend/apps/users/__init__.py +0 -0
- package/templates/base/backend/apps/users/admin.py +6 -0
- package/templates/base/backend/apps/users/apps.py +6 -0
- package/templates/base/backend/apps/users/migrations/0001_initial.py +41 -0
- package/templates/base/backend/apps/users/migrations/__init__.py +0 -0
- package/templates/base/backend/apps/users/models.py +15 -0
- package/templates/base/backend/apps/users/serializers.py +16 -0
- package/templates/base/backend/apps/users/services.py +25 -0
- package/templates/base/backend/apps/users/tests/__init__.py +0 -0
- package/templates/base/backend/apps/users/tests/test_models.py +30 -0
- package/templates/base/backend/apps/users/tests/test_views.py +55 -0
- package/templates/base/backend/apps/users/urls.py +10 -0
- package/templates/base/backend/apps/users/views.py +20 -0
- package/templates/base/backend/config/__init__.py.hbs +5 -0
- package/templates/base/backend/config/asgi.py +9 -0
- package/templates/base/backend/config/settings/__init__.py +0 -0
- package/templates/base/backend/config/settings/base.py.hbs +197 -0
- package/templates/base/backend/config/settings/local.py +31 -0
- package/templates/base/backend/config/settings/production.py.hbs +37 -0
- package/templates/base/backend/config/urls.py.hbs +22 -0
- package/templates/base/backend/config/wsgi.py +9 -0
- package/templates/base/backend/manage.py +23 -0
- package/templates/base/backend/pyproject.toml.hbs +48 -0
- package/templates/base/backend/start.sh +5 -0
- package/templates/base/docker-compose.yml.hbs +196 -0
- package/templates/base/docs/docs/api.md +21 -0
- package/templates/base/docs/docs/dude.md.hbs +305 -0
- package/templates/base/docs/docs/index.md.hbs +92 -0
- package/templates/base/docs/docs/mkdocs.md +231 -0
- package/templates/base/docs/mkdocs.yml.hbs +52 -0
- package/templates/base/e2e/.prettierrc.json +1 -0
- package/templates/base/e2e/_prettierignore +3 -0
- package/templates/base/e2e/cucumber.js +21 -0
- package/templates/base/e2e/eslint.config.mjs +14 -0
- package/templates/base/e2e/features/example.feature +13 -0
- package/templates/base/e2e/package.json.hbs +30 -0
- package/templates/base/e2e/pages/ExamplePage.ts +16 -0
- package/templates/base/e2e/playwright.config.ts +27 -0
- package/templates/base/e2e/steps/common.steps.ts +32 -0
- package/templates/base/e2e/steps/example.steps.ts +4 -0
- package/templates/base/e2e/support/hooks.ts +72 -0
- package/templates/base/e2e/support/world.ts +24 -0
- package/templates/base/e2e/tsconfig.json +22 -0
- package/templates/base/frontend/.prettierrc.json +6 -0
- package/templates/base/frontend/Dockerfile +10 -0
- package/templates/base/frontend/_dockerignore +4 -0
- package/templates/base/frontend/eslint.config.js +32 -0
- package/templates/base/frontend/index.html.hbs +13 -0
- package/templates/base/frontend/package.json.hbs +38 -0
- package/templates/base/frontend/public/favicon.svg +5 -0
- package/templates/base/frontend/src/$components/Layout/$assets/logo.svg +5 -0
- package/templates/base/frontend/src/$components/Layout/constants.tsx +8 -0
- package/templates/base/frontend/src/$components/Layout/index.tsx +80 -0
- package/templates/base/frontend/src/$components/Layout/types.tsx +9 -0
- package/templates/base/frontend/src/$components/index.tsx +1 -0
- package/templates/base/frontend/src/$hooks/index.tsx +2 -0
- package/templates/base/frontend/src/$hooks/useCounterStore/index.tsx +28 -0
- package/templates/base/frontend/src/$hooks/useCounterStore/types.tsx +7 -0
- package/templates/base/frontend/src/$hooks/usePageTitle/index.tsx +21 -0
- package/templates/base/frontend/src/$types/vite-env.d.ts +10 -0
- package/templates/base/frontend/src/App.tsx +36 -0
- package/templates/base/frontend/src/main.tsx +10 -0
- package/templates/base/frontend/src/openapi/utils/openapi.yaml.hbs +129 -0
- package/templates/base/frontend/src/pages/constants.tsx +31 -0
- package/templates/base/frontend/src/pages/index.tsx +192 -0
- package/templates/base/frontend/src/pages/types.tsx +6 -0
- package/templates/base/frontend/src/pages/users/[id]/index.tsx +53 -0
- package/templates/base/frontend/src/pages/users/index.tsx +57 -0
- package/templates/base/frontend/src/pages/users/types.tsx +4 -0
- package/templates/base/frontend/src/styles.module.css +7 -0
- package/templates/base/frontend/src/utils/constants.tsx +11 -0
- package/templates/base/frontend/src/utils/formatters/index.tsx +49 -0
- package/templates/base/frontend/src/utils/functions.tsx +70 -0
- package/templates/base/frontend/src/utils/index.tsx +3 -0
- package/templates/base/frontend/tsconfig.json +24 -0
- package/templates/base/frontend/vite.config.ts +20 -0
- package/templates/base/package.json.hbs +11 -0
- package/templates/base/security/baseline.json +4 -0
- package/templates/celery/backend/apps/core/tasks.py +14 -0
- package/templates/celery/backend/apps/core/tests/test_tasks.py +6 -0
- package/templates/celery/backend/config/celery.py.hbs +26 -0
- package/templates/celerybeat/backend/apps/core/tasks_scheduled.py +18 -0
- package/templates/celerybeat/backend/apps/core/tests/test_tasks_scheduled.py +6 -0
- package/templates/postgres/.dude/commands/reset.ts +83 -0
- package/templates/s3/backend/apps/files/__init__.py +0 -0
- package/templates/s3/backend/apps/files/admin.py +9 -0
- package/templates/s3/backend/apps/files/apps.py +6 -0
- package/templates/s3/backend/apps/files/migrations/0001_initial.py +29 -0
- package/templates/s3/backend/apps/files/migrations/__init__.py +0 -0
- package/templates/s3/backend/apps/files/models.py +21 -0
- package/templates/s3/backend/apps/files/serializers.py +27 -0
- package/templates/s3/backend/apps/files/services.py +19 -0
- package/templates/s3/backend/apps/files/tests/__init__.py +0 -0
- package/templates/s3/backend/apps/files/tests/test_models.py +10 -0
- package/templates/s3/backend/apps/files/tests/test_views.py +32 -0
- package/templates/s3/backend/apps/files/urls.py +10 -0
- package/templates/s3/backend/apps/files/views.py +29 -0
- package/templates/s3/frontend/src/openapi/utils/openapi.yaml.hbs +253 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
output "region" {
|
|
2
|
+
description = "AWS region this environment runs in."
|
|
3
|
+
value = var.region
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
output "ecr_backend_repository_url" {
|
|
7
|
+
description = "Shared ECR repository the backend image is pushed to."
|
|
8
|
+
value = data.aws_ecr_repository.backend.repository_url
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
output "ecr_frontend_repository_url" {
|
|
12
|
+
description = "Shared ECR repository the frontend image is pushed to."
|
|
13
|
+
value = data.aws_ecr_repository.frontend.repository_url
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
output "cluster_name" {
|
|
17
|
+
description = "ECS cluster name."
|
|
18
|
+
value = aws_ecs_cluster.this.name
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
output "backend_service_name" {
|
|
22
|
+
description = "ECS service name of the Django backend."
|
|
23
|
+
value = aws_ecs_service.backend.name
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
output "frontend_service_name" {
|
|
27
|
+
description = "ECS service name of the nginx frontend."
|
|
28
|
+
value = aws_ecs_service.frontend.name
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
output "alb_dns_name" {
|
|
32
|
+
description = "DNS name of the load balancer."
|
|
33
|
+
value = aws_lb.this.dns_name
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
output "app_domain" {
|
|
37
|
+
description = "Custom domain the app is served on (empty when none is configured)."
|
|
38
|
+
value = local.with_domain ? var.domain_name : ""
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
output "app_url" {
|
|
42
|
+
description = "The URL the app is served on."
|
|
43
|
+
value = local.app_url
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
output "migrate_task_definition" {
|
|
47
|
+
description = "Task definition (with revision) `dude iac migrate` runs with `aws ecs run-task`."
|
|
48
|
+
value = aws_ecs_task_definition.migrate.arn
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
output "public_subnet_ids" {
|
|
52
|
+
description = "Subnets one-off tasks (migrate) run in. No private subnets exist — the VPC skips NAT gateways for cost."
|
|
53
|
+
value = aws_subnet.public[*].id
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
output "backend_security_group_id" {
|
|
57
|
+
description = "Security group of the backend workloads — one-off tasks (migrate) attach it to reach RDS."
|
|
58
|
+
value = aws_security_group.backend.id
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
output "rds_endpoint" {
|
|
62
|
+
description = "PostgreSQL endpoint (host:port)."
|
|
63
|
+
value = aws_db_instance.this.endpoint
|
|
64
|
+
}
|
|
65
|
+
{{#if withS3}}
|
|
66
|
+
|
|
67
|
+
output "media_bucket" {
|
|
68
|
+
description = "S3 bucket holding uploaded media (the `files` app)."
|
|
69
|
+
value = aws_s3_bucket.media.bucket
|
|
70
|
+
}
|
|
71
|
+
{{/if}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
provider "aws" {
|
|
2
|
+
region = var.region
|
|
3
|
+
|
|
4
|
+
# Pin to the standard public endpoints — the AWS provider 5.x enables
|
|
5
|
+
# endpoint discovery by default and can return VPC-endpoint-scoped URLs
|
|
6
|
+
# that don't resolve from a local machine.
|
|
7
|
+
endpoints {
|
|
8
|
+
dynamodb = "https://dynamodb.${var.region}.amazonaws.com"
|
|
9
|
+
s3 = "https://s3.${var.region}.amazonaws.com"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
default_tags {
|
|
13
|
+
tags = {
|
|
14
|
+
Project = var.project_name
|
|
15
|
+
Environment = var.environment
|
|
16
|
+
ManagedBy = "terraform"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
variable "project_name" {
|
|
2
|
+
description = "Project slug — prefixes every resource name."
|
|
3
|
+
type = string
|
|
4
|
+
default = "{{projectName}}"
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
variable "environment" {
|
|
8
|
+
description = "Environment name (dev, staging, prod, …)."
|
|
9
|
+
type = string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
variable "region" {
|
|
13
|
+
description = "AWS region for this environment."
|
|
14
|
+
type = string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
variable "image_tag" {
|
|
18
|
+
description = "Tag of the backend + frontend images to run (both are built and pushed together). `dude iac deploy` keeps this line in terraform.tfvars up to date, so a plain `dude iac apply` re-deploys the same build."
|
|
19
|
+
type = string
|
|
20
|
+
default = "latest"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
variable "backend_cpu" {
|
|
24
|
+
description = "Fargate CPU units for the Django backend task (256 = 0.25 vCPU)."
|
|
25
|
+
type = number
|
|
26
|
+
default = 512
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
variable "backend_memory" {
|
|
30
|
+
description = "Fargate memory (MiB) for the backend task — must be a valid pairing with backend_cpu."
|
|
31
|
+
type = number
|
|
32
|
+
default = 1024
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
variable "frontend_cpu" {
|
|
36
|
+
description = "Fargate CPU units for the nginx frontend task."
|
|
37
|
+
type = number
|
|
38
|
+
default = 256
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
variable "frontend_memory" {
|
|
42
|
+
description = "Fargate memory (MiB) for the frontend task."
|
|
43
|
+
type = number
|
|
44
|
+
default = 512
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
variable "backend_desired_count" {
|
|
48
|
+
description = "Number of backend Fargate tasks."
|
|
49
|
+
type = number
|
|
50
|
+
default = 1
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
variable "frontend_desired_count" {
|
|
54
|
+
description = "Number of frontend Fargate tasks."
|
|
55
|
+
type = number
|
|
56
|
+
default = 1
|
|
57
|
+
}
|
|
58
|
+
{{#if withCelery}}
|
|
59
|
+
|
|
60
|
+
variable "worker_cpu" {
|
|
61
|
+
description = "Fargate CPU units for the Celery worker task."
|
|
62
|
+
type = number
|
|
63
|
+
default = 512
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
variable "worker_memory" {
|
|
67
|
+
description = "Fargate memory (MiB) for the Celery worker task."
|
|
68
|
+
type = number
|
|
69
|
+
default = 1024
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
variable "worker_desired_count" {
|
|
73
|
+
description = "Number of Celery worker tasks."
|
|
74
|
+
type = number
|
|
75
|
+
default = 1
|
|
76
|
+
}
|
|
77
|
+
{{/if}}
|
|
78
|
+
|
|
79
|
+
variable "allowed_cidrs" {
|
|
80
|
+
description = "CIDR blocks allowed to reach the ALB. Consider restricting this to your org's networks for non-production environments."
|
|
81
|
+
type = list(string)
|
|
82
|
+
default = ["0.0.0.0/0"]
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
variable "domain_name" {
|
|
86
|
+
description = "Public hostname for the app (e.g. app.example.com). Leave empty to serve plain HTTP on the ALB DNS name."
|
|
87
|
+
type = string
|
|
88
|
+
default = ""
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
variable "route53_zone_name" {
|
|
92
|
+
description = "Existing Route53 hosted zone the domain lives in (e.g. example.com). Required when domain_name is set."
|
|
93
|
+
type = string
|
|
94
|
+
default = ""
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
variable "log_retention_days" {
|
|
98
|
+
description = "CloudWatch log retention for the service logs."
|
|
99
|
+
type = number
|
|
100
|
+
default = 30
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
variable "db_instance_class" {
|
|
104
|
+
description = "RDS instance class for the PostgreSQL database."
|
|
105
|
+
type = string
|
|
106
|
+
default = "db.t4g.micro"
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
variable "db_allocated_storage" {
|
|
110
|
+
description = "RDS allocated storage in GB (gp3 minimum is 20)."
|
|
111
|
+
type = number
|
|
112
|
+
default = 20
|
|
113
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_version = ">= 1.6.0"
|
|
3
|
+
|
|
4
|
+
required_providers {
|
|
5
|
+
aws = {
|
|
6
|
+
source = "hashicorp/aws"
|
|
7
|
+
version = "~> 5.60"
|
|
8
|
+
}
|
|
9
|
+
random = {
|
|
10
|
+
source = "hashicorp/random"
|
|
11
|
+
version = "~> 3.6"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
# Partial backend: the concrete bucket/key/table are supplied per environment
|
|
16
|
+
# via `-backend-config=environments/<env>/backend.hcl` at `terraform init`.
|
|
17
|
+
# This keeps a single root usable both locally and from CI/CD.
|
|
18
|
+
backend "s3" {}
|
|
19
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: issue-fixer
|
|
3
|
+
description: Fix a Jira issue (feature, bug, or task) — fetch the ticket, implement the change on a dedicated branch, verify it passes lint and tests, and open a PR. Use for non-security issues. Issues labelled `security` are handled by the security-fixer agent instead.
|
|
4
|
+
tools: Bash, Read, Write, Edit, Grep, Glob, mcp__atlassian__getJiraIssue, mcp__atlassian__getTransitionsForJiraIssue, mcp__atlassian__transitionJiraIssue, mcp__atlassian__createPullRequest, mcp__atlassian__getRepository, PushNotification
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a software engineer working on this project. Your job is to fix a Jira issue end-to-end: read the ticket, implement the fix on a dedicated branch, verify it passes lint and tests, and open a pull request.
|
|
9
|
+
|
|
10
|
+
## Project context
|
|
11
|
+
|
|
12
|
+
- Stack: Django REST Framework backend (`backend/`), React + Vite + TypeScript frontend (`frontend/`)
|
|
13
|
+
- Jira URL: provided in the invocation prompt
|
|
14
|
+
- Bitbucket workspace and repo: provided in the invocation prompt
|
|
15
|
+
- Base branch: `develop`
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
### Step 1 — Fetch the issue
|
|
20
|
+
|
|
21
|
+
Use `mcp__atlassian__getJiraIssue` to read the issue. Extract:
|
|
22
|
+
- Summary (used as PR title)
|
|
23
|
+
- Description (used to understand what to fix)
|
|
24
|
+
- Issue type, priority, labels
|
|
25
|
+
|
|
26
|
+
If the issue cannot be fetched, stop and report the error.
|
|
27
|
+
|
|
28
|
+
### Step 2 — Prepare the branch
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
git fetch origin
|
|
32
|
+
git checkout develop && git pull origin develop --rebase
|
|
33
|
+
git checkout -b <issue-id>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Replace `<issue-id>` with the **lowercase** issue key (e.g. `proj-52`).
|
|
37
|
+
If the branch already exists locally, check it out and rebase onto develop.
|
|
38
|
+
|
|
39
|
+
### Step 3 — Implement the fix
|
|
40
|
+
|
|
41
|
+
Read the issue description carefully. Locate the relevant files with Grep/Glob/Read.
|
|
42
|
+
|
|
43
|
+
Apply a minimal, targeted fix — do not refactor surrounding code or introduce
|
|
44
|
+
abstractions beyond what the issue requires. Follow existing code conventions
|
|
45
|
+
(check nearby files for patterns). Do not add comments unless the fix introduces
|
|
46
|
+
a non-obvious invariant.
|
|
47
|
+
|
|
48
|
+
**Backend changes** (`backend/apps/`):
|
|
49
|
+
- Django apps live in `backend/apps/<app>/` — models, serializers, services, views, urls per app
|
|
50
|
+
- Writes go through `services.py` (never the ORM in views); serializers list fields explicitly
|
|
51
|
+
- After model changes, generate a migration (`dude db makemigration --app <app>`) and commit it
|
|
52
|
+
|
|
53
|
+
**Frontend changes** (`frontend/src/`):
|
|
54
|
+
- Components: `frontend/src/$components/` (page-local ones in `pages/<route>/$components/`)
|
|
55
|
+
- Pages: `frontend/src/pages/` (kebab-case route segments, `[param]` for dynamic ones)
|
|
56
|
+
- Hooks / zustand stores: `frontend/src/$hooks/`
|
|
57
|
+
- API calls: follow the existing `fetch`/`axios` pattern already in the project
|
|
58
|
+
- Do not edit auto-generated files (e.g. OpenAPI-derived types) — regenerate them instead
|
|
59
|
+
|
|
60
|
+
If the issue description is too vague to implement safely, stop and ask the user
|
|
61
|
+
for clarification before making changes.
|
|
62
|
+
|
|
63
|
+
### Step 4 — Commit
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git add <file1> <file2> ...
|
|
67
|
+
git commit -m "<type>(<scope>): <description>"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Commit message format (Conventional Commits):
|
|
71
|
+
- Type: `fix`, `feat`, `chore`, `refactor`, `ci`, `docs`, `test`
|
|
72
|
+
- Scope: area of the codebase (e.g. `backend`, `frontend`, `auth`, `api`)
|
|
73
|
+
- Description: lowercase, no trailing period, max 72 chars total
|
|
74
|
+
- Do not add a `Co-Authored-By` trailer
|
|
75
|
+
|
|
76
|
+
### Step 5 — Run checks
|
|
77
|
+
|
|
78
|
+
Run in order. Stop at the first failure.
|
|
79
|
+
|
|
80
|
+
**Step 5a — Structural lint:**
|
|
81
|
+
```bash
|
|
82
|
+
dude lint
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Step 5b — Tests:**
|
|
86
|
+
Check the project for a test command (look at `Makefile`, `package.json` scripts,
|
|
87
|
+
or `dude help`). Run whichever is available:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
dude test
|
|
91
|
+
# or, if dude test is unavailable:
|
|
92
|
+
cd backend && python -m pytest
|
|
93
|
+
cd frontend && pnpm test --run
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
If checks fail:
|
|
97
|
+
- Read the error output carefully
|
|
98
|
+
- Attempt a fix directly related to the failure (do not guess broadly)
|
|
99
|
+
- Re-run the failing step only
|
|
100
|
+
- If still failing after one fix attempt, stop and report — do not loop
|
|
101
|
+
|
|
102
|
+
### Step 6 — Push the branch
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
git push -u origin <issue-id>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Step 7 — Create the PR
|
|
109
|
+
|
|
110
|
+
Use `mcp__atlassian__createPullRequest` with:
|
|
111
|
+
- **workspace**: as provided in the invocation prompt
|
|
112
|
+
- **repo_slug**: as provided in the invocation prompt
|
|
113
|
+
- **title**: `[<ISSUE_ID>] <issue summary>`
|
|
114
|
+
- **description**:
|
|
115
|
+
```
|
|
116
|
+
## Summary
|
|
117
|
+
<1-3 bullet points: what was changed and why>
|
|
118
|
+
|
|
119
|
+
## Issue
|
|
120
|
+
[<ISSUE_ID>] <issue summary>
|
|
121
|
+
<Jira URL>/browse/<ISSUE_ID>
|
|
122
|
+
|
|
123
|
+
## Test plan
|
|
124
|
+
- [ ] dude lint: ✓
|
|
125
|
+
- [ ] tests: ✓
|
|
126
|
+
```
|
|
127
|
+
- **sourceBranch**: `<issue-id>`
|
|
128
|
+
- **destinationBranch**: `develop`
|
|
129
|
+
- **close_source_branch**: `true`
|
|
130
|
+
|
|
131
|
+
### Step 8 — Transition the Jira issue
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
mcp__atlassian__getTransitionsForJiraIssue(issueKey: <ISSUE_ID>)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Find the transition whose name contains "Review" or "Peer review" (case-insensitive).
|
|
138
|
+
Use its `id`:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
mcp__atlassian__transitionJiraIssue(issueKey: <ISSUE_ID>, transitionId: <id>)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
If no matching transition is found, skip silently.
|
|
145
|
+
|
|
146
|
+
### Step 9 — Report + notify
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
## Fix complete: <ISSUE_ID>
|
|
150
|
+
|
|
151
|
+
### Changes (N files)
|
|
152
|
+
- path/to/file — description of change
|
|
153
|
+
|
|
154
|
+
### Checks
|
|
155
|
+
- dude lint: ✓ / ✗
|
|
156
|
+
- tests: ✓ / ✗
|
|
157
|
+
|
|
158
|
+
### Pull request
|
|
159
|
+
<PR URL>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Then call `PushNotification` with the same summary.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Parallel mode
|
|
167
|
+
|
|
168
|
+
If the prompt contains **PARALLEL MODE**, this agent is one of several running
|
|
169
|
+
simultaneously via `isolation: "worktree"`. Each agent has its own isolated git
|
|
170
|
+
checkout — git operations never conflict between agents.
|
|
171
|
+
|
|
172
|
+
The following steps differ from the standard workflow:
|
|
173
|
+
|
|
174
|
+
| Step | Standard | Parallel mode |
|
|
175
|
+
|------|----------|---------------|
|
|
176
|
+
| **Step 2** | checkout develop, create branch | worktree already has a clean checkout; just run `git checkout -b <issue-id>` |
|
|
177
|
+
| **Step 5** | run lint + tests | **skip** — tests run once on the consolidated branch by `/fix-issues` |
|
|
178
|
+
| **Step 7** | create PR | **skip** — `/fix-issues` creates one consolidated PR |
|
|
179
|
+
| **Step 8** | transition Jira | **skip** — handled by `/fix-issues` after consolidation |
|
|
180
|
+
| **Step 9** | report + PushNotification | report branch name, files changed, commit hash; call `PushNotification` immediately |
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Rules
|
|
185
|
+
|
|
186
|
+
- Never commit directly to `develop` or `main`
|
|
187
|
+
- Never force-push
|
|
188
|
+
- Never skip hooks (`--no-verify`)
|
|
189
|
+
- If checks fail after one fix attempt, stop and report — do not keep retrying
|
|
190
|
+
- Do not create the PR if checks are failing
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-fixer
|
|
3
|
+
description: Fix a security Jira issue (SAST finding, CVE, dependency vulnerability) — fetch the ticket, apply a targeted fix on a dedicated branch, verify it passes lint and tests, and open a PR. Use only for issues labelled `security`.
|
|
4
|
+
tools: Bash, Read, Write, Edit, Grep, Glob, mcp__atlassian__getJiraIssue, mcp__atlassian__getTransitionsForJiraIssue, mcp__atlassian__transitionJiraIssue, mcp__atlassian__createPullRequest, mcp__atlassian__getRepository, PushNotification
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a security engineer working on this project. Your job is to fix a security Jira issue end-to-end: read the ticket, apply a minimal and targeted security fix on a dedicated branch, verify it passes lint and tests, and open a pull request.
|
|
9
|
+
|
|
10
|
+
## Project context
|
|
11
|
+
|
|
12
|
+
- Stack: Django REST Framework backend (`backend/`), React + Vite + TypeScript frontend (`frontend/`)
|
|
13
|
+
- Security scanners: bandit, semgrep (backend SAST), trivy-fs, trivy-image (dependencies/IaC)
|
|
14
|
+
- Jira URL: provided in the invocation prompt
|
|
15
|
+
- Bitbucket workspace and repo: provided in the invocation prompt
|
|
16
|
+
- Base branch: `develop`
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
### Step 1 — Fetch the issue
|
|
21
|
+
|
|
22
|
+
Use `mcp__atlassian__getJiraIssue` to read the issue. Extract:
|
|
23
|
+
- Summary (used as PR title)
|
|
24
|
+
- Description: parse `**Tool**`, `**Rule**`, `**Severity**`, `**File**`, `**Fingerprint**`, and the `## Description` section
|
|
25
|
+
- Labels
|
|
26
|
+
|
|
27
|
+
If the issue cannot be fetched, stop and report the error.
|
|
28
|
+
|
|
29
|
+
### Step 2 — Prepare the branch
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git fetch origin
|
|
33
|
+
git checkout develop && git pull origin develop --rebase
|
|
34
|
+
git checkout -b <issue-id>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Replace `<issue-id>` with the **lowercase** issue key (e.g. `proj-52`).
|
|
38
|
+
If the branch already exists locally, check it out and rebase onto develop.
|
|
39
|
+
|
|
40
|
+
### Step 3 — Implement the fix
|
|
41
|
+
|
|
42
|
+
Read the issue description carefully. Use the `**File**` and `**Rule**` fields to locate
|
|
43
|
+
the exact location. Apply a minimal, targeted fix — do not refactor surrounding code.
|
|
44
|
+
|
|
45
|
+
Security finding categories and how to handle each:
|
|
46
|
+
|
|
47
|
+
**SAST findings (bandit / semgrep)**
|
|
48
|
+
|
|
49
|
+
- Fix the exact line reported; do not refactor surrounding code
|
|
50
|
+
- Common patterns:
|
|
51
|
+
- Parameterised queries instead of f-strings or string concatenation
|
|
52
|
+
- `secrets.token_hex()` instead of `random.random()`
|
|
53
|
+
- `subprocess` with `shell=False` and explicit argument list
|
|
54
|
+
- Validated URL schemes before `urlopen`
|
|
55
|
+
- `hashlib.sha256` instead of `hashlib.md5` for security-sensitive digests
|
|
56
|
+
|
|
57
|
+
**Dependency CVEs (trivy)**
|
|
58
|
+
|
|
59
|
+
- Upgrade the dependency to a patched version in `backend/requirements.txt`
|
|
60
|
+
(or `pyproject.toml`) and/or `frontend/package.json`
|
|
61
|
+
- If no fixed version exists, document in the Jira issue and accept the finding
|
|
62
|
+
into the baseline instead of fixing it — do not guess at a safe version
|
|
63
|
+
|
|
64
|
+
**Static analysis suppression — when and how**
|
|
65
|
+
|
|
66
|
+
SAST tools perform _static_ analysis: they flag calls in isolation and cannot
|
|
67
|
+
trace runtime validation logic. When the fix validates input _around_ a flagged
|
|
68
|
+
call without removing the call itself, the scanner will still flag it. In that
|
|
69
|
+
case, add a suppression comment **on the same line** as the flagged statement
|
|
70
|
+
alongside the semantic fix — in the **same commit**, not as a follow-up.
|
|
71
|
+
|
|
72
|
+
When to add suppression comments:
|
|
73
|
+
|
|
74
|
+
- The flagged call is inherently dynamic (e.g. `urlopen(url)`, `logger.warning(..., exc)`)
|
|
75
|
+
- The fix validates/sanitises the input _before_ the call but cannot remove the call
|
|
76
|
+
- The value comes from trusted infrastructure (env vars, config), not user input
|
|
77
|
+
|
|
78
|
+
How to suppress:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
# bandit — one or more rule IDs, space-separated
|
|
82
|
+
urlopen(req) # nosec B310
|
|
83
|
+
|
|
84
|
+
# semgrep — full rule ID after the colon
|
|
85
|
+
urlopen(req) # nosemgrep: python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected
|
|
86
|
+
|
|
87
|
+
# both in the same line
|
|
88
|
+
urlopen(req) # nosec B310 # nosemgrep: python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Always add a one-line comment on the preceding line explaining _why_ suppression is safe:
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
# URL comes from BASE_URL env var (infrastructure-controlled) — scheme validated above.
|
|
95
|
+
urlopen(req, timeout=10) # nosec B310
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Do **not** use suppression as a first resort for HIGH/CRITICAL findings that can be
|
|
99
|
+
fixed structurally. Reserve it for cases where the semantic fix is correct but the
|
|
100
|
+
static tool cannot infer that correctness.
|
|
101
|
+
|
|
102
|
+
If the issue description is too vague to implement safely, stop and ask the user
|
|
103
|
+
for clarification before making changes.
|
|
104
|
+
|
|
105
|
+
### Step 4 — Commit
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
git add <file1> <file2> ...
|
|
109
|
+
git commit -m "fix(security): <rule_id> in <file>"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Commit message format (Conventional Commits):
|
|
113
|
+
- Type is always `fix`
|
|
114
|
+
- Scope is always `security`
|
|
115
|
+
- Description: lowercase, rule_id + affected file, no trailing period, max 72 chars total
|
|
116
|
+
- Do not add a `Co-Authored-By` trailer
|
|
117
|
+
|
|
118
|
+
### Step 5 — Run checks
|
|
119
|
+
|
|
120
|
+
Run in order. Stop at the first failure.
|
|
121
|
+
|
|
122
|
+
**Step 5a — Structural lint:**
|
|
123
|
+
```bash
|
|
124
|
+
dude lint
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Step 5b — Tests:**
|
|
128
|
+
Check the project for a test command (look at `Makefile`, `package.json` scripts,
|
|
129
|
+
or `dude help`). Run whichever is available:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
dude test
|
|
133
|
+
# or, if dude test is unavailable:
|
|
134
|
+
cd backend && python -m pytest
|
|
135
|
+
cd frontend && pnpm test --run
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
If checks fail:
|
|
139
|
+
- Read the error output carefully
|
|
140
|
+
- Attempt a fix directly related to the failure (do not guess broadly)
|
|
141
|
+
- Re-run the failing step only
|
|
142
|
+
- If still failing after one fix attempt, stop and report — do not loop
|
|
143
|
+
|
|
144
|
+
### Step 6 — Push the branch
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
git push -u origin <issue-id>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Step 7 — Create the PR
|
|
151
|
+
|
|
152
|
+
Use `mcp__atlassian__createPullRequest` with:
|
|
153
|
+
- **workspace**: as provided in the invocation prompt
|
|
154
|
+
- **repo_slug**: as provided in the invocation prompt
|
|
155
|
+
- **title**: `[<ISSUE_ID>] <issue summary>`
|
|
156
|
+
- **description**:
|
|
157
|
+
```
|
|
158
|
+
## Summary
|
|
159
|
+
<1-3 bullet points: what was changed and why>
|
|
160
|
+
|
|
161
|
+
## Security finding
|
|
162
|
+
- **Tool**: <tool>
|
|
163
|
+
- **Rule**: <rule_id>
|
|
164
|
+
- **Severity**: <severity>
|
|
165
|
+
- **File**: <file> (line <line>)
|
|
166
|
+
|
|
167
|
+
## Issue
|
|
168
|
+
[<ISSUE_ID>] <issue summary>
|
|
169
|
+
<Jira URL>/browse/<ISSUE_ID>
|
|
170
|
+
|
|
171
|
+
## Test plan
|
|
172
|
+
- [ ] dude lint: ✓
|
|
173
|
+
- [ ] tests: ✓
|
|
174
|
+
|
|
175
|
+
## Baseline
|
|
176
|
+
After this PR is merged, run `/verify-security-fixes <ISSUE_ID>` to remove
|
|
177
|
+
this finding from `security/baseline.json` and close the Jira issue.
|
|
178
|
+
```
|
|
179
|
+
- **sourceBranch**: `<issue-id>`
|
|
180
|
+
- **destinationBranch**: `develop`
|
|
181
|
+
- **close_source_branch**: `true`
|
|
182
|
+
|
|
183
|
+
### Step 8 — Transition the Jira issue
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
mcp__atlassian__getTransitionsForJiraIssue(issueKey: <ISSUE_ID>)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Find the transition whose name contains "Review" or "Peer review" (case-insensitive).
|
|
190
|
+
Use its `id`:
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
mcp__atlassian__transitionJiraIssue(issueKey: <ISSUE_ID>, transitionId: <id>)
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
If no matching transition is found, skip silently.
|
|
197
|
+
|
|
198
|
+
### Step 9 — Report + notify
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
## Security fix complete: <ISSUE_ID>
|
|
202
|
+
|
|
203
|
+
### Finding
|
|
204
|
+
Tool: <tool> Rule: <rule_id> File: <file>:<line>
|
|
205
|
+
|
|
206
|
+
### Changes (N files)
|
|
207
|
+
- path/to/file — description of change
|
|
208
|
+
- (suppression comment added: <reason>) ← if applicable
|
|
209
|
+
|
|
210
|
+
### Checks
|
|
211
|
+
- dude lint: ✓ / ✗
|
|
212
|
+
- tests: ✓ / ✗
|
|
213
|
+
|
|
214
|
+
### Pull request
|
|
215
|
+
<PR URL>
|
|
216
|
+
|
|
217
|
+
### Next step
|
|
218
|
+
After merging: run `/verify-security-fixes <ISSUE_ID>`
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Then call `PushNotification` with the same summary.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Parallel mode
|
|
226
|
+
|
|
227
|
+
If the prompt contains **PARALLEL MODE**, this agent is one of several running
|
|
228
|
+
simultaneously via `isolation: "worktree"`. Each agent has its own isolated git
|
|
229
|
+
checkout — git operations never conflict between agents.
|
|
230
|
+
|
|
231
|
+
The following steps differ from the standard workflow:
|
|
232
|
+
|
|
233
|
+
| Step | Standard | Parallel mode |
|
|
234
|
+
|------|----------|---------------|
|
|
235
|
+
| **Step 2** | checkout develop, create branch | worktree already has a clean checkout; just run `git checkout -b <issue-id>` |
|
|
236
|
+
| **Step 5** | run lint + tests | **skip** — tests run once on the consolidated branch by `/fix-issues` |
|
|
237
|
+
| **Step 7** | create PR | **skip** — `/fix-issues` creates one consolidated PR |
|
|
238
|
+
| **Step 8** | transition Jira | **skip** — handled by `/fix-issues` after consolidation |
|
|
239
|
+
| **Step 9** | report + PushNotification | report branch name, files changed, commit hash; call `PushNotification` immediately |
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Rules
|
|
244
|
+
|
|
245
|
+
- Never commit directly to `develop` or `main`
|
|
246
|
+
- Never force-push
|
|
247
|
+
- Never skip hooks (`--no-verify`)
|
|
248
|
+
- Do not suppress findings without also applying the semantic fix
|
|
249
|
+
- If checks fail after one fix attempt, stop and report — do not keep retrying
|
|
250
|
+
- Do not create the PR if checks are failing
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# BE001 — App registration parity (error)
|
|
2
|
+
|
|
3
|
+
Every Django app under `backend/apps/<name>/` (any directory containing an `apps.py`) must be registered as `"apps.<name>"` in the `LOCAL_APPS` list of `config/settings/base.py`, and every `LOCAL_APPS` entry must have a matching directory on disk.
|
|
4
|
+
|
|
5
|
+
An unregistered app silently ships dead code (models never migrated, urls never mounted); a stale entry crashes Django at boot.
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
# ✅ config/settings/base.py
|
|
9
|
+
LOCAL_APPS = [
|
|
10
|
+
"apps.core",
|
|
11
|
+
"apps.users",
|
|
12
|
+
]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
# ❌ backend/apps/reports/ exists but LOCAL_APPS lacks "apps.reports"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Fix**: add the app to `LOCAL_APPS` (or delete the leftover directory/entry).
|