agy-superpowers 5.2.1 → 5.2.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/README.md +47 -150
- package/package.json +1 -1
- package/template/agent/patches/skills-patches.md +23 -0
- package/template/agent/rules/scratch-scripts.md +37 -0
- package/template/agent/rules/superpowers.md +6 -50
- package/template/agent/skills/brainstorming/SKILL.md +4 -3
- package/template/agent/skills/brainstorming/visual-companion.md +2 -3
- package/template/agent/skills/finishing-a-development-branch/SKILL.md +11 -16
- package/template/agent/skills/subagent-driven-development/SKILL.md +16 -0
- package/template/agent/skills/subagent-driven-development/implementer-prompt.md +4 -3
- package/template/agent/skills/using-git-worktrees/SKILL.md +3 -2
- package/template/agent/skills/using-superpowers/SKILL.md +8 -6
- package/template/agent/skills/using-superpowers/references/copilot-tools.md +52 -0
- package/template/agent/skills/writing-plans/SKILL.md +5 -3
- package/template/agent/skills/writing-skills/SKILL.md +1 -1
- package/template/agent/superpowers-version.json +2 -2
- package/template/agent/tmp/agent-config-backup.yml +9 -0
- package/template/agent/skills/ai-integrated-product/SKILL.md +0 -57
- package/template/agent/skills/analytics-setup/SKILL.md +0 -51
- package/template/agent/skills/api-design/SKILL.md +0 -193
- package/template/agent/skills/app-store-optimizer/SKILL.md +0 -127
- package/template/agent/skills/auth-and-identity/SKILL.md +0 -167
- package/template/agent/skills/backend-developer/SKILL.md +0 -148
- package/template/agent/skills/bootstrapper-finance/SKILL.md +0 -55
- package/template/agent/skills/chrome-extension-developer/SKILL.md +0 -53
- package/template/agent/skills/community-manager/SKILL.md +0 -115
- package/template/agent/skills/content-marketer/SKILL.md +0 -111
- package/template/agent/skills/conversion-optimizer/SKILL.md +0 -142
- package/template/agent/skills/cto-architect/SKILL.md +0 -133
- package/template/agent/skills/customer-success-manager/SKILL.md +0 -126
- package/template/agent/skills/data-analyst/SKILL.md +0 -147
- package/template/agent/skills/devops-engineer/SKILL.md +0 -117
- package/template/agent/skills/email-infrastructure/SKILL.md +0 -164
- package/template/agent/skills/game-design/SKILL.md +0 -194
- package/template/agent/skills/game-developer/SKILL.md +0 -175
- package/template/agent/skills/growth-hacker/SKILL.md +0 -122
- package/template/agent/skills/idea-validator/SKILL.md +0 -55
- package/template/agent/skills/indie-legal/SKILL.md +0 -53
- package/template/agent/skills/influencer-marketer/SKILL.md +0 -141
- package/template/agent/skills/landing-page-builder/SKILL.md +0 -59
- package/template/agent/skills/launch-strategist/SKILL.md +0 -62
- package/template/agent/skills/market-researcher/SKILL.md +0 -53
- package/template/agent/skills/micro-saas-builder/SKILL.md +0 -56
- package/template/agent/skills/monetization-strategist/SKILL.md +0 -119
- package/template/agent/skills/paid-acquisition-specialist/SKILL.md +0 -119
- package/template/agent/skills/pricing-psychologist/SKILL.md +0 -58
- package/template/agent/skills/real-time-features/SKILL.md +0 -194
- package/template/agent/skills/retention-specialist/SKILL.md +0 -123
- package/template/agent/skills/rust-developer/SKILL.md +0 -281
- package/template/agent/skills/rust-developer/references/rust-rules/_sections.md +0 -231
- package/template/agent/skills/rust-developer/references/rust-rules/anti-clone-excessive.md +0 -124
- package/template/agent/skills/rust-developer/references/rust-rules/anti-collect-intermediate.md +0 -131
- package/template/agent/skills/rust-developer/references/rust-rules/anti-empty-catch.md +0 -132
- package/template/agent/skills/rust-developer/references/rust-rules/anti-expect-lazy.md +0 -95
- package/template/agent/skills/rust-developer/references/rust-rules/anti-format-hot-path.md +0 -141
- package/template/agent/skills/rust-developer/references/rust-rules/anti-index-over-iter.md +0 -125
- package/template/agent/skills/rust-developer/references/rust-rules/anti-lock-across-await.md +0 -127
- package/template/agent/skills/rust-developer/references/rust-rules/anti-over-abstraction.md +0 -120
- package/template/agent/skills/rust-developer/references/rust-rules/anti-panic-expected.md +0 -131
- package/template/agent/skills/rust-developer/references/rust-rules/anti-premature-optimize.md +0 -156
- package/template/agent/skills/rust-developer/references/rust-rules/anti-string-for-str.md +0 -122
- package/template/agent/skills/rust-developer/references/rust-rules/anti-stringly-typed.md +0 -167
- package/template/agent/skills/rust-developer/references/rust-rules/anti-type-erasure.md +0 -134
- package/template/agent/skills/rust-developer/references/rust-rules/anti-unwrap-abuse.md +0 -143
- package/template/agent/skills/rust-developer/references/rust-rules/anti-vec-for-slice.md +0 -121
- package/template/agent/skills/rust-developer/references/rust-rules/api-builder-must-use.md +0 -143
- package/template/agent/skills/rust-developer/references/rust-rules/api-builder-pattern.md +0 -187
- package/template/agent/skills/rust-developer/references/rust-rules/api-common-traits.md +0 -165
- package/template/agent/skills/rust-developer/references/rust-rules/api-default-impl.md +0 -177
- package/template/agent/skills/rust-developer/references/rust-rules/api-extension-trait.md +0 -163
- package/template/agent/skills/rust-developer/references/rust-rules/api-from-not-into.md +0 -146
- package/template/agent/skills/rust-developer/references/rust-rules/api-impl-asref.md +0 -142
- package/template/agent/skills/rust-developer/references/rust-rules/api-impl-into.md +0 -160
- package/template/agent/skills/rust-developer/references/rust-rules/api-must-use.md +0 -125
- package/template/agent/skills/rust-developer/references/rust-rules/api-newtype-safety.md +0 -162
- package/template/agent/skills/rust-developer/references/rust-rules/api-non-exhaustive.md +0 -177
- package/template/agent/skills/rust-developer/references/rust-rules/api-parse-dont-validate.md +0 -184
- package/template/agent/skills/rust-developer/references/rust-rules/api-sealed-trait.md +0 -168
- package/template/agent/skills/rust-developer/references/rust-rules/api-serde-optional.md +0 -182
- package/template/agent/skills/rust-developer/references/rust-rules/api-typestate.md +0 -199
- package/template/agent/skills/rust-developer/references/rust-rules/async-bounded-channel.md +0 -175
- package/template/agent/skills/rust-developer/references/rust-rules/async-broadcast-pubsub.md +0 -185
- package/template/agent/skills/rust-developer/references/rust-rules/async-cancellation-token.md +0 -203
- package/template/agent/skills/rust-developer/references/rust-rules/async-clone-before-await.md +0 -171
- package/template/agent/skills/rust-developer/references/rust-rules/async-join-parallel.md +0 -158
- package/template/agent/skills/rust-developer/references/rust-rules/async-joinset-structured.md +0 -195
- package/template/agent/skills/rust-developer/references/rust-rules/async-mpsc-queue.md +0 -171
- package/template/agent/skills/rust-developer/references/rust-rules/async-no-lock-await.md +0 -156
- package/template/agent/skills/rust-developer/references/rust-rules/async-oneshot-response.md +0 -191
- package/template/agent/skills/rust-developer/references/rust-rules/async-select-racing.md +0 -198
- package/template/agent/skills/rust-developer/references/rust-rules/async-spawn-blocking.md +0 -154
- package/template/agent/skills/rust-developer/references/rust-rules/async-tokio-fs.md +0 -167
- package/template/agent/skills/rust-developer/references/rust-rules/async-tokio-runtime.md +0 -169
- package/template/agent/skills/rust-developer/references/rust-rules/async-try-join.md +0 -172
- package/template/agent/skills/rust-developer/references/rust-rules/async-watch-latest.md +0 -189
- package/template/agent/skills/rust-developer/references/rust-rules/doc-all-public.md +0 -113
- package/template/agent/skills/rust-developer/references/rust-rules/doc-cargo-metadata.md +0 -147
- package/template/agent/skills/rust-developer/references/rust-rules/doc-errors-section.md +0 -122
- package/template/agent/skills/rust-developer/references/rust-rules/doc-examples-section.md +0 -161
- package/template/agent/skills/rust-developer/references/rust-rules/doc-hidden-setup.md +0 -149
- package/template/agent/skills/rust-developer/references/rust-rules/doc-intra-links.md +0 -138
- package/template/agent/skills/rust-developer/references/rust-rules/doc-link-types.md +0 -169
- package/template/agent/skills/rust-developer/references/rust-rules/doc-module-inner.md +0 -116
- package/template/agent/skills/rust-developer/references/rust-rules/doc-panics-section.md +0 -128
- package/template/agent/skills/rust-developer/references/rust-rules/doc-question-mark.md +0 -136
- package/template/agent/skills/rust-developer/references/rust-rules/doc-safety-section.md +0 -131
- package/template/agent/skills/rust-developer/references/rust-rules/err-anyhow-app.md +0 -179
- package/template/agent/skills/rust-developer/references/rust-rules/err-context-chain.md +0 -144
- package/template/agent/skills/rust-developer/references/rust-rules/err-custom-type.md +0 -152
- package/template/agent/skills/rust-developer/references/rust-rules/err-doc-errors.md +0 -145
- package/template/agent/skills/rust-developer/references/rust-rules/err-expect-bugs-only.md +0 -133
- package/template/agent/skills/rust-developer/references/rust-rules/err-from-impl.md +0 -152
- package/template/agent/skills/rust-developer/references/rust-rules/err-lowercase-msg.md +0 -124
- package/template/agent/skills/rust-developer/references/rust-rules/err-no-unwrap-prod.md +0 -115
- package/template/agent/skills/rust-developer/references/rust-rules/err-question-mark.md +0 -151
- package/template/agent/skills/rust-developer/references/rust-rules/err-result-over-panic.md +0 -130
- package/template/agent/skills/rust-developer/references/rust-rules/err-source-chain.md +0 -155
- package/template/agent/skills/rust-developer/references/rust-rules/err-thiserror-lib.md +0 -171
- package/template/agent/skills/rust-developer/references/rust-rules/lint-cargo-metadata.md +0 -138
- package/template/agent/skills/rust-developer/references/rust-rules/lint-deny-correctness.md +0 -107
- package/template/agent/skills/rust-developer/references/rust-rules/lint-missing-docs.md +0 -154
- package/template/agent/skills/rust-developer/references/rust-rules/lint-pedantic-selective.md +0 -118
- package/template/agent/skills/rust-developer/references/rust-rules/lint-rustfmt-check.md +0 -157
- package/template/agent/skills/rust-developer/references/rust-rules/lint-unsafe-doc.md +0 -133
- package/template/agent/skills/rust-developer/references/rust-rules/lint-warn-complexity.md +0 -131
- package/template/agent/skills/rust-developer/references/rust-rules/lint-warn-perf.md +0 -136
- package/template/agent/skills/rust-developer/references/rust-rules/lint-warn-style.md +0 -135
- package/template/agent/skills/rust-developer/references/rust-rules/lint-warn-suspicious.md +0 -122
- package/template/agent/skills/rust-developer/references/rust-rules/lint-workspace-lints.md +0 -172
- package/template/agent/skills/rust-developer/references/rust-rules/mem-arena-allocator.md +0 -168
- package/template/agent/skills/rust-developer/references/rust-rules/mem-arrayvec.md +0 -142
- package/template/agent/skills/rust-developer/references/rust-rules/mem-assert-type-size.md +0 -168
- package/template/agent/skills/rust-developer/references/rust-rules/mem-avoid-format.md +0 -147
- package/template/agent/skills/rust-developer/references/rust-rules/mem-box-large-variant.md +0 -158
- package/template/agent/skills/rust-developer/references/rust-rules/mem-boxed-slice.md +0 -139
- package/template/agent/skills/rust-developer/references/rust-rules/mem-clone-from.md +0 -147
- package/template/agent/skills/rust-developer/references/rust-rules/mem-compact-string.md +0 -149
- package/template/agent/skills/rust-developer/references/rust-rules/mem-reuse-collections.md +0 -174
- package/template/agent/skills/rust-developer/references/rust-rules/mem-smaller-integers.md +0 -159
- package/template/agent/skills/rust-developer/references/rust-rules/mem-smallvec.md +0 -138
- package/template/agent/skills/rust-developer/references/rust-rules/mem-thinvec.md +0 -142
- package/template/agent/skills/rust-developer/references/rust-rules/mem-with-capacity.md +0 -156
- package/template/agent/skills/rust-developer/references/rust-rules/mem-write-over-format.md +0 -172
- package/template/agent/skills/rust-developer/references/rust-rules/mem-zero-copy.md +0 -164
- package/template/agent/skills/rust-developer/references/rust-rules/name-acronym-word.md +0 -99
- package/template/agent/skills/rust-developer/references/rust-rules/name-as-free.md +0 -104
- package/template/agent/skills/rust-developer/references/rust-rules/name-consts-screaming.md +0 -94
- package/template/agent/skills/rust-developer/references/rust-rules/name-crate-no-rs.md +0 -78
- package/template/agent/skills/rust-developer/references/rust-rules/name-funcs-snake.md +0 -76
- package/template/agent/skills/rust-developer/references/rust-rules/name-into-ownership.md +0 -123
- package/template/agent/skills/rust-developer/references/rust-rules/name-is-has-bool.md +0 -127
- package/template/agent/skills/rust-developer/references/rust-rules/name-iter-convention.md +0 -129
- package/template/agent/skills/rust-developer/references/rust-rules/name-iter-method.md +0 -131
- package/template/agent/skills/rust-developer/references/rust-rules/name-iter-type-match.md +0 -142
- package/template/agent/skills/rust-developer/references/rust-rules/name-lifetime-short.md +0 -86
- package/template/agent/skills/rust-developer/references/rust-rules/name-no-get-prefix.md +0 -154
- package/template/agent/skills/rust-developer/references/rust-rules/name-to-expensive.md +0 -118
- package/template/agent/skills/rust-developer/references/rust-rules/name-type-param-single.md +0 -92
- package/template/agent/skills/rust-developer/references/rust-rules/name-types-camel.md +0 -65
- package/template/agent/skills/rust-developer/references/rust-rules/name-variants-camel.md +0 -101
- package/template/agent/skills/rust-developer/references/rust-rules/opt-bounds-check.md +0 -161
- package/template/agent/skills/rust-developer/references/rust-rules/opt-cache-friendly.md +0 -187
- package/template/agent/skills/rust-developer/references/rust-rules/opt-codegen-units.md +0 -142
- package/template/agent/skills/rust-developer/references/rust-rules/opt-cold-unlikely.md +0 -152
- package/template/agent/skills/rust-developer/references/rust-rules/opt-inline-always-rare.md +0 -141
- package/template/agent/skills/rust-developer/references/rust-rules/opt-inline-never-cold.md +0 -181
- package/template/agent/skills/rust-developer/references/rust-rules/opt-inline-small.md +0 -160
- package/template/agent/skills/rust-developer/references/rust-rules/opt-likely-hint.md +0 -171
- package/template/agent/skills/rust-developer/references/rust-rules/opt-lto-release.md +0 -130
- package/template/agent/skills/rust-developer/references/rust-rules/opt-pgo-profile.md +0 -167
- package/template/agent/skills/rust-developer/references/rust-rules/opt-simd-portable.md +0 -144
- package/template/agent/skills/rust-developer/references/rust-rules/opt-target-cpu.md +0 -154
- package/template/agent/skills/rust-developer/references/rust-rules/own-arc-shared.md +0 -141
- package/template/agent/skills/rust-developer/references/rust-rules/own-borrow-over-clone.md +0 -95
- package/template/agent/skills/rust-developer/references/rust-rules/own-clone-explicit.md +0 -135
- package/template/agent/skills/rust-developer/references/rust-rules/own-copy-small.md +0 -124
- package/template/agent/skills/rust-developer/references/rust-rules/own-cow-conditional.md +0 -135
- package/template/agent/skills/rust-developer/references/rust-rules/own-lifetime-elision.md +0 -134
- package/template/agent/skills/rust-developer/references/rust-rules/own-move-large.md +0 -134
- package/template/agent/skills/rust-developer/references/rust-rules/own-mutex-interior.md +0 -105
- package/template/agent/skills/rust-developer/references/rust-rules/own-rc-single-thread.md +0 -65
- package/template/agent/skills/rust-developer/references/rust-rules/own-refcell-interior.md +0 -97
- package/template/agent/skills/rust-developer/references/rust-rules/own-rwlock-readers.md +0 -122
- package/template/agent/skills/rust-developer/references/rust-rules/own-slice-over-vec.md +0 -119
- package/template/agent/skills/rust-developer/references/rust-rules/perf-black-box-bench.md +0 -153
- package/template/agent/skills/rust-developer/references/rust-rules/perf-chain-avoid.md +0 -136
- package/template/agent/skills/rust-developer/references/rust-rules/perf-collect-into.md +0 -133
- package/template/agent/skills/rust-developer/references/rust-rules/perf-collect-once.md +0 -120
- package/template/agent/skills/rust-developer/references/rust-rules/perf-drain-reuse.md +0 -137
- package/template/agent/skills/rust-developer/references/rust-rules/perf-entry-api.md +0 -134
- package/template/agent/skills/rust-developer/references/rust-rules/perf-extend-batch.md +0 -150
- package/template/agent/skills/rust-developer/references/rust-rules/perf-iter-lazy.md +0 -123
- package/template/agent/skills/rust-developer/references/rust-rules/perf-iter-over-index.md +0 -113
- package/template/agent/skills/rust-developer/references/rust-rules/perf-profile-first.md +0 -175
- package/template/agent/skills/rust-developer/references/rust-rules/perf-release-profile.md +0 -149
- package/template/agent/skills/rust-developer/references/rust-rules/proj-bin-dir.md +0 -142
- package/template/agent/skills/rust-developer/references/rust-rules/proj-flat-small.md +0 -133
- package/template/agent/skills/rust-developer/references/rust-rules/proj-lib-main-split.md +0 -148
- package/template/agent/skills/rust-developer/references/rust-rules/proj-mod-by-feature.md +0 -130
- package/template/agent/skills/rust-developer/references/rust-rules/proj-mod-rs-dir.md +0 -120
- package/template/agent/skills/rust-developer/references/rust-rules/proj-prelude-module.md +0 -155
- package/template/agent/skills/rust-developer/references/rust-rules/proj-pub-crate-internal.md +0 -139
- package/template/agent/skills/rust-developer/references/rust-rules/proj-pub-super-parent.md +0 -135
- package/template/agent/skills/rust-developer/references/rust-rules/proj-pub-use-reexport.md +0 -162
- package/template/agent/skills/rust-developer/references/rust-rules/proj-workspace-deps.md +0 -186
- package/template/agent/skills/rust-developer/references/rust-rules/proj-workspace-large.md +0 -162
- package/template/agent/skills/rust-developer/references/rust-rules/test-arrange-act-assert.md +0 -160
- package/template/agent/skills/rust-developer/references/rust-rules/test-cfg-test-module.md +0 -151
- package/template/agent/skills/rust-developer/references/rust-rules/test-criterion-bench.md +0 -171
- package/template/agent/skills/rust-developer/references/rust-rules/test-descriptive-names.md +0 -142
- package/template/agent/skills/rust-developer/references/rust-rules/test-doctest-examples.md +0 -168
- package/template/agent/skills/rust-developer/references/rust-rules/test-fixture-raii.md +0 -151
- package/template/agent/skills/rust-developer/references/rust-rules/test-integration-dir.md +0 -144
- package/template/agent/skills/rust-developer/references/rust-rules/test-mock-traits.md +0 -189
- package/template/agent/skills/rust-developer/references/rust-rules/test-mockall-mocking.md +0 -226
- package/template/agent/skills/rust-developer/references/rust-rules/test-proptest-properties.md +0 -161
- package/template/agent/skills/rust-developer/references/rust-rules/test-should-panic.md +0 -130
- package/template/agent/skills/rust-developer/references/rust-rules/test-tokio-async.md +0 -154
- package/template/agent/skills/rust-developer/references/rust-rules/test-use-super.md +0 -127
- package/template/agent/skills/rust-developer/references/rust-rules/type-enum-states.md +0 -154
- package/template/agent/skills/rust-developer/references/rust-rules/type-generic-bounds.md +0 -142
- package/template/agent/skills/rust-developer/references/rust-rules/type-never-diverge.md +0 -146
- package/template/agent/skills/rust-developer/references/rust-rules/type-newtype-ids.md +0 -160
- package/template/agent/skills/rust-developer/references/rust-rules/type-newtype-validated.md +0 -159
- package/template/agent/skills/rust-developer/references/rust-rules/type-no-stringly.md +0 -144
- package/template/agent/skills/rust-developer/references/rust-rules/type-option-nullable.md +0 -137
- package/template/agent/skills/rust-developer/references/rust-rules/type-phantom-marker.md +0 -188
- package/template/agent/skills/rust-developer/references/rust-rules/type-repr-transparent.md +0 -143
- package/template/agent/skills/rust-developer/references/rust-rules/type-result-fallible.md +0 -131
- package/template/agent/skills/saas-architect/SKILL.md +0 -139
- package/template/agent/skills/security-engineer/SKILL.md +0 -133
- package/template/agent/skills/seo-specialist/SKILL.md +0 -130
- package/template/agent/skills/solo-founder-ops/SKILL.md +0 -56
|
@@ -32,6 +32,7 @@ digraph when_to_use {
|
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**vs. Executing Plans (parallel session):**
|
|
35
|
+
|
|
35
36
|
- Same session (no context switch)
|
|
36
37
|
- Fresh subagent per task (no context pollution)
|
|
37
38
|
- Two-stage review after each task: spec compliance first, then code quality
|
|
@@ -95,6 +96,7 @@ Use the least powerful model that can handle each role to conserve cost and incr
|
|
|
95
96
|
**Architecture, design, and review tasks**: use the most capable available model.
|
|
96
97
|
|
|
97
98
|
**Task complexity signals:**
|
|
99
|
+
|
|
98
100
|
- Touches 1-2 files with a complete spec → cheap model
|
|
99
101
|
- Touches multiple files with integration concerns → standard model
|
|
100
102
|
- Requires design judgment or broad codebase understanding → most capable model
|
|
@@ -110,6 +112,7 @@ Implementer subagents report one of four statuses. Handle each appropriately:
|
|
|
110
112
|
**NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
|
|
111
113
|
|
|
112
114
|
**BLOCKED:** The implementer cannot complete the task. Assess the blocker:
|
|
115
|
+
|
|
113
116
|
1. If it's a context problem, provide more context and re-dispatch with the same model
|
|
114
117
|
2. If the task requires more reasoning, re-dispatch with a more capable model
|
|
115
118
|
3. If the task is too large, break it into smaller pieces
|
|
@@ -202,23 +205,27 @@ Done!
|
|
|
202
205
|
## Advantages
|
|
203
206
|
|
|
204
207
|
**vs. Manual execution:**
|
|
208
|
+
|
|
205
209
|
- Subagents follow TDD naturally
|
|
206
210
|
- Fresh context per task (no confusion)
|
|
207
211
|
- Parallel-safe (subagents don't interfere)
|
|
208
212
|
- Subagent can ask questions (before AND during work)
|
|
209
213
|
|
|
210
214
|
**vs. Executing Plans:**
|
|
215
|
+
|
|
211
216
|
- Same session (no handoff)
|
|
212
217
|
- Continuous progress (no waiting)
|
|
213
218
|
- Review checkpoints automatic
|
|
214
219
|
|
|
215
220
|
**Efficiency gains:**
|
|
221
|
+
|
|
216
222
|
- No file reading overhead (controller provides full text)
|
|
217
223
|
- Controller curates exactly what context is needed
|
|
218
224
|
- Subagent gets complete information upfront
|
|
219
225
|
- Questions surfaced before work begins (not after)
|
|
220
226
|
|
|
221
227
|
**Quality gates:**
|
|
228
|
+
|
|
222
229
|
- Self-review catches issues before handoff
|
|
223
230
|
- Two-stage review: spec compliance, then code quality
|
|
224
231
|
- Review loops ensure fixes actually work
|
|
@@ -226,6 +233,7 @@ Done!
|
|
|
226
233
|
- Code quality ensures implementation is well-built
|
|
227
234
|
|
|
228
235
|
**Cost:**
|
|
236
|
+
|
|
229
237
|
- More subagent invocations (implementer + 2 reviewers per task)
|
|
230
238
|
- Controller does more prep work (extracting all tasks upfront)
|
|
231
239
|
- Review loops add iterations
|
|
@@ -234,6 +242,7 @@ Done!
|
|
|
234
242
|
## Red Flags
|
|
235
243
|
|
|
236
244
|
**Never:**
|
|
245
|
+
|
|
237
246
|
- Start implementation on main/master branch without explicit user consent
|
|
238
247
|
- Skip reviews (spec compliance OR code quality)
|
|
239
248
|
- Proceed with unfixed issues
|
|
@@ -248,35 +257,42 @@ Done!
|
|
|
248
257
|
- Move to next task while either review has open issues
|
|
249
258
|
|
|
250
259
|
**Before implementer commits:** Check `.agent/config.yml` for `auto_commit` setting.
|
|
260
|
+
|
|
251
261
|
- If `auto_commit: true` (default): commit normally with `git add` + `git commit`
|
|
252
262
|
- If `auto_commit: false`: skip commit and staging entirely. Print: "Skipping commit (auto_commit: false in .agent/config.yml). Files left as modified for manual commit."
|
|
253
263
|
|
|
254
264
|
**If subagent asks questions:**
|
|
265
|
+
|
|
255
266
|
- Answer clearly and completely
|
|
256
267
|
- Provide additional context if needed
|
|
257
268
|
- Don't rush them into implementation
|
|
258
269
|
|
|
259
270
|
**If reviewer finds issues:**
|
|
271
|
+
|
|
260
272
|
- Implementer (same subagent) fixes them
|
|
261
273
|
- Reviewer reviews again
|
|
262
274
|
- Repeat until approved
|
|
263
275
|
- Don't skip the re-review
|
|
264
276
|
|
|
265
277
|
**If subagent fails task:**
|
|
278
|
+
|
|
266
279
|
- Dispatch fix subagent with specific instructions
|
|
267
280
|
- Don't try to fix manually (context pollution)
|
|
268
281
|
|
|
269
282
|
## Integration
|
|
270
283
|
|
|
271
284
|
**Required workflow skills:**
|
|
285
|
+
|
|
272
286
|
- **superpowers:using-git-worktrees** - REQUIRED: Set up isolated workspace before starting
|
|
273
287
|
- **superpowers:writing-plans** - Creates the plan this skill executes
|
|
274
288
|
- **superpowers:requesting-code-review** - Code review template for reviewer subagents
|
|
275
289
|
- **superpowers:finishing-a-development-branch** - Complete development after all tasks
|
|
276
290
|
|
|
277
291
|
**Subagents should use:**
|
|
292
|
+
|
|
278
293
|
- **superpowers:test-driven-development** - Subagents follow TDD for each task
|
|
279
294
|
- **Domain skills matching the task context** - e.g. `mobile-developer` for React Native work, `backend-developer` for API work, `frontend-developer` for web UI. Include only the relevant SKILL.md in the implementer prompt context; load specific references on demand as the task requires them.
|
|
280
295
|
|
|
281
296
|
**Alternative workflow:**
|
|
297
|
+
|
|
282
298
|
- **superpowers:executing-plans** - Use for parallel session instead of same-session execution
|
|
@@ -28,13 +28,14 @@ Task tool (general-purpose):
|
|
|
28
28
|
|
|
29
29
|
## Your Job
|
|
30
30
|
|
|
31
|
+
Once you're clear on requirements:
|
|
31
32
|
1. Implement exactly what the task specifies
|
|
32
33
|
2. Write tests (following TDD if task says to)
|
|
33
34
|
3. Verify implementation works
|
|
34
35
|
4. Commit your work (if auto_commit is enabled)
|
|
35
|
-
- Read `.agent/config.yml`
|
|
36
|
-
- If `auto_commit: true` (or not set): `git add`
|
|
37
|
-
- If `auto_commit: false`: skip commit and staging entirely
|
|
36
|
+
- Read `.agent/config.yml` — check `auto_commit` setting
|
|
37
|
+
- If `auto_commit: true` (or not set): `git add` + `git commit`
|
|
38
|
+
- If `auto_commit: false`: skip commit and staging entirely, print "Skipping commit (auto_commit: false)."
|
|
38
39
|
5. Self-review (see below)
|
|
39
40
|
6. Report back
|
|
40
41
|
|
|
@@ -63,9 +63,10 @@ git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/d
|
|
|
63
63
|
|
|
64
64
|
Per Jesse's rule "Fix broken things immediately":
|
|
65
65
|
1. Add appropriate line to .gitignore
|
|
66
|
-
2. Commit the change (if auto_commit enabled)
|
|
67
|
-
- Read `.agent/config.yml` —
|
|
66
|
+
2. Commit the change (if `auto_commit` is enabled):
|
|
67
|
+
- Read `.agent/config.yml` — check `auto_commit` setting
|
|
68
68
|
- If `auto_commit: true` (or absent): `git add .gitignore && git commit -m "chore: ignore worktree directory"`
|
|
69
|
+
- If `auto_commit: false`: skip commit, print "Skipping git operation (auto_commit: false)."
|
|
69
70
|
3. Proceed with worktree creation
|
|
70
71
|
|
|
71
72
|
**Why critical:** Prevents accidentally committing worktree contents to repository.
|
|
@@ -19,21 +19,23 @@ This is not negotiable. This is not optional. You cannot rationalize your way ou
|
|
|
19
19
|
|
|
20
20
|
Superpowers skills override default system prompt behavior, but **user instructions always take precedence**:
|
|
21
21
|
|
|
22
|
-
1. **User's explicit instructions** (
|
|
22
|
+
1. **User's explicit instructions** (direct requests, project config) — highest priority
|
|
23
23
|
2. **Superpowers skills** — override default system behavior where they conflict
|
|
24
24
|
3. **Default system prompt** — lowest priority
|
|
25
25
|
|
|
26
|
-
If
|
|
26
|
+
If the user says "don't use TDD" and a skill says "always use TDD," follow the user's instructions. The user is in control.
|
|
27
27
|
|
|
28
28
|
## How to Access Skills
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Use `view_file` on the skill's `SKILL.md`:
|
|
31
|
+
```
|
|
32
|
+
.agent/skills/<skill-name>/SKILL.md
|
|
33
|
+
```
|
|
34
|
+
Example: `.agent/skills/brainstorming/SKILL.md`
|
|
31
35
|
|
|
32
36
|
## Platform Adaptation
|
|
33
37
|
|
|
34
|
-
This package is configured for **Google Antigravity**. Tool name
|
|
35
|
-
|
|
36
|
-
For tool name equivalents, see `references/antigravity-tools.md`.
|
|
38
|
+
This package is configured for **Google Antigravity**. Tool name equivalents are documented in `references/antigravity-tools.md`.
|
|
37
39
|
|
|
38
40
|
# Using Skills
|
|
39
41
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Copilot CLI Tool Mapping
|
|
2
|
+
|
|
3
|
+
Skills use Claude Code tool names. When you encounter these in a skill, use your platform equivalent:
|
|
4
|
+
|
|
5
|
+
| Skill references | Copilot CLI equivalent |
|
|
6
|
+
|-----------------|----------------------|
|
|
7
|
+
| `Read` (file reading) | `view` |
|
|
8
|
+
| `Write` (file creation) | `create` |
|
|
9
|
+
| `Edit` (file editing) | `edit` |
|
|
10
|
+
| `Bash` (run commands) | `bash` |
|
|
11
|
+
| `Grep` (search file content) | `grep` |
|
|
12
|
+
| `Glob` (search files by name) | `glob` |
|
|
13
|
+
| `Skill` tool (invoke a skill) | `skill` |
|
|
14
|
+
| `WebFetch` | `web_fetch` |
|
|
15
|
+
| `Task` tool (dispatch subagent) | `task` (see [Agent types](#agent-types)) |
|
|
16
|
+
| Multiple `Task` calls (parallel) | Multiple `task` calls |
|
|
17
|
+
| Task status/output | `read_agent`, `list_agents` |
|
|
18
|
+
| `TodoWrite` (task tracking) | `sql` with built-in `todos` table |
|
|
19
|
+
| `WebSearch` | No equivalent — use `web_fetch` with a search engine URL |
|
|
20
|
+
| `EnterPlanMode` / `ExitPlanMode` | No equivalent — stay in the main session |
|
|
21
|
+
|
|
22
|
+
## Agent types
|
|
23
|
+
|
|
24
|
+
Copilot CLI's `task` tool accepts an `agent_type` parameter:
|
|
25
|
+
|
|
26
|
+
| Claude Code agent | Copilot CLI equivalent |
|
|
27
|
+
|-------------------|----------------------|
|
|
28
|
+
| `general-purpose` | `"general-purpose"` |
|
|
29
|
+
| `Explore` | `"explore"` |
|
|
30
|
+
| Named plugin agents (e.g. `superpowers:code-reviewer`) | Discovered automatically from installed plugins |
|
|
31
|
+
|
|
32
|
+
## Async shell sessions
|
|
33
|
+
|
|
34
|
+
Copilot CLI supports persistent async shell sessions, which have no direct Claude Code equivalent:
|
|
35
|
+
|
|
36
|
+
| Tool | Purpose |
|
|
37
|
+
|------|---------|
|
|
38
|
+
| `bash` with `async: true` | Start a long-running command in the background |
|
|
39
|
+
| `write_bash` | Send input to a running async session |
|
|
40
|
+
| `read_bash` | Read output from an async session |
|
|
41
|
+
| `stop_bash` | Terminate an async session |
|
|
42
|
+
| `list_bash` | List all active shell sessions |
|
|
43
|
+
|
|
44
|
+
## Additional Copilot CLI tools
|
|
45
|
+
|
|
46
|
+
| Tool | Purpose |
|
|
47
|
+
|------|---------|
|
|
48
|
+
| `store_memory` | Persist facts about the codebase for future sessions |
|
|
49
|
+
| `report_intent` | Update the UI status line with current intent |
|
|
50
|
+
| `sql` | Query the session's SQLite database (todos, metadata) |
|
|
51
|
+
| `fetch_copilot_cli_documentation` | Look up Copilot CLI documentation |
|
|
52
|
+
| GitHub MCP tools (`github-mcp-server-*`) | Native GitHub API access (issues, PRs, code search) |
|
|
@@ -97,13 +97,15 @@ Expected: PASS
|
|
|
97
97
|
|
|
98
98
|
- [ ] **Step 5: Commit (if auto_commit enabled)**
|
|
99
99
|
|
|
100
|
-
Check `.agent/config.yml` for `auto_commit` setting
|
|
101
|
-
|
|
100
|
+
Check `.agent/config.yml` for `auto_commit` setting.
|
|
101
|
+
|
|
102
|
+
If `auto_commit: true` (default when absent):
|
|
102
103
|
```bash
|
|
103
104
|
git add tests/path/test.py src/path/file.py
|
|
104
105
|
git commit -m "feat: add specific feature"
|
|
105
106
|
```
|
|
106
|
-
|
|
107
|
+
|
|
108
|
+
If `auto_commit: false`: skip commit and staging. Print: "Skipping commit (auto_commit: false)."
|
|
107
109
|
````
|
|
108
110
|
|
|
109
111
|
## No Placeholders
|
|
@@ -9,7 +9,7 @@ description: Use when creating new skills, editing existing skills, or verifying
|
|
|
9
9
|
|
|
10
10
|
**Writing skills IS Test-Driven Development applied to process documentation.**
|
|
11
11
|
|
|
12
|
-
**Personal skills live in
|
|
12
|
+
**Personal skills live in `~/.agent/skills`**
|
|
13
13
|
|
|
14
14
|
You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).
|
|
15
15
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Antigravity Superpowers — Project Config
|
|
2
|
+
#
|
|
3
|
+
# Configure per-project behavior by editing this file.
|
|
4
|
+
# Skills read this file to determine how to behave in this project.
|
|
5
|
+
|
|
6
|
+
# auto_commit: true | false
|
|
7
|
+
# When true (default), AI automatically commits after completing tasks and writing design docs.
|
|
8
|
+
# When false, all git commits and staging are skipped; files are left as modified for manual commit.
|
|
9
|
+
auto_commit: false
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ai-integrated-product
|
|
3
|
-
description: Use when integrating AI/LLM capabilities into a product, building AI-powered features, or evaluating APIs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# AI Integrated Product Lens
|
|
7
|
-
|
|
8
|
-
## Identity
|
|
9
|
-
You are pragmatic about AI. You view LLMs as unreliable but powerful probabilistic engines, not magic. You focus on cost control, useful constraints, and graceful degradation when the AI inevitably hallucinates or the API goes down.
|
|
10
|
-
|
|
11
|
-
## Core Instincts
|
|
12
|
-
- **AI is a feature, not a product** — the underlying workflow must provide value; AI just accelerates it
|
|
13
|
-
- **Cost control from day 1** — LLM API costs scale with usage; if you don't limit tokens, you will lose money
|
|
14
|
-
- **UX > Model capabilities** — a great UI wrapped around a fast, cheap model (GPT-4o-mini) beats a clunky UI block-awaiting an expensive model (GPT-4o)
|
|
15
|
-
- **Trust but verify** — users need to be able to edit, undo, or reject AI outputs
|
|
16
|
-
|
|
17
|
-
## Core Knowledge
|
|
18
|
-
|
|
19
|
-
**AI API Landscape for Indie (2025-2026):**
|
|
20
|
-
- **OpenAI (GPT-4o, GPT-4o-mini):** Best general-purpose, predictable JSON modes.
|
|
21
|
-
- **Anthropic (Claude 3.5 Sonnet):** Exceptional for coding, long context, and nuanced writing.
|
|
22
|
-
- **Google (Gemini 2.0 Flash):** Incredible pricing and multimodal speed.
|
|
23
|
-
- **Open-source (Llama/Mistral via Together/Groq):** Cheapest at scale, fastest inference.
|
|
24
|
-
|
|
25
|
-
**Cost Benchmarks (Approx input/output per 1M tokens):**
|
|
26
|
-
- GPT-4o-mini: $0.15 / $0.60
|
|
27
|
-
- GPT-4o: $2.50 / $10.00
|
|
28
|
-
- Claude 3.5 Sonnet: $3.00 / $15.00
|
|
29
|
-
- Gemini 2.0 Flash: $0.10 / $0.40
|
|
30
|
-
|
|
31
|
-
**Cost Management Strategies:**
|
|
32
|
-
- Estimate tokens per request before calling the API.
|
|
33
|
-
- Set hard usage caps per user tier.
|
|
34
|
-
- Cache common responses (exact or semantic caching).
|
|
35
|
-
- Use cheaper models (Flash/Mini) for routing/classification, save expensive models for complex generation.
|
|
36
|
-
|
|
37
|
-
**Feature Patterns:**
|
|
38
|
-
- Text generation/summarization (Drafting assistants)
|
|
39
|
-
- Conversational UI (Support bots)
|
|
40
|
-
- Classification/tagging (Sorting incoming data)
|
|
41
|
-
- Data extraction (Converting messy HTML/text into clean JSON)
|
|
42
|
-
|
|
43
|
-
**Prompt Engineering Basics:**
|
|
44
|
-
- Deeply specific system prompts.
|
|
45
|
-
- Few-shot examples (give it 3 good inputs + outputs).
|
|
46
|
-
- Always use structured output (JSON schema) when parsing programmatically.
|
|
47
|
-
|
|
48
|
-
## Questions You Always Ask
|
|
49
|
-
- Can we use a cheaper model (like Gemini Flash or GPT-4o-mini) for this specific task?
|
|
50
|
-
- What is the UI/UX when the API takes 5 seconds to respond?
|
|
51
|
-
- How are we capping usage so a single enthusiastic user doesn't cost us $50 today?
|
|
52
|
-
|
|
53
|
-
## Red Flags / Anti-Patterns
|
|
54
|
-
- [ ] Passing user input directly to an expensive model without a rate limit
|
|
55
|
-
- [ ] Relying on the AI to perform complex math or exact character counts
|
|
56
|
-
- [ ] No fallback state for when the API times out
|
|
57
|
-
- [ ] "Building a ChatGPT wrapper" with no distinct workflow advantage
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: analytics-setup
|
|
3
|
-
description: Use when setting up analytics, choosing tracking tools, or designing a metrics dashboard for an indie product
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Analytics Setup Lens
|
|
7
|
-
|
|
8
|
-
## Identity
|
|
9
|
-
You focus on actionable metrics over vanity numbers. You prefer privacy-first, lightweight tracking over heavy, enterprise-grade suites. You want to understand the user journey without invading their privacy or blowing the indie budget.
|
|
10
|
-
|
|
11
|
-
## Core Instincts
|
|
12
|
-
- **Track what matters, ignore the rest** — event bloat kills data utility
|
|
13
|
-
- **Privacy first** — if you don't need user-level tracking, use aggregate tools
|
|
14
|
-
- **Different questions need different tools** — product analytics ≠ web analytics ≠ error tracking
|
|
15
|
-
- **Cohorts over totals** — "Total Users" is a vanity metric; "D7 Retention by Week" is actionable
|
|
16
|
-
|
|
17
|
-
## Core Knowledge
|
|
18
|
-
|
|
19
|
-
**Analytics Stack for Indie (Budget-Friendly):**
|
|
20
|
-
- **Web Analytics (Marketing):** Plausible ($9/mo, privacy-first) or Umami (free self-hosted). Avoid Google Analytics unless required by an ad platform.
|
|
21
|
-
- **Product Analytics (In-App):** PostHog (generous free tier, all-in-one) or Mixpanel (free up to 20M events).
|
|
22
|
-
- **Error Tracking:** Sentry (free tier: 5K events/mo) or BugSnag.
|
|
23
|
-
- **Uptime:** BetterUptime free tier or UptimeRobot.
|
|
24
|
-
|
|
25
|
-
**Essential Events to Track (Day 1):**
|
|
26
|
-
- **Web/SaaS:** `signup`, `activation` (the "Aha!" moment), `feature_used` (top 3 core features), `upgrade_started`, `payment_completed`, `churned`.
|
|
27
|
-
- **Mobile:** `app_opened`, `session_duration`, `notification_opened`, `iap_initiated`.
|
|
28
|
-
- **Extension:** `installed`, `extension_opened`, `upgraded`.
|
|
29
|
-
|
|
30
|
-
**Implementation Patterns:**
|
|
31
|
-
- **Naming convention:** `noun_verb` (e.g., `subscription_started`). Be strictly consistent.
|
|
32
|
-
- **User properties:** plan type, signup_date, platform. Attach these to the user profile, not every event.
|
|
33
|
-
- **Group analytics by cohort:** Weekly signup cohorts are the best way to measure improvements over time.
|
|
34
|
-
|
|
35
|
-
**Dashboard Template (The 5 Metrics That Matter):**
|
|
36
|
-
1. Daily/Weekly Active Users (DAU/WAU)
|
|
37
|
-
2. Activation Rate (% reaching the aha moment)
|
|
38
|
-
3. Retention (D1, D7, D30)
|
|
39
|
-
4. Revenue (MRR, trial-to-paid conversion rate)
|
|
40
|
-
5. Acquisition source breakdown
|
|
41
|
-
|
|
42
|
-
## Questions You Always Ask
|
|
43
|
-
- What is the ONE primary metric for this product?
|
|
44
|
-
- How are we defining an "Active" user? (Hint: it shouldn't just be "logging in")
|
|
45
|
-
- Have we set a strict naming convention for our events before we start writing `track()` calls?
|
|
46
|
-
|
|
47
|
-
## Red Flags / Anti-Patterns
|
|
48
|
-
- [ ] Tracking every single button click ("event bloat")
|
|
49
|
-
- [ ] No tracking at all on V1 ("I'll add analytics later")
|
|
50
|
-
- [ ] Using vanity metrics (page views, total registered accounts without filtering for activation)
|
|
51
|
-
- [ ] No consistent event naming convention
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: api-design
|
|
3
|
-
description: Use when designing REST or GraphQL APIs, defining versioning strategy, implementing rate limiting, pagination, or writing API documentation
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# API Design Lens
|
|
7
|
-
|
|
8
|
-
> **Philosophy:** An API is a contract. Breaking it breaks your users' production systems.
|
|
9
|
-
> Design APIs for the client's needs, not the server's convenience.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Core Instincts
|
|
14
|
-
|
|
15
|
-
- **API contracts are forever** — breaking changes in v1 are unforgivable; version aggressively
|
|
16
|
-
- **Design for the consumer** — the client's workflow, not the server's data model, drives resource design
|
|
17
|
-
- **Idempotency is non-negotiable** — safe to retry = safe to build reliable systems on top of
|
|
18
|
-
- **Errors must be informative** — vague errors waste developer hours
|
|
19
|
-
- **Consistency over cleverness** — a boring, predictable API is a beloved API
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## REST Resource Design Rules
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
Resource naming:
|
|
27
|
-
✅ /users/{id}/projects (noun, plural, hierarchical)
|
|
28
|
-
❌ /getProjectsForUser/{id} (verb, confusing)
|
|
29
|
-
❌ /user-projects/{userId} (mixed conventions)
|
|
30
|
-
|
|
31
|
-
HTTP verbs:
|
|
32
|
-
GET /resources → list (paginated)
|
|
33
|
-
GET /resources/{id} → get one
|
|
34
|
-
POST /resources → create
|
|
35
|
-
PUT /resources/{id} → full replace (idempotent)
|
|
36
|
-
PATCH /resources/{id} → partial update
|
|
37
|
-
DELETE /resources/{id} → delete (idempotent)
|
|
38
|
-
|
|
39
|
-
Idempotency:
|
|
40
|
-
GET, PUT, DELETE = always idempotent
|
|
41
|
-
POST = not idempotent by default → use Idempotency-Key header
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## HTTP Status Codes (Precise Usage)
|
|
47
|
-
|
|
48
|
-
| Status | Use when | Body |
|
|
49
|
-
|--------|----------|------|
|
|
50
|
-
| 200 | Success, returns data | Resource |
|
|
51
|
-
| 201 | Created | Resource + `Location` header |
|
|
52
|
-
| 204 | Success, no body | Empty |
|
|
53
|
-
| 400 | Malformed request / validation failure | Error with field details |
|
|
54
|
-
| 401 | Missing or invalid auth | Error |
|
|
55
|
-
| 403 | Auth valid, no permission | Error (don't reveal resource existence) |
|
|
56
|
-
| 404 | Resource not found | Error |
|
|
57
|
-
| 409 | Conflict (duplicate, state clash) | Error with conflict detail |
|
|
58
|
-
| 422 | Valid format, business rule violation | Error with reason |
|
|
59
|
-
| 429 | Rate limited | Error + `Retry-After` header |
|
|
60
|
-
| 500 | Unexpected server error | Generic error (log full details server-side) |
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## Error Response Standard (RFC 7807 / Problem Details)
|
|
65
|
-
|
|
66
|
-
```json
|
|
67
|
-
{
|
|
68
|
-
"type": "https://docs.myapp.com/errors/validation-failed",
|
|
69
|
-
"title": "Validation Failed",
|
|
70
|
-
"status": 422,
|
|
71
|
-
"detail": "One or more fields are invalid",
|
|
72
|
-
"errors": [
|
|
73
|
-
{ "field": "email", "message": "Must be a valid email address" },
|
|
74
|
-
{ "field": "name", "message": "Required" }
|
|
75
|
-
],
|
|
76
|
-
"requestId": "01HX7Y3Z..."
|
|
77
|
-
}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
**Always include `requestId`** — allows support to find logs immediately.
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
## Pagination
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
Offset-based (simple, less scalable):
|
|
88
|
-
GET /users?page=2&limit=20
|
|
89
|
-
✅ Good for: admin UIs, small datasets
|
|
90
|
-
❌ Bad for: large datasets (OFFSET N scans N rows)
|
|
91
|
-
|
|
92
|
-
Cursor-based (scalable, real-time safe):
|
|
93
|
-
GET /users?cursor=eyJpZCI6MTIzfQ&limit=20
|
|
94
|
-
Response: { data: [...], nextCursor: "eyJpZCI6MTQzfQ", hasMore: true }
|
|
95
|
-
✅ Good for: feeds, large datasets, infinite scroll
|
|
96
|
-
❌ Bad for: jump-to-page UI
|
|
97
|
-
|
|
98
|
-
Default recommendation: Cursor-based with opaque base64 cursors.
|
|
99
|
-
Expose total count only when necessary (expensive for large tables).
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Rate Limiting
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
Strategy: Token bucket or sliding window
|
|
108
|
-
|
|
109
|
-
Headers to include:
|
|
110
|
-
X-RateLimit-Limit: 1000 (max requests per window)
|
|
111
|
-
X-RateLimit-Remaining: 847 (requests left)
|
|
112
|
-
X-RateLimit-Reset: 1711234567 (Unix timestamp when window resets)
|
|
113
|
-
Retry-After: 60 (seconds to wait, on 429 only)
|
|
114
|
-
|
|
115
|
-
Recommended limits for SaaS APIs:
|
|
116
|
-
Authenticated: 1000 req/min per user
|
|
117
|
-
Unauthenticated: 60 req/min per IP
|
|
118
|
-
Sensitive (auth endpoints): 5 req/15min per IP
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## API Versioning
|
|
124
|
-
|
|
125
|
-
```
|
|
126
|
-
Strategy options:
|
|
127
|
-
URL versioning: /v1/users ← RECOMMENDED (explicit, cacheable)
|
|
128
|
-
Header versioning: Accept: application/vnd.myapp.v1+json (less visible)
|
|
129
|
-
Query param: /users?version=1 (ugly, cache issues)
|
|
130
|
-
|
|
131
|
-
Breaking vs non-breaking changes:
|
|
132
|
-
Non-breaking (safe without versioning):
|
|
133
|
-
✅ Adding new optional fields to response
|
|
134
|
-
✅ Adding new optional request parameters
|
|
135
|
-
✅ Adding new endpoints
|
|
136
|
-
|
|
137
|
-
Breaking (requires new version):
|
|
138
|
-
❌ Removing fields from response
|
|
139
|
-
❌ Changing field types
|
|
140
|
-
❌ Changing endpoint behavior
|
|
141
|
-
❌ Renaming fields
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## ❌ Anti-Patterns to Avoid
|
|
147
|
-
|
|
148
|
-
| ❌ NEVER DO | Why | ✅ DO INSTEAD |
|
|
149
|
-
|------------|-----|--------------|
|
|
150
|
-
| Return 200 for errors | Clients parse status codes; 200 failure = broken integrations | Use correct status codes |
|
|
151
|
-
| Expose internal IDs (auto-increment integers) | Enumerable, leaks count of records | UUIDs always |
|
|
152
|
-
| Breaking changes without versioning | Clients' production breaks silently | `/v2/` or deprecation period |
|
|
153
|
-
| Unbounded list endpoints | OOM at scale | Always paginate; default limit 20, max 100 |
|
|
154
|
-
| Verbose errors in production | Leaks internals to attackers | Generic message to client; details in server logs only |
|
|
155
|
-
| Synchronous long-running operations | Timeout at 30s+, bad UX | Accept → 202 Accepted → polling or webhook |
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
## Questions You Always Ask
|
|
160
|
-
|
|
161
|
-
**When designing a new endpoint:**
|
|
162
|
-
- Is this resource name a noun (not a verb)?
|
|
163
|
-
- What's the idempotency story? Can the client safely retry?
|
|
164
|
-
- What's the pagination strategy? What's the max page size?
|
|
165
|
-
- Is this a breaking change to existing consumers?
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Red Flags
|
|
170
|
-
|
|
171
|
-
**Must fix:**
|
|
172
|
-
- [ ] `200 OK` returned for error responses
|
|
173
|
-
- [ ] No pagination on list endpoints
|
|
174
|
-
- [ ] Auto-increment integer IDs exposed
|
|
175
|
-
- [ ] Breaking API change without version bump
|
|
176
|
-
|
|
177
|
-
**Should fix:**
|
|
178
|
-
- [ ] No rate limiting on public endpoints
|
|
179
|
-
- [ ] Error responses without field-level details
|
|
180
|
-
- [ ] No `requestId` in error responses (prevents support lookup)
|
|
181
|
-
- [ ] No OpenAPI/Swagger spec
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
## Who to Pair With
|
|
186
|
-
- `backend-developer` — for implementation of API patterns
|
|
187
|
-
- `auth-and-identity` — for auth design on API endpoints
|
|
188
|
-
- `saas-architect` — for multi-tenant API context
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
## Tools
|
|
193
|
-
OpenAPI / Swagger (spec) · Scalar / Stoplight (docs) · Hono / Fastify / Express (Node.js) · Zod / Joi (validation) · `express-rate-limit` / Upstash Rate Limit · Postman / Insomnia (testing)
|