@runecraft/grimoire 1.0.0

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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -0
  3. package/catalog.json +9 -0
  4. package/dist/grimoire.js +1758 -0
  5. package/package.json +54 -0
  6. package/references/definition-of-done.md +67 -0
  7. package/references/testing-patterns.md +260 -0
  8. package/skills/code-review-and-quality/README.md +13 -0
  9. package/skills/code-review-and-quality/SKILL.md +389 -0
  10. package/skills/code-simplification/README.md +13 -0
  11. package/skills/code-simplification/SKILL.md +338 -0
  12. package/skills/debugging-and-error-recovery/README.md +13 -0
  13. package/skills/debugging-and-error-recovery/SKILL.md +343 -0
  14. package/skills/debugging-and-error-recovery/scripts/__pycache__/triage_state.cpython-314.pyc +0 -0
  15. package/skills/debugging-and-error-recovery/scripts/triage_state.py +206 -0
  16. package/skills/deprecation-and-migration/README.md +13 -0
  17. package/skills/deprecation-and-migration/SKILL.md +248 -0
  18. package/skills/deprecation-and-migration/scripts/__pycache__/migration_tracker.cpython-314.pyc +0 -0
  19. package/skills/deprecation-and-migration/scripts/migration_tracker.py +237 -0
  20. package/skills/doubt-driven-development/README.md +13 -0
  21. package/skills/doubt-driven-development/SKILL.md +251 -0
  22. package/skills/git-commit-learning/.skill-meta.json +14 -0
  23. package/skills/git-commit-learning/README.md +205 -0
  24. package/skills/git-commit-learning/SKILL.md +435 -0
  25. package/skills/git-commit-learning/references/commit-patterns.md +595 -0
  26. package/skills/git-worktree/README.md +13 -0
  27. package/skills/git-worktree/SKILL.md +220 -0
  28. package/skills/idea-refine/README.md +13 -0
  29. package/skills/idea-refine/SKILL.md +186 -0
  30. package/skills/interview-me/README.md +13 -0
  31. package/skills/interview-me/SKILL.md +233 -0
  32. package/skills/linkedin-audit/SKILL.md +98 -0
  33. package/skills/linkedin-audit/references/dashboard-spec.md +43 -0
  34. package/skills/memory-management/README.md +13 -0
  35. package/skills/memory-management/SKILL.md +198 -0
  36. package/skills/security-and-hardening/README.md +13 -0
  37. package/skills/security-and-hardening/SKILL.md +472 -0
  38. package/skills/shipping-and-launch/README.md +13 -0
  39. package/skills/shipping-and-launch/SKILL.md +317 -0
  40. package/skills/skill-forge/README.md +153 -0
  41. package/skills/skill-forge/SKILL.md +291 -0
  42. package/skills/skill-forge/assets/SKILL.template.md +73 -0
  43. package/skills/skill-forge/references/authoring-patterns.md +249 -0
  44. package/skills/skill-forge/references/description-optimization.md +171 -0
  45. package/skills/skill-forge/references/output-evaluation.md +276 -0
  46. package/skills/skill-forge/references/scripts-guide.md +232 -0
  47. package/skills/skill-forge/references/spec.md +175 -0
  48. package/skills/skill-forge/scripts/validate.py +536 -0
  49. package/skills/spec-driven/.skill-meta.json +14 -0
  50. package/skills/spec-driven/README.md +335 -0
  51. package/skills/spec-driven/SKILL.md +174 -0
  52. package/skills/spec-driven/references/code-analysis.md +98 -0
  53. package/skills/spec-driven/references/coding-principles.md +56 -0
  54. package/skills/spec-driven/references/context-limits.md +31 -0
  55. package/skills/spec-driven/references/design.md +199 -0
  56. package/skills/spec-driven/references/discuss.md +136 -0
  57. package/skills/spec-driven/references/implement.md +425 -0
  58. package/skills/spec-driven/references/lessons.md +113 -0
  59. package/skills/spec-driven/references/memory.md +126 -0
  60. package/skills/spec-driven/references/specify.md +210 -0
  61. package/skills/spec-driven/references/sub-agents.md +96 -0
  62. package/skills/spec-driven/references/tasks.md +484 -0
  63. package/skills/spec-driven/references/validate.md +350 -0
  64. package/skills/spec-driven/scripts/__pycache__/lessons.cpython-314.pyc +0 -0
  65. package/skills/spec-driven/scripts/lessons.py +370 -0
  66. package/skills/spec-loop/README.md +36 -0
  67. package/skills/spec-loop/SKILL.md +61 -0
  68. package/skills/test-driven-development/README.md +13 -0
  69. package/skills/test-driven-development/SKILL.md +388 -0
  70. package/skills/typescript-patterns/README.md +13 -0
  71. package/skills/typescript-patterns/SKILL.md +346 -0
  72. package/skills/using-agent-skills/README.md +13 -0
  73. package/skills/using-agent-skills/SKILL.md +187 -0
@@ -0,0 +1,346 @@
1
+ ---
2
+ name: typescript-patterns
3
+ description: >
4
+ TypeScript best practices and patterns for type-safe, maintainable code.
5
+ Covers discriminated unions, generics, const assertions, type narrowing,
6
+ and common anti-patterns. Extends (does not override) project tsconfig.
7
+ EN triggers: /typescript, TypeScript patterns, TS best practices, type safety, discriminated unions, generics, type narrowing.
8
+ PT triggers: /typescript, padrões TypeScript, boas práticas TS, segurança de tipos, unions discriminadas, genéricos.
9
+ Do NOT use for: JavaScript-only projects, runtime performance, or replacing project tsconfig rules.
10
+ license: CC-BY-4.0
11
+ ---
12
+
13
+ # TypeScript Patterns
14
+
15
+ ## Overview
16
+
17
+ This skill provides TypeScript patterns that produce type-safe, maintainable code. It extends your project's tsconfig — not overrides it. When in conflict, the project tsconfig wins.
18
+
19
+ All patterns assume strict mode is enabled (`strict: true` in tsconfig) and that `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`, and other strict-family flags are on when available. The patterns work with the strictest reasonable settings — they never rely on lax compiler options.
20
+
21
+ ## When to Use
22
+
23
+ - Writing new TypeScript code
24
+ - Refactoring existing code for stronger type safety
25
+ - Reviewing code for type-level issues
26
+ - Eliminating `any` and `as` casts from a codebase
27
+ - Designing shared types, APIs, or generic utilities
28
+ - Deciding between structurally equivalent alternatives (union vs enum, optional vs `| undefined`)
29
+
30
+ ## Core Patterns
31
+
32
+ ### 1. Discriminated Unions
33
+
34
+ Use a `kind` (or `type`) field to create a union that the compiler can exhaustively narrow.
35
+
36
+ ```typescript
37
+ type Shape =
38
+ | { kind: 'circle'; radius: number }
39
+ | { kind: 'rectangle'; width: number; height: number }
40
+ | { kind: 'triangle'; base: number; height: number };
41
+
42
+ function area(shape: Shape): number {
43
+ switch (shape.kind) {
44
+ case 'circle':
45
+ return Math.PI * shape.radius ** 2;
46
+ case 'rectangle':
47
+ return shape.width * shape.height;
48
+ case 'triangle':
49
+ return (shape.base * shape.height) / 2;
50
+ }
51
+ }
52
+ ```
53
+
54
+ **Exhaustiveness check** — add a `never`-asserting helper so adding a new variant produces a compile error, not a silent fallthrough:
55
+
56
+ ```typescript
57
+ function assertNever(value: never): never {
58
+ throw new Error(`Unhandled case: ${JSON.stringify(value)}`);
59
+ }
60
+
61
+ function area(shape: Shape): number {
62
+ switch (shape.kind) {
63
+ case 'circle':
64
+ return Math.PI * shape.radius ** 2;
65
+ case 'rectangle':
66
+ return shape.width * shape.height;
67
+ case 'triangle':
68
+ return (shape.base * shape.height) / 2;
69
+ default:
70
+ return assertNever(shape);
71
+ }
72
+ }
73
+ ```
74
+
75
+ Prefer string literal unions over boolean flags for mutually exclusive states. `{ status: 'loading' } | { status: 'success'; data: T } | { status: 'error'; error: Error }` is clearer than `{ loading: boolean; data?: T; error?: Error }` and eliminates impossible states.
76
+
77
+ ### 2. Generics with Constraints
78
+
79
+ Always constrain generic parameters to the shape you actually depend on. A bare `<T>` gives no information to the caller or the compiler.
80
+
81
+ ```typescript
82
+ // BAD: T could be anything — no way to access .id
83
+ function first<T>(items: T[]): T {
84
+ return items[0];
85
+ }
86
+
87
+ // GOOD: constraint communicates intent and enables property access
88
+ function first<T extends { id: string }>(items: T[]): T {
89
+ return items[0];
90
+ }
91
+ ```
92
+
93
+ Keep generics shallow. If you need four or more type parameters, reconsider the abstraction — it may be too general or the responsibilities should be split.
94
+
95
+ ```typescript
96
+ // BAD: too many unconstrained params
97
+ function map<S, T, U, V>(a: S[], b: T[], fn: (a: S, b: T) => [U, V]): [U[], V[]] { /* ... */ }
98
+
99
+ // GOOD: compose simpler functions instead
100
+ ```
101
+
102
+ Use `extends` to narrow, `infer` to extract (in conditional types), and defaults (`<T = unknown>`) to make call sites ergonomic.
103
+
104
+ ### 3. Const Assertions
105
+
106
+ `as const` tells the compiler to infer the narrowest possible type — literal values and `readonly` tuples/objects.
107
+
108
+ ```typescript
109
+ // Without as const: widened to string[]
110
+ const COLORS = ['red', 'green', 'blue'];
111
+ // type: string[]
112
+
113
+ // With as const: narrowed to readonly tuple of literals
114
+ const COLORS = ['red', 'green', 'blue'] as const;
115
+ // type: readonly ["red", "green", "blue"]
116
+
117
+ type Color = (typeof COLORS)[number];
118
+ // type Color = "red" | "green" | "blue"
119
+ ```
120
+
121
+ Use `as const` for:
122
+ - Enumerations (prefer over `enum`)
123
+ - Configuration objects that drive conditional types
124
+ - Literal-tuple derived union types
125
+ - `const` objects used as lookup tables
126
+
127
+ ```typescript
128
+ const STATUS_MAP = {
129
+ draft: 'Draft',
130
+ published: 'Published',
131
+ archived: 'Archived',
132
+ } as const;
133
+
134
+ type Status = keyof typeof STATUS_MAP; // "draft" | "published" | "archived"
135
+ ```
136
+
137
+ ### 4. Type Narrowing
138
+
139
+ Narrow types explicitly. The compiler can follow `typeof`, `instanceof`, `in`, and custom type guards — use them instead of casting.
140
+
141
+ ```typescript
142
+ function process(input: string | number | Date) {
143
+ if (typeof input === 'string') {
144
+ return input.toUpperCase(); // input: string
145
+ }
146
+ if (typeof input === 'number') {
147
+ return input.toFixed(2); // input: number
148
+ }
149
+ return input.toISOString(); // input: Date (by elimination)
150
+ }
151
+ ```
152
+
153
+ **Custom type guards** make complex narrowing reusable:
154
+
155
+ ```typescript
156
+ function isUser(obj: unknown): obj is User {
157
+ return (
158
+ typeof obj === 'object' &&
159
+ obj !== null &&
160
+ 'id' in obj &&
161
+ 'email' in obj
162
+ );
163
+ }
164
+
165
+ function process(input: unknown) {
166
+ if (isUser(input)) {
167
+ console.log(input.email); // input: User
168
+ }
169
+ }
170
+ ```
171
+
172
+ **`in` operator** for discriminated properties when you don't control the union:
173
+
174
+ ```typescript
175
+ type Response = SuccessResponse | ErrorResponse;
176
+
177
+ if ('data' in response) {
178
+ console.log(response.data); // response: SuccessResponse
179
+ }
180
+ ```
181
+
182
+ Use `unknown` at system boundaries (API responses, parsed JSON, message queues). Narrow to a known type before use — never cast.
183
+
184
+ ```typescript
185
+ function parseApiResponse(raw: unknown): User[] {
186
+ if (!Array.isArray(raw)) throw new Error('Expected array');
187
+ return raw.map((item) => {
188
+ if (!isUser(item)) throw new Error('Invalid user shape');
189
+ return item; // item: User
190
+ });
191
+ }
192
+ ```
193
+
194
+ ### 5. Template Literal Types
195
+
196
+ Use template literal types for string pattern matching — route params, event names, CSS-in-JS, and more.
197
+
198
+ ```typescript
199
+ type EventName = `${string}:${string}`;
200
+ // "click:button", "key:enter", "submit:form"
201
+
202
+ type CSSUnit = `${number}${'px' | 'rem' | 'em' | '%'}`;
203
+ // "16px", "1.5rem", "80%"
204
+
205
+ type RouteParams<T extends string> =
206
+ T extends `${string}:${infer Param}/${infer Rest}`
207
+ ? Param | RouteParams<Rest>
208
+ : T extends `${string}:${infer Param}`
209
+ ? Param
210
+ : never;
211
+
212
+ type Params = RouteParams<'/users/:userId/posts/:postId'>;
213
+ // "userId" | "postId"
214
+ ```
215
+
216
+ Combine with `Capitalize`, `Uncapitalize`, `Uppercase`, and `Lowercase` intrinsic types for string transformation:
217
+
218
+ ```typescript
219
+ type Getters<T extends string> = `get${Capitalize<T>}`;
220
+ type UserGetters = Getters<'name' | 'email'>; // "getName" | "getEmail"
221
+ ```
222
+
223
+ ### 6. Utility Types
224
+
225
+ Know the standard library before writing custom mapped types.
226
+
227
+ | Utility | Use when |
228
+ |---------|----------|
229
+ | `Partial<T>` | All properties optional — e.g., update DTOs |
230
+ | `Required<T>` | All properties required — remove optionality |
231
+ | `Pick<T, K>` | Select a subset of keys — API response shaping |
232
+ | `Omit<T, K>` | Exclude specific keys — public vs internal types |
233
+ | `Record<K, V>` | Map a union of keys to a single value type |
234
+ | `Readonly<T>` | Prevent mutation — function parameters, config |
235
+ | `NonNullable<T>` | Strip `null` and `undefined` from a union |
236
+ | `ReturnType<T>` | Extract the return type of a function type |
237
+ | `Awaited<T>` | Unwrap a Promise type recursively |
238
+
239
+ ```typescript
240
+ interface User {
241
+ id: string;
242
+ email: string;
243
+ passwordHash: string;
244
+ createdAt: Date;
245
+ }
246
+
247
+ type PublicUser = Omit<User, 'passwordHash'>;
248
+ type UpdateUserDTO = Partial<Pick<User, 'email'>>;
249
+
250
+ type Status = 'active' | 'inactive';
251
+ const statusLabels: Record<Status, string> = {
252
+ active: 'Active',
253
+ inactive: 'Inactive',
254
+ };
255
+ ```
256
+
257
+ ## Anti-Patterns to Avoid
258
+
259
+ ### `any` — Use `unknown` Then Narrow
260
+
261
+ `any` disables type checking entirely. Use `unknown` at boundaries and narrow before use.
262
+
263
+ ```typescript
264
+ // BAD
265
+ function handle(data: any) {
266
+ console.log(data.email); // no error, no safety
267
+ }
268
+
269
+ // GOOD
270
+ function handle(data: unknown) {
271
+ if (isUser(data)) {
272
+ console.log(data.email); // safe
273
+ }
274
+ }
275
+ ```
276
+
277
+ ### Type Assertions (`as Type`) — Prefer Type Guards
278
+
279
+ Assertions silence the compiler but don't validate at runtime. A type guard narrows through actual checks.
280
+
281
+ ```typescript
282
+ // BAD: assertion — no runtime check
283
+ const user = response.data as User;
284
+
285
+ // GOOD: type guard — validates at runtime
286
+ if (!isUser(response.data)) throw new Error('Unexpected shape');
287
+ const user = response.data; // user: User
288
+ ```
289
+
290
+ The one acceptable use of `as` is `as const` for literal inference (see Core Pattern 3).
291
+
292
+ ### Overly Complex Generics
293
+
294
+ If a generic has four or more type parameters, or if the conditional types are three levels deep, it's probably over-designed. Prefer simpler, more concrete types unless the abstraction pays for itself across at least three call sites.
295
+
296
+ ### `enum` — Prefer `as const` Objects or String Literal Unions
297
+
298
+ TypeScript's `enum` is a runtime construct with surprising behavior (reverse mapping, numeric auto-increment, const-enum pitfalls). String literal unions and `as const` objects are simpler and more predictable.
299
+
300
+ ```typescript
301
+ // BAD: enum
302
+ enum Status {
303
+ Active = 'active',
304
+ Inactive = 'inactive',
305
+ }
306
+
307
+ // GOOD: string literal union
308
+ type Status = 'active' | 'inactive';
309
+
310
+ // GOOD: as const object (when you need runtime access to values)
311
+ const Status = {
312
+ Active: 'active',
313
+ Inactive: 'inactive',
314
+ } as const;
315
+ type Status = (typeof Status)[keyof typeof Status];
316
+ ```
317
+
318
+ ### Optional Chaining Abuse
319
+
320
+ `?.` everywhere makes error sources invisible. Use it intentionally at boundaries where `null`/`undefined` is expected, and prefer early returns with explicit null checks inside function bodies.
321
+
322
+ ```typescript
323
+ // BAD: silent failure — if anything is missing, result is undefined with no trace
324
+ const result = data?.nested?.deeply?.value?.toString()?.toUpperCase();
325
+
326
+ // GOOD: explicit null checks with clear error boundaries
327
+ function format(data: Data): string {
328
+ if (!data.nested?.deeply?.value) {
329
+ throw new Error('Missing deeply nested value');
330
+ }
331
+ return data.nested.deeply.value.toString().toUpperCase();
332
+ }
333
+ ```
334
+
335
+ ## Verification
336
+
337
+ After applying TypeScript patterns to new or refactored code:
338
+
339
+ - [ ] Zero `any` in new code (or every `any` is justified by a comment explaining why `unknown`+narrowing wasn't feasible)
340
+ - [ ] Type assertions (`as Type`) are replaced by type guards or explicit validation
341
+ - [ ] Discriminated unions have an exhaustiveness check (`assertNever` in `default` branch)
342
+ - [ ] Generics have meaningful constraints (`extends ...`) — no bare `<T>`
343
+ - [ ] `enum` declarations are avoided in favor of string unions or `as const` objects
344
+ - [ ] `unknown` is used at system boundaries (API responses, parsed JSON, message queues) and narrowed before use
345
+ - [ ] Optional chaining is used intentionally at boundaries, not as a blanket pattern throughout functions
346
+ - [ ] The code compiles with `strict: true` and no `@ts-ignore` or `@ts-expect-error` suppression comments
@@ -0,0 +1,13 @@
1
+ # using-agent-skills
2
+
3
+ **Meta-skill** — discover and dispatch to the right Runecraft skill for the current task.
4
+
5
+ | Field | Value |
6
+ |-------|-------|
7
+ | Version | 1.0.0 |
8
+ | Trigger | `/skill` |
9
+ | PT trigger | "qual skill", "qual fluxo usar" |
10
+
11
+ **Do not use for** actual implementation work (route to the specific skill instead) or unrelated standalone tasks outside the Runecraft catalog.
12
+
13
+ See [SKILL.md](SKILL.md) for the full dispatch table and process.
@@ -0,0 +1,187 @@
1
+ ---
2
+ name: using-agent-skills
3
+ description: >
4
+ Discovers and invokes the right @runecraft/grimoire skill for the current task.
5
+ Use when starting a session, when a request is ambiguous about which workflow to apply,
6
+ or when you need to pick among the 19-skill Runecraft catalog.
7
+ EN triggers: /skill, which skill, pick a skill, what skill should I use, skill discovery, meta skill.
8
+ PT triggers: qual skill, qual habilidade, descobrir skill, qual fluxo usar.
9
+ Do NOT use for: actual implementation work (route to the specific skill instead), unrelated
10
+ standalone tasks outside the Runecraft catalog, or runtime-specific configuration (e.g.,
11
+ opencode.json / Claude Code plugin paths).
12
+ license: CC-BY-4.0
13
+ ---
14
+
15
+ # Using Agent Skills
16
+
17
+ ## Overview
18
+
19
+ Agent Skills is a collection of engineering workflow skills organized by development phase. Each skill encodes a specific process that senior engineers follow. This meta-skill helps you discover and apply the right skill for your current task.
20
+
21
+ ## Skill Discovery
22
+
23
+ When a task arrives, identify the development phase and apply the corresponding skill:
24
+
25
+ ```
26
+ Task arrives
27
+
28
+ ├── Don't know what you want yet? ──────→ interview-me
29
+ ├── Have a rough concept, need variants? → idea-refine
30
+ ├── New project/feature/change? ────→ spec-driven
31
+ ├── Implementing code? ─────────────→ spec-driven
32
+ │ ├── TypeScript code? ──────────→ typescript-patterns
33
+ │ ├── Stakes high / unfamiliar code? ──→ doubt-driven-development
34
+ │ └── Driving a loop? ──────────────→ spec-loop
35
+ │ ├── Need a plan/spec first? ────→ spec-driven
36
+ │ └── Verify the executed work? ───→ spec-driven
37
+ ├── Writing/running tests? ─────────→ test-driven-development
38
+ ├── Something broke? ───────────────→ debugging-and-error-recovery
39
+ ├── Reviewing code? ────────────────→ code-review-and-quality
40
+ │ ├── Too complex? ──────────────→ code-simplification
41
+ │ └── Security concerns? ────────→ security-and-hardening
42
+ ├── Deprecating/migrating? ─────────→ deprecation-and-migration
43
+ ├── Deploying/launching? ───────────→ shipping-and-launch
44
+ ├── Git work? ─────────────────────→ git-worktree
45
+ │ └── Mining history for knowledge? → git-commit-learning
46
+ ├── Project memory for the agent? ──→ memory-management
47
+ ├── Creating a new skill? ──────────→ skill-forge
48
+ └── LinkedIn profile audit? ────────→ linkedin-audit
49
+ ```
50
+
51
+ ## Core Operating Behaviors
52
+
53
+ These behaviors apply at all times, across all skills. They are non-negotiable.
54
+
55
+ ### 1. Surface Assumptions
56
+
57
+ Before implementing anything non-trivial, explicitly state your assumptions:
58
+
59
+ ```
60
+ ASSUMPTIONS I'M MAKING:
61
+ 1. [assumption about requirements]
62
+ 2. [assumption about architecture]
63
+ 3. [assumption about scope]
64
+ → Correct me now or I'll proceed with these.
65
+ ```
66
+
67
+ Don't silently fill in ambiguous requirements. The most common failure mode is making wrong assumptions and running with them unchecked. Surface uncertainty early — it's cheaper than rework.
68
+
69
+ ### 2. Manage Confusion Actively
70
+
71
+ When you encounter inconsistencies, conflicting requirements, or unclear specifications:
72
+
73
+ 1. **STOP.** Do not proceed with a guess.
74
+ 2. Name the specific confusion.
75
+ 3. Present the tradeoff or ask the clarifying question.
76
+ 4. Wait for resolution before continuing.
77
+
78
+ **Bad:** Silently picking one interpretation and hoping it's right.
79
+ **Good:** "I see X in the spec but Y in the existing code. Which takes precedence?"
80
+
81
+ ### 3. Push Back When Warranted
82
+
83
+ You are not a yes-machine. When an approach has clear problems:
84
+
85
+ - Point out the issue directly
86
+ - Explain the concrete downside (quantify when possible — "this adds ~200ms latency" not "this might be slower")
87
+ - Propose an alternative
88
+ - Accept the human's decision if they override with full information
89
+
90
+ Sycophancy is a failure mode. "Of course!" followed by implementing a bad idea helps no one. Honest technical disagreement is more valuable than false agreement.
91
+
92
+ ### 4. Enforce Simplicity
93
+
94
+ Your natural tendency is to overcomplicate. Actively resist it.
95
+
96
+ Before finishing any implementation, ask:
97
+ - Can this be done in fewer lines?
98
+ - Are these abstractions earning their complexity?
99
+ - Would a staff engineer look at this and say "why didn't you just..."?
100
+
101
+ If you build 1000 lines and 100 would suffice, you have failed. Prefer the boring, obvious solution. Cleverness is expensive.
102
+
103
+ ### 5. Maintain Scope Discipline
104
+
105
+ Touch only what you're asked to touch.
106
+
107
+ Do NOT:
108
+ - Remove comments you don't understand
109
+ - "Clean up" code orthogonal to the task
110
+ - Refactor adjacent systems as a side effect
111
+ - Delete code that seems unused without explicit approval
112
+ - Add features not in the spec because they "seem useful"
113
+
114
+ Your job is surgical precision, not unsolicited renovation.
115
+
116
+ ### 6. Verify, Don't Assume
117
+
118
+ Every skill includes a verification step. A task is not complete until verification passes. "Seems right" is never sufficient — there must be evidence (passing tests, build output, runtime data).
119
+
120
+ Per-skill verification is the local check. The project-wide bar that applies to *every* change, regardless of which skill is active, is the Definition of Done: tests pass, no regressions, behavior verified at runtime, docs updated. See `references/definition-of-done.md`. It complements each task's acceptance criteria rather than replacing them.
121
+
122
+ ## Failure Modes to Avoid
123
+
124
+ These are the subtle errors that look like productivity but create problems:
125
+
126
+ 1. Making wrong assumptions without checking
127
+ 2. Not managing your own confusion — plowing ahead when lost
128
+ 3. Not surfacing inconsistencies you notice
129
+ 4. Not presenting tradeoffs on non-obvious decisions
130
+ 5. Being sycophantic ("Of course!") to approaches with clear problems
131
+ 6. Overcomplicating code and APIs
132
+ 7. Modifying code or comments orthogonal to the task
133
+ 8. Removing things you don't fully understand
134
+ 9. Building without a spec because "it's obvious"
135
+ 10. Skipping verification because "it looks right"
136
+
137
+ ## Skill Rules
138
+
139
+ 1. **Check for an applicable skill before starting work.** Skills encode processes that prevent common mistakes.
140
+
141
+ 2. **Skills are workflows, not suggestions.** Follow the steps in order. Don't skip verification steps.
142
+
143
+ 3. **Multiple skills can apply.** A feature implementation might involve `idea-refine` → `spec-driven` → `test-driven-development` → `code-review-and-quality` → `code-simplification` → `shipping-and-launch` in sequence.
144
+
145
+ 4. **When in doubt, start with a spec.** If the task is non-trivial and there's no spec, begin with `spec-driven`.
146
+
147
+ ## Lifecycle Sequence
148
+
149
+ For a complete feature, the typical skill sequence is:
150
+
151
+ ```
152
+ 1. interview-me → Extract what the user actually wants
153
+ 2. idea-refine → Refine vague ideas
154
+ 3. spec-driven → Specify, design, and break into verifiable chunks
155
+ 4. doubt-driven-development → Cross-examine non-trivial decisions in-flight
156
+ 5. test-driven-development → Prove each slice works
157
+ 6. code-review-and-quality → Review before merge
158
+ 7. code-simplification → Reduce unnecessary complexity while preserving behavior
159
+ 8. deprecation-and-migration → Retire old systems and move users safely when needed
160
+ 9. shipping-and-launch → Deploy safely
161
+ ```
162
+
163
+ Not every task needs every skill. A bug fix might only need: `debugging-and-error-recovery` → `test-driven-development` → `code-review-and-quality`.
164
+
165
+ ## Quick Reference
166
+
167
+ | Phase | Skill | One-Line Summary |
168
+ |-------|-------|-----------------|
169
+ | Define | interview-me | Surface what the user actually wants before any plan, spec, or code exists |
170
+ | Define | idea-refine | Refine ideas through structured divergent and convergent thinking |
171
+ | Define | spec-driven | Specify, design, and break work into verifiable tasks before code |
172
+ | Build | typescript-patterns | Type-safe, maintainable TypeScript patterns |
173
+ | Build | doubt-driven-development | Adversarial fresh-context review of every non-trivial decision |
174
+ | Verify | test-driven-development | Failing test first, then make it pass |
175
+ | Verify | debugging-and-error-recovery | Reproduce → localize → fix → guard |
176
+ | Review | code-review-and-quality | Five-axis review with quality gates |
177
+ | Review | code-simplification | Preserve behavior while reducing unnecessary complexity |
178
+ | Review | security-and-hardening | OWASP prevention, input validation, least privilege |
179
+ | Ship | deprecation-and-migration | Remove old systems and migrate users safely |
180
+ | Ship | shipping-and-launch | Pre-launch checklist, monitoring, rollback plan |
181
+ | Git | git-worktree | Parallel feature branches in isolated worktrees |
182
+ | Git | git-commit-learning | Mine git history into reusable project memory |
183
+ | Memory | memory-management | Project decisions and error patterns in `.agent-memory/` |
184
+ | Loop | spec-loop | Milestone-loop runner: drives .specs artifacts to completion (gates, atomic commits, STATE.md) |
185
+ | Meta | using-agent-skills | Discover and route to the right skill (this skill) |
186
+ | Meta | skill-forge | Design, author, and validate new Agent Skills |
187
+ | Domain | linkedin-audit | LinkedIn profile analysis with 0-10 scores and HTML dashboard |