@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,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-route
|
|
3
|
+
description: Scaffold a new backend API endpoint (Django REST Framework). Asks for the resource, HTTP method(s) and response shape, surveys existing apps/serializers/services for reuse, then creates or extends a Django app (model, serializer, service, view, urls, migration, tests), wires it into config/urls.py, and regenerates the typed frontend client — all enforcing the backend BE rules.
|
|
4
|
+
disable-model-invocation: false
|
|
5
|
+
allowed-tools: "Read Write Edit Glob Grep Bash(dude *) Bash(find *) Bash(cat *) Bash(grep *) Bash(ls *)"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Create Route
|
|
9
|
+
|
|
10
|
+
Guided creation of a backend API endpoint that satisfies every backend rule in
|
|
11
|
+
`.claude/rules/BE/`. The skill **inspects the existing codebase first** so new
|
|
12
|
+
code reuses existing apps, serializers and services instead of duplicating them.
|
|
13
|
+
|
|
14
|
+
> Read `.claude/rules/BE/001.md`–`014.md` once at the start — they are the
|
|
15
|
+
> source of truth. The summary below tracks them but the rule files win.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Step 0 — Locate the project
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
find . -maxdepth 3 -name "dude.json" | head -1
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Set `PROJECT_ROOT` to the directory containing `dude.json`. If missing, stop
|
|
26
|
+
with _"No dude.json found — are you inside a dude project?"_.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Step 1 — Gather requirements
|
|
31
|
+
|
|
32
|
+
Ask only for what the user hasn't already provided:
|
|
33
|
+
|
|
34
|
+
1. **Resource** — e.g. `todos`, `orders`, `users/me`.
|
|
35
|
+
2. **Method(s)** — list/retrieve (GET), create (POST), update (PUT/PATCH),
|
|
36
|
+
destroy (DELETE). A ViewSet can expose any subset via mixins.
|
|
37
|
+
3. **Response shape** — fields the serializer should expose.
|
|
38
|
+
4. **Persistence?** — a new model, an existing model, or stateless.
|
|
39
|
+
5. **Permissions** — who may call it (`AllowAny`, `IsAuthenticated`, custom).
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Step 2 — Survey the existing code (reuse before create)
|
|
44
|
+
|
|
45
|
+
Run these and **read the relevant matches** before proposing anything:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ls "$PROJECT_ROOT"/backend/apps/
|
|
49
|
+
ls "$PROJECT_ROOT"/backend/apps/*/models.py "$PROJECT_ROOT"/backend/apps/*/serializers.py 2>/dev/null
|
|
50
|
+
grep -n include "$PROJECT_ROOT"/backend/config/urls.py
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- **Existing app** — if the resource belongs to an existing domain (e.g. a
|
|
54
|
+
`users` sub-resource), extend that app instead of creating a new one.
|
|
55
|
+
- **Existing serializer/model** — reuse before creating; add fields to the
|
|
56
|
+
explicit `fields` tuple (BE002) rather than cloning serializers.
|
|
57
|
+
- **Existing service** — writes live in `services.py` (BE005); add a function
|
|
58
|
+
to the existing module when the domain matches.
|
|
59
|
+
|
|
60
|
+
Report what you found and what you intend to reuse.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Step 3 — Plan the file set (confirm before writing)
|
|
65
|
+
|
|
66
|
+
A **new app** touches all of these; extending an existing app touches a subset.
|
|
67
|
+
|
|
68
|
+
| File | Rule | Purpose |
|
|
69
|
+
|------|------|---------|
|
|
70
|
+
| `apps/<app>/apps.py` | BE001 | AppConfig (`name = "apps.<app>"`) |
|
|
71
|
+
| `config/settings/base.py` | BE001 | add `"apps.<app>"` to `LOCAL_APPS` |
|
|
72
|
+
| `apps/<app>/models.py` | BE009, BE010, BE011 | model with `__str__` + `Meta.ordering`; no `null=True` on text fields; `related_name` on relations |
|
|
73
|
+
| `apps/<app>/migrations/0001_….py` | BE006 | generated with `dude db makemigration --app <app>` and committed |
|
|
74
|
+
| `apps/<app>/serializers.py` | BE002 | explicit `fields` tuple — never `"__all__"` |
|
|
75
|
+
| `apps/<app>/services.py` | BE005 | all ORM writes (create/update/delete) |
|
|
76
|
+
| `apps/<app>/views.py` | BE003, BE013 | ViewSet/APIView with explicit `permission_classes` and `serializer_class` (or `@extend_schema`) |
|
|
77
|
+
| `apps/<app>/urls.py` | BE008 | `app_name = "<app>"` + DRF router |
|
|
78
|
+
| `config/urls.py` | BE008 | `path("api/", include("apps.<app>.urls"))` |
|
|
79
|
+
| `apps/<app>/admin.py` | — | register the model |
|
|
80
|
+
| `apps/<app>/tests/test_*.py` | BE014 | model + view tests (pytest-django, `APIClient`) |
|
|
81
|
+
|
|
82
|
+
Skip rows that don't apply. Present the list, then wait for an OK.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Step 4 — Implement
|
|
87
|
+
|
|
88
|
+
Follow the existing patterns exactly — `apps/users/` is the reference app.
|
|
89
|
+
Reference shapes:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
# apps/todos/views.py — reads via the queryset, writes via services (BE005)
|
|
93
|
+
class TodoViewSet(CreateModelMixin, ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
|
94
|
+
"""List, retrieve and create todos."""
|
|
95
|
+
|
|
96
|
+
queryset = Todo.objects.all()
|
|
97
|
+
serializer_class = TodoSerializer # BE013
|
|
98
|
+
permission_classes = [IsAuthenticated] # BE003 — always explicit
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
# apps/todos/serializers.py — explicit fields (BE002); create delegates to the service
|
|
103
|
+
class TodoSerializer(serializers.ModelSerializer):
|
|
104
|
+
class Meta:
|
|
105
|
+
model = Todo
|
|
106
|
+
fields = ("id", "title", "done", "created_at")
|
|
107
|
+
read_only_fields = ("id", "created_at")
|
|
108
|
+
|
|
109
|
+
def create(self, validated_data: dict) -> Todo:
|
|
110
|
+
return create_todo(**validated_data)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Constraints to honour while writing:
|
|
114
|
+
- No raw SQL anywhere (BE004); no `print()` — use `logging` (BE012).
|
|
115
|
+
- Settings values come from `environ` — never hard-code secrets (BE007).
|
|
116
|
+
- drf-spectacular: custom actions/`APIView`s get `@extend_schema` so the
|
|
117
|
+
OpenAPI schema stays typed (BE013).
|
|
118
|
+
- Write meaningful tests (don't just assert 200) mirroring
|
|
119
|
+
`apps/users/tests/test_views.py` style.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Step 5 — Migrate + validate
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
cd "$PROJECT_ROOT"
|
|
127
|
+
dude db makemigration --app <app> # generate the migration (BE006) — commit it
|
|
128
|
+
dude db migrate # apply locally
|
|
129
|
+
dude lint # must pass — fix any BE rule violations
|
|
130
|
+
dude api sync # regenerate frontend/src/openapi/ from /api/schema/
|
|
131
|
+
dude test --backend # run the new tests
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
If `dude lint` reports a violation, fix it and re-run before continuing. After
|
|
135
|
+
`dude api sync` the new endpoint is available to the frontend as
|
|
136
|
+
`@/openapi/api/<resource>` (`$get`, `$post`, …).
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Step 6 — Report
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
Route created
|
|
144
|
+
═════════════════════════════════════════
|
|
145
|
+
Endpoint <METHOD> /api/<resource>/
|
|
146
|
+
App backend/apps/<app>/ (created | extended)
|
|
147
|
+
Registered LOCAL_APPS + config/urls.py
|
|
148
|
+
Model <created | reused | n/a> (+ migration committed)
|
|
149
|
+
Serializer <created | reused>
|
|
150
|
+
Service <created | extended | n/a>
|
|
151
|
+
Tests apps/<app>/tests/test_views.py (+ test_models.py)
|
|
152
|
+
─────────────────────────────────────────
|
|
153
|
+
dude lint: ✓
|
|
154
|
+
dude api sync: ✓ → @/openapi/api/<resource>
|
|
155
|
+
Next: wire it into a page with /create-page
|
|
156
|
+
```
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: draft-email
|
|
3
|
+
description: Draft a formal email and save it as a Markdown file in private/messages/. Use when asked to write, draft, or compose an email.
|
|
4
|
+
disable-model-invocation: false
|
|
5
|
+
allowed-tools: "Write Read Bash(date) Bash(ls *) Bash(git *)"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Draft Formal Email
|
|
9
|
+
|
|
10
|
+
## Context
|
|
11
|
+
|
|
12
|
+
!`date "+%Y-%m-%d"`
|
|
13
|
+
!`git branch --show-current`
|
|
14
|
+
!`ls private/messages/ 2>/dev/null || echo "(no existing messages)"`
|
|
15
|
+
|
|
16
|
+
## Conventions
|
|
17
|
+
|
|
18
|
+
**File format:**
|
|
19
|
+
```markdown
|
|
20
|
+
# Email — <short description of the email>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
**To:** <recipient name or role>
|
|
25
|
+
**Cc:** <if applicable — omit line if not needed>
|
|
26
|
+
**Subject:** <Project name — concise subject>
|
|
27
|
+
**Date:** <YYYY-MM-DD>
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
<body>
|
|
32
|
+
|
|
33
|
+
Best regards,
|
|
34
|
+
<Your Name>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Filename:** `private/messages/<kebab-case-description>.md`
|
|
38
|
+
- Descriptive, not generic: `api-handover.md`, `deploy-blocker.md`
|
|
39
|
+
- No date prefix in filename
|
|
40
|
+
|
|
41
|
+
**Tone and style:**
|
|
42
|
+
- Formal but not stiff — direct, professional, collegial
|
|
43
|
+
- English
|
|
44
|
+
- No filler phrases ("I hope this email finds you well", "Please feel free to")
|
|
45
|
+
- Lead with the main point, provide context after
|
|
46
|
+
- Use Markdown formatting (bold, bullet lists) where it aids clarity
|
|
47
|
+
|
|
48
|
+
**Signature:** always `Best regards,\n<Your Name>`
|
|
49
|
+
|
|
50
|
+
> **Note**: replace `<Your Name>` with your actual name the first time you use this skill in a new project — or update this file to hardcode it.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Step 1 — Gather information
|
|
55
|
+
|
|
56
|
+
Before drafting, make sure you have:
|
|
57
|
+
- **Recipient** (name, role, or team)
|
|
58
|
+
- **Purpose** (what action or information is this email for?)
|
|
59
|
+
- **Key points** to cover (listed by the user, or inferred from context)
|
|
60
|
+
- **Tone** (default: formal — adjust if user says "friendly" or "assertive")
|
|
61
|
+
- **Attachments or references** to mention (links, docs, issues)
|
|
62
|
+
|
|
63
|
+
If any of these is unclear and cannot be inferred from context, ask before drafting.
|
|
64
|
+
|
|
65
|
+
## Step 2 — Draft the email
|
|
66
|
+
|
|
67
|
+
Write the full email following the format above. Apply these structural rules by purpose:
|
|
68
|
+
|
|
69
|
+
**Informational / handover email** (sharing deliverables, status updates):
|
|
70
|
+
- Open with what you are sharing and why
|
|
71
|
+
- Provide relevant context or background the recipient needs
|
|
72
|
+
- List key details, constraints, or next steps clearly
|
|
73
|
+
- Close with an offer to clarify or reconnect
|
|
74
|
+
|
|
75
|
+
**Request / action required email** (asking for something, flagging a blocker):
|
|
76
|
+
- Open with the specific request or issue — one sentence
|
|
77
|
+
- Explain why it is needed and the impact if not addressed
|
|
78
|
+
- Provide all information the recipient needs to act (no back-and-forth)
|
|
79
|
+
- State a deadline or urgency level if applicable
|
|
80
|
+
- Close with a clear call to action
|
|
81
|
+
|
|
82
|
+
**Follow-up / reminder email**:
|
|
83
|
+
- Reference the previous communication briefly
|
|
84
|
+
- State what is still pending and why it matters now
|
|
85
|
+
- Keep it short — no need to repeat full context already shared
|
|
86
|
+
|
|
87
|
+
**Technical clarification email** (explaining architecture, processes, decisions):
|
|
88
|
+
- Lead with the conclusion or recommendation, then explain
|
|
89
|
+
- Use structured sections (##) for complex topics
|
|
90
|
+
- Include concrete examples, file paths, or command references where helpful
|
|
91
|
+
- Anticipate follow-up questions and address them proactively
|
|
92
|
+
|
|
93
|
+
## Step 3 — Review
|
|
94
|
+
|
|
95
|
+
Show the drafted email in full. Ask the user:
|
|
96
|
+
> "Does this look right, or would you like to adjust the tone, add/remove points, or change any details?"
|
|
97
|
+
|
|
98
|
+
Wait for explicit confirmation or edits before saving.
|
|
99
|
+
|
|
100
|
+
## Step 4 — Save
|
|
101
|
+
|
|
102
|
+
Save the file to `private/messages/<kebab-case-description>.md`.
|
|
103
|
+
|
|
104
|
+
Confirm: show the filename and the first line of the saved content.
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fix-issues
|
|
3
|
+
description: Fix 1–5 Jira issues. Single-issue uses a standard flow; multiple issues run parallel agents in isolated git worktrees, then consolidate into one branch and open a PR.
|
|
4
|
+
disable-model-invocation: false
|
|
5
|
+
allowed-tools: "Bash(git *) Bash(dude *) Bash(docker *) Bash(cat *) Bash(find *) Read Write mcp__atlassian__getJiraIssue mcp__atlassian__getTransitionsForJiraIssue mcp__atlassian__transitionJiraIssue mcp__atlassian__addCommentToJiraIssue mcp__atlassian__createPullRequest mcp__atlassian__getRepository PushNotification"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Fix Issues (Router + Parallel + Consolidation)
|
|
9
|
+
|
|
10
|
+
Fixes 1–5 Jira issues. For a single issue a standard single-agent flow is
|
|
11
|
+
used. For multiple issues, agents run in parallel using isolated git worktrees
|
|
12
|
+
and their branches are merged into one consolidated branch before the PR is
|
|
13
|
+
created.
|
|
14
|
+
|
|
15
|
+
Each issue is routed to the appropriate agent based on its labels:
|
|
16
|
+
- Issues labelled `security` → **`security-fixer`** agent
|
|
17
|
+
- All other issues (features, bugs, tasks) → **`issue-fixer`** agent
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
/fix-issues PROJ-52
|
|
23
|
+
/fix-issues PROJ-52 PROJ-55 PROJ-59
|
|
24
|
+
/fix-issues PROJ-52 PROJ-53 PROJ-54 PROJ-57 PROJ-60
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Validation
|
|
28
|
+
|
|
29
|
+
If more than 5 issue IDs are provided, stop and ask the user to split the
|
|
30
|
+
request into batches of at most 5.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Step 0 — Autodiscovery
|
|
35
|
+
|
|
36
|
+
### Project root
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
find . -maxdepth 3 -name "dude.json" | head -1
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If not found, report: _"No dude.json found — are you inside a dude project?"_ and stop.
|
|
43
|
+
|
|
44
|
+
### Jira + Bitbucket configuration
|
|
45
|
+
|
|
46
|
+
Read `## Saved configuration` at the bottom of this file.
|
|
47
|
+
|
|
48
|
+
- If `workspace`, `repo`, and `jira-project` keys are present, use them silently.
|
|
49
|
+
- If any are absent, ask:
|
|
50
|
+
- **"What is the Bitbucket workspace slug?"** (e.g. `myteam`)
|
|
51
|
+
- **"What is the repository slug?"** (e.g. `my-project`)
|
|
52
|
+
- **"What is the Jira project key?"** (e.g. `PROJ`)
|
|
53
|
+
- Then offer to save all three in this file's `## Saved configuration` section.
|
|
54
|
+
|
|
55
|
+
Resolve automatically:
|
|
56
|
+
- **Jira URL**: `getAccessibleAtlassianResources` → first site URL
|
|
57
|
+
- **Current user**: `atlassianUserInfo` → display name (used in PR description)
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Phase 0 — Route: fetch issues and pick agents
|
|
62
|
+
|
|
63
|
+
Before launching any fix agent, fetch all issues with `getJiraIssue`
|
|
64
|
+
(in parallel if N>1) and read `labels` for each.
|
|
65
|
+
|
|
66
|
+
For each issue, select the agent:
|
|
67
|
+
- `labels` contains `security` → `security-fixer`
|
|
68
|
+
- otherwise → `issue-fixer`
|
|
69
|
+
|
|
70
|
+
Build a per-issue map: `{ issue_id: agent_type }`.
|
|
71
|
+
|
|
72
|
+
### Branch naming
|
|
73
|
+
|
|
74
|
+
- **Single issue (N=1)**: branch = lowercase issue key (e.g. `proj-52`)
|
|
75
|
+
- **Multiple issues (N>1)**:
|
|
76
|
+
- Individual branches: lowercase issue key per agent
|
|
77
|
+
- Consolidated branch: `fix/<key1>-<key2>-...` (keys sorted numerically)
|
|
78
|
+
- If **all** issues are security-labelled: `security/<key1>-<key2>-...`
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Phase 1 — Fix agents (parallel for N>1, single for N=1)
|
|
83
|
+
|
|
84
|
+
Launch one agent **per issue** in the **same message** (so they run in parallel
|
|
85
|
+
when N>1), using the agent type determined in Phase 0. Each agent uses
|
|
86
|
+
`isolation: "worktree"` to get its own isolated git checkout.
|
|
87
|
+
|
|
88
|
+
Prompt template for each agent:
|
|
89
|
+
|
|
90
|
+
> Fix Jira issue `<ISSUE_ID>` in PARALLEL MODE.
|
|
91
|
+
>
|
|
92
|
+
> Project root: `<PROJECT_ROOT>`
|
|
93
|
+
> Jira URL: `<JIRA_URL>`
|
|
94
|
+
> Bitbucket workspace: `<workspace>`, repo: `<repo>`
|
|
95
|
+
>
|
|
96
|
+
> PARALLEL MODE: create branch `<issue-id>` from `develop`, apply fix, push.
|
|
97
|
+
> Do NOT create a PR. Do NOT transition the Jira issue.
|
|
98
|
+
|
|
99
|
+
Wait for **all agents** to finish before proceeding.
|
|
100
|
+
|
|
101
|
+
Collect from each agent:
|
|
102
|
+
- Branch name pushed
|
|
103
|
+
- Files changed
|
|
104
|
+
- Commit hash
|
|
105
|
+
- Any `BLOCKED: <reason>` if the agent could not complete the fix
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Phase 2 — Consolidation (N>1 only)
|
|
110
|
+
|
|
111
|
+
For a **single issue**, skip this phase — go directly to Phase 3 using the
|
|
112
|
+
agent's own branch.
|
|
113
|
+
|
|
114
|
+
For **multiple issues**, collect branch names, then:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
git fetch origin
|
|
118
|
+
git checkout develop && git pull origin develop --rebase
|
|
119
|
+
git checkout -b fix/<key1>-<key2>-...
|
|
120
|
+
|
|
121
|
+
git merge --no-ff <key1>
|
|
122
|
+
git merge --no-ff <key2>
|
|
123
|
+
# … one per agent branch
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
If any merge produces a conflict:
|
|
127
|
+
- Report which branch caused it and the conflicting files.
|
|
128
|
+
- Stop — do **not** force-push or discard changes.
|
|
129
|
+
- Ask the user how to proceed.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Phase 3 — Tests
|
|
134
|
+
|
|
135
|
+
Run on the consolidated branch (or the single agent branch):
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
dude lint
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
If the project has a test command (check `Makefile`, `package.json` scripts, or
|
|
142
|
+
`dude help`), run it next:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
dude test # if available
|
|
146
|
+
# or:
|
|
147
|
+
cd backend && python -m pytest
|
|
148
|
+
cd frontend && pnpm test
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
If any step fails, report the output and stop — do **not** create a PR.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Phase 4 — Push and create one PR
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
git push -u origin <source-branch>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Create a pull request via `createPullRequest`:
|
|
162
|
+
|
|
163
|
+
- **Title**:
|
|
164
|
+
- N=1: `[<ISSUE_ID>] <issue summary>`
|
|
165
|
+
- N>1: `[<KEY1>, <KEY2>, …] <short batch description>`
|
|
166
|
+
- **Source branch**: `<source-branch>`
|
|
167
|
+
- **Destination branch**: `develop`
|
|
168
|
+
- **Description**:
|
|
169
|
+
```
|
|
170
|
+
## Summary
|
|
171
|
+
<bullet points per issue: what was changed and why>
|
|
172
|
+
|
|
173
|
+
## Issues
|
|
174
|
+
- [<ISSUE_ID>] <summary> — <Jira URL>/<ISSUE_ID>
|
|
175
|
+
- …
|
|
176
|
+
|
|
177
|
+
## Test plan
|
|
178
|
+
- [ ] dude lint: ✓
|
|
179
|
+
- [ ] tests: ✓
|
|
180
|
+
```
|
|
181
|
+
- **Close source branch**: `true`
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Phase 5 — Transition all Jira issues
|
|
186
|
+
|
|
187
|
+
For each issue, call `getTransitionsForJiraIssue` → find a transition whose
|
|
188
|
+
name contains "Review" or "Peer review" (case-insensitive) →
|
|
189
|
+
`transitionJiraIssue`.
|
|
190
|
+
|
|
191
|
+
If no matching transition is found (the workflow may differ), skip silently.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Phase 6 — Report
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
Fix complete
|
|
199
|
+
══════════════════════════════════════════════════════
|
|
200
|
+
|
|
201
|
+
Branch
|
|
202
|
+
<branch-name>
|
|
203
|
+
|
|
204
|
+
Issues (N)
|
|
205
|
+
<KEY> [issue-fixer] — commit <hash> — <description>
|
|
206
|
+
<KEY> [security-fixer] — commit <hash> — <description>
|
|
207
|
+
|
|
208
|
+
Tests
|
|
209
|
+
dude lint: ✓
|
|
210
|
+
dude test: ✓
|
|
211
|
+
|
|
212
|
+
Pull request
|
|
213
|
+
<PR URL>
|
|
214
|
+
|
|
215
|
+
Jira
|
|
216
|
+
<KEY> → In Review
|
|
217
|
+
<KEY> → In Review
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Notes
|
|
223
|
+
|
|
224
|
+
- Each agent runs in its own git worktree (`isolation: "worktree"`) — git
|
|
225
|
+
operations never conflict during Phase 1.
|
|
226
|
+
- `security/baseline.json` is **not** touched by individual agents. Baseline
|
|
227
|
+
cleanup is handled by `verify-security-fixes` after the PR is merged.
|
|
228
|
+
- Each agent calls `PushNotification` when it completes so you are notified
|
|
229
|
+
immediately as each fix lands.
|
|
230
|
+
- Agents marked `BLOCKED` are reported in Phase 6 but do not prevent the PR
|
|
231
|
+
from being created for the remaining issues.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
<!-- ------------------------------------------------------------------ -->
|
|
236
|
+
<!-- Everything below this line is written automatically by the skill. -->
|
|
237
|
+
<!-- Do not edit manually. -->
|
|
238
|
+
<!-- ------------------------------------------------------------------ -->
|