@gobing-ai/spur 0.3.78 → 0.3.81

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 (177) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/config/config.example.yaml +29 -18
  3. package/config/config.global.yaml +10 -11
  4. package/config/pipeline-budgets.json +34 -2
  5. package/config/plugin-scripts.json +25 -0
  6. package/config/rules/boundary/config-loading-ownership.yaml +0 -3
  7. package/config/rules/boundary/dao-boundary.yaml +4 -17
  8. package/config/rules/boundary/planning-folder-hardcode.yaml +0 -1
  9. package/config/rules/boundary/sp-no-vendor-refs.yaml +3 -2
  10. package/config/rules/boundary/sp-runtime-path.yaml +3 -14
  11. package/config/rules/quality/coverage-gate.yaml +3 -14
  12. package/config/rules/quality/tsdoc-exports.yaml +4 -7
  13. package/config/rules/strict/http-boundaries.yaml +5 -8
  14. package/config/rules/strict/runtime-boundaries.yaml +1 -5
  15. package/config/rules/structure/protected-files.yaml +9 -3
  16. package/config/rules/structure/test-focus-skip.yaml +0 -2
  17. package/config/rules/structure/test-location.yaml +0 -5
  18. package/config/rules/surface/check-cli-surface.yaml +3 -2
  19. package/config/rules/typescript/bun-tooling.yaml +5 -7
  20. package/config/rules/typescript/guarded-happy-dom-register.yaml +0 -2
  21. package/config/rules/typescript/happy-dom-teardown.yaml +0 -2
  22. package/config/rules/typescript/no-biome-suppressions.yaml +0 -2
  23. package/config/rules/typescript/no-debugger.yaml +0 -2
  24. package/config/rules/typescript/no-eslint-suppressions.yaml +0 -4
  25. package/config/rules/typescript/no-leaky-module-mocks.yaml +6 -13
  26. package/config/rules/typescript/no-module-scope-import-calls.yaml +0 -2
  27. package/config/rules/typescript/no-syscall-emulation-in-boundary-mock.yaml +0 -3
  28. package/config/rules/typescript/no-unmocked-module-eval-side-effects.yaml +0 -3
  29. package/config/rules/typescript/output-boundaries.yaml +0 -3
  30. package/config/rules/typescript/prefer-accessible-role-for-button-queries.yaml +0 -3
  31. package/config/rules/ui/ui-import-boundary.yaml +1 -5
  32. package/config/templates/AGENTS.md +26 -23
  33. package/config/templates/docs/00_ADR.md +13 -23
  34. package/config/templates/docs/01_PRD.md +5 -2
  35. package/config/templates/docs/02_ROADMAP.md +9 -13
  36. package/config/templates/docs/03_ARCHITECTURE.md +2 -2
  37. package/config/templates/docs/04_DESIGN.md +12 -31
  38. package/config/templates/docs/05_FEATURES.md +6 -18
  39. package/config/templates/docs/99_PROJECT_CONSTITUTION.md +162 -394
  40. package/config/transition-shims.json +7 -7
  41. package/config/workflows/basic.yaml +4 -0
  42. package/config/workflows/docs-pipeline.yaml +13 -14
  43. package/config/workflows/feature-dev.yaml +20 -65
  44. package/config/workflows/history-anatomy.yaml +22 -1
  45. package/config/workflows/idea-pipeline.yaml +53 -97
  46. package/config/workflows/pr-review.yaml +21 -33
  47. package/config/workflows/task-pipeline.yaml +87 -330
  48. package/config/workflows/wayfinder-resolution.yaml +12 -26
  49. package/config/workflows/wrapup-pipeline.yaml +48 -189
  50. package/package.json +9 -9
  51. package/plugins/sp/README.md +22 -8
  52. package/plugins/sp/agents/expert-spur.md +41 -19
  53. package/plugins/sp/agents/super-reviewer.md +43 -8
  54. package/plugins/sp/lib/idea-handoff.generated.d.mts +17 -0
  55. package/plugins/sp/lib/idea-handoff.generated.mjs +1301 -0
  56. package/plugins/sp/plugin.json +1 -1
  57. package/plugins/sp/scripts/feature-dev-precheck.mjs +146 -0
  58. package/plugins/sp/scripts/feature-dev-precheck.ts +238 -0
  59. package/plugins/sp/scripts/idea-handoff.mjs +27 -0
  60. package/plugins/sp/scripts/idea-handoff.ts +44 -0
  61. package/plugins/sp/scripts/quality-gate.mjs +165 -0
  62. package/plugins/sp/scripts/quality-gate.ts +217 -0
  63. package/plugins/sp/scripts/verify-answer-lint.ts +21 -3
  64. package/plugins/sp/scripts/workflow-step-profile.mjs +319 -0
  65. package/plugins/sp/scripts/workflow-step-profile.ts +456 -0
  66. package/plugins/sp/scripts/wrapup-steps.mjs +350 -0
  67. package/plugins/sp/scripts/wrapup-steps.ts +466 -0
  68. package/plugins/sp/skills/conflict-finding/SKILL.md +6 -0
  69. package/plugins/sp/skills/daily-summary/SKILL.md +1 -1
  70. package/plugins/sp/skills/doc-evolve/SKILL.md +26 -40
  71. package/plugins/sp/skills/doc-evolve/references/operations.md +17 -30
  72. package/plugins/sp/skills/parallel-execution/references/dispatch-surface.md +1 -1
  73. package/plugins/sp/skills/spec-decomposition/references/decomposition.md +29 -0
  74. package/plugins/sp/skills/spur-cli/references/agent.md +56 -14
  75. package/plugins/sp/skills/spur-cli/references/message.md +30 -3
  76. package/plugins/sp/skills/spur-cli/references/projects.md +45 -1
  77. package/plugins/sp/skills/spur-cli/references/self.md +5 -4
  78. package/plugins/sp/skills/spur-cli/references/serve.md +5 -4
  79. package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +17 -1
  80. package/plugins/sp/skills/spur-cli/references/tasks.md +32 -2
  81. package/plugins/sp/skills/spur-cli/references/team.md +21 -1
  82. package/plugins/sp/skills/spur-cli/references/workflows/operations.md +6 -3
  83. package/plugins/sp/skills/spur-cli/references/workflows/workflow-fit-and-tuning.md +57 -18
  84. package/plugins/sp/skills/spur-composer/SKILL.md +145 -0
  85. package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +14 -0
  86. package/plugins/sp/skills/spur-dev/references/cross-cutting.md +3 -3
  87. package/plugins/sp/skills/spur-dev/references/done-housekeeping.md +12 -0
  88. package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +46 -4
  89. package/plugins/sp/skills/spur-dev/references/planning-workflow.md +24 -0
  90. package/plugins/sp/skills/spur-doctor/SKILL.md +138 -0
  91. package/plugins/sp/skills/taste-refactoring-api/README.md +43 -0
  92. package/plugins/sp/skills/taste-refactoring-api/SKILL.md +334 -0
  93. package/plugins/sp/skills/taste-refactoring-api/checklists/daily-api-review.md +71 -0
  94. package/plugins/sp/skills/taste-refactoring-api/examples/refactor-example.md +72 -0
  95. package/plugins/sp/skills/taste-refactoring-api/examples/review-template.md +93 -0
  96. package/plugins/sp/skills/taste-refactoring-api/references/api-refactoring-playbook.md +253 -0
  97. package/plugins/sp/skills/taste-refactoring-api/references/protocol-modes.md +79 -0
  98. package/plugins/sp/skills/taste-refactoring-api/references/research-basis.md +58 -0
  99. package/plugins/sp/skills/taste-refactoring-architect/README.md +26 -0
  100. package/plugins/sp/skills/taste-refactoring-architect/SKILL.md +471 -0
  101. package/plugins/sp/skills/taste-refactoring-architect/checklists/daily-architecture-review.md +48 -0
  102. package/plugins/sp/skills/taste-refactoring-architect/examples/refactor-example.md +55 -0
  103. package/plugins/sp/skills/taste-refactoring-architect/examples/review-template.md +51 -0
  104. package/plugins/sp/skills/taste-refactoring-architect/references/architecture-refactoring-playbook.md +173 -0
  105. package/plugins/sp/skills/taste-refactoring-architect/references/research-basis.md +28 -0
  106. package/plugins/sp/skills/taste-refactoring-tests/README.md +28 -0
  107. package/plugins/sp/skills/taste-refactoring-tests/SKILL.md +482 -0
  108. package/plugins/sp/skills/taste-refactoring-tests/checklists/daily-test-review.md +39 -0
  109. package/plugins/sp/skills/taste-refactoring-tests/examples/refactor-example.md +85 -0
  110. package/plugins/sp/skills/taste-refactoring-tests/examples/review-template.md +59 -0
  111. package/plugins/sp/skills/taste-refactoring-tests/references/research-basis.md +47 -0
  112. package/plugins/sp/skills/taste-refactoring-tests/references/test-refactoring-playbook.md +222 -0
  113. package/plugins/sp/skills/taste-refactoring-ui/README.md +12 -0
  114. package/plugins/sp/skills/taste-refactoring-ui/SKILL.md +290 -0
  115. package/plugins/sp/skills/taste-refactoring-ui/checklists/daily-ui-review.md +72 -0
  116. package/plugins/sp/skills/taste-refactoring-ui/examples/review-template.md +51 -0
  117. package/plugins/sp/skills/taste-refactoring-ui/references/refactoring-ui-playbook.md +170 -0
  118. package/plugins/sp/skills/wayfinder/SKILL.md +2 -2
  119. package/plugins/sp/skills/wayfinder/references/pipeline-resolution.md +30 -0
  120. package/schemas/spur-config.schema.json +49 -0
  121. package/spur.js +46936 -44198
  122. package/web/_astro/{BoardApp.CHQ1lycZ.js → BoardApp.B1U26g3I.js} +97 -95
  123. package/web/_astro/BoardApp.Csgyg-lS.js +1 -0
  124. package/web/_astro/{TaskDetail.GKfQJ60c.js → TaskDetail.DwPqpq7v.js} +1 -1
  125. package/web/_astro/{arc.DWEtA3Tx.js → arc.CweZEjN2.js} +1 -1
  126. package/web/_astro/{architectureDiagram-3BPJPVTR.DB42oWmP.js → architectureDiagram-3BPJPVTR.D89pbDuv.js} +1 -1
  127. package/web/_astro/{blockDiagram-GPEHLZMM.rhv-zNQV.js → blockDiagram-GPEHLZMM.BOuTeEpX.js} +1 -1
  128. package/web/_astro/{c4Diagram-AAUBKEIU.Ci4-4VvY.js → c4Diagram-AAUBKEIU.CASbkWZF.js} +1 -1
  129. package/web/_astro/channel.Cx6sXxhq.js +1 -0
  130. package/web/_astro/{chunk-2J33WTMH.Cc9veUgf.js → chunk-2J33WTMH.BKQYtOvY.js} +1 -1
  131. package/web/_astro/{chunk-4BX2VUAB.Bec9c4eI.js → chunk-4BX2VUAB.9sHLdMtG.js} +1 -1
  132. package/web/_astro/{chunk-55IACEB6.DoV8S1iB.js → chunk-55IACEB6.wOLXWlPs.js} +1 -1
  133. package/web/_astro/{chunk-727SXJPM.DwR-Qlyj.js → chunk-727SXJPM.DovFbwg3.js} +1 -1
  134. package/web/_astro/{chunk-AQP2D5EJ.ND_a81WY.js → chunk-AQP2D5EJ.B1Weod1X.js} +1 -1
  135. package/web/_astro/{chunk-FMBD7UC4.Wv_jwG48.js → chunk-FMBD7UC4.TEMS04st.js} +1 -1
  136. package/web/_astro/{chunk-ND2GUHAM.CXKXCMmp.js → chunk-ND2GUHAM.Cp8VT1wQ.js} +1 -1
  137. package/web/_astro/{chunk-QZHKN3VN.nkaoNYQq.js → chunk-QZHKN3VN.BzATdEcP.js} +1 -1
  138. package/web/_astro/{classDiagram-4FO5ZUOK.cMQcVlQu.js → classDiagram-4FO5ZUOK.C9BOCfAO.js} +1 -1
  139. package/web/_astro/{classDiagram-v2-Q7XG4LA2.cMQcVlQu.js → classDiagram-v2-Q7XG4LA2.C9BOCfAO.js} +1 -1
  140. package/web/_astro/{cose-bilkent-S5V4N54A.OaDJ7Mr2.js → cose-bilkent-S5V4N54A.DUnr4UAw.js} +1 -1
  141. package/web/_astro/{cynefin-OW5HDTMX.Chi8IphF.js → cynefin-OW5HDTMX.rYq5uM3D.js} +1 -1
  142. package/web/_astro/{cytoscape.esm.DzSz-X2X.js → cytoscape.esm.BB4DxJjf.js} +1 -1
  143. package/web/_astro/{dagre-BM42HDAG.CzK2t_Fp.js → dagre-BM42HDAG.CWeNKe3I.js} +1 -1
  144. package/web/_astro/{diagram-2AECGRRQ.DRvxlVS7.js → diagram-2AECGRRQ.DCkfls10.js} +1 -1
  145. package/web/_astro/{diagram-5GNKFQAL.CnYvNdwA.js → diagram-5GNKFQAL.D5U4JCka.js} +1 -1
  146. package/web/_astro/{diagram-KO2AKTUF.CpLpMw5R.js → diagram-KO2AKTUF.BZJgqaqG.js} +1 -1
  147. package/web/_astro/{diagram-LMA3HP47.JTb78qUA.js → diagram-LMA3HP47.DoMeHvPR.js} +1 -1
  148. package/web/_astro/{diagram-OG6HWLK6.Bk-1jDIb.js → diagram-OG6HWLK6.B50qwwWX.js} +1 -1
  149. package/web/_astro/{erDiagram-TEJ5UH35.D8hN9GZq.js → erDiagram-TEJ5UH35.DdGPG6LK.js} +1 -1
  150. package/web/_astro/{flowDiagram-I6XJVG4X.-6zQr6m5.js → flowDiagram-I6XJVG4X.QP2MJ12u.js} +1 -1
  151. package/web/_astro/{ganttDiagram-6RSMTGT7.DboLQ9ca.js → ganttDiagram-6RSMTGT7.BI6LgKSy.js} +1 -1
  152. package/web/_astro/{gitGraphDiagram-PVQCEYII.4tYvJKGR.js → gitGraphDiagram-PVQCEYII.npPZiC2G.js} +1 -1
  153. package/web/_astro/index.DayyIngm.css +1 -0
  154. package/web/_astro/{infoDiagram-5YYISTIA.Bd9rXpsB.js → infoDiagram-5YYISTIA.DCJCBVbp.js} +1 -1
  155. package/web/_astro/{ishikawaDiagram-YF4QCWOH.CvMoaf67.js → ishikawaDiagram-YF4QCWOH.BMLV-3I1.js} +1 -1
  156. package/web/_astro/{journeyDiagram-JHISSGLW.Ccy1CA7y.js → journeyDiagram-JHISSGLW.LE58crde.js} +1 -1
  157. package/web/_astro/{kanban-definition-UN3LZRKU.0MaMqHNS.js → kanban-definition-UN3LZRKU.BPbz8rH9.js} +1 -1
  158. package/web/_astro/{linear.CHXgcIbN.js → linear.DhZaBtYh.js} +1 -1
  159. package/web/_astro/{mermaid.core.Ca-kcelG.js → mermaid.core.BD5-jXum.js} +6 -6
  160. package/web/_astro/{mindmap-definition-RKZ34NQL.BUIDlHa0.js → mindmap-definition-RKZ34NQL.MTJyrQ65.js} +1 -1
  161. package/web/_astro/ordinal.BYWQX77i.js +1 -0
  162. package/web/_astro/{pieDiagram-4H26LBE5.2dX3CU1s.js → pieDiagram-4H26LBE5.BrDhDvIS.js} +1 -1
  163. package/web/_astro/{quadrantDiagram-W4KKPZXB.B3LBlRiv.js → quadrantDiagram-W4KKPZXB.71d73_5N.js} +1 -1
  164. package/web/_astro/{requirementDiagram-4Y6WPE33.X12I2uNx.js → requirementDiagram-4Y6WPE33.Bga6UF-z.js} +1 -1
  165. package/web/_astro/{sankeyDiagram-5OEKKPKP.BXohIHqx.js → sankeyDiagram-5OEKKPKP.BnHs4K82.js} +1 -1
  166. package/web/_astro/{sequenceDiagram-3UESZ5HK.C37ZIUzg.js → sequenceDiagram-3UESZ5HK.DsfY2gnj.js} +1 -1
  167. package/web/_astro/{stateDiagram-AJRCARHV.BRgz317z.js → stateDiagram-AJRCARHV.DvsTSc9a.js} +1 -1
  168. package/web/_astro/{stateDiagram-v2-BHNVJYJU.7VYSXN9-.js → stateDiagram-v2-BHNVJYJU.DxzzmHUR.js} +1 -1
  169. package/web/_astro/{timeline-definition-PNZ67QCA.BVNz_HiN.js → timeline-definition-PNZ67QCA.4ZuQmOTt.js} +1 -1
  170. package/web/_astro/{vennDiagram-CIIHVFJN.CHVDkPX4.js → vennDiagram-CIIHVFJN.Ck5Q86SG.js} +1 -1
  171. package/web/_astro/{wardleyDiagram-YWT4CUSO.EQQ_qT9v.js → wardleyDiagram-YWT4CUSO.BK7k2hXr.js} +1 -1
  172. package/web/_astro/{xychartDiagram-2RQKCTM6.DrAT9WoP.js → xychartDiagram-2RQKCTM6.DfCrgauK.js} +1 -1
  173. package/web/index.html +2 -2
  174. package/web/_astro/BoardApp.DV9kx0wo.js +0 -1
  175. package/web/_astro/channel.BAI6xLeV.js +0 -1
  176. package/web/_astro/index.Dcr_8fiK.css +0 -1
  177. package/web/_astro/ordinal.DBvzRdQf.js +0 -1
@@ -0,0 +1,253 @@
1
+ # API Refactoring — Operational Playbook
2
+
3
+ This playbook is a practical synthesis of established API standards and widely used design guidance. It is not tied to one vendor or architectural style.
4
+
5
+ ## 1. Start from the consumer job
6
+
7
+ Before naming endpoints, write the job a caller is trying to complete. Good APIs optimize the caller’s mental model, not the server’s package structure.
8
+
9
+ Questions:
10
+ - What must the caller know before invoking this operation?
11
+ - What is the smallest successful outcome?
12
+ - What failures can the caller actually recover from?
13
+ - What parts of the workflow are synchronous vs asynchronous?
14
+ - Which data belongs in one consistency boundary?
15
+
16
+ ## 2. Model stable domain concepts
17
+
18
+ Prefer stable nouns/types with durable identifiers. Do not expose internal database tables, ORM entities, queue names, deployment topology, or microservice ownership unless those are themselves the public domain.
19
+
20
+ Refactoring signal: if a database rename forces an API rename, the contract is too coupled to storage.
21
+
22
+ ## 3. Prefer protocol-native semantics
23
+
24
+ ### HTTP
25
+ Use method semantics and status codes as intended. RFC 9110 defines safe methods and idempotent methods; the retry characteristics of operations should align with those semantics.
26
+
27
+ ### RPC / gRPC
28
+ Use explicit request/response messages, canonical status codes, deadlines, and predictable method naming. Treat semantic compatibility separately from wire compatibility.
29
+
30
+ ### GraphQL
31
+ Use the schema/type system as the contract. Field names, nullability, input types, pagination, and deprecation are all compatibility decisions.
32
+
33
+ ### Events/webhooks
34
+ Treat event type, envelope, delivery guarantees, ordering, retries, and deduplication as the contract.
35
+
36
+ ## 4. Resource-oriented by default, actions when necessary
37
+
38
+ For resource APIs, model collections and resources first. Standard operations should handle the majority of use cases. Use custom actions when intent does not fit create/get/list/update/delete semantics cleanly.
39
+
40
+ Example:
41
+ - Prefer `POST /orders` over `POST /createOrder`.
42
+ - Prefer `POST /orders/{id}:cancel` or a cancellation subresource over inventing an unsafe `GET /cancelOrder?id=...`.
43
+
44
+ Custom actions are not inherently bad; arbitrary inconsistency is.
45
+
46
+ ## 5. Make schemas explicit
47
+
48
+ Define:
49
+ - required vs optional;
50
+ - nullable vs absent;
51
+ - default behavior;
52
+ - value constraints;
53
+ - enum semantics and unknown-value strategy;
54
+ - identifiers and formats;
55
+ - timestamps/time zones;
56
+ - money/decimal representation;
57
+ - read-only vs write-only/server-generated fields.
58
+
59
+ Avoid generic maps/JSON blobs unless open-ended data is truly part of the domain.
60
+
61
+ ## 6. Design partial update deliberately
62
+
63
+ A partial update needs an explicit model for:
64
+ - omitted field = unchanged?
65
+ - null = clear value, invalid, or unchanged?
66
+ - empty collection = clear all or no change?
67
+ - nested object = merge or replace?
68
+
69
+ For HTTP, choose and document a patch format rather than relying on framework deserialization quirks.
70
+
71
+ ## 7. Collections need contracts too
72
+
73
+ For any collection that can grow:
74
+ - paginate from day one;
75
+ - define deterministic ordering;
76
+ - bound page size;
77
+ - prefer opaque cursors/tokens when traversal must remain stable and implementation-flexible;
78
+ - document filter and sort grammar;
79
+ - decide whether total counts are exact, estimated, expensive, or omitted;
80
+ - define what happens if items are inserted/deleted between pages.
81
+
82
+ Adding pagination later can be behaviorally breaking because existing clients may assume a full collection response.
83
+
84
+ ## 8. Errors should be actionable
85
+
86
+ An error contract should answer:
87
+ - What category of failure occurred?
88
+ - Is the request malformed, unauthenticated, unauthorized, conflicting, rate limited, temporarily unavailable, or permanently invalid?
89
+ - Which field/value is wrong?
90
+ - Can the caller retry? When?
91
+ - What stable code/type can software branch on?
92
+
93
+ For new HTTP APIs, RFC 9457 Problem Details is a strong standard envelope when it fits the ecosystem.
94
+
95
+ Do not expose stack traces, SQL messages, internal hostnames, secrets, or raw downstream errors.
96
+
97
+ ## 9. Design for retries
98
+
99
+ Network ambiguity means the client may not know whether a mutation succeeded.
100
+
101
+ Use one or more of:
102
+ - naturally idempotent methods/operations;
103
+ - client-chosen resource IDs;
104
+ - idempotency keys for retry-safe creation/action requests;
105
+ - deduplication records keyed by caller + idempotency key + request fingerprint;
106
+ - operation resources for asynchronous work.
107
+
108
+ If using an `Idempotency-Key` header, note that the IETF specification is still an Internet-Draft as of this skill’s research date, so treat the exact standardization status accordingly.
109
+
110
+ ## 10. Handle concurrent writes explicitly
111
+
112
+ When lost updates matter, use optimistic concurrency:
113
+ - HTTP ETag + `If-Match`;
114
+ - resource revision/version fields;
115
+ - compare-and-set preconditions.
116
+
117
+ A failed precondition should be distinguishable from malformed input.
118
+
119
+ ## 11. Long-running work should look long-running
120
+
121
+ If work can exceed normal request latency or has meaningful progress/cancellation:
122
+ - return an accepted/operation response quickly;
123
+ - expose operation status;
124
+ - make polling bounded and cache-friendly where possible;
125
+ - support cancellation if useful;
126
+ - define terminal success/failure shape;
127
+ - separate operation identity from resulting resource identity.
128
+
129
+ ## 12. Evolve additively
130
+
131
+ Prefer:
132
+ - add optional request fields;
133
+ - add response fields that tolerant clients ignore;
134
+ - add new operations;
135
+ - add a new version only for true contract breaks.
136
+
137
+ Be cautious with:
138
+ - enum expansion for generated/exhaustive clients;
139
+ - changing defaults;
140
+ - narrowing validation;
141
+ - changing sort order;
142
+ - changing error identities;
143
+ - changing nullability;
144
+ - switching sync operations to async without migration.
145
+
146
+ ## 13. Deprecate with evidence
147
+
148
+ A deprecation needs:
149
+ - replacement behavior;
150
+ - deprecation date;
151
+ - target removal date or policy;
152
+ - usage telemetry;
153
+ - owner/contact path;
154
+ - migration examples;
155
+ - client communication.
156
+
157
+ Do not keep every version forever, but do not remove based on guesses.
158
+
159
+ ## 14. Security is deeper than authentication
160
+
161
+ Use OWASP API Security Top 10 as a recurring review lens.
162
+
163
+ Core checks:
164
+ - authorize the specific object referenced by every client-controlled ID;
165
+ - authorize individual properties on read/write when sensitivity differs;
166
+ - avoid mass assignment by whitelisting writable fields;
167
+ - bound expensive operations and collection sizes;
168
+ - guard business-critical flows against automation/abuse;
169
+ - validate outbound fetch URLs and network destinations to reduce SSRF risk;
170
+ - inventory old hosts/versions/shadow APIs;
171
+ - treat downstream APIs as untrusted inputs and validate their data too.
172
+
173
+ ## 15. Observability is a client feature
174
+
175
+ A diagnosable API should provide or propagate request/trace identity and make server telemetry correlate with client-visible failures.
176
+
177
+ Useful operational dimensions:
178
+ - operation/route/method;
179
+ - status/error type;
180
+ - latency;
181
+ - request/response size;
182
+ - client/application identity where allowed;
183
+ - retries/timeouts;
184
+ - throttling/quota events;
185
+ - downstream dependency failures.
186
+
187
+ Never put secrets or sensitive payloads in logs by default.
188
+
189
+ ## 16. Documentation should be testable
190
+
191
+ For contract-first or contract-documented APIs:
192
+ - validate OpenAPI/GraphQL/protobuf/AsyncAPI-like definitions in CI;
193
+ - lint naming and requiredness;
194
+ - validate examples;
195
+ - generate compatibility diffs;
196
+ - run consumer/contract tests;
197
+ - fail builds on undocumented public endpoints if the organization requires spec completeness.
198
+
199
+ The OpenAPI Initiative currently publishes OAS 3.2.0 and 3.1.x. Choose a version your tooling supports; do not upgrade a spec version only for fashion.
200
+
201
+ ## 17. Protocol-specific notes
202
+
203
+ ### REST/HTTP quick rules
204
+ - nouns/resources in paths by default;
205
+ - no state change on `GET`;
206
+ - precise status codes;
207
+ - `Location` for newly created resources when useful;
208
+ - conditional requests for concurrency/cache validation;
209
+ - clear content types;
210
+ - RFC 9457-style errors when appropriate.
211
+
212
+ ### gRPC quick rules
213
+ - explicit request/response messages;
214
+ - deadlines propagated;
215
+ - canonical status codes;
216
+ - idempotency/retry documented;
217
+ - streaming only when interaction needs it;
218
+ - reserve removed protobuf field numbers/names;
219
+ - do not reinterpret existing fields silently.
220
+
221
+ ### GraphQL quick rules
222
+ - product/domain schema, not service topology;
223
+ - strong types over JSON blobs;
224
+ - nullability is a guarantee;
225
+ - input objects for evolvability;
226
+ - cursors/connections for large lists;
227
+ - deprecate before removal;
228
+ - query complexity and authorization at resolver/field boundaries.
229
+
230
+ ### Event/webhook quick rules
231
+ - stable event IDs and types;
232
+ - versioning strategy;
233
+ - explicit at-least-once/ordering semantics;
234
+ - dedup guidance;
235
+ - signatures + replay protection;
236
+ - additive payload evolution.
237
+
238
+ ## 18. Daily refactoring sequence
239
+
240
+ When reviewing an API every day, use this order:
241
+ 1. consumer job;
242
+ 2. domain model;
243
+ 3. semantics;
244
+ 4. naming/schema;
245
+ 5. collections;
246
+ 6. errors;
247
+ 7. retries/concurrency;
248
+ 8. compatibility;
249
+ 9. security;
250
+ 10. observability/performance;
251
+ 11. docs/tests.
252
+
253
+ Fix the earliest broken layer first. Cosmetic naming polish should not distract from a confused domain model or unsafe mutation semantics.
@@ -0,0 +1,79 @@
1
+ # Protocol-specific API review
2
+
3
+ ## REST/HTTP mode
4
+
5
+ ### Resource design
6
+ - Prefer noun-based resource paths for domain entities and collections.
7
+ - Use nesting when it communicates true ownership or scope; avoid deep path trees that mirror storage.
8
+ - Keep canonical IDs stable even if names or hierarchy labels change.
9
+ - Use custom action endpoints only when standard resource operations cannot express the intent cleanly.
10
+
11
+ ### HTTP methods
12
+ - `GET` and `HEAD` are read-oriented and safe; do not hide state-changing behavior behind them.
13
+ - `PUT` should represent full replacement/upsert semantics where the client addresses the target and repeated identical requests have the same intended effect.
14
+ - `PATCH` should define a clear patch model; do not leave null/omitted/reset semantics ambiguous.
15
+ - `DELETE` should be idempotent in intended effect; define repeated-delete behavior consistently.
16
+ - `POST` is appropriate for creation under a collection and non-idempotent/custom actions; add idempotency support when safe retries are required.
17
+
18
+ ### Status codes
19
+ Use status codes as protocol semantics, not decorative metadata. Favor the narrowest standard code that tells generic clients what happened. Common distinctions include:
20
+ - `200` successful response with content;
21
+ - `201` resource created, normally with a discoverable resource location;
22
+ - `202` accepted for asynchronous processing;
23
+ - `204` successful response without representation;
24
+ - `304` conditional request not modified;
25
+ - `400` malformed/invalid request when no more specific code applies;
26
+ - `401` missing/invalid authentication;
27
+ - `403` authenticated but not permitted;
28
+ - `404` target not found, including intentionally concealed unauthorized resources where appropriate;
29
+ - `409` state conflict;
30
+ - `412` failed precondition for conditional mutation;
31
+ - `413` request content too large;
32
+ - `415` unsupported media type;
33
+ - `422` syntactically valid content that cannot be processed under the API’s validation semantics, when this distinction is useful;
34
+ - `429` rate limited;
35
+ - `5xx` server-side inability to fulfill an otherwise valid request.
36
+
37
+ Do not create application-defined pseudo-status codes outside the HTTP status space.
38
+
39
+ ### Error representation
40
+ For HTTP APIs, prefer a consistent machine-readable error envelope. RFC 9457 Problem Details is a strong default for new APIs when it fits the ecosystem. Keep problem `type`/application error identity stable, include actionable detail, and attach structured extensions only when clients need them.
41
+
42
+ ### Conditional requests and concurrency
43
+ For mutation races, prefer explicit optimistic concurrency such as ETags / `If-Match`, version fields, or revision tokens. Do not silently implement last-write-wins when lost updates would matter.
44
+
45
+ ## RPC / gRPC mode
46
+
47
+ - Prefer a small predictable set of standard methods for resource-oriented services before custom RPCs.
48
+ - Keep request/response messages explicit even when they currently contain one field; this preserves room to evolve.
49
+ - Use canonical status codes consistently; do not tunnel all errors through `UNKNOWN`/`INTERNAL`.
50
+ - Propagate deadlines. A server should know when a caller no longer cares about work.
51
+ - Define retry behavior only for operations that are safe to retry; coordinate with service config/client retry policies.
52
+ - Use streaming when it matches interaction semantics, not merely to avoid pagination.
53
+ - Avoid reusing a protobuf field number after removal; reserve removed numbers/names where appropriate.
54
+ - Prefer additive field evolution and treat semantic reinterpretation as a breaking change even when wire compatibility remains.
55
+
56
+ ## GraphQL mode
57
+
58
+ - Design the schema around consumer-facing domain concepts and product workflows, not backend services.
59
+ - Prefer clear field names and strong types over generic `JSON` blobs.
60
+ - Treat nullability as a compatibility contract; tightening nullability can break clients and loosening it changes guarantees.
61
+ - Use input object types for evolving argument sets.
62
+ - Prefer connection/cursor pagination for unbounded collections when clients need stable traversal.
63
+ - Put side effects in mutations and name mutations by domain intent.
64
+ - Deprecate fields/arguments/input fields/enum values with reasons before removal; measure usage where possible.
65
+ - Prevent abusive query cost with depth/complexity/breadth controls, pagination limits, timeouts, and resolver-level authorization.
66
+ - Avoid N+1 resolver behavior with batching/data-loader patterns or equivalent backend aggregation.
67
+ - Remember that GraphQL errors can coexist with partial data; define which errors are expected domain outcomes versus exceptional execution failures.
68
+
69
+ ## Event / webhook mode
70
+
71
+ - Define a stable event type and versioning strategy independent of internal producer class names.
72
+ - Use a consistent envelope with event ID, source, type, timestamp, subject/resource identity, and payload.
73
+ - Assume at-least-once delivery unless stronger guarantees truly exist; consumers need deduplication by event ID or domain key.
74
+ - Define ordering scope explicitly; never imply global ordering unless guaranteed.
75
+ - Document retry schedule, maximum attempts, dead-letter behavior, and retention.
76
+ - Sign webhooks, include replay protection, and rotate secrets safely.
77
+ - Make consumers tolerant of additive fields.
78
+ - Do not use events as disguised synchronous RPC responses when the caller needs an immediate result.
79
+
@@ -0,0 +1,58 @@
1
+ # Research Basis and Standards References
2
+
3
+ This skill intentionally synthesizes standards and public guidance instead of depending on a single book.
4
+
5
+ Research checked in September 2026.
6
+
7
+ ## HTTP semantics
8
+
9
+ - RFC 9110 — HTTP Semantics: https://www.rfc-editor.org/rfc/rfc9110.html
10
+ - Defines request method semantics, safe methods, idempotency, status codes, conditional requests, and HTTP representation behavior.
11
+
12
+ ## HTTP API errors
13
+
14
+ - RFC 9457 — Problem Details for HTTP APIs: https://www.rfc-editor.org/rfc/rfc9457.html
15
+ - Standard machine-readable problem detail model; obsoletes RFC 7807.
16
+
17
+ ## OpenAPI
18
+
19
+ - OpenAPI Specification: https://spec.openapis.org/oas/
20
+ - Current published version list includes OpenAPI 3.2.0 and 3.1.x.
21
+
22
+ ## Resource-oriented design
23
+
24
+ - Google AIP-121 — Resource-oriented design: https://google.aip.dev/121
25
+ - Google AIP-130 — Methods: https://google.aip.dev/130
26
+ - Google AIP-132 — Standard methods: List: https://google.aip.dev/132
27
+ - Google AIP-136 — Custom methods: https://google.aip.dev/136
28
+ - Google AIP-158 — Pagination: https://google.aip.dev/158
29
+
30
+ These are vendor-specific guidelines, but they capture broadly useful patterns: stable resources, standard operations, custom actions only when necessary, and pagination designed from the start.
31
+
32
+ ## API security
33
+
34
+ - OWASP API Security Top 10 — 2023: https://api-security.owasp.org/editions/2023/en/0x11-t10/
35
+ - Used as the baseline threat-model checklist for object-level authorization, authentication, property-level authorization, resource consumption, function-level authorization, sensitive business flows, SSRF, misconfiguration, inventory, and unsafe downstream API consumption.
36
+
37
+ ## GraphQL
38
+
39
+ - GraphQL Specification — September 2025: https://spec.graphql.org/September2025/
40
+ - Used for schema/type-system, deprecation, nullability, input/output, and execution semantics.
41
+
42
+ ## Events
43
+
44
+ - CloudEvents: https://cloudevents.io/
45
+ - Useful reference for stable event envelope concepts and interoperability.
46
+
47
+ ## Idempotency keys
48
+
49
+ - IETF HTTPAPI draft — Idempotency-Key HTTP Header Field: https://datatracker.ietf.org/doc/draft-ietf-httpapi-idempotency-key-header/
50
+ - As of the research date this remains an Internet-Draft, not a final RFC. The skill therefore treats the design pattern as useful while avoiding claims that the header is a finalized HTTP standard.
51
+
52
+ ## Additional architectural guidance
53
+
54
+ - Microsoft Azure Architecture Center — API design / RESTful web API design:
55
+ - https://learn.microsoft.com/en-us/azure/architecture/microservices/design/api-design
56
+ - https://learn.microsoft.com/en-us/azure/architecture/best-practices/api-design
57
+
58
+ This material reinforces loose coupling, domain-oriented contracts, compatibility/versioning, pagination/filtering, idempotency, and operational concerns.
@@ -0,0 +1,26 @@
1
+ # taste-refactoring-architect
2
+
3
+ A reusable agent skill for system architecture refactoring with one central goal:
4
+
5
+ **Simplify the architecture while preserving all required features and delivery qualities.**
6
+
7
+ It uses a graded intervention model instead of treating every issue as a redesign problem:
8
+
9
+ - A0 KEEP
10
+ - A1 DIRECT REMOVE
11
+ - A2 SUGGEST REMOVE
12
+ - A3 CONSOLIDATE / SIMPLIFY
13
+ - A4 SUGGEST ENHANCE
14
+ - A5 RE-BOUNDARY
15
+ - A6 SUGGEST RE-DESIGN
16
+ - A7 DEFER / OBSERVE
17
+
18
+ The package includes:
19
+ - `SKILL.md` — operational agent instructions
20
+ - `references/architecture-refactoring-playbook.md` — deeper techniques
21
+ - `references/research-basis.md` — standards/practice basis
22
+ - `checklists/daily-architecture-review.md` — quick daily checklist
23
+ - `examples/review-template.md` — reusable assessment format
24
+ - `examples/refactor-example.md` — worked example
25
+
26
+ The skill interprets **STOA** as **state-of-the-art** architecture techniques. If your organization means a particular named STOA methodology, customize `research-basis.md` and map its rules into the action ladder.