contextos-agents 2.0.0 → 2.1.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.
Files changed (223) hide show
  1. package/.agents/AGENTS.md +53 -33
  2. package/.agents/adapters/aider/export.js +41 -14
  3. package/.agents/adapters/claude/export.js +54 -3
  4. package/.agents/adapters/copilot/export.js +1 -1
  5. package/.agents/adapters/cursor/export.js +1 -1
  6. package/.agents/adapters/drift-detector.js +86 -10
  7. package/.agents/adapters/gemini/export.js +1 -1
  8. package/.agents/adapters/pure-compiler.js +28 -6
  9. package/.agents/adapters/shared.js +13 -4
  10. package/.agents/adapters/zed/export.js +1 -1
  11. package/.agents/compiled/registry.v2.json +29 -25
  12. package/.agents/compiled/registry.v2.sha256 +1 -1
  13. package/.agents/core/skills/context-os/SKILL.md +34 -37
  14. package/.agents/core/skills/engineering-workflow/SKILL.md +24 -24
  15. package/.agents/core/skills/gemini-precision/EXAMPLES.md +72 -0
  16. package/.agents/core/skills/gemini-precision/SKILL.md +2 -1
  17. package/.agents/core/skills/gemini-precision/TROUBLESHOOTING.md +25 -0
  18. package/.agents/core/skills/gemini-precision/skill.yaml +2 -0
  19. package/.agents/core/skills/gstack-roles/SKILL.md +7 -6
  20. package/.agents/core/skills/security/SKILL.md +44 -16
  21. package/.agents/core/skills/security/skill.yaml +0 -1
  22. package/.agents/ctx.js +20 -14
  23. package/.agents/generated/claude/skills/context-os/SKILL.md +34 -37
  24. package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +24 -24
  25. package/.agents/generated/claude/skills/gemini-precision/SKILL.md +102 -1
  26. package/.agents/generated/claude/skills/gstack-roles/SKILL.md +7 -6
  27. package/.agents/generated/claude/skills/security/SKILL.md +44 -16
  28. package/.agents/generated/gemini/skills/context-os/SKILL.md +34 -37
  29. package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +24 -24
  30. package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +105 -1
  31. package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +7 -6
  32. package/.agents/generated/gemini/skills/security/SKILL.md +44 -125
  33. package/.agents/plugins.js +105 -8
  34. package/.agents/profiles.js +32 -11
  35. package/.agents/resolver/canonical-resolver.js +7 -7
  36. package/.agents/validate.js +69 -1
  37. package/README.md +81 -24
  38. package/bin/commands/hook.js +167 -0
  39. package/bin/commands/scan.js +77 -0
  40. package/bin/commands.js +39 -1
  41. package/bin/index.js +151 -34
  42. package/bin/lib/gate.js +171 -0
  43. package/bin/lib/git-snapshot.js +214 -0
  44. package/bin/lib/scan.js +461 -0
  45. package/catalog/skills/adapters/EXAMPLES.md +19 -0
  46. package/catalog/skills/adapters/SKILL.md +101 -0
  47. package/catalog/skills/adapters/TROUBLESHOOTING.md +7 -0
  48. package/catalog/skills/adapters/VALIDATION.json +12 -0
  49. package/catalog/skills/adapters/skill.yaml +13 -0
  50. package/catalog/skills/api-design/EXAMPLES.md +91 -0
  51. package/catalog/skills/api-design/SKILL.md +63 -0
  52. package/catalog/skills/api-design/TROUBLESHOOTING.md +54 -0
  53. package/catalog/skills/api-design/VALIDATION.json +11 -0
  54. package/catalog/skills/api-design/skill.yaml +14 -0
  55. package/catalog/skills/architecture-diagrams/SKILL.md +108 -0
  56. package/catalog/skills/architecture-diagrams/VALIDATION.json +12 -0
  57. package/catalog/skills/architecture-diagrams/skill.yaml +9 -0
  58. package/catalog/skills/brutalist-design/EXAMPLES.md +59 -0
  59. package/catalog/skills/brutalist-design/SKILL.md +150 -0
  60. package/catalog/skills/brutalist-design/VALIDATION.json +12 -0
  61. package/catalog/skills/brutalist-design/skill.yaml +10 -0
  62. package/catalog/skills/ci-cd/EXAMPLES.md +79 -0
  63. package/catalog/skills/ci-cd/SKILL.md +69 -0
  64. package/catalog/skills/ci-cd/TROUBLESHOOTING.md +52 -0
  65. package/catalog/skills/ci-cd/VALIDATION.json +11 -0
  66. package/catalog/skills/ci-cd/skill.yaml +13 -0
  67. package/catalog/skills/database/EXAMPLES.md +74 -0
  68. package/catalog/skills/database/SKILL.md +101 -0
  69. package/catalog/skills/database/TROUBLESHOOTING.md +18 -0
  70. package/catalog/skills/database/VALIDATION.json +11 -0
  71. package/catalog/skills/database/skill.yaml +14 -0
  72. package/catalog/skills/ddd/EXAMPLES.md +42 -0
  73. package/catalog/skills/ddd/SKILL.md +247 -0
  74. package/catalog/skills/ddd/TROUBLESHOOTING.md +19 -0
  75. package/catalog/skills/ddd/VALIDATION.json +12 -0
  76. package/catalog/skills/ddd/skill.yaml +14 -0
  77. package/catalog/skills/decisions/EXAMPLES.md +35 -0
  78. package/catalog/skills/decisions/SKILL.md +90 -0
  79. package/catalog/skills/decisions/TROUBLESHOOTING.md +13 -0
  80. package/catalog/skills/decisions/VALIDATION.json +12 -0
  81. package/catalog/skills/decisions/skill.yaml +13 -0
  82. package/catalog/skills/docker/EXAMPLES.md +56 -0
  83. package/catalog/skills/docker/SKILL.md +169 -0
  84. package/catalog/skills/docker/TROUBLESHOOTING.md +18 -0
  85. package/catalog/skills/docker/VALIDATION.json +11 -0
  86. package/catalog/skills/docker/skill.yaml +13 -0
  87. package/catalog/skills/fastapi/EXAMPLES.md +36 -0
  88. package/catalog/skills/fastapi/SKILL.md +171 -0
  89. package/catalog/skills/fastapi/TROUBLESHOOTING.md +19 -0
  90. package/catalog/skills/fastapi/VALIDATION.json +12 -0
  91. package/catalog/skills/fastapi/skill.yaml +14 -0
  92. package/catalog/skills/generators/EXAMPLES.md +19 -0
  93. package/catalog/skills/generators/SKILL.md +110 -0
  94. package/catalog/skills/generators/TROUBLESHOOTING.md +7 -0
  95. package/catalog/skills/generators/VALIDATION.json +12 -0
  96. package/catalog/skills/generators/skill.yaml +22 -0
  97. package/catalog/skills/generators/templates/API.md +77 -0
  98. package/catalog/skills/generators/templates/ARCHITECTURE.md +70 -0
  99. package/catalog/skills/generators/templates/DATABASE.md +42 -0
  100. package/catalog/skills/generators/templates/DECISION.md +46 -0
  101. package/catalog/skills/generators/templates/PRD.md +67 -0
  102. package/catalog/skills/generators/templates/PROJECT_GRAPH.md +56 -0
  103. package/catalog/skills/generators/templates/ROADMAP.md +51 -0
  104. package/catalog/skills/generators/templates/TASKS.md +43 -0
  105. package/catalog/skills/generators/templates/UI.md +73 -0
  106. package/catalog/skills/graphify/EXAMPLES.md +73 -0
  107. package/catalog/skills/graphify/SKILL.md +130 -0
  108. package/catalog/skills/graphify/VALIDATION.json +12 -0
  109. package/catalog/skills/graphify/skill.yaml +13 -0
  110. package/catalog/skills/impeccable-design/EXAMPLES.md +26 -0
  111. package/catalog/skills/impeccable-design/SKILL.md +201 -0
  112. package/catalog/skills/impeccable-design/TROUBLESHOOTING.md +19 -0
  113. package/catalog/skills/impeccable-design/VALIDATION.json +12 -0
  114. package/catalog/skills/impeccable-design/skill.yaml +15 -0
  115. package/catalog/skills/interview-me/SKILL.md +97 -0
  116. package/catalog/skills/interview-me/VALIDATION.json +12 -0
  117. package/catalog/skills/interview-me/skill.yaml +9 -0
  118. package/catalog/skills/microservices/EXAMPLES.md +38 -0
  119. package/catalog/skills/microservices/SKILL.md +164 -0
  120. package/catalog/skills/microservices/TROUBLESHOOTING.md +19 -0
  121. package/catalog/skills/microservices/VALIDATION.json +12 -0
  122. package/catalog/skills/microservices/skill.yaml +14 -0
  123. package/catalog/skills/minimalist-design/EXAMPLES.md +58 -0
  124. package/catalog/skills/minimalist-design/SKILL.md +113 -0
  125. package/catalog/skills/minimalist-design/VALIDATION.json +12 -0
  126. package/catalog/skills/minimalist-design/skill.yaml +10 -0
  127. package/catalog/skills/nestjs/EXAMPLES.md +40 -0
  128. package/catalog/skills/nestjs/SKILL.md +139 -0
  129. package/catalog/skills/nestjs/TROUBLESHOOTING.md +19 -0
  130. package/catalog/skills/nestjs/VALIDATION.json +12 -0
  131. package/catalog/skills/nestjs/skill.yaml +14 -0
  132. package/catalog/skills/nextjs/EXAMPLES.md +40 -0
  133. package/catalog/skills/nextjs/SKILL.md +163 -0
  134. package/catalog/skills/nextjs/TROUBLESHOOTING.md +19 -0
  135. package/catalog/skills/nextjs/VALIDATION.json +12 -0
  136. package/catalog/skills/nextjs/skill.yaml +14 -0
  137. package/catalog/skills/node/EXAMPLES.md +80 -0
  138. package/catalog/skills/node/SKILL.md +128 -0
  139. package/catalog/skills/node/TROUBLESHOOTING.md +19 -0
  140. package/catalog/skills/node/VALIDATION.json +12 -0
  141. package/catalog/skills/node/skill.yaml +14 -0
  142. package/catalog/skills/performance/EXAMPLES.md +30 -0
  143. package/catalog/skills/performance/SKILL.md +75 -0
  144. package/catalog/skills/performance/TROUBLESHOOTING.md +19 -0
  145. package/catalog/skills/performance/VALIDATION.json +12 -0
  146. package/catalog/skills/performance/skill.yaml +14 -0
  147. package/catalog/skills/react/EXAMPLES.md +79 -0
  148. package/catalog/skills/react/SKILL.md +132 -0
  149. package/catalog/skills/react/TROUBLESHOOTING.md +19 -0
  150. package/catalog/skills/react/VALIDATION.json +12 -0
  151. package/catalog/skills/react/skill.yaml +14 -0
  152. package/catalog/skills/react-best-practices/SKILL.md +158 -0
  153. package/catalog/skills/react-best-practices/VALIDATION.json +12 -0
  154. package/catalog/skills/react-best-practices/skill.yaml +13 -0
  155. package/catalog/skills/redesign-audit/SKILL.md +117 -0
  156. package/catalog/skills/redesign-audit/VALIDATION.json +12 -0
  157. package/catalog/skills/redesign-audit/skill.yaml +9 -0
  158. package/catalog/skills/security-audit/EXAMPLES.md +79 -0
  159. package/catalog/skills/security-audit/SKILL.md +91 -0
  160. package/catalog/skills/security-audit/TROUBLESHOOTING.md +46 -0
  161. package/catalog/skills/security-audit/VALIDATION.json +11 -0
  162. package/catalog/skills/security-audit/skill.yaml +14 -0
  163. package/catalog/skills/soft-design/EXAMPLES.md +51 -0
  164. package/catalog/skills/soft-design/SKILL.md +108 -0
  165. package/catalog/skills/soft-design/VALIDATION.json +12 -0
  166. package/catalog/skills/soft-design/skill.yaml +10 -0
  167. package/catalog/skills/state-management/EXAMPLES.md +56 -0
  168. package/catalog/skills/state-management/SKILL.md +168 -0
  169. package/catalog/skills/state-management/TROUBLESHOOTING.md +18 -0
  170. package/catalog/skills/state-management/VALIDATION.json +11 -0
  171. package/catalog/skills/state-management/skill.yaml +14 -0
  172. package/catalog/skills/subagent-orchestrator/SKILL.md +117 -0
  173. package/catalog/skills/subagent-orchestrator/VALIDATION.json +12 -0
  174. package/catalog/skills/subagent-orchestrator/skill.yaml +9 -0
  175. package/catalog/skills/system-design/EXAMPLES.md +75 -0
  176. package/catalog/skills/system-design/SKILL.md +419 -0
  177. package/catalog/skills/system-design/TROUBLESHOOTING.md +19 -0
  178. package/catalog/skills/system-design/VALIDATION.json +12 -0
  179. package/catalog/skills/system-design/skill.yaml +14 -0
  180. package/catalog/skills/terraform/EXAMPLES.md +74 -0
  181. package/catalog/skills/terraform/SKILL.md +55 -0
  182. package/catalog/skills/terraform/TROUBLESHOOTING.md +53 -0
  183. package/catalog/skills/terraform/VALIDATION.json +11 -0
  184. package/catalog/skills/terraform/skill.yaml +14 -0
  185. package/catalog/skills/testing/EXAMPLES.md +122 -0
  186. package/catalog/skills/testing/SKILL.md +70 -0
  187. package/catalog/skills/testing/TROUBLESHOOTING.md +18 -0
  188. package/catalog/skills/testing/VALIDATION.json +11 -0
  189. package/catalog/skills/testing/skill.yaml +14 -0
  190. package/catalog/skills/typescript/EXAMPLES.md +64 -0
  191. package/catalog/skills/typescript/SKILL.md +112 -0
  192. package/catalog/skills/typescript/TROUBLESHOOTING.md +19 -0
  193. package/catalog/skills/typescript/VALIDATION.json +12 -0
  194. package/catalog/skills/typescript/skill.yaml +14 -0
  195. package/catalog/skills/ui-design/EXAMPLES.md +21 -0
  196. package/catalog/skills/ui-design/SKILL.md +124 -0
  197. package/catalog/skills/ui-design/TROUBLESHOOTING.md +19 -0
  198. package/catalog/skills/ui-design/VALIDATION.json +12 -0
  199. package/catalog/skills/ui-design/skill.yaml +16 -0
  200. package/catalog/skills/ui-ux-pro/EXAMPLES.md +62 -0
  201. package/catalog/skills/ui-ux-pro/SKILL.md +418 -0
  202. package/catalog/skills/ui-ux-pro/TROUBLESHOOTING.md +19 -0
  203. package/catalog/skills/ui-ux-pro/VALIDATION.json +12 -0
  204. package/catalog/skills/ui-ux-pro/skill.yaml +14 -0
  205. package/catalog/skills/ux-design/EXAMPLES.md +36 -0
  206. package/catalog/skills/ux-design/SKILL.md +116 -0
  207. package/catalog/skills/ux-design/TROUBLESHOOTING.md +19 -0
  208. package/catalog/skills/ux-design/VALIDATION.json +12 -0
  209. package/catalog/skills/ux-design/skill.yaml +16 -0
  210. package/catalog/skills/vercel-optimize/SKILL.md +83 -0
  211. package/catalog/skills/vercel-optimize/VALIDATION.json +12 -0
  212. package/catalog/skills/vercel-optimize/scripts/collect-signals.mjs +131 -0
  213. package/catalog/skills/vercel-optimize/scripts/gate-investigations.mjs +142 -0
  214. package/catalog/skills/vercel-optimize/scripts/merge-signals.mjs +143 -0
  215. package/catalog/skills/vercel-optimize/scripts/scan-codebase.mjs +174 -0
  216. package/catalog/skills/vercel-optimize/skill.yaml +15 -0
  217. package/catalog/skills/web-accessibility/EXAMPLES.md +39 -0
  218. package/catalog/skills/web-accessibility/SKILL.md +151 -0
  219. package/catalog/skills/web-accessibility/TROUBLESHOOTING.md +19 -0
  220. package/catalog/skills/web-accessibility/VALIDATION.json +12 -0
  221. package/catalog/skills/web-accessibility/skill.yaml +14 -0
  222. package/package.json +5 -2
  223. package/.agents/core/skills/security/security.md +0 -106
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: api-design
3
+ description: Guides stable API and interface design. Enforces Hyrum's Law awareness, contract-first development, uniform error shapes, boundary validation, and idempotency patterns.
4
+ ---
5
+
6
+ # API and Interface Design
7
+
8
+ Design stable, self-documenting, and robust interfaces that are hard to misuse. Good interfaces make the right thing easy and the wrong thing difficult. This applies to REST APIs, GraphQL schemas, RPC services, and internal module contracts.
9
+
10
+ ## Core Principles
11
+
12
+ ### 1. Hyrum's Law Awareness
13
+
14
+ > With a sufficient number of users of an API, all observable behaviors of your system will be depended on by somebody, regardless of what you promise in the contract.
15
+
16
+ Design implications:
17
+ - **Never leak internal implementation details**: Database column names, raw ORM errors, stack traces, and internal IDs must never escape to clients.
18
+ - **Lock down response shapes**: Undocumented extra fields or varying JSON key ordering become accidental dependencies.
19
+ - **Design for evolution**: Additive changes are safe; removing, renaming, or changing types of fields requires a deprecation window.
20
+
21
+ ### 2. Contract-First Development
22
+
23
+ Define the interface and data types before implementing handlers or controllers:
24
+ 1. Specify TypeScript interfaces, JSON Schemas, or OpenAPI documents.
25
+ 2. Review the contract independently of database models.
26
+ 3. Generate server stubs and client SDK types from the unified contract.
27
+
28
+ ### 3. Uniform Error Semantics
29
+
30
+ All API error responses must adhere to a single predictable schema across the entire application:
31
+
32
+ ```typescript
33
+ interface APIErrorResponse {
34
+ error: {
35
+ code: string; // Machine-readable uppercase token (e.g., "VALIDATION_FAILED")
36
+ message: string; // Clear, user-safe human-readable description
37
+ details?: unknown; // Specific field errors or structured context
38
+ };
39
+ }
40
+ ```
41
+
42
+ Standard HTTP status mappings:
43
+ - `400 Bad Request`: Malformed syntax or unparseable request body.
44
+ - `401 Unauthorized`: Authentication credentials missing or invalid.
45
+ - `403 Forbidden`: Authenticated, but lacks required permissions.
46
+ - `404 Not Found`: Target resource does not exist.
47
+ - `409 Conflict`: Resource state conflict (e.g., duplicate unique key).
48
+ - `422 Unprocessable Entity`: Well-formed request failed semantic validation.
49
+ - `429 Too Many Requests`: Rate limit exceeded.
50
+ - `500 Internal Server Error`: Unhandled server condition (never leak stack details).
51
+
52
+ ### 4. Boundary Validation
53
+
54
+ Trust internal services, but validate strictly at external boundaries:
55
+ - Validate every query parameter, path variable, header, and request payload using schemas (e.g. Zod, Pydantic, TypeBox).
56
+ - Sanitize inputs against injection attacks before passing them to services.
57
+ - Return explicit validation errors pinpointing the exact field and issue.
58
+
59
+ ### 5. Idempotent State Mutations
60
+
61
+ Any non-safe HTTP mutation (`POST` creating resources, charging payments, or executing transfers) should support an `Idempotency-Key` header:
62
+ - Store operation results indexed by `Idempotency-Key` with a TTL (e.g. 24 hours).
63
+ - Subsequent requests with the same key immediately return the cached response without re-executing side effects.
@@ -0,0 +1,54 @@
1
+ # API Design - Troubleshooting & Common Edge Cases
2
+
3
+ ## Common Diagnostic Scenarios
4
+
5
+ ### 1. Accidental Hyrum's Law Contract Leakage
6
+
7
+ - **Symptom**: Frontend clients start breaking after an internal database migration or ORM upgrade, even though the documented API schema did not change.
8
+ - **Root Cause**: The API endpoint returned raw database entity objects (`res.json(user)`) instead of projecting through an explicit DTO (Data Transfer Object). Undocumented fields, changed nullability, or reordered keys broke client assumptions.
9
+ - **Fix Protocol**:
10
+ 1. Never pass raw ORM instances directly to response serializers.
11
+ 2. Map domain models through strict schema parsers or DTO mappers (`toUserDTO(user)`).
12
+ 3. Strip internal metadata columns (`__v`, `password_hash`, internal foreign keys).
13
+
14
+ ---
15
+
16
+ ### 2. High-Concurrency Race Conditions with Idempotency Keys
17
+
18
+ - **Symptom**: Two duplicate `POST /payments` requests sent concurrently with the exact same `Idempotency-Key` both execute the underlying charge twice.
19
+ - **Root Cause**: Check-then-act race condition in the idempotency store. Reading `store.get(key)` and writing `store.set(key)` were not executed atomically.
20
+ - **Fix Protocol**:
21
+ 1. Use atomic reservations with state transitions: `PENDING` -> `RESOLVED`.
22
+ 2. In Redis, execute `SET key "PENDING" NX EX 120`. If the key already exists, return `409 Conflict` or poll until `RESOLVED`.
23
+ 3. Once the mutation succeeds, atomically update the key with the serialized response body and final HTTP status code.
24
+
25
+ ---
26
+
27
+ ### 3. Inconsistent Error Response Shapes Across Endpoints
28
+
29
+ - **Symptom**: Some API routes return `{ message: "Not found" }`, others return `{ error: "Not found" }`, and uncaught server errors return `{ statusCode: 500, error: "Internal Server Error" }`.
30
+ - **Root Cause**: Different libraries or individual route handlers constructing ad-hoc error literals without centralized error middleware.
31
+ - **Fix Protocol**:
32
+ 1. Implement a single global error handler middleware.
33
+ 2. Define an `AppError` class with machine-readable error codes.
34
+ 3. Ensure all errors format strictly as:
35
+ ```json
36
+ {
37
+ "error": {
38
+ "code": "RESOURCE_NOT_FOUND",
39
+ "message": "User with id 123 does not exist",
40
+ "details": null
41
+ }
42
+ }
43
+ ```
44
+
45
+ ---
46
+
47
+ ### 4. Non-Additive Breaking Changes in Schema Evolution
48
+
49
+ - **Symptom**: Renaming an optional field `fullName` to `name` breaks mobile clients that have not updated yet.
50
+ - **Root Cause**: Violating the additive evolution rule.
51
+ - **Fix Protocol**:
52
+ 1. Add new fields alongside existing ones: maintain both `name` and `fullName` during the deprecation window.
53
+ 2. Mark `fullName` as deprecated in OpenAPI specs.
54
+ 3. Monitor usage via analytics; remove the deprecated field only after traffic drops to zero and a major version bump occurs.
@@ -0,0 +1,11 @@
1
+ {
2
+ "skill": "api-design",
3
+ "version": "1.0.0",
4
+ "checks": [
5
+ "Hyrum's Law awareness enforced: no raw internal errors or ORM models leaked",
6
+ "Contracts defined before implementation using TypeScript, JSON Schema, or OpenAPI",
7
+ "Uniform error response shape implemented across all endpoints",
8
+ "Boundary validation applied at all network and controller ingress points",
9
+ "Idempotency keys supported for critical state-mutating requests"
10
+ ]
11
+ }
@@ -0,0 +1,14 @@
1
+ schemaVersion: 2
2
+ name: api-design
3
+ description: Contract-first API and interface design standard inspired by Addy Osmani. Enforces Hyrum's Law awareness, uniform error shapes, boundary validation, and idempotency keys.
4
+ version: 1.0.0
5
+ category: backend
6
+ type: instruction-only
7
+ requires:
8
+ - engineering-workflow
9
+ - system-design
10
+ resources:
11
+ - EXAMPLES.md
12
+ - SKILL.md
13
+ - TROUBLESHOOTING.md
14
+ - VALIDATION.json
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: architecture-diagrams
3
+ description: >
4
+ Interactive, visual architecture and sequence diagrams as code. Generates beautiful, self-contained
5
+ SVG/HTML diagrams with motion, clear component boundaries, and verifiable data flows.
6
+ ---
7
+
8
+ # architecture-diagrams
9
+
10
+ ## Overview
11
+
12
+ Visual architecture engineering skill inspired by [tt-a1i/archify](https://github.com/tt-a1i/archify). Replaces static ASCII art and rigid default diagrams with crisp, self-contained SVG and responsive HTML diagrams featuring modern dark-mode palettes, pulse animations for event flows, and strict C4-model component boundaries.
13
+
14
+ ## When to Use
15
+
16
+ Activate whenever:
17
+
18
+ - Designing or explaining distributed systems, microservices, or full-stack architectures.
19
+ - Visualizing complex auth flows (OAuth2, PKCE), multi-step payment sagas, or CDC outbox data pipelines.
20
+ - User requests an architecture diagram, flow chart, sequence diagram, or visual system design.
21
+
22
+ ## Rules & Patterns
23
+
24
+ ### 1. Diagram Types Supported
25
+
26
+ 1. **System Landscape / C4 Container Diagram**:
27
+ - Clients (Web, Mobile, Third-party) → API Gateway / CDN → Microservices / Serverless → Storage / Event Brokers.
28
+ 2. **Sequence Flow Diagram**:
29
+ - Step-by-step lifecycles with synchronous requests, asynchronous pub/sub events, and compensating transactions.
30
+ 3. **Data Pipeline & Event-Driven Topology**:
31
+ - Primary DB → Transactional Outbox → CDC (Debezium) → Kafka Topic → Consumers → Materialized Views.
32
+
33
+ ### 2. Aesthetic & Visual Invariants
34
+
35
+ - **Dark Theme by Default**: Surface `#0B0F19`, containers `#1E293B`, borders `#334155`, text `#F8FAFC`.
36
+ - **Semantic Component Accents**:
37
+ - Client / Frontend: Sky Blue (`#38BDF8`)
38
+ - API Gateway / Router: Indigo (`#818CF8`)
39
+ - Business Services: Emerald Green (`#34D399`)
40
+ - Databases / Storage: Amber / Orange (`#F59E0B`)
41
+ - Message Brokers / Event Buses: Purple (`#A855F7`)
42
+ - **Active Data-Flow Motion**: Use subtle CSS `@keyframes` on SVG stroke dashes (`stroke-dasharray`, `stroke-dashoffset`) to show active direction of messages and data streams.
43
+
44
+ ---
45
+
46
+ ## Code Examples
47
+
48
+ ### Standalone Animated SVG Data-Flow Pattern
49
+
50
+ ```html
51
+ <svg viewBox="0 0 800 200" xmlns="http://www.w3.org/2000/svg" class="bg-slate-950 rounded-xl p-4 w-full">
52
+ <defs>
53
+ <style>
54
+ .flow-line { stroke: #38BDF8; stroke-width: 2; stroke-dasharray: 6,6; animation: flow 1.5s linear infinite; }
55
+ @keyframes flow { to { stroke-dashoffset: -12; } }
56
+ .box { fill: #1E293B; stroke: #334155; stroke-width: 1.5; rx: 8; }
57
+ .text-title { fill: #F8FAFC; font-family: sans-serif; font-size: 14px; font-weight: 600; }
58
+ .text-sub { fill: #94A3B8; font-family: monospace; font-size: 11px; }
59
+ </style>
60
+ </defs>
61
+
62
+ <!-- Client Node -->
63
+ <rect x="30" y="70" width="160" height="60" class="box" />
64
+ <text x="110" y="96" text-anchor="middle" class="text-title">Next.js Client</text>
65
+ <text x="110" y="114" text-anchor="middle" class="text-sub">React 19 / RSC</text>
66
+
67
+ <!-- Data Flow -->
68
+ <line x1="190" y1="100" x2="330" y2="100" class="flow-line" />
69
+
70
+ <!-- API Gateway -->
71
+ <rect x="330" y="70" width="160" height="60" class="box" />
72
+ <text x="410" y="96" text-anchor="middle" class="text-title">API Gateway</text>
73
+ <text x="410" y="114" text-anchor="middle" class="text-sub">Auth & Rate Limiting</text>
74
+
75
+ <!-- Flow to Database -->
76
+ <line x1="490" y1="100" x2="630" y2="100" class="flow-line" />
77
+
78
+ <!-- Database -->
79
+ <rect x="630" y="70" width="140" height="60" class="box" />
80
+ <text x="700" y="96" text-anchor="middle" class="text-title">PostgreSQL</text>
81
+ <text x="700" y="114" text-anchor="middle" class="text-sub">Prisma / Outbox</text>
82
+ </svg>
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Validation Checklist
88
+
89
+ - [ ] Diagram clearly identifies all component boundaries, ports, and protocols.
90
+ - [ ] Visual hierarchy is unambiguous (clients on left/top, storage on right/bottom).
91
+ - [ ] Motion/animation is purposeful and lightweight (no heavy canvas frameworks).
92
+ - [ ] Accessible: nodes include semantic labels and readable color contrast.
93
+
94
+ ---
95
+
96
+ ## Common Mistakes
97
+
98
+ - **Messy cross-overs**: Laying out 20 boxes with overlapping lines instead of grouping into clean C4 layers.
99
+ - **Unlabeled connections**: Lines without protocol (HTTPS, gRPC, WSS) or event payload descriptions.
100
+ - **Overwhelming detail**: Drawing internal class diagrams when the user asked for a system-level overview.
101
+
102
+ ---
103
+
104
+ ## Integration Notes
105
+
106
+ - Triggers during `system-design` and `microservices` planning phases.
107
+ - Used to generate visual architecture artifacts in Markdown walkthroughs and specs.
108
+ - Pairs with `ui-ux-pro` for consistent aesthetic styling.
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "rules_followed": {
6
+ "type": "boolean"
7
+ }
8
+ },
9
+ "required": [
10
+ "rules_followed"
11
+ ]
12
+ }
@@ -0,0 +1,9 @@
1
+ schemaVersion: 2
2
+ name: architecture-diagrams
3
+ category: architecture
4
+ type: instruction-only
5
+ description: Interactive, visual architecture and sequence diagrams as code. Generates beautiful, self-contained SVG/HTML diagrams with motion, clear component boundaries, and verifiable data flows.
6
+ version: 1.0.0
7
+ resources:
8
+ - SKILL.md
9
+ - VALIDATION.json
@@ -0,0 +1,59 @@
1
+ # Brutalist Design - Component & Layout Examples
2
+
3
+ ## Example 1: High-Contrast Neobrutalist Action Card
4
+
5
+ ```tsx
6
+ import React from 'react';
7
+
8
+ interface BrutalistCardProps {
9
+ title: string;
10
+ tag: string;
11
+ description: string;
12
+ onAction: () => void;
13
+ }
14
+
15
+ export function BrutalistCard({ title, tag, description, onAction }: BrutalistCardProps) {
16
+ return (
17
+ <div className="border-4 border-black bg-yellow-300 p-6 shadow-[8px_8px_0px_0px_#000000] hover:translate-x-1 hover:translate-y-1 hover:shadow-[4px_4px_0px_0px_#000000] transition-all">
18
+ <div className="flex items-center justify-between border-b-4 border-black pb-3">
19
+ <span className="bg-black text-white px-3 py-1 font-mono text-xs uppercase font-bold tracking-wider">
20
+ {tag}
21
+ </span>
22
+ <span className="font-mono text-xs font-bold uppercase">SEC-LOCKED</span>
23
+ </div>
24
+ <div className="mt-4">
25
+ <h3 className="font-mono text-xl font-black uppercase tracking-tight text-black">
26
+ {title}
27
+ </h3>
28
+ <p className="mt-2 font-mono text-sm leading-relaxed text-black/90">
29
+ {description}
30
+ </p>
31
+ </div>
32
+ <button
33
+ onClick={onAction}
34
+ className="mt-6 w-full border-2 border-black bg-white px-4 py-3 font-mono text-sm font-bold uppercase tracking-wider text-black shadow-[4px_4px_0px_0px_#000000] active:translate-x-0.5 active:translate-y-0.5 active:shadow-[1px_1px_0px_0px_#000000] transition-all"
35
+ >
36
+ EXECUTE ACTION ->
37
+ </button>
38
+ </div>
39
+ );
40
+ }
41
+ ```
42
+
43
+ ---
44
+
45
+ ## Example 2: Terminal-Style Metric Strip
46
+
47
+ ```tsx
48
+ export function BrutalistStatusStrip({ status }: { status: string }) {
49
+ return (
50
+ <div className="border-2 border-black bg-black text-white px-4 py-2 font-mono text-xs uppercase flex items-center justify-between">
51
+ <div className="flex items-center gap-2">
52
+ <span className="inline-block h-2 w-2 bg-green-400 animate-pulse" />
53
+ <span>SYSTEM STATUS: {status}</span>
54
+ </div>
55
+ <span className="text-neutral-400">LATENCY: 12ms</span>
56
+ </div>
57
+ );
58
+ }
59
+ ```
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: industrial-brutalist-ui
3
+ description: Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.
4
+ ---
5
+
6
+ # SKILL: Industrial Brutalism & Tactical Telemetry UI
7
+
8
+ ## Overview
9
+
10
+ Advanced proficiency in architecting web interfaces that synthesize mid-century Swiss Typographic design, industrial manufacturing manuals, and retro-futuristic aerospace/military terminal interfaces. This discipline requires absolute mastery over rigid modular grids, extreme typographic scale contrast, purely utilitarian color palettes, and the programmatic simulation of analog degradation (halftones, CRT scanlines, bitmap dithering). The objective is to construct digital environments that project raw functionality, mechanical precision, and high data density, deliberately discarding conventional consumer UI patterns.
11
+
12
+ ## When to Use
13
+
14
+ - When building data-heavy telemetry dashboards, analytics monitors, trading systems, or developer command centers.
15
+ - When creating editorial portfolios, archival indexes, or technical documentation sites requiring an industrial blueprint aesthetic.
16
+ - When explicitly prompted for "brutalist", "tactical", "terminal", "Swiss print", or "mechanical" aesthetics.
17
+
18
+ ## Rules & Patterns
19
+
20
+ ### 1. Visual Archetypes
21
+
22
+ Pick ONE per project and commit to it. Do not alternate or mix both modes within the same interface.
23
+
24
+ #### 1.1 Swiss Industrial Print
25
+
26
+ Derived from 1960s corporate identity systems and heavy machinery blueprints.
27
+
28
+ - **Characteristics:** High-contrast light modes (newsprint/off-white substrates). Reliance on monolithic, heavy sans-serif typography. Unforgiving structural grids outlined by visible dividing lines. Aggressive, asymmetric use of negative space punctuated by oversized, viewport-bleeding numerals or letterforms. Heavy use of primary red as an alert/accent color.
29
+
30
+ #### 1.2 Tactical Telemetry & CRT Terminal
31
+
32
+ Derived from classified military databases, legacy mainframes, and aerospace Heads-Up Displays (HUDs).
33
+
34
+ - **Characteristics:** Dark mode exclusivity. High-density tabular data presentation. Absolute dominance of monospaced typography. Integration of technical framing devices (ASCII brackets, crosshairs). Application of simulated hardware limitations (phosphor glow, scanlines, low bit-depth rendering).
35
+
36
+ ### 2. Typographic Architecture
37
+
38
+ Typography is the primary structural and decorative infrastructure. Imagery is secondary. The system demands extreme variance in scale, weight, and spacing.
39
+
40
+ #### 2.1 Macro-Typography (Structural Headers)
41
+
42
+ - **Classification:** Neo-Grotesque / Heavy Sans-Serif.
43
+ - **Optimal Web Fonts:** Neue Haas Grotesk (Black), Inter (Extra Bold/Black), Archivo Black, Roboto Flex (Heavy), Monument Extended.
44
+ - **Scale:** Deployed at massive scales using fluid typography (e.g., `clamp(4rem, 10vw, 15rem)`).
45
+ - **Tracking (Letter-spacing):** Extremely tight, often negative (`-0.03em` to `-0.06em`), forcing glyphs to form solid architectural blocks.
46
+ - **Leading (Line-height):** Highly compressed (`0.85` to `0.95`).
47
+ - **Casing:** Exclusively uppercase for structural impact.
48
+
49
+ #### 2.2 Micro-Typography (Data & Telemetry)
50
+
51
+ - **Classification:** Monospace / Technical Sans.
52
+ - **Optimal Web Fonts:** JetBrains Mono, IBM Plex Mono, Space Mono, VT323, Courier Prime.
53
+ - **Scale:** Fixed and small (`10px` to `14px` / `0.7rem` to `0.875rem`).
54
+ - **Tracking:** Generous (`0.05em` to `0.1em`) to simulate mechanical typewriter spacing or terminal matrices.
55
+ - **Leading:** Standard to tight (`1.2` to `1.4`).
56
+ - **Casing:** Exclusively uppercase. Used for all metadata, navigation, unit IDs, and coordinates.
57
+
58
+ #### 2.3 Textural Contrast (Artistic Disruption)
59
+
60
+ - **Classification:** High-Contrast Serif.
61
+ - **Optimal Web Fonts:** Playfair Display, EB Garamond, Times New Roman.
62
+ - **Implementation Parameters:** Used exceedingly sparingly. Must be subjected to heavy post-processing (halftone filters, 1-bit dithering) to degrade vector perfection and create textural juxtaposition against the clean sans-serifs.
63
+
64
+ ### 3. Color System
65
+
66
+ The color architecture is uncompromising. Gradients, soft drop shadows, and modern translucency are strictly prohibited. Colors simulate physical media or primitive emissive displays.
67
+
68
+ **CRITICAL: Choose ONE substrate palette per project and use it consistently. Never mix light and dark substrates within the same interface.**
69
+
70
+ #### Swiss Industrial Print Light Substrate
71
+
72
+ - **Background:** `#F4F4F0` or `#EAE8E3` (Matte, unbleached documentation paper).
73
+ - **Foreground:** `#050505` to `#111111` (Carbon Ink).
74
+ - **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). This is the ONLY accent color. Used for strike-throughs, thick structural dividing lines, or vital data highlights.
75
+
76
+ #### Tactical Telemetry Dark Substrate
77
+
78
+ - **Background:** `#0A0A0A` or `#121212` (Deactivated CRT. Avoid pure `#000000`).
79
+ - **Foreground:** `#EAEAEA` (White phosphor). This is the primary text color.
80
+ - **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). Same red, same rules.
81
+ - **Terminal Green (`#4AF626`):** Optional. Use ONLY for a single specific UI element (e.g., one status indicator or one data readout) - never as a general text color. If it doesn't serve a clear purpose, omit it entirely.
82
+
83
+ ### 4. Layout and Spatial Engineering
84
+
85
+ - **The Blueprint Grid:** Strict adherence to CSS Grid architectures. Elements do not float; they are anchored precisely to grid tracks and intersections.
86
+ - **Visible Compartmentalization:** Extensive utilization of solid borders (`1px` or `2px solid`) to delineate distinct zones of information. Horizontal rules (`<hr>`) frequently span the entire container width to segregate operational units.
87
+ - **Bimodal Density:** Layouts oscillate between extreme data density (tightly packed monospace metadata clustered together) and vast expanses of calculated negative space framing macro-typography.
88
+ - **Geometry:** Absolute rejection of `border-radius`. All corners must be exactly 90 degrees to enforce mechanical rigidity.
89
+
90
+ ### 5. UI Components and Symbology
91
+
92
+ - **Syntax Decoration:** Utilization of ASCII characters to frame data points (`[ DELIVERY SYSTEMS ]`, `< RE-IND >`, `>>>`, `///`).
93
+ - **Industrial Markers:** Prominent integration of registration (`®`), copyright (`©`), and trademark (`™`) symbols functioning as structural geometric elements rather than legal text.
94
+ - **Technical Assets:** Integration of crosshairs (`+`) at grid intersections, repeating vertical lines (barcodes), thick horizontal warning stripes, and randomized string data (`REV 2.6`, `UNIT / D-01`) to simulate active mechanical processes.
95
+
96
+ ### 6. Textural and Post-Processing Effects
97
+
98
+ - **Halftone and 1-Bit Dithering:** Dot-matrix effects via `mix-blend-mode: multiply` overlays combined with SVG radial dot patterns.
99
+ - **CRT Scanlines:** `repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px)` on terminal backgrounds.
100
+ - **Mechanical Noise:** Low-opacity SVG static filter on the DOM root to introduce physical grain.
101
+
102
+ ### 7. Web Engineering Directives
103
+
104
+ 1. **Grid Determinism:** Utilize `display: grid; gap: 1px;` with contrasting parent/child background colors to generate mathematically perfect, razor-thin dividing lines without complex border declarations.
105
+ 2. **Semantic Rigidity:** Construct the DOM using precise semantic tags (`<data>`, `<samp>`, `<kbd>`, `<output>`, `<dl>`) to accurately reflect the technical nature of the telemetry.
106
+ 3. **Typography Clamping:** Implement CSS `clamp()` functions exclusively for macro-typography to ensure massive text scales aggressively while maintaining structural integrity across viewports.
107
+
108
+ ## Code Examples
109
+
110
+ ```tsx
111
+ export function TelemetryModule({ unitId, status, metrics }: { unitId: string; status: string; metrics: { label: string; val: string }[] }) {
112
+ return (
113
+ <div className="border-2 border-black dark:border-white bg-[#F4F4F0] dark:bg-[#0A0A0A] font-mono p-4 rounded-none">
114
+ <div className="flex justify-between border-b border-black/30 dark:border-white/30 pb-2 mb-4 text-xs tracking-widest uppercase">
115
+ <span>[ UNIT // {unitId} ]</span>
116
+ <span className="text-[#E61919] font-bold">&lt; STATUS: {status} &gt;</span>
117
+ </div>
118
+ <div className="grid grid-cols-2 gap-px bg-black/20 dark:bg-white/20">
119
+ {metrics.map(m => (
120
+ <div key={m.label} className="bg-[#F4F4F0] dark:bg-[#0A0A0A] p-2">
121
+ <div className="text-[10px] text-black/60 dark:text-white/60 tracking-wider">{m.label}</div>
122
+ <div className="text-sm font-bold tracking-tight">{m.val}</div>
123
+ </div>
124
+ ))}
125
+ </div>
126
+ </div>
127
+ );
128
+ }
129
+ ```
130
+
131
+ ## Validation Checklist
132
+
133
+ - [ ] Strict rejection of `border-radius` (all corners 0px / 90 degrees).
134
+ - [ ] Substrate consistency: 100% committed to either Swiss Light or Tactical CRT Dark.
135
+ - [ ] Pure black (`#000000`) avoided for backgrounds.
136
+ - [ ] Monospace typography used for all telemetry, coordinates, and metadata labels.
137
+ - [ ] Dividing lines engineered using solid borders or 1px grid track gaps.
138
+ - [ ] No soft gradients, standard drop shadows, or floating cards.
139
+
140
+ ## Common Mistakes
141
+
142
+ - Mixing Swiss Industrial Print and Tactical Telemetry substrates within the same view.
143
+ - Introducing rounded corners (`rounded-md`, `rounded-full`) or pill buttons.
144
+ - Using generic body typefaces without tracking adjustments.
145
+ - Applying subtle pastel colors instead of raw carbon ink, off-white, and hazard red.
146
+
147
+ ## Integration Notes
148
+
149
+ - Complements `impeccable-design` for QA checks on contrast and typography.
150
+ - Pairs with `web-accessibility` to guarantee high-contrast readability (AAA ratio).
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "rules_followed": {
6
+ "type": "boolean"
7
+ }
8
+ },
9
+ "required": [
10
+ "rules_followed"
11
+ ]
12
+ }
@@ -0,0 +1,10 @@
1
+ schemaVersion: 2
2
+ name: brutalist-design
3
+ category: design
4
+ type: instruction-only
5
+ description: Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics.
6
+ version: 1.0.0
7
+ resources:
8
+ - EXAMPLES.md
9
+ - SKILL.md
10
+ - VALIDATION.json
@@ -0,0 +1,79 @@
1
+ # CI/CD - Examples & GitHub Actions Configurations
2
+
3
+ ## Example 1: Production Quality Gate Workflow
4
+
5
+ ```yaml
6
+ # .github/workflows/ci.yml
7
+ name: CI Quality Gates
8
+
9
+ on:
10
+ pull_request:
11
+ branches: [main]
12
+ push:
13
+ branches: [main]
14
+
15
+ concurrency:
16
+ group: ${{ github.workflow }}-${{ github.ref }}
17
+ cancel-in-progress: true
18
+
19
+ permissions:
20
+ contents: read
21
+
22
+ jobs:
23
+ quality:
24
+ name: Lint, Types & Security
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - name: Checkout Code
28
+ uses: actions/checkout@v4
29
+
30
+ - name: Setup Node.js
31
+ uses: actions/setup-node@v4
32
+ with:
33
+ node-version: '22'
34
+ cache: 'npm'
35
+
36
+ - name: Install Dependencies
37
+ run: npm ci
38
+
39
+ - name: Secret Scan
40
+ run: npm run check:secrets
41
+
42
+ - name: Linter & Format Check
43
+ run: npm run lint
44
+
45
+ - name: Type Check
46
+ run: npx tsc --noEmit
47
+
48
+ - name: Unit Tests with Coverage
49
+ run: npm test -- --coverage
50
+
51
+ - name: Build Verification
52
+ run: npm run build
53
+
54
+ - name: Dependency Audit
55
+ run: npm audit --audit-level=high
56
+ ```
57
+
58
+ ---
59
+
60
+ ## Example 2: Polyglot Matrix Test Stage
61
+
62
+ ```yaml
63
+ test-matrix:
64
+ name: Node Test Matrix
65
+ needs: quality
66
+ runs-on: ubuntu-latest
67
+ strategy:
68
+ fail-fast: false
69
+ matrix:
70
+ node-version: ['20', '22']
71
+ steps:
72
+ - uses: actions/checkout@v4
73
+ - uses: actions/setup-node@v4
74
+ with:
75
+ node-version: ${{ matrix.node-version }}
76
+ cache: 'npm'
77
+ - run: npm ci
78
+ - run: npm test
79
+ ```
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: ci-cd
3
+ description: Automates CI/CD pipeline setup. Enforces unskippable quality gates, shift-left static analysis, secret scanning, and hardened GitHub Actions workflows.
4
+ ---
5
+
6
+ # CI/CD and Automation
7
+
8
+ Automate quality gates so no change reaches production without passing tests, lint, type checking, security scans, and build verification.
9
+
10
+ ## Core Philosophy
11
+
12
+ - **Shift Left**: Catch problems as early in the delivery lifecycle as possible. A defect caught during static analysis or linting takes seconds to fix; the same defect discovered in production takes hours and damages reliability.
13
+ - **Faster is Safer**: Small, frequent, automated releases drastically lower blast radius and risk compared to infrequent bulk deployments.
14
+ - **Unskippable Gates Invariant**: Never disable a failing rule or skip a test suite just to make a pipeline green. Fix the root cause in the code.
15
+
16
+ ## The Quality Gate Pipeline
17
+
18
+ Every Pull Request must successfully traverse these automated stages before merge approval:
19
+
20
+ ```
21
+ Pull Request Opened
22
+ │
23
+ ▼
24
+ 1. Secret Scanning (prevent credential leaks before running untrusted steps)
25
+ │
26
+ ▼
27
+ 2. Lint & Formatting (eslint, prettier, markdownlint)
28
+ │
29
+ ▼
30
+ 3. Type Checking (tsc --noEmit, pyright, mypy)
31
+ │
32
+ ▼
33
+ 4. Unit Tests (vitest, jest, pytest with coverage thresholds)
34
+ │
35
+ ▼
36
+ 5. Production Build (bundling, tree-shaking, static generation)
37
+ │
38
+ ▼
39
+ 6. Integration Tests (API contracts, database migrations)
40
+ │
41
+ ▼
42
+ 7. Security Audit (npm audit, trivy, dependency vulnerability checks)
43
+ │
44
+ ▼
45
+ 8. Bundle Budget (bundle size checks against baseline thresholds)
46
+ │
47
+ ▼
48
+ Merge Allowed
49
+ ```
50
+
51
+ ## Hardened Pipeline Standards
52
+
53
+ 1. **Least-Privilege Token Permissions**:
54
+ Explicitly declare workflow and job permissions at the top of the workflow file. Default to read-only access:
55
+ ```yaml
56
+ permissions:
57
+ contents: read
58
+ ```
59
+ 2. **Deterministic Dependency Installation**:
60
+ Always use frozen lockfiles (`npm ci` instead of `npm install`, `uv sync --frozen` instead of `pip install`).
61
+ 3. **Concurrency Cancellation**:
62
+ Automatically cancel in-progress runs when a newer commit is pushed to the same Pull Request branch:
63
+ ```yaml
64
+ concurrency:
65
+ group: ${{ github.workflow }}-${{ github.ref }}
66
+ cancel-in-progress: true
67
+ ```
68
+ 4. **Action Pinning**:
69
+ Reference trusted actions using verified release tags (e.g. `actions/checkout@v4`) or full commit SHAs.