@el-j/magic-helix-plugins 4.0.0-beta.2 → 4.0.0-beta.3

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.
Files changed (120) hide show
  1. package/dist/architecture/codeowners.md +123 -0
  2. package/dist/architecture/monorepo.md +146 -0
  3. package/dist/architecture/nx.md +122 -0
  4. package/dist/architecture/turborepo.md +114 -0
  5. package/dist/ci/github-actions.md +268 -0
  6. package/dist/ci/gitlab-ci.md +330 -0
  7. package/dist/containers/docker-multistage.md +120 -0
  8. package/dist/containers/kubernetes-deploy.md +210 -0
  9. package/dist/cpp/index.cjs +79 -0
  10. package/dist/cpp/index.mjs +209 -0
  11. package/dist/csharp/index.cjs +2 -2
  12. package/dist/csharp/{index.js → index.mjs} +17 -11
  13. package/dist/csharp/templates/framework-aspnetcore.md +205 -0
  14. package/dist/csharp/templates/framework-blazor.md +271 -0
  15. package/dist/csharp/templates/lang-csharp.md +162 -0
  16. package/dist/devops/docker-compose.md +111 -0
  17. package/dist/devops/docker-dockerfile.md +94 -0
  18. package/dist/devops/github-actions.md +160 -0
  19. package/dist/devops/gitlab-ci.md +210 -0
  20. package/dist/generic/lang-typescript.md +57 -0
  21. package/dist/generic/state-redux.md +21 -0
  22. package/dist/generic/state-rxjs.md +6 -0
  23. package/dist/generic/style-mui.md +23 -0
  24. package/dist/generic/style-tailwind.md +76 -0
  25. package/dist/generic/test-cypress.md +21 -0
  26. package/dist/generic/test-jest.md +20 -0
  27. package/dist/generic/test-playwright.md +21 -0
  28. package/dist/generic/test-vitest.md +131 -0
  29. package/dist/go/index.cjs +3 -3
  30. package/dist/go/{index.js → index.mjs} +18 -15
  31. package/dist/go/templates/lang-go.md +571 -0
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.mjs +24 -0
  34. package/dist/java/index.cjs +2 -2
  35. package/dist/java/{index.js → index.mjs} +25 -19
  36. package/dist/java/templates/build-gradle.md +102 -0
  37. package/dist/java/templates/build-maven.md +86 -0
  38. package/dist/java/templates/framework-spring-boot.md +179 -0
  39. package/dist/java/templates/lang-java.md +78 -0
  40. package/dist/java/templates/lang-kotlin.md +88 -0
  41. package/dist/meta/magic-helix-meta.md +213 -0
  42. package/dist/meta/meta-debug.md +459 -0
  43. package/dist/meta/meta-implement.md +450 -0
  44. package/dist/meta/meta-roadmap.md +265 -0
  45. package/dist/nodejs/templates/angular-core.md +19 -0
  46. package/dist/nodejs/templates/lang-typescript.md +57 -0
  47. package/dist/nodejs/templates/nestjs-core.md +7 -0
  48. package/dist/nodejs/templates/react-core.md +677 -0
  49. package/dist/nodejs/templates/react-zustand.md +7 -0
  50. package/dist/nodejs/templates/state-redux.md +21 -0
  51. package/dist/nodejs/templates/state-rxjs.md +6 -0
  52. package/dist/nodejs/templates/style-primevue.md +6 -0
  53. package/dist/nodejs/templates/style-quasar.md +22 -0
  54. package/dist/nodejs/templates/style-tailwind.md +76 -0
  55. package/dist/nodejs/templates/test-cypress.md +21 -0
  56. package/dist/nodejs/templates/test-jest.md +20 -0
  57. package/dist/nodejs/templates/test-playwright.md +21 -0
  58. package/dist/nodejs/templates/test-vitest.md +131 -0
  59. package/dist/nodejs/templates/vue-core.md +108 -0
  60. package/dist/nodejs/templates/vue-pinia.md +5 -0
  61. package/dist/patterns/architecture/clean-architecture.md +469 -0
  62. package/dist/patterns/architecture/dependency-injection.md +517 -0
  63. package/dist/patterns/architecture/domain-driven-design.md +621 -0
  64. package/dist/patterns/architecture/layered-architecture.md +382 -0
  65. package/dist/patterns/architecture/repository-pattern.md +408 -0
  66. package/dist/patterns/domain-expertise/nextjs-rules.md +115 -0
  67. package/dist/patterns/domain-expertise/react-patterns.md +181 -0
  68. package/dist/patterns/domain-expertise/server-components.md +212 -0
  69. package/dist/patterns/domain-expertise/shadcn-ui.md +52 -0
  70. package/dist/patterns/domain-expertise/tailwind-patterns.md +52 -0
  71. package/dist/patterns/environment/container-awareness.md +17 -0
  72. package/dist/patterns/environment/ide-features.md +17 -0
  73. package/dist/patterns/environment/os-commands.md +17 -0
  74. package/dist/patterns/organization/heading-hierarchy.md +103 -0
  75. package/dist/patterns/organization/sequential-workflows.md +102 -0
  76. package/dist/patterns/organization/xml-rule-groups.md +64 -0
  77. package/dist/patterns/reasoning/agent-loop.md +151 -0
  78. package/dist/patterns/reasoning/confirmation-gates.md +141 -0
  79. package/dist/patterns/reasoning/dependency-analysis.md +132 -0
  80. package/dist/patterns/reasoning/one-tool-per-iteration.md +152 -0
  81. package/dist/patterns/reasoning/preview-before-action.md +194 -0
  82. package/dist/patterns/reasoning/reflection-checkpoints.md +166 -0
  83. package/dist/patterns/reasoning/result-verification.md +157 -0
  84. package/dist/patterns/reasoning/subtask-breakdown.md +131 -0
  85. package/dist/patterns/reasoning/thinking-tags.md +100 -0
  86. package/dist/patterns/role-definition/capability-declarations.md +72 -0
  87. package/dist/patterns/role-definition/expert-identity.md +45 -0
  88. package/dist/patterns/role-definition/scope-boundaries.md +61 -0
  89. package/dist/patterns/safety/code-safety-rules.md +17 -0
  90. package/dist/patterns/safety/credential-handling.md +17 -0
  91. package/dist/patterns/safety/destructive-warnings.md +17 -0
  92. package/dist/patterns/safety/refusal-messages.md +17 -0
  93. package/dist/patterns/tone/adaptive-tone.md +17 -0
  94. package/dist/patterns/tone/concise-communication.md +17 -0
  95. package/dist/patterns/tone/forbidden-phrases.md +17 -0
  96. package/dist/patterns/tool-guidelines/function-schemas.md +143 -0
  97. package/dist/patterns/tool-guidelines/parameter-examples.md +137 -0
  98. package/dist/patterns/tool-guidelines/usage-policies.md +105 -0
  99. package/dist/php/index.cjs +2 -2
  100. package/dist/php/{index.js → index.mjs} +12 -6
  101. package/dist/php/templates/framework-laravel.md +112 -0
  102. package/dist/php/templates/lang-php.md +94 -0
  103. package/dist/python/index.cjs +4 -4
  104. package/dist/python/{index.js → index.mjs} +10 -7
  105. package/dist/python/templates/lang-python.md +508 -0
  106. package/dist/ruby/index.cjs +2 -2
  107. package/dist/ruby/{index.js → index.mjs} +16 -10
  108. package/dist/ruby/templates/framework-rails.md +309 -0
  109. package/dist/ruby/templates/framework-sinatra.md +227 -0
  110. package/dist/ruby/templates/lang-ruby.md +216 -0
  111. package/dist/rust/index.cjs +3 -3
  112. package/dist/rust/{index.js → index.mjs} +24 -18
  113. package/dist/rust/templates/lang-rust.md +89 -0
  114. package/dist/swift/index.cjs +32 -0
  115. package/dist/swift/index.mjs +112 -0
  116. package/dist/swift/templates/framework-vapor.md +352 -0
  117. package/dist/swift/templates/lang-swift.md +291 -0
  118. package/package.json +31 -21
  119. package/dist/index.js +0 -20
  120. /package/dist/nodejs/{index.js → index.mjs} +0 -0
@@ -0,0 +1,111 @@
1
+ # Docker Compose Best Practices
2
+
3
+ ## Overview
4
+ This project uses Docker Compose for multi-container orchestration.
5
+
6
+ ## Commands
7
+ - Start services: `docker compose up`
8
+ - Start in background: `docker compose up -d`
9
+ - Stop services: `docker compose down`
10
+ - View logs: `docker compose logs -f`
11
+ - Rebuild: `docker compose up --build`
12
+ - Run command: `docker compose exec <service> <command>`
13
+
14
+ ## Service Definition
15
+ - Define services clearly with descriptive names
16
+ - Specify image or build context
17
+ - Set restart policies: `restart: unless-stopped`
18
+ - Use environment variables
19
+ - Define health checks
20
+
21
+ ## Networking
22
+ - Services can communicate by service name
23
+ - Define custom networks if needed
24
+ - Use `depends_on` for startup order
25
+ - Expose only necessary ports
26
+
27
+ ## Volumes
28
+ - Use named volumes for persistent data
29
+ - Use bind mounts for development
30
+ - Mount volumes in development for hot reload
31
+ - Example:
32
+ ```yaml
33
+ volumes:
34
+ - ./src:/app/src
35
+ - node_modules:/app/node_modules
36
+ ```
37
+
38
+ ## Environment Variables
39
+ - Use `.env` file for environment variables
40
+ - Reference in compose file: `${VARIABLE_NAME}`
41
+ - Use `env_file` directive for multiple files
42
+ - Never commit sensitive `.env` files
43
+
44
+ ## Development vs Production
45
+ - Use `docker-compose.yml` for base configuration
46
+ - Use `docker-compose.override.yml` for development
47
+ - Use `docker-compose.prod.yml` for production
48
+ - Override with: `docker compose -f docker-compose.yml -f docker-compose.prod.yml up`
49
+
50
+ ## Common Services
51
+ - **Database**: PostgreSQL, MySQL, MongoDB
52
+ - **Cache**: Redis, Memcached
53
+ - **Queue**: RabbitMQ, Redis
54
+ - **Web Server**: Nginx, Apache
55
+
56
+ ## Best Practices
57
+ - Pin service versions
58
+ - Use health checks for dependencies
59
+ - Set resource limits in production
60
+ - Use secrets for sensitive data (v3.1+)
61
+ - Don't run containers as root
62
+ - Use separate networks for isolation
63
+
64
+ ## Example Structure
65
+ ```yaml
66
+ version: '3.8'
67
+
68
+ services:
69
+ app:
70
+ build: .
71
+ ports:
72
+ - "3000:3000"
73
+ environment:
74
+ - NODE_ENV=development
75
+ volumes:
76
+ - .:/app
77
+ - /app/node_modules
78
+ depends_on:
79
+ - db
80
+ - redis
81
+
82
+ db:
83
+ image: postgres:15-alpine
84
+ environment:
85
+ POSTGRES_DB: myapp
86
+ POSTGRES_USER: user
87
+ POSTGRES_PASSWORD: password
88
+ volumes:
89
+ - postgres_data:/var/lib/postgresql/data
90
+
91
+ redis:
92
+ image: redis:7-alpine
93
+ ports:
94
+ - "6379:6379"
95
+
96
+ volumes:
97
+ postgres_data:
98
+ ```
99
+
100
+ ## Troubleshooting
101
+ - Check logs: `docker compose logs <service>`
102
+ - Inspect containers: `docker compose ps`
103
+ - Access shell: `docker compose exec <service> sh`
104
+ - View networks: `docker network ls`
105
+ - Clean up: `docker compose down -v` (removes volumes)
106
+
107
+ ## Performance
108
+ - Use volumes for better I/O performance
109
+ - Limit services to necessary ones during development
110
+ - Use profiles to group optional services
111
+ - Consider using `docker compose watch` for development
@@ -0,0 +1,94 @@
1
+ # Dockerfile Best Practices
2
+
3
+ ## Overview
4
+ This project uses Docker for containerization. Follow Docker best practices for efficient and secure images.
5
+
6
+ ## Multi-Stage Builds
7
+ - Use multi-stage builds to reduce final image size
8
+ - Separate build and runtime stages
9
+ - Copy only necessary artifacts to final stage
10
+ - Example:
11
+ ```dockerfile
12
+ FROM node:20 AS builder
13
+ WORKDIR /app
14
+ COPY package*.json ./
15
+ RUN npm ci
16
+ COPY . .
17
+ RUN npm run build
18
+
19
+ FROM node:20-slim
20
+ WORKDIR /app
21
+ COPY --from=builder /app/dist ./dist
22
+ COPY package*.json ./
23
+ RUN npm ci --only=production
24
+ CMD ["node", "dist/index.js"]
25
+ ```
26
+
27
+ ## Base Image Selection
28
+ - Use official images when available
29
+ - Choose slim or alpine variants for smaller sizes
30
+ - Pin specific versions, avoid `latest` tag
31
+ - Use distroless images for production when possible
32
+
33
+ ## Layer Optimization
34
+ - Order instructions from least to most frequently changing
35
+ - Combine RUN commands to reduce layers
36
+ - Use `.dockerignore` to exclude unnecessary files
37
+ - Clean up in the same RUN command (apt-get clean, rm cache)
38
+
39
+ ## Security Best Practices
40
+ - Run as non-root user: `USER node` or custom user
41
+ - Scan images for vulnerabilities regularly
42
+ - Don't store secrets in images
43
+ - Use `COPY` instead of `ADD` unless you need tar extraction
44
+ - Keep base images updated
45
+
46
+ ## Dockerfile Instructions
47
+ - `FROM`: Base image
48
+ - `WORKDIR`: Set working directory
49
+ - `COPY`: Copy files (preferred over ADD)
50
+ - `RUN`: Execute commands
51
+ - `CMD`: Default command (can be overridden)
52
+ - `ENTRYPOINT`: Main executable (harder to override)
53
+ - `ENV`: Set environment variables
54
+ - `EXPOSE`: Document ports (doesn't actually publish)
55
+ - `VOLUME`: Define mount points
56
+
57
+ ## Environment Variables
58
+ - Use `ENV` for build-time variables
59
+ - Use `ARG` for build arguments
60
+ - Don't hardcode sensitive data
61
+ - Use `.env` files with docker-compose
62
+
63
+ ## Health Checks
64
+ - Define `HEALTHCHECK` instruction
65
+ - Example: `HEALTHCHECK CMD curl -f http://localhost/ || exit 1`
66
+ - Helps orchestrators know when container is ready
67
+
68
+ ## Image Tagging
69
+ - Tag images with semantic versions
70
+ - Use descriptive tags: `app:1.2.3`, `app:latest`, `app:dev`
71
+ - Don't rely solely on `latest` tag
72
+
73
+ ## Build Context
74
+ - Keep build context small
75
+ - Use `.dockerignore` file
76
+ - Exclude: `node_modules`, `.git`, `dist`, test files
77
+ - Only include what's needed for the build
78
+
79
+ ## Performance Tips
80
+ - Use layer caching effectively
81
+ - Leverage BuildKit features
82
+ - Use `--mount=type=cache` for package managers
83
+ - Minimize the number of layers in final image
84
+
85
+ ## Common Patterns
86
+ - Copy package files first, then install dependencies
87
+ - This caches dependencies when source code changes
88
+ - Use `COPY package*.json ./` before `RUN npm install`
89
+
90
+ ## Documentation
91
+ - Add labels for metadata: `LABEL maintainer="team@example.com"`
92
+ - Include README with Docker commands
93
+ - Document exposed ports and volumes
94
+ - Provide example docker-compose.yml
@@ -0,0 +1,160 @@
1
+ # GitHub Actions CI/CD Guidelines
2
+
3
+ ## Overview
4
+ This project uses GitHub Actions for CI/CD workflows. Follow best practices for efficient and maintainable workflows.
5
+
6
+ ## Workflow Structure
7
+ ```yaml
8
+ name: CI
9
+
10
+ on:
11
+ push:
12
+ branches: [ main, develop ]
13
+ pull_request:
14
+ branches: [ main ]
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-node@v4
22
+ with:
23
+ node-version: '20'
24
+ - run: npm ci
25
+ - run: npm test
26
+ ```
27
+
28
+ ## Triggers
29
+ - `push`: On push to branches
30
+ - `pull_request`: On PRs
31
+ - `workflow_dispatch`: Manual trigger
32
+ - `schedule`: Cron-based scheduling
33
+ - `release`: On release creation
34
+
35
+ ## Common Actions
36
+ - `actions/checkout@v4`: Checkout code
37
+ - `actions/setup-node@v4`: Setup Node.js
38
+ - `actions/cache@v4`: Cache dependencies
39
+ - `actions/upload-artifact@v4`: Upload artifacts
40
+ - `actions/download-artifact@v4`: Download artifacts
41
+
42
+ ## Best Practices
43
+
44
+ ### Use Matrix Strategy
45
+ ```yaml
46
+ strategy:
47
+ matrix:
48
+ node-version: [18, 20, 22]
49
+ os: [ubuntu-latest, windows-latest, macos-latest]
50
+ ```
51
+
52
+ ### Cache Dependencies
53
+ ```yaml
54
+ - uses: actions/cache@v4
55
+ with:
56
+ path: ~/.npm
57
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
58
+ restore-keys: |
59
+ ${{ runner.os }}-node-
60
+ ```
61
+
62
+ ### Use Secrets
63
+ - Store sensitive data in GitHub Secrets
64
+ - Access via: `${{ secrets.SECRET_NAME }}`
65
+ - Never hardcode credentials
66
+
67
+ ### Conditional Steps
68
+ ```yaml
69
+ - name: Deploy
70
+ if: github.ref == 'refs/heads/main'
71
+ run: npm run deploy
72
+ ```
73
+
74
+ ### Reusable Workflows
75
+ - Create reusable workflows in `.github/workflows/`
76
+ - Call with `uses: ./.github/workflows/reusable.yml`
77
+
78
+ ## Job Dependencies
79
+ ```yaml
80
+ jobs:
81
+ build:
82
+ runs-on: ubuntu-latest
83
+ steps: [...]
84
+
85
+ deploy:
86
+ needs: build
87
+ runs-on: ubuntu-latest
88
+ steps: [...]
89
+ ```
90
+
91
+ ## Environment Variables
92
+ ```yaml
93
+ env:
94
+ NODE_ENV: production
95
+ API_URL: https://api.example.com
96
+ ```
97
+
98
+ ## Artifacts
99
+ - Upload build outputs for later jobs
100
+ - Download in subsequent jobs or manually
101
+ - Artifacts expire after 90 days by default
102
+
103
+ ## Concurrency Control
104
+ ```yaml
105
+ concurrency:
106
+ group: ${{ github.workflow }}-${{ github.ref }}
107
+ cancel-in-progress: true
108
+ ```
109
+
110
+ ## Performance Tips
111
+ - Use caching for dependencies
112
+ - Run independent jobs in parallel
113
+ - Use `if` conditions to skip unnecessary steps
114
+ - Use `continue-on-error` for non-critical steps
115
+
116
+ ## Security
117
+ - Use pinned versions of actions: `actions/checkout@v4`
118
+ - Review third-party actions before use
119
+ - Use GITHUB_TOKEN for authentication
120
+ - Enable branch protection rules
121
+ - Use environments for deployment approvals
122
+
123
+ ## Debugging
124
+ - Enable debug logging: Set secret `ACTIONS_STEP_DEBUG` to `true`
125
+ - Use `actions/upload-artifact` to save debug files
126
+ - Check workflow logs in Actions tab
127
+
128
+ ## Common Patterns
129
+
130
+ ### Build and Test
131
+ ```yaml
132
+ - name: Install dependencies
133
+ run: npm ci
134
+ - name: Build
135
+ run: npm run build
136
+ - name: Test
137
+ run: npm test
138
+ ```
139
+
140
+ ### Deploy on Main
141
+ ```yaml
142
+ - name: Deploy
143
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
144
+ run: npm run deploy
145
+ ```
146
+
147
+ ### Docker Build and Push
148
+ ```yaml
149
+ - name: Build and push
150
+ uses: docker/build-push-action@v5
151
+ with:
152
+ push: true
153
+ tags: user/app:latest
154
+ ```
155
+
156
+ ## Monitoring
157
+ - Check workflow status in Actions tab
158
+ - Set up status checks for required workflows
159
+ - Use workflow badges in README
160
+ - Enable notifications for failures
@@ -0,0 +1,210 @@
1
+ # GitLab CI/CD Guidelines
2
+
3
+ ## Overview
4
+ This project uses GitLab CI/CD for continuous integration and deployment. Follow best practices for efficient pipelines.
5
+
6
+ ## Pipeline Structure
7
+ ```yaml
8
+ stages:
9
+ - build
10
+ - test
11
+ - deploy
12
+
13
+ variables:
14
+ NODE_VERSION: "20"
15
+
16
+ build:
17
+ stage: build
18
+ image: node:${NODE_VERSION}
19
+ script:
20
+ - npm ci
21
+ - npm run build
22
+ artifacts:
23
+ paths:
24
+ - dist/
25
+ expire_in: 1 hour
26
+
27
+ test:
28
+ stage: test
29
+ image: node:${NODE_VERSION}
30
+ script:
31
+ - npm ci
32
+ - npm test
33
+ coverage: '/Coverage: \d+\.\d+%/'
34
+
35
+ deploy:
36
+ stage: deploy
37
+ script:
38
+ - npm run deploy
39
+ only:
40
+ - main
41
+ environment:
42
+ name: production
43
+ ```
44
+
45
+ ## Stages
46
+ - Define pipeline stages: `build`, `test`, `deploy`
47
+ - Jobs in same stage run in parallel
48
+ - Stages run sequentially
49
+ - Use dependencies for job order within stage
50
+
51
+ ## Jobs
52
+ - Each job runs in isolated environment
53
+ - Define image for Docker-based runners
54
+ - Use `script` for commands
55
+ - Use `before_script` and `after_script` for setup/cleanup
56
+
57
+ ## Variables
58
+ - Define global variables in `variables:` section
59
+ - Use in scripts: `$VARIABLE_NAME`
60
+ - Set in GitLab CI/CD settings for secrets
61
+ - Use `file` type for certificates
62
+
63
+ ## Artifacts
64
+ - Share files between jobs
65
+ - Define in `artifacts:` section
66
+ - Set expiration: `expire_in: 1 week`
67
+ - Download from pipeline UI
68
+
69
+ ## Cache
70
+ ```yaml
71
+ cache:
72
+ key: ${CI_COMMIT_REF_SLUG}
73
+ paths:
74
+ - node_modules/
75
+ - .npm/
76
+ ```
77
+
78
+ ## Rules and Conditions
79
+ ```yaml
80
+ deploy:
81
+ script: deploy.sh
82
+ rules:
83
+ - if: $CI_COMMIT_BRANCH == "main"
84
+ - when: manual # Require manual trigger
85
+ ```
86
+
87
+ ## Docker Integration
88
+ ```yaml
89
+ build-docker:
90
+ image: docker:latest
91
+ services:
92
+ - docker:dind
93
+ script:
94
+ - docker build -t myapp .
95
+ - docker push myapp
96
+ ```
97
+
98
+ ## Services
99
+ - Run side containers (database, cache)
100
+ - Example: `services: - postgres:15`
101
+ - Access via hostname: `postgres`
102
+
103
+ ## Environments
104
+ - Define deployment environments
105
+ - Track deployments in GitLab
106
+ - Enable auto-rollback
107
+ - Use protected environments
108
+
109
+ ## Include and Extends
110
+ ```yaml
111
+ include:
112
+ - local: '/.gitlab-ci-template.yml'
113
+
114
+ .node_job:
115
+ image: node:20
116
+ before_script:
117
+ - npm ci
118
+
119
+ test:
120
+ extends: .node_job
121
+ script:
122
+ - npm test
123
+ ```
124
+
125
+ ## Parallel Jobs
126
+ ```yaml
127
+ test:
128
+ parallel: 3
129
+ script:
130
+ - npm test -- --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL
131
+ ```
132
+
133
+ ## Triggers
134
+ - `push`: On every push
135
+ - `merge_request_event`: On MR creation/update
136
+ - `schedule`: Scheduled pipelines
137
+ - `api`: Triggered via API
138
+ - `manual`: Requires manual action
139
+
140
+ ## Best Practices
141
+ - Use `.gitlab-ci.yml` in repository root
142
+ - Pin image versions
143
+ - Use cache for dependencies
144
+ - Separate build and deploy stages
145
+ - Use artifacts for build outputs
146
+ - Set appropriate timeout values
147
+ - Use rules instead of only/except
148
+ - Validate YAML before committing
149
+
150
+ ## Performance
151
+ - Use cache effectively
152
+ - Run jobs in parallel when possible
153
+ - Use shallow clone: `GIT_DEPTH: 1`
154
+ - Optimize Docker images
155
+ - Use artifacts sparingly
156
+
157
+ ## Security
158
+ - Never commit secrets to `.gitlab-ci.yml`
159
+ - Use masked variables for secrets
160
+ - Use protected variables for sensitive data
161
+ - Scan for vulnerabilities in dependencies
162
+ - Use SAST and DAST tools
163
+
164
+ ## Debugging
165
+ - Check pipeline logs in CI/CD > Pipelines
166
+ - Use `CI_DEBUG_TRACE: "true"` for verbose logs
167
+ - Test locally with GitLab Runner
168
+ - Use `when: always` to run on failure
169
+
170
+ ## Common Patterns
171
+
172
+ ### Node.js Project
173
+ ```yaml
174
+ test:
175
+ image: node:20
176
+ script:
177
+ - npm ci
178
+ - npm test
179
+ artifacts:
180
+ reports:
181
+ coverage_report:
182
+ coverage_format: cobertura
183
+ path: coverage/cobertura-coverage.xml
184
+ ```
185
+
186
+ ### Manual Deployment
187
+ ```yaml
188
+ deploy:
189
+ stage: deploy
190
+ script:
191
+ - deploy.sh
192
+ when: manual
193
+ only:
194
+ - main
195
+ ```
196
+
197
+ ### Multi-Project Pipeline
198
+ ```yaml
199
+ trigger_downstream:
200
+ trigger:
201
+ project: group/downstream-project
202
+ branch: main
203
+ ```
204
+
205
+ ## Monitoring
206
+ - View pipeline status in GitLab UI
207
+ - Enable email notifications
208
+ - Use badges in README
209
+ - Monitor pipeline duration
210
+ - Track deployment frequency
@@ -0,0 +1,57 @@
1
+ # Language: TypeScript
2
+
3
+ ## Expert Identity
4
+ You are an expert TypeScript developer with deep knowledge of static typing, modern ECMAScript features, and type-safe application development.
5
+
6
+ ## Core Capabilities
7
+ - Write type-safe TypeScript code using strict mode
8
+ - Design robust type systems with interfaces and utility types
9
+ - Apply modern TypeScript patterns for null safety and immutability
10
+ - Debug type errors and provide clear type annotations
11
+
12
+ ## Coding Standards
13
+
14
+ ### Type Safety
15
+ * **ALWAYS** use strict mode (`"strict": true` in `tsconfig.json`).
16
+ * **AVOID** the `any` type. Prefer `unknown` when the type is truly unknown.
17
+ * **ALWAYS** use `interface` for public API definitions (e.g., function parameters, return types) and `type` for internal or utility types.
18
+
19
+ ### Modern Syntax
20
+ * **ALWAYS** use optional chaining (`?.`) and nullish coalescing (`??`) over `&&` checks.
21
+ * **NEVER** use `require`. Always use ES module `import` syntax.
22
+
23
+ ## Examples
24
+
25
+ ### Proper Interface Definition
26
+ ```typescript
27
+ // ✅ Good: Interface for public API
28
+ interface UserProfile {
29
+ id: string;
30
+ name: string;
31
+ email?: string; // Optional property
32
+ }
33
+
34
+ function getUser(id: string): Promise<UserProfile> {
35
+ // Implementation
36
+ }
37
+ ```
38
+
39
+ ### Type-Safe Null Handling
40
+ ```typescript
41
+ // ✅ Good: Using optional chaining and nullish coalescing
42
+ const displayName = user?.profile?.name ?? 'Anonymous';
43
+
44
+ // ❌ Bad: Manual null checks
45
+ const displayName = user && user.profile && user.profile.name ? user.profile.name : 'Anonymous';
46
+ ```
47
+
48
+ ## Safety Guidelines
49
+ - Never generate code that bypasses TypeScript's type system with `@ts-ignore` or `as any` without explicit user request
50
+ - Always validate that suggested code compiles without type errors
51
+ - Refuse to implement patterns that compromise type safety when asked
52
+
53
+ ## Tool Usage
54
+ When using file editing or code generation tools:
55
+ - Always include proper TypeScript type annotations
56
+ - Ensure imports are typed correctly
57
+ - Verify that generated code is compatible with strict mode
@@ -0,0 +1,21 @@
1
+ # State Management: Redux
2
+ - **ALWAYS** use Redux Toolkit (`@reduxjs/toolkit`) for modern Redux development.
3
+ - **ALWAYS** use `createSlice()` for reducer logic and actions.
4
+ - **ALWAYS** use `configureStore()` for store setup with good defaults.
5
+ - **ALWAYS** use TypeScript for type-safe Redux code.
6
+ - **ALWAYS** define action types as string constants or use `createAction()`.
7
+ - **ALWAYS** use `createAsyncThunk()` for async logic and API calls.
8
+ - **ALWAYS** normalize state shape for better performance and consistency.
9
+ - **ALWAYS** use selector functions with `createSelector()` for computed values.
10
+ - **ALWAYS** use `useSelector()` and `useDispatch()` hooks in React components.
11
+ - **ALWAYS** avoid direct state mutations - use immutable updates.
12
+ - **ALWAYS** use `redux-persist` for state persistence when needed.
13
+ - **ALWAYS** use `redux-saga` or `redux-thunk` for complex async flows.
14
+ - **ALWAYS** use `redux-devtools-extension` for debugging in development.
15
+ - **ALWAYS** write comprehensive tests for reducers and selectors.
16
+ - **ALWAYS** use `entityAdapter` from RTK for CRUD operations.
17
+ - **ALWAYS** handle loading and error states in async thunks.
18
+ - **ALWAYS** use `extraReducers` in `createSlice()` for async thunk handling.
19
+ - **ALWAYS** keep reducers pure and side-effect free.
20
+ - **ALWAYS** use meaningful action names and payload structures.
21
+ - **ALWAYS** document complex state transformations with comments.
@@ -0,0 +1,6 @@
1
+ # State: RxJS
2
+ - **ALWAYS** suffix Observable variables with a `$` (e.g., `users$`).
3
+ - **ALWAYS** use `BehaviorSubject` for state that needs to be "replayed" to new subscribers.
4
+ - **ALWAYS** `pipe()` operators. Do not use chained `.` operators.
5
+ - **NEVER** forget to `unsubscribe()`. Manage subscriptions in a central way, e.g., a `destroy$` Subject that completes `onComponentDestroy`.
6
+ - **PREFER** `switchMap` for handling new inner observables (like HTTP requests) and `mergeMap` for parallel operations.
@@ -0,0 +1,23 @@
1
+ # Styling: Material-UI (MUI)
2
+ - **ALWAYS** use `@mui/material` v5+ with Emotion styling engine.
3
+ - **ALWAYS** use `sx` prop for component-level styling.
4
+ - **ALWAYS** use `ThemeProvider` for consistent theming.
5
+ - **ALWAYS** use `createTheme()` for custom theme configuration.
6
+ - **ALWAYS** use semantic color tokens from the theme palette.
7
+ - **ALWAYS** use `Box` component as a generic layout primitive.
8
+ - **ALWAYS** use `Container` for max-width layouts and centering.
9
+ - **ALWAYS** use `Grid` v2 (`Grid2`) for responsive layouts.
10
+ - **ALWAYS** use `Typography` component for all text elements.
11
+ - **ALWAYS** use `Button` variants (`contained`, `outlined`, `text`) appropriately.
12
+ - **ALWAYS** use `IconButton` for icon-only actions.
13
+ - **ALWAYS** use `TextField` with proper `label` and `helperText` props.
14
+ - **ALWAYS** use `FormControl` and `FormLabel` for form organization.
15
+ - **ALWAYS** use `Dialog` for modals with proper accessibility.
16
+ - **ALWAYS** use `Menu` and `MenuItem` for dropdown menus.
17
+ - **ALWAYS** use `Chip` for tags, filters, and small status indicators.
18
+ - **ALWAYS** use `Avatar` for user profile images.
19
+ - **ALWAYS** use `Card`, `CardContent`, and `CardActions` for content containers.
20
+ - **ALWAYS** use `List`, `ListItem`, and `ListItemText` for list displays.
21
+ - **ALWAYS** use `Table` components for tabular data.
22
+ - **ALWAYS** use `useMediaQuery` hook for responsive behavior.
23
+ - **ALWAYS** use `styled()` API for custom component styling when needed.