forgecraft-mcp 1.2.0 → 1.3.2
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 +525 -525
- package/dist/cli/help.js +44 -44
- package/dist/registry/renderer-skeletons.js +92 -92
- package/dist/shared/gs-score-logger.js +6 -6
- package/dist/tools/add-module.js +123 -123
- package/dist/tools/advice-registry.js +18 -18
- package/dist/tools/check-cascade-report.js +64 -64
- package/dist/tools/configure-mcp.d.ts +3 -0
- package/dist/tools/configure-mcp.d.ts.map +1 -1
- package/dist/tools/configure-mcp.js +10 -0
- package/dist/tools/configure-mcp.js.map +1 -1
- package/dist/tools/forgecraft-dispatch.d.ts.map +1 -1
- package/dist/tools/forgecraft-dispatch.js +3 -0
- package/dist/tools/forgecraft-dispatch.js.map +1 -1
- package/dist/tools/forgecraft-schema-params.d.ts +9 -0
- package/dist/tools/forgecraft-schema-params.d.ts.map +1 -1
- package/dist/tools/forgecraft-schema-params.js +21 -0
- package/dist/tools/forgecraft-schema-params.js.map +1 -1
- package/dist/tools/forgecraft-schema.d.ts +9 -0
- package/dist/tools/forgecraft-schema.d.ts.map +1 -1
- package/dist/tools/refresh-output.js +14 -14
- package/dist/tools/scaffold-spec-stubs.js +115 -115
- package/dist/tools/scaffold-templates.js +62 -62
- package/dist/tools/setup-artifact-writers.d.ts +30 -0
- package/dist/tools/setup-artifact-writers.d.ts.map +1 -1
- package/dist/tools/setup-artifact-writers.js +120 -8
- package/dist/tools/setup-artifact-writers.js.map +1 -1
- package/dist/tools/setup-phase1.d.ts +3 -0
- package/dist/tools/setup-phase1.d.ts.map +1 -1
- package/dist/tools/setup-phase1.js +79 -35
- package/dist/tools/setup-phase1.js.map +1 -1
- package/dist/tools/setup-phase2.d.ts +2 -0
- package/dist/tools/setup-phase2.d.ts.map +1 -1
- package/dist/tools/setup-phase2.js +10 -1
- package/dist/tools/setup-phase2.js.map +1 -1
- package/dist/tools/setup-project.d.ts +18 -0
- package/dist/tools/setup-project.d.ts.map +1 -1
- package/dist/tools/setup-project.js +77 -1
- package/dist/tools/setup-project.js.map +1 -1
- package/dist/tools/spec-parser-tags.d.ts +9 -0
- package/dist/tools/spec-parser-tags.d.ts.map +1 -1
- package/dist/tools/spec-parser-tags.js +92 -0
- package/dist/tools/spec-parser-tags.js.map +1 -1
- package/package.json +89 -86
- package/templates/analytics/instructions.yaml +37 -37
- package/templates/analytics/mcp-servers.yaml +11 -11
- package/templates/analytics/structure.yaml +25 -25
- package/templates/api/instructions.yaml +231 -231
- package/templates/api/mcp-servers.yaml +22 -13
- package/templates/api/nfr.yaml +23 -23
- package/templates/api/review.yaml +103 -103
- package/templates/api/structure.yaml +34 -34
- package/templates/api/verification.yaml +132 -132
- package/templates/cli/instructions.yaml +31 -31
- package/templates/cli/mcp-servers.yaml +11 -11
- package/templates/cli/review.yaml +53 -53
- package/templates/cli/structure.yaml +16 -16
- package/templates/data-lineage/instructions.yaml +28 -28
- package/templates/data-lineage/mcp-servers.yaml +22 -22
- package/templates/data-pipeline/instructions.yaml +84 -84
- package/templates/data-pipeline/mcp-servers.yaml +13 -13
- package/templates/data-pipeline/nfr.yaml +39 -39
- package/templates/data-pipeline/structure.yaml +23 -23
- package/templates/fintech/hooks.yaml +55 -55
- package/templates/fintech/instructions.yaml +112 -112
- package/templates/fintech/mcp-servers.yaml +13 -13
- package/templates/fintech/nfr.yaml +46 -46
- package/templates/fintech/playbook.yaml +210 -210
- package/templates/fintech/verification.yaml +239 -239
- package/templates/game/instructions.yaml +289 -289
- package/templates/game/mcp-servers.yaml +38 -38
- package/templates/game/nfr.yaml +64 -64
- package/templates/game/playbook.yaml +214 -214
- package/templates/game/review.yaml +97 -97
- package/templates/game/structure.yaml +67 -67
- package/templates/game/verification.yaml +174 -174
- package/templates/healthcare/instructions.yaml +42 -42
- package/templates/healthcare/mcp-servers.yaml +13 -13
- package/templates/healthcare/nfr.yaml +47 -47
- package/templates/hipaa/instructions.yaml +41 -41
- package/templates/hipaa/mcp-servers.yaml +13 -13
- package/templates/infra/instructions.yaml +104 -104
- package/templates/infra/mcp-servers.yaml +20 -20
- package/templates/infra/nfr.yaml +46 -46
- package/templates/infra/review.yaml +65 -65
- package/templates/infra/structure.yaml +25 -25
- package/templates/library/instructions.yaml +36 -36
- package/templates/library/mcp-servers.yaml +20 -20
- package/templates/library/review.yaml +56 -56
- package/templates/library/structure.yaml +19 -19
- package/templates/medallion-architecture/instructions.yaml +41 -41
- package/templates/medallion-architecture/mcp-servers.yaml +22 -22
- package/templates/ml/instructions.yaml +85 -85
- package/templates/ml/mcp-servers.yaml +11 -11
- package/templates/ml/nfr.yaml +39 -39
- package/templates/ml/structure.yaml +25 -25
- package/templates/ml/verification.yaml +156 -156
- package/templates/mobile/instructions.yaml +44 -44
- package/templates/mobile/mcp-servers.yaml +11 -11
- package/templates/mobile/nfr.yaml +49 -49
- package/templates/mobile/structure.yaml +27 -27
- package/templates/mobile/verification.yaml +121 -121
- package/templates/observability-xray/instructions.yaml +40 -40
- package/templates/observability-xray/mcp-servers.yaml +15 -15
- package/templates/realtime/instructions.yaml +42 -42
- package/templates/realtime/mcp-servers.yaml +13 -13
- package/templates/soc2/instructions.yaml +41 -41
- package/templates/soc2/mcp-servers.yaml +24 -24
- package/templates/social/instructions.yaml +43 -43
- package/templates/social/mcp-servers.yaml +24 -24
- package/templates/state-machine/instructions.yaml +42 -42
- package/templates/state-machine/mcp-servers.yaml +11 -11
- package/templates/tools-registry.yaml +164 -164
- package/templates/universal/hooks.yaml +531 -531
- package/templates/universal/instructions.yaml +1692 -1692
- package/templates/universal/mcp-servers.yaml +50 -50
- package/templates/universal/nfr.yaml +197 -197
- package/templates/universal/reference.yaml +326 -326
- package/templates/universal/review.yaml +204 -204
- package/templates/universal/skills.yaml +262 -262
- package/templates/universal/structure.yaml +67 -67
- package/templates/universal/verification.yaml +416 -416
- package/templates/web-react/hooks.yaml +44 -44
- package/templates/web-react/instructions.yaml +207 -207
- package/templates/web-react/mcp-servers.yaml +20 -20
- package/templates/web-react/nfr.yaml +27 -27
- package/templates/web-react/review.yaml +94 -94
- package/templates/web-react/structure.yaml +46 -46
- package/templates/web-react/verification.yaml +126 -126
- package/templates/web-static/instructions.yaml +115 -115
- package/templates/web-static/mcp-servers.yaml +20 -20
- package/templates/web3/instructions.yaml +44 -44
- package/templates/web3/mcp-servers.yaml +11 -11
- package/templates/web3/verification.yaml +159 -159
- package/templates/zero-trust/instructions.yaml +41 -41
- package/templates/zero-trust/mcp-servers.yaml +15 -15
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
tag: UNIVERSAL
|
|
2
|
-
section: mcp-servers
|
|
3
|
-
servers:
|
|
4
|
-
- name: forgecraft
|
|
5
|
-
description: "Production-grade engineering standards and project scaffolding"
|
|
6
|
-
command: npx
|
|
7
|
-
args: ["-y", "forgecraft-mcp"]
|
|
8
|
-
tags: [UNIVERSAL]
|
|
9
|
-
category: scaffolding
|
|
10
|
-
tier: core
|
|
11
|
-
url: "https://github.com/jghiringhelli/forgecraft-mcp"
|
|
12
|
-
|
|
13
|
-
- name: context7
|
|
14
|
-
description: "Pulls up-to-date documentation and code examples for libraries directly into your prompt"
|
|
15
|
-
command: npx
|
|
16
|
-
args: ["-y", "@upstash/context7-mcp@latest"]
|
|
17
|
-
tags: [UNIVERSAL]
|
|
18
|
-
category: documentation
|
|
19
|
-
tier: recommended
|
|
20
|
-
url: "https://github.com/upstash/context7"
|
|
21
|
-
|
|
22
|
-
- name: sequential-thinking
|
|
23
|
-
description: "Dynamic, reflective problem-solving through thought sequences"
|
|
24
|
-
command: npx
|
|
25
|
-
args: ["-y", "@modelcontextprotocol/server-sequential-thinking"]
|
|
26
|
-
tags: [UNIVERSAL]
|
|
27
|
-
category: general
|
|
28
|
-
tier: optional
|
|
29
|
-
url: "https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking"
|
|
30
|
-
|
|
31
|
-
- name: spec-workflow
|
|
32
|
-
description: "Spec-driven TDD workflow with structured requirements, design docs, and red-green-refactor quality gates"
|
|
33
|
-
command: npx
|
|
34
|
-
args: ["-y", "spec-workflow-mcp"]
|
|
35
|
-
tags: [UNIVERSAL]
|
|
36
|
-
category: testing
|
|
37
|
-
tier: optional
|
|
38
|
-
url: "https://github.com/Pimzino/spec-workflow-mcp"
|
|
39
|
-
|
|
40
|
-
- name: codeseeker
|
|
41
|
-
description: "Semantic code search — prevents duplication by finding existing patterns before writing new code"
|
|
42
|
-
command: npx
|
|
43
|
-
args: ["-y", "codeseeker@2", "serve", "--mcp"]
|
|
44
|
-
env:
|
|
45
|
-
CODESEEKER_STORAGE_MODE: embedded
|
|
46
|
-
tags: [UNIVERSAL, API, CLI, LIBRARY]
|
|
47
|
-
category: code-intelligence
|
|
48
|
-
tier: recommended
|
|
49
|
-
url: "https://github.com/jghiringhelli/codeseeker"
|
|
50
|
-
evidence: "AX treatment-v6 — CodeSeeker v2.0.0 active during session. Duplication dropped from v5 5.37% to 2.50%."
|
|
1
|
+
tag: UNIVERSAL
|
|
2
|
+
section: mcp-servers
|
|
3
|
+
servers:
|
|
4
|
+
- name: forgecraft
|
|
5
|
+
description: "Production-grade engineering standards and project scaffolding"
|
|
6
|
+
command: npx
|
|
7
|
+
args: ["-y", "forgecraft-mcp"]
|
|
8
|
+
tags: [UNIVERSAL]
|
|
9
|
+
category: scaffolding
|
|
10
|
+
tier: core
|
|
11
|
+
url: "https://github.com/jghiringhelli/forgecraft-mcp"
|
|
12
|
+
|
|
13
|
+
- name: context7
|
|
14
|
+
description: "Pulls up-to-date documentation and code examples for libraries directly into your prompt"
|
|
15
|
+
command: npx
|
|
16
|
+
args: ["-y", "@upstash/context7-mcp@latest"]
|
|
17
|
+
tags: [UNIVERSAL]
|
|
18
|
+
category: documentation
|
|
19
|
+
tier: recommended
|
|
20
|
+
url: "https://github.com/upstash/context7"
|
|
21
|
+
|
|
22
|
+
- name: sequential-thinking
|
|
23
|
+
description: "Dynamic, reflective problem-solving through thought sequences"
|
|
24
|
+
command: npx
|
|
25
|
+
args: ["-y", "@modelcontextprotocol/server-sequential-thinking"]
|
|
26
|
+
tags: [UNIVERSAL]
|
|
27
|
+
category: general
|
|
28
|
+
tier: optional
|
|
29
|
+
url: "https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking"
|
|
30
|
+
|
|
31
|
+
- name: spec-workflow
|
|
32
|
+
description: "Spec-driven TDD workflow with structured requirements, design docs, and red-green-refactor quality gates"
|
|
33
|
+
command: npx
|
|
34
|
+
args: ["-y", "spec-workflow-mcp"]
|
|
35
|
+
tags: [UNIVERSAL]
|
|
36
|
+
category: testing
|
|
37
|
+
tier: optional
|
|
38
|
+
url: "https://github.com/Pimzino/spec-workflow-mcp"
|
|
39
|
+
|
|
40
|
+
- name: codeseeker
|
|
41
|
+
description: "Semantic code search — prevents duplication by finding existing patterns before writing new code"
|
|
42
|
+
command: npx
|
|
43
|
+
args: ["-y", "codeseeker@2", "serve", "--mcp"]
|
|
44
|
+
env:
|
|
45
|
+
CODESEEKER_STORAGE_MODE: embedded
|
|
46
|
+
tags: [UNIVERSAL, API, CLI, LIBRARY]
|
|
47
|
+
category: code-intelligence
|
|
48
|
+
tier: recommended
|
|
49
|
+
url: "https://github.com/jghiringhelli/codeseeker"
|
|
50
|
+
evidence: "AX treatment-v6 — CodeSeeker v2.0.0 active during session. Duplication dropped from v5 5.37% to 2.50%."
|
|
@@ -1,197 +1,197 @@
|
|
|
1
|
-
tag: UNIVERSAL
|
|
2
|
-
section: nfr
|
|
3
|
-
blocks:
|
|
4
|
-
- id: security
|
|
5
|
-
tier: core
|
|
6
|
-
title: "Security"
|
|
7
|
-
content: |
|
|
8
|
-
## NFR: Security
|
|
9
|
-
|
|
10
|
-
### Authentication & Authorization
|
|
11
|
-
- Authentication mechanism: {{auth_mechanism}}
|
|
12
|
-
- Authorization model: {{auth_model}}
|
|
13
|
-
- Secret management: environment variables minimum, secrets manager preferred (AWS SSM, Vault)
|
|
14
|
-
- No secrets in code, config files, or git history. Ever.
|
|
15
|
-
|
|
16
|
-
### Input Validation
|
|
17
|
-
- Validate and sanitize ALL external input at system boundary.
|
|
18
|
-
- Use allowlists, not denylists.
|
|
19
|
-
- Parameterized queries only — no string concatenation for SQL/commands.
|
|
20
|
-
|
|
21
|
-
### Dependencies
|
|
22
|
-
- Automated dependency vulnerability scanning (Dependabot, Snyk, or equivalent).
|
|
23
|
-
- No dependencies with known critical CVEs.
|
|
24
|
-
- Lock file committed (package-lock.json, poetry.lock, Cargo.lock).
|
|
25
|
-
|
|
26
|
-
### Transport
|
|
27
|
-
- TLS 1.2+ for all network communication.
|
|
28
|
-
- HSTS headers on all web responses.
|
|
29
|
-
- CORS configured to minimum necessary origins.
|
|
30
|
-
|
|
31
|
-
- id: observability
|
|
32
|
-
tier: recommended
|
|
33
|
-
title: "Observability"
|
|
34
|
-
content: |
|
|
35
|
-
## NFR: Observability
|
|
36
|
-
|
|
37
|
-
### Structured Logging
|
|
38
|
-
- JSON-formatted structured logs (structlog for Python, pino for Node).
|
|
39
|
-
- Every log entry includes: timestamp, level, service, trace_id, operation, context.
|
|
40
|
-
- Log levels used correctly: DEBUG for development, INFO for operations, WARN for degraded
|
|
41
|
-
state, ERROR for failures requiring attention.
|
|
42
|
-
- NO sensitive data in logs (PHI, PII, credentials, tokens).
|
|
43
|
-
|
|
44
|
-
### Metrics
|
|
45
|
-
- RED metrics on all service boundaries: Rate, Errors, Duration.
|
|
46
|
-
- Business metrics for key operations.
|
|
47
|
-
- Alerting thresholds defined for all critical metrics.
|
|
48
|
-
|
|
49
|
-
### Health Checks
|
|
50
|
-
- /health endpoint returning: status, version, uptime, dependency health.
|
|
51
|
-
- Readiness vs liveness probes (Kubernetes) or equivalent.
|
|
52
|
-
|
|
53
|
-
- id: reliability
|
|
54
|
-
tier: recommended
|
|
55
|
-
title: "Reliability"
|
|
56
|
-
content: |
|
|
57
|
-
## NFR: Reliability
|
|
58
|
-
|
|
59
|
-
### Graceful Degradation
|
|
60
|
-
- Circuit breakers on all external service calls.
|
|
61
|
-
- Timeout configured on every external call (no indefinite waits).
|
|
62
|
-
- Fallback behavior defined for each dependency failure.
|
|
63
|
-
|
|
64
|
-
### Disaster Recovery
|
|
65
|
-
- Backup strategy: automated, tested, documented.
|
|
66
|
-
- Runbook for common failure scenarios.
|
|
67
|
-
- **RPO** (Recovery Point Objective): maximum acceptable data loss = {{rpo | default: 1 hour}}.
|
|
68
|
-
- **RTO** (Recovery Time Objective): maximum acceptable downtime = {{rto | default: 4 hours}}.
|
|
69
|
-
- Failover tested at least quarterly. Document time-to-recovery in post-mortems.
|
|
70
|
-
- Database point-in-time recovery enabled. Retention: {{backup_retention | default: 30 days}}.
|
|
71
|
-
|
|
72
|
-
### Availability Targets
|
|
73
|
-
- Target uptime: {{uptime_target | default: 99.9%}} (≈ 8.7 hours downtime/year).
|
|
74
|
-
- Define SLIs (error rate, latency p99, availability) and SLOs per service.
|
|
75
|
-
- Error budget policy: when budget is exhausted, freeze feature releases until reliability improves.
|
|
76
|
-
- Maintenance windows communicated 48h in advance. Prefer zero-downtime deployments.
|
|
77
|
-
|
|
78
|
-
- id: scalability
|
|
79
|
-
tier: optional
|
|
80
|
-
title: "Scalability"
|
|
81
|
-
content: |
|
|
82
|
-
## NFR: Scalability
|
|
83
|
-
|
|
84
|
-
### Horizontal Scaling
|
|
85
|
-
- Application designed for horizontal scaling — no in-process state that can't be lost.
|
|
86
|
-
- Session/cache state externalized to Redis, Memcached, or equivalent.
|
|
87
|
-
- Connection pooling configured per environment. Pool exhaustion triggers alerts, not failures.
|
|
88
|
-
|
|
89
|
-
### Data Layer
|
|
90
|
-
- Database queries support the expected data volume. Test with 10x expected load.
|
|
91
|
-
- Pagination on all list operations. No unbounded queries.
|
|
92
|
-
- Read replicas for read-heavy workloads. Write/read split documented.
|
|
93
|
-
- Index strategy reviewed quarterly. Slow query log monitored.
|
|
94
|
-
|
|
95
|
-
### Queue & Async Processing
|
|
96
|
-
- CPU-intensive or long-running work offloaded to background queues.
|
|
97
|
-
- Queue depth monitored. Auto-scale workers based on queue backlog.
|
|
98
|
-
- Dead letter queues for failed messages. Alert and review DLQ weekly.
|
|
99
|
-
|
|
100
|
-
- id: compliance
|
|
101
|
-
tier: optional
|
|
102
|
-
title: "Compliance & Data Governance"
|
|
103
|
-
content: |
|
|
104
|
-
## NFR: Compliance & Data Governance
|
|
105
|
-
|
|
106
|
-
### Data Classification
|
|
107
|
-
- All data fields classified: Public, Internal, Confidential, Restricted.
|
|
108
|
-
- Restricted data (PII, PHI, financial) encrypted at rest and in transit.
|
|
109
|
-
- Access to restricted data logged and auditable.
|
|
110
|
-
|
|
111
|
-
### GDPR / Privacy
|
|
112
|
-
- Data processing purposes documented. No collection beyond stated purpose.
|
|
113
|
-
- Right to access: user can export their data in machine-readable format.
|
|
114
|
-
- Right to erasure: user data deletable within {{deletion_sla | default: 30 days}} of request.
|
|
115
|
-
- Data retention schedules defined per data type. Auto-delete expired data.
|
|
116
|
-
- Cookie consent where required. No tracking before consent.
|
|
117
|
-
|
|
118
|
-
### Audit Trail
|
|
119
|
-
- Security-relevant actions logged: authentication events, permission changes,
|
|
120
|
-
data access, admin operations.
|
|
121
|
-
- Audit logs immutable, retained for {{audit_retention | default: 1 year}}.
|
|
122
|
-
- Logs stored separately from application data.
|
|
123
|
-
|
|
124
|
-
- id: accessibility
|
|
125
|
-
tier: optional
|
|
126
|
-
title: "Accessibility"
|
|
127
|
-
content: |
|
|
128
|
-
## NFR: Accessibility
|
|
129
|
-
|
|
130
|
-
### Standards
|
|
131
|
-
- Target: WCAG 2.1 AA compliance minimum for all user-facing interfaces.
|
|
132
|
-
- Semantic HTML. Proper heading hierarchy. ARIA attributes where HTML semantics aren't sufficient.
|
|
133
|
-
- All interactive elements keyboard-accessible. Visible focus indicators.
|
|
134
|
-
- Color contrast: minimum 4.5:1 for normal text, 3:1 for large text.
|
|
135
|
-
|
|
136
|
-
### Testing
|
|
137
|
-
- Automated accessibility audit in CI (axe-core, Lighthouse accessibility).
|
|
138
|
-
- Screen reader testing for critical user journeys (at least quarterly).
|
|
139
|
-
- No images without alt text. No videos without captions.
|
|
140
|
-
|
|
141
|
-
### Universal Design
|
|
142
|
-
- Support reduced motion (`prefers-reduced-motion`).
|
|
143
|
-
- Support high contrast mode.
|
|
144
|
-
- Touch targets minimum 44x44px on mobile interfaces.
|
|
145
|
-
|
|
146
|
-
- id: internationalization
|
|
147
|
-
tier: optional
|
|
148
|
-
title: "Internationalization"
|
|
149
|
-
content: |
|
|
150
|
-
## NFR: Internationalization (i18n)
|
|
151
|
-
|
|
152
|
-
### Text & Content
|
|
153
|
-
- All user-facing text externalized to translation files from day one.
|
|
154
|
-
- No hardcoded strings in UI code. No string concatenation for translatable sentences.
|
|
155
|
-
- Translation keys namespaced by feature: `module.component.label`.
|
|
156
|
-
|
|
157
|
-
### Formatting
|
|
158
|
-
- Dates, numbers, currencies formatted via `Intl` API or equivalent — never manual formatting.
|
|
159
|
-
- Time zones handled correctly. Store UTC, display in user's local zone.
|
|
160
|
-
- Support RTL layouts if right-to-left languages are in scope.
|
|
161
|
-
|
|
162
|
-
### Workflow
|
|
163
|
-
- New strings automatically flagged for translation in CI.
|
|
164
|
-
- Missing translations fall back to default locale, never show raw keys to users.
|
|
165
|
-
|
|
166
|
-
- id: maintainability
|
|
167
|
-
tier: recommended
|
|
168
|
-
title: "Maintainability & Developer Experience"
|
|
169
|
-
content: |
|
|
170
|
-
## NFR: Maintainability & Developer Experience
|
|
171
|
-
|
|
172
|
-
### Onboarding
|
|
173
|
-
- New developer productive within 1 day: clone → install → run → make a change → test → commit.
|
|
174
|
-
- README.md with step-by-step local setup.
|
|
175
|
-
- .env.example with every variable documented.
|
|
176
|
-
|
|
177
|
-
### Code Quality Metrics
|
|
178
|
-
- Cyclomatic complexity: flag functions > 10, block > 15.
|
|
179
|
-
- Dead code detection.
|
|
180
|
-
- Documentation coverage: all public APIs have {{#if language_is_typescript}}JSDoc{{/if}}{{#if language_is_python}}docstrings{{/if}}.
|
|
181
|
-
|
|
182
|
-
### Technical Debt Tracking
|
|
183
|
-
- Tech debt items logged in Status.md.
|
|
184
|
-
- No "we'll fix it later" without a tracked item.
|
|
185
|
-
|
|
186
|
-
- id: cost-management
|
|
187
|
-
tier: optional
|
|
188
|
-
title: "Cost Management"
|
|
189
|
-
content: |
|
|
190
|
-
## NFR: Cost Management
|
|
191
|
-
|
|
192
|
-
### Resource Budgets
|
|
193
|
-
- Monthly cloud spend budget defined and alerted at 80% threshold.
|
|
194
|
-
- Cost per user/transaction tracked as a business KPI.
|
|
195
|
-
|
|
196
|
-
### Optimization Cadence
|
|
197
|
-
- Monthly: review top 5 cost drivers, identify optimization opportunities.
|
|
1
|
+
tag: UNIVERSAL
|
|
2
|
+
section: nfr
|
|
3
|
+
blocks:
|
|
4
|
+
- id: security
|
|
5
|
+
tier: core
|
|
6
|
+
title: "Security"
|
|
7
|
+
content: |
|
|
8
|
+
## NFR: Security
|
|
9
|
+
|
|
10
|
+
### Authentication & Authorization
|
|
11
|
+
- Authentication mechanism: {{auth_mechanism}}
|
|
12
|
+
- Authorization model: {{auth_model}}
|
|
13
|
+
- Secret management: environment variables minimum, secrets manager preferred (AWS SSM, Vault)
|
|
14
|
+
- No secrets in code, config files, or git history. Ever.
|
|
15
|
+
|
|
16
|
+
### Input Validation
|
|
17
|
+
- Validate and sanitize ALL external input at system boundary.
|
|
18
|
+
- Use allowlists, not denylists.
|
|
19
|
+
- Parameterized queries only — no string concatenation for SQL/commands.
|
|
20
|
+
|
|
21
|
+
### Dependencies
|
|
22
|
+
- Automated dependency vulnerability scanning (Dependabot, Snyk, or equivalent).
|
|
23
|
+
- No dependencies with known critical CVEs.
|
|
24
|
+
- Lock file committed (package-lock.json, poetry.lock, Cargo.lock).
|
|
25
|
+
|
|
26
|
+
### Transport
|
|
27
|
+
- TLS 1.2+ for all network communication.
|
|
28
|
+
- HSTS headers on all web responses.
|
|
29
|
+
- CORS configured to minimum necessary origins.
|
|
30
|
+
|
|
31
|
+
- id: observability
|
|
32
|
+
tier: recommended
|
|
33
|
+
title: "Observability"
|
|
34
|
+
content: |
|
|
35
|
+
## NFR: Observability
|
|
36
|
+
|
|
37
|
+
### Structured Logging
|
|
38
|
+
- JSON-formatted structured logs (structlog for Python, pino for Node).
|
|
39
|
+
- Every log entry includes: timestamp, level, service, trace_id, operation, context.
|
|
40
|
+
- Log levels used correctly: DEBUG for development, INFO for operations, WARN for degraded
|
|
41
|
+
state, ERROR for failures requiring attention.
|
|
42
|
+
- NO sensitive data in logs (PHI, PII, credentials, tokens).
|
|
43
|
+
|
|
44
|
+
### Metrics
|
|
45
|
+
- RED metrics on all service boundaries: Rate, Errors, Duration.
|
|
46
|
+
- Business metrics for key operations.
|
|
47
|
+
- Alerting thresholds defined for all critical metrics.
|
|
48
|
+
|
|
49
|
+
### Health Checks
|
|
50
|
+
- /health endpoint returning: status, version, uptime, dependency health.
|
|
51
|
+
- Readiness vs liveness probes (Kubernetes) or equivalent.
|
|
52
|
+
|
|
53
|
+
- id: reliability
|
|
54
|
+
tier: recommended
|
|
55
|
+
title: "Reliability"
|
|
56
|
+
content: |
|
|
57
|
+
## NFR: Reliability
|
|
58
|
+
|
|
59
|
+
### Graceful Degradation
|
|
60
|
+
- Circuit breakers on all external service calls.
|
|
61
|
+
- Timeout configured on every external call (no indefinite waits).
|
|
62
|
+
- Fallback behavior defined for each dependency failure.
|
|
63
|
+
|
|
64
|
+
### Disaster Recovery
|
|
65
|
+
- Backup strategy: automated, tested, documented.
|
|
66
|
+
- Runbook for common failure scenarios.
|
|
67
|
+
- **RPO** (Recovery Point Objective): maximum acceptable data loss = {{rpo | default: 1 hour}}.
|
|
68
|
+
- **RTO** (Recovery Time Objective): maximum acceptable downtime = {{rto | default: 4 hours}}.
|
|
69
|
+
- Failover tested at least quarterly. Document time-to-recovery in post-mortems.
|
|
70
|
+
- Database point-in-time recovery enabled. Retention: {{backup_retention | default: 30 days}}.
|
|
71
|
+
|
|
72
|
+
### Availability Targets
|
|
73
|
+
- Target uptime: {{uptime_target | default: 99.9%}} (≈ 8.7 hours downtime/year).
|
|
74
|
+
- Define SLIs (error rate, latency p99, availability) and SLOs per service.
|
|
75
|
+
- Error budget policy: when budget is exhausted, freeze feature releases until reliability improves.
|
|
76
|
+
- Maintenance windows communicated 48h in advance. Prefer zero-downtime deployments.
|
|
77
|
+
|
|
78
|
+
- id: scalability
|
|
79
|
+
tier: optional
|
|
80
|
+
title: "Scalability"
|
|
81
|
+
content: |
|
|
82
|
+
## NFR: Scalability
|
|
83
|
+
|
|
84
|
+
### Horizontal Scaling
|
|
85
|
+
- Application designed for horizontal scaling — no in-process state that can't be lost.
|
|
86
|
+
- Session/cache state externalized to Redis, Memcached, or equivalent.
|
|
87
|
+
- Connection pooling configured per environment. Pool exhaustion triggers alerts, not failures.
|
|
88
|
+
|
|
89
|
+
### Data Layer
|
|
90
|
+
- Database queries support the expected data volume. Test with 10x expected load.
|
|
91
|
+
- Pagination on all list operations. No unbounded queries.
|
|
92
|
+
- Read replicas for read-heavy workloads. Write/read split documented.
|
|
93
|
+
- Index strategy reviewed quarterly. Slow query log monitored.
|
|
94
|
+
|
|
95
|
+
### Queue & Async Processing
|
|
96
|
+
- CPU-intensive or long-running work offloaded to background queues.
|
|
97
|
+
- Queue depth monitored. Auto-scale workers based on queue backlog.
|
|
98
|
+
- Dead letter queues for failed messages. Alert and review DLQ weekly.
|
|
99
|
+
|
|
100
|
+
- id: compliance
|
|
101
|
+
tier: optional
|
|
102
|
+
title: "Compliance & Data Governance"
|
|
103
|
+
content: |
|
|
104
|
+
## NFR: Compliance & Data Governance
|
|
105
|
+
|
|
106
|
+
### Data Classification
|
|
107
|
+
- All data fields classified: Public, Internal, Confidential, Restricted.
|
|
108
|
+
- Restricted data (PII, PHI, financial) encrypted at rest and in transit.
|
|
109
|
+
- Access to restricted data logged and auditable.
|
|
110
|
+
|
|
111
|
+
### GDPR / Privacy
|
|
112
|
+
- Data processing purposes documented. No collection beyond stated purpose.
|
|
113
|
+
- Right to access: user can export their data in machine-readable format.
|
|
114
|
+
- Right to erasure: user data deletable within {{deletion_sla | default: 30 days}} of request.
|
|
115
|
+
- Data retention schedules defined per data type. Auto-delete expired data.
|
|
116
|
+
- Cookie consent where required. No tracking before consent.
|
|
117
|
+
|
|
118
|
+
### Audit Trail
|
|
119
|
+
- Security-relevant actions logged: authentication events, permission changes,
|
|
120
|
+
data access, admin operations.
|
|
121
|
+
- Audit logs immutable, retained for {{audit_retention | default: 1 year}}.
|
|
122
|
+
- Logs stored separately from application data.
|
|
123
|
+
|
|
124
|
+
- id: accessibility
|
|
125
|
+
tier: optional
|
|
126
|
+
title: "Accessibility"
|
|
127
|
+
content: |
|
|
128
|
+
## NFR: Accessibility
|
|
129
|
+
|
|
130
|
+
### Standards
|
|
131
|
+
- Target: WCAG 2.1 AA compliance minimum for all user-facing interfaces.
|
|
132
|
+
- Semantic HTML. Proper heading hierarchy. ARIA attributes where HTML semantics aren't sufficient.
|
|
133
|
+
- All interactive elements keyboard-accessible. Visible focus indicators.
|
|
134
|
+
- Color contrast: minimum 4.5:1 for normal text, 3:1 for large text.
|
|
135
|
+
|
|
136
|
+
### Testing
|
|
137
|
+
- Automated accessibility audit in CI (axe-core, Lighthouse accessibility).
|
|
138
|
+
- Screen reader testing for critical user journeys (at least quarterly).
|
|
139
|
+
- No images without alt text. No videos without captions.
|
|
140
|
+
|
|
141
|
+
### Universal Design
|
|
142
|
+
- Support reduced motion (`prefers-reduced-motion`).
|
|
143
|
+
- Support high contrast mode.
|
|
144
|
+
- Touch targets minimum 44x44px on mobile interfaces.
|
|
145
|
+
|
|
146
|
+
- id: internationalization
|
|
147
|
+
tier: optional
|
|
148
|
+
title: "Internationalization"
|
|
149
|
+
content: |
|
|
150
|
+
## NFR: Internationalization (i18n)
|
|
151
|
+
|
|
152
|
+
### Text & Content
|
|
153
|
+
- All user-facing text externalized to translation files from day one.
|
|
154
|
+
- No hardcoded strings in UI code. No string concatenation for translatable sentences.
|
|
155
|
+
- Translation keys namespaced by feature: `module.component.label`.
|
|
156
|
+
|
|
157
|
+
### Formatting
|
|
158
|
+
- Dates, numbers, currencies formatted via `Intl` API or equivalent — never manual formatting.
|
|
159
|
+
- Time zones handled correctly. Store UTC, display in user's local zone.
|
|
160
|
+
- Support RTL layouts if right-to-left languages are in scope.
|
|
161
|
+
|
|
162
|
+
### Workflow
|
|
163
|
+
- New strings automatically flagged for translation in CI.
|
|
164
|
+
- Missing translations fall back to default locale, never show raw keys to users.
|
|
165
|
+
|
|
166
|
+
- id: maintainability
|
|
167
|
+
tier: recommended
|
|
168
|
+
title: "Maintainability & Developer Experience"
|
|
169
|
+
content: |
|
|
170
|
+
## NFR: Maintainability & Developer Experience
|
|
171
|
+
|
|
172
|
+
### Onboarding
|
|
173
|
+
- New developer productive within 1 day: clone → install → run → make a change → test → commit.
|
|
174
|
+
- README.md with step-by-step local setup.
|
|
175
|
+
- .env.example with every variable documented.
|
|
176
|
+
|
|
177
|
+
### Code Quality Metrics
|
|
178
|
+
- Cyclomatic complexity: flag functions > 10, block > 15.
|
|
179
|
+
- Dead code detection.
|
|
180
|
+
- Documentation coverage: all public APIs have {{#if language_is_typescript}}JSDoc{{/if}}{{#if language_is_python}}docstrings{{/if}}.
|
|
181
|
+
|
|
182
|
+
### Technical Debt Tracking
|
|
183
|
+
- Tech debt items logged in Status.md.
|
|
184
|
+
- No "we'll fix it later" without a tracked item.
|
|
185
|
+
|
|
186
|
+
- id: cost-management
|
|
187
|
+
tier: optional
|
|
188
|
+
title: "Cost Management"
|
|
189
|
+
content: |
|
|
190
|
+
## NFR: Cost Management
|
|
191
|
+
|
|
192
|
+
### Resource Budgets
|
|
193
|
+
- Monthly cloud spend budget defined and alerted at 80% threshold.
|
|
194
|
+
- Cost per user/transaction tracked as a business KPI.
|
|
195
|
+
|
|
196
|
+
### Optimization Cadence
|
|
197
|
+
- Monthly: review top 5 cost drivers, identify optimization opportunities.
|