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.
Files changed (136) hide show
  1. package/README.md +525 -525
  2. package/dist/cli/help.js +44 -44
  3. package/dist/registry/renderer-skeletons.js +92 -92
  4. package/dist/shared/gs-score-logger.js +6 -6
  5. package/dist/tools/add-module.js +123 -123
  6. package/dist/tools/advice-registry.js +18 -18
  7. package/dist/tools/check-cascade-report.js +64 -64
  8. package/dist/tools/configure-mcp.d.ts +3 -0
  9. package/dist/tools/configure-mcp.d.ts.map +1 -1
  10. package/dist/tools/configure-mcp.js +10 -0
  11. package/dist/tools/configure-mcp.js.map +1 -1
  12. package/dist/tools/forgecraft-dispatch.d.ts.map +1 -1
  13. package/dist/tools/forgecraft-dispatch.js +3 -0
  14. package/dist/tools/forgecraft-dispatch.js.map +1 -1
  15. package/dist/tools/forgecraft-schema-params.d.ts +9 -0
  16. package/dist/tools/forgecraft-schema-params.d.ts.map +1 -1
  17. package/dist/tools/forgecraft-schema-params.js +21 -0
  18. package/dist/tools/forgecraft-schema-params.js.map +1 -1
  19. package/dist/tools/forgecraft-schema.d.ts +9 -0
  20. package/dist/tools/forgecraft-schema.d.ts.map +1 -1
  21. package/dist/tools/refresh-output.js +14 -14
  22. package/dist/tools/scaffold-spec-stubs.js +115 -115
  23. package/dist/tools/scaffold-templates.js +62 -62
  24. package/dist/tools/setup-artifact-writers.d.ts +30 -0
  25. package/dist/tools/setup-artifact-writers.d.ts.map +1 -1
  26. package/dist/tools/setup-artifact-writers.js +120 -8
  27. package/dist/tools/setup-artifact-writers.js.map +1 -1
  28. package/dist/tools/setup-phase1.d.ts +3 -0
  29. package/dist/tools/setup-phase1.d.ts.map +1 -1
  30. package/dist/tools/setup-phase1.js +79 -35
  31. package/dist/tools/setup-phase1.js.map +1 -1
  32. package/dist/tools/setup-phase2.d.ts +2 -0
  33. package/dist/tools/setup-phase2.d.ts.map +1 -1
  34. package/dist/tools/setup-phase2.js +10 -1
  35. package/dist/tools/setup-phase2.js.map +1 -1
  36. package/dist/tools/setup-project.d.ts +18 -0
  37. package/dist/tools/setup-project.d.ts.map +1 -1
  38. package/dist/tools/setup-project.js +77 -1
  39. package/dist/tools/setup-project.js.map +1 -1
  40. package/dist/tools/spec-parser-tags.d.ts +9 -0
  41. package/dist/tools/spec-parser-tags.d.ts.map +1 -1
  42. package/dist/tools/spec-parser-tags.js +92 -0
  43. package/dist/tools/spec-parser-tags.js.map +1 -1
  44. package/package.json +89 -86
  45. package/templates/analytics/instructions.yaml +37 -37
  46. package/templates/analytics/mcp-servers.yaml +11 -11
  47. package/templates/analytics/structure.yaml +25 -25
  48. package/templates/api/instructions.yaml +231 -231
  49. package/templates/api/mcp-servers.yaml +22 -13
  50. package/templates/api/nfr.yaml +23 -23
  51. package/templates/api/review.yaml +103 -103
  52. package/templates/api/structure.yaml +34 -34
  53. package/templates/api/verification.yaml +132 -132
  54. package/templates/cli/instructions.yaml +31 -31
  55. package/templates/cli/mcp-servers.yaml +11 -11
  56. package/templates/cli/review.yaml +53 -53
  57. package/templates/cli/structure.yaml +16 -16
  58. package/templates/data-lineage/instructions.yaml +28 -28
  59. package/templates/data-lineage/mcp-servers.yaml +22 -22
  60. package/templates/data-pipeline/instructions.yaml +84 -84
  61. package/templates/data-pipeline/mcp-servers.yaml +13 -13
  62. package/templates/data-pipeline/nfr.yaml +39 -39
  63. package/templates/data-pipeline/structure.yaml +23 -23
  64. package/templates/fintech/hooks.yaml +55 -55
  65. package/templates/fintech/instructions.yaml +112 -112
  66. package/templates/fintech/mcp-servers.yaml +13 -13
  67. package/templates/fintech/nfr.yaml +46 -46
  68. package/templates/fintech/playbook.yaml +210 -210
  69. package/templates/fintech/verification.yaml +239 -239
  70. package/templates/game/instructions.yaml +289 -289
  71. package/templates/game/mcp-servers.yaml +38 -38
  72. package/templates/game/nfr.yaml +64 -64
  73. package/templates/game/playbook.yaml +214 -214
  74. package/templates/game/review.yaml +97 -97
  75. package/templates/game/structure.yaml +67 -67
  76. package/templates/game/verification.yaml +174 -174
  77. package/templates/healthcare/instructions.yaml +42 -42
  78. package/templates/healthcare/mcp-servers.yaml +13 -13
  79. package/templates/healthcare/nfr.yaml +47 -47
  80. package/templates/hipaa/instructions.yaml +41 -41
  81. package/templates/hipaa/mcp-servers.yaml +13 -13
  82. package/templates/infra/instructions.yaml +104 -104
  83. package/templates/infra/mcp-servers.yaml +20 -20
  84. package/templates/infra/nfr.yaml +46 -46
  85. package/templates/infra/review.yaml +65 -65
  86. package/templates/infra/structure.yaml +25 -25
  87. package/templates/library/instructions.yaml +36 -36
  88. package/templates/library/mcp-servers.yaml +20 -20
  89. package/templates/library/review.yaml +56 -56
  90. package/templates/library/structure.yaml +19 -19
  91. package/templates/medallion-architecture/instructions.yaml +41 -41
  92. package/templates/medallion-architecture/mcp-servers.yaml +22 -22
  93. package/templates/ml/instructions.yaml +85 -85
  94. package/templates/ml/mcp-servers.yaml +11 -11
  95. package/templates/ml/nfr.yaml +39 -39
  96. package/templates/ml/structure.yaml +25 -25
  97. package/templates/ml/verification.yaml +156 -156
  98. package/templates/mobile/instructions.yaml +44 -44
  99. package/templates/mobile/mcp-servers.yaml +11 -11
  100. package/templates/mobile/nfr.yaml +49 -49
  101. package/templates/mobile/structure.yaml +27 -27
  102. package/templates/mobile/verification.yaml +121 -121
  103. package/templates/observability-xray/instructions.yaml +40 -40
  104. package/templates/observability-xray/mcp-servers.yaml +15 -15
  105. package/templates/realtime/instructions.yaml +42 -42
  106. package/templates/realtime/mcp-servers.yaml +13 -13
  107. package/templates/soc2/instructions.yaml +41 -41
  108. package/templates/soc2/mcp-servers.yaml +24 -24
  109. package/templates/social/instructions.yaml +43 -43
  110. package/templates/social/mcp-servers.yaml +24 -24
  111. package/templates/state-machine/instructions.yaml +42 -42
  112. package/templates/state-machine/mcp-servers.yaml +11 -11
  113. package/templates/tools-registry.yaml +164 -164
  114. package/templates/universal/hooks.yaml +531 -531
  115. package/templates/universal/instructions.yaml +1692 -1692
  116. package/templates/universal/mcp-servers.yaml +50 -50
  117. package/templates/universal/nfr.yaml +197 -197
  118. package/templates/universal/reference.yaml +326 -326
  119. package/templates/universal/review.yaml +204 -204
  120. package/templates/universal/skills.yaml +262 -262
  121. package/templates/universal/structure.yaml +67 -67
  122. package/templates/universal/verification.yaml +416 -416
  123. package/templates/web-react/hooks.yaml +44 -44
  124. package/templates/web-react/instructions.yaml +207 -207
  125. package/templates/web-react/mcp-servers.yaml +20 -20
  126. package/templates/web-react/nfr.yaml +27 -27
  127. package/templates/web-react/review.yaml +94 -94
  128. package/templates/web-react/structure.yaml +46 -46
  129. package/templates/web-react/verification.yaml +126 -126
  130. package/templates/web-static/instructions.yaml +115 -115
  131. package/templates/web-static/mcp-servers.yaml +20 -20
  132. package/templates/web3/instructions.yaml +44 -44
  133. package/templates/web3/mcp-servers.yaml +11 -11
  134. package/templates/web3/verification.yaml +159 -159
  135. package/templates/zero-trust/instructions.yaml +41 -41
  136. package/templates/zero-trust/mcp-servers.yaml +15 -15
@@ -1,103 +1,103 @@
1
- tag: API
2
- section: review
3
- blocks:
4
- - id: api-architecture-review
5
- tier: recommended
6
- dimension: architecture
7
- title: "API Architecture Review"
8
- description: |
9
- Evaluate API design, endpoint structure, middleware pipeline, and service boundaries.
10
- checklist:
11
- - id: endpoint-design
12
- description: "RESTful conventions followed: proper HTTP methods, status codes, resource naming."
13
- severity: critical
14
- - id: middleware-pipeline
15
- description: "Middleware pipeline is ordered correctly: auth → validation → rate-limit → handler."
16
- severity: important
17
- - id: service-layer-separation
18
- description: "Handlers are thin (validation + delegation). Business logic lives in service layer."
19
- severity: critical
20
- - id: api-versioning
21
- description: "API versioning strategy defined and enforced (URL prefix, header, or content negotiation)."
22
- severity: important
23
- - id: database-migrations
24
- description: "Schema changes managed through versioned migration files. Every migration is reversible. No manual DDL."
25
- severity: critical
26
- - id: owasp-injection
27
- description: "Parameterized queries only. No string concatenation for SQL, commands, or LDAP queries."
28
- severity: critical
29
- - id: owasp-access-control
30
- description: "Ownership checks enforced — users cannot access other users' resources. No IDOR vulnerabilities."
31
- severity: critical
32
- - id: security-headers
33
- description: "Security headers set: CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy."
34
- severity: important
35
- - id: audit-logging
36
- description: "Security-relevant actions logged: WHO did WHAT to WHICH resource, WHEN. Immutable, separate from app logs."
37
- severity: important
38
- - id: graceful-shutdown
39
- description: "SIGTERM handled: stop accepting requests, drain in-flight work, close connections, exit cleanly."
40
- severity: important
41
- - id: container-best-practices
42
- description: "Dockerfile uses multi-stage build, non-root user, pinned base image digest. Image scanned for CVEs."
43
- severity: important
44
- - id: health-endpoint
45
- description: "/health endpoint returns status, version, uptime, and dependency connectivity. Used by orchestrator probes."
46
- severity: critical
47
- - id: migration-auto-deploy
48
- description: "Database migrations run automatically on deploy (pre-deploy hook or init container). Never manually applied."
49
- severity: important
50
-
51
- - id: api-code-quality-review
52
- tier: recommended
53
- dimension: code-quality
54
- title: "API Code Quality Review"
55
- description: |
56
- Evaluate input validation, response contracts, and error response consistency.
57
- checklist:
58
- - id: input-validation
59
- description: "All endpoint inputs validated with schema (Zod, Joi, class-validator). No trust of client data."
60
- severity: critical
61
- - id: response-consistency
62
- description: "All responses follow a consistent envelope: { data, error, meta }."
63
- severity: important
64
- - id: error-responses
65
- description: "Error responses include: status code, error code, human message, request ID. No stack traces in production."
66
- severity: critical
67
-
68
- - id: api-performance-review
69
- tier: recommended
70
- dimension: performance
71
- title: "API Performance Review"
72
- description: |
73
- Evaluate query efficiency, pagination, and rate limiting.
74
- checklist:
75
- - id: n-plus-one-queries
76
- description: "No N+1 query patterns in list endpoints. Use eager loading or DataLoader."
77
- severity: critical
78
- - id: pagination
79
- description: "List endpoints paginated. No unbounded result sets."
80
- severity: critical
81
- - id: rate-limiting
82
- description: "Rate limiting configured on all public-facing endpoints."
83
- severity: important
84
- - id: response-caching
85
- description: "Cacheable responses use Cache-Control headers or application-level caching."
86
- severity: nice-to-have
87
-
88
- - id: api-test-review
89
- tier: recommended
90
- dimension: tests
91
- title: "API Test Review"
92
- description: |
93
- Evaluate API-specific testing patterns including contract tests and migration testing.
94
- checklist:
95
- - id: migration-testing
96
- description: "Database migrations tested: up + down both verified. Migration tests run in CI."
97
- severity: critical
98
- - id: api-contract-tests
99
- description: "API contracts tested: request/response shapes match OpenAPI spec. Breaking changes caught early."
100
- severity: important
101
- - id: auth-path-testing
102
- description: "Auth paths thoroughly tested: valid token, expired token, missing token, insufficient permissions."
103
- severity: critical
1
+ tag: API
2
+ section: review
3
+ blocks:
4
+ - id: api-architecture-review
5
+ tier: recommended
6
+ dimension: architecture
7
+ title: "API Architecture Review"
8
+ description: |
9
+ Evaluate API design, endpoint structure, middleware pipeline, and service boundaries.
10
+ checklist:
11
+ - id: endpoint-design
12
+ description: "RESTful conventions followed: proper HTTP methods, status codes, resource naming."
13
+ severity: critical
14
+ - id: middleware-pipeline
15
+ description: "Middleware pipeline is ordered correctly: auth → validation → rate-limit → handler."
16
+ severity: important
17
+ - id: service-layer-separation
18
+ description: "Handlers are thin (validation + delegation). Business logic lives in service layer."
19
+ severity: critical
20
+ - id: api-versioning
21
+ description: "API versioning strategy defined and enforced (URL prefix, header, or content negotiation)."
22
+ severity: important
23
+ - id: database-migrations
24
+ description: "Schema changes managed through versioned migration files. Every migration is reversible. No manual DDL."
25
+ severity: critical
26
+ - id: owasp-injection
27
+ description: "Parameterized queries only. No string concatenation for SQL, commands, or LDAP queries."
28
+ severity: critical
29
+ - id: owasp-access-control
30
+ description: "Ownership checks enforced — users cannot access other users' resources. No IDOR vulnerabilities."
31
+ severity: critical
32
+ - id: security-headers
33
+ description: "Security headers set: CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy."
34
+ severity: important
35
+ - id: audit-logging
36
+ description: "Security-relevant actions logged: WHO did WHAT to WHICH resource, WHEN. Immutable, separate from app logs."
37
+ severity: important
38
+ - id: graceful-shutdown
39
+ description: "SIGTERM handled: stop accepting requests, drain in-flight work, close connections, exit cleanly."
40
+ severity: important
41
+ - id: container-best-practices
42
+ description: "Dockerfile uses multi-stage build, non-root user, pinned base image digest. Image scanned for CVEs."
43
+ severity: important
44
+ - id: health-endpoint
45
+ description: "/health endpoint returns status, version, uptime, and dependency connectivity. Used by orchestrator probes."
46
+ severity: critical
47
+ - id: migration-auto-deploy
48
+ description: "Database migrations run automatically on deploy (pre-deploy hook or init container). Never manually applied."
49
+ severity: important
50
+
51
+ - id: api-code-quality-review
52
+ tier: recommended
53
+ dimension: code-quality
54
+ title: "API Code Quality Review"
55
+ description: |
56
+ Evaluate input validation, response contracts, and error response consistency.
57
+ checklist:
58
+ - id: input-validation
59
+ description: "All endpoint inputs validated with schema (Zod, Joi, class-validator). No trust of client data."
60
+ severity: critical
61
+ - id: response-consistency
62
+ description: "All responses follow a consistent envelope: { data, error, meta }."
63
+ severity: important
64
+ - id: error-responses
65
+ description: "Error responses include: status code, error code, human message, request ID. No stack traces in production."
66
+ severity: critical
67
+
68
+ - id: api-performance-review
69
+ tier: recommended
70
+ dimension: performance
71
+ title: "API Performance Review"
72
+ description: |
73
+ Evaluate query efficiency, pagination, and rate limiting.
74
+ checklist:
75
+ - id: n-plus-one-queries
76
+ description: "No N+1 query patterns in list endpoints. Use eager loading or DataLoader."
77
+ severity: critical
78
+ - id: pagination
79
+ description: "List endpoints paginated. No unbounded result sets."
80
+ severity: critical
81
+ - id: rate-limiting
82
+ description: "Rate limiting configured on all public-facing endpoints."
83
+ severity: important
84
+ - id: response-caching
85
+ description: "Cacheable responses use Cache-Control headers or application-level caching."
86
+ severity: nice-to-have
87
+
88
+ - id: api-test-review
89
+ tier: recommended
90
+ dimension: tests
91
+ title: "API Test Review"
92
+ description: |
93
+ Evaluate API-specific testing patterns including contract tests and migration testing.
94
+ checklist:
95
+ - id: migration-testing
96
+ description: "Database migrations tested: up + down both verified. Migration tests run in CI."
97
+ severity: critical
98
+ - id: api-contract-tests
99
+ description: "API contracts tested: request/response shapes match OpenAPI spec. Breaking changes caught early."
100
+ severity: important
101
+ - id: auth-path-testing
102
+ description: "Auth paths thoroughly tested: valid token, expired token, missing token, insufficient permissions."
103
+ severity: critical
@@ -1,34 +1,34 @@
1
- tag: API
2
- section: structure
3
- language: typescript
4
- entries:
5
- - path: src/index.ts
6
- type: file
7
- description: "Composition root — only place concretes are instantiated"
8
- - path: src/shared/config/index.ts
9
- type: file
10
- description: "Env validation with fail-fast"
11
- - path: src/shared/errors/index.ts
12
- type: file
13
- description: "Error class hierarchy"
14
- - path: src/shared/logger/index.ts
15
- type: file
16
- description: "Structured logging (pino)"
17
- - path: src/shared/middleware
18
- type: directory
19
- description: "Auth, error handler, request ID"
20
- - path: src/shared/types
21
- type: directory
22
- description: "Shared interfaces and type definitions"
23
- - path: src/modules
24
- type: directory
25
- description: "Feature modules"
26
- - path: tests/unit
27
- type: directory
28
- description: "Unit tests"
29
- - path: tests/integration
30
- type: directory
31
- description: "Integration tests"
32
- - path: tests/e2e
33
- type: directory
34
- description: "End-to-end tests"
1
+ tag: API
2
+ section: structure
3
+ language: typescript
4
+ entries:
5
+ - path: src/index.ts
6
+ type: file
7
+ description: "Composition root — only place concretes are instantiated"
8
+ - path: src/shared/config/index.ts
9
+ type: file
10
+ description: "Env validation with fail-fast"
11
+ - path: src/shared/errors/index.ts
12
+ type: file
13
+ description: "Error class hierarchy"
14
+ - path: src/shared/logger/index.ts
15
+ type: file
16
+ description: "Structured logging (pino)"
17
+ - path: src/shared/middleware
18
+ type: directory
19
+ description: "Auth, error handler, request ID"
20
+ - path: src/shared/types
21
+ type: directory
22
+ description: "Shared interfaces and type definitions"
23
+ - path: src/modules
24
+ type: directory
25
+ description: "Feature modules"
26
+ - path: tests/unit
27
+ type: directory
28
+ description: "Unit tests"
29
+ - path: tests/integration
30
+ type: directory
31
+ description: "Integration tests"
32
+ - path: tests/e2e
33
+ type: directory
34
+ description: "End-to-end tests"
@@ -1,132 +1,132 @@
1
- tag: API
2
- section: verification
3
- title: "Spec-Driven API Verification"
4
- description: >
5
- API contracts are the highest-determinism domain. A formal Hurl spec or
6
- OpenAPI schema covers every endpoint, method, status code, and response shape.
7
- When this strategy is applied, S approaches 1.0 — enabling single-pass
8
- automated verification with no human judgment required at execution time.
9
- uncertainty_levels:
10
- - deterministic
11
- completeness_ceiling: 0.95
12
-
13
- phases:
14
-
15
- - id: contract-definition
16
- title: "Define the API Contract Before Code"
17
- rationale: >
18
- The OpenAPI spec is the source of truth. Types, validators, and tests
19
- must be generated from it — never maintained in parallel. A spec written
20
- before implementation is a contract; a spec written after implementation
21
- is documentation.
22
- steps:
23
- - id: write-openapi-spec
24
- instruction: >
25
- Write the full OpenAPI 3.1 spec for every endpoint before implementation.
26
- Every endpoint must define: path, method, request schema (body + query + path params),
27
- all response codes with response schemas, and security requirements.
28
- Use $ref for shared schemas — no inline duplication.
29
- contract: >
30
- openapi.yaml or openapi.json exists in the project root and passes
31
- `openapi-spec-validator`. Every endpoint in the spec maps 1:1 to a route
32
- in the implementation.
33
- tools: ["openapi-spec-validator", "stoplight/spectral"]
34
- expected_output: "openapi.yaml validated by openapi-spec-validator with 0 errors"
35
- pass_criterion: "openapi-spec-validator openapi.yaml exits 0"
36
-
37
- - id: generate-types-from-spec
38
- instruction: >
39
- Generate TypeScript types from the OpenAPI spec using openapi-typescript.
40
- Use the generated types in route handlers and service layers — do not
41
- hand-write types that duplicate the spec.
42
- contract: >
43
- src/types/api.ts (or equivalent) is generated, not hand-written.
44
- A Makefile or package.json script exists to regenerate it.
45
- tools: ["openapi-typescript", "npx openapi-typescript openapi.yaml -o src/types/api.ts"]
46
- expected_output: "Generated src/types/api.ts with no manual edits"
47
- pass_criterion: "File is generated; `npm run generate-types` succeeds"
48
-
49
- - id: write-hurl-spec
50
- instruction: >
51
- Write a Hurl spec file for every endpoint. Each file covers:
52
- the happy path, at least one error case (400/401/403/404/422),
53
- and one edge case (e.g., empty list, max payload).
54
- Variables use Hurl's {{variable}} syntax for base_url, tokens, etc.
55
- contract: >
56
- A .hurl file exists per endpoint group (auth, articles, users, etc.).
57
- Total Hurl files ≥ number of resource groups. Every Hurl file runs
58
- to completion without network errors.
59
- tools: ["hurl --test", "hurl --variables-file .env.test"]
60
- expected_output: "Hurl test output with pass/fail per file"
61
- pass_criterion: "hurl --test *.hurl exits 0 with 0 failures"
62
-
63
- - id: execution
64
- title: "Run Hurl Spec Against Live Server"
65
- rationale: >
66
- The gap between GS Verifiable and Executable is closed here. The server must be
67
- running with a test database. Hurl drives real HTTP — it catches route wiring gaps,
68
- JWT issues, and normalization bugs that no unit test can detect.
69
- steps:
70
- - id: start-server
71
- instruction: >
72
- Start the API server with NODE_ENV=test and a clean test database.
73
- Sync the schema with `prisma db push --accept-data-loss` (not `migrate deploy` —
74
- migrate deploy silently no-ops when no migrations folder exists, leaving an empty DB).
75
- Capture the server process and its port in a test fixture.
76
- contract: >
77
- Server health check endpoint returns HTTP 200 within 5 seconds.
78
- Test database has 0 seed rows (clean state).
79
- tools: ["docker-compose up -d", "npx prisma db push --accept-data-loss", "curl /health"]
80
- expected_output: "HTTP 200 from /health or /api/health"
81
- pass_criterion: "curl -s localhost:PORT/health returns 200"
82
-
83
- - id: run-hurl-suite
84
- instruction: >
85
- Run all Hurl files in sequence. Record: total files, total assertions,
86
- pass count, fail count. For every failure, capture: file name, step number,
87
- expected vs actual response body and status code.
88
- contract: >
89
- ≥ 80% of Hurl files pass. 100% of auth-related files pass.
90
- Zero 5xx responses on any happy-path request.
91
- tools: ["hurl --test --report-junit junit-hurl.xml", "hurl --variables-file .env.test"]
92
- expected_output: "JUnit XML + terminal summary: N files, M passed, K failed"
93
- pass_criterion: "Pass rate ≥ 80%; 0 failures in auth.hurl"
94
-
95
- - id: run-schema-validator
96
- instruction: >
97
- For every response captured by the Hurl run, validate the response body against
98
- the OpenAPI spec's response schema. Use `openapi-backend` or `express-openapi-validator`
99
- in strict mode. Treat schema mismatches as failures even if Hurl assertions passed.
100
- contract: >
101
- 0 schema validation errors. Response shapes match spec exactly —
102
- no extra undocumented fields, no missing required fields.
103
- tools: ["openapi-backend", "express-openapi-validator"]
104
- expected_output: "Validation report with 0 mismatches"
105
- pass_criterion: "0 schema validation errors"
106
-
107
- - id: evidence
108
- title: "Record and Interpret Execution Results"
109
- rationale: >
110
- Hurl results feed directly into the Executable dimension score (0–2).
111
- Results must be structured so the verify loop can detect regressions
112
- across passes and determine whether the fix prompt improved things.
113
- steps:
114
- - id: record-hurl-results
115
- instruction: >
116
- Save the JUnit XML report to test-results/hurl-junit.xml.
117
- Extract: total files count, pass count, fail count, failed file names.
118
- Write a one-line summary to test-results/hurl-summary.txt.
119
- contract: "test-results/hurl-junit.xml and hurl-summary.txt exist after run"
120
- tools: ["hurl --report-junit", "xsltproc or python xml.etree"]
121
- expected_output: "hurl-summary.txt: '13 files, 12 passed, 1 failed'"
122
- pass_criterion: "Files exist; pass count parseable as integer"
123
-
124
- - id: compute-executable-score
125
- instruction: >
126
- Compute the Executable score: 0 if server fails to start, 1 if 1–79% of Hurl files pass,
127
- 2 if ≥ 80% of Hurl files pass. Record this score in test-results/executable-score.json
128
- with fields: score, pass_rate, total_files, passed_files, timestamp.
129
- contract: "executable-score.json exists with integer score 0|1|2"
130
- tools: ["node -e", "python -c", "jq"]
131
- expected_output: '{"score": 2, "pass_rate": 0.92, "total_files": 13, "passed_files": 12}'
132
- pass_criterion: "File parses as valid JSON with score field"
1
+ tag: API
2
+ section: verification
3
+ title: "Spec-Driven API Verification"
4
+ description: >
5
+ API contracts are the highest-determinism domain. A formal Hurl spec or
6
+ OpenAPI schema covers every endpoint, method, status code, and response shape.
7
+ When this strategy is applied, S approaches 1.0 — enabling single-pass
8
+ automated verification with no human judgment required at execution time.
9
+ uncertainty_levels:
10
+ - deterministic
11
+ completeness_ceiling: 0.95
12
+
13
+ phases:
14
+
15
+ - id: contract-definition
16
+ title: "Define the API Contract Before Code"
17
+ rationale: >
18
+ The OpenAPI spec is the source of truth. Types, validators, and tests
19
+ must be generated from it — never maintained in parallel. A spec written
20
+ before implementation is a contract; a spec written after implementation
21
+ is documentation.
22
+ steps:
23
+ - id: write-openapi-spec
24
+ instruction: >
25
+ Write the full OpenAPI 3.1 spec for every endpoint before implementation.
26
+ Every endpoint must define: path, method, request schema (body + query + path params),
27
+ all response codes with response schemas, and security requirements.
28
+ Use $ref for shared schemas — no inline duplication.
29
+ contract: >
30
+ openapi.yaml or openapi.json exists in the project root and passes
31
+ `openapi-spec-validator`. Every endpoint in the spec maps 1:1 to a route
32
+ in the implementation.
33
+ tools: ["openapi-spec-validator", "stoplight/spectral"]
34
+ expected_output: "openapi.yaml validated by openapi-spec-validator with 0 errors"
35
+ pass_criterion: "openapi-spec-validator openapi.yaml exits 0"
36
+
37
+ - id: generate-types-from-spec
38
+ instruction: >
39
+ Generate TypeScript types from the OpenAPI spec using openapi-typescript.
40
+ Use the generated types in route handlers and service layers — do not
41
+ hand-write types that duplicate the spec.
42
+ contract: >
43
+ src/types/api.ts (or equivalent) is generated, not hand-written.
44
+ A Makefile or package.json script exists to regenerate it.
45
+ tools: ["openapi-typescript", "npx openapi-typescript openapi.yaml -o src/types/api.ts"]
46
+ expected_output: "Generated src/types/api.ts with no manual edits"
47
+ pass_criterion: "File is generated; `npm run generate-types` succeeds"
48
+
49
+ - id: write-hurl-spec
50
+ instruction: >
51
+ Write a Hurl spec file for every endpoint. Each file covers:
52
+ the happy path, at least one error case (400/401/403/404/422),
53
+ and one edge case (e.g., empty list, max payload).
54
+ Variables use Hurl's {{variable}} syntax for base_url, tokens, etc.
55
+ contract: >
56
+ A .hurl file exists per endpoint group (auth, articles, users, etc.).
57
+ Total Hurl files ≥ number of resource groups. Every Hurl file runs
58
+ to completion without network errors.
59
+ tools: ["hurl --test", "hurl --variables-file .env.test"]
60
+ expected_output: "Hurl test output with pass/fail per file"
61
+ pass_criterion: "hurl --test *.hurl exits 0 with 0 failures"
62
+
63
+ - id: execution
64
+ title: "Run Hurl Spec Against Live Server"
65
+ rationale: >
66
+ The gap between GS Verifiable and Executable is closed here. The server must be
67
+ running with a test database. Hurl drives real HTTP — it catches route wiring gaps,
68
+ JWT issues, and normalization bugs that no unit test can detect.
69
+ steps:
70
+ - id: start-server
71
+ instruction: >
72
+ Start the API server with NODE_ENV=test and a clean test database.
73
+ Sync the schema with `prisma db push --accept-data-loss` (not `migrate deploy` —
74
+ migrate deploy silently no-ops when no migrations folder exists, leaving an empty DB).
75
+ Capture the server process and its port in a test fixture.
76
+ contract: >
77
+ Server health check endpoint returns HTTP 200 within 5 seconds.
78
+ Test database has 0 seed rows (clean state).
79
+ tools: ["docker-compose up -d", "npx prisma db push --accept-data-loss", "curl /health"]
80
+ expected_output: "HTTP 200 from /health or /api/health"
81
+ pass_criterion: "curl -s localhost:PORT/health returns 200"
82
+
83
+ - id: run-hurl-suite
84
+ instruction: >
85
+ Run all Hurl files in sequence. Record: total files, total assertions,
86
+ pass count, fail count. For every failure, capture: file name, step number,
87
+ expected vs actual response body and status code.
88
+ contract: >
89
+ ≥ 80% of Hurl files pass. 100% of auth-related files pass.
90
+ Zero 5xx responses on any happy-path request.
91
+ tools: ["hurl --test --report-junit junit-hurl.xml", "hurl --variables-file .env.test"]
92
+ expected_output: "JUnit XML + terminal summary: N files, M passed, K failed"
93
+ pass_criterion: "Pass rate ≥ 80%; 0 failures in auth.hurl"
94
+
95
+ - id: run-schema-validator
96
+ instruction: >
97
+ For every response captured by the Hurl run, validate the response body against
98
+ the OpenAPI spec's response schema. Use `openapi-backend` or `express-openapi-validator`
99
+ in strict mode. Treat schema mismatches as failures even if Hurl assertions passed.
100
+ contract: >
101
+ 0 schema validation errors. Response shapes match spec exactly —
102
+ no extra undocumented fields, no missing required fields.
103
+ tools: ["openapi-backend", "express-openapi-validator"]
104
+ expected_output: "Validation report with 0 mismatches"
105
+ pass_criterion: "0 schema validation errors"
106
+
107
+ - id: evidence
108
+ title: "Record and Interpret Execution Results"
109
+ rationale: >
110
+ Hurl results feed directly into the Executable dimension score (0–2).
111
+ Results must be structured so the verify loop can detect regressions
112
+ across passes and determine whether the fix prompt improved things.
113
+ steps:
114
+ - id: record-hurl-results
115
+ instruction: >
116
+ Save the JUnit XML report to test-results/hurl-junit.xml.
117
+ Extract: total files count, pass count, fail count, failed file names.
118
+ Write a one-line summary to test-results/hurl-summary.txt.
119
+ contract: "test-results/hurl-junit.xml and hurl-summary.txt exist after run"
120
+ tools: ["hurl --report-junit", "xsltproc or python xml.etree"]
121
+ expected_output: "hurl-summary.txt: '13 files, 12 passed, 1 failed'"
122
+ pass_criterion: "Files exist; pass count parseable as integer"
123
+
124
+ - id: compute-executable-score
125
+ instruction: >
126
+ Compute the Executable score: 0 if server fails to start, 1 if 1–79% of Hurl files pass,
127
+ 2 if ≥ 80% of Hurl files pass. Record this score in test-results/executable-score.json
128
+ with fields: score, pass_rate, total_files, passed_files, timestamp.
129
+ contract: "executable-score.json exists with integer score 0|1|2"
130
+ tools: ["node -e", "python -c", "jq"]
131
+ expected_output: '{"score": 2, "pass_rate": 0.92, "total_files": 13, "passed_files": 12}'
132
+ pass_criterion: "File parses as valid JSON with score field"
@@ -1,31 +1,31 @@
1
- tag: CLI
2
- section: instructions
3
- blocks:
4
- - id: cli-standards
5
- tier: recommended
6
- title: "CLI Standards"
7
- content: |
8
- ## CLI Standards
9
-
10
- ### User Experience
11
- - Clear, concise help text for every command and option.
12
- - Consistent flag naming: --verbose, --output, --format across all commands.
13
- - Exit codes: 0 for success, 1 for general error, 2 for usage error.
14
- - Colored output for terminals that support it, plain text fallback.
15
- - Progress indicators for long-running operations.
16
-
17
- ### Input/Output
18
- - Accept input from stdin, arguments, and config files.
19
- - Support --json flag for machine-readable output.
20
- - Support --quiet flag to suppress non-essential output.
21
- - Never prompt for input in non-interactive mode (CI/CD).
22
-
23
- ### Distribution
24
- - Single binary or npx-invocable package.
25
- - Minimal dependencies — fast install.
26
- - Version command: --version prints version and exits.
27
-
28
- ### Error Messages
29
- - Errors include: what went wrong, why, and how to fix it.
30
- - Suggest the correct command when user mistypes.
31
- - Link to documentation for complex errors.
1
+ tag: CLI
2
+ section: instructions
3
+ blocks:
4
+ - id: cli-standards
5
+ tier: recommended
6
+ title: "CLI Standards"
7
+ content: |
8
+ ## CLI Standards
9
+
10
+ ### User Experience
11
+ - Clear, concise help text for every command and option.
12
+ - Consistent flag naming: --verbose, --output, --format across all commands.
13
+ - Exit codes: 0 for success, 1 for general error, 2 for usage error.
14
+ - Colored output for terminals that support it, plain text fallback.
15
+ - Progress indicators for long-running operations.
16
+
17
+ ### Input/Output
18
+ - Accept input from stdin, arguments, and config files.
19
+ - Support --json flag for machine-readable output.
20
+ - Support --quiet flag to suppress non-essential output.
21
+ - Never prompt for input in non-interactive mode (CI/CD).
22
+
23
+ ### Distribution
24
+ - Single binary or npx-invocable package.
25
+ - Minimal dependencies — fast install.
26
+ - Version command: --version prints version and exits.
27
+
28
+ ### Error Messages
29
+ - Errors include: what went wrong, why, and how to fix it.
30
+ - Suggest the correct command when user mistypes.
31
+ - Link to documentation for complex errors.
@@ -1,11 +1,11 @@
1
- tag: CLI
2
- section: mcp-servers
3
- servers:
4
- - name: filesystem
5
- description: "Secure file operations — read, write, search, and directory management with configurable access controls"
6
- command: npx
7
- args: ["-y", "@modelcontextprotocol/server-filesystem", "/"]
8
- tags: [CLI, LIBRARY]
9
- category: general
10
- tier: recommended
11
- url: "https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem"
1
+ tag: CLI
2
+ section: mcp-servers
3
+ servers:
4
+ - name: filesystem
5
+ description: "Secure file operations — read, write, search, and directory management with configurable access controls"
6
+ command: npx
7
+ args: ["-y", "@modelcontextprotocol/server-filesystem", "/"]
8
+ tags: [CLI, LIBRARY]
9
+ category: general
10
+ tier: recommended
11
+ url: "https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem"