@kl-c/matrixos 0.3.39 → 0.3.41

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 (50) hide show
  1. package/dist/cli/index.js +69 -2
  2. package/dist/cli/skills/api-and-interface-design/SKILL.md +298 -0
  3. package/dist/cli/skills/browser-testing-with-devtools/SKILL.md +321 -0
  4. package/dist/cli/skills/ci-cd-and-automation/SKILL.md +394 -0
  5. package/dist/cli/skills/context-engineering/SKILL.md +293 -0
  6. package/dist/cli/skills/deprecation-and-migration/SKILL.md +251 -0
  7. package/dist/cli/skills/documentation-and-adrs/SKILL.md +292 -0
  8. package/dist/cli/skills/doubt-driven-development/SKILL.md +247 -0
  9. package/dist/cli/skills/incremental-implementation/SKILL.md +253 -0
  10. package/dist/cli/skills/interview-me/SKILL.md +229 -0
  11. package/dist/cli/skills/observability-and-instrumentation/SKILL.md +207 -0
  12. package/dist/cli/skills/performance-optimization/SKILL.md +354 -0
  13. package/dist/cli/skills/security-and-hardening/SKILL.md +471 -0
  14. package/dist/cli/skills/shipping-and-launch/SKILL.md +314 -0
  15. package/dist/cli/skills/source-driven-development/SKILL.md +198 -0
  16. package/dist/cli/skills/test-driven-development/SKILL.md +402 -0
  17. package/dist/cli-node/index.js +69 -2
  18. package/dist/index.js +68 -1
  19. package/dist/skills/api-and-interface-design/SKILL.md +298 -0
  20. package/dist/skills/browser-testing-with-devtools/SKILL.md +321 -0
  21. package/dist/skills/ci-cd-and-automation/SKILL.md +394 -0
  22. package/dist/skills/context-engineering/SKILL.md +293 -0
  23. package/dist/skills/deprecation-and-migration/SKILL.md +251 -0
  24. package/dist/skills/documentation-and-adrs/SKILL.md +292 -0
  25. package/dist/skills/doubt-driven-development/SKILL.md +247 -0
  26. package/dist/skills/incremental-implementation/SKILL.md +253 -0
  27. package/dist/skills/interview-me/SKILL.md +229 -0
  28. package/dist/skills/observability-and-instrumentation/SKILL.md +207 -0
  29. package/dist/skills/performance-optimization/SKILL.md +354 -0
  30. package/dist/skills/security-and-hardening/SKILL.md +471 -0
  31. package/dist/skills/shipping-and-launch/SKILL.md +314 -0
  32. package/dist/skills/source-driven-development/SKILL.md +198 -0
  33. package/dist/skills/test-driven-development/SKILL.md +402 -0
  34. package/dist/tui.js +68 -1
  35. package/package.json +1 -1
  36. package/packages/shared-skills/skills/api-and-interface-design/SKILL.md +298 -0
  37. package/packages/shared-skills/skills/browser-testing-with-devtools/SKILL.md +321 -0
  38. package/packages/shared-skills/skills/ci-cd-and-automation/SKILL.md +394 -0
  39. package/packages/shared-skills/skills/context-engineering/SKILL.md +293 -0
  40. package/packages/shared-skills/skills/deprecation-and-migration/SKILL.md +251 -0
  41. package/packages/shared-skills/skills/documentation-and-adrs/SKILL.md +292 -0
  42. package/packages/shared-skills/skills/doubt-driven-development/SKILL.md +247 -0
  43. package/packages/shared-skills/skills/incremental-implementation/SKILL.md +253 -0
  44. package/packages/shared-skills/skills/interview-me/SKILL.md +229 -0
  45. package/packages/shared-skills/skills/observability-and-instrumentation/SKILL.md +207 -0
  46. package/packages/shared-skills/skills/performance-optimization/SKILL.md +354 -0
  47. package/packages/shared-skills/skills/security-and-hardening/SKILL.md +471 -0
  48. package/packages/shared-skills/skills/shipping-and-launch/SKILL.md +314 -0
  49. package/packages/shared-skills/skills/source-driven-development/SKILL.md +198 -0
  50. package/packages/shared-skills/skills/test-driven-development/SKILL.md +402 -0
package/dist/cli/index.js CHANGED
@@ -2163,7 +2163,7 @@ var package_default;
2163
2163
  var init_package = __esm(() => {
2164
2164
  package_default = {
2165
2165
  name: "@kl-c/matrixos",
2166
- version: "0.3.39",
2166
+ version: "0.3.41",
2167
2167
  description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
2168
2168
  main: "./dist/index.js",
2169
2169
  types: "dist/index.d.ts",
@@ -9370,7 +9370,7 @@ var init_file_reference_resolver = __esm(() => {
9370
9370
  });
9371
9371
 
9372
9372
  // packages/model-core/src/agent-model-requirements.ts
9373
- var SISYPHUS_REQ, HEPHAESTUS_REQ, ORACLE_REQ, LIBRARIAN_REQ, EXPLORE_REQ, MULTIMODAL_REQ, PROMETHEUS_REQ, METIS_REQ, MOMUS_REQ, ATLAS_REQ, SISYPHUS_JUNIOR_REQ, AGENT_MODEL_REQUIREMENTS;
9373
+ var SISYPHUS_REQ, HEPHAESTUS_REQ, ORACLE_REQ, LIBRARIAN_REQ, EXPLORE_REQ, MULTIMODAL_REQ, PROMETHEUS_REQ, METIS_REQ, MOMUS_REQ, ATLAS_REQ, SISYPHUS_JUNIOR_REQ, TRINITY_REQ, CYPHER_REQ, SENTINEL_REQ, MOUSE_REQ, DREAMER_REQ, ARCHITECT_REQ, AGENT_MODEL_REQUIREMENTS;
9374
9374
  var init_agent_model_requirements = __esm(() => {
9375
9375
  SISYPHUS_REQ = {
9376
9376
  fallbackChain: [
@@ -9501,6 +9501,67 @@ var init_agent_model_requirements = __esm(() => {
9501
9501
  ],
9502
9502
  requiresAnyModel: true
9503
9503
  };
9504
+ TRINITY_REQ = {
9505
+ fallbackChain: [
9506
+ { providers: ["zen-1", "opencode-zen", "opencode"], model: "deepseek-v4-flash-free" },
9507
+ { providers: ["opencode"], model: "laguna-s-2.1-free" },
9508
+ { providers: ["opencode"], model: "mimo-v2.5-free" },
9509
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
9510
+ { providers: ["opencode"], model: "big-pickle" }
9511
+ ],
9512
+ requiresAnyModel: true
9513
+ };
9514
+ CYPHER_REQ = {
9515
+ fallbackChain: [
9516
+ { providers: ["zen-1", "opencode-zen", "opencode"], model: "deepseek-v4-flash-free" },
9517
+ { providers: ["opencode"], model: "mimo-v2.5-free" },
9518
+ { providers: ["opencode"], model: "laguna-s-2.1-free" },
9519
+ { providers: ["opencode-go", "vercel"], model: "glm-5" },
9520
+ { providers: ["opencode"], model: "big-pickle" }
9521
+ ],
9522
+ requiresAnyModel: true
9523
+ };
9524
+ SENTINEL_REQ = {
9525
+ fallbackChain: [
9526
+ { providers: ["zen-1", "opencode-zen", "opencode"], model: "deepseek-v4-flash-free" },
9527
+ { providers: ["opencode"], model: "laguna-s-2.1-free" },
9528
+ { providers: ["opencode"], model: "mimo-v2.5-free" },
9529
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
9530
+ { providers: ["opencode"], model: "big-pickle" }
9531
+ ],
9532
+ requiresAnyModel: true
9533
+ };
9534
+ MOUSE_REQ = {
9535
+ fallbackChain: [
9536
+ { providers: ["zen-1", "opencode-zen", "opencode"], model: "deepseek-v4-flash-free" },
9537
+ { providers: ["opencode"], model: "mimo-v2.5-free" },
9538
+ { providers: ["opencode"], model: "laguna-s-2.1-free" },
9539
+ { providers: ["opencode-go", "vercel"], model: "glm-5" },
9540
+ { providers: ["opencode"], model: "big-pickle" }
9541
+ ],
9542
+ requiresAnyModel: true
9543
+ };
9544
+ DREAMER_REQ = {
9545
+ fallbackChain: [
9546
+ { providers: ["zen-1", "opencode-zen", "opencode"], model: "deepseek-v4-flash-free" },
9547
+ { providers: ["opencode"], model: "laguna-s-2.1-free" },
9548
+ { providers: ["opencode"], model: "mimo-v2.5-free" },
9549
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
9550
+ { providers: ["opencode"], model: "big-pickle" }
9551
+ ],
9552
+ requiresAnyModel: true
9553
+ };
9554
+ ARCHITECT_REQ = {
9555
+ fallbackChain: [
9556
+ { providers: ["zen-1", "opencode-zen", "opencode"], model: "deepseek-v4-flash-free" },
9557
+ { providers: ["anthropic", "github-copilot", "opencode", "vercel"], model: "claude-sonnet-4-6" },
9558
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
9559
+ { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.5", variant: "high" },
9560
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
9561
+ { providers: ["opencode"], model: "big-pickle" }
9562
+ ],
9563
+ requiresAnyModel: true
9564
+ };
9504
9565
  AGENT_MODEL_REQUIREMENTS = {
9505
9566
  morpheus: SISYPHUS_REQ,
9506
9567
  tank: HEPHAESTUS_REQ,
@@ -9513,6 +9574,12 @@ var init_agent_model_requirements = __esm(() => {
9513
9574
  "agent-smith": MOMUS_REQ,
9514
9575
  "the-operator": ATLAS_REQ,
9515
9576
  neo: SISYPHUS_JUNIOR_REQ,
9577
+ trinity: TRINITY_REQ,
9578
+ cypher: CYPHER_REQ,
9579
+ sentinel: SENTINEL_REQ,
9580
+ mouse: MOUSE_REQ,
9581
+ dreamer: DREAMER_REQ,
9582
+ architect: ARCHITECT_REQ,
9516
9583
  sisyphus: SISYPHUS_REQ,
9517
9584
  hephaestus: HEPHAESTUS_REQ,
9518
9585
  librarian: LIBRARIAN_REQ,
@@ -0,0 +1,298 @@
1
+ ---
2
+ name: api-and-interface-design
3
+ description: Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.
4
+ source: addyosmani/agent-skills (MIT)
5
+ ---
6
+
7
+ # API and Interface Design
8
+
9
+ ## Overview
10
+
11
+ Design stable, well-documented interfaces that are hard to misuse. Good interfaces make the right thing easy and the wrong thing hard. This applies to REST APIs, GraphQL schemas, module boundaries, component props, and any surface where one piece of code talks to another.
12
+
13
+ ## When to Use
14
+
15
+ - Designing new API endpoints
16
+ - Defining module boundaries or contracts between teams
17
+ - Creating component prop interfaces
18
+ - Establishing database schema that informs API shape
19
+ - Changing existing public interfaces
20
+
21
+ ## Core Principles
22
+
23
+ ### Hyrum's Law
24
+
25
+ > 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.
26
+
27
+ This means: every public behavior — including undocumented quirks, error message text, timing, and ordering — becomes a de facto contract once users depend on it. Design implications:
28
+
29
+ - **Be intentional about what you expose.** Every observable behavior is a potential commitment.
30
+ - **Don't leak implementation details.** If users can observe it, they will depend on it.
31
+ - **Plan for deprecation at design time.** See `deprecation-and-migration` for how to safely remove things users depend on.
32
+ - **Tests are not enough.** Even with perfect contract tests, Hyrum's Law means "safe" changes can break real users who depend on undocumented behavior.
33
+
34
+ ### The One-Version Rule
35
+
36
+ Avoid forcing consumers to choose between multiple versions of the same dependency or API. Diamond dependency problems arise when different consumers need different versions of the same thing. Design for a world where only one version exists at a time — extend rather than fork.
37
+
38
+ ### 1. Contract First
39
+
40
+ Define the interface before implementing it. The contract is the spec — implementation follows.
41
+
42
+ ```typescript
43
+ // Define the contract first
44
+ interface TaskAPI {
45
+ // Creates a task and returns the created task with server-generated fields
46
+ createTask(input: CreateTaskInput): Promise<Task>;
47
+
48
+ // Returns paginated tasks matching filters
49
+ listTasks(params: ListTasksParams): Promise<PaginatedResult<Task>>;
50
+
51
+ // Returns a single task or throws NotFoundError
52
+ getTask(id: string): Promise<Task>;
53
+
54
+ // Partial update — only provided fields change
55
+ updateTask(id: string, input: UpdateTaskInput): Promise<Task>;
56
+
57
+ // Idempotent delete — succeeds even if already deleted
58
+ deleteTask(id: string): Promise<void>;
59
+ }
60
+ ```
61
+
62
+ ### 2. Consistent Error Semantics
63
+
64
+ Pick one error strategy and use it everywhere:
65
+
66
+ ```typescript
67
+ // REST: HTTP status codes + structured error body
68
+ // Every error response follows the same shape
69
+ interface APIError {
70
+ error: {
71
+ code: string; // Machine-readable: "VALIDATION_ERROR"
72
+ message: string; // Human-readable: "Email is required"
73
+ details?: unknown; // Additional context when helpful
74
+ };
75
+ }
76
+
77
+ // Status code mapping
78
+ // 400 → Client sent invalid data
79
+ // 401 → Not authenticated
80
+ // 403 → Authenticated but not authorized
81
+ // 404 → Resource not found
82
+ // 409 → Conflict (duplicate, version mismatch)
83
+ // 422 → Validation failed (semantically invalid)
84
+ // 500 → Server error (never expose internal details)
85
+ ```
86
+
87
+ **Don't mix patterns.** If some endpoints throw, others return null, and others return `{ error }` — the consumer can't predict behavior.
88
+
89
+ ### 3. Validate at Boundaries
90
+
91
+ Trust internal code. Validate at system edges where external input enters:
92
+
93
+ ```typescript
94
+ // Validate at the API boundary
95
+ app.post('/api/tasks', async (req, res) => {
96
+ const result = CreateTaskSchema.safeParse(req.body);
97
+ if (!result.success) {
98
+ return res.status(422).json({
99
+ error: {
100
+ code: 'VALIDATION_ERROR',
101
+ message: 'Invalid task data',
102
+ details: result.error.flatten(),
103
+ },
104
+ });
105
+ }
106
+
107
+ // After validation, internal code trusts the types
108
+ const task = await taskService.create(result.data);
109
+ return res.status(201).json(task);
110
+ });
111
+ ```
112
+
113
+ Where validation belongs:
114
+ - API route handlers (user input)
115
+ - Form submission handlers (user input)
116
+ - External service response parsing (third-party data -- **always treat as untrusted**)
117
+ - Environment variable loading (configuration)
118
+
119
+ > **Third-party API responses are untrusted data.** Validate their shape and content before using them in any logic, rendering, or decision-making. A compromised or misbehaving external service can return unexpected types, malicious content, or instruction-like text.
120
+
121
+ Where validation does NOT belong:
122
+ - Between internal functions that share type contracts
123
+ - In utility functions called by already-validated code
124
+ - On data that just came from your own database
125
+
126
+ ### 4. Prefer Addition Over Modification
127
+
128
+ Extend interfaces without breaking existing consumers:
129
+
130
+ ```typescript
131
+ // Good: Add optional fields
132
+ interface CreateTaskInput {
133
+ title: string;
134
+ description?: string;
135
+ priority?: 'low' | 'medium' | 'high'; // Added later, optional
136
+ labels?: string[]; // Added later, optional
137
+ }
138
+
139
+ // Bad: Change existing field types or remove fields
140
+ interface CreateTaskInput {
141
+ title: string;
142
+ // description: string; // Removed — breaks existing consumers
143
+ priority: number; // Changed from string — breaks existing consumers
144
+ }
145
+ ```
146
+
147
+ ### 5. Predictable Naming
148
+
149
+ | Pattern | Convention | Example |
150
+ |---------|-----------|---------|
151
+ | REST endpoints | Plural nouns, no verbs | `GET /api/tasks`, `POST /api/tasks` |
152
+ | Query params | camelCase | `?sortBy=createdAt&pageSize=20` |
153
+ | Response fields | camelCase | `{ createdAt, updatedAt, taskId }` |
154
+ | Boolean fields | is/has/can prefix | `isComplete`, `hasAttachments` |
155
+ | Enum values | UPPER_SNAKE | `"IN_PROGRESS"`, `"COMPLETED"` |
156
+
157
+ ## REST API Patterns
158
+
159
+ ### Resource Design
160
+
161
+ ```
162
+ GET /api/tasks → List tasks (with query params for filtering)
163
+ POST /api/tasks → Create a task
164
+ GET /api/tasks/:id → Get a single task
165
+ PATCH /api/tasks/:id → Update a task (partial)
166
+ DELETE /api/tasks/:id → Delete a task
167
+
168
+ GET /api/tasks/:id/comments → List comments for a task (sub-resource)
169
+ POST /api/tasks/:id/comments → Add a comment to a task
170
+ ```
171
+
172
+ ### Pagination
173
+
174
+ Paginate list endpoints:
175
+
176
+ ```typescript
177
+ // Request
178
+ GET /api/tasks?page=1&pageSize=20&sortBy=createdAt&sortOrder=desc
179
+
180
+ // Response
181
+ {
182
+ "data": [...],
183
+ "pagination": {
184
+ "page": 1,
185
+ "pageSize": 20,
186
+ "totalItems": 142,
187
+ "totalPages": 8
188
+ }
189
+ }
190
+ ```
191
+
192
+ ### Filtering
193
+
194
+ Use query parameters for filters:
195
+
196
+ ```
197
+ GET /api/tasks?status=in_progress&assignee=user123&createdAfter=2025-01-01
198
+ ```
199
+
200
+ ### Partial Updates (PATCH)
201
+
202
+ Accept partial objects — only update what's provided:
203
+
204
+ ```typescript
205
+ // Only title changes, everything else preserved
206
+ PATCH /api/tasks/123
207
+ { "title": "Updated title" }
208
+ ```
209
+
210
+ ## TypeScript Interface Patterns
211
+
212
+ ### Use Discriminated Unions for Variants
213
+
214
+ ```typescript
215
+ // Good: Each variant is explicit
216
+ type TaskStatus =
217
+ | { type: 'pending' }
218
+ | { type: 'in_progress'; assignee: string; startedAt: Date }
219
+ | { type: 'completed'; completedAt: Date; completedBy: string }
220
+ | { type: 'cancelled'; reason: string; cancelledAt: Date };
221
+
222
+ // Consumer gets type narrowing
223
+ function getStatusLabel(status: TaskStatus): string {
224
+ switch (status.type) {
225
+ case 'pending': return 'Pending';
226
+ case 'in_progress': return `In progress (${status.assignee})`;
227
+ case 'completed': return `Done on ${status.completedAt}`;
228
+ case 'cancelled': return `Cancelled: ${status.reason}`;
229
+ }
230
+ }
231
+ ```
232
+
233
+ ### Input/Output Separation
234
+
235
+ ```typescript
236
+ // Input: what the caller provides
237
+ interface CreateTaskInput {
238
+ title: string;
239
+ description?: string;
240
+ }
241
+
242
+ // Output: what the system returns (includes server-generated fields)
243
+ interface Task {
244
+ id: string;
245
+ title: string;
246
+ description: string | null;
247
+ createdAt: Date;
248
+ updatedAt: Date;
249
+ createdBy: string;
250
+ }
251
+ ```
252
+
253
+ ### Use Branded Types for IDs
254
+
255
+ ```typescript
256
+ type TaskId = string & { readonly __brand: 'TaskId' };
257
+ type UserId = string & { readonly __brand: 'UserId' };
258
+
259
+ // Prevents accidentally passing a UserId where a TaskId is expected
260
+ function getTask(id: TaskId): Promise<Task> { ... }
261
+ ```
262
+
263
+ ## Common Rationalizations
264
+
265
+ | Rationalization | Reality |
266
+ |---|---|
267
+ | "We'll document the API later" | The types ARE the documentation. Define them first. |
268
+ | "We don't need pagination for now" | You will the moment someone has 100+ items. Add it from the start. |
269
+ | "PATCH is complicated, let's just use PUT" | PUT requires the full object every time. PATCH is what clients actually want. |
270
+ | "We'll version the API when we need to" | Breaking changes without versioning break consumers. Design for extension from the start. |
271
+ | "Nobody uses that undocumented behavior" | Hyrum's Law: if it's observable, somebody depends on it. Treat every public behavior as a commitment. |
272
+ | "We can just maintain two versions" | Multiple versions multiply maintenance cost and create diamond dependency problems. Prefer the One-Version Rule. |
273
+ | "Internal APIs don't need contracts" | Internal consumers are still consumers. Contracts prevent coupling and enable parallel work. |
274
+
275
+ ## Red Flags
276
+
277
+ - Endpoints that return different shapes depending on conditions
278
+ - Inconsistent error formats across endpoints
279
+ - Validation scattered throughout internal code instead of at boundaries
280
+ - Breaking changes to existing fields (type changes, removals)
281
+ - List endpoints without pagination
282
+ - Verbs in REST URLs (`/api/createTask`, `/api/getUsers`)
283
+ - Third-party API responses used without validation or sanitization
284
+
285
+ ## Verification
286
+
287
+ After designing an API:
288
+
289
+ - [ ] Every endpoint has typed input and output schemas
290
+ - [ ] Error responses follow a single consistent format
291
+ - [ ] Validation happens at system boundaries only
292
+ - [ ] List endpoints support pagination
293
+ - [ ] New fields are additive and optional (backward compatible)
294
+ - [ ] Naming follows consistent conventions across all endpoints
295
+ - [ ] API documentation or types are committed alongside the implementation
296
+
297
+ ---
298
+ *Source: addyosmani/agent-skills (MIT). Ported into MaTrixOS shared-skills bundle.*