cdk-cost-analyzer 0.1.1

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 (228) hide show
  1. package/.cdk-cost-analyzer-cache/metadata.json +12 -0
  2. package/.gitlab-ci.yml +214 -0
  3. package/.husky/pre-commit +12 -0
  4. package/.kiro/hooks/accessibility-audit.kiro.hook +18 -0
  5. package/.kiro/hooks/api-schema-validation.kiro.hook +21 -0
  6. package/.kiro/hooks/auto-test-on-save.kiro.hook +19 -0
  7. package/.kiro/hooks/cdk-synth-on-change.kiro.hook +20 -0
  8. package/.kiro/hooks/code-coverage-check.kiro.hook +14 -0
  9. package/.kiro/hooks/commit-message-helper.kiro.hook +14 -0
  10. package/.kiro/hooks/dependency-update-check.kiro.hook +14 -0
  11. package/.kiro/hooks/env-file-validation.kiro.hook +18 -0
  12. package/.kiro/hooks/lint-and-format-on-save.kiro.hook +21 -0
  13. package/.kiro/hooks/mcp-config-validation.kiro.hook +17 -0
  14. package/.kiro/hooks/mcp-server-test.kiro.hook +14 -0
  15. package/.kiro/hooks/performance-analysis.kiro.hook +14 -0
  16. package/.kiro/hooks/readme-spell-check.kiro.hook +14 -0
  17. package/.kiro/hooks/security-scan-on-dependency-change.kiro.hook +21 -0
  18. package/.kiro/hooks/translation-update.kiro.hook +18 -0
  19. package/.kiro/hooks/update-documentation.kiro.hook +18 -0
  20. package/.kiro/settings/mcp.json +20 -0
  21. package/.kiro/specs/cdk-cost-analyzer/design.md +620 -0
  22. package/.kiro/specs/cdk-cost-analyzer/requirements.md +183 -0
  23. package/.kiro/specs/cdk-cost-analyzer/tasks.md +357 -0
  24. package/.kiro/specs/github-actions-ci/design.md +281 -0
  25. package/.kiro/specs/github-actions-ci/requirements.md +86 -0
  26. package/.kiro/specs/github-actions-ci/tasks.md +115 -0
  27. package/.kiro/specs/nlb-calculator-test-coverage/design.md +190 -0
  28. package/.kiro/specs/nlb-calculator-test-coverage/requirements.md +84 -0
  29. package/.kiro/specs/nlb-calculator-test-coverage/tasks.md +150 -0
  30. package/.kiro/specs/production-readiness/design.md +1213 -0
  31. package/.kiro/specs/production-readiness/requirements.md +312 -0
  32. package/.kiro/specs/production-readiness/tasks.md +269 -0
  33. package/.kiro/specs/repository-cleanup/design.md +283 -0
  34. package/.kiro/specs/repository-cleanup/requirements.md +74 -0
  35. package/.kiro/specs/repository-cleanup/tasks.md +64 -0
  36. package/.kiro/steering/aws-cli-best-practices.md +41 -0
  37. package/.kiro/steering/cdk-best-practices.md +49 -0
  38. package/.kiro/steering/development-standards.md +54 -0
  39. package/.kiro/steering/docker-best-practices.md +34 -0
  40. package/.kiro/steering/documentation-style.md +151 -0
  41. package/.kiro/steering/git-best-practices.md +37 -0
  42. package/.kiro/steering/mcp-best-practices.md +95 -0
  43. package/.kiro/steering/python-best-practices.md +48 -0
  44. package/.kiro/steering/react-best-practices.md +44 -0
  45. package/.kiro/steering/security-best-practices.md +41 -0
  46. package/.kiro/steering/testing-best-practices.md +59 -0
  47. package/.kiro/steering/typescript-best-practices.md +40 -0
  48. package/CHANGELOG.md +49 -0
  49. package/CONTRIBUTING.md +258 -0
  50. package/LICENSE +19 -0
  51. package/README.md +480 -0
  52. package/SECURITY.md +117 -0
  53. package/dist/api/index.d.ts +11 -0
  54. package/dist/api/index.js +65 -0
  55. package/dist/api/types.d.ts +15 -0
  56. package/dist/api/types.js +3 -0
  57. package/dist/cli/index.d.ts +2 -0
  58. package/dist/cli/index.js +262 -0
  59. package/dist/config/ConfigManager.d.ts +40 -0
  60. package/dist/config/ConfigManager.js +238 -0
  61. package/dist/config/index.d.ts +2 -0
  62. package/dist/config/index.js +19 -0
  63. package/dist/config/types.d.ts +72 -0
  64. package/dist/config/types.js +15 -0
  65. package/dist/diff/DiffEngine.d.ts +7 -0
  66. package/dist/diff/DiffEngine.js +73 -0
  67. package/dist/diff/index.d.ts +2 -0
  68. package/dist/diff/index.js +21 -0
  69. package/dist/diff/types.d.ts +20 -0
  70. package/dist/diff/types.js +3 -0
  71. package/dist/integrations/GitLabIntegration.d.ts +7 -0
  72. package/dist/integrations/GitLabIntegration.js +45 -0
  73. package/dist/integrations/index.d.ts +2 -0
  74. package/dist/integrations/index.js +21 -0
  75. package/dist/integrations/types.d.ts +11 -0
  76. package/dist/integrations/types.js +13 -0
  77. package/dist/parser/TemplateParser.d.ts +8 -0
  78. package/dist/parser/TemplateParser.js +75 -0
  79. package/dist/parser/index.d.ts +2 -0
  80. package/dist/parser/index.js +22 -0
  81. package/dist/parser/types.d.ts +30 -0
  82. package/dist/parser/types.js +3 -0
  83. package/dist/pipeline/PipelineOrchestrator.d.ts +23 -0
  84. package/dist/pipeline/PipelineOrchestrator.js +191 -0
  85. package/dist/pipeline/index.d.ts +2 -0
  86. package/dist/pipeline/index.js +19 -0
  87. package/dist/pipeline/types.d.ts +41 -0
  88. package/dist/pipeline/types.js +13 -0
  89. package/dist/pricing/CacheManager.d.ts +75 -0
  90. package/dist/pricing/CacheManager.js +195 -0
  91. package/dist/pricing/PricingClient.d.ts +17 -0
  92. package/dist/pricing/PricingClient.js +122 -0
  93. package/dist/pricing/PricingService.d.ts +16 -0
  94. package/dist/pricing/PricingService.js +149 -0
  95. package/dist/pricing/calculators/ALBCalculator.d.ts +16 -0
  96. package/dist/pricing/calculators/ALBCalculator.js +163 -0
  97. package/dist/pricing/calculators/APIGatewayCalculator.d.ts +10 -0
  98. package/dist/pricing/calculators/APIGatewayCalculator.js +177 -0
  99. package/dist/pricing/calculators/CloudFrontCalculator.d.ts +59 -0
  100. package/dist/pricing/calculators/CloudFrontCalculator.js +151 -0
  101. package/dist/pricing/calculators/DynamoDBCalculator.d.ts +9 -0
  102. package/dist/pricing/calculators/DynamoDBCalculator.js +146 -0
  103. package/dist/pricing/calculators/EC2Calculator.d.ts +7 -0
  104. package/dist/pricing/calculators/EC2Calculator.js +80 -0
  105. package/dist/pricing/calculators/ECSCalculator.d.ts +9 -0
  106. package/dist/pricing/calculators/ECSCalculator.js +116 -0
  107. package/dist/pricing/calculators/ElastiCacheCalculator.d.ts +8 -0
  108. package/dist/pricing/calculators/ElastiCacheCalculator.js +106 -0
  109. package/dist/pricing/calculators/LambdaCalculator.d.ts +13 -0
  110. package/dist/pricing/calculators/LambdaCalculator.js +111 -0
  111. package/dist/pricing/calculators/NLBCalculator.d.ts +16 -0
  112. package/dist/pricing/calculators/NLBCalculator.js +138 -0
  113. package/dist/pricing/calculators/NatGatewayCalculator.d.ts +12 -0
  114. package/dist/pricing/calculators/NatGatewayCalculator.js +116 -0
  115. package/dist/pricing/calculators/RDSCalculator.d.ts +9 -0
  116. package/dist/pricing/calculators/RDSCalculator.js +103 -0
  117. package/dist/pricing/calculators/S3Calculator.d.ts +8 -0
  118. package/dist/pricing/calculators/S3Calculator.js +68 -0
  119. package/dist/pricing/calculators/VPCEndpointCalculator.d.ts +12 -0
  120. package/dist/pricing/calculators/VPCEndpointCalculator.js +129 -0
  121. package/dist/pricing/index.d.ts +10 -0
  122. package/dist/pricing/index.js +37 -0
  123. package/dist/pricing/types.d.ts +53 -0
  124. package/dist/pricing/types.js +22 -0
  125. package/dist/releasetag.txt +1 -0
  126. package/dist/reporter/Reporter.d.ts +18 -0
  127. package/dist/reporter/Reporter.js +412 -0
  128. package/dist/reporter/index.d.ts +2 -0
  129. package/dist/reporter/index.js +21 -0
  130. package/dist/reporter/types.d.ts +72 -0
  131. package/dist/reporter/types.js +3 -0
  132. package/dist/synthesis/SynthesisOrchestrator.d.ts +26 -0
  133. package/dist/synthesis/SynthesisOrchestrator.js +243 -0
  134. package/dist/synthesis/index.d.ts +2 -0
  135. package/dist/synthesis/index.js +19 -0
  136. package/dist/synthesis/types.d.ts +17 -0
  137. package/dist/synthesis/types.js +13 -0
  138. package/dist/threshold/ThresholdEnforcer.d.ts +29 -0
  139. package/dist/threshold/ThresholdEnforcer.js +143 -0
  140. package/dist/threshold/index.d.ts +2 -0
  141. package/dist/threshold/index.js +19 -0
  142. package/dist/threshold/types.d.ts +15 -0
  143. package/dist/threshold/types.js +17 -0
  144. package/docs/CALCULATORS.md +820 -0
  145. package/docs/CI_CD.md +608 -0
  146. package/docs/CONFIGURATION.md +407 -0
  147. package/docs/DEVELOPMENT.md +387 -0
  148. package/docs/RELEASE.md +223 -0
  149. package/docs/TROUBLESHOOTING.md +847 -0
  150. package/examples/.cdk-cost-analyzer.yml +85 -0
  151. package/examples/.gitlab-ci.yml +125 -0
  152. package/examples/api-usage.js +26 -0
  153. package/examples/complex/base.json +16 -0
  154. package/examples/complex/target.json +29 -0
  155. package/examples/monorepo/.gitlab-ci.yml +251 -0
  156. package/examples/monorepo/README.md +341 -0
  157. package/examples/monorepo/package.json +27 -0
  158. package/examples/monorepo/packages/backend-infra/.cdk-cost-analyzer.yml +34 -0
  159. package/examples/monorepo/packages/backend-infra/bin/app.ts +16 -0
  160. package/examples/monorepo/packages/backend-infra/cdk.json +7 -0
  161. package/examples/monorepo/packages/backend-infra/lib/backend-stack.ts +128 -0
  162. package/examples/monorepo/packages/backend-infra/package.json +30 -0
  163. package/examples/monorepo/packages/backend-infra/tsconfig.json +11 -0
  164. package/examples/monorepo/packages/data-infra/.cdk-cost-analyzer.yml +38 -0
  165. package/examples/monorepo/packages/data-infra/bin/app.ts +16 -0
  166. package/examples/monorepo/packages/data-infra/cdk.json +7 -0
  167. package/examples/monorepo/packages/data-infra/lib/data-stack.ts +121 -0
  168. package/examples/monorepo/packages/data-infra/package.json +30 -0
  169. package/examples/monorepo/packages/data-infra/tsconfig.json +11 -0
  170. package/examples/monorepo/packages/frontend-infra/.cdk-cost-analyzer.yml +31 -0
  171. package/examples/monorepo/packages/frontend-infra/bin/app.ts +16 -0
  172. package/examples/monorepo/packages/frontend-infra/cdk.json +7 -0
  173. package/examples/monorepo/packages/frontend-infra/lib/frontend-stack.ts +60 -0
  174. package/examples/monorepo/packages/frontend-infra/package.json +30 -0
  175. package/examples/monorepo/packages/frontend-infra/tsconfig.json +11 -0
  176. package/examples/monorepo/tsconfig.json +35 -0
  177. package/examples/multi-stack/.cdk-cost-analyzer.yml +72 -0
  178. package/examples/multi-stack/.gitlab-ci.yml +184 -0
  179. package/examples/multi-stack/README.md +279 -0
  180. package/examples/multi-stack/bin/app.ts +36 -0
  181. package/examples/multi-stack/cdk.json +72 -0
  182. package/examples/multi-stack/lib/compute-stack.ts +128 -0
  183. package/examples/multi-stack/lib/networking-stack.ts +69 -0
  184. package/examples/multi-stack/lib/storage-stack.ts +141 -0
  185. package/examples/multi-stack/package-lock.json +4437 -0
  186. package/examples/multi-stack/package.json +42 -0
  187. package/examples/multi-stack/tsconfig.json +34 -0
  188. package/examples/simple/base.json +8 -0
  189. package/examples/simple/target.json +14 -0
  190. package/examples/single-stack/.NVP +0 -0
  191. package/examples/single-stack/.cdk-cost-analyzer.yml +52 -0
  192. package/examples/single-stack/.gitlab-ci.yml +126 -0
  193. package/examples/single-stack/README.md +184 -0
  194. package/examples/single-stack/UeK +0 -0
  195. package/examples/single-stack/bin/app.ts +16 -0
  196. package/examples/single-stack/cdk.json +72 -0
  197. package/examples/single-stack/lib/infrastructure-stack.ts +119 -0
  198. package/examples/single-stack/package-lock.json +4443 -0
  199. package/examples/single-stack/package.json +38 -0
  200. package/examples/single-stack/tsconfig.json +34 -0
  201. package/package.json +139 -0
  202. package/test-cdk-project/README-COMPUTE.md +141 -0
  203. package/test-cdk-project/README.md +95 -0
  204. package/test-cdk-project/app-with-compute.js +102 -0
  205. package/test-cdk-project/app.js +81 -0
  206. package/test-cdk-project/cdk-compute.json +3 -0
  207. package/test-cdk-project/cdk.context.json +7 -0
  208. package/test-cdk-project/cdk.json +3 -0
  209. package/test-cdk-project/cdk.out/TestStack.assets.json +21 -0
  210. package/test-cdk-project/cdk.out/TestStack.template.json +115 -0
  211. package/test-cdk-project/cdk.out/cdk.out +1 -0
  212. package/test-cdk-project/cdk.out/manifest.json +503 -0
  213. package/test-cdk-project/cdk.out/tree.json +1 -0
  214. package/test-cdk-project/cdk.out.base/TestStack.assets.json +21 -0
  215. package/test-cdk-project/cdk.out.base/TestStack.template.json +115 -0
  216. package/test-cdk-project/cdk.out.base/cdk.out +1 -0
  217. package/test-cdk-project/cdk.out.base/manifest.json +503 -0
  218. package/test-cdk-project/cdk.out.base/tree.json +1 -0
  219. package/test-cdk-project/cdk.out.target/TestStack.assets.json +21 -0
  220. package/test-cdk-project/cdk.out.target/TestStack.template.json +183 -0
  221. package/test-cdk-project/cdk.out.target/cdk.out +1 -0
  222. package/test-cdk-project/cdk.out.target/manifest.json +521 -0
  223. package/test-cdk-project/cdk.out.target/tree.json +1 -0
  224. package/test-cdk-project/package-lock.json +422 -0
  225. package/test-cdk-project/package.json +17 -0
  226. package/tools/workflows/README.md +102 -0
  227. package/tools/workflows/validate-workflows.js +109 -0
  228. package/tools/workflows/workflow-utils.ts +181 -0
@@ -0,0 +1,151 @@
1
+ # Documentation Style Guide
2
+
3
+ ## Writing Style
4
+
5
+ Write documentation with a professional, technical tone similar to AWS documentation:
6
+
7
+ - **Professional and clear** - Direct, informative language without casual expressions
8
+ - **Action-oriented** - Use active voice and imperative mood for instructions
9
+ - **Concise** - Get to the point quickly, avoid unnecessary words
10
+ - **Practical** - Focus on what users need to do, not just theory
11
+
12
+ ## Tone Guidelines
13
+
14
+ ### Do Use
15
+
16
+ - Clear, direct language: "Configure the IAM role" not "You might want to configure the IAM role"
17
+ - Active voice: "Deploy the stack" not "The stack should be deployed"
18
+ - Present tense: "The function returns" not "The function will return"
19
+ - Second person for instructions: "You configure" or imperative "Configure"
20
+ - Technical precision: Use exact AWS service names and terminology
21
+
22
+ ### Don't Use
23
+
24
+ - Emojis or emoticons (❌ 🎉 😊)
25
+ - Exclamation marks for emphasis
26
+ - Casual expressions: "awesome", "cool", "super easy"
27
+ - Vague qualifiers: "pretty much", "basically", "kind of"
28
+ - Marketing language: "revolutionary", "game-changing", "best-in-class"
29
+ - Overused adjectives: "comprehensive" (use specific descriptions instead)
30
+
31
+ ## Structure
32
+
33
+ ### Headers
34
+
35
+ - Use descriptive, action-oriented headers
36
+ - "Configuring IAM Roles" not "IAM Roles Configuration"
37
+ - "What You'll Do" for overview sections
38
+ - Avoid stacked headings (heading immediately followed by another heading)
39
+
40
+ ### Content Organization
41
+
42
+ - Start with overview/context
43
+ - Use tables for structured comparisons
44
+ - Use bullet lists for related items
45
+ - Use numbered lists for sequential steps
46
+ - Include code examples with proper syntax highlighting
47
+
48
+ ### Examples and Code
49
+
50
+ - Provide complete, working examples
51
+ - Include comments explaining key concepts
52
+ - Use realistic placeholder values
53
+ - Show both the command and expected output when relevant
54
+
55
+ ## Formatting
56
+
57
+ ### Emphasis
58
+
59
+ - **Bold** for UI elements, important terms, and key concepts
60
+ - `Code formatting` for commands, file names, and technical values
61
+ - Use admonitions (warning, info, note) for important callouts
62
+
63
+ ### Lists
64
+
65
+ - Use bullet points for unordered information
66
+ - Use numbered lists only for sequential steps
67
+ - Keep list items parallel in structure
68
+ - Start list items with capital letters
69
+
70
+ ### Code Blocks
71
+
72
+ Always specify the language for syntax highlighting:
73
+
74
+ ```yaml
75
+ # Good - with language specified
76
+ variables:
77
+ AWS_REGION: eu-central-1
78
+ ```
79
+
80
+ ## Language
81
+
82
+ - **US English spelling** - "behavior" not "behaviour", "optimize" not "optimise"
83
+ - **Consistent terminology** - Use AWS service names exactly as documented
84
+ - **Avoid jargon** - Explain technical terms when first introduced
85
+ - **Active voice preferred** - "Configure the role" not "The role should be configured"
86
+
87
+ ## AWS-Specific Guidelines
88
+
89
+ ### Service Names
90
+
91
+ - Use official AWS service names: "AWS Secrets Manager" not "Secrets Manager"
92
+ - First mention: full name, subsequent: short name if clear from context
93
+ - Capitalize properly: "Amazon S3", "AWS Lambda", "Amazon RDS"
94
+
95
+ ### Resource References
96
+
97
+ - Use exact ARN formats
98
+ - Include region and account placeholders: `<ACCOUNT>`, `<REGION>`
99
+ - Show complete resource names in examples
100
+
101
+ ### Best Practices
102
+
103
+ - Reference official AWS documentation when appropriate
104
+ - Include security considerations
105
+ - Mention cost implications when relevant
106
+ - Provide troubleshooting guidance
107
+
108
+ ## Examples
109
+
110
+ ### Good Example
111
+
112
+ ```markdown
113
+ ## Configuring Secret Rotation
114
+
115
+ Enable automatic rotation for database credentials:
116
+
117
+ 1. Navigate to AWS Secrets Manager console
118
+ 2. Select your secret
119
+ 3. Choose "Edit rotation"
120
+ 4. Configure rotation schedule
121
+
122
+ **Important:** Ensure your Lambda function has network access to the database.
123
+ ```
124
+
125
+ ### Avoid
126
+
127
+ ```markdown
128
+ ## Secret Rotation 🔄
129
+
130
+ Let's set up rotation! It's super easy:
131
+
132
+ - Just go to Secrets Manager
133
+ - Click around until you find rotation settings
134
+ - Turn it on! 🎉
135
+
136
+ Pretty cool, right?
137
+ ```
138
+
139
+ ## Checklist
140
+
141
+ Before submitting documentation:
142
+
143
+ - [ ] Professional tone throughout
144
+ - [ ] No emojis or casual language
145
+ - [ ] Active voice used for instructions
146
+ - [ ] US English spelling
147
+ - [ ] Code blocks have language specified
148
+ - [ ] Headers are descriptive and action-oriented
149
+ - [ ] Examples are complete and realistic
150
+ - [ ] AWS service names are correct
151
+ - [ ] Security and cost considerations mentioned where relevant
@@ -0,0 +1,37 @@
1
+ ---
2
+ title: Git Best Practices
3
+ inclusion: always
4
+ ---
5
+
6
+ # Git Best Practices
7
+
8
+ ## Commit Messages
9
+ - Use conventional commit format: `type(scope): description`
10
+ - Types: feat, fix, docs, style, refactor, test, chore
11
+ - Keep first line under 50 characters
12
+ - Use imperative mood ("Add feature" not "Added feature")
13
+ - Include body for complex changes
14
+
15
+ ## Branching
16
+ - Use feature branches for new development
17
+ - Keep main/master branch stable and deployable
18
+ - Use descriptive branch names (feature/user-auth, fix/login-bug)
19
+ - Delete merged branches to keep repository clean
20
+
21
+ ## Workflow
22
+ - Pull latest changes before starting work
23
+ - Commit frequently with logical chunks
24
+ - Use interactive rebase to clean up history before merging
25
+ - Review code before merging (pull requests)
26
+
27
+ ## Repository Management
28
+ - Use .gitignore to exclude build artifacts and secrets
29
+ - Keep repository size manageable (use Git LFS for large files)
30
+ - Tag releases with semantic versioning
31
+ - Document branching strategy in README
32
+
33
+ ## Security
34
+ - Never commit secrets, API keys, or passwords
35
+ - Use environment variables for configuration
36
+ - Review commits for sensitive information
37
+ - Use signed commits when possible
@@ -0,0 +1,95 @@
1
+ ---
2
+ title: MCP (Model Context Protocol) Best Practices
3
+ inclusion: always
4
+ ---
5
+
6
+ # MCP (Model Context Protocol) Best Practices
7
+
8
+ ## Server Configuration
9
+ - Use workspace-level config (`.kiro/settings/mcp.json`) for project-specific servers
10
+ - Use user-level config (`~/.kiro/settings/mcp.json`) for global/cross-workspace servers
11
+ - Workspace config takes precedence over user config for server name conflicts
12
+ - Always specify exact versions or use `@latest` for stability
13
+
14
+ ## Installation and Setup
15
+ - Use `uvx` command for Python-based MCP servers (requires `uv` package manager)
16
+ - Install `uv` via pip, homebrew, or follow: https://docs.astral.sh/uv/getting-started/installation/
17
+ - No separate installation needed for uvx servers - they download automatically
18
+ - Test servers immediately after configuration, don't wait for issues
19
+
20
+ ## Security and Auto-Approval
21
+ - Use `autoApprove` sparingly and only for trusted, low-risk tools
22
+ - Review tool capabilities before adding to auto-approve list
23
+ - Regularly audit auto-approved tools for security implications
24
+ - Consider environment-specific auto-approve settings
25
+
26
+ ## Error Handling and Debugging
27
+ - Set `FASTMCP_LOG_LEVEL: "ERROR"` to reduce noise in logs
28
+ - Use `disabled: false` to temporarily disable problematic servers
29
+ - Servers reconnect automatically on config changes
30
+ - Use MCP Server view in Kiro feature panel for manual reconnection
31
+
32
+ ## Common MCP Server Examples
33
+ ```json
34
+ {
35
+ "mcpServers": {
36
+ "aws-docs": {
37
+ "command": "uvx",
38
+ "args": ["awslabs.aws-documentation-mcp-server@latest"],
39
+ "env": {
40
+ "FASTMCP_LOG_LEVEL": "ERROR"
41
+ },
42
+ "disabled": false,
43
+ "autoApprove": []
44
+ },
45
+ "filesystem": {
46
+ "command": "uvx",
47
+ "args": ["mcp-server-filesystem@latest"],
48
+ "env": {
49
+ "FASTMCP_LOG_LEVEL": "ERROR"
50
+ },
51
+ "disabled": false,
52
+ "autoApprove": ["read_file", "list_directory"]
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ ## Testing MCP Tools
59
+ - Test MCP tools immediately after configuration
60
+ - Don't inspect configurations unless facing specific issues
61
+ - Use sample calls to verify tool behavior
62
+ - Test with various parameter combinations
63
+ - Document working examples for team reference
64
+
65
+ ## Performance Optimization
66
+ - Disable unused servers to improve startup time
67
+ - Use specific tool names in auto-approve rather than wildcards
68
+ - Monitor server resource usage and adjust as needed
69
+ - Consider server-specific environment variables for optimization
70
+
71
+ ## Development Workflow
72
+ - Add MCP servers incrementally, test each addition
73
+ - Use version pinning for production environments
74
+ - Document server purposes and usage in team documentation
75
+ - Create project-specific server collections for different use cases
76
+
77
+ ## Troubleshooting
78
+ - Check server logs in Kiro's MCP Server view
79
+ - Verify `uv` and `uvx` installation if Python servers fail
80
+ - Test server connectivity outside of Kiro if needed
81
+ - Use command palette "MCP" commands for server management
82
+ - Restart servers via MCP Server view rather than restarting Kiro
83
+
84
+ ## Best Practices for Tool Usage
85
+ - Understand tool capabilities before first use
86
+ - Use descriptive prompts when calling MCP tools
87
+ - Handle tool errors gracefully in workflows
88
+ - Combine multiple MCP tools for complex tasks
89
+ - Cache results when appropriate to avoid repeated calls
90
+
91
+ ## Development Integration
92
+ - Use Context7 MCP server to verify dependency compatibility before adding libraries
93
+ - Leverage AWS-Knowledge MCP server for current AWS documentation and best practices
94
+ - Use aws-api-mcp-server for AWS API interactions and validation
95
+ - Reference official sources through MCP servers when available in documentation
@@ -0,0 +1,48 @@
1
+ ---
2
+ title: Python Best Practices
3
+ inclusion: fileMatch
4
+ fileMatchPattern: '*.py'
5
+ ---
6
+
7
+ # Python Best Practices
8
+
9
+ ## Code Style
10
+ - Follow PEP 8 style guide
11
+ - Use meaningful variable and function names
12
+ - Use snake_case for variables and functions
13
+ - Use PascalCase for classes
14
+ - Use UPPER_SNAKE_CASE for constants
15
+ - Limit line length to 88 characters (Black formatter)
16
+
17
+ ## Type Hints
18
+ - Use type hints for function parameters and return values
19
+ - Import types from `typing` module when needed
20
+ - Use `Optional` for nullable values
21
+ - Use `Union` for multiple possible types
22
+
23
+ ## Error Handling
24
+ - Use specific exception types
25
+ - Handle exceptions at appropriate levels
26
+ - Use context managers (`with` statements) for resource management
27
+ - Log errors with appropriate detail
28
+
29
+ ## Code Organization
30
+ - Use virtual environments for dependencies
31
+ - Create requirements.txt or use poetry/pipenv
32
+ - Organize code into modules and packages
33
+ - Use `__init__.py` files appropriately
34
+
35
+ ## Testing
36
+ - Write unit tests using pytest
37
+ - Use descriptive test function names
38
+ - Mock external dependencies
39
+ - Aim for high test coverage
40
+ - Use fixtures for test setup
41
+ - Run tests with minimal output: `pytest -q` or `python -m pytest --tb=short -q`
42
+ - Filter specific tests: `pytest -k "test_name"` to avoid running full suites
43
+
44
+ ## Performance
45
+ - Use list comprehensions over loops when appropriate
46
+ - Use generators for large datasets
47
+ - Profile code before optimizing
48
+ - Use appropriate data structures (sets, dicts, etc.)
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: React Best Practices
3
+ inclusion: fileMatch
4
+ fileMatchPattern: '*.tsx,*.jsx,*react*'
5
+ ---
6
+
7
+ # React Best Practices
8
+
9
+ ## Component Structure
10
+ - Use functional components with hooks
11
+ - Keep components small and focused (single responsibility)
12
+ - Use TypeScript for all React components
13
+ - Prefer named exports over default exports
14
+
15
+ ## Hooks
16
+ - Use `useState` for local component state
17
+ - Use `useEffect` for side effects
18
+ - Use `useMemo` and `useCallback` for performance optimization
19
+ - Create custom hooks for reusable logic
20
+ - Follow the rules of hooks (only call at top level)
21
+
22
+ ## Props and State
23
+ - Define prop types with TypeScript interfaces
24
+ - Use destructuring for props
25
+ - Avoid deeply nested state objects
26
+ - Use state updater functions for complex state updates
27
+
28
+ ## Performance
29
+ - Use React.memo for expensive components
30
+ - Implement proper key props for lists
31
+ - Avoid creating objects/functions in render
32
+ - Use lazy loading for large components
33
+
34
+ ## Styling
35
+ - Use CSS modules or styled-components
36
+ - Avoid inline styles for complex styling
37
+ - Use consistent naming conventions
38
+ - Implement responsive design patterns
39
+
40
+ ## Testing
41
+ - Test component behavior, not implementation
42
+ - Use React Testing Library
43
+ - Test user interactions and accessibility
44
+ - Mock external dependencies
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: Security Best Practices
3
+ inclusion: always
4
+ ---
5
+
6
+ # Security Best Practices
7
+
8
+ ## Code Security
9
+ - Never hardcode secrets, API keys, or passwords
10
+ - Use environment variables for configuration
11
+ - Validate all user inputs
12
+ - Use parameterized queries to prevent SQL injection
13
+ - Implement proper authentication and authorization
14
+
15
+ ## Dependency Management
16
+ - Keep dependencies updated
17
+ - Use dependency scanning tools
18
+ - Review third-party packages before adding
19
+ - Use lock files (package-lock.json, poetry.lock)
20
+ - Remove unused dependencies
21
+
22
+ ## Data Protection
23
+ - Encrypt sensitive data at rest and in transit
24
+ - Use HTTPS for all web communications
25
+ - Implement proper session management
26
+ - Use secure headers (HSTS, CSP, etc.)
27
+ - Follow OWASP guidelines
28
+
29
+ ## Infrastructure Security
30
+ - Use least privilege principle for IAM
31
+ - Enable logging and monitoring
32
+ - Use network segmentation
33
+ - Implement proper backup strategies
34
+ - Regular security audits and penetration testing
35
+
36
+ ## Development Practices
37
+ - Use static code analysis tools
38
+ - Implement security testing in CI/CD
39
+ - Code reviews for security issues
40
+ - Security training for developers
41
+ - Incident response procedures
@@ -0,0 +1,59 @@
1
+ ---
2
+ title: Testing Best Practices
3
+ inclusion: always
4
+ ---
5
+
6
+ # Testing Best Practices
7
+
8
+ ## Test Execution
9
+ - Always run tests with minimal verbosity to prevent session timeouts
10
+ - Use `--silent` or `--quiet` flags when available
11
+ - Filter tests with grep/pattern matching for focused testing
12
+ - Avoid running full test suites in automated contexts unless necessary
13
+
14
+ ## Common Test Commands
15
+ ```bash
16
+ # NPM/Yarn - Use silent mode
17
+ npm test -- --silent
18
+ yarn test --silent
19
+
20
+ # Jest - Minimal output
21
+ npm test -- --verbose=false --silent
22
+ npx jest --silent --passWithNoTests
23
+
24
+ # Pytest - Quiet mode
25
+ pytest -q
26
+ python -m pytest --tb=short -q
27
+
28
+ # Mocha - Minimal reporter
29
+ npx mocha --reporter min
30
+
31
+ # Filtering specific tests
32
+ npm test -- --grep "specific test"
33
+ npx jest --testNamePattern="specific test"
34
+ pytest -k "test_specific"
35
+ ```
36
+
37
+ ## Output Management
38
+ - Use summary reporters instead of verbose output
39
+ - Capture detailed logs only when tests fail
40
+ - Use `--bail` or `--maxfail=1` to stop on first failure
41
+ - Redirect verbose output to files when needed: `npm test > test-results.log 2>&1`
42
+
43
+ ## Test Organization
44
+ - Group related tests to enable selective running
45
+ - Use test tags/categories for filtering
46
+ - Keep test names descriptive but concise
47
+ - Separate unit, integration, and e2e tests
48
+
49
+ ## Performance
50
+ - Run tests in parallel when possible (`--parallel`, `--maxWorkers`)
51
+ - Use test caching mechanisms
52
+ - Mock external dependencies to speed up tests
53
+ - Skip slow tests in development with appropriate flags
54
+
55
+ ## CI/CD Considerations
56
+ - Use different verbosity levels for local vs CI environments
57
+ - Capture test artifacts (coverage, reports) separately from console output
58
+ - Use test result formatters that work well with CI systems
59
+ - Consider splitting large test suites across multiple jobs
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: TypeScript Best Practices
3
+ inclusion: always
4
+ ---
5
+
6
+ # TypeScript Best Practices
7
+
8
+ ## Code Style
9
+ - Use strict TypeScript configuration (`strict: true`)
10
+ - Prefer `const` over `let`, avoid `var`
11
+ - Use meaningful variable and function names
12
+ - Use PascalCase for classes and interfaces
13
+ - Use camelCase for variables and functions
14
+ - Use UPPER_SNAKE_CASE for constants
15
+
16
+ ## Type Safety
17
+ - Always define return types for functions
18
+ - Use union types instead of `any`
19
+ - Prefer interfaces over type aliases for object shapes
20
+ - Use generic types for reusable components
21
+ - Enable `noImplicitAny` and `strictNullChecks`
22
+
23
+ ## Error Handling
24
+ - Use Result/Either patterns for error handling
25
+ - Prefer throwing typed errors over generic Error
26
+ - Use optional chaining (`?.`) and nullish coalescing (`??`)
27
+
28
+ ## Imports/Exports
29
+ - Use named exports over default exports
30
+ - Group imports: external libraries first, then internal modules
31
+ - Use absolute imports with path mapping when possible
32
+
33
+ ## Testing
34
+ - Write unit tests for all public functions
35
+ - Use descriptive test names
36
+ - Mock external dependencies
37
+ - Aim for high test coverage (>80%)
38
+ - Run tests with minimal verbosity to avoid session timeouts
39
+ - Use grep/filter options to run specific tests when debugging
40
+ - Prefer `npm test -- --silent` or `yarn test --silent` for automated runs
package/CHANGELOG.md ADDED
@@ -0,0 +1,49 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Security
11
+ - Improved command execution security in CDK synthesis by using `shell: false` to prevent command injection vulnerabilities
12
+
13
+ ## [0.1.0] - 2024-12-10
14
+
15
+ ### Added
16
+ - Initial public release with core cost analysis functionality
17
+ - CONTRIBUTING.md with contribution guidelines
18
+ - SECURITY.md with security policy and vulnerability reporting
19
+ - GitHub issue templates for bug reports and feature requests
20
+ - Pull request template for standardized contributions
21
+ - Enhanced package metadata (homepage, bug tracker URLs)
22
+ - Support for multiple AWS resource types
23
+ - CloudFormation template parsing and comparison
24
+ - Cost estimation using AWS Pricing API
25
+ - CLI interface for local and CI/CD usage
26
+ - GitLab integration for merge request comments
27
+ - Configuration file support
28
+ - Threshold enforcement
29
+ - Multi-stack CDK application support
30
+ - Automatic CDK synthesis
31
+ - Pricing data caching
32
+ - Property-based testing for core components
33
+
34
+ ### Supported Resources
35
+ - AWS::Lambda::Function
36
+ - AWS::S3::Bucket
37
+ - AWS::DynamoDB::Table
38
+ - AWS::RDS::DBInstance
39
+ - AWS::EC2::Instance
40
+ - AWS::ECS::Service
41
+ - AWS::ApiGateway::RestApi
42
+ - AWS::EC2::NatGateway
43
+ - AWS::ElasticLoadBalancingV2::LoadBalancer (ALB/NLB)
44
+ - AWS::CloudFront::Distribution
45
+ - AWS::ElastiCache::CacheCluster
46
+ - AWS::EC2::VPCEndpoint
47
+
48
+ [Unreleased]: https://github.com/buildinginthecloud/cdk-cost-analyzer/compare/v0.1.0...HEAD
49
+ [0.1.0]: https://github.com/buildinginthecloud/cdk-cost-analyzer/releases/tag/v0.1.0