specweave 0.23.16 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/.claude-plugin/marketplace.json +93 -38
  2. package/CLAUDE.md +159 -11
  3. package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts.map +1 -1
  4. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js +57 -0
  5. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
  6. package/dist/src/cli/commands/sync-spec-content.js +3 -0
  7. package/dist/src/cli/commands/sync-spec-content.js.map +1 -1
  8. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
  9. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
  10. package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
  11. package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
  12. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
  13. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
  14. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
  15. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
  16. package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
  17. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  18. package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
  19. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  20. package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
  21. package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
  22. package/dist/src/cli/helpers/smart-filter.js +265 -0
  23. package/dist/src/cli/helpers/smart-filter.js.map +1 -0
  24. package/dist/src/core/progress/progress-tracker.d.ts +4 -1
  25. package/dist/src/core/progress/progress-tracker.d.ts.map +1 -1
  26. package/dist/src/core/progress/progress-tracker.js +33 -4
  27. package/dist/src/core/progress/progress-tracker.js.map +1 -1
  28. package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
  29. package/dist/src/core/qa/quality-gate-decider.js +2 -2
  30. package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
  31. package/dist/src/core/qa/risk-calculator.d.ts +2 -2
  32. package/dist/src/core/qa/risk-calculator.js +2 -2
  33. package/dist/src/core/spec-content-sync.d.ts +1 -1
  34. package/dist/src/core/spec-content-sync.d.ts.map +1 -1
  35. package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
  36. package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
  37. package/dist/src/core/validators/ac-presence-validator.js +149 -0
  38. package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
  39. package/dist/src/integrations/ado/ado-dependency-loader.d.ts +1 -1
  40. package/dist/src/integrations/ado/ado-dependency-loader.d.ts.map +1 -1
  41. package/dist/src/integrations/ado/ado-dependency-loader.js +39 -7
  42. package/dist/src/integrations/ado/ado-dependency-loader.js.map +1 -1
  43. package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
  44. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
  45. package/dist/src/integrations/ado/area-path-mapper.js +267 -0
  46. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
  47. package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
  48. package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
  49. package/dist/src/integrations/jira/filter-processor.js +207 -0
  50. package/dist/src/integrations/jira/filter-processor.js.map +1 -0
  51. package/dist/src/integrations/jira/jira-client.d.ts +13 -0
  52. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  53. package/dist/src/integrations/jira/jira-client.js +33 -0
  54. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  55. package/dist/src/utils/ac-embedder.d.ts +63 -0
  56. package/dist/src/utils/ac-embedder.d.ts.map +1 -0
  57. package/dist/src/utils/ac-embedder.js +217 -0
  58. package/dist/src/utils/ac-embedder.js.map +1 -0
  59. package/dist/src/utils/env-manager.d.ts +86 -0
  60. package/dist/src/utils/env-manager.d.ts.map +1 -0
  61. package/dist/src/utils/env-manager.js +188 -0
  62. package/dist/src/utils/env-manager.js.map +1 -0
  63. package/package.json +1 -1
  64. package/plugins/specweave/.claude-plugin/plugin.json +1 -1
  65. package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
  66. package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
  67. package/plugins/specweave/commands/specweave-do.md +37 -0
  68. package/plugins/specweave/commands/specweave-done.md +159 -0
  69. package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
  70. package/plugins/specweave/commands/specweave-next.md +148 -3
  71. package/plugins/specweave/commands/specweave-qa.md +2 -2
  72. package/plugins/specweave/hooks/lib/migrate-increment-work.sh +1 -1
  73. package/plugins/specweave/hooks/lib/migrate-increment-work.sh.bak +245 -0
  74. package/plugins/specweave/hooks/lib/sync-spec-content.sh +2 -2
  75. package/plugins/specweave/hooks/lib/sync-spec-content.sh.bak +149 -0
  76. package/plugins/specweave/hooks/lib/update-status-line.sh +34 -4
  77. package/plugins/specweave/hooks/lib/validate-spec-status.sh +1 -1
  78. package/plugins/specweave/hooks/lib/validate-spec-status.sh.bak +163 -0
  79. package/plugins/specweave/hooks/post-first-increment.sh +1 -1
  80. package/plugins/specweave/hooks/post-first-increment.sh.bak +61 -0
  81. package/plugins/specweave/hooks/post-spec-update.sh +1 -1
  82. package/plugins/specweave/hooks/post-spec-update.sh.bak +158 -0
  83. package/plugins/specweave/hooks/post-user-story-complete.sh +1 -1
  84. package/plugins/specweave/hooks/post-user-story-complete.sh.bak +179 -0
  85. package/plugins/specweave/hooks/pre-command-deduplication.sh +1 -1
  86. package/plugins/specweave/hooks/pre-command-deduplication.sh.bak +83 -0
  87. package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
  88. package/plugins/specweave/hooks/user-prompt-submit.sh +1 -1
  89. package/plugins/specweave/hooks/user-prompt-submit.sh.bak +386 -0
  90. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  91. package/plugins/specweave/skills/specweave-framework/SKILL.md +1 -1
  92. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  93. package/plugins/specweave-ado/agents/ado-manager/AGENT.md +23 -0
  94. package/plugins/specweave-ado/agents/ado-multi-project-mapper/AGENT.md +23 -0
  95. package/plugins/specweave-ado/agents/ado-sync-judge/AGENT.md +23 -0
  96. package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
  97. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
  98. package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
  99. package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
  100. package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
  101. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
  102. package/plugins/specweave-backend/agents/database-optimizer/AGENT.md +23 -0
  103. package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
  104. package/plugins/specweave-backend/commands/crud-generate.md +109 -0
  105. package/plugins/specweave-backend/commands/migration-generate.md +139 -0
  106. package/plugins/specweave-confluent/agents/confluent-architect/AGENT.md +23 -0
  107. package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
  108. package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
  109. package/plugins/specweave-confluent/commands/schema-register.md +123 -0
  110. package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
  111. package/plugins/specweave-core/commands/architecture-review.md +288 -0
  112. package/plugins/specweave-core/commands/code-review.md +213 -0
  113. package/plugins/specweave-core/commands/refactor-plan.md +249 -0
  114. package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
  115. package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
  116. package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
  117. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
  118. package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
  119. package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
  120. package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
  121. package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
  122. package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
  123. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  124. package/plugins/specweave-diagrams/agents/diagrams-architect/AGENT.md +23 -0
  125. package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
  126. package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
  127. package/plugins/specweave-docs/commands/docs-generate.md +441 -0
  128. package/plugins/specweave-docs/commands/docs-init.md +334 -0
  129. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
  130. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
  131. package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
  132. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  133. package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
  134. package/plugins/specweave-figma/commands/figma-import.md +690 -0
  135. package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
  136. package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
  137. package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
  138. package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +387 -0
  139. package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
  140. package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
  141. package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
  142. package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
  143. package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
  144. package/plugins/specweave-frontend/commands/component-generate.md +510 -0
  145. package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
  146. package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
  147. package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
  148. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
  149. package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
  150. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
  151. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  152. package/plugins/specweave-github/agents/github-manager/AGENT.md +23 -0
  153. package/plugins/specweave-github/agents/github-task-splitter/AGENT.md +25 -0
  154. package/plugins/specweave-github/agents/user-story-updater/AGENT.md +25 -0
  155. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +194 -0
  156. package/plugins/specweave-github/lib/github-spec-content-sync.js +49 -0
  157. package/plugins/specweave-github/lib/github-spec-content-sync.ts +67 -0
  158. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  159. package/plugins/specweave-infrastructure/agents/devops/AGENT.md +26 -0
  160. package/plugins/specweave-infrastructure/agents/network-engineer/AGENT.md +26 -0
  161. package/plugins/specweave-infrastructure/agents/observability-engineer/AGENT.md +26 -0
  162. package/plugins/specweave-infrastructure/agents/performance-engineer/AGENT.md +26 -0
  163. package/plugins/specweave-infrastructure/agents/sre/AGENT.md +26 -0
  164. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  165. package/plugins/specweave-jira/agents/jira-manager/AGENT.md +26 -0
  166. package/plugins/specweave-jira/commands/import-projects.js +183 -0
  167. package/plugins/specweave-jira/commands/import-projects.md +97 -0
  168. package/plugins/specweave-jira/commands/import-projects.ts +288 -0
  169. package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
  170. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  171. package/plugins/specweave-kafka/agents/kafka-architect/AGENT.md +26 -0
  172. package/plugins/specweave-kafka/agents/kafka-devops/AGENT.md +26 -0
  173. package/plugins/specweave-kafka/agents/kafka-observability/AGENT.md +26 -0
  174. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  175. package/plugins/specweave-kubernetes/agents/kubernetes-architect/AGENT.md +26 -0
  176. package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
  177. package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
  178. package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
  179. package/plugins/specweave-ml/.claude-plugin/plugin.json +3 -3
  180. package/plugins/specweave-ml/agents/data-scientist/AGENT.md +26 -0
  181. package/plugins/specweave-ml/agents/ml-engineer/AGENT.md +26 -0
  182. package/plugins/specweave-ml/agents/mlops-engineer/AGENT.md +26 -0
  183. package/plugins/specweave-mobile/agents/mobile-architect/AGENT.md +26 -0
  184. package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
  185. package/plugins/specweave-mobile/commands/build-config.md +256 -0
  186. package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
  187. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  188. package/plugins/specweave-payments/agents/payment-integration/AGENT.md +26 -0
  189. package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +20 -0
  190. package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
  191. package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
  192. package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
  193. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
  194. package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
  195. package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
  196. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  197. package/plugins/specweave-release/agents/release-manager/AGENT.md +27 -0
  198. package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
  199. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
  200. package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
  201. package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +797 -0
  202. package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
  203. package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
  204. package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
  205. package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
  206. package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
  207. package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
  208. package/plugins/specweave-testing/commands/test-coverage.md +979 -0
  209. package/plugins/specweave-testing/commands/test-generate.md +1156 -0
  210. package/plugins/specweave-testing/commands/test-init.md +409 -0
  211. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
  212. package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
  213. package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
  214. package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
  215. package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
  216. package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
  217. package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
  218. package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
  219. package/plugins/specweave-ui/commands/ui-automate.md +199 -0
  220. package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
  221. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
  222. package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
  223. package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
  224. package/plugins/specweave/commands/check-hooks.md +0 -257
  225. package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
  226. package/plugins/specweave/skills/plugin-expert/SKILL.md +0 -340
  227. /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
@@ -0,0 +1,416 @@
1
+ ---
2
+ name: aws-cost-expert
3
+ description: Deep AWS cost optimization expertise covering EC2 Reserved Instances, Savings Plans, Spot Instances, Lambda cost optimization, S3 lifecycle policies, RDS Reserved Instances, Cost Explorer, AWS Budgets, Trusted Advisor, Compute Optimizer, Cost Anomaly Detection, and AWS-specific FinOps best practices. Activates for AWS costs, AWS pricing, EC2 costs, Lambda costs, S3 costs, RDS costs, AWS savings plans, AWS reserved instances, AWS spot instances, AWS cost explorer, AWS budgets, reduce AWS bill.
4
+ ---
5
+
6
+ # AWS Cost Optimization Expert
7
+
8
+ Deep expertise in AWS-specific cost optimization strategies and services.
9
+
10
+ ## AWS Cost Management Services
11
+
12
+ ### 1. Cost Explorer
13
+ ```bash
14
+ # Get monthly costs by service
15
+ aws ce get-cost-and-usage \
16
+ --time-period Start=2025-01-01,End=2025-02-01 \
17
+ --granularity MONTHLY \
18
+ --metrics BlendedCost \
19
+ --group-by Type=SERVICE
20
+
21
+ # Get EC2 costs by instance type
22
+ aws ce get-cost-and-usage \
23
+ --time-period Start=2025-01-01,End=2025-02-01 \
24
+ --granularity DAILY \
25
+ --metrics UnblendedCost \
26
+ --filter file://ec2-filter.json \
27
+ --group-by Type=INSTANCE_TYPE
28
+ ```
29
+
30
+ ### 2. AWS Budgets
31
+ ```yaml
32
+ Budget Configuration:
33
+ - Monthly budget: $30,000
34
+ - Alert at 80% ($24,000)
35
+ - Alert at 90% ($27,000)
36
+ - Alert at 100% ($30,000)
37
+ - Alert at 110% ($33,000) - critical
38
+
39
+ Actions:
40
+ - Stop non-production instances
41
+ - Deny new resource creation
42
+ - Email C-level executives
43
+ ```
44
+
45
+ ### 3. Compute Optimizer
46
+ ```bash
47
+ # Get EC2 right-sizing recommendations
48
+ aws compute-optimizer get-ec2-instance-recommendations \
49
+ --max-results 100
50
+
51
+ # Get Lambda function recommendations
52
+ aws compute-optimizer get-lambda-function-recommendations
53
+ ```
54
+
55
+ ### 4. Trusted Advisor
56
+ ```bash
57
+ # Get cost optimization checks
58
+ aws support describe-trusted-advisor-checks \
59
+ --language en \
60
+ --query 'checks[?category==`cost_optimizing`]'
61
+
62
+ # Check results
63
+ aws support describe-trusted-advisor-check-result \
64
+ --check-id <check-id>
65
+ ```
66
+
67
+ ## EC2 Cost Optimization
68
+
69
+ ### Savings Plans vs Reserved Instances
70
+ ```typescript
71
+ interface Comparison {
72
+ option: string;
73
+ flexibility: string;
74
+ discount: string;
75
+ commitment: string;
76
+ bestFor: string;
77
+ }
78
+
79
+ const options: Comparison[] = [
80
+ {
81
+ option: 'On-Demand',
82
+ flexibility: 'Maximum',
83
+ discount: '0%',
84
+ commitment: 'None',
85
+ bestFor: 'Unpredictable workloads',
86
+ },
87
+ {
88
+ option: 'Spot Instances',
89
+ flexibility: 'Medium',
90
+ discount: '50-90%',
91
+ commitment: 'None',
92
+ bestFor: 'Fault-tolerant batch workloads',
93
+ },
94
+ {
95
+ option: 'Compute Savings Plans',
96
+ flexibility: 'High (any instance, any region)',
97
+ discount: '30-70%',
98
+ commitment: '1 or 3 years',
99
+ bestFor: 'Flexible compute usage',
100
+ },
101
+ {
102
+ option: 'EC2 Instance Savings Plans',
103
+ flexibility: 'Medium (same instance family, same region)',
104
+ discount: '35-72%',
105
+ commitment: '1 or 3 years',
106
+ bestFor: 'Consistent instance family usage',
107
+ },
108
+ {
109
+ option: 'Reserved Instances',
110
+ flexibility: 'Low (specific instance type)',
111
+ discount: '40-75%',
112
+ commitment: '1 or 3 years',
113
+ bestFor: 'Predictable, steady-state workloads',
114
+ },
115
+ ];
116
+ ```
117
+
118
+ ### Graviton Instances (ARM)
119
+ ```yaml
120
+ Benefits:
121
+ - 20% better price/performance vs x86
122
+ - 40% better price/performance for many workloads
123
+ - Lower power consumption
124
+
125
+ Migration:
126
+ - t4g (general purpose, burstable)
127
+ - m6g (balanced)
128
+ - c6g (compute optimized)
129
+ - r6g (memory optimized)
130
+
131
+ Compatibility:
132
+ - Most Linux distributions
133
+ - Container workloads (Docker, ECS, EKS)
134
+ - Not for: Windows, x86-only software
135
+ ```
136
+
137
+ ## Lambda Cost Optimization
138
+
139
+ ### Power Tuning
140
+ ```typescript
141
+ // Use AWS Lambda Power Tuning tool
142
+ // https://github.com/alexcasalboni/aws-lambda-power-tuning
143
+
144
+ interface PowerTuningResult {
145
+ optimalMemory: number;
146
+ currentCost: number;
147
+ optimalCost: number;
148
+ savings: number;
149
+ }
150
+
151
+ // Example: Image processing function
152
+ const result: PowerTuningResult = {
153
+ optimalMemory: 2048, // MB
154
+ currentCost: 0.0000133, // per invocation at 1024MB
155
+ optimalCost: 0.0000119, // per invocation at 2048MB
156
+ savings: 10.5, // % (faster execution despite higher memory cost)
157
+ };
158
+ ```
159
+
160
+ ### Lambda Cost Optimization Checklist
161
+ ```yaml
162
+ Memory Optimization:
163
+ - ✅ Run power tuning for all production functions
164
+ - ✅ Monitor cold start vs warm execution cost
165
+ - ✅ Consider provisioned concurrency for latency-sensitive APIs
166
+
167
+ Architecture:
168
+ - ✅ Avoid VPC Lambda unless necessary (saves NAT costs)
169
+ - ✅ Use Lambda Layers for shared dependencies
170
+ - ✅ Enable Lambda SnapStart for Java functions (faster cold starts)
171
+
172
+ Invocation:
173
+ - ✅ Batch process vs streaming (fewer invocations)
174
+ - ✅ Async invocation where possible
175
+ - ✅ Use Step Functions for orchestration (not nested Lambdas)
176
+ ```
177
+
178
+ ## S3 Cost Optimization
179
+
180
+ ### Intelligent-Tiering
181
+ ```yaml
182
+ Automatic Cost Optimization:
183
+ - Frequent Access tier (default)
184
+ - Infrequent Access tier (30 days no access)
185
+ - Archive Instant Access (90 days)
186
+ - Archive Access (90-730 days, optional)
187
+ - Deep Archive Access (180-730 days, optional)
188
+
189
+ Monitoring fee: $0.0025 per 1000 objects
190
+ Cost: Worth it for > 128KB objects with unpredictable access
191
+
192
+ Best for:
193
+ - Unknown access patterns
194
+ - Data lakes
195
+ - Long-term storage with occasional access
196
+ ```
197
+
198
+ ### Lifecycle Policy Example
199
+ ```json
200
+ {
201
+ "Rules": [
202
+ {
203
+ "Id": "Optimize application logs",
204
+ "Status": "Enabled",
205
+ "Filter": { "Prefix": "logs/app/" },
206
+ "Transitions": [
207
+ { "Days": 30, "StorageClass": "STANDARD_IA" },
208
+ { "Days": 90, "StorageClass": "GLACIER_IR" },
209
+ { "Days": 365, "StorageClass": "DEEP_ARCHIVE" }
210
+ ],
211
+ "Expiration": { "Days": 2555 }
212
+ },
213
+ {
214
+ "Id": "Delete incomplete multipart uploads",
215
+ "Status": "Enabled",
216
+ "AbortIncompleteMultipartUpload": {
217
+ "DaysAfterInitiation": 7
218
+ }
219
+ }
220
+ ]
221
+ }
222
+ ```
223
+
224
+ ## RDS Cost Optimization
225
+
226
+ ### Reserved Instance vs Aurora Serverless
227
+ ```typescript
228
+ interface DBCostComparison {
229
+ option: string;
230
+ monthlyCost: number;
231
+ usagePattern: string;
232
+ pros: string[];
233
+ cons: string[];
234
+ }
235
+
236
+ const comparison: DBCostComparison[] = [
237
+ {
238
+ option: 'On-Demand (db.t3.medium)',
239
+ monthlyCost: 50,
240
+ usagePattern: 'Variable, testing',
241
+ pros: ['No commitment', 'Easy to change'],
242
+ cons: ['Highest cost'],
243
+ },
244
+ {
245
+ option: 'Reserved Instance 1yr (db.t3.medium)',
246
+ monthlyCost: 32,
247
+ usagePattern: 'Steady-state, 24/7',
248
+ pros: ['36% savings', 'Predictable cost'],
249
+ cons: ['1-year commitment', 'Capacity reserved'],
250
+ },
251
+ {
252
+ option: 'Aurora Serverless v2',
253
+ monthlyCost: 15,
254
+ usagePattern: 'Intermittent, dev/test',
255
+ pros: ['Auto-scaling', 'Pay per ACU-second', '70% savings for low usage'],
256
+ cons: ['Cold start latency', 'Not for steady 24/7'],
257
+ },
258
+ ];
259
+ ```
260
+
261
+ ### RDS Storage Optimization
262
+ ```yaml
263
+ Storage Types:
264
+ gp2 (General Purpose SSD):
265
+ - $0.115/GB/month
266
+ - 3 IOPS per GB (min 100, max 16,000)
267
+ - Burstable to 3,000 IOPS
268
+
269
+ gp3 (Newer General Purpose SSD):
270
+ - $0.08/GB/month (30% cheaper!)
271
+ - 3,000 IOPS baseline (free)
272
+ - 125 MB/s throughput (free)
273
+ - Additional IOPS: $0.005 per IOPS/month
274
+ - Additional throughput: $0.04 per MB/s/month
275
+
276
+ io1/io2 (Provisioned IOPS):
277
+ - $0.125/GB + $0.065 per IOPS
278
+ - For high-performance databases
279
+
280
+ Migration: gp2 → gp3 saves 30% with no performance impact
281
+ ```
282
+
283
+ ## DynamoDB Cost Optimization
284
+
285
+ ### On-Demand vs Provisioned
286
+ ```typescript
287
+ // Decision matrix
288
+ function chooseBillingMode(usage: UsagePattern): string {
289
+ const { requestsPerDay, peakTPS, averageTPS, predictability } = usage;
290
+
291
+ // On-demand if:
292
+ // - Unpredictable traffic
293
+ // - Spiky workloads
294
+ // - New applications
295
+ // - < 20% peak utilization
296
+
297
+ if (predictability < 0.5 || (peakTPS / averageTPS) > 2) {
298
+ return 'On-Demand';
299
+ }
300
+
301
+ // Provisioned if:
302
+ // - Predictable traffic
303
+ // - Steady-state workloads
304
+ // - High utilization (> 20%)
305
+
306
+ if (predictability > 0.7 && (peakTPS / averageTPS) < 2) {
307
+ return 'Provisioned (with auto-scaling)';
308
+ }
309
+
310
+ return 'On-Demand (then migrate to Provisioned after 3 months)';
311
+ }
312
+ ```
313
+
314
+ ### Reserved Capacity
315
+ ```yaml
316
+ Savings: 53-76% discount
317
+ Commitment: 1 year
318
+ Minimum: 100 WCU or RCU
319
+
320
+ Cost Comparison (100 WCU):
321
+ - On-Demand: $1.25 per 1M writes = $3,600/month (100 writes/sec)
322
+ - Provisioned: 100 WCU * $0.00065/hour * 730 = $47.45/month
323
+ - Reserved: $47.45 * 0.47 = $22.30/month
324
+
325
+ Best for: Predictable write-heavy workloads
326
+ ```
327
+
328
+ ## Cost Anomaly Detection
329
+
330
+ ### Setup
331
+ ```bash
332
+ # Create anomaly monitor
333
+ aws ce create-anomaly-monitor \
334
+ --anomaly-monitor Name=ProductionMonitor,MonitorType=DIMENSIONAL,MonitorDimension=SERVICE
335
+
336
+ # Create anomaly subscription
337
+ aws ce create-anomaly-subscription \
338
+ --anomaly-subscription Name=ProductionAlerts,MonitorArnList=arn:aws:ce::123456789012:anomalymonitor/abc123,Subscribers=[{Address=team@example.com,Type=EMAIL}],Threshold=100
339
+ ```
340
+
341
+ ### Anomaly Patterns
342
+ ```yaml
343
+ Common Anomalies:
344
+ - Unexpected EC2 instance launches (compromised credentials)
345
+ - Data transfer spikes (DDoS, misconfigured app)
346
+ - Lambda invocation explosion (infinite loops)
347
+ - S3 GET request flood (hotlinked content)
348
+ - RDS storage growth (missing retention policies)
349
+
350
+ Alert Thresholds:
351
+ - Service cost: > 50% increase from baseline
352
+ - Daily spend: > 20% above 7-day average
353
+ - Total cost: > 10% above monthly forecast
354
+ ```
355
+
356
+ ## Tagging Strategy for Cost Allocation
357
+
358
+ ### Tag Policy
359
+ ```yaml
360
+ Required Tags (enforced via AWS Config):
361
+ Environment: [prod, staging, dev, test]
362
+ Team: [platform, api, frontend, data]
363
+ Project: [alpha, beta, gamma]
364
+ CostCenter: [engineering, product, sales]
365
+ Owner: [email@example.com]
366
+
367
+ Auto-Tagging:
368
+ - Use AWS Organizations tag policies
369
+ - Terraform: default_tags in provider
370
+ - CloudFormation: Tags parameter
371
+ - Lambda: Environment variables → tags
372
+ ```
373
+
374
+ ### Cost Allocation Tags
375
+ ```bash
376
+ # Activate cost allocation tags
377
+ aws ce update-cost-allocation-tags-status \
378
+ --cost-allocation-tags-status TagKey=Environment,Status=Active TagKey=Team,Status=Active
379
+
380
+ # View costs by tag
381
+ aws ce get-cost-and-usage \
382
+ --time-period Start=2025-01-01,End=2025-02-01 \
383
+ --granularity MONTHLY \
384
+ --metrics BlendedCost \
385
+ --group-by Type=TAG,Key=Environment
386
+ ```
387
+
388
+ ## AWS-Specific Best Practices
389
+
390
+ ### Multi-Account Strategy
391
+ ```yaml
392
+ Organization Structure:
393
+ - Management account (billing only)
394
+ - Production account (prod workloads)
395
+ - Staging account (pre-prod)
396
+ - Development account (dev/test)
397
+ - Shared Services account (logging, monitoring)
398
+
399
+ Benefits:
400
+ - Consolidated billing (volume discounts)
401
+ - Reserved Instance sharing across accounts
402
+ - Savings Plans apply organization-wide
403
+ - Isolated blast radius
404
+ - Clear cost attribution
405
+ ```
406
+
407
+ ### AWS Free Tier Monitoring
408
+ ```bash
409
+ # Set up budget for free tier limits
410
+ aws budgets create-budget \
411
+ --account-id 123456789012 \
412
+ --budget file://free-tier-budget.json \
413
+ --notifications-with-subscribers file://free-tier-alerts.json
414
+ ```
415
+
416
+ Optimize AWS costs like a cloud financial engineer!