@cubocicloide/stack-react-fastapi 13.0.6
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 +95 -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 +30 -0
- package/dist/commands/lint/checks/BE/002.js.map +1 -0
- package/dist/commands/lint/checks/BE/003.d.ts +11 -0
- package/dist/commands/lint/checks/BE/003.js +46 -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 +27 -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 +107 -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 +27 -0
- package/dist/commands/lint/checks/BE/006.js.map +1 -0
- package/dist/commands/lint/checks/BE/007.d.ts +31 -0
- package/dist/commands/lint/checks/BE/007.js +109 -0
- package/dist/commands/lint/checks/BE/007.js.map +1 -0
- package/dist/commands/lint/checks/BE/008.d.ts +12 -0
- package/dist/commands/lint/checks/BE/008.js +57 -0
- package/dist/commands/lint/checks/BE/008.js.map +1 -0
- package/dist/commands/lint/checks/BE/009.d.ts +12 -0
- package/dist/commands/lint/checks/BE/009.js +104 -0
- package/dist/commands/lint/checks/BE/009.js.map +1 -0
- package/dist/commands/lint/checks/BE/010.d.ts +12 -0
- package/dist/commands/lint/checks/BE/010.js +54 -0
- package/dist/commands/lint/checks/BE/010.js.map +1 -0
- package/dist/commands/lint/checks/BE/011.d.ts +16 -0
- package/dist/commands/lint/checks/BE/011.js +46 -0
- package/dist/commands/lint/checks/BE/011.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 +3491 -0
- package/dist/index.js.map +1 -0
- package/dude.stack.json +7 -0
- package/package.json +43 -0
- package/templates/aws-eks/backend/Dockerfile.prod.hbs +22 -0
- package/templates/aws-eks/docs/docs/deploy.md.hbs +159 -0
- package/templates/aws-eks/frontend/Dockerfile.prod +28 -0
- package/templates/aws-eks/frontend/nginx.conf +19 -0
- package/templates/aws-eks/iac/README.md.hbs +311 -0
- package/templates/aws-eks/iac/_gitignore +24 -0
- package/templates/aws-eks/iac/helm/app/.helmignore +7 -0
- package/templates/aws-eks/iac/helm/app/Chart.yaml.hbs +6 -0
- package/templates/aws-eks/iac/helm/app/templates/NOTES.txt +23 -0
- package/templates/aws-eks/iac/helm/app/templates/backend-deployment.yaml +44 -0
- package/templates/aws-eks/iac/helm/app/templates/backend-service.yaml +16 -0
- package/templates/aws-eks/iac/helm/app/templates/celery-beat-deployment.yaml +34 -0
- package/templates/aws-eks/iac/helm/app/templates/celery-worker-deployment.yaml +31 -0
- package/templates/aws-eks/iac/helm/app/templates/configmap.yaml +15 -0
- package/templates/aws-eks/iac/helm/app/templates/flower-deployment.yaml +28 -0
- package/templates/aws-eks/iac/helm/app/templates/flower-service.yaml +19 -0
- package/templates/aws-eks/iac/helm/app/templates/frontend-deployment.yaml +34 -0
- package/templates/aws-eks/iac/helm/app/templates/frontend-service.yaml +16 -0
- package/templates/aws-eks/iac/helm/app/templates/helpers.tpl +90 -0
- package/templates/aws-eks/iac/helm/app/templates/hpa.yaml +23 -0
- package/templates/aws-eks/iac/helm/app/templates/ingress.yaml +30 -0
- package/templates/aws-eks/iac/helm/app/templates/migration-job.yaml +38 -0
- package/templates/aws-eks/iac/helm/app/templates/redis-deployment.yaml +33 -0
- package/templates/aws-eks/iac/helm/app/templates/redis-service.yaml +18 -0
- package/templates/aws-eks/iac/helm/app/templates/secret.yaml +17 -0
- package/templates/aws-eks/iac/helm/app/templates/serviceaccount.yaml +12 -0
- package/templates/aws-eks/iac/helm/app/values-dev.yaml.hbs +35 -0
- package/templates/aws-eks/iac/helm/app/values.yaml.hbs +130 -0
- package/templates/aws-eks/iac/runner/Dockerfile +53 -0
- package/templates/aws-eks/iac/terraform/bootstrap/main.tf.hbs +101 -0
- package/templates/aws-eks/iac/terraform/bootstrap/outputs.tf +19 -0
- package/templates/aws-eks/iac/terraform/bootstrap/variables.tf.hbs +17 -0
- package/templates/aws-eks/iac/terraform/environments/dev/backend.hcl.hbs +12 -0
- package/templates/aws-eks/iac/terraform/environments/dev/terraform.tfvars.hbs +32 -0
- package/templates/aws-eks/iac/terraform/main.tf.hbs +305 -0
- package/templates/aws-eks/iac/terraform/outputs.tf.hbs +52 -0
- package/templates/aws-eks/iac/terraform/providers.tf +47 -0
- package/templates/aws-eks/iac/terraform/variables.tf.hbs +181 -0
- package/templates/aws-eks/iac/terraform/versions.tf +27 -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 +25 -0
- package/templates/base/.claude/rules/BE/002.md +15 -0
- package/templates/base/.claude/rules/BE/003.md +18 -0
- package/templates/base/.claude/rules/BE/004.md +14 -0
- package/templates/base/.claude/rules/BE/005.md +15 -0
- package/templates/base/.claude/rules/BE/006.md +17 -0
- package/templates/base/.claude/rules/BE/007.md +21 -0
- package/templates/base/.claude/rules/BE/008.md +19 -0
- package/templates/base/.claude/rules/BE/009.md +27 -0
- package/templates/base/.claude/rules/BE/010.md +16 -0
- package/templates/base/.claude/rules/BE/011.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 +199 -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 +364 -0
- package/templates/base/README.md.hbs +187 -0
- package/templates/base/_env.example.hbs +29 -0
- package/templates/base/_env.hbs +25 -0
- package/templates/base/_gitignore +31 -0
- package/templates/base/_npmrc +2 -0
- package/templates/base/backend/Dockerfile.hbs +22 -0
- package/templates/base/backend/README.md.hbs +74 -0
- package/templates/base/backend/_dockerignore +11 -0
- package/templates/base/backend/app/__init__.py +1 -0
- package/templates/base/backend/app/core/__init__.py +0 -0
- package/templates/base/backend/app/core/config.py.hbs +23 -0
- package/templates/base/backend/app/fixtures/__init__.py +0 -0
- package/templates/base/backend/app/main.py.hbs +41 -0
- package/templates/base/backend/app/management/__init__.py +0 -0
- package/templates/base/backend/app/models/__init__.py +0 -0
- package/templates/base/backend/app/queries/__init__.py +0 -0
- package/templates/base/backend/app/routers/__init__.py +0 -0
- package/templates/base/backend/app/routers/health.py +13 -0
- package/templates/base/backend/app/schemas/__init__.py +0 -0
- package/templates/base/backend/app/schemas/health.py +7 -0
- package/templates/base/backend/app/tasks/__init__.py +1 -0
- package/templates/base/backend/app/tests/__init__.py +0 -0
- package/templates/base/backend/app/tests/conftest.py +13 -0
- package/templates/base/backend/app/tests/models/__init__.py +0 -0
- package/templates/base/backend/app/tests/queries/__init__.py +0 -0
- package/templates/base/backend/app/tests/routers/__init__.py +0 -0
- package/templates/base/backend/app/tests/routers/test_health.py +10 -0
- package/templates/base/backend/app/tests/tasks/__init__.py +1 -0
- package/templates/base/backend/app/tests/utils/__init__.py +0 -0
- package/templates/base/backend/app/utils/__init__.py +0 -0
- package/templates/base/backend/pyproject.toml.hbs +40 -0
- package/templates/base/docker-compose.yml.hbs +128 -0
- package/templates/base/docs/docs/api.md +21 -0
- package/templates/base/docs/docs/dude.md.hbs +316 -0
- package/templates/base/docs/docs/index.md.hbs +100 -0
- package/templates/base/docs/docs/mkdocs.md +238 -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.hbs +10 -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.hbs +40 -0
- package/templates/base/frontend/src/main.tsx +10 -0
- package/templates/base/frontend/src/openapi/utils/openapi.yaml.hbs +28 -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/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/app/tasks/__init__.py +1 -0
- package/templates/celery/backend/app/tasks/example.py +21 -0
- package/templates/celery/backend/app/tests/tasks/test_example.py +7 -0
- package/templates/celery/backend/app/worker.py.hbs +33 -0
- package/templates/celerybeat/backend/app/tasks/scheduled.py +16 -0
- package/templates/celerybeat/backend/app/tests/tasks/test_scheduled.py +7 -0
- package/templates/postgres/.dude/commands/reset.ts +76 -0
- package/templates/postgres/backend/alembic/env.py +55 -0
- package/templates/postgres/backend/alembic/script.py.mako +27 -0
- package/templates/postgres/backend/alembic/versions/0001_create_user_table.py +38 -0
- package/templates/postgres/backend/alembic.ini +42 -0
- package/templates/postgres/backend/app/core/database.py +15 -0
- package/templates/postgres/backend/app/models/__init__.py +5 -0
- package/templates/postgres/backend/app/models/user.py +15 -0
- package/templates/postgres/backend/app/queries/__init__.py +5 -0
- package/templates/postgres/backend/app/queries/users.py +18 -0
- package/templates/postgres/backend/app/routers/users.py +19 -0
- package/templates/postgres/backend/app/routers/users__id.py +20 -0
- package/templates/postgres/backend/app/tests/conftest.py +33 -0
- package/templates/postgres/backend/app/tests/models/test_user.py +12 -0
- package/templates/postgres/backend/app/tests/queries/test_users.py +12 -0
- package/templates/postgres/backend/app/tests/routers/test_users.py +10 -0
- package/templates/postgres/backend/app/tests/routers/test_users__id.py +9 -0
- package/templates/postgres/backend/start.sh +32 -0
- package/templates/postgres/frontend/src/openapi/utils/openapi.yaml.hbs +138 -0
- package/templates/postgres/frontend/src/pages/users/[id]/index.tsx +51 -0
- package/templates/postgres/frontend/src/pages/users/index.tsx +54 -0
- package/templates/postgres/frontend/src/pages/users/types.tsx +4 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(git *)",
|
|
5
|
+
"Bash(docker *)",
|
|
6
|
+
"Bash(dude *)",
|
|
7
|
+
"Bash(node *)",
|
|
8
|
+
"Bash(pnpm *)",
|
|
9
|
+
"Bash(npm *)",
|
|
10
|
+
"Bash(pip *)",
|
|
11
|
+
"Bash(pip3 *)",
|
|
12
|
+
"Bash(python *)",
|
|
13
|
+
"Bash(python3 *)",
|
|
14
|
+
"Bash(rm *)",
|
|
15
|
+
"Bash(mkdir *)",
|
|
16
|
+
"Bash(cp *)",
|
|
17
|
+
"Bash(mv *)",
|
|
18
|
+
"Bash(sed *)",
|
|
19
|
+
"Bash(find *)",
|
|
20
|
+
"Bash(cat *)",
|
|
21
|
+
"Read(*)",
|
|
22
|
+
"Write(*)",
|
|
23
|
+
"Edit(*)",
|
|
24
|
+
"Glob(*)",
|
|
25
|
+
"Grep(*)",
|
|
26
|
+
"mcp__atlassian__atlassianUserInfo",
|
|
27
|
+
"mcp__atlassian__getAccessibleAtlassianResources",
|
|
28
|
+
"mcp__atlassian__createJiraIssue",
|
|
29
|
+
"mcp__atlassian__searchJiraIssuesUsingJql",
|
|
30
|
+
"mcp__atlassian__getJiraIssue",
|
|
31
|
+
"mcp__atlassian__getTransitionsForJiraIssue",
|
|
32
|
+
"mcp__atlassian__transitionJiraIssue",
|
|
33
|
+
"mcp__atlassian__addCommentToJiraIssue",
|
|
34
|
+
"mcp__atlassian__createPullRequest",
|
|
35
|
+
"mcp__atlassian__getRepository",
|
|
36
|
+
"mcp__atlassian__getPullRequest",
|
|
37
|
+
"PushNotification"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"hooks": {
|
|
41
|
+
"SubagentStop": [
|
|
42
|
+
{
|
|
43
|
+
"hooks": [
|
|
44
|
+
{
|
|
45
|
+
"type": "command",
|
|
46
|
+
"command": "osascript -e 'display notification \"Agent completed\" with title \"Claude Code\"' 2>/dev/null || true",
|
|
47
|
+
"async": true
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clean-branches
|
|
3
|
+
description: Identify merged and stale branches, list them, ask for confirmation, then delete selected ones
|
|
4
|
+
disable-model-invocation: false
|
|
5
|
+
allowed-tools: "Bash(git *)"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Clean Branches
|
|
9
|
+
|
|
10
|
+
## Step 0 — Clean up stale worktrees
|
|
11
|
+
|
|
12
|
+
Before identifying branch candidates, check for stale or abandoned worktrees:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
git worktree list
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Flag any worktree under `.claude/worktrees/` as a **Claude agent worktree** — these are created automatically during agent runs and are safe to remove when no longer active.
|
|
19
|
+
|
|
20
|
+
For each stale worktree:
|
|
21
|
+
1. Check if the directory exists on disk
|
|
22
|
+
2. Remove it with `git worktree remove -f -f <path>` (double `-f` required for locked worktrees)
|
|
23
|
+
3. After removal, include the associated branch in the candidate list for Step 1
|
|
24
|
+
|
|
25
|
+
If any worktree removal fails, warn the user and skip that branch from deletion.
|
|
26
|
+
|
|
27
|
+
## Current state
|
|
28
|
+
|
|
29
|
+
!`git fetch --prune 2>&1 | tail -5`
|
|
30
|
+
!`git branch --show-current`
|
|
31
|
+
|
|
32
|
+
## Step 1 — Identify candidates
|
|
33
|
+
|
|
34
|
+
Run the following commands and collect results:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Branches merged into main (local)
|
|
38
|
+
git branch --merged main | grep -v '^\*' | grep -v 'main$' | grep -v 'develop$'
|
|
39
|
+
|
|
40
|
+
# Branches merged into develop (local)
|
|
41
|
+
git branch --merged develop | grep -v '^\*' | grep -v 'main$' | grep -v 'develop$'
|
|
42
|
+
|
|
43
|
+
# Remote branches merged into main
|
|
44
|
+
git branch -r --merged main | grep -v 'origin/main$' | grep -v 'origin/develop$' | grep -v 'origin/HEAD'
|
|
45
|
+
|
|
46
|
+
# Remote branches merged into develop
|
|
47
|
+
git branch -r --merged develop | grep -v 'origin/main$' | grep -v 'origin/develop$' | grep -v 'origin/HEAD'
|
|
48
|
+
|
|
49
|
+
# Stale local branches (no upstream, last commit older than 30 days)
|
|
50
|
+
git for-each-ref --format='%(refname:short) %(upstream:short) %(committerdate:iso)' refs/heads \
|
|
51
|
+
| awk '{if ($2 == "" && $3 != "" && $3 < "'$(date -v-30d +%Y-%m-%d 2>/dev/null || date -d '30 days ago' +%Y-%m-%d)'") print $1}'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Step 2 — Present the list
|
|
55
|
+
|
|
56
|
+
After collecting results, deduplicate and present a clear table:
|
|
57
|
+
|
|
58
|
+
| # | Branch | Type | Last Commit | Merged into |
|
|
59
|
+
| --- | ------ | ---- | ----------- | ----------- |
|
|
60
|
+
|
|
61
|
+
**Types:**
|
|
62
|
+
|
|
63
|
+
- `merged-local` — local branch merged into main or develop
|
|
64
|
+
- `merged-remote` — remote tracking branch merged into main or develop
|
|
65
|
+
- `stale-local` — local branch with no upstream and no commits in 30+ days
|
|
66
|
+
|
|
67
|
+
Always **exclude** from the list: `main`, `develop`, `sandbox`, the current branch, and any branch the user is currently on.
|
|
68
|
+
|
|
69
|
+
## Step 3 — Ask for confirmation
|
|
70
|
+
|
|
71
|
+
Present the list, then ask:
|
|
72
|
+
|
|
73
|
+
> "Which branches should I delete?
|
|
74
|
+
>
|
|
75
|
+
> - Type **all** to delete everything listed
|
|
76
|
+
> - Type **none** to cancel
|
|
77
|
+
> - Type branch numbers or names to keep (exceptions), e.g. `keep 3,5` or `keep feature/old-experiment`"
|
|
78
|
+
|
|
79
|
+
Wait for the user's explicit answer before proceeding.
|
|
80
|
+
|
|
81
|
+
## Step 4 — Delete confirmed branches
|
|
82
|
+
|
|
83
|
+
Based on the user's response:
|
|
84
|
+
|
|
85
|
+
- For **local** merged/stale branches: `git branch -d <branch>` (use `-D` only if `-d` fails and user confirms)
|
|
86
|
+
- For **remote** branches: `git push origin --delete <branch>` (strip the `origin/` prefix)
|
|
87
|
+
|
|
88
|
+
After deletion, show a summary:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Deleted: <list>
|
|
92
|
+
Skipped: <list>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Rules
|
|
96
|
+
|
|
97
|
+
- Never delete `main`, `develop`, `dev`, `test`, `staging`, or the currently checked-out branch
|
|
98
|
+
- Never force-delete (`-D`) without explicit user confirmation per branch
|
|
99
|
+
- Always confirm before any remote deletion — remote deletions are not reversible locally
|
|
100
|
+
- If no candidates are found, report "No stale or merged branches found" and stop
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create
|
|
3
|
+
description: Guided scaffolding for this stack. Asks whether you want to create a backend route or a frontend page, then runs the matching convention-aware flow (create-route or create-page) that inspects existing code and enforces the stack's BE/FE rules.
|
|
4
|
+
disable-model-invocation: false
|
|
5
|
+
allowed-tools: "Read Glob Grep Bash(find *) Bash(cat *)"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Create (router)
|
|
9
|
+
|
|
10
|
+
Single entry point for scaffolding new code in this project. It figures out
|
|
11
|
+
**what** you want to build, then hands off to the specialised skill that knows
|
|
12
|
+
the exact conventions (see `.claude/rules/`) and inspects the existing codebase
|
|
13
|
+
before writing anything.
|
|
14
|
+
|
|
15
|
+
## Step 0 — Locate the project
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
find . -maxdepth 3 -name "dude.json" | head -1
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If not found, report _"No dude.json found — are you inside a dude project?"_ and stop.
|
|
22
|
+
Set `PROJECT_ROOT` to the directory containing `dude.json`.
|
|
23
|
+
|
|
24
|
+
## Step 1 — Ask what to create
|
|
25
|
+
|
|
26
|
+
If the user has not already made it explicit, ask:
|
|
27
|
+
|
|
28
|
+
> **What do you want to create?**
|
|
29
|
+
> 1. **Route** — a backend API endpoint (FastAPI router + optional model/query/schema + tests)
|
|
30
|
+
> 2. **Page** — a frontend screen (React page + route wiring + components/hooks)
|
|
31
|
+
|
|
32
|
+
Map free-form answers too: "endpoint", "API", "router" → route; "screen",
|
|
33
|
+
"view", "UI", "component-heavy view" → page.
|
|
34
|
+
|
|
35
|
+
## Step 2 — Hand off
|
|
36
|
+
|
|
37
|
+
- **Route** → read `.claude/skills/create-route/SKILL.md` and follow it from Step 0.
|
|
38
|
+
- **Page** → read `.claude/skills/create-page/SKILL.md` and follow it from Step 0.
|
|
39
|
+
|
|
40
|
+
Pass along anything the user already specified (path, method, what to display)
|
|
41
|
+
so the worker skill can skip questions it already has answers for.
|
|
42
|
+
|
|
43
|
+
## Notes
|
|
44
|
+
|
|
45
|
+
- This router never writes files itself — it only routes.
|
|
46
|
+
- Both worker skills are also invocable directly (`/create-route`, `/create-page`)
|
|
47
|
+
when you already know which one you need.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-jira-issue
|
|
3
|
+
description: Create a Jira issue. Use whenever the user asks to create, open, log, or file a Jira issue, ticket, or bug report.
|
|
4
|
+
disable-model-invocation: false
|
|
5
|
+
allowed-tools: "Bash(git *) mcp__atlassian__createJiraIssue mcp__atlassian__searchJiraIssuesUsingJql mcp__atlassian__getJiraIssue mcp__atlassian__lookupJiraAccountId mcp__atlassian__atlassianUserInfo mcp__atlassian__getAccessibleAtlassianResources Write Read"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Create Jira Issue
|
|
9
|
+
|
|
10
|
+
## Step 0 — Load configuration
|
|
11
|
+
|
|
12
|
+
Read the `## Saved configuration` section at the bottom of this file.
|
|
13
|
+
|
|
14
|
+
- If a `project` key is present, use it as the Jira project key. Skip to Step 1.
|
|
15
|
+
- If absent, ask the user: **"What is the Jira project key? (e.g. MYPROJ)"** and proceed with the answer.
|
|
16
|
+
|
|
17
|
+
Resolve the reporter and Jira site automatically — do not ask the user:
|
|
18
|
+
- **Reporter**: call `atlassianUserInfo` → use the returned account ID
|
|
19
|
+
- **Jira URL**: call `getAccessibleAtlassianResources` → use the first site's URL
|
|
20
|
+
|
|
21
|
+
## Git context
|
|
22
|
+
|
|
23
|
+
!`git branch --show-current`
|
|
24
|
+
!`git log --oneline -5`
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Step 1 — Determine issue type
|
|
29
|
+
|
|
30
|
+
Ask the user (or infer from context) whether this is a **Bug** or a **Task**.
|
|
31
|
+
If ambiguous, ask before proceeding.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Step 2 — Build the issue fields
|
|
36
|
+
|
|
37
|
+
### BUG
|
|
38
|
+
|
|
39
|
+
Use when something is broken, incorrect, or behaving unexpectedly.
|
|
40
|
+
|
|
41
|
+
**Summary format**: `[<component>] <short description of the broken behaviour>`
|
|
42
|
+
- Component: `backend`, `frontend`, `e2e`, `deploy`, `security`, `pipeline`
|
|
43
|
+
- Max 72 characters. Active voice. No trailing period.
|
|
44
|
+
- Examples:
|
|
45
|
+
- `[backend] User creation fails silently when DB connection times out`
|
|
46
|
+
- `[frontend] Table does not refresh after approval action`
|
|
47
|
+
|
|
48
|
+
**Description template**:
|
|
49
|
+
```
|
|
50
|
+
## Summary
|
|
51
|
+
<One sentence describing what is wrong and the observable impact.>
|
|
52
|
+
|
|
53
|
+
## Steps to reproduce
|
|
54
|
+
1. <First step — be specific: URL, user role, data used>
|
|
55
|
+
2. <Second step>
|
|
56
|
+
3. <…>
|
|
57
|
+
|
|
58
|
+
## Expected behaviour
|
|
59
|
+
<What should happen.>
|
|
60
|
+
|
|
61
|
+
## Actual behaviour
|
|
62
|
+
<What happens instead. Include error messages, stack traces, or screenshots if available.>
|
|
63
|
+
|
|
64
|
+
## Environment
|
|
65
|
+
- Branch: <current git branch>
|
|
66
|
+
- Component: <backend / frontend / e2e / deploy>
|
|
67
|
+
- Relevant config: <env vars, feature flags, or settings involved if known>
|
|
68
|
+
|
|
69
|
+
## Root cause hypothesis
|
|
70
|
+
<If known or suspected: which file/function/service is likely responsible.
|
|
71
|
+
Reference specific files and line numbers if possible.>
|
|
72
|
+
|
|
73
|
+
## Suggested fix
|
|
74
|
+
<Concrete suggestion for the assignee:
|
|
75
|
+
- Which file(s) to look at
|
|
76
|
+
- What change is likely needed
|
|
77
|
+
- Any gotchas or related code to check
|
|
78
|
+
If unknown, write "Under investigation.">
|
|
79
|
+
|
|
80
|
+
## References
|
|
81
|
+
<Links to related issues, PRs, docs, or log output. Remove if empty.>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Labels**: `bug` + component label (e.g. `backend`, `frontend`) + any of: `security`, `e2e`, `ux`, `performance`
|
|
85
|
+
**Priority**: infer from impact — Blocker if production is broken, High if a core flow is broken, Medium otherwise, Low for cosmetic issues.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### TASK
|
|
90
|
+
|
|
91
|
+
Use for planned work: new features, improvements, refactors, infrastructure, documentation.
|
|
92
|
+
|
|
93
|
+
**Summary format**: `[<component>] <imperative verb> <what>`
|
|
94
|
+
- Imperative verb: Add, Implement, Refactor, Update, Remove, Migrate, Document, Configure
|
|
95
|
+
- Examples:
|
|
96
|
+
- `[backend] Add --reset flag to seed management command`
|
|
97
|
+
- `[deploy] Migrate Helm chart values to support multi-environment secrets`
|
|
98
|
+
- `[e2e] Add Cucumber scenario for group access approval flow`
|
|
99
|
+
|
|
100
|
+
**Description template**:
|
|
101
|
+
```
|
|
102
|
+
## Goal
|
|
103
|
+
<One or two sentences: what needs to be done and why it matters.>
|
|
104
|
+
|
|
105
|
+
## Background & context
|
|
106
|
+
<Why is this needed now? What triggered it?
|
|
107
|
+
Reference related issues, decisions, or constraints the assignee should know about.>
|
|
108
|
+
|
|
109
|
+
## Acceptance criteria
|
|
110
|
+
- [ ] <Specific, verifiable condition 1>
|
|
111
|
+
- [ ] <Specific, verifiable condition 2>
|
|
112
|
+
- [ ] <…>
|
|
113
|
+
|
|
114
|
+
## Technical approach (suggested)
|
|
115
|
+
<Concrete guidance for the assignee:
|
|
116
|
+
- Which files / modules to touch
|
|
117
|
+
- Recommended implementation pattern (reference existing code where applicable)
|
|
118
|
+
- Known constraints or risks
|
|
119
|
+
- Dependencies on other tasks or services
|
|
120
|
+
If speculative, mark clearly as "suggestion, not requirement.">
|
|
121
|
+
|
|
122
|
+
## Out of scope
|
|
123
|
+
<Explicit list of what this task does NOT cover, to prevent scope creep. Remove if not needed.>
|
|
124
|
+
|
|
125
|
+
## References
|
|
126
|
+
<Links to docs, related issues, ADRs, or PRs. Remove if empty.>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Labels**: component label (e.g. `backend`, `frontend`) + type label: `feature`, `refactor`, `infra`, `docs`, `test`
|
|
130
|
+
**Priority**: High if blocking other work or sprint goal, Medium for planned work, Low for nice-to-have.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Step 3 — Check for duplicates
|
|
135
|
+
|
|
136
|
+
Before creating, search for existing open issues:
|
|
137
|
+
|
|
138
|
+
```jql
|
|
139
|
+
project = <PROJECT_KEY> AND statusCategory != Done AND summary ~ "<3-4 key words from the summary>"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
If a close match exists, show it to the user and ask whether to proceed with a new issue or link to the existing one.
|
|
143
|
+
|
|
144
|
+
## Step 4 — Create the issue
|
|
145
|
+
|
|
146
|
+
Use the `createJiraIssue` MCP tool with the fields built above.
|
|
147
|
+
|
|
148
|
+
## Step 5 — Confirm
|
|
149
|
+
|
|
150
|
+
After creation, show:
|
|
151
|
+
- Issue key and URL
|
|
152
|
+
- Summary
|
|
153
|
+
- One-line recap: type, priority, labels
|
|
154
|
+
|
|
155
|
+
## Step 6 — Save configuration (first run only)
|
|
156
|
+
|
|
157
|
+
If no `## Saved configuration` section existed at the start (Step 0), ask the user:
|
|
158
|
+
|
|
159
|
+
> "Should I remember the project key **<KEY>** for future use? I'll save it in this skill file."
|
|
160
|
+
|
|
161
|
+
If the user confirms, append the following to the end of this file:
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
## Saved configuration
|
|
165
|
+
|
|
166
|
+
project: <KEY>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
<!-- ------------------------------------------------------------------ -->
|
|
172
|
+
<!-- Everything below this line is written automatically by the skill. -->
|
|
173
|
+
<!-- Do not edit manually. -->
|
|
174
|
+
<!-- ------------------------------------------------------------------ -->
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-page
|
|
3
|
+
description: Scaffold a new frontend page (React + Vite + Ant Design). Asks for the route path and what the page should display, surveys existing shared components/hooks and the generated API client for reuse, then creates the page directory, wires the route into App.tsx, and adds any new components/hooks following the frontend FE 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 Page
|
|
9
|
+
|
|
10
|
+
Guided creation of a frontend screen that satisfies every frontend rule in
|
|
11
|
+
`.claude/rules/FE/`. The skill **surveys the existing component library, hooks
|
|
12
|
+
and API client first** so the page composes what's already there instead of
|
|
13
|
+
re-inventing it.
|
|
14
|
+
|
|
15
|
+
> Read `.claude/rules/FE/001.md`–`012.md` once at the start — they are the
|
|
16
|
+
> source of truth. The stack uses **React 19 + Vite + TypeScript (strict)**,
|
|
17
|
+
> **Ant Design** (`antd`) for UI, **@tanstack/react-query** for data,
|
|
18
|
+
> **zustand** for global client state, and **react-router-dom** for routing.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Step 0 — Locate the project
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
find . -maxdepth 3 -name "dude.json" | head -1
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Set `PROJECT_ROOT` to the directory containing `dude.json`. If missing, stop
|
|
29
|
+
with _"No dude.json found — are you inside a dude project?"_.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Step 1 — Gather requirements
|
|
34
|
+
|
|
35
|
+
Ask only for what the user hasn't provided:
|
|
36
|
+
|
|
37
|
+
1. **Route path** — e.g. `/todos`, `/users/[id]`. Each segment becomes a
|
|
38
|
+
directory under `pages/` (kebab-case, or `[param]` for a dynamic segment)
|
|
39
|
+
and the `<Route path>` in `App.tsx` (`[id]` → `:id`).
|
|
40
|
+
2. **Page title** — shown in the header / browser tab (`usePageTitle`).
|
|
41
|
+
3. **What it should display** — the content and interactions: a table, a form, a
|
|
42
|
+
dashboard of cards, a detail view, etc.
|
|
43
|
+
4. **Data source** — which API endpoint(s) feed it (if any).
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Step 2 — Survey the existing code (reuse before create)
|
|
48
|
+
|
|
49
|
+
Run these and **read the relevant matches** before proposing anything:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Shared components available for reuse + their barrel
|
|
53
|
+
ls "$PROJECT_ROOT"/frontend/src/'$components'
|
|
54
|
+
cat "$PROJECT_ROOT"/frontend/src/'$components'/index.tsx 2>/dev/null
|
|
55
|
+
# Reusable hooks (usePageTitle, zustand stores) + barrel
|
|
56
|
+
ls "$PROJECT_ROOT"/frontend/src/'$hooks'
|
|
57
|
+
cat "$PROJECT_ROOT"/frontend/src/'$hooks'/index.tsx 2>/dev/null
|
|
58
|
+
# Existing pages — mirror their structure/style
|
|
59
|
+
ls "$PROJECT_ROOT"/frontend/src/pages
|
|
60
|
+
# Generated API client — what data is available
|
|
61
|
+
ls "$PROJECT_ROOT"/frontend/src/openapi/api 2>/dev/null
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Then propose, explicitly:
|
|
65
|
+
- **Shared components to reuse** from `@/$components` (import via the barrel:
|
|
66
|
+
`import { UserCard } from '@/$components'`).
|
|
67
|
+
- **Hooks to reuse** — always wire `usePageTitle(<title>)`; reuse any `use*`
|
|
68
|
+
hook or zustand store that already holds the state you need.
|
|
69
|
+
- **API calls** — use the generated client: `import { $get } from '@/openapi/api/<resource>'`
|
|
70
|
+
inside a `useQuery`. If the endpoint doesn't exist yet, tell the user to create
|
|
71
|
+
it first with `/create-route` (then `dude api sync`).
|
|
72
|
+
- **Sub-components to introduce** — if the page has distinct reusable chunks,
|
|
73
|
+
plan them as page-local `$components/` (used only here) or shared
|
|
74
|
+
`@/$components` (used elsewhere too).
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Step 3 — Plan the file set (confirm before writing)
|
|
79
|
+
|
|
80
|
+
Present files to **create** and **modify**, then wait for an OK.
|
|
81
|
+
|
|
82
|
+
| File | Rule | Purpose |
|
|
83
|
+
|------|------|---------|
|
|
84
|
+
| `pages/<route>/index.tsx` | FE004, FE005 | the page component (mandatory) |
|
|
85
|
+
| `pages/<route>/styles.module.css` | FE005 | optional scoped styles |
|
|
86
|
+
| `pages/<route>/types.tsx` | FE005, FE012 | optional local types |
|
|
87
|
+
| `pages/<route>/constants.tsx` | FE005, FE012 | optional local constants |
|
|
88
|
+
| `pages/<route>/functions.tsx` | FE005, FE012 | optional local helpers |
|
|
89
|
+
| `pages/<route>/$components/<Comp>/index.tsx` | FE001, FE002 | optional page-local sub-components (+ barrel `$components/index.tsx`, FE003) |
|
|
90
|
+
| `pages/<route>/$hooks/use<Name>/index.tsx` | FE006, FE007 | optional page-local hooks (+ barrel) |
|
|
91
|
+
| `src/App.tsx` | FE004 | add `import X from '@/pages/<route>'` **and** a `<Route path="<path>" element={<X />} />` |
|
|
92
|
+
| `src/$components/<Comp>/` + barrel | FE001–003 | only when introducing a **shared** component |
|
|
93
|
+
| `src/$hooks/use<Name>/` + barrel | FE006, FE007 | only when introducing a **shared** hook or zustand store |
|
|
94
|
+
| `<scope>/$assets/...` | FE008 | any new static asset lives in the `$assets/` of the scope that uses it |
|
|
95
|
+
|
|
96
|
+
Allowed contents reminders:
|
|
97
|
+
- Any **scope dir** (page, component, hook, utils domain) holds only
|
|
98
|
+
`index.tsx`, `styles.module.css`, `types.tsx`, `constants.tsx`,
|
|
99
|
+
`functions.tsx` plus its privileged `$`-folders (FE002/FE005/FE006/FE009).
|
|
100
|
+
- **Route segments** are kebab-case or `[param]` — the `$` prefix keeps
|
|
101
|
+
structural folders (`$components/`, `$hooks/`, `$assets/`, `$misc/`) out of
|
|
102
|
+
the route namespace (FE005).
|
|
103
|
+
- A **component dir** is PascalCase (FE001) and re-exported from its parent
|
|
104
|
+
`$components/index.tsx` barrel in alphabetical order (FE003).
|
|
105
|
+
- A **hook dir** matches `use[A-Z]...` and is re-exported from its
|
|
106
|
+
`$hooks/index.tsx` barrel (FE006/FE007).
|
|
107
|
+
- Keep `index.tsx` thin (FE012): types → `types.tsx`, helpers →
|
|
108
|
+
`functions.tsx`, extra components → `$components/`, hooks → `$hooks/`.
|
|
109
|
+
- Never park files in `$misc/` if you know where they belong — every `$misc/`
|
|
110
|
+
raises a warning (FE011).
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Step 4 — Implement
|
|
115
|
+
|
|
116
|
+
Mirror `pages/index.tsx` and `$components/Layout/index.tsx` for style. Reference
|
|
117
|
+
shape:
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
// pages/todos/index.tsx
|
|
121
|
+
import { useQuery } from '@tanstack/react-query'
|
|
122
|
+
import { Card, Space, Table, Typography } from 'antd'
|
|
123
|
+
import { $get as getTodos } from '@/openapi/api/todos'
|
|
124
|
+
import { usePageTitle } from '@/$hooks'
|
|
125
|
+
|
|
126
|
+
const { Title } = Typography
|
|
127
|
+
|
|
128
|
+
export default function TodosPage() {
|
|
129
|
+
usePageTitle('Todos')
|
|
130
|
+
const { data, isLoading } = useQuery({ queryKey: ['todos'], queryFn: getTodos })
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<Space direction="vertical" size="large" style={{ width: '100%' }}>
|
|
134
|
+
<Title level={2}>Todos</Title>
|
|
135
|
+
<Card>
|
|
136
|
+
<Table loading={isLoading} dataSource={data ?? []} rowKey="id" columns={[/* … */]} />
|
|
137
|
+
</Card>
|
|
138
|
+
</Space>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
// App.tsx — add inside the <Layout> route (FE004), keep imports tidy
|
|
145
|
+
import TodosPage from '@/pages/todos'
|
|
146
|
+
...
|
|
147
|
+
<Route element={<Layout />}>
|
|
148
|
+
<Route path="/" element={<HomePage />} />
|
|
149
|
+
<Route path="/todos" element={<TodosPage />} />
|
|
150
|
+
</Route>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
If the page should appear in the sidebar, add a matching entry to `MENU_ITEMS`
|
|
154
|
+
in `$components/Layout/constants.tsx` (key = first path segment, with an
|
|
155
|
+
`@ant-design/icons` icon).
|
|
156
|
+
|
|
157
|
+
Constraints to honour while writing:
|
|
158
|
+
- Use `antd` components and `@ant-design/icons` — match the existing visual
|
|
159
|
+
language; avoid bespoke CSS when an antd component exists.
|
|
160
|
+
- Fetch through `@tanstack/react-query` + the generated `@/openapi` client; never
|
|
161
|
+
hand-write `fetch` calls or edit `frontend/src/openapi/` by hand.
|
|
162
|
+
- Global client state lives in a zustand store under `$hooks/` — mirror
|
|
163
|
+
`$hooks/useCounterStore/` (devtools middleware, `enabled: import.meta.env.DEV`).
|
|
164
|
+
- Imports use the `@/` alias (assets are imported from their scope's `$assets/`, FE008).
|
|
165
|
+
- Adding a component → update its `$components/index.tsx` barrel; adding a hook
|
|
166
|
+
→ update the `$hooks/index.tsx` barrel in the same change (FE003/FE007).
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Step 5 — Validate
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
cd "$PROJECT_ROOT"
|
|
174
|
+
dude lint # must pass — enforces FE directory/barrel/route rules
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Fix any reported violation and re-run before continuing. If the dev server is
|
|
178
|
+
running (`dude up`), Vite HMR will show the page immediately at the route path.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Step 6 — Report
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
Page created
|
|
186
|
+
═════════════════════════════════════════
|
|
187
|
+
Route <path> → pages/<route>/index.tsx
|
|
188
|
+
Wired in App.tsx (<Route>) [+ Layout menu item]
|
|
189
|
+
Reused components: <…> hooks: <…> api: <…>
|
|
190
|
+
New shared components: <…> hooks: <…>
|
|
191
|
+
Assets <…|none>
|
|
192
|
+
─────────────────────────────────────────
|
|
193
|
+
dude lint: ✓
|
|
194
|
+
Open: http://localhost:5173<path>
|
|
195
|
+
```
|