@kl-c/matrixos 0.3.40 → 0.3.42

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 (55) hide show
  1. package/dist/cli/index.js +167 -1
  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 +167 -1
  18. package/dist/features/dashboard/data-provider.d.ts +21 -1
  19. package/dist/features/dashboard/frontend/css/style.css +148 -1
  20. package/dist/features/dashboard/frontend/index.html +22 -0
  21. package/dist/features/dashboard/frontend/js/api.js +4 -0
  22. package/dist/features/dashboard/frontend/js/app.js +77 -2
  23. package/dist/features/dashboard/types.d.ts +9 -0
  24. package/dist/index.js +1 -1
  25. package/dist/skills/api-and-interface-design/SKILL.md +298 -0
  26. package/dist/skills/browser-testing-with-devtools/SKILL.md +321 -0
  27. package/dist/skills/ci-cd-and-automation/SKILL.md +394 -0
  28. package/dist/skills/context-engineering/SKILL.md +293 -0
  29. package/dist/skills/deprecation-and-migration/SKILL.md +251 -0
  30. package/dist/skills/documentation-and-adrs/SKILL.md +292 -0
  31. package/dist/skills/doubt-driven-development/SKILL.md +247 -0
  32. package/dist/skills/incremental-implementation/SKILL.md +253 -0
  33. package/dist/skills/interview-me/SKILL.md +229 -0
  34. package/dist/skills/observability-and-instrumentation/SKILL.md +207 -0
  35. package/dist/skills/performance-optimization/SKILL.md +354 -0
  36. package/dist/skills/security-and-hardening/SKILL.md +471 -0
  37. package/dist/skills/shipping-and-launch/SKILL.md +314 -0
  38. package/dist/skills/source-driven-development/SKILL.md +198 -0
  39. package/dist/skills/test-driven-development/SKILL.md +402 -0
  40. package/package.json +1 -1
  41. package/packages/shared-skills/skills/api-and-interface-design/SKILL.md +298 -0
  42. package/packages/shared-skills/skills/browser-testing-with-devtools/SKILL.md +321 -0
  43. package/packages/shared-skills/skills/ci-cd-and-automation/SKILL.md +394 -0
  44. package/packages/shared-skills/skills/context-engineering/SKILL.md +293 -0
  45. package/packages/shared-skills/skills/deprecation-and-migration/SKILL.md +251 -0
  46. package/packages/shared-skills/skills/documentation-and-adrs/SKILL.md +292 -0
  47. package/packages/shared-skills/skills/doubt-driven-development/SKILL.md +247 -0
  48. package/packages/shared-skills/skills/incremental-implementation/SKILL.md +253 -0
  49. package/packages/shared-skills/skills/interview-me/SKILL.md +229 -0
  50. package/packages/shared-skills/skills/observability-and-instrumentation/SKILL.md +207 -0
  51. package/packages/shared-skills/skills/performance-optimization/SKILL.md +354 -0
  52. package/packages/shared-skills/skills/security-and-hardening/SKILL.md +471 -0
  53. package/packages/shared-skills/skills/shipping-and-launch/SKILL.md +314 -0
  54. package/packages/shared-skills/skills/source-driven-development/SKILL.md +198 -0
  55. package/packages/shared-skills/skills/test-driven-development/SKILL.md +402 -0
@@ -0,0 +1,251 @@
1
+ ---
2
+ name: deprecation-and-migration
3
+ description: Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.
4
+ source: addyosmani/agent-skills (MIT)
5
+ ---
6
+
7
+ # Deprecation and Migration
8
+
9
+ ## Overview
10
+
11
+ Code is a liability, not an asset. Every line of code has ongoing maintenance cost — bugs to fix, dependencies to update, security patches to apply, and new engineers to onboard. Deprecation is the discipline of removing code that no longer earns its keep, and migration is the process of moving users safely from the old to the new.
12
+
13
+ Most engineering organizations are good at building things. Few are good at removing them. This skill addresses that gap.
14
+
15
+ ## When to Use
16
+
17
+ - Replacing an old system, API, or library with a new one
18
+ - Sunsetting a feature that's no longer needed
19
+ - Consolidating duplicate implementations
20
+ - Removing dead code that nobody owns but everybody depends on
21
+ - Planning the lifecycle of a new system (deprecation planning starts at design time)
22
+ - Deciding whether to maintain a legacy system or invest in migration
23
+
24
+ ## Core Principles
25
+
26
+ ### Code Is a Liability
27
+
28
+ Every line of code has ongoing cost: it needs tests, documentation, security patches, dependency updates, and mental overhead for anyone working nearby. The value of code is the functionality it provides, not the code itself. When the same functionality can be provided with less code, less complexity, or better abstractions — the old code should go.
29
+
30
+ ### Hyrum's Law Makes Removal Hard
31
+
32
+ With enough users, every observable behavior becomes depended on — including bugs, timing quirks, and undocumented side effects. This is why deprecation requires active migration, not just announcement. Users can't "just switch" when they depend on behaviors the replacement doesn't replicate.
33
+
34
+ ### Deprecation Planning Starts at Design Time
35
+
36
+ When building something new, ask: "How would we remove this in 3 years?" Systems designed with clean interfaces, feature flags, and minimal surface area are easier to deprecate than systems that leak implementation details everywhere.
37
+
38
+ ## The Deprecation Decision
39
+
40
+ Before deprecating anything, answer these questions:
41
+
42
+ ```
43
+ 1. Does this system still provide unique value?
44
+ → If yes, maintain it. If no, proceed.
45
+
46
+ 2. How many users/consumers depend on it?
47
+ → Quantify the migration scope.
48
+
49
+ 3. Does a replacement exist?
50
+ → If no, build the replacement first. Don't deprecate without an alternative.
51
+
52
+ 4. What's the migration cost for each consumer?
53
+ → If trivially automated, do it. If manual and high-effort, weigh against maintenance cost.
54
+
55
+ 5. What's the ongoing maintenance cost of NOT deprecating?
56
+ → Security risk, engineer time, opportunity cost of complexity.
57
+ ```
58
+
59
+ ## Compulsory vs Advisory Deprecation
60
+
61
+ | Type | When to Use | Mechanism |
62
+ |------|-------------|-----------|
63
+ | **Advisory** | Migration is optional, old system is stable | Warnings, documentation, nudges. Users migrate on their own timeline. |
64
+ | **Compulsory** | Old system has security issues, blocks progress, or maintenance cost is unsustainable | Hard deadline. Old system will be removed by date X. Provide migration tooling. |
65
+
66
+ **Default to advisory.** Use compulsory only when the maintenance cost or risk justifies forcing migration. Compulsory deprecation requires providing migration tooling, documentation, and support — you can't just announce a deadline.
67
+
68
+ ## The Migration Process
69
+
70
+ ### Step 1: Build the Replacement
71
+
72
+ Don't deprecate without a working alternative. The replacement must:
73
+
74
+ - Cover all critical use cases of the old system
75
+ - Have documentation and migration guides
76
+ - Be proven in production (not just "theoretically better")
77
+
78
+ ### Step 2: Announce and Document
79
+
80
+ ```markdown
81
+ ## Deprecation Notice: OldService
82
+
83
+ **Status:** Deprecated as of 2025-03-01
84
+ **Replacement:** NewService (see migration guide below)
85
+ **Removal date:** Advisory — no hard deadline yet
86
+ **Reason:** OldService requires manual scaling and lacks observability.
87
+ NewService handles both automatically.
88
+
89
+ ### Migration Guide
90
+ 1. Replace `import { client } from 'old-service'` with `import { client } from 'new-service'`
91
+ 2. Update configuration (see examples below)
92
+ 3. Run the migration verification script: `npx migrate-check`
93
+ ```
94
+
95
+ ### Step 3: Migrate Incrementally
96
+
97
+ Migrate consumers one at a time, not all at once. For each consumer:
98
+
99
+ ```
100
+ 1. Identify all touchpoints with the deprecated system
101
+ 2. Update to use the replacement
102
+ 3. Verify behavior matches (tests, integration checks)
103
+ 4. Remove references to the old system
104
+ 5. Confirm no regressions
105
+ ```
106
+
107
+ **The Churn Rule:** If you own the infrastructure being deprecated, you are responsible for migrating your users — or providing backward-compatible updates that require no migration. Don't announce deprecation and leave users to figure it out.
108
+
109
+ ### Step 4: Remove the Old System
110
+
111
+ Only after all consumers have migrated:
112
+
113
+ ```
114
+ 1. Verify zero active usage (metrics, logs, dependency analysis)
115
+ 2. Remove the code
116
+ 3. Remove associated tests, documentation, and configuration
117
+ 4. Remove the deprecation notices
118
+ 5. Celebrate — removing code is an achievement
119
+ ```
120
+
121
+ ## Migration Patterns
122
+
123
+ ### Strangler Pattern
124
+
125
+ Run old and new systems in parallel. Route traffic incrementally from old to new. When the old system handles 0% of traffic, remove it.
126
+
127
+ ```
128
+ Phase 1: New system handles 0%, old handles 100%
129
+ Phase 2: New system handles 10% (canary)
130
+ Phase 3: New system handles 50%
131
+ Phase 4: New system handles 100%, old system idle
132
+ Phase 5: Remove old system
133
+ ```
134
+
135
+ ### Adapter Pattern
136
+
137
+ Create an adapter that translates calls from the old interface to the new implementation. Consumers keep using the old interface while you migrate the backend.
138
+
139
+ ```typescript
140
+ // Adapter: old interface, new implementation
141
+ class LegacyTaskService implements OldTaskAPI {
142
+ constructor(private newService: NewTaskService) {}
143
+
144
+ // Old method signature, delegates to new implementation
145
+ getTask(id: number): OldTask {
146
+ const task = this.newService.findById(String(id));
147
+ return this.toOldFormat(task);
148
+ }
149
+ }
150
+ ```
151
+
152
+ ### Feature Flag Migration
153
+
154
+ Use feature flags to switch consumers from old to new system one at a time:
155
+
156
+ ```typescript
157
+ function getTaskService(userId: string): TaskService {
158
+ if (featureFlags.isEnabled('new-task-service', { userId })) {
159
+ return new NewTaskService();
160
+ }
161
+ return new LegacyTaskService();
162
+ }
163
+ ```
164
+
165
+ ### Database Schema Migrations (Expand/Contract)
166
+
167
+ A schema change is the riskiest migration because the data is the one thing you cannot roll back by reverting a deploy. The failure mode is coupling the schema change to the code change: rename a column in the same release that starts using the new name, and during the rollout window — when old and new code run at once — one of them is querying a column that doesn't exist. The fix is to **never change a column in place**. Migrate in additive phases so old and new code are both valid at every step.
168
+
169
+ ```
170
+ EXPAND ──────────────→ MIGRATE ──────────────→ CONTRACT
171
+ add the new column, backfill existing rows, once no code reads the
172
+ nullable, alongside dual-write old+new from old column, drop it in
173
+ the old one the app a later, separate deploy
174
+ ```
175
+
176
+ **Worked example — renaming `name` to `full_name`:**
177
+
178
+ 1. **Expand.** Add `full_name` as nullable. Deploy. (Old code ignores it; nothing breaks.)
179
+ 2. **Dual-write.** App writes both `name` and `full_name` on every insert/update. Deploy.
180
+ 3. **Backfill.** Copy `name → full_name` for existing rows, in batches, so you don't lock the table.
181
+ 4. **Switch reads.** Point the app at `full_name`, keep writing both. Deploy and bake.
182
+ 5. **Contract.** Stop writing `name`, then — in a *separate, later* deploy — drop the column.
183
+
184
+ Each step is independently deployable and reversible: if step 4 misbehaves, roll the code back and `full_name` is still being populated. Treat each phase as a thin vertical slice — see the `incremental-implementation` skill.
185
+
186
+ **Rules:**
187
+ - **Additive first, destructive last and alone.** Adds (new nullable column, new table, new index) are safe in any deploy; drops and renames get their own deploy *after* no code references the old shape.
188
+ - **Every migration has a tested down path.** A migration you can't reverse is a deploy you can't roll back. Write and run the `down` before merging.
189
+ - **Backfill in batches, off the hot path.** A single `UPDATE` over millions of rows locks the table; chunk it and throttle.
190
+ - **Build large indexes without blocking writes** (e.g. Postgres `CREATE INDEX CONCURRENTLY`).
191
+ - **Decouple from code by feature flag** when the cutover is risky, exactly as in the Feature Flag Migration pattern above.
192
+
193
+ ## Zombie Code
194
+
195
+ Zombie code is code that nobody owns but everybody depends on. It's not actively maintained, has no clear owner, and accumulates security vulnerabilities and compatibility issues. Signs:
196
+
197
+ - No commits in 6+ months but active consumers exist
198
+ - No assigned maintainer or team
199
+ - Failing tests that nobody fixes
200
+ - Dependencies with known vulnerabilities that nobody updates
201
+ - Documentation that references systems that no longer exist
202
+
203
+ **Response:** Either assign an owner and maintain it properly, or deprecate it with a concrete migration plan. Zombie code cannot stay in limbo — it either gets investment or removal.
204
+
205
+ ## Common Rationalizations
206
+
207
+ | Rationalization | Reality |
208
+ |---|---|
209
+ | "It still works, why remove it?" | Working code that nobody maintains accumulates security debt and complexity. Maintenance cost grows silently. |
210
+ | "Someone might need it later" | If it's needed later, it can be rebuilt. Keeping unused code "just in case" costs more than rebuilding. |
211
+ | "The migration is too expensive" | Compare migration cost to ongoing maintenance cost over 2-3 years. Migration is usually cheaper long-term. |
212
+ | "We'll deprecate it after we finish the new system" | Deprecation planning starts at design time. By the time the new system is done, you'll have new priorities. Plan now. |
213
+ | "Users will migrate on their own" | They won't. Provide tooling, documentation, and incentives — or do the migration yourself (the Churn Rule). |
214
+ | "We can maintain both systems indefinitely" | Two systems doing the same thing is double the maintenance, testing, documentation, and onboarding cost. |
215
+ | "Just rename the column, it's one line" | During the rollout, old and new code run together — one will query a column that no longer exists. Expand/contract, never rename in place. |
216
+ | "I'll add the column and drop the old one in the same migration" | That couples a safe add to a destructive drop. Drops get their own deploy, after no code references the old shape. |
217
+ | "We'll write the rollback if we need it" | A migration with no down path is a deploy you can't reverse. Write and run the `down` before merging. |
218
+
219
+ ## Red Flags
220
+
221
+ - Deprecated systems with no replacement available
222
+ - Deprecation announcements with no migration tooling or documentation
223
+ - "Soft" deprecation that's been advisory for years with no progress
224
+ - Zombie code with no owner and active consumers
225
+ - New features added to a deprecated system (invest in the replacement instead)
226
+ - Deprecation without measuring current usage
227
+ - Removing code without verifying zero active consumers
228
+ - A schema change and the code that depends on it shipped in the same deploy
229
+ - A column renamed or dropped in place rather than via expand/contract
230
+ - A migration merged with no tested down path, or a backfill that locks the table
231
+
232
+ ## Verification
233
+
234
+ After completing a deprecation:
235
+
236
+ - [ ] Replacement is production-proven and covers all critical use cases
237
+ - [ ] Migration guide exists with concrete steps and examples
238
+ - [ ] All active consumers have been migrated (verified by metrics/logs)
239
+ - [ ] Old code, tests, documentation, and configuration are fully removed
240
+ - [ ] No references to the deprecated system remain in the codebase
241
+ - [ ] Deprecation notices are removed (they served their purpose)
242
+
243
+ After a database schema migration:
244
+
245
+ - [ ] The change ships in additive phases (expand → backfill → contract), not a single in-place edit
246
+ - [ ] Old and new code are both valid against the schema at every deploy step
247
+ - [ ] Each migration has a tested down path; backfills run in throttled batches
248
+ - [ ] Destructive steps (drop/rename) ship in their own deploy after no code references the old shape
249
+
250
+ ---
251
+ *Source: addyosmani/agent-skills (MIT). Ported into MaTrixOS shared-skills bundle.*
@@ -0,0 +1,292 @@
1
+ ---
2
+ name: documentation-and-adrs
3
+ description: Records decisions and documentation. Use when making architectural decisions, changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.
4
+ source: addyosmani/agent-skills (MIT)
5
+ ---
6
+
7
+ # Documentation and ADRs
8
+
9
+ ## Overview
10
+
11
+ Document decisions, not just code. The most valuable documentation captures the *why* — the context, constraints, and trade-offs that led to a decision. Code shows *what* was built; documentation explains *why it was built this way* and *what alternatives were considered*. This context is essential for future humans and agents working in the codebase.
12
+
13
+ ## When to Use
14
+
15
+ - Making a significant architectural decision
16
+ - Choosing between competing approaches
17
+ - Adding or changing a public API
18
+ - Shipping a feature that changes user-facing behavior
19
+ - Onboarding new team members (or agents) to the project
20
+ - When you find yourself explaining the same thing repeatedly
21
+
22
+ **When NOT to use:** Don't document obvious code. Don't add comments that restate what the code already says. Don't write docs for throwaway prototypes.
23
+
24
+ ## Architecture Decision Records (ADRs)
25
+
26
+ ADRs capture the reasoning behind significant technical decisions. They're the highest-value documentation you can write.
27
+
28
+ ### When to Write an ADR
29
+
30
+ - Choosing a framework, library, or major dependency
31
+ - Designing a data model or database schema
32
+ - Selecting an authentication strategy
33
+ - Deciding on an API architecture (REST vs. GraphQL vs. tRPC)
34
+ - Choosing between build tools, hosting platforms, or infrastructure
35
+ - Any decision that would be expensive to reverse
36
+
37
+ ### Match the existing convention first
38
+
39
+ Before creating an ADR, inspect the available repository context for an established convention — existing ADRs, project instructions, and ADR-related configuration or tooling (e.g. an `.adr-dir` file). An established convention overrides the defaults below. Match:
40
+
41
+ - **Location and format** — e.g. `docs/adr/*.md`, `Documentation/Decisions/*.rst`, a MADR layout, or an `adr-tools` setup. Match the existing directory, file extension, and markup (Markdown vs reStructuredText).
42
+ - **Numbering and naming** — continue the existing sequence and filename pattern (`ADR-004-Title.rst`, `0004-title.md`, …); don't restart at 001 or introduce a second scheme.
43
+ - **Section headings** — reuse the project's heading set rather than imposing this template's.
44
+
45
+ If the available evidence conflicts, surface the conflict rather than silently introducing another scheme. Only when no convention can be established do you apply the default below.
46
+
47
+ ### ADR Template
48
+
49
+ Store ADRs in `docs/decisions/` with sequential numbering (unless the project already uses another location — see above):
50
+
51
+ ```markdown
52
+ # ADR-001: Use PostgreSQL for primary database
53
+
54
+ ## Status
55
+ Accepted | Superseded by ADR-XXX | Deprecated
56
+
57
+ ## Date
58
+ 2025-01-15
59
+
60
+ ## Context
61
+ We need a primary database for the task management application. Key requirements:
62
+ - Relational data model (users, tasks, teams with relationships)
63
+ - ACID transactions for task state changes
64
+ - Support for full-text search on task content
65
+ - Managed hosting available (for small team, limited ops capacity)
66
+
67
+ ## Decision
68
+ Use PostgreSQL with Prisma ORM.
69
+
70
+ ## Alternatives Considered
71
+
72
+ ### MongoDB
73
+ - Pros: Flexible schema, easy to start with
74
+ - Cons: Our data is inherently relational; would need to manage relationships manually
75
+ - Rejected: Relational data in a document store leads to complex joins or data duplication
76
+
77
+ ### SQLite
78
+ - Pros: Zero configuration, embedded, fast for reads
79
+ - Cons: Limited concurrent write support, no managed hosting for production
80
+ - Rejected: Not suitable for multi-user web application in production
81
+
82
+ ### MySQL
83
+ - Pros: Mature, widely supported
84
+ - Cons: PostgreSQL has better JSON support, full-text search, and ecosystem tooling
85
+ - Rejected: PostgreSQL is the better fit for our feature requirements
86
+
87
+ ## Consequences
88
+ - Prisma provides type-safe database access and migration management
89
+ - We can use PostgreSQL's full-text search instead of adding Elasticsearch
90
+ - Team needs PostgreSQL knowledge (standard skill, low risk)
91
+ - Hosting on managed service (Supabase, Neon, or RDS)
92
+ ```
93
+
94
+ ### ADR Lifecycle
95
+
96
+ ```
97
+ PROPOSED → ACCEPTED → (SUPERSEDED or DEPRECATED)
98
+ ```
99
+
100
+ - **Don't delete old ADRs.** They capture historical context.
101
+ - When a decision changes, write a new ADR that references and supersedes the old one.
102
+
103
+ ## Inline Documentation
104
+
105
+ ### When to Comment
106
+
107
+ Comment the *why*, not the *what*:
108
+
109
+ ```typescript
110
+ // BAD: Restates the code
111
+ // Increment counter by 1
112
+ counter += 1;
113
+
114
+ // GOOD: Explains non-obvious intent
115
+ // Rate limit uses a sliding window — reset counter at window boundary,
116
+ // not on a fixed schedule, to prevent burst attacks at window edges
117
+ if (now - windowStart > WINDOW_SIZE_MS) {
118
+ counter = 0;
119
+ windowStart = now;
120
+ }
121
+ ```
122
+
123
+ ### When NOT to Comment
124
+
125
+ ```typescript
126
+ // Don't comment self-explanatory code
127
+ function calculateTotal(items: CartItem[]): number {
128
+ return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
129
+ }
130
+
131
+ // Don't leave TODO comments for things you should just do now
132
+ // TODO: add error handling ← Just add it
133
+
134
+ // Don't leave commented-out code
135
+ // const oldImplementation = () => { ... } ← Delete it, git has history
136
+ ```
137
+
138
+ ### Document Known Gotchas
139
+
140
+ ```typescript
141
+ /**
142
+ * IMPORTANT: This function must be called before the first render.
143
+ * If called after hydration, it causes a flash of unstyled content
144
+ * because the theme context isn't available during SSR.
145
+ *
146
+ * See ADR-003 for the full design rationale.
147
+ */
148
+ export function initializeTheme(theme: Theme): void {
149
+ // ...
150
+ }
151
+ ```
152
+
153
+ ## API Documentation
154
+
155
+ For public APIs (REST, GraphQL, library interfaces):
156
+
157
+ ### Inline with Types (Preferred for TypeScript)
158
+
159
+ ```typescript
160
+ /**
161
+ * Creates a new task.
162
+ *
163
+ * @param input - Task creation data (title required, description optional)
164
+ * @returns The created task with server-generated ID and timestamps
165
+ * @throws {ValidationError} If title is empty or exceeds 200 characters
166
+ * @throws {AuthenticationError} If the user is not authenticated
167
+ *
168
+ * @example
169
+ * const task = await createTask({ title: 'Buy groceries' });
170
+ * console.log(task.id); // "task_abc123"
171
+ */
172
+ export async function createTask(input: CreateTaskInput): Promise<Task> {
173
+ // ...
174
+ }
175
+ ```
176
+
177
+ ### OpenAPI / Swagger for REST APIs
178
+
179
+ ```yaml
180
+ paths:
181
+ /api/tasks:
182
+ post:
183
+ summary: Create a task
184
+ requestBody:
185
+ required: true
186
+ content:
187
+ application/json:
188
+ schema:
189
+ $ref: '#/components/schemas/CreateTaskInput'
190
+ responses:
191
+ '201':
192
+ description: Task created
193
+ content:
194
+ application/json:
195
+ schema:
196
+ $ref: '#/components/schemas/Task'
197
+ '422':
198
+ description: Validation error
199
+ ```
200
+
201
+ ## README Structure
202
+
203
+ Every project should have a README that covers:
204
+
205
+ ```markdown
206
+ # Project Name
207
+
208
+ One-paragraph description of what this project does.
209
+
210
+ ## Quick Start
211
+ 1. Clone the repo
212
+ 2. Install dependencies: `npm install`
213
+ 3. Set up environment: `cp .env.example .env`
214
+ 4. Run the dev server: `npm run dev`
215
+
216
+ ## Commands
217
+ | Command | Description |
218
+ |---------|-------------|
219
+ | `npm run dev` | Start development server |
220
+ | `npm test` | Run tests |
221
+ | `npm run build` | Production build |
222
+ | `npm run lint` | Run linter |
223
+
224
+ ## Architecture
225
+ Brief overview of the project structure and key design decisions.
226
+ Link to ADRs for details.
227
+
228
+ ## Contributing
229
+ How to contribute, coding standards, PR process.
230
+ ```
231
+
232
+ ## Changelog Maintenance
233
+
234
+ For shipped features:
235
+
236
+ ```markdown
237
+ # Changelog
238
+
239
+ ## [1.2.0] - 2025-01-20
240
+ ### Added
241
+ - Task sharing: users can share tasks with team members (#123)
242
+ - Email notifications for task assignments (#124)
243
+
244
+ ### Fixed
245
+ - Duplicate tasks appearing when rapidly clicking create button (#125)
246
+
247
+ ### Changed
248
+ - Task list now loads 50 items per page (was 20) for better UX (#126)
249
+ ```
250
+
251
+ ## Documentation for Agents
252
+
253
+ Special consideration for AI agent context:
254
+
255
+ - **CLAUDE.md / rules files** — Document project conventions so agents follow them
256
+ - **Spec files** — Keep specs updated so agents build the right thing
257
+ - **ADRs** — Help agents understand why past decisions were made (prevents re-deciding)
258
+ - **Inline gotchas** — Prevent agents from falling into known traps
259
+
260
+ ## Common Rationalizations
261
+
262
+ | Rationalization | Reality |
263
+ |---|---|
264
+ | "The code is self-documenting" | Code shows what. It doesn't show why, what alternatives were rejected, or what constraints apply. |
265
+ | "We'll write docs when the API stabilizes" | APIs stabilize faster when you document them. The doc is the first test of the design. |
266
+ | "Nobody reads docs" | Agents do. Future engineers do. Your 3-months-later self does. |
267
+ | "ADRs are overhead" | A 10-minute ADR prevents a 2-hour debate about the same decision six months later. |
268
+ | "Comments get outdated" | Comments on *why* are stable. Comments on *what* get outdated — that's why you only write the former. |
269
+
270
+ ## Red Flags
271
+
272
+ - Architectural decisions with no written rationale
273
+ - Public APIs with no documentation or types
274
+ - README that doesn't explain how to run the project
275
+ - Commented-out code instead of deletion
276
+ - TODO comments that have been there for weeks
277
+ - No ADRs in a project with significant architectural choices
278
+ - Documentation that restates the code instead of explaining intent
279
+
280
+ ## Verification
281
+
282
+ After documenting:
283
+
284
+ - [ ] ADRs exist for all significant architectural decisions
285
+ - [ ] README covers quick start, commands, and architecture overview
286
+ - [ ] API functions have parameter and return type documentation
287
+ - [ ] Known gotchas are documented inline where they matter
288
+ - [ ] No commented-out code remains
289
+ - [ ] Rules files (CLAUDE.md etc.) are current and accurate
290
+
291
+ ---
292
+ *Source: addyosmani/agent-skills (MIT). Ported into MaTrixOS shared-skills bundle.*