@gobing-ai/spur 0.3.80 → 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 (158) 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/transition-shims.json +7 -7
  33. package/config/workflows/basic.yaml +4 -0
  34. package/config/workflows/docs-pipeline.yaml +13 -14
  35. package/config/workflows/feature-dev.yaml +20 -65
  36. package/config/workflows/history-anatomy.yaml +22 -1
  37. package/config/workflows/idea-pipeline.yaml +53 -97
  38. package/config/workflows/pr-review.yaml +21 -33
  39. package/config/workflows/task-pipeline.yaml +87 -330
  40. package/config/workflows/wayfinder-resolution.yaml +12 -26
  41. package/config/workflows/wrapup-pipeline.yaml +48 -189
  42. package/package.json +9 -9
  43. package/plugins/sp/README.md +10 -1
  44. package/plugins/sp/agents/expert-spur.md +41 -19
  45. package/plugins/sp/lib/idea-handoff.generated.d.mts +17 -0
  46. package/plugins/sp/lib/idea-handoff.generated.mjs +1301 -0
  47. package/plugins/sp/plugin.json +1 -1
  48. package/plugins/sp/scripts/feature-dev-precheck.mjs +146 -0
  49. package/plugins/sp/scripts/feature-dev-precheck.ts +238 -0
  50. package/plugins/sp/scripts/idea-handoff.mjs +27 -0
  51. package/plugins/sp/scripts/idea-handoff.ts +44 -0
  52. package/plugins/sp/scripts/quality-gate.mjs +165 -0
  53. package/plugins/sp/scripts/quality-gate.ts +217 -0
  54. package/plugins/sp/scripts/workflow-step-profile.mjs +319 -0
  55. package/plugins/sp/scripts/workflow-step-profile.ts +456 -0
  56. package/plugins/sp/scripts/wrapup-steps.mjs +350 -0
  57. package/plugins/sp/scripts/wrapup-steps.ts +466 -0
  58. package/plugins/sp/skills/parallel-execution/references/dispatch-surface.md +1 -1
  59. package/plugins/sp/skills/spec-decomposition/references/decomposition.md +29 -0
  60. package/plugins/sp/skills/spur-cli/references/agent.md +56 -14
  61. package/plugins/sp/skills/spur-cli/references/message.md +30 -3
  62. package/plugins/sp/skills/spur-cli/references/projects.md +45 -1
  63. package/plugins/sp/skills/spur-cli/references/self.md +5 -4
  64. package/plugins/sp/skills/spur-cli/references/serve.md +5 -4
  65. package/plugins/sp/skills/spur-cli/references/tasks.md +1 -1
  66. package/plugins/sp/skills/spur-cli/references/team.md +21 -1
  67. package/plugins/sp/skills/spur-cli/references/workflows/operations.md +6 -3
  68. package/plugins/sp/skills/spur-cli/references/workflows/workflow-fit-and-tuning.md +57 -18
  69. package/plugins/sp/skills/spur-composer/SKILL.md +145 -0
  70. package/plugins/sp/skills/spur-dev/references/planning-workflow.md +24 -0
  71. package/plugins/sp/skills/spur-doctor/SKILL.md +138 -0
  72. package/plugins/sp/skills/taste-refactoring-api/README.md +43 -0
  73. package/plugins/sp/skills/taste-refactoring-api/SKILL.md +334 -0
  74. package/plugins/sp/skills/taste-refactoring-api/checklists/daily-api-review.md +71 -0
  75. package/plugins/sp/skills/taste-refactoring-api/examples/refactor-example.md +72 -0
  76. package/plugins/sp/skills/taste-refactoring-api/examples/review-template.md +93 -0
  77. package/plugins/sp/skills/taste-refactoring-api/references/api-refactoring-playbook.md +253 -0
  78. package/plugins/sp/skills/taste-refactoring-api/references/protocol-modes.md +79 -0
  79. package/plugins/sp/skills/taste-refactoring-api/references/research-basis.md +58 -0
  80. package/plugins/sp/skills/taste-refactoring-architect/README.md +26 -0
  81. package/plugins/sp/skills/taste-refactoring-architect/SKILL.md +471 -0
  82. package/plugins/sp/skills/taste-refactoring-architect/checklists/daily-architecture-review.md +48 -0
  83. package/plugins/sp/skills/taste-refactoring-architect/examples/refactor-example.md +55 -0
  84. package/plugins/sp/skills/taste-refactoring-architect/examples/review-template.md +51 -0
  85. package/plugins/sp/skills/taste-refactoring-architect/references/architecture-refactoring-playbook.md +173 -0
  86. package/plugins/sp/skills/taste-refactoring-architect/references/research-basis.md +28 -0
  87. package/plugins/sp/skills/taste-refactoring-tests/README.md +28 -0
  88. package/plugins/sp/skills/taste-refactoring-tests/SKILL.md +482 -0
  89. package/plugins/sp/skills/taste-refactoring-tests/checklists/daily-test-review.md +39 -0
  90. package/plugins/sp/skills/taste-refactoring-tests/examples/refactor-example.md +85 -0
  91. package/plugins/sp/skills/taste-refactoring-tests/examples/review-template.md +59 -0
  92. package/plugins/sp/skills/taste-refactoring-tests/references/research-basis.md +47 -0
  93. package/plugins/sp/skills/taste-refactoring-tests/references/test-refactoring-playbook.md +222 -0
  94. package/plugins/sp/skills/taste-refactoring-ui/README.md +12 -0
  95. package/plugins/sp/skills/taste-refactoring-ui/SKILL.md +290 -0
  96. package/plugins/sp/skills/taste-refactoring-ui/checklists/daily-ui-review.md +72 -0
  97. package/plugins/sp/skills/taste-refactoring-ui/examples/review-template.md +51 -0
  98. package/plugins/sp/skills/taste-refactoring-ui/references/refactoring-ui-playbook.md +170 -0
  99. package/plugins/sp/skills/wayfinder/SKILL.md +2 -2
  100. package/plugins/sp/skills/wayfinder/references/pipeline-resolution.md +30 -0
  101. package/schemas/spur-config.schema.json +49 -0
  102. package/spur.js +46754 -44121
  103. package/web/_astro/{BoardApp.CHQ1lycZ.js → BoardApp.B1U26g3I.js} +97 -95
  104. package/web/_astro/BoardApp.Csgyg-lS.js +1 -0
  105. package/web/_astro/{TaskDetail.GKfQJ60c.js → TaskDetail.DwPqpq7v.js} +1 -1
  106. package/web/_astro/{arc.DWEtA3Tx.js → arc.CweZEjN2.js} +1 -1
  107. package/web/_astro/{architectureDiagram-3BPJPVTR.DB42oWmP.js → architectureDiagram-3BPJPVTR.D89pbDuv.js} +1 -1
  108. package/web/_astro/{blockDiagram-GPEHLZMM.rhv-zNQV.js → blockDiagram-GPEHLZMM.BOuTeEpX.js} +1 -1
  109. package/web/_astro/{c4Diagram-AAUBKEIU.Ci4-4VvY.js → c4Diagram-AAUBKEIU.CASbkWZF.js} +1 -1
  110. package/web/_astro/channel.Cx6sXxhq.js +1 -0
  111. package/web/_astro/{chunk-2J33WTMH.Cc9veUgf.js → chunk-2J33WTMH.BKQYtOvY.js} +1 -1
  112. package/web/_astro/{chunk-4BX2VUAB.Bec9c4eI.js → chunk-4BX2VUAB.9sHLdMtG.js} +1 -1
  113. package/web/_astro/{chunk-55IACEB6.DoV8S1iB.js → chunk-55IACEB6.wOLXWlPs.js} +1 -1
  114. package/web/_astro/{chunk-727SXJPM.DwR-Qlyj.js → chunk-727SXJPM.DovFbwg3.js} +1 -1
  115. package/web/_astro/{chunk-AQP2D5EJ.ND_a81WY.js → chunk-AQP2D5EJ.B1Weod1X.js} +1 -1
  116. package/web/_astro/{chunk-FMBD7UC4.Wv_jwG48.js → chunk-FMBD7UC4.TEMS04st.js} +1 -1
  117. package/web/_astro/{chunk-ND2GUHAM.CXKXCMmp.js → chunk-ND2GUHAM.Cp8VT1wQ.js} +1 -1
  118. package/web/_astro/{chunk-QZHKN3VN.nkaoNYQq.js → chunk-QZHKN3VN.BzATdEcP.js} +1 -1
  119. package/web/_astro/{classDiagram-4FO5ZUOK.cMQcVlQu.js → classDiagram-4FO5ZUOK.C9BOCfAO.js} +1 -1
  120. package/web/_astro/{classDiagram-v2-Q7XG4LA2.cMQcVlQu.js → classDiagram-v2-Q7XG4LA2.C9BOCfAO.js} +1 -1
  121. package/web/_astro/{cose-bilkent-S5V4N54A.OaDJ7Mr2.js → cose-bilkent-S5V4N54A.DUnr4UAw.js} +1 -1
  122. package/web/_astro/{cynefin-OW5HDTMX.Chi8IphF.js → cynefin-OW5HDTMX.rYq5uM3D.js} +1 -1
  123. package/web/_astro/{cytoscape.esm.DzSz-X2X.js → cytoscape.esm.BB4DxJjf.js} +1 -1
  124. package/web/_astro/{dagre-BM42HDAG.CzK2t_Fp.js → dagre-BM42HDAG.CWeNKe3I.js} +1 -1
  125. package/web/_astro/{diagram-2AECGRRQ.DRvxlVS7.js → diagram-2AECGRRQ.DCkfls10.js} +1 -1
  126. package/web/_astro/{diagram-5GNKFQAL.CnYvNdwA.js → diagram-5GNKFQAL.D5U4JCka.js} +1 -1
  127. package/web/_astro/{diagram-KO2AKTUF.CpLpMw5R.js → diagram-KO2AKTUF.BZJgqaqG.js} +1 -1
  128. package/web/_astro/{diagram-LMA3HP47.JTb78qUA.js → diagram-LMA3HP47.DoMeHvPR.js} +1 -1
  129. package/web/_astro/{diagram-OG6HWLK6.Bk-1jDIb.js → diagram-OG6HWLK6.B50qwwWX.js} +1 -1
  130. package/web/_astro/{erDiagram-TEJ5UH35.D8hN9GZq.js → erDiagram-TEJ5UH35.DdGPG6LK.js} +1 -1
  131. package/web/_astro/{flowDiagram-I6XJVG4X.-6zQr6m5.js → flowDiagram-I6XJVG4X.QP2MJ12u.js} +1 -1
  132. package/web/_astro/{ganttDiagram-6RSMTGT7.DboLQ9ca.js → ganttDiagram-6RSMTGT7.BI6LgKSy.js} +1 -1
  133. package/web/_astro/{gitGraphDiagram-PVQCEYII.4tYvJKGR.js → gitGraphDiagram-PVQCEYII.npPZiC2G.js} +1 -1
  134. package/web/_astro/index.DayyIngm.css +1 -0
  135. package/web/_astro/{infoDiagram-5YYISTIA.Bd9rXpsB.js → infoDiagram-5YYISTIA.DCJCBVbp.js} +1 -1
  136. package/web/_astro/{ishikawaDiagram-YF4QCWOH.CvMoaf67.js → ishikawaDiagram-YF4QCWOH.BMLV-3I1.js} +1 -1
  137. package/web/_astro/{journeyDiagram-JHISSGLW.Ccy1CA7y.js → journeyDiagram-JHISSGLW.LE58crde.js} +1 -1
  138. package/web/_astro/{kanban-definition-UN3LZRKU.0MaMqHNS.js → kanban-definition-UN3LZRKU.BPbz8rH9.js} +1 -1
  139. package/web/_astro/{linear.CHXgcIbN.js → linear.DhZaBtYh.js} +1 -1
  140. package/web/_astro/{mermaid.core.Ca-kcelG.js → mermaid.core.BD5-jXum.js} +6 -6
  141. package/web/_astro/{mindmap-definition-RKZ34NQL.BUIDlHa0.js → mindmap-definition-RKZ34NQL.MTJyrQ65.js} +1 -1
  142. package/web/_astro/ordinal.BYWQX77i.js +1 -0
  143. package/web/_astro/{pieDiagram-4H26LBE5.2dX3CU1s.js → pieDiagram-4H26LBE5.BrDhDvIS.js} +1 -1
  144. package/web/_astro/{quadrantDiagram-W4KKPZXB.B3LBlRiv.js → quadrantDiagram-W4KKPZXB.71d73_5N.js} +1 -1
  145. package/web/_astro/{requirementDiagram-4Y6WPE33.X12I2uNx.js → requirementDiagram-4Y6WPE33.Bga6UF-z.js} +1 -1
  146. package/web/_astro/{sankeyDiagram-5OEKKPKP.BXohIHqx.js → sankeyDiagram-5OEKKPKP.BnHs4K82.js} +1 -1
  147. package/web/_astro/{sequenceDiagram-3UESZ5HK.C37ZIUzg.js → sequenceDiagram-3UESZ5HK.DsfY2gnj.js} +1 -1
  148. package/web/_astro/{stateDiagram-AJRCARHV.BRgz317z.js → stateDiagram-AJRCARHV.DvsTSc9a.js} +1 -1
  149. package/web/_astro/{stateDiagram-v2-BHNVJYJU.7VYSXN9-.js → stateDiagram-v2-BHNVJYJU.DxzzmHUR.js} +1 -1
  150. package/web/_astro/{timeline-definition-PNZ67QCA.BVNz_HiN.js → timeline-definition-PNZ67QCA.4ZuQmOTt.js} +1 -1
  151. package/web/_astro/{vennDiagram-CIIHVFJN.CHVDkPX4.js → vennDiagram-CIIHVFJN.Ck5Q86SG.js} +1 -1
  152. package/web/_astro/{wardleyDiagram-YWT4CUSO.EQQ_qT9v.js → wardleyDiagram-YWT4CUSO.BK7k2hXr.js} +1 -1
  153. package/web/_astro/{xychartDiagram-2RQKCTM6.DrAT9WoP.js → xychartDiagram-2RQKCTM6.DfCrgauK.js} +1 -1
  154. package/web/index.html +2 -2
  155. package/web/_astro/BoardApp.DV9kx0wo.js +0 -1
  156. package/web/_astro/channel.BAI6xLeV.js +0 -1
  157. package/web/_astro/index.Dcr_8fiK.css +0 -1
  158. package/web/_astro/ordinal.DBvzRdQf.js +0 -1
@@ -0,0 +1,471 @@
1
+ ---
2
+ name: taste-refactoring-architect
3
+ description: Review, simplify, and refactor system architecture toward minimum sufficient architecture while preserving required capabilities, quality attributes, delivery safety, and data invariants. Backs architectural refactoring and boundary reviews.
4
+ ---
5
+
6
+ # taste-refactoring-architect
7
+
8
+ ## Purpose
9
+ Use this skill to review, simplify, and refactor software/system architecture while preserving required capabilities and delivery qualities.
10
+
11
+ The default objective is **minimum sufficient architecture**: the smallest coherent architecture that preserves required features, quality attributes, compliance obligations, delivery safety, and credible near-term evolution paths.
12
+
13
+ This is not a “modernize everything” skill. Prefer subtraction over addition, reversible change over big-bang redesign, and evidence over fashion.
14
+
15
+ ## Core outcome
16
+ Given architecture diagrams, ADRs, repositories, service inventories, infrastructure, APIs, data flows, SLOs, incidents, costs, deployment topology, or a prose description, produce:
17
+
18
+ 1. A concise model of the current system and its actual responsibilities.
19
+ 2. A map of architectural complexity, coupling, duplication, and operational burden.
20
+ 3. A list of invariants that must not regress: features, contracts, quality attributes, regulatory constraints, data semantics, SLOs, RTO/RPO, delivery cadence, and key business flows.
21
+ 4. A prioritized refactoring plan using the intervention ladder below.
22
+ 5. A safe migration sequence with validation/fitness functions, rollback boundaries, ownership, and evidence required before each step.
23
+ 6. A simplified target architecture only when simplification by removal/consolidation is insufficient.
24
+
25
+ ## Prime directive
26
+ **Preserve outcomes, not structures.** Existing components, services, queues, layers, databases, frameworks, and deployment units are not requirements unless evidence proves they are necessary.
27
+
28
+ Ask of every architectural element:
29
+ - What capability or quality does it protect?
30
+ - What failure or constraint justified it?
31
+ - Is that constraint still real?
32
+ - Can the same outcome be achieved with fewer moving parts?
33
+ - What is the cost of keeping it versus removing it?
34
+
35
+ ## Non-negotiable principles
36
+
37
+ ### 1. Simplify before redesign
38
+ Use this order unless evidence demands otherwise:
39
+ 1. Remove dead or redundant elements.
40
+ 2. Collapse needless indirection.
41
+ 3. Standardize duplicated patterns.
42
+ 4. Reassign unclear ownership.
43
+ 5. Improve boundaries and contracts.
44
+ 6. Enhance observability/reliability/security where required.
45
+ 7. Redesign only when structural limits remain.
46
+
47
+ ### 2. Features and delivery qualities are invariants
48
+ Do not simplify by silently degrading:
49
+ - functional completeness or correctness,
50
+ - reliability/availability/recoverability,
51
+ - latency/throughput/capacity,
52
+ - security/privacy/compliance,
53
+ - operability/observability,
54
+ - maintainability/testability,
55
+ - deployability/change safety,
56
+ - interoperability/compatibility,
57
+ - cost constraints,
58
+ - data integrity/retention,
59
+ - scalability where it is evidenced, not hypothetical.
60
+
61
+ ### 3. Complexity needs a reason
62
+ Treat every service boundary, network hop, queue, cache, database, orchestration engine, abstraction layer, framework, runtime, deployment pipeline, and duplicated data model as a complexity cost that must pay rent.
63
+
64
+ ### 4. Prefer cohesive ownership
65
+ A boundary is healthy when responsibility, data, runtime behavior, and team ownership line up. Shared ownership, distributed transactions, cross-service chatty workflows, and “everyone owns it” are strong refactoring signals.
66
+
67
+ ### 5. Optimize for change
68
+ Prefer designs where common business changes touch one cohesive area, can be tested locally, and can be deployed independently when independence is actually valuable.
69
+
70
+ ### 6. Prefer reversible decisions
71
+ Delay irreversible choices until evidence is sufficient. Favor incremental migration, strangler-style replacement, compatibility layers, feature flags, parallel runs, canaries, shadow traffic, and reversible data migrations when risk warrants them.
72
+
73
+ ### 7. Quality is measurable
74
+ Translate architecture qualities into fitness functions or acceptance checks. “Scalable”, “resilient”, “secure”, and “maintainable” are not conclusions without observable criteria.
75
+
76
+ ## The intervention ladder
77
+ Classify every finding into exactly one primary action. Use the least disruptive action that solves the real problem.
78
+
79
+ ### A0 — KEEP
80
+ The element is justified, cohesive, owned, and proportionate. Do not churn it.
81
+
82
+ Use when:
83
+ - its value and constraints are clear,
84
+ - removal would harm an invariant,
85
+ - there is no material simplification benefit.
86
+
87
+ Output: `KEEP — <reason and evidence>`
88
+
89
+ ### A1 — DIRECT REMOVE
90
+ Remove with little or no architectural replacement.
91
+
92
+ Use only when evidence shows the element is dead, duplicate, bypassed, unreachable, obsolete, or purely accidental complexity, and removal has a bounded blast radius.
93
+
94
+ Typical candidates:
95
+ - unused services/endpoints/queues/topics,
96
+ - duplicate caches,
97
+ - dead adapters,
98
+ - obsolete feature infrastructure,
99
+ - pass-through proxy layers with no policy value,
100
+ - duplicated schedulers or pipelines,
101
+ - abandoned migration bridges.
102
+
103
+ Required proof:
104
+ - dependency/traffic evidence,
105
+ - contract search,
106
+ - data retention check,
107
+ - operational/rollback plan.
108
+
109
+ ### A2 — SUGGEST REMOVE
110
+ Likely unnecessary, but evidence is incomplete or organizational/business coupling raises risk.
111
+
112
+ Use when:
113
+ - utilization is near-zero but not proven zero,
114
+ - ownership is unclear,
115
+ - a component exists for a historical reason that may still matter,
116
+ - external consumers may exist.
117
+
118
+ Output must specify the evidence needed to graduate to A1.
119
+
120
+ ### A3 — CONSOLIDATE / SIMPLIFY
121
+ Keep the capability, reduce the number of concepts or moving parts.
122
+
123
+ Typical moves:
124
+ - merge nano-services with the same owner/change cadence/data lifecycle,
125
+ - collapse redundant layers,
126
+ - consolidate duplicate databases or queues,
127
+ - replace custom infrastructure with one standard platform capability,
128
+ - unify duplicated policy/enforcement points,
129
+ - remove premature extensibility.
130
+
131
+ ### A4 — SUGGEST ENHANCE
132
+ Structure is basically sound, but delivery quality is insufficient.
133
+
134
+ Enhance only for a named quality gap, for example:
135
+ - add idempotency for retry safety,
136
+ - add circuit breaking/timeouts/backpressure,
137
+ - improve SLOs and observability,
138
+ - add schema/contract tests,
139
+ - isolate secrets/permissions,
140
+ - add automated recovery,
141
+ - partition hotspots,
142
+ - introduce caching where measured latency/cost justifies it.
143
+
144
+ Never add “best practice” machinery without a demonstrated risk or requirement.
145
+
146
+ ### A5 — RE-BOUNDARY
147
+ The main problem is domain, data, dependency, or ownership boundaries rather than technology.
148
+
149
+ Signals:
150
+ - one change routinely spans many services,
151
+ - cyclic dependencies,
152
+ - distributed transactions for ordinary workflows,
153
+ - shared database tables across supposed service boundaries,
154
+ - high coordination cost between teams,
155
+ - duplicated domain rules,
156
+ - unstable interfaces between tightly coupled components.
157
+
158
+ Possible moves:
159
+ - move capabilities to the team/domain that owns the invariant,
160
+ - modularize a monolith before extracting services,
161
+ - merge services that are operationally inseparable,
162
+ - split a component only around a proven independent lifecycle or scale/security boundary.
163
+
164
+ ### A6 — SUGGEST RE-DESIGN
165
+ Use only when local simplification cannot meet requirements or the current architecture is fundamentally mismatched to constraints.
166
+
167
+ Triggers include:
168
+ - hard reliability/scalability limits,
169
+ - unacceptable security/compliance exposure,
170
+ - data consistency model incompatible with business rules,
171
+ - architecture prevents required delivery cadence,
172
+ - extreme coupling makes change unsafe,
173
+ - platform/runtime is no longer supportable,
174
+ - economics remain structurally unacceptable after simpler fixes.
175
+
176
+ A redesign recommendation must include:
177
+ - explicit constraints driving it,
178
+ - rejected lower-level interventions,
179
+ - at least two viable target options,
180
+ - trade-offs,
181
+ - migration strategy,
182
+ - exit/rollback strategy where feasible.
183
+
184
+ ### A7 — DEFER / OBSERVE
185
+ Do not change yet. Add instrumentation or gather evidence first.
186
+
187
+ Use when architecture debate is speculative. Define what to measure and the decision threshold.
188
+
189
+ ## Architecture review workflow
190
+
191
+ ### Phase 0 — Establish scope
192
+ Identify:
193
+ - business capabilities in scope,
194
+ - system boundaries,
195
+ - actors and external dependencies,
196
+ - critical user/business journeys,
197
+ - teams and ownership,
198
+ - deployment and data boundaries.
199
+
200
+ If diagrams disagree with production behavior, trust runtime evidence and record the mismatch.
201
+
202
+ ### Phase 1 — Capture invariants
203
+ Build a `Preservation Contract`:
204
+ - features/business flows,
205
+ - public/internal contracts,
206
+ - data ownership and semantics,
207
+ - SLO/SLI targets,
208
+ - RTO/RPO,
209
+ - security/compliance obligations,
210
+ - peak load and capacity needs,
211
+ - cost envelopes,
212
+ - deployment/release expectations,
213
+ - regional/residency requirements.
214
+
215
+ Unknown values are risks, not assumptions.
216
+
217
+ ### Phase 2 — Build a complexity inventory
218
+ Inventory architecture elements and tag each with:
219
+ - responsibility,
220
+ - owner,
221
+ - consumers/providers,
222
+ - state owned,
223
+ - synchronous dependencies,
224
+ - asynchronous dependencies,
225
+ - deployment unit,
226
+ - failure modes,
227
+ - traffic/load,
228
+ - cost,
229
+ - change frequency,
230
+ - incident history,
231
+ - rationale/ADR if known.
232
+
233
+ ### Phase 3 — Detect architecture smells
234
+ Look for:
235
+ - accidental distribution,
236
+ - needless indirection,
237
+ - cyclic dependencies,
238
+ - shared mutable data,
239
+ - duplicate sources of truth,
240
+ - pass-through services,
241
+ - chatty synchronous chains,
242
+ - orchestration with no business value,
243
+ - event buses used as hidden RPC,
244
+ - too many persistence technologies,
245
+ - cache inconsistency complexity,
246
+ - generic “platform” layers used by one consumer,
247
+ - bespoke infrastructure replacing managed/common capabilities,
248
+ - boundary/ownership mismatch,
249
+ - premature multi-region or multi-cloud complexity,
250
+ - speculative extensibility,
251
+ - duplicated cross-cutting logic,
252
+ - orphaned components,
253
+ - manual operational steps,
254
+ - architecture that cannot be tested or observed.
255
+
256
+ ### Phase 4 — Score findings
257
+ Score each finding from 1–5 on:
258
+ - `Complexity Cost` — cognitive, operational, dependency, infrastructure.
259
+ - `Change Friction` — coordination and deployment burden.
260
+ - `Failure Blast Radius`.
261
+ - `Quality Risk` — reliability/security/performance/etc.
262
+ - `Evidence Confidence`.
263
+ - `Removal/Rework Risk`.
264
+ - `Business Value Protected`.
265
+
266
+ Do not sum mechanically. Use scores to expose trade-offs.
267
+
268
+ ### Phase 5 — Apply the intervention ladder
269
+ For each finding choose A0–A7 and explain why lower-intervention actions are insufficient when recommending A4+.
270
+
271
+ ### Phase 6 — Design the simpler target
272
+ Target architecture should reduce at least one of:
273
+ - number of deployable units,
274
+ - number of runtime dependencies,
275
+ - number of data stores/technologies,
276
+ - synchronous path length,
277
+ - concepts engineers must understand,
278
+ - team handoffs per change,
279
+ - duplicated policy/rules,
280
+ - bespoke operational mechanisms.
281
+
282
+ If none decrease, challenge whether the proposal is truly simplification.
283
+
284
+ ### Phase 7 — Prove preservation with fitness functions
285
+ Define checks before migration. Examples:
286
+ - API/contract compatibility tests,
287
+ - end-to-end business flow tests,
288
+ - latency percentile budgets,
289
+ - availability/error-rate SLOs,
290
+ - RTO/RPO recovery tests,
291
+ - security policy checks,
292
+ - architecture dependency rules,
293
+ - data reconciliation thresholds,
294
+ - deployment lead time/failure rate,
295
+ - cost per transaction/request/tenant,
296
+ - number of cross-team dependencies for representative changes.
297
+
298
+ ### Phase 8 — Sequence migration
299
+ Prefer small, independently verifiable increments.
300
+ For each step include:
301
+ - change,
302
+ - precondition,
303
+ - validation,
304
+ - rollback/exit,
305
+ - observability,
306
+ - owner,
307
+ - dependency,
308
+ - risk.
309
+
310
+ Avoid “rewrite then switch” unless incremental migration is demonstrably worse.
311
+
312
+ ## System-level heuristics
313
+
314
+ ### Monolith vs services
315
+ Do not default to microservices. A well-modularized monolith is often simpler when:
316
+ - one/few teams own the product,
317
+ - scaling characteristics are similar,
318
+ - deployment independence has little value,
319
+ - strong consistency dominates,
320
+ - domain boundaries are not stable.
321
+
322
+ Services earn their cost when there is a proven independent boundary such as:
323
+ - team ownership,
324
+ - deployment cadence,
325
+ - security/trust boundary,
326
+ - data lifecycle,
327
+ - scaling profile,
328
+ - failure isolation,
329
+ - regulatory boundary.
330
+
331
+ ### Synchronous vs asynchronous
332
+ Prefer synchronous communication for simple request/response workflows with immediate consistency needs.
333
+ Use asynchronous messaging when it buys concrete value: temporal decoupling, buffering, fan-out, resilience, independent processing, or long-running workflows.
334
+ Do not introduce queues just to appear decoupled.
335
+
336
+ ### Orchestration vs choreography
337
+ Use explicit orchestration when a business process needs visible state, ordering, compensation, auditability, or timeout handling.
338
+ Use choreography only when event reactions are independently meaningful and the global process remains understandable.
339
+ If nobody can explain the end-to-end flow, centralize visibility before adding more events.
340
+
341
+ ### Data
342
+ Prefer one authoritative owner per business fact.
343
+ Avoid shared-write databases across independent services.
344
+ Do not duplicate data unless latency, availability, autonomy, analytics, or integration needs justify synchronization cost.
345
+ Treat caches and replicas as derived state with explicit invalidation/reconciliation rules.
346
+
347
+ ### Abstractions
348
+ An abstraction is justified when it hides stable repeated complexity from multiple real consumers.
349
+ Delete or inline abstractions that add indirection without reducing change cost.
350
+
351
+ ### Platforms
352
+ Platform capabilities should reduce cognitive load for product teams. A platform that requires every team to understand its internals is shifting complexity, not removing it.
353
+
354
+ ### Build vs buy / managed vs custom
355
+ Favor managed/common capabilities when differentiation is low and operational burden is high, unless constraints around cost, latency, regulation, portability, or lock-in materially change the decision.
356
+
357
+ ## Quality model
358
+ Use a context-specific subset of these qualities, with explicit priorities and thresholds:
359
+ - functional suitability,
360
+ - reliability and recoverability,
361
+ - security/privacy,
362
+ - performance efficiency and capacity,
363
+ - compatibility/interoperability,
364
+ - maintainability/modifiability/testability,
365
+ - operability/observability,
366
+ - deployability/change safety,
367
+ - cost efficiency,
368
+ - sustainability/resource efficiency,
369
+ - portability/flexibility where required.
370
+
371
+ Do not maximize every quality. Architecture is trade-offs under constraints.
372
+
373
+ ## Ownership and organizational fit
374
+ Architecture and team topology should reinforce each other.
375
+ Flag:
376
+ - one service owned by multiple teams,
377
+ - a team owning too many unrelated services,
378
+ - components with no accountable owner,
379
+ - changes that require recurring coordination across many teams,
380
+ - centralized bottleneck teams for routine delivery.
381
+
382
+ Prefer clear end-to-end ownership and interfaces that reflect stable collaboration boundaries.
383
+
384
+ ## Evidence hierarchy
385
+ Prefer evidence in this order:
386
+ 1. production telemetry and incident history,
387
+ 2. contracts and actual dependency graphs,
388
+ 3. tests and deployment data,
389
+ 4. cost/usage data,
390
+ 5. current code/config/infrastructure,
391
+ 6. current ADRs/runbooks,
392
+ 7. diagrams,
393
+ 8. stakeholder recollection,
394
+ 9. assumptions.
395
+
396
+ Mark assumptions explicitly.
397
+
398
+ ## Output format
399
+ Use this structure unless the user asks otherwise.
400
+
401
+ ### 1. Executive assessment
402
+ - Current architecture in 3–8 sentences.
403
+ - Biggest complexity sources.
404
+ - What must be preserved.
405
+ - Overall refactoring direction.
406
+
407
+ ### 2. Preservation Contract
408
+ A compact table of capabilities/qualities and required thresholds.
409
+
410
+ ### 3. Findings
411
+ For each finding:
412
+ - `ID`
413
+ - `Scope`
414
+ - `Observation`
415
+ - `Why it matters`
416
+ - `Evidence`
417
+ - `Action`: A0–A7
418
+ - `Expected simplification`
419
+ - `Quality impact`
420
+ - `Risk`
421
+ - `Confidence`
422
+
423
+ ### 4. Target simplifications
424
+ Describe only meaningful structural changes. Prefer a current → target mapping.
425
+
426
+ ### 5. Migration plan
427
+ Ordered, incremental steps with validation and rollback.
428
+
429
+ ### 6. Fitness functions
430
+ Measurable checks that prove feature and quality preservation.
431
+
432
+ ### 7. Decisions / ADR candidates
433
+ List irreversible or high-cost decisions that deserve an ADR.
434
+
435
+ ### 8. Deferred questions
436
+ Unknowns that could materially change recommendations.
437
+
438
+ ## Anti-patterns for this skill
439
+ Never:
440
+ - recommend microservices merely because the system is large,
441
+ - add Kafka/event sourcing/CQRS/service mesh/Kubernetes/multi-cloud without an evidenced need,
442
+ - call a rewrite “refactoring” without a migration strategy,
443
+ - remove redundancy that exists to satisfy availability/recovery requirements,
444
+ - collapse trust boundaries for convenience,
445
+ - merge data ownership casually,
446
+ - optimize hypothetical scale while ignoring present change friction,
447
+ - confuse fewer boxes on a diagram with simpler operations,
448
+ - use “industry best practice” as a substitute for context,
449
+ - preserve accidental structures just because they already exist.
450
+
451
+ ## Daily-use commands
452
+ Interpret prompts like these as shortcuts:
453
+
454
+ - `architecture taste review` → full review using this skill.
455
+ - `simplify architecture` → prioritize A1–A3 before considering redesign.
456
+ - `find removable architecture` → focus on A1/A2 candidates and required proof.
457
+ - `quality-preserving refactor` → establish Preservation Contract first, then refactor.
458
+ - `service boundary review` → focus on ownership/domain/data/change-coupling boundaries.
459
+ - `redesign threshold` → determine whether A6 is justified or lower interventions suffice.
460
+ - `migration plan` → produce incremental migration with fitness functions and rollback.
461
+ - `ADR review` → identify decisions that are stale, unnecessary, or need replacement.
462
+
463
+ ## When information is incomplete
464
+ Do not block on perfect documentation. Produce:
465
+ - confirmed findings,
466
+ - hypotheses,
467
+ - evidence gaps,
468
+ - instrumentation/research actions,
469
+ - decisions that can safely proceed now.
470
+
471
+ Use A7 DEFER/OBSERVE when evidence is too weak for a structural change.
@@ -0,0 +1,48 @@
1
+ # Daily Architecture Review Checklist
2
+
3
+ Use this in 10–20 minutes for a feature, subsystem, or architecture change.
4
+
5
+ ## Preservation
6
+ - [ ] What feature/business capability must remain unchanged?
7
+ - [ ] What contracts/consumers are affected?
8
+ - [ ] What SLO, security, data, compliance, RTO/RPO, cost, or capacity constraints matter?
9
+ - [ ] Which constraints are measured vs assumed?
10
+
11
+ ## Simplification first
12
+ - [ ] Can anything be deleted outright?
13
+ - [ ] Can any layer/hop/adapter be inlined?
14
+ - [ ] Can duplicated capabilities be consolidated?
15
+ - [ ] Can one standard platform capability replace bespoke machinery?
16
+ - [ ] Can a service boundary become a module boundary instead?
17
+ - [ ] Can we reduce technologies, deployables, or cross-team handoffs?
18
+
19
+ ## Boundaries
20
+ - [ ] Does each capability have a clear owner?
21
+ - [ ] Does each business fact have one authoritative owner?
22
+ - [ ] Do components that change together live together?
23
+ - [ ] Are supposed independent services actually sharing data or coordinated releases?
24
+ - [ ] Are there cycles or chatty synchronous chains?
25
+
26
+ ## Quality
27
+ - [ ] Reliability/failure behavior explicit?
28
+ - [ ] Security/trust boundaries explicit?
29
+ - [ ] Latency/throughput/capacity measured?
30
+ - [ ] Data consistency and recovery explicit?
31
+ - [ ] Deployment/rollback observable and safe?
32
+ - [ ] Cost impact known?
33
+
34
+ ## Intervention
35
+ - [ ] A0 KEEP
36
+ - [ ] A1 DIRECT REMOVE
37
+ - [ ] A2 SUGGEST REMOVE
38
+ - [ ] A3 CONSOLIDATE / SIMPLIFY
39
+ - [ ] A4 SUGGEST ENHANCE
40
+ - [ ] A5 RE-BOUNDARY
41
+ - [ ] A6 SUGGEST RE-DESIGN
42
+ - [ ] A7 DEFER / OBSERVE
43
+
44
+ ## Proof
45
+ - [ ] What fitness function proves this is better?
46
+ - [ ] What metric proves no delivery quality regressed?
47
+ - [ ] What is the rollback/exit path?
48
+ - [ ] What can be deleted after migration?
@@ -0,0 +1,55 @@
1
+ # Worked Example — Simplifying an Over-Distributed Order Flow
2
+
3
+ ## Situation
4
+ An order placement flow crosses six services synchronously:
5
+ `Web -> Checkout -> Pricing -> Promotion -> Inventory -> Order -> Notification`.
6
+ Pricing and Promotion are owned by the same team, deploy together, and share a database. Notification blocks the request even though delivery is not required before the order is accepted. An old “OrderFacade” proxy only forwards requests to Order. The system meets load requirements but has frequent partial-failure incidents.
7
+
8
+ ## Preservation Contract
9
+ - Price and promotion rules remain functionally identical.
10
+ - Inventory reservation remains strongly validated before acceptance.
11
+ - Order acceptance p99 remains <= 900 ms.
12
+ - Notification may be delayed up to 60 seconds.
13
+ - No accepted order may be lost.
14
+ - Existing public checkout API remains compatible during migration.
15
+
16
+ ## Findings
17
+
18
+ ### F-01 OrderFacade
19
+ **Observation:** Pass-through hop with no policy, transformation, ownership, or compatibility role.
20
+ **Action:** A1 DIRECT REMOVE.
21
+ **Proof:** Trace/dependency analysis confirms only Checkout calls it; contract tests can move directly to Order.
22
+
23
+ ### F-02 Pricing + Promotion split
24
+ **Observation:** Two services share owner, data, deployment cadence, and change together.
25
+ **Action:** A3 CONSOLIDATE / SIMPLIFY.
26
+ **Target:** One `CommercialRules` module/service depending on whether independent deployment is still useful.
27
+
28
+ ### F-03 Notification on critical synchronous path
29
+ **Observation:** Notification availability increases checkout failure probability without contributing to acceptance correctness.
30
+ **Action:** A3 CONSOLIDATE / SIMPLIFY by removing it from the synchronous critical path; publish an `OrderAccepted` event after durable order commit.
31
+ **Required enhancement:** idempotent notification consumer and replay/dead-letter recovery.
32
+
33
+ ### F-04 Inventory boundary
34
+ **Observation:** Inventory has independent scaling and correctness semantics; failure must prevent oversell.
35
+ **Action:** A0 KEEP.
36
+
37
+ ### F-05 Overall redesign
38
+ **Observation:** Local changes remove two remote hops and one unnecessary blocking dependency.
39
+ **Action:** A7 DEFER / OBSERVE for broader redesign. A full rewrite/microservice re-platform is not justified.
40
+
41
+ ## Resulting flow
42
+ `Web -> Checkout -> CommercialRules -> Inventory -> Order`
43
+ then asynchronous `OrderAccepted -> Notification`.
44
+
45
+ ## Fitness functions
46
+ - public checkout contract tests pass unchanged,
47
+ - price/promotion golden test corpus has zero semantic diff,
48
+ - no accepted order without durable order record,
49
+ - p99 checkout <= 900 ms,
50
+ - notification delivered/recovered within 60 seconds for 99.9% of events,
51
+ - synchronous downstream dependency count reduced from 6 to 4,
52
+ - incident rate for notification failures no longer affects order acceptance.
53
+
54
+ ## Why this is better
55
+ The target preserves business behavior while reducing synchronous failure surface, remote calls, and false service boundaries. It adds only the reliability machinery required by the newly asynchronous notification path.
@@ -0,0 +1,51 @@
1
+ # Architecture Refactoring Review Template
2
+
3
+ ## Executive assessment
4
+ **System/subsystem:**
5
+ **Current shape:**
6
+ **Primary complexity:**
7
+ **Preservation goal:**
8
+ **Recommended direction:**
9
+
10
+ ## Preservation Contract
11
+ | Invariant | Current evidence | Required target | Confidence |
12
+ |---|---|---|---|
13
+ | Feature/capability | | | |
14
+ | Availability | | | |
15
+ | Latency | | | |
16
+ | RTO/RPO | | | |
17
+ | Security/compliance | | | |
18
+ | Data semantics | | | |
19
+ | Cost | | | |
20
+ | Delivery cadence | | | |
21
+
22
+ ## Findings
23
+ | ID | Scope | Observation | Evidence | Action | Simplification | Quality impact | Risk | Confidence |
24
+ |---|---|---|---|---|---|---|---|---|
25
+ | F-01 | | | | A0–A7 | | | | |
26
+
27
+ ## Current → target
28
+ | Current | Target | Why |
29
+ |---|---|---|
30
+ | | | |
31
+
32
+ ## Migration sequence
33
+ | Step | Change | Precondition | Validation | Rollback/exit | Owner | Risk |
34
+ |---|---|---|---|---|---|---|
35
+ | 1 | | | | | | |
36
+
37
+ ## Fitness functions
38
+ - [ ]
39
+ - [ ]
40
+
41
+ ## ADR candidates
42
+ - Decision:
43
+ - Context:
44
+ - Options:
45
+ - Trade-off:
46
+ - Validation:
47
+
48
+ ## Deferred / observe
49
+ - Unknown:
50
+ - Measurement required:
51
+ - Decision threshold: