@totaland/create-starter-kit 1.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +130 -18
- package/bin/index.js +109 -21
- package/package.json +2 -2
- package/templates/backend/.github/agents/ /360/237/216/255 planner.agent.md" +92 -0
- package/templates/backend/.github/agents/api-architect.agent.md +41 -0
- package/templates/backend/.github/agents/code-reviewer.agent.md +26 -0
- package/templates/backend/.github/agents/code-simplifier.agent.md +41 -0
- package/templates/backend/.github/agents/code-skeptic.agent.md +74 -0
- package/templates/backend/.github/agents/docs-specialist.agent.md +25 -0
- package/templates/backend/.github/agents/implementation-plan.agent.md +160 -0
- package/templates/backend/.github/agents/janitor.agent.md +90 -0
- package/templates/backend/.github/agents/ms-sql-dba.agent.md +25 -0
- package/templates/backend/.github/agents/plan.agent.md +115 -0
- package/templates/backend/.github/agents/planner.agent.md +15 -0
- package/templates/backend/.github/agents/playwright-tester.agent.md +13 -0
- package/templates/backend/.github/agents/postgresql-dba.agent.md +18 -0
- package/templates/backend/.github/agents/prd.agent.md +202 -0
- package/templates/backend/.github/agents/research-technical-spike.agent.md +170 -0
- package/templates/backend/.github/agents/software-engineer-agent-v1.agent.md +165 -0
- package/templates/backend/.github/agents/task-planner.agent.md +375 -0
- package/templates/backend/.github/agents/task-researcher.agent.md +255 -0
- package/templates/backend/.github/agents/tdd-green.agent.md +60 -0
- package/templates/backend/.github/agents/tdd-red.agent.md +60 -0
- package/templates/backend/.github/agents/tdd-refactor.agent.md +85 -0
- package/templates/backend/.github/agents/tech-debt-remediation-plan.agent.md +50 -0
- package/templates/backend/.github/agents/typescript-mcp-expert.agent.md +91 -0
- package/templates/backend/.github/agents/ultimate-thinking-beastmode.agent.md +644 -0
- package/templates/backend/.github/agents//360/237/216/255 generator.agent.md" +264 -0
- package/templates/backend/.github/agents//360/237/216/255 healer.agent.md" +44 -0
- package/templates/backend/.github/agents//360/237/216/255 pom.agent.md" +308 -0
- package/templates/backend/.github/instructions/a11y.instructions.md +369 -0
- package/templates/backend/.github/instructions/ms-sql-dba.instructions.md +25 -0
- package/templates/backend/.github/instructions/object-calisthenics.instructions.md +302 -0
- package/templates/backend/.github/instructions/performance-optimization.instructions.md +420 -0
- package/templates/backend/.github/instructions/playwright-python.instructions.md +62 -0
- package/templates/backend/.github/instructions/playwright-typescript.instructions.md +86 -0
- package/templates/backend/.github/instructions/security-and-owasp.instructions.md +51 -0
- package/templates/backend/.github/instructions/self-explanatory-code-commenting.instructions.md +162 -0
- package/templates/backend/.github/instructions/spec-driven-workflow-v1.instructions.md +323 -0
- package/templates/backend/.github/instructions/sql-sp-generation.instructions.md +74 -0
- package/templates/backend/.github/instructions/task-implementation.instructions.md +190 -0
- package/templates/backend/.github/instructions/typescript-mcp-server.instructions.md +228 -0
- package/templates/backend/.github/prompts/ai-prompt-engineering-safety-review.prompt.md +229 -0
- package/templates/backend/.github/prompts/architecture-blueprint-generator.prompt.md +321 -0
- package/templates/backend/.github/prompts/breakdown-epic-arch.prompt.md +65 -0
- package/templates/backend/.github/prompts/breakdown-epic-pm.prompt.md +57 -0
- package/templates/backend/.github/prompts/breakdown-feature-implementation.prompt.md +127 -0
- package/templates/backend/.github/prompts/breakdown-feature-prd.prompt.md +60 -0
- package/templates/backend/.github/prompts/breakdown-plan.prompt.md +508 -0
- package/templates/backend/.github/prompts/copilot-instructions-blueprint-generator.prompt.md +293 -0
- package/templates/backend/.github/prompts/create-agentsmd.prompt.md +248 -0
- package/templates/backend/.github/prompts/create-github-issue-feature-from-specification.prompt.md +27 -0
- package/templates/backend/.github/prompts/create-github-issues-feature-from-implementation-plan.prompt.md +27 -0
- package/templates/backend/.github/prompts/create-github-issues-for-unmet-specification-requirements.prompt.md +35 -0
- package/templates/backend/.github/prompts/create-implementation-plan.prompt.md +156 -0
- package/templates/backend/.github/prompts/create-llms.prompt.md +209 -0
- package/templates/backend/.github/prompts/create-specification.prompt.md +126 -0
- package/templates/backend/.github/prompts/create-technical-spike.prompt.md +230 -0
- package/templates/backend/.github/prompts/csharp-nunit.prompt.md +71 -0
- package/templates/backend/.github/prompts/ef-core.prompt.md +76 -0
- package/templates/backend/.github/prompts/folder-structure-blueprint-generator.prompt.md +404 -0
- package/templates/backend/.github/prompts/gen-specs-as-issues.prompt.md +165 -0
- package/templates/backend/.github/prompts/generate-custom-instructions-from-codebase.prompt.md +239 -0
- package/templates/backend/.github/prompts/java-junit.prompt.md +64 -0
- package/templates/backend/.github/prompts/memory-merger.prompt.md +107 -0
- package/templates/backend/.github/prompts/multi-stage-dockerfile.prompt.md +46 -0
- package/templates/backend/.github/prompts/playwright-automation-fill-in-form.prompt.md +29 -0
- package/templates/backend/.github/prompts/playwright-explore-website.prompt.md +19 -0
- package/templates/backend/.github/prompts/playwright-generate-test.prompt.md +19 -0
- package/templates/backend/.github/prompts/postgresql-code-review.prompt.md +214 -0
- package/templates/backend/.github/prompts/postgresql-optimization.prompt.md +406 -0
- package/templates/backend/.github/prompts/project-workflow-analysis-blueprint-generator.prompt.md +294 -0
- package/templates/backend/.github/prompts/prompt-builder.prompt.md +142 -0
- package/templates/backend/.github/prompts/remember.prompt.md +125 -0
- package/templates/backend/.github/prompts/review-and-refactor.prompt.md +15 -0
- package/templates/backend/.github/prompts/sql-code-review.prompt.md +303 -0
- package/templates/backend/.github/prompts/sql-optimization.prompt.md +298 -0
- package/templates/backend/.github/prompts/suggest-awesome-github-copilot-agents.prompt.md +72 -0
- package/templates/backend/.github/prompts/suggest-awesome-github-copilot-chatmodes.prompt.md +71 -0
- package/templates/backend/.github/prompts/suggest-awesome-github-copilot-collections.prompt.md +149 -0
- package/templates/backend/.github/prompts/suggest-awesome-github-copilot-instructions.prompt.md +88 -0
- package/templates/backend/.github/prompts/suggest-awesome-github-copilot-prompts.prompt.md +71 -0
- package/templates/backend/.github/prompts/technology-stack-blueprint-generator.prompt.md +242 -0
- package/templates/backend/.github/prompts/typescript-mcp-server-generator.prompt.md +90 -0
- package/templates/backend/.github/prompts/update-implementation-plan.prompt.md +157 -0
- package/templates/backend/.github/prompts/update-markdown-file-index.prompt.md +76 -0
- package/templates/backend/Project_Folders_Structure_Blueprint.md +529 -0
- package/templates/backend/README.md +99 -0
- package/templates/backend/biome.json +45 -0
- package/{template → templates/backend}/drizzle.config.ts +1 -1
- package/{template → templates/backend}/package.json +9 -4
- package/templates/backend/pnpm-lock.yaml +4240 -0
- package/templates/backend/src/features/health/health.test.ts +23 -0
- package/{template → templates/backend}/src/features/health/index.ts +1 -0
- package/templates/backend/src/features/health/schemas.ts +29 -0
- package/templates/backend/src/features/orders/controller.ts +18 -0
- package/templates/backend/src/features/orders/index.ts +10 -0
- package/templates/backend/src/features/orders/schemas.ts +62 -0
- package/{template → templates/backend}/src/index.ts +3 -36
- package/templates/backend/src/lib/openapi.ts +25 -0
- package/templates/backend/src/lib/validateRequest.test.ts +84 -0
- package/templates/backend/src/lib/validateRequest.ts +72 -0
- package/{template → templates/backend}/tsconfig.json +2 -2
- package/{template → templates/backend}/vitest.config.ts +8 -1
- package/templates/frontend/.env.example +7 -0
- package/templates/frontend/.github/agents/ /360/237/216/255 planner.agent.md" +92 -0
- package/templates/frontend/.github/agents/api-architect.agent.md +41 -0
- package/templates/frontend/.github/agents/code-reviewer.agent.md +26 -0
- package/templates/frontend/.github/agents/code-simplifier.agent.md +41 -0
- package/templates/frontend/.github/agents/code-skeptic.agent.md +74 -0
- package/templates/frontend/.github/agents/docs-specialist.agent.md +25 -0
- package/templates/frontend/.github/agents/implementation-plan.agent.md +160 -0
- package/templates/frontend/.github/agents/janitor.agent.md +90 -0
- package/templates/frontend/.github/agents/ms-sql-dba.agent.md +25 -0
- package/templates/frontend/.github/agents/plan.agent.md +115 -0
- package/templates/frontend/.github/agents/planner.agent.md +15 -0
- package/templates/frontend/.github/agents/playwright-tester.agent.md +13 -0
- package/templates/frontend/.github/agents/postgresql-dba.agent.md +18 -0
- package/templates/frontend/.github/agents/prd.agent.md +202 -0
- package/templates/frontend/.github/agents/research-technical-spike.agent.md +170 -0
- package/templates/frontend/.github/agents/software-engineer-agent-v1.agent.md +165 -0
- package/templates/frontend/.github/agents/task-planner.agent.md +375 -0
- package/templates/frontend/.github/agents/task-researcher.agent.md +255 -0
- package/templates/frontend/.github/agents/tdd-green.agent.md +60 -0
- package/templates/frontend/.github/agents/tdd-red.agent.md +60 -0
- package/templates/frontend/.github/agents/tdd-refactor.agent.md +85 -0
- package/templates/frontend/.github/agents/tech-debt-remediation-plan.agent.md +50 -0
- package/templates/frontend/.github/agents/typescript-mcp-expert.agent.md +91 -0
- package/templates/frontend/.github/agents/ultimate-thinking-beastmode.agent.md +644 -0
- package/templates/frontend/.github/agents//360/237/216/255 generator.agent.md" +264 -0
- package/templates/frontend/.github/agents//360/237/216/255 healer.agent.md" +44 -0
- package/templates/frontend/.github/agents//360/237/216/255 pom.agent.md" +308 -0
- package/templates/frontend/.github/instructions/a11y.instructions.md +369 -0
- package/templates/frontend/.github/instructions/ms-sql-dba.instructions.md +25 -0
- package/templates/frontend/.github/instructions/object-calisthenics.instructions.md +302 -0
- package/templates/frontend/.github/instructions/performance-optimization.instructions.md +420 -0
- package/templates/frontend/.github/instructions/playwright-python.instructions.md +62 -0
- package/templates/frontend/.github/instructions/playwright-typescript.instructions.md +86 -0
- package/templates/frontend/.github/instructions/security-and-owasp.instructions.md +51 -0
- package/templates/frontend/.github/instructions/self-explanatory-code-commenting.instructions.md +162 -0
- package/templates/frontend/.github/instructions/spec-driven-workflow-v1.instructions.md +323 -0
- package/templates/frontend/.github/instructions/sql-sp-generation.instructions.md +74 -0
- package/templates/frontend/.github/instructions/task-implementation.instructions.md +190 -0
- package/templates/frontend/.github/instructions/typescript-mcp-server.instructions.md +228 -0
- package/templates/frontend/.github/prompts/ai-prompt-engineering-safety-review.prompt.md +229 -0
- package/templates/frontend/.github/prompts/architecture-blueprint-generator.prompt.md +321 -0
- package/templates/frontend/.github/prompts/breakdown-epic-arch.prompt.md +65 -0
- package/templates/frontend/.github/prompts/breakdown-epic-pm.prompt.md +57 -0
- package/templates/frontend/.github/prompts/breakdown-feature-implementation.prompt.md +127 -0
- package/templates/frontend/.github/prompts/breakdown-feature-prd.prompt.md +60 -0
- package/templates/frontend/.github/prompts/breakdown-plan.prompt.md +508 -0
- package/templates/frontend/.github/prompts/copilot-instructions-blueprint-generator.prompt.md +293 -0
- package/templates/frontend/.github/prompts/create-agentsmd.prompt.md +248 -0
- package/templates/frontend/.github/prompts/create-github-issue-feature-from-specification.prompt.md +27 -0
- package/templates/frontend/.github/prompts/create-github-issues-feature-from-implementation-plan.prompt.md +27 -0
- package/templates/frontend/.github/prompts/create-github-issues-for-unmet-specification-requirements.prompt.md +35 -0
- package/templates/frontend/.github/prompts/create-implementation-plan.prompt.md +156 -0
- package/templates/frontend/.github/prompts/create-llms.prompt.md +209 -0
- package/templates/frontend/.github/prompts/create-specification.prompt.md +126 -0
- package/templates/frontend/.github/prompts/create-technical-spike.prompt.md +230 -0
- package/templates/frontend/.github/prompts/csharp-nunit.prompt.md +71 -0
- package/templates/frontend/.github/prompts/ef-core.prompt.md +76 -0
- package/templates/frontend/.github/prompts/folder-structure-blueprint-generator.prompt.md +404 -0
- package/templates/frontend/.github/prompts/gen-specs-as-issues.prompt.md +165 -0
- package/templates/frontend/.github/prompts/generate-custom-instructions-from-codebase.prompt.md +239 -0
- package/templates/frontend/.github/prompts/java-junit.prompt.md +64 -0
- package/templates/frontend/.github/prompts/memory-merger.prompt.md +107 -0
- package/templates/frontend/.github/prompts/multi-stage-dockerfile.prompt.md +46 -0
- package/templates/frontend/.github/prompts/playwright-automation-fill-in-form.prompt.md +29 -0
- package/templates/frontend/.github/prompts/playwright-explore-website.prompt.md +19 -0
- package/templates/frontend/.github/prompts/playwright-generate-test.prompt.md +19 -0
- package/templates/frontend/.github/prompts/postgresql-code-review.prompt.md +214 -0
- package/templates/frontend/.github/prompts/postgresql-optimization.prompt.md +406 -0
- package/templates/frontend/.github/prompts/project-workflow-analysis-blueprint-generator.prompt.md +294 -0
- package/templates/frontend/.github/prompts/prompt-builder.prompt.md +142 -0
- package/templates/frontend/.github/prompts/remember.prompt.md +125 -0
- package/templates/frontend/.github/prompts/review-and-refactor.prompt.md +15 -0
- package/templates/frontend/.github/prompts/sql-code-review.prompt.md +303 -0
- package/templates/frontend/.github/prompts/sql-optimization.prompt.md +298 -0
- package/templates/frontend/.github/prompts/suggest-awesome-github-copilot-agents.prompt.md +72 -0
- package/templates/frontend/.github/prompts/suggest-awesome-github-copilot-chatmodes.prompt.md +71 -0
- package/templates/frontend/.github/prompts/suggest-awesome-github-copilot-collections.prompt.md +149 -0
- package/templates/frontend/.github/prompts/suggest-awesome-github-copilot-instructions.prompt.md +88 -0
- package/templates/frontend/.github/prompts/suggest-awesome-github-copilot-prompts.prompt.md +71 -0
- package/templates/frontend/.github/prompts/technology-stack-blueprint-generator.prompt.md +242 -0
- package/templates/frontend/.github/prompts/typescript-mcp-server-generator.prompt.md +90 -0
- package/templates/frontend/.github/prompts/update-implementation-plan.prompt.md +157 -0
- package/templates/frontend/.github/prompts/update-markdown-file-index.prompt.md +76 -0
- package/templates/frontend/README.md +199 -0
- package/templates/frontend/biome.json +45 -0
- package/templates/frontend/components.json +22 -0
- package/templates/frontend/index.html +13 -0
- package/templates/frontend/package.json +44 -0
- package/templates/frontend/pnpm-lock.yaml +2011 -0
- package/templates/frontend/postcss.config.js +6 -0
- package/templates/frontend/public/vite.svg +1 -0
- package/templates/frontend/src/App.css +42 -0
- package/templates/frontend/src/App.tsx +17 -0
- package/templates/frontend/src/assets/react.svg +1 -0
- package/templates/frontend/src/components/layout/layout.component.tsx +31 -0
- package/templates/frontend/src/components/menu-toggle-icon.tsx +53 -0
- package/templates/frontend/src/components/ui/button.tsx +57 -0
- package/templates/frontend/src/docs/RECOMMENDED_LIBRARIES.md +226 -0
- package/templates/frontend/src/docs/SETUP_SUMMARY.md +162 -0
- package/templates/frontend/src/hooks/use-scroll.ts +21 -0
- package/templates/frontend/src/index.css +121 -0
- package/templates/frontend/src/lib/api-client.ts +46 -0
- package/templates/frontend/src/lib/utils.ts +6 -0
- package/templates/frontend/src/main.tsx +30 -0
- package/templates/frontend/src/pages/about/about.page.tsx +50 -0
- package/templates/frontend/src/pages/home/home.page.tsx +43 -0
- package/templates/frontend/tailwind.config.js +59 -0
- package/templates/frontend/tsconfig.app.json +41 -0
- package/templates/frontend/tsconfig.json +13 -0
- package/templates/frontend/tsconfig.node.json +26 -0
- package/templates/frontend/vite.config.ts +14 -0
- package/template/.env.example +0 -8
- package/template/AGENTS.md +0 -23
- package/template/ARCHITECTURE.md +0 -53
- package/template/ORDER_SYSTEM.md +0 -93
- package/template/biome.json +0 -3
- package/template/src/features/orders/controller.ts +0 -13
- package/template/src/features/orders/index.ts +0 -7
- /package/{template → templates/backend}/knip.json +0 -0
- /package/{template → templates/backend}/playwright.config.ts +0 -0
- /package/{template → templates/backend}/pnpm-workspace.yaml +0 -0
- /package/{template → templates/backend}/src/features/health/controller.ts +0 -0
- /package/{template → templates/backend}/tsconfig.build.json +0 -0
package/templates/backend/.github/instructions/self-explanatory-code-commenting.instructions.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Guidelines for GitHub Copilot to write comments to achieve self-explanatory code with less comments. Examples are in JavaScript but it should work on any language that has comments.'
|
|
3
|
+
applyTo: '**'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Self-explanatory Code Commenting Instructions
|
|
7
|
+
|
|
8
|
+
## Core Principle
|
|
9
|
+
**Write code that speaks for itself. Comment only when necessary to explain WHY, not WHAT.**
|
|
10
|
+
We do not need comments most of the time.
|
|
11
|
+
|
|
12
|
+
## Commenting Guidelines
|
|
13
|
+
|
|
14
|
+
### ❌ AVOID These Comment Types
|
|
15
|
+
|
|
16
|
+
**Obvious Comments**
|
|
17
|
+
```javascript
|
|
18
|
+
// Bad: States the obvious
|
|
19
|
+
let counter = 0; // Initialize counter to zero
|
|
20
|
+
counter++; // Increment counter by one
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Redundant Comments**
|
|
24
|
+
```javascript
|
|
25
|
+
// Bad: Comment repeats the code
|
|
26
|
+
function getUserName() {
|
|
27
|
+
return user.name; // Return the user's name
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Outdated Comments**
|
|
32
|
+
```javascript
|
|
33
|
+
// Bad: Comment doesn't match the code
|
|
34
|
+
// Calculate tax at 5% rate
|
|
35
|
+
const tax = price * 0.08; // Actually 8%
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### ✅ WRITE These Comment Types
|
|
39
|
+
|
|
40
|
+
**Complex Business Logic**
|
|
41
|
+
```javascript
|
|
42
|
+
// Good: Explains WHY this specific calculation
|
|
43
|
+
// Apply progressive tax brackets: 10% up to 10k, 20% above
|
|
44
|
+
const tax = calculateProgressiveTax(income, [0.10, 0.20], [10000]);
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Non-obvious Algorithms**
|
|
48
|
+
```javascript
|
|
49
|
+
// Good: Explains the algorithm choice
|
|
50
|
+
// Using Floyd-Warshall for all-pairs shortest paths
|
|
51
|
+
// because we need distances between all nodes
|
|
52
|
+
for (let k = 0; k < vertices; k++) {
|
|
53
|
+
for (let i = 0; i < vertices; i++) {
|
|
54
|
+
for (let j = 0; j < vertices; j++) {
|
|
55
|
+
// ... implementation
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Regex Patterns**
|
|
62
|
+
```javascript
|
|
63
|
+
// Good: Explains what the regex matches
|
|
64
|
+
// Match email format: username@domain.extension
|
|
65
|
+
const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**API Constraints or Gotchas**
|
|
69
|
+
```javascript
|
|
70
|
+
// Good: Explains external constraint
|
|
71
|
+
// GitHub API rate limit: 5000 requests/hour for authenticated users
|
|
72
|
+
await rateLimiter.wait();
|
|
73
|
+
const response = await fetch(githubApiUrl);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Decision Framework
|
|
77
|
+
|
|
78
|
+
Before writing a comment, ask:
|
|
79
|
+
1. **Is the code self-explanatory?** → No comment needed
|
|
80
|
+
2. **Would a better variable/function name eliminate the need?** → Refactor instead
|
|
81
|
+
3. **Does this explain WHY, not WHAT?** → Good comment
|
|
82
|
+
4. **Will this help future maintainers?** → Good comment
|
|
83
|
+
|
|
84
|
+
## Special Cases for Comments
|
|
85
|
+
|
|
86
|
+
### Public APIs
|
|
87
|
+
```javascript
|
|
88
|
+
/**
|
|
89
|
+
* Calculate compound interest using the standard formula.
|
|
90
|
+
*
|
|
91
|
+
* @param {number} principal - Initial amount invested
|
|
92
|
+
* @param {number} rate - Annual interest rate (as decimal, e.g., 0.05 for 5%)
|
|
93
|
+
* @param {number} time - Time period in years
|
|
94
|
+
* @param {number} compoundFrequency - How many times per year interest compounds (default: 1)
|
|
95
|
+
* @returns {number} Final amount after compound interest
|
|
96
|
+
*/
|
|
97
|
+
function calculateCompoundInterest(principal, rate, time, compoundFrequency = 1) {
|
|
98
|
+
// ... implementation
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Configuration and Constants
|
|
103
|
+
```javascript
|
|
104
|
+
// Good: Explains the source or reasoning
|
|
105
|
+
const MAX_RETRIES = 3; // Based on network reliability studies
|
|
106
|
+
const API_TIMEOUT = 5000; // AWS Lambda timeout is 15s, leaving buffer
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Annotations
|
|
110
|
+
```javascript
|
|
111
|
+
// TODO: Replace with proper user authentication after security review
|
|
112
|
+
// FIXME: Memory leak in production - investigate connection pooling
|
|
113
|
+
// HACK: Workaround for bug in library v2.1.0 - remove after upgrade
|
|
114
|
+
// NOTE: This implementation assumes UTC timezone for all calculations
|
|
115
|
+
// WARNING: This function modifies the original array instead of creating a copy
|
|
116
|
+
// PERF: Consider caching this result if called frequently in hot path
|
|
117
|
+
// SECURITY: Validate input to prevent SQL injection before using in query
|
|
118
|
+
// BUG: Edge case failure when array is empty - needs investigation
|
|
119
|
+
// REFACTOR: Extract this logic into separate utility function for reusability
|
|
120
|
+
// DEPRECATED: Use newApiFunction() instead - this will be removed in v3.0
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Anti-Patterns to Avoid
|
|
124
|
+
|
|
125
|
+
### Dead Code Comments
|
|
126
|
+
```javascript
|
|
127
|
+
// Bad: Don't comment out code
|
|
128
|
+
// const oldFunction = () => { ... };
|
|
129
|
+
const newFunction = () => { ... };
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Changelog Comments
|
|
133
|
+
```javascript
|
|
134
|
+
// Bad: Don't maintain history in comments
|
|
135
|
+
// Modified by John on 2023-01-15
|
|
136
|
+
// Fixed bug reported by Sarah on 2023-02-03
|
|
137
|
+
function processData() {
|
|
138
|
+
// ... implementation
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Divider Comments
|
|
143
|
+
```javascript
|
|
144
|
+
// Bad: Don't use decorative comments
|
|
145
|
+
//=====================================
|
|
146
|
+
// UTILITY FUNCTIONS
|
|
147
|
+
//=====================================
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Quality Checklist
|
|
151
|
+
|
|
152
|
+
Before committing, ensure your comments:
|
|
153
|
+
- [ ] Explain WHY, not WHAT
|
|
154
|
+
- [ ] Are grammatically correct and clear
|
|
155
|
+
- [ ] Will remain accurate as code evolves
|
|
156
|
+
- [ ] Add genuine value to code understanding
|
|
157
|
+
- [ ] Are placed appropriately (above the code they describe)
|
|
158
|
+
- [ ] Use proper spelling and professional language
|
|
159
|
+
|
|
160
|
+
## Summary
|
|
161
|
+
|
|
162
|
+
Remember: **The best comment is the one you don't need to write because the code is self-documenting.**
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Specification-Driven Workflow v1 provides a structured approach to software development, ensuring that requirements are clearly defined, designs are meticulously planned, and implementations are thoroughly documented and validated.'
|
|
3
|
+
applyTo: '**'
|
|
4
|
+
---
|
|
5
|
+
# Spec Driven Workflow v1
|
|
6
|
+
|
|
7
|
+
**Specification-Driven Workflow:**
|
|
8
|
+
Bridge the gap between requirements and implementation.
|
|
9
|
+
|
|
10
|
+
**Maintain these artifacts at all times:**
|
|
11
|
+
|
|
12
|
+
- **`requirements.md`**: User stories and acceptance criteria in structured EARS notation.
|
|
13
|
+
- **`design.md`**: Technical architecture, sequence diagrams, implementation considerations.
|
|
14
|
+
- **`tasks.md`**: Detailed, trackable implementation plan.
|
|
15
|
+
|
|
16
|
+
## Universal Documentation Framework
|
|
17
|
+
|
|
18
|
+
**Documentation Rule:**
|
|
19
|
+
Use the detailed templates as the **primary source of truth** for all documentation.
|
|
20
|
+
|
|
21
|
+
**Summary formats:**
|
|
22
|
+
Use only for concise artifacts such as changelogs and pull request descriptions.
|
|
23
|
+
|
|
24
|
+
### Detailed Documentation Templates
|
|
25
|
+
|
|
26
|
+
#### Action Documentation Template (All Steps/Executions/Tests)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
### [TYPE] - [ACTION] - [TIMESTAMP]
|
|
30
|
+
**Objective**: [Goal being accomplished]
|
|
31
|
+
**Context**: [Current state, requirements, and reference to prior steps]
|
|
32
|
+
**Decision**: [Approach chosen and rationale, referencing the Decision Record if applicable]
|
|
33
|
+
**Execution**: [Steps taken with parameters and commands used. For code, include file paths.]
|
|
34
|
+
**Output**: [Complete and unabridged results, logs, command outputs, and metrics]
|
|
35
|
+
**Validation**: [Success verification method and results. If failed, include a remediation plan.]
|
|
36
|
+
**Next**: [Automatic continuation plan to the next specific action]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### Decision Record Template (All Decisions)
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
### Decision - [TIMESTAMP]
|
|
43
|
+
**Decision**: [What was decided]
|
|
44
|
+
**Context**: [Situation requiring decision and data driving it]
|
|
45
|
+
**Options**: [Alternatives evaluated with brief pros and cons]
|
|
46
|
+
**Rationale**: [Why the selected option is superior, with trade-offs explicitly stated]
|
|
47
|
+
**Impact**: [Anticipated consequences for implementation, maintainability, and performance]
|
|
48
|
+
**Review**: [Conditions or schedule for reassessing this decision]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Summary Formats (for Reporting)
|
|
52
|
+
|
|
53
|
+
#### Streamlined Action Log
|
|
54
|
+
|
|
55
|
+
For generating concise changelogs. Each log entry is derived from a full Action Document.
|
|
56
|
+
|
|
57
|
+
`[TYPE][TIMESTAMP] Goal: [X] → Action: [Y] → Result: [Z] → Next: [W]`
|
|
58
|
+
|
|
59
|
+
#### Compressed Decision Record
|
|
60
|
+
|
|
61
|
+
For use in pull request summaries or executive summaries.
|
|
62
|
+
|
|
63
|
+
`Decision: [X] | Rationale: [Y] | Impact: [Z] | Review: [Date]`
|
|
64
|
+
|
|
65
|
+
## Execution Workflow (6-Phase Loop)
|
|
66
|
+
|
|
67
|
+
**Never skip any step. Use consistent terminology. Reduce ambiguity.**
|
|
68
|
+
|
|
69
|
+
### **Phase 1: ANALYZE**
|
|
70
|
+
|
|
71
|
+
**Objective:**
|
|
72
|
+
|
|
73
|
+
- Understand the problem.
|
|
74
|
+
- Analyze the existing system.
|
|
75
|
+
- Produce a clear, testable set of requirements.
|
|
76
|
+
- Think about the possible solutions and their implications.
|
|
77
|
+
|
|
78
|
+
**Checklist:**
|
|
79
|
+
|
|
80
|
+
- [ ] Read all provided code, documentation, tests, and logs.
|
|
81
|
+
- Document file inventory, summaries, and initial analysis results.
|
|
82
|
+
- [ ] Define requirements in **EARS Notation**:
|
|
83
|
+
- Transform feature requests into structured, testable requirements.
|
|
84
|
+
- Format: `WHEN [a condition or event], THE SYSTEM SHALL [expected behavior]`
|
|
85
|
+
- [ ] Identify dependencies and constraints.
|
|
86
|
+
- Document a dependency graph with risks and mitigation strategies.
|
|
87
|
+
- [ ] Map data flows and interactions.
|
|
88
|
+
- Document system interaction diagrams and data models.
|
|
89
|
+
- [ ] Catalog edge cases and failures.
|
|
90
|
+
- Document a comprehensive edge case matrix and potential failure points.
|
|
91
|
+
- [ ] Assess confidence.
|
|
92
|
+
- Generate a **Confidence Score (0-100%)** based on clarity of requirements, complexity, and problem scope.
|
|
93
|
+
- Document the score and its rationale.
|
|
94
|
+
|
|
95
|
+
**Critical Constraint:**
|
|
96
|
+
|
|
97
|
+
- **Do not proceed until all requirements are clear and documented.**
|
|
98
|
+
|
|
99
|
+
### **Phase 2: DESIGN**
|
|
100
|
+
|
|
101
|
+
**Objective:**
|
|
102
|
+
|
|
103
|
+
- Create a comprehensive technical design and a detailed implementation plan.
|
|
104
|
+
|
|
105
|
+
**Checklist:**
|
|
106
|
+
|
|
107
|
+
- [ ] **Define adaptive execution strategy based on Confidence Score:**
|
|
108
|
+
- **High Confidence (>85%)**
|
|
109
|
+
- Draft a comprehensive, step-by-step implementation plan.
|
|
110
|
+
- Skip proof-of-concept steps.
|
|
111
|
+
- Proceed with full, automated implementation.
|
|
112
|
+
- Maintain standard comprehensive documentation.
|
|
113
|
+
- **Medium Confidence (66–85%)**
|
|
114
|
+
- Prioritize a **Proof-of-Concept (PoC)** or **Minimum Viable Product (MVP)**.
|
|
115
|
+
- Define clear success criteria for PoC/MVP.
|
|
116
|
+
- Build and validate PoC/MVP first, then expand plan incrementally.
|
|
117
|
+
- Document PoC/MVP goals, execution, and validation results.
|
|
118
|
+
- **Low Confidence (<66%)**
|
|
119
|
+
- Dedicate first phase to research and knowledge-building.
|
|
120
|
+
- Use semantic search and analyze similar implementations.
|
|
121
|
+
- Synthesize findings into a research document.
|
|
122
|
+
- Re-run ANALYZE phase after research.
|
|
123
|
+
- Escalate only if confidence remains low.
|
|
124
|
+
|
|
125
|
+
- [ ] **Document technical design in `design.md`:**
|
|
126
|
+
- **Architecture:** High-level overview of components and interactions.
|
|
127
|
+
- **Data Flow:** Diagrams and descriptions.
|
|
128
|
+
- **Interfaces:** API contracts, schemas, public-facing function signatures.
|
|
129
|
+
- **Data Models:** Data structures and database schemas.
|
|
130
|
+
|
|
131
|
+
- [ ] **Document error handling:**
|
|
132
|
+
- Create an error matrix with procedures and expected responses.
|
|
133
|
+
|
|
134
|
+
- [ ] **Define unit testing strategy.**
|
|
135
|
+
|
|
136
|
+
- [ ] **Create implementation plan in `tasks.md`:**
|
|
137
|
+
- For each task, include description, expected outcome, and dependencies.
|
|
138
|
+
|
|
139
|
+
**Critical Constraint:**
|
|
140
|
+
|
|
141
|
+
- **Do not proceed to implementation until design and plan are complete and validated.**
|
|
142
|
+
|
|
143
|
+
### **Phase 3: IMPLEMENT**
|
|
144
|
+
|
|
145
|
+
**Objective:**
|
|
146
|
+
|
|
147
|
+
- Write production-quality code according to the design and plan.
|
|
148
|
+
|
|
149
|
+
**Checklist:**
|
|
150
|
+
|
|
151
|
+
- [ ] Code in small, testable increments.
|
|
152
|
+
- Document each increment with code changes, results, and test links.
|
|
153
|
+
- [ ] Implement from dependencies upward.
|
|
154
|
+
- Document resolution order, justification, and verification.
|
|
155
|
+
- [ ] Follow conventions.
|
|
156
|
+
- Document adherence and any deviations with a Decision Record.
|
|
157
|
+
- [ ] Add meaningful comments.
|
|
158
|
+
- Focus on intent ("why"), not mechanics ("what").
|
|
159
|
+
- [ ] Create files as planned.
|
|
160
|
+
- Document file creation log.
|
|
161
|
+
- [ ] Update task status in real time.
|
|
162
|
+
|
|
163
|
+
**Critical Constraint:**
|
|
164
|
+
|
|
165
|
+
- **Do not merge or deploy code until all implementation steps are documented and tested.**
|
|
166
|
+
|
|
167
|
+
### **Phase 4: VALIDATE**
|
|
168
|
+
|
|
169
|
+
**Objective:**
|
|
170
|
+
|
|
171
|
+
- Verify that implementation meets all requirements and quality standards.
|
|
172
|
+
|
|
173
|
+
**Checklist:**
|
|
174
|
+
|
|
175
|
+
- [ ] Execute automated tests.
|
|
176
|
+
- Document outputs, logs, and coverage reports.
|
|
177
|
+
- For failures, document root cause analysis and remediation.
|
|
178
|
+
- [ ] Perform manual verification if necessary.
|
|
179
|
+
- Document procedures, checklists, and results.
|
|
180
|
+
- [ ] Test edge cases and errors.
|
|
181
|
+
- Document results and evidence of correct error handling.
|
|
182
|
+
- [ ] Verify performance.
|
|
183
|
+
- Document metrics and profile critical sections.
|
|
184
|
+
- [ ] Log execution traces.
|
|
185
|
+
- Document path analysis and runtime behavior.
|
|
186
|
+
|
|
187
|
+
**Critical Constraint:**
|
|
188
|
+
|
|
189
|
+
- **Do not proceed until all validation steps are complete and all issues are resolved.**
|
|
190
|
+
|
|
191
|
+
### **Phase 5: REFLECT**
|
|
192
|
+
|
|
193
|
+
**Objective:**
|
|
194
|
+
|
|
195
|
+
- Improve codebase, update documentation, and analyze performance.
|
|
196
|
+
|
|
197
|
+
**Checklist:**
|
|
198
|
+
|
|
199
|
+
- [ ] Refactor for maintainability.
|
|
200
|
+
- Document decisions, before/after comparisons, and impact.
|
|
201
|
+
- [ ] Update all project documentation.
|
|
202
|
+
- Ensure all READMEs, diagrams, and comments are current.
|
|
203
|
+
- [ ] Identify potential improvements.
|
|
204
|
+
- Document backlog with prioritization.
|
|
205
|
+
- [ ] Validate success criteria.
|
|
206
|
+
- Document final verification matrix.
|
|
207
|
+
- [ ] Perform meta-analysis.
|
|
208
|
+
- Reflect on efficiency, tool usage, and protocol adherence.
|
|
209
|
+
- [ ] Auto-create technical debt issues.
|
|
210
|
+
- Document inventory and remediation plans.
|
|
211
|
+
|
|
212
|
+
**Critical Constraint:**
|
|
213
|
+
|
|
214
|
+
- **Do not close the phase until all documentation and improvement actions are logged.**
|
|
215
|
+
|
|
216
|
+
### **Phase 6: HANDOFF**
|
|
217
|
+
|
|
218
|
+
**Objective:**
|
|
219
|
+
|
|
220
|
+
- Package work for review and deployment, and transition to next task.
|
|
221
|
+
|
|
222
|
+
**Checklist:**
|
|
223
|
+
|
|
224
|
+
- [ ] Generate executive summary.
|
|
225
|
+
- Use **Compressed Decision Record** format.
|
|
226
|
+
- [ ] Prepare pull request (if applicable):
|
|
227
|
+
1. Executive summary.
|
|
228
|
+
2. Changelog from **Streamlined Action Log**.
|
|
229
|
+
3. Links to validation artifacts and Decision Records.
|
|
230
|
+
4. Links to final `requirements.md`, `design.md`, and `tasks.md`.
|
|
231
|
+
- [ ] Finalize workspace.
|
|
232
|
+
- Archive intermediate files, logs, and temporary artifacts to `.agent_work/`.
|
|
233
|
+
- [ ] Continue to next task.
|
|
234
|
+
- Document transition or completion.
|
|
235
|
+
|
|
236
|
+
**Critical Constraint:**
|
|
237
|
+
|
|
238
|
+
- **Do not consider the task complete until all handoff steps are finished and documented.**
|
|
239
|
+
|
|
240
|
+
## Troubleshooting & Retry Protocol
|
|
241
|
+
|
|
242
|
+
**If you encounter errors, ambiguities, or blockers:**
|
|
243
|
+
|
|
244
|
+
**Checklist:**
|
|
245
|
+
|
|
246
|
+
1. **Re-analyze**:
|
|
247
|
+
- Revisit the ANALYZE phase.
|
|
248
|
+
- Confirm all requirements and constraints are clear and complete.
|
|
249
|
+
2. **Re-design**:
|
|
250
|
+
- Revisit the DESIGN phase.
|
|
251
|
+
- Update technical design, plans, or dependencies as needed.
|
|
252
|
+
3. **Re-plan**:
|
|
253
|
+
- Adjust the implementation plan in `tasks.md` to address new findings.
|
|
254
|
+
4. **Retry execution**:
|
|
255
|
+
- Re-execute failed steps with corrected parameters or logic.
|
|
256
|
+
5. **Escalate**:
|
|
257
|
+
- If the issue persists after retries, follow the escalation protocol.
|
|
258
|
+
|
|
259
|
+
**Critical Constraint:**
|
|
260
|
+
|
|
261
|
+
- **Never proceed with unresolved errors or ambiguities. Always document troubleshooting steps and outcomes.**
|
|
262
|
+
|
|
263
|
+
## Technical Debt Management (Automated)
|
|
264
|
+
|
|
265
|
+
### Identification & Documentation
|
|
266
|
+
|
|
267
|
+
- **Code Quality**: Continuously assess code quality during implementation using static analysis.
|
|
268
|
+
- **Shortcuts**: Explicitly record all speed-over-quality decisions with their consequences in a Decision Record.
|
|
269
|
+
- **Workspace**: Monitor for organizational drift and naming inconsistencies.
|
|
270
|
+
- **Documentation**: Track incomplete, outdated, or missing documentation.
|
|
271
|
+
|
|
272
|
+
### Auto-Issue Creation Template
|
|
273
|
+
|
|
274
|
+
```text
|
|
275
|
+
**Title**: [Technical Debt] - [Brief Description]
|
|
276
|
+
**Priority**: [High/Medium/Low based on business impact and remediation cost]
|
|
277
|
+
**Location**: [File paths and line numbers]
|
|
278
|
+
**Reason**: [Why the debt was incurred, linking to a Decision Record if available]
|
|
279
|
+
**Impact**: [Current and future consequences (e.g., slows development, increases bug risk)]
|
|
280
|
+
**Remediation**: [Specific, actionable resolution steps]
|
|
281
|
+
**Effort**: [Estimate for resolution (e.g., T-shirt size: S, M, L)]
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Remediation (Auto-Prioritized)
|
|
285
|
+
|
|
286
|
+
- Risk-based prioritization with dependency analysis.
|
|
287
|
+
- Effort estimation to aid in future planning.
|
|
288
|
+
- Propose migration strategies for large refactoring efforts.
|
|
289
|
+
|
|
290
|
+
## Quality Assurance (Automated)
|
|
291
|
+
|
|
292
|
+
### Continuous Monitoring
|
|
293
|
+
|
|
294
|
+
- **Static Analysis**: Linting for code style, quality, security vulnerabilities, and architectural rule adherence.
|
|
295
|
+
- **Dynamic Analysis**: Monitor runtime behavior and performance in a staging environment.
|
|
296
|
+
- **Documentation**: Automated checks for documentation completeness and accuracy (e.g., linking, format).
|
|
297
|
+
|
|
298
|
+
### Quality Metrics (Auto-Tracked)
|
|
299
|
+
|
|
300
|
+
- Code coverage percentage and gap analysis.
|
|
301
|
+
- Cyclomatic complexity score per function/method.
|
|
302
|
+
- Maintainability index assessment.
|
|
303
|
+
- Technical debt ratio (e.g., estimated remediation time vs. development time).
|
|
304
|
+
- Documentation coverage percentage (e.g., public methods with comments).
|
|
305
|
+
|
|
306
|
+
## EARS Notation Reference
|
|
307
|
+
|
|
308
|
+
**EARS (Easy Approach to Requirements Syntax)** - Standard format for requirements:
|
|
309
|
+
|
|
310
|
+
- **Ubiquitous**: `THE SYSTEM SHALL [expected behavior]`
|
|
311
|
+
- **Event-driven**: `WHEN [trigger event] THE SYSTEM SHALL [expected behavior]`
|
|
312
|
+
- **State-driven**: `WHILE [in specific state] THE SYSTEM SHALL [expected behavior]`
|
|
313
|
+
- **Unwanted behavior**: `IF [unwanted condition] THEN THE SYSTEM SHALL [required response]`
|
|
314
|
+
- **Optional**: `WHERE [feature is included] THE SYSTEM SHALL [expected behavior]`
|
|
315
|
+
- **Complex**: Combinations of the above patterns for sophisticated requirements
|
|
316
|
+
|
|
317
|
+
Each requirement must be:
|
|
318
|
+
|
|
319
|
+
- **Testable**: Can be verified through automated or manual testing
|
|
320
|
+
- **Unambiguous**: Single interpretation possible
|
|
321
|
+
- **Necessary**: Contributes to the system's purpose
|
|
322
|
+
- **Feasible**: Can be implemented within constraints
|
|
323
|
+
- **Traceable**: Linked to user needs and design elements
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Guidelines for generating SQL statements and stored procedures'
|
|
3
|
+
applyTo: '**/*.sql'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SQL Development
|
|
7
|
+
|
|
8
|
+
## Database schema generation
|
|
9
|
+
- all table names should be in singular form
|
|
10
|
+
- all column names should be in singular form
|
|
11
|
+
- all tables should have a primary key column named `id`
|
|
12
|
+
- all tables should have a column named `created_at` to store the creation timestamp
|
|
13
|
+
- all tables should have a column named `updated_at` to store the last update timestamp
|
|
14
|
+
|
|
15
|
+
## Database schema design
|
|
16
|
+
- all tables should have a primary key constraint
|
|
17
|
+
- all foreign key constraints should have a name
|
|
18
|
+
- all foreign key constraints should be defined inline
|
|
19
|
+
- all foreign key constraints should have `ON DELETE CASCADE` option
|
|
20
|
+
- all foreign key constraints should have `ON UPDATE CASCADE` option
|
|
21
|
+
- all foreign key constraints should reference the primary key of the parent table
|
|
22
|
+
|
|
23
|
+
## SQL Coding Style
|
|
24
|
+
- use uppercase for SQL keywords (SELECT, FROM, WHERE)
|
|
25
|
+
- use consistent indentation for nested queries and conditions
|
|
26
|
+
- include comments to explain complex logic
|
|
27
|
+
- break long queries into multiple lines for readability
|
|
28
|
+
- organize clauses consistently (SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY)
|
|
29
|
+
|
|
30
|
+
## SQL Query Structure
|
|
31
|
+
- use explicit column names in SELECT statements instead of SELECT *
|
|
32
|
+
- qualify column names with table name or alias when using multiple tables
|
|
33
|
+
- limit the use of subqueries when joins can be used instead
|
|
34
|
+
- include LIMIT/TOP clauses to restrict result sets
|
|
35
|
+
- use appropriate indexing for frequently queried columns
|
|
36
|
+
- avoid using functions on indexed columns in WHERE clauses
|
|
37
|
+
|
|
38
|
+
## Stored Procedure Naming Conventions
|
|
39
|
+
- prefix stored procedure names with 'usp_'
|
|
40
|
+
- use PascalCase for stored procedure names
|
|
41
|
+
- use descriptive names that indicate purpose (e.g., usp_GetCustomerOrders)
|
|
42
|
+
- include plural noun when returning multiple records (e.g., usp_GetProducts)
|
|
43
|
+
- include singular noun when returning single record (e.g., usp_GetProduct)
|
|
44
|
+
|
|
45
|
+
## Parameter Handling
|
|
46
|
+
- prefix parameters with '@'
|
|
47
|
+
- use camelCase for parameter names
|
|
48
|
+
- provide default values for optional parameters
|
|
49
|
+
- validate parameter values before use
|
|
50
|
+
- document parameters with comments
|
|
51
|
+
- arrange parameters consistently (required first, optional later)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Stored Procedure Structure
|
|
55
|
+
- include header comment block with description, parameters, and return values
|
|
56
|
+
- return standardized error codes/messages
|
|
57
|
+
- return result sets with consistent column order
|
|
58
|
+
- use OUTPUT parameters for returning status information
|
|
59
|
+
- prefix temporary tables with 'tmp_'
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## SQL Security Best Practices
|
|
63
|
+
- parameterize all queries to prevent SQL injection
|
|
64
|
+
- use prepared statements when executing dynamic SQL
|
|
65
|
+
- avoid embedding credentials in SQL scripts
|
|
66
|
+
- implement proper error handling without exposing system details
|
|
67
|
+
- avoid using dynamic SQL within stored procedures
|
|
68
|
+
|
|
69
|
+
## Transaction Management
|
|
70
|
+
- explicitly begin and commit transactions
|
|
71
|
+
- use appropriate isolation levels based on requirements
|
|
72
|
+
- avoid long-running transactions that lock tables
|
|
73
|
+
- use batch processing for large data operations
|
|
74
|
+
- include SET NOCOUNT ON for stored procedures that modify data
|