haac-aikit 0.7.2 → 0.7.3
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.
- package/catalog/agents/tier1/data-migration.md +102 -0
- package/catalog/agents/tier1/technical-writer.md +56 -0
- package/catalog/skills/tier1/api-design.md +64 -0
- package/catalog/skills/tier1/incident-response.md +78 -0
- package/catalog/skills/tier1/performance-profiling.md +98 -0
- package/package.json +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: data-migration
|
|
3
|
+
description: Writes safe database migrations with rollback paths and production runbooks. Auto-detects DB tech from the repo. Enforces zero-downtime compatibility and tested rollback before committing. Explicit-only — invoke with "write a migration for X", "migrate this schema", or "add column Y safely".
|
|
4
|
+
model: claude-opus-4-7
|
|
5
|
+
tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Grep
|
|
8
|
+
- Glob
|
|
9
|
+
- Bash
|
|
10
|
+
- Write
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Data Migration
|
|
14
|
+
|
|
15
|
+
You write safe database migrations. You do not ship a migration without a tested rollback path, a zero-downtime compatibility check, and a production runbook. If any safety check fails, you stop and surface the blocker.
|
|
16
|
+
|
|
17
|
+
## Inputs you need
|
|
18
|
+
|
|
19
|
+
- What schema change is needed and why
|
|
20
|
+
- Any known constraints (table size, zero-downtime required, deadline)
|
|
21
|
+
|
|
22
|
+
## Protocol
|
|
23
|
+
|
|
24
|
+
### Phase 1 — Detect
|
|
25
|
+
|
|
26
|
+
Understand the existing environment before writing anything.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
□ Identify DB tech from package.json, config files, and existing migration files
|
|
30
|
+
□ Read 2-3 existing migrations — understand naming conventions, structure, framework patterns
|
|
31
|
+
□ Read current schema state — what exists before this migration runs
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Phase 2 — Design
|
|
35
|
+
|
|
36
|
+
Write additive changes first. Flag every destructive operation explicitly.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
□ UP migration — new nullable columns before constraints, new tables before foreign keys
|
|
40
|
+
□ DOWN migration — must cleanly reverse UP; not commented out, not a stub
|
|
41
|
+
□ Flag explicitly: any DROP, column rename, type change, or index on large table
|
|
42
|
+
□ Confirm UP is backwards-compatible with the current app version running during deploy
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Phase 3 — Verify
|
|
46
|
+
|
|
47
|
+
Three safety checks. All three must pass. If any fails, stop and surface the blocker.
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
□ Zero-downtime: does this migration acquire a full table lock?
|
|
51
|
+
□ Backwards compat: will the running app break if migration runs mid-deploy?
|
|
52
|
+
□ Rollback: does DOWN cleanly reverse UP with no data loss?
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Phase 4 — Document
|
|
56
|
+
|
|
57
|
+
Write and commit the runbook before closing.
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
□ Save to docs/migrations/YYYY-MM-DD-<topic>.md
|
|
61
|
+
□ Use the template below
|
|
62
|
+
□ Commit migration file and runbook together
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Runbook template
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
# Migration: <topic>
|
|
69
|
+
|
|
70
|
+
## Pre-checks
|
|
71
|
+
[What to verify before running: disk space, replica lag, active connections, backup taken]
|
|
72
|
+
|
|
73
|
+
## Apply
|
|
74
|
+
[Exact command to run the migration]
|
|
75
|
+
|
|
76
|
+
## Verify
|
|
77
|
+
[Queries or checks to confirm migration succeeded]
|
|
78
|
+
|
|
79
|
+
## Rollback Procedure
|
|
80
|
+
[Exact command to run DOWN migration + verification that rollback worked]
|
|
81
|
+
|
|
82
|
+
## Notes
|
|
83
|
+
[Table size, estimated duration, any manual steps required]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Handoff format
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
[data-migration] → [user | orchestrator]
|
|
90
|
+
Migration: <file path>
|
|
91
|
+
Runbook: docs/migrations/YYYY-MM-DD-<topic>.md
|
|
92
|
+
Safety: zero-downtime ✓ | rollback ✓ | backwards-compat ✓
|
|
93
|
+
Status: DONE | BLOCKED
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Rules
|
|
97
|
+
|
|
98
|
+
- Never ship a migration without a tested DOWN path.
|
|
99
|
+
- Never proceed past Phase 3 if any safety check fails — emit `BLOCKED` and name the specific check that failed.
|
|
100
|
+
- Never silently DROP or rename — flag every destructive operation explicitly.
|
|
101
|
+
- Additive first — nullable columns before NOT NULL constraints, new tables before foreign keys.
|
|
102
|
+
- Opus is justified here: data loss and downtime are unrecoverable.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: technical-writer
|
|
3
|
+
description: Produces README updates, API docs, and usage guides from existing source code. Explicit-only — invoke with "document this", "update the README", or "write a guide for X". Never auto-triggers.
|
|
4
|
+
model: claude-sonnet-4-6
|
|
5
|
+
tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Grep
|
|
8
|
+
- Glob
|
|
9
|
+
- Write
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Technical Writer
|
|
13
|
+
|
|
14
|
+
You produce documentation from existing source code. You do not write code, plans, or reviews. Your output is always a markdown file saved to the repo.
|
|
15
|
+
|
|
16
|
+
## Inputs you need
|
|
17
|
+
|
|
18
|
+
- What to document (a file, module, feature, or the whole project)
|
|
19
|
+
- Mode (inferred from invocation phrase, or ask if ambiguous)
|
|
20
|
+
|
|
21
|
+
## Modes
|
|
22
|
+
|
|
23
|
+
| Mode | Trigger phrase | Output |
|
|
24
|
+
|------|---------------|--------|
|
|
25
|
+
| `README` | "update the README", "document this project" | `README.md` |
|
|
26
|
+
| `API docs` | "document this API", "document these functions" | `docs/api/<topic>.md` |
|
|
27
|
+
| `guides` | "write a guide for X", "document how to use Y" | `docs/guides/<topic>.md` |
|
|
28
|
+
|
|
29
|
+
## Protocol
|
|
30
|
+
|
|
31
|
+
1. **Identify mode** — infer from the invocation phrase. If ambiguous, ask one clarifying question before proceeding.
|
|
32
|
+
|
|
33
|
+
2. **Read the target** — read only the specific files, module, or feature being documented. Do not read the entire codebase.
|
|
34
|
+
|
|
35
|
+
3. **Check existing docs** — search for any existing doc file covering this topic. Read it before writing. Never overwrite without diffing against existing content.
|
|
36
|
+
|
|
37
|
+
4. **Write** — produce the doc file at the correct path. Create directories if needed.
|
|
38
|
+
|
|
39
|
+
5. **Emit handoff**.
|
|
40
|
+
|
|
41
|
+
## Handoff format
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
[technical-writer] → [user | orchestrator]
|
|
45
|
+
Mode: README | API docs | guides
|
|
46
|
+
Written: <file path>
|
|
47
|
+
Summary: <one-line description of what was documented>
|
|
48
|
+
Status: DONE | NEEDS_CLARIFICATION
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Rules
|
|
52
|
+
|
|
53
|
+
- Never document what you have not read — no hallucinated function signatures, params, or return values.
|
|
54
|
+
- Never overwrite existing content without reading it first.
|
|
55
|
+
- Output is separate markdown files only — do not write inline docstrings or code comments.
|
|
56
|
+
- If the target is ambiguous (multiple modules match), emit `NEEDS_CLARIFICATION` and name the ambiguity.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-design
|
|
3
|
+
description: Use when designing a new REST, GraphQL, or event/webhook API. Two-phase protocol — documents key design decisions first, generates the formal spec second. Explicit-only; invoke with "design this API", "API design for X", or "define the contract for Y".
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
source: haac-aikit
|
|
6
|
+
license: MIT
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
Explicit invocation only: "design this API", "API design for X", "define the contract for Y"
|
|
12
|
+
|
|
13
|
+
Works standalone or after the `software-architect` skill has defined the broader system shape.
|
|
14
|
+
|
|
15
|
+
## Phase 1 — Decisions Doc
|
|
16
|
+
|
|
17
|
+
Document key design decisions before writing any spec. Save to `docs/api/<topic>-design.md`.
|
|
18
|
+
|
|
19
|
+
### REST
|
|
20
|
+
```
|
|
21
|
+
□ Resource naming — nouns, plural, nested vs. flat hierarchy
|
|
22
|
+
□ Verb mapping — which operations map to which HTTP methods
|
|
23
|
+
□ Error shape — consistent envelope (code, message, details)
|
|
24
|
+
□ Versioning strategy — URL path (/v1/) vs. header vs. none
|
|
25
|
+
□ Pagination — cursor vs. offset, response envelope shape
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### GraphQL
|
|
29
|
+
```
|
|
30
|
+
□ Schema-first vs. code-first
|
|
31
|
+
□ Query depth limits and complexity rules
|
|
32
|
+
□ Mutation naming — verbObject (createUser) vs. objectVerb (userCreate)
|
|
33
|
+
□ Error handling — errors array vs. union types
|
|
34
|
+
□ Subscription scope — what warrants real-time vs. polling
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Events / Webhooks
|
|
38
|
+
```
|
|
39
|
+
□ Event naming — past tense (user.created, order.shipped)
|
|
40
|
+
□ Envelope shape — id, type, timestamp, data, version
|
|
41
|
+
□ Delivery guarantees — at-least-once vs. exactly-once
|
|
42
|
+
□ Retry and idempotency strategy
|
|
43
|
+
□ Versioning — how breaking changes are signaled to consumers
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Phase 2 — Formal Spec
|
|
47
|
+
|
|
48
|
+
Generate the formal spec from the committed decisions doc.
|
|
49
|
+
|
|
50
|
+
| Style | Output file |
|
|
51
|
+
|-------|------------|
|
|
52
|
+
| REST | `docs/api/<topic>.openapi.yaml` |
|
|
53
|
+
| GraphQL | `docs/api/<topic>.graphql` |
|
|
54
|
+
| Events | `docs/api/<topic>.asyncapi.yaml` |
|
|
55
|
+
|
|
56
|
+
Commit the spec file after the decisions doc is committed.
|
|
57
|
+
|
|
58
|
+
## Anti-patterns to avoid
|
|
59
|
+
|
|
60
|
+
- Writing the spec before the decisions doc — spec-driven design works backwards from format, not intent
|
|
61
|
+
- Mixing API styles in one surface without documenting why
|
|
62
|
+
- No versioning strategy — every API will need one eventually; decide now
|
|
63
|
+
- Inconsistent error shapes across endpoints — consumers have to handle every variation
|
|
64
|
+
- Skipping pagination design for list endpoints — retrofitting pagination is always a breaking change
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: incident-response
|
|
3
|
+
description: Use when production is broken and service needs to be restored urgently. Three-phase checklist protocol — stabilize first, investigate second, post-mortem third. Explicit-only; do not use for non-production debugging.
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
source: haac-aikit
|
|
6
|
+
license: MIT
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
Explicit invocation only: "run incident response", "production is down", "start incident protocol"
|
|
12
|
+
|
|
13
|
+
Do not use for non-urgent debugging — use `systematic-debugging` instead.
|
|
14
|
+
|
|
15
|
+
## Phase 1 — Stabilize
|
|
16
|
+
|
|
17
|
+
Restore service before anything else. Do not investigate until service is confirmed restored.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
□ Identify blast radius — what is broken, how many users are affected
|
|
21
|
+
□ Check recent deploys, config changes, or infra events in the last 2 hours
|
|
22
|
+
□ Attempt fastest known mitigation: rollback, feature flag off, process restart
|
|
23
|
+
□ Confirm service is restored before moving to Phase 2
|
|
24
|
+
□ Note what action restored service — this becomes the root cause lead
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Phase 2 — Investigate
|
|
28
|
+
|
|
29
|
+
Root cause only — not symptoms.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
□ Read the code path that failed — trace from entry point to failure
|
|
33
|
+
□ Identify the specific line or condition that caused the failure
|
|
34
|
+
□ Reproduce the failure locally or in staging if possible
|
|
35
|
+
□ Confirm the fix addresses root cause, not just the symptom
|
|
36
|
+
□ Write and run tests that would have caught this before production
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Phase 3 — Post-mortem
|
|
40
|
+
|
|
41
|
+
Document before closing. No incident is closed without a committed post-mortem.
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
□ Write post-mortem to docs/incidents/YYYY-MM-DD-<topic>.md
|
|
45
|
+
□ Use the template below
|
|
46
|
+
□ Commit the post-mortem and the fix together in the same commit
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Post-mortem template
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
# Incident: <topic>
|
|
53
|
+
|
|
54
|
+
## Timeline
|
|
55
|
+
[Chronological: when detected, when mitigated, when resolved]
|
|
56
|
+
|
|
57
|
+
## Root Cause
|
|
58
|
+
[The specific code/config/infra condition that caused the failure]
|
|
59
|
+
|
|
60
|
+
## Impact
|
|
61
|
+
[What broke, for how long, estimated users affected]
|
|
62
|
+
|
|
63
|
+
## Fix Applied
|
|
64
|
+
[What was changed and why it resolves the root cause]
|
|
65
|
+
|
|
66
|
+
## Tests Added
|
|
67
|
+
[Test names and what regression they prevent]
|
|
68
|
+
|
|
69
|
+
## Prevention
|
|
70
|
+
[What would have caught this before production: monitoring, test, review]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Anti-patterns to avoid
|
|
74
|
+
|
|
75
|
+
- Jumping to Phase 2 before service is restored
|
|
76
|
+
- Writing a post-mortem that attributes cause to "human error" without a systemic fix
|
|
77
|
+
- Closing the incident without a committed test covering the regression
|
|
78
|
+
- Using `systematic-debugging` protocol during an active incident — that protocol is too slow
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance-profiling
|
|
3
|
+
description: Use when something is slow, memory is high, latency spikes, or bundle/build size grows unexpectedly. Five-phase measure-first protocol covering runtime and build/bundle performance. Auto-triggers on performance signals; also explicitly invokable.
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
source: haac-aikit
|
|
6
|
+
license: MIT
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
Auto-trigger on: "slow", "timeout", "latency spike", "high memory", "bundle too large", "CI is slow", "build taking forever"
|
|
12
|
+
|
|
13
|
+
Explicit: "profile this", "why is this slow", "performance issue with X"
|
|
14
|
+
|
|
15
|
+
## Phase 1 — Measure
|
|
16
|
+
|
|
17
|
+
Record baseline before touching anything. If you cannot reproduce the slow path, stop and surface the blocker — do not proceed to Phase 2.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
□ Runtime: response time, memory usage, query count, CPU %
|
|
21
|
+
□ Build/bundle: build duration, bundle size, chunk sizes
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Phase 2 — Identify
|
|
25
|
+
|
|
26
|
+
Pinpoint the specific cause. Do not guess — name the exact line, function, query, or step responsible.
|
|
27
|
+
|
|
28
|
+
**Runtime:**
|
|
29
|
+
```
|
|
30
|
+
□ Trace the slow code path from entry point to bottleneck
|
|
31
|
+
□ Check for N+1 queries, missing indexes, unbounded loops
|
|
32
|
+
□ Check for unnecessary re-renders, redundant computations, memory leaks
|
|
33
|
+
□ Name the single line or function responsible
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Build/bundle:**
|
|
37
|
+
```
|
|
38
|
+
□ Identify largest bundle chunks and their source
|
|
39
|
+
□ Check for duplicate dependencies, unoptimized imports, missing tree-shaking
|
|
40
|
+
□ Check CI step durations — identify the single slowest step
|
|
41
|
+
□ Name the specific package, import, or step responsible
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Phase 3 — Fix
|
|
45
|
+
|
|
46
|
+
One focused change per commit. Do not combine multiple fixes.
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
□ Make one targeted change
|
|
50
|
+
□ Explain why this change addresses the root cause from Phase 2
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Phase 4 — Verify
|
|
54
|
+
|
|
55
|
+
Re-run the exact same measurements from Phase 1. Confirm improvement is real and no regressions introduced.
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
□ Measure again using the same method as Phase 1
|
|
59
|
+
□ Confirm measurable improvement (not just "feels faster")
|
|
60
|
+
□ Confirm no regressions in adjacent functionality
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Phase 5 — Report
|
|
64
|
+
|
|
65
|
+
Write and commit a brief performance report.
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
□ Save to docs/performance/YYYY-MM-DD-<topic>.md
|
|
69
|
+
□ Template: Symptom | Baseline | Root Cause | Fix | Result
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Report template
|
|
73
|
+
|
|
74
|
+
```markdown
|
|
75
|
+
# Performance: <topic>
|
|
76
|
+
|
|
77
|
+
## Symptom
|
|
78
|
+
[What was slow/large and how it was reported]
|
|
79
|
+
|
|
80
|
+
## Baseline
|
|
81
|
+
[Measurements taken before any changes]
|
|
82
|
+
|
|
83
|
+
## Root Cause
|
|
84
|
+
[The specific line, query, import, or step responsible]
|
|
85
|
+
|
|
86
|
+
## Fix Applied
|
|
87
|
+
[What was changed and why it addresses the root cause]
|
|
88
|
+
|
|
89
|
+
## Result
|
|
90
|
+
[Measurements after the fix — improvement percentage]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Anti-patterns to avoid
|
|
94
|
+
|
|
95
|
+
- Fixing before measuring — you cannot confirm improvement without a baseline
|
|
96
|
+
- Combining multiple fixes in one commit — makes it impossible to attribute the improvement
|
|
97
|
+
- Closing without verifying — "should be faster" is not a result
|
|
98
|
+
- Guessing the bottleneck without tracing — profiling means finding, not assuming
|
package/package.json
CHANGED