contextos-agents 1.7.0 → 2.0.0-beta.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 (309) hide show
  1. package/.agents/AGENTS.md +1 -1
  2. package/.agents/adapters/aider/export.js +117 -99
  3. package/.agents/adapters/claude/export.js +68 -26
  4. package/.agents/adapters/copilot/export.js +90 -53
  5. package/.agents/adapters/cursor/export.js +80 -101
  6. package/.agents/adapters/drift-detector.js +196 -0
  7. package/.agents/adapters/gemini/export.js +76 -45
  8. package/.agents/adapters/pure-compiler.js +443 -0
  9. package/.agents/adapters/zed/export.js +104 -96
  10. package/.agents/compiled/registry.v2.json +504 -0
  11. package/.agents/compiled/registry.v2.sha256 +1 -0
  12. package/.agents/compiler/manifest-compiler.js +963 -0
  13. package/.agents/compiler/vendor/yaml.LICENSE.txt +13 -0
  14. package/.agents/compiler/vendor/yaml.SBOM.json +6 -0
  15. package/.agents/compiler/vendor/yaml.js +139 -0
  16. package/.agents/core/profiles/init.yaml +25 -0
  17. package/.agents/core/skills/context-manager/skill.yaml +3 -5
  18. package/.agents/core/skills/context-os/SKILL.md +3 -6
  19. package/.agents/core/skills/context-os/skill.yaml +3 -8
  20. package/.agents/core/skills/engineering-workflow/skill.yaml +1 -7
  21. package/.agents/core/skills/gemini-precision/skill.yaml +1 -6
  22. package/.agents/core/skills/gstack-roles/skill.yaml +3 -6
  23. package/.agents/core/skills/ponytail-mindset/skill.yaml +1 -7
  24. package/.agents/core/skills/security/skill.yaml +15 -3
  25. package/.agents/ctx.js +574 -111
  26. package/.agents/customization-dx.js +282 -0
  27. package/.agents/doctor.js +719 -64
  28. package/.agents/filesystem/index.js +71 -0
  29. package/.agents/filesystem/journaled-transaction.js +451 -0
  30. package/.agents/filesystem/lockfile-v2.js +275 -0
  31. package/.agents/filesystem/platform-hardening.js +222 -0
  32. package/.agents/filesystem/project-lock.js +218 -0
  33. package/.agents/filesystem/safe-path.js +256 -0
  34. package/.agents/generated/claude/skills/context-os/SKILL.md +1 -1
  35. package/.agents/generated/gemini/skills/context-os/SKILL.md +2 -2
  36. package/.agents/plugins/contextos/plugin.json +1 -1
  37. package/.agents/plugins.js +259 -60
  38. package/.agents/profiles.js +486 -51
  39. package/.agents/resolver.js +50 -534
  40. package/.agents/schemas/attestation.review.v1.json +111 -0
  41. package/.agents/schemas/attestation.verification.v1.json +85 -0
  42. package/.agents/schemas/lockfile.v2.schema.json +134 -0
  43. package/.agents/schemas/profile.v2.schema.json +114 -0
  44. package/.agents/schemas/runtime.thread.v1.json +192 -0
  45. package/.agents/schemas/skill.manifest.v2.json +177 -0
  46. package/.agents/schemas/verification.spec.v1.json +39 -0
  47. package/.agents/schemas/workspace.graph.schema.json +106 -0
  48. package/.agents/transaction-core/event-store.js +288 -0
  49. package/.agents/transaction-core/idempotency.js +129 -0
  50. package/.agents/transaction-core/ipc-lock.js +311 -0
  51. package/.agents/transaction-core/plugin-supply-chain-bundle.js +436 -0
  52. package/.agents/validate.js +44 -1
  53. package/.agents/watch.js +354 -102
  54. package/.agents/workspace/workspace-graph.js +778 -0
  55. package/README.md +59 -387
  56. package/benchmarks/v2/analysis/statistics.js +140 -0
  57. package/benchmarks/v2/analysis/stats.js +69 -0
  58. package/benchmarks/v2/arms/arm-definitions.js +79 -0
  59. package/benchmarks/v2/dataset.schema.json +34 -0
  60. package/benchmarks/v2/evaluators/index.js +25 -0
  61. package/benchmarks/v2/evaluators/verified-success.js +116 -0
  62. package/benchmarks/v2/harness/runner.js +88 -0
  63. package/benchmarks/v2/pilot-tasks.json +392 -0
  64. package/bin/commands/recover.js +88 -0
  65. package/bin/commands/update.js +80 -17
  66. package/bin/commands.js +62 -25
  67. package/bin/index.js +138 -81
  68. package/bin/lib/lockfile.js +5 -3
  69. package/bin/lib/safe-writer.js +34 -3
  70. package/package.json +85 -72
  71. package/registry.json +2 -2
  72. package/registry.v2.schema.json +86 -0
  73. package/.agents/core/profiles/backend.yaml +0 -47
  74. package/.agents/core/profiles/enterprise.yaml +0 -46
  75. package/.agents/core/profiles/frontend.yaml +0 -46
  76. package/.agents/core/profiles/hackathon.yaml +0 -45
  77. package/.agents/core/profiles/mvp.yaml +0 -44
  78. package/.agents/core/profiles/startup.yaml +0 -48
  79. package/.agents/core/skills/adapters/EXAMPLES.md +0 -19
  80. package/.agents/core/skills/adapters/SKILL.md +0 -105
  81. package/.agents/core/skills/adapters/TROUBLESHOOTING.md +0 -7
  82. package/.agents/core/skills/adapters/VALIDATION.json +0 -12
  83. package/.agents/core/skills/adapters/skill.yaml +0 -16
  84. package/.agents/core/skills/architecture-diagrams/SKILL.md +0 -108
  85. package/.agents/core/skills/architecture-diagrams/VALIDATION.json +0 -12
  86. package/.agents/core/skills/architecture-diagrams/skill.yaml +0 -12
  87. package/.agents/core/skills/brutalist-design/SKILL.md +0 -150
  88. package/.agents/core/skills/brutalist-design/VALIDATION.json +0 -12
  89. package/.agents/core/skills/brutalist-design/skill.yaml +0 -12
  90. package/.agents/core/skills/database/EXAMPLES.md +0 -74
  91. package/.agents/core/skills/database/SKILL.md +0 -101
  92. package/.agents/core/skills/database/TROUBLESHOOTING.md +0 -18
  93. package/.agents/core/skills/database/VALIDATION.json +0 -11
  94. package/.agents/core/skills/database/skill.yaml +0 -31
  95. package/.agents/core/skills/ddd/EXAMPLES.md +0 -42
  96. package/.agents/core/skills/ddd/SKILL.md +0 -247
  97. package/.agents/core/skills/ddd/TROUBLESHOOTING.md +0 -19
  98. package/.agents/core/skills/ddd/VALIDATION.json +0 -12
  99. package/.agents/core/skills/ddd/ddd.md +0 -178
  100. package/.agents/core/skills/ddd/skill.yaml +0 -17
  101. package/.agents/core/skills/decisions/EXAMPLES.md +0 -35
  102. package/.agents/core/skills/decisions/SKILL.md +0 -90
  103. package/.agents/core/skills/decisions/TROUBLESHOOTING.md +0 -13
  104. package/.agents/core/skills/decisions/VALIDATION.json +0 -12
  105. package/.agents/core/skills/decisions/skill.yaml +0 -16
  106. package/.agents/core/skills/docker/EXAMPLES.md +0 -56
  107. package/.agents/core/skills/docker/SKILL.md +0 -63
  108. package/.agents/core/skills/docker/TROUBLESHOOTING.md +0 -18
  109. package/.agents/core/skills/docker/VALIDATION.json +0 -11
  110. package/.agents/core/skills/docker/skill.yaml +0 -29
  111. package/.agents/core/skills/fastapi/EXAMPLES.md +0 -36
  112. package/.agents/core/skills/fastapi/SKILL.md +0 -148
  113. package/.agents/core/skills/fastapi/TROUBLESHOOTING.md +0 -19
  114. package/.agents/core/skills/fastapi/VALIDATION.json +0 -12
  115. package/.agents/core/skills/fastapi/fastapi.md +0 -112
  116. package/.agents/core/skills/fastapi/skill.yaml +0 -17
  117. package/.agents/core/skills/generators/EXAMPLES.md +0 -19
  118. package/.agents/core/skills/generators/SKILL.md +0 -112
  119. package/.agents/core/skills/generators/TROUBLESHOOTING.md +0 -7
  120. package/.agents/core/skills/generators/VALIDATION.json +0 -12
  121. package/.agents/core/skills/generators/skill.yaml +0 -25
  122. package/.agents/core/skills/generators/templates/API.md +0 -77
  123. package/.agents/core/skills/generators/templates/ARCHITECTURE.md +0 -70
  124. package/.agents/core/skills/generators/templates/DATABASE.md +0 -42
  125. package/.agents/core/skills/generators/templates/DECISION.md +0 -46
  126. package/.agents/core/skills/generators/templates/PRD.md +0 -67
  127. package/.agents/core/skills/generators/templates/PROJECT_GRAPH.md +0 -56
  128. package/.agents/core/skills/generators/templates/ROADMAP.md +0 -51
  129. package/.agents/core/skills/generators/templates/TASKS.md +0 -43
  130. package/.agents/core/skills/generators/templates/UI.md +0 -73
  131. package/.agents/core/skills/graphify/EXAMPLES.md +0 -73
  132. package/.agents/core/skills/graphify/SKILL.md +0 -130
  133. package/.agents/core/skills/graphify/VALIDATION.json +0 -12
  134. package/.agents/core/skills/graphify/skill.yaml +0 -18
  135. package/.agents/core/skills/impeccable-design/EXAMPLES.md +0 -26
  136. package/.agents/core/skills/impeccable-design/SKILL.md +0 -201
  137. package/.agents/core/skills/impeccable-design/TROUBLESHOOTING.md +0 -19
  138. package/.agents/core/skills/impeccable-design/VALIDATION.json +0 -12
  139. package/.agents/core/skills/impeccable-design/skill.yaml +0 -20
  140. package/.agents/core/skills/interview-me/SKILL.md +0 -97
  141. package/.agents/core/skills/interview-me/VALIDATION.json +0 -12
  142. package/.agents/core/skills/interview-me/skill.yaml +0 -12
  143. package/.agents/core/skills/microservices/EXAMPLES.md +0 -38
  144. package/.agents/core/skills/microservices/SKILL.md +0 -164
  145. package/.agents/core/skills/microservices/TROUBLESHOOTING.md +0 -19
  146. package/.agents/core/skills/microservices/VALIDATION.json +0 -12
  147. package/.agents/core/skills/microservices/microservices.md +0 -119
  148. package/.agents/core/skills/microservices/skill.yaml +0 -17
  149. package/.agents/core/skills/minimalist-design/SKILL.md +0 -113
  150. package/.agents/core/skills/minimalist-design/VALIDATION.json +0 -12
  151. package/.agents/core/skills/minimalist-design/skill.yaml +0 -12
  152. package/.agents/core/skills/nestjs/EXAMPLES.md +0 -40
  153. package/.agents/core/skills/nestjs/SKILL.md +0 -139
  154. package/.agents/core/skills/nestjs/TROUBLESHOOTING.md +0 -19
  155. package/.agents/core/skills/nestjs/VALIDATION.json +0 -12
  156. package/.agents/core/skills/nestjs/nestjs.md +0 -103
  157. package/.agents/core/skills/nestjs/skill.yaml +0 -17
  158. package/.agents/core/skills/nextjs/EXAMPLES.md +0 -40
  159. package/.agents/core/skills/nextjs/SKILL.md +0 -163
  160. package/.agents/core/skills/nextjs/TROUBLESHOOTING.md +0 -19
  161. package/.agents/core/skills/nextjs/VALIDATION.json +0 -12
  162. package/.agents/core/skills/nextjs/nextjs.md +0 -67
  163. package/.agents/core/skills/nextjs/skill.yaml +0 -17
  164. package/.agents/core/skills/node/EXAMPLES.md +0 -80
  165. package/.agents/core/skills/node/SKILL.md +0 -128
  166. package/.agents/core/skills/node/TROUBLESHOOTING.md +0 -19
  167. package/.agents/core/skills/node/VALIDATION.json +0 -12
  168. package/.agents/core/skills/node/node.md +0 -87
  169. package/.agents/core/skills/node/skill.yaml +0 -17
  170. package/.agents/core/skills/performance/EXAMPLES.md +0 -30
  171. package/.agents/core/skills/performance/SKILL.md +0 -75
  172. package/.agents/core/skills/performance/TROUBLESHOOTING.md +0 -19
  173. package/.agents/core/skills/performance/VALIDATION.json +0 -12
  174. package/.agents/core/skills/performance/performance.md +0 -52
  175. package/.agents/core/skills/performance/skill.yaml +0 -17
  176. package/.agents/core/skills/react/EXAMPLES.md +0 -79
  177. package/.agents/core/skills/react/SKILL.md +0 -132
  178. package/.agents/core/skills/react/TROUBLESHOOTING.md +0 -19
  179. package/.agents/core/skills/react/VALIDATION.json +0 -12
  180. package/.agents/core/skills/react/react.md +0 -93
  181. package/.agents/core/skills/react/skill.yaml +0 -17
  182. package/.agents/core/skills/react-best-practices/SKILL.md +0 -155
  183. package/.agents/core/skills/react-best-practices/VALIDATION.json +0 -12
  184. package/.agents/core/skills/react-best-practices/skill.yaml +0 -14
  185. package/.agents/core/skills/redesign-audit/SKILL.md +0 -117
  186. package/.agents/core/skills/redesign-audit/VALIDATION.json +0 -12
  187. package/.agents/core/skills/redesign-audit/skill.yaml +0 -12
  188. package/.agents/core/skills/soft-design/SKILL.md +0 -108
  189. package/.agents/core/skills/soft-design/VALIDATION.json +0 -12
  190. package/.agents/core/skills/soft-design/skill.yaml +0 -12
  191. package/.agents/core/skills/state-management/EXAMPLES.md +0 -56
  192. package/.agents/core/skills/state-management/SKILL.md +0 -48
  193. package/.agents/core/skills/state-management/TROUBLESHOOTING.md +0 -18
  194. package/.agents/core/skills/state-management/VALIDATION.json +0 -11
  195. package/.agents/core/skills/state-management/skill.yaml +0 -28
  196. package/.agents/core/skills/subagent-orchestrator/SKILL.md +0 -117
  197. package/.agents/core/skills/subagent-orchestrator/VALIDATION.json +0 -12
  198. package/.agents/core/skills/subagent-orchestrator/skill.yaml +0 -12
  199. package/.agents/core/skills/system-design/EXAMPLES.md +0 -75
  200. package/.agents/core/skills/system-design/SKILL.md +0 -419
  201. package/.agents/core/skills/system-design/TROUBLESHOOTING.md +0 -19
  202. package/.agents/core/skills/system-design/VALIDATION.json +0 -12
  203. package/.agents/core/skills/system-design/skill.yaml +0 -20
  204. package/.agents/core/skills/system-design/system-design.md +0 -112
  205. package/.agents/core/skills/testing/EXAMPLES.md +0 -71
  206. package/.agents/core/skills/testing/SKILL.md +0 -70
  207. package/.agents/core/skills/testing/TROUBLESHOOTING.md +0 -18
  208. package/.agents/core/skills/testing/VALIDATION.json +0 -11
  209. package/.agents/core/skills/testing/skill.yaml +0 -32
  210. package/.agents/core/skills/typescript/EXAMPLES.md +0 -64
  211. package/.agents/core/skills/typescript/SKILL.md +0 -112
  212. package/.agents/core/skills/typescript/TROUBLESHOOTING.md +0 -19
  213. package/.agents/core/skills/typescript/VALIDATION.json +0 -12
  214. package/.agents/core/skills/typescript/skill.yaml +0 -17
  215. package/.agents/core/skills/typescript/typescript.md +0 -71
  216. package/.agents/core/skills/ui-design/EXAMPLES.md +0 -21
  217. package/.agents/core/skills/ui-design/SKILL.md +0 -124
  218. package/.agents/core/skills/ui-design/TROUBLESHOOTING.md +0 -19
  219. package/.agents/core/skills/ui-design/VALIDATION.json +0 -12
  220. package/.agents/core/skills/ui-design/skill.yaml +0 -17
  221. package/.agents/core/skills/ui-design/ui.md +0 -88
  222. package/.agents/core/skills/ui-ux-pro/EXAMPLES.md +0 -62
  223. package/.agents/core/skills/ui-ux-pro/SKILL.md +0 -375
  224. package/.agents/core/skills/ui-ux-pro/TROUBLESHOOTING.md +0 -19
  225. package/.agents/core/skills/ui-ux-pro/VALIDATION.json +0 -12
  226. package/.agents/core/skills/ui-ux-pro/skill.yaml +0 -19
  227. package/.agents/core/skills/ux-design/EXAMPLES.md +0 -36
  228. package/.agents/core/skills/ux-design/SKILL.md +0 -116
  229. package/.agents/core/skills/ux-design/TROUBLESHOOTING.md +0 -19
  230. package/.agents/core/skills/ux-design/VALIDATION.json +0 -12
  231. package/.agents/core/skills/ux-design/skill.yaml +0 -17
  232. package/.agents/core/skills/ux-design/ux.md +0 -80
  233. package/.agents/core/skills/vercel-optimize/SKILL.md +0 -83
  234. package/.agents/core/skills/vercel-optimize/VALIDATION.json +0 -12
  235. package/.agents/core/skills/vercel-optimize/scripts/collect-signals.mjs +0 -131
  236. package/.agents/core/skills/vercel-optimize/scripts/gate-investigations.mjs +0 -142
  237. package/.agents/core/skills/vercel-optimize/scripts/merge-signals.mjs +0 -143
  238. package/.agents/core/skills/vercel-optimize/scripts/scan-codebase.mjs +0 -174
  239. package/.agents/core/skills/vercel-optimize/skill.yaml +0 -18
  240. package/.agents/core/skills/web-accessibility/EXAMPLES.md +0 -39
  241. package/.agents/core/skills/web-accessibility/SKILL.md +0 -170
  242. package/.agents/core/skills/web-accessibility/TROUBLESHOOTING.md +0 -19
  243. package/.agents/core/skills/web-accessibility/VALIDATION.json +0 -12
  244. package/.agents/core/skills/web-accessibility/accessibility.md +0 -63
  245. package/.agents/core/skills/web-accessibility/skill.yaml +0 -17
  246. package/.agents/generated/claude/skills/adapters/SKILL.md +0 -126
  247. package/.agents/generated/claude/skills/architecture-diagrams/SKILL.md +0 -101
  248. package/.agents/generated/claude/skills/brutalist-design/SKILL.md +0 -145
  249. package/.agents/generated/claude/skills/database/SKILL.md +0 -191
  250. package/.agents/generated/claude/skills/ddd/SKILL.md +0 -305
  251. package/.agents/generated/claude/skills/decisions/SKILL.md +0 -134
  252. package/.agents/generated/claude/skills/docker/SKILL.md +0 -135
  253. package/.agents/generated/claude/skills/fastapi/SKILL.md +0 -200
  254. package/.agents/generated/claude/skills/generators/SKILL.md +0 -133
  255. package/.agents/generated/claude/skills/graphify/SKILL.md +0 -198
  256. package/.agents/generated/claude/skills/impeccable-design/SKILL.md +0 -241
  257. package/.agents/generated/claude/skills/interview-me/SKILL.md +0 -90
  258. package/.agents/generated/claude/skills/microservices/SKILL.md +0 -218
  259. package/.agents/generated/claude/skills/minimalist-design/SKILL.md +0 -108
  260. package/.agents/generated/claude/skills/nestjs/SKILL.md +0 -195
  261. package/.agents/generated/claude/skills/nextjs/SKILL.md +0 -219
  262. package/.agents/generated/claude/skills/node/SKILL.md +0 -224
  263. package/.agents/generated/claude/skills/performance/SKILL.md +0 -121
  264. package/.agents/generated/claude/skills/react/SKILL.md +0 -227
  265. package/.agents/generated/claude/skills/react-best-practices/SKILL.md +0 -146
  266. package/.agents/generated/claude/skills/redesign-audit/SKILL.md +0 -112
  267. package/.agents/generated/claude/skills/soft-design/SKILL.md +0 -103
  268. package/.agents/generated/claude/skills/state-management/SKILL.md +0 -120
  269. package/.agents/generated/claude/skills/subagent-orchestrator/SKILL.md +0 -110
  270. package/.agents/generated/claude/skills/system-design/SKILL.md +0 -507
  271. package/.agents/generated/claude/skills/testing/SKILL.md +0 -157
  272. package/.agents/generated/claude/skills/typescript/SKILL.md +0 -192
  273. package/.agents/generated/claude/skills/ui-design/SKILL.md +0 -161
  274. package/.agents/generated/claude/skills/ui-ux-pro/SKILL.md +0 -451
  275. package/.agents/generated/claude/skills/ux-design/SKILL.md +0 -168
  276. package/.agents/generated/claude/skills/vercel-optimize/SKILL.md +0 -76
  277. package/.agents/generated/claude/skills/web-accessibility/SKILL.md +0 -225
  278. package/.agents/generated/gemini/skills/adapters/SKILL.md +0 -135
  279. package/.agents/generated/gemini/skills/architecture-diagrams/SKILL.md +0 -107
  280. package/.agents/generated/gemini/skills/brutalist-design/SKILL.md +0 -151
  281. package/.agents/generated/gemini/skills/database/SKILL.md +0 -200
  282. package/.agents/generated/gemini/skills/ddd/SKILL.md +0 -314
  283. package/.agents/generated/gemini/skills/decisions/SKILL.md +0 -143
  284. package/.agents/generated/gemini/skills/docker/SKILL.md +0 -144
  285. package/.agents/generated/gemini/skills/fastapi/SKILL.md +0 -209
  286. package/.agents/generated/gemini/skills/generators/SKILL.md +0 -142
  287. package/.agents/generated/gemini/skills/graphify/SKILL.md +0 -205
  288. package/.agents/generated/gemini/skills/impeccable-design/SKILL.md +0 -250
  289. package/.agents/generated/gemini/skills/interview-me/SKILL.md +0 -96
  290. package/.agents/generated/gemini/skills/microservices/SKILL.md +0 -227
  291. package/.agents/generated/gemini/skills/minimalist-design/SKILL.md +0 -114
  292. package/.agents/generated/gemini/skills/nestjs/SKILL.md +0 -204
  293. package/.agents/generated/gemini/skills/nextjs/SKILL.md +0 -298
  294. package/.agents/generated/gemini/skills/node/SKILL.md +0 -323
  295. package/.agents/generated/gemini/skills/performance/SKILL.md +0 -185
  296. package/.agents/generated/gemini/skills/react/SKILL.md +0 -332
  297. package/.agents/generated/gemini/skills/react-best-practices/SKILL.md +0 -152
  298. package/.agents/generated/gemini/skills/redesign-audit/SKILL.md +0 -118
  299. package/.agents/generated/gemini/skills/soft-design/SKILL.md +0 -109
  300. package/.agents/generated/gemini/skills/state-management/SKILL.md +0 -129
  301. package/.agents/generated/gemini/skills/subagent-orchestrator/SKILL.md +0 -116
  302. package/.agents/generated/gemini/skills/system-design/SKILL.md +0 -631
  303. package/.agents/generated/gemini/skills/testing/SKILL.md +0 -166
  304. package/.agents/generated/gemini/skills/typescript/SKILL.md +0 -275
  305. package/.agents/generated/gemini/skills/ui-design/SKILL.md +0 -170
  306. package/.agents/generated/gemini/skills/ui-ux-pro/SKILL.md +0 -460
  307. package/.agents/generated/gemini/skills/ux-design/SKILL.md +0 -177
  308. package/.agents/generated/gemini/skills/vercel-optimize/SKILL.md +0 -82
  309. package/.agents/generated/gemini/skills/web-accessibility/SKILL.md +0 -300
@@ -1,192 +0,0 @@
1
- # TypeScript
2
-
3
- ## Overview
4
-
5
- Strict TypeScript engineering standard. Enforces noImplicitAny, discriminated unions, branded types, immutability, exhaustive switch checks, and zero unsafe any or as unknown as T casts.
6
-
7
- ## When to Use
8
-
9
- Activate on all TypeScript and JavaScript codebases to ensure compile-time type safety, robust domain modeling, and foolproof function contracts.
10
-
11
- ## Negative Constraints (What NOT to Do)
12
-
13
- 1. **NEVER use `any`**: Use `unknown` with type guards, discriminated unions, or Zod schemas.
14
- 2. **NEVER use type assertions (`as Type` or `as unknown as Type`) to bypass safety**: Fix the underlying type signature or use runtime narrowing (`instanceof`, `typeof`, `in`).
15
- 3. **NEVER use non-null assertions (`foo!.bar`)**: Handle `null` and `undefined` with optional chaining (`?.`) or explicit error guards.
16
- 4. **NEVER export mutable global arrays or object constants**: Always mark constant objects and arrays with `as const` and `readonly`.
17
- 5. **NEVER omit explicit return types on exported functions**: Exported public APIs must declare explicit return types to protect consumers.
18
-
19
- ## Rules & Patterns
20
-
21
- ## Strict Mode
22
-
23
- Always use strict TypeScript configuration:
24
-
25
- ```json
26
- {
27
- "compilerOptions": {
28
- "strict": true,
29
- "noUncheckedIndexedAccess": true,
30
- "noImplicitReturns": true,
31
- "noFallthroughCasesInSwitch": true
32
- }
33
- }
34
- ```
35
-
36
- ## Types
37
-
38
- - **Prefer `interface`** for object shapes, `type` for unions/intersections
39
- - **No `any`** — use `unknown` if type is truly unknown, then narrow
40
- - **Explicit return types** for exported functions
41
- - **Const assertions** — `as const` for literal types
42
-
43
- ```typescript
44
- // Good
45
- interface User {
46
- id: string;
47
- name: string;
48
- role: 'admin' | 'user';
49
- }
50
-
51
- // Unions
52
- type Result<T> = { ok: true; data: T } | { ok: false; error: string };
53
- ```
54
-
55
- ## Utility Types
56
-
57
- - `Partial<T>` — all properties optional
58
- - `Required<T>` — all properties required
59
- - `Pick<T, K>` — select specific properties
60
- - `Omit<T, K>` — remove specific properties
61
- - `Record<K, V>` — key-value map
62
-
63
- ## Type Guards
64
-
65
- ```typescript
66
- function isUser(value: unknown): value is User {
67
- return typeof value === 'object' && value !== null && 'id' in value;
68
- }
69
- ```
70
-
71
- ## Generic Patterns
72
-
73
- ```typescript
74
- // Repository pattern
75
- interface Repository<T extends { id: string }> {
76
- findById(id: string): Promise<T | null>;
77
- create(data: Omit<T, 'id'>): Promise<T>;
78
- update(id: string, data: Partial<T>): Promise<T>;
79
- delete(id: string): Promise<void>;
80
- }
81
- ```
82
-
83
- ## Anti-Patterns
84
-
85
- - [FAIL] `any` — use `unknown` + type guards
86
- - [FAIL] Type assertions (`as`) — prefer type guards
87
- - [FAIL] Non-null assertions (`!`) — handle null explicitly
88
- - [FAIL] Enums — prefer union types or `as const` objects
89
- - [FAIL] Complex generics without JSDoc — document intent
90
-
91
-
92
- ## Code Examples
93
-
94
- See `EXAMPLES.md` for detailed code examples.
95
-
96
- ## Validation Checklist
97
-
98
- What to verify during the review phase before completing the task.
99
-
100
- ## Common Mistakes
101
-
102
- Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
103
-
104
- ## Integration Notes
105
-
106
- How this skill interacts with other skills.
107
-
108
-
109
- # TypeScript Examples — Anti-patterns vs ContextOS Standard
110
-
111
- ## Example 1: Type-Safe Parsing with Zod (No `any`)
112
-
113
- ### Anti-pattern: Anti-pattern (Blind type assertion with `as`)
114
-
115
- ```typescript
116
- // BAD: using 'as User' bypasses runtime validation completely
117
- async function fetchUser(id: string): Promise<User> {
118
- const res = await fetch(`/api/users/${id}`);
119
- const data = await res.json();
120
- return data as User; // Runtime crash if payload changes!
121
- }
122
- ```
123
-
124
- ### Best practice: ContextOS Standard (Runtime schema validation with Zod)
125
-
126
- ```typescript
127
- // GOOD: guaranteed runtime and compile-time type safety
128
- import { z } from 'zod';
129
-
130
- export const UserSchema = z.object({
131
- id: z.string().uuid(),
132
- name: z.string().min(1),
133
- email: z.string().email(),
134
- role: z.enum(['admin', 'member', 'guest']),
135
- createdAt: z.string().datetime(),
136
- });
137
-
138
- export type User = z.infer<typeof UserSchema>;
139
-
140
- export async function fetchUser(id: string): Promise<User> {
141
- const res = await fetch(`/api/users/${id}`);
142
- if (!res.ok) throw new Error(`Fetch failed with status ${res.status}`);
143
- const raw: unknown = await res.json();
144
- return UserSchema.parse(raw);
145
- }
146
- ```
147
-
148
- ---
149
-
150
- ## Example 2: Discriminated Unions for State Handling
151
-
152
- ### Anti-pattern: Anti-pattern (Optional soup with boolean flags)
153
-
154
- ```typescript
155
- // BAD: impossible states can be represented (e.g. isLoading: true AND error: 'Failed')
156
- interface AsyncState<T> {
157
- data?: T;
158
- isLoading: boolean;
159
- error?: string;
160
- }
161
- ```
162
-
163
- ### Best practice: ContextOS Standard (Discriminated Union)
164
-
165
- ```typescript
166
- // GOOD: impossible states are impossible at compile-time
167
- export type AsyncState<T> =
168
- | { readonly status: 'idle' }
169
- | { readonly status: 'loading' }
170
- | { readonly status: 'success'; readonly data: T }
171
- | { readonly status: 'error'; readonly error: Error };
172
- ```
173
-
174
- # typescript Troubleshooting & Common Mistakes
175
-
176
- ## 1. Excessive Use of `any` or `as unknown as T`
177
-
178
- - **Symptom**: Runtime `TypeError: Cannot read properties of undefined` in supposedly typed TypeScript code.
179
- - **Root Cause**: Bypassing type checking with `any` or forceful type assertions.
180
- - **Fix**: Use `unknown` with type guards, Zod schemas, or discriminated unions.
181
-
182
- ## 2. Non-Exhaustive Switch on Unions
183
-
184
- - **Symptom**: New union member added but some switch statements fail to handle it, producing bugs.
185
- - **Root Cause**: Missing exhaustive type checking in `default:` case.
186
- - **Fix**: Add `default: const _exhaustive: never = action; throw new Error(_exhaustive);` to let the compiler catch missing branches.
187
-
188
- ## 3. Inaccurate Generics Constraints
189
-
190
- - **Symptom**: Generic functions that lose type inference and resolve to `unknown`.
191
- - **Root Cause**: Over-specifying generics or missing `extends` constraints.
192
- - **Fix**: Constrain generics narrowly: `function get<T, K extends keyof T>(obj: T, key: K): T[K]`.
@@ -1,161 +0,0 @@
1
- # UI Design
2
-
3
- ## Overview
4
-
5
- Modern component library and design system engineering. Enforces design token hierarchies (spacing, radii, elevation), accessible component primitives (shadcn/ui, Radix), and responsive layout constraints.
6
-
7
- ## When to Use
8
-
9
- Activate when designing design systems, reusable UI component libraries, navigation bars, modals, data tables, and interactive dashboards.
10
-
11
- ## Rules & Patterns
12
- <!-- Source: ui.md -->
13
-
14
- ## UI Design — Best Practices
15
-
16
- ## Design System Foundations
17
-
18
- ### Color
19
-
20
- - **Never use generic colors** — curate a harmonious palette
21
- - **Always tint** — no pure black (#000), no pure gray. Add a subtle warm or cool tint
22
- - **Color roles**: primary (action), secondary (accent), neutral (text, borders), semantic (error, success, warning, info)
23
- - **Dark mode**: design intentionally, not just invert. Surface hierarchy: background < surface < elevated
24
- - **Contrast**: 4.5:1 minimum for body text, 3:1 for large text
25
-
26
- ### Typography
27
-
28
- - **Never use browser defaults** — choose a curated font (Inter, Outfit, Geist, Sora)
29
- - **Type scale**: use a modular scale (1.25 ratio) — 12, 14, 16, 20, 24, 32, 40, 48
30
- - **Font weights**: Regular (400), Medium (500), Semibold (600), Bold (700). Don't use all of them — pick 2-3
31
- - **Line height**: 1.5 for body, 1.2 for headings, 1.6 for long-form text
32
- - **Max line width**: 65-75 characters for readability
33
-
34
- ### Spacing
35
-
36
- - **Use a 4px grid** — all spacing should be multiples of 4
37
- - **Spacing scale**: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96
38
- - **Consistency** — same spacing between similar elements
39
- - **Whitespace is design** — don't fill every pixel
40
-
41
- ### Layout
42
-
43
- - **Grid system**: 12-column grid for desktop, 4-column for mobile
44
- - **Visual hierarchy**: size, weight, color, spacing, position
45
- - **F-pattern/Z-pattern** — for content-heavy pages
46
- - **Group related items** — use proximity and boundaries
47
-
48
- ## Component Patterns
49
-
50
- ### Buttons
51
-
52
- - Clear hierarchy: Primary > Secondary > Ghost/Text
53
- - Consistent sizing: sm (32px), md (40px), lg (48px)
54
- - States: default, hover, active, disabled, loading
55
- - Always accessible: sufficient contrast, focus indicator
56
-
57
- ### Forms
58
-
59
- - Labels above inputs (not floating labels for critical forms)
60
- - Clear error states with inline messages
61
- - Logical tab order
62
- - Progressive disclosure — don't show all fields at once
63
-
64
- ### Cards
65
-
66
- - Don't nest cards inside cards
67
- - Clear visual hierarchy within the card
68
- - Consistent padding and spacing
69
- - Interactive cards need hover state
70
-
71
- ### Navigation
72
-
73
- - Maximum 7±2 items in primary nav
74
- - Clear active state
75
- - Mobile: bottom nav or hamburger (not both)
76
- - Breadcrumbs for deep hierarchies
77
-
78
- ## Animation Principles
79
-
80
- - **Purpose**: guide attention, show relationships, provide feedback
81
- - **Duration**: 150-300ms for micro-interactions, 300-500ms for transitions
82
- - **Easing**: `ease-out` for entrances, `ease-in` for exits. Never `bounce` or `elastic`
83
- - **Reduce motion**: respect `prefers-reduced-motion`
84
-
85
- ## Anti-Patterns (from Impeccable)
86
-
87
- - [FAIL] Gray text on colored backgrounds — destroys readability
88
- - [FAIL] Pure black text on white (#000 on #fff) — too harsh, tint the black
89
- - [FAIL] Cards nested inside cards — visual noise
90
- - [FAIL] Bounce/elastic easing — feels dated
91
- - [FAIL] Icon tile above every heading — SaaS template tell
92
- - [FAIL] Purple-to-blue gradient on everything — overused
93
- - [FAIL] Using Inter for everything — pick a font that matches your brand
94
- - [FAIL] Rounded-square icons everywhere — lack of visual variety
95
-
96
- ## Dark Mode
97
-
98
- - Surface elevation through subtle lightening (not colored backgrounds)
99
- - Reduce white contrast — use #E0E0E0, not #FFFFFF
100
- - Shadows become less visible — use subtle borders or elevation changes
101
- - Test all states in both modes
102
-
103
-
104
- ## Code Examples
105
-
106
- See `EXAMPLES.md` for detailed code examples.
107
-
108
- ## Validation Checklist
109
-
110
- What to verify during the review phase before completing the task.
111
-
112
- ## Common Mistakes
113
-
114
- Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
115
-
116
- ## Integration Notes
117
-
118
- How this skill interacts with other skills.
119
-
120
-
121
- # ui-design Examples — Anti-patterns vs ContextOS Standard
122
-
123
- ## Example 1: Component Token Consistency
124
-
125
- ### Anti-pattern: Hardcoded Arbitrary Tailwind Utilities
126
-
127
- ```tsx
128
- // BAD: Inconsistent spacing, arbitrary colors, unmaintainable styling
129
- <div className="p-[13px] bg-[#1a1b2e] rounded-[7px] text-[#99aab5] border border-[#2b2d42]">
130
- <button className="px-[15px] py-[7px] bg-[#5865f2] hover:bg-[#4752c4]">Action</button>
131
- </div>
132
- ```
133
-
134
- ### Best practice: ContextOS Standard (Semantic Theme Tokens)
135
-
136
- ```tsx
137
- // GOOD: Consistent scale utilities driven by Tailwind v4 @theme design tokens
138
- <div className="p-4 bg-card rounded-lg text-muted-foreground border border-border">
139
- <Button variant="primary" size="md">Action</Button>
140
- </div>
141
- ```
142
-
143
- # ui-design Troubleshooting & Common Mistakes
144
-
145
- ## 1. Z-Index Chaos
146
-
147
- - **Symptom**: Tooltips rendered underneath dialog overlays, or dropdowns hidden behind sticky headers.
148
- - **Root Cause**: Ad-hoc hardcoded values (z-50, z-[999], z-[9999]).
149
- - **Fix**: Use Radix / shadcn Portals for floating elements so they render at root DOM level, or declare strict z-index tokens.
150
-
151
- ## 2. Inconsistent Component States
152
-
153
- - **Symptom**: Buttons have hover states but lack focus-visible rings or disabled states.
154
- - **Root Cause**: Styling only the default and hover states.
155
- - **Fix**: Standardize state matrices for every interactive element: default, hover, focus-visible, active, disabled, loading.
156
-
157
- ## 3. Ignoring Empty and Error Component States
158
-
159
- - **Symptom**: Tables or list views show a blank white box when there are 0 records.
160
- - **Root Cause**: Developers only design for the "ideal data" case.
161
- - **Fix**: Every data component must explicitly render designed EmptyState and ErrorState fallbacks.