infrawise 0.2.1 → 0.2.2

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 (2) hide show
  1. package/README.md +73 -94
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -7,27 +7,37 @@
7
7
 
8
8
  **Understand your infrastructure, not just your code.**
9
9
 
10
- Infrawise is a CLI tool that scans your TypeScript codebase, maps every function-to-database relationship into a graph, detects anti-patterns (full table scans, missing indexes, hot partitions, N+1 queries), and exposes all of it as an MCP server — so AI coding assistants like Claude Code have live, deterministic knowledge of your infrastructure when helping you write database code.
10
+ Infrawise gives AI coding assistants deterministic infrastructure awareness.
11
+
12
+ It statically analyzes your codebase, cloud infrastructure, and database schemas, then exposes that context through MCP so tools like Claude Code can understand your actual tables, indexes, query patterns, and service relationships instead of guessing from source files alone.
11
13
 
12
14
  ---
13
15
 
14
16
  ## Why this exists
15
17
 
16
- When AI coding assistants help you write database queries, they read your source files but have no knowledge of your actual infrastructure. They don't know your DynamoDB partition keys, which GSIs exist, or which functions are already doing expensive scans. They guess.
18
+ AI coding assistants can read your source files but have no deterministic knowledge of your infrastructure. They do not know which GSIs exist, how tables are partitioned, which functions already trigger scans, or where indexes are missing. So they guess.
17
19
 
18
- Infrawise fixes that. It runs a static analysis of your repo, builds an infrastructure graph, and starts a local MCP server. Claude Code can then call tools like `get_graph_summary`, `analyze_function`, and `suggest_gsi` in real time — giving it exact knowledge of your schema and access patterns before writing a single line of database code.
20
+ Infrawise replaces guessing with infrastructure-aware context.
19
21
 
20
- **Without Infrawise**, Claude might:
22
+ **Without Infrawise**, an AI assistant might:
21
23
  - Suggest a `.scan()` on your Orders table that has 50M rows
22
24
  - Recommend adding a GSI on `status` that you already have
23
25
  - Write a `SELECT *` when you need to keep query cost low
24
26
  - Not notice that 5 functions are already hammering the same partition key
25
27
 
26
- **With Infrawise**, Claude knows:
28
+ **With Infrawise**, it knows:
27
29
  - Your exact table schemas, partition keys, sort keys, and GSIs
28
30
  - Which functions query which tables and how
29
- - Which patterns are already flagged as high severity in your codebase
30
- - The exact `CREATE INDEX` SQL or GSI config for your specific tables — not generic advice
31
+ - Which patterns are already flagged as high severity
32
+ - The exact `CREATE INDEX` SQL or GSI config for your tables — not generic advice
33
+
34
+ ---
35
+
36
+ ## What Infrawise is not
37
+
38
+ Infrawise is not an AI agent framework, an infrastructure provisioning tool, an observability platform, or a cloud management dashboard.
39
+
40
+ It is a deterministic infrastructure intelligence layer for AI-assisted development.
31
41
 
32
42
  ---
33
43
 
@@ -56,14 +66,6 @@ infrawise init
56
66
 
57
67
  Detects your AWS profile and region, asks a few questions, writes `infrawise.yaml`. That's the only file it creates in your project.
58
68
 
59
- ```
60
- ✔ Detected repository: payments-service
61
- ✔ Repository type: typescript
62
- ✔ AWS profile: default
63
- ✔ Found DynamoDB tables: Orders, Users, Sessions
64
- ✔ Created infrawise.yaml
65
- ```
66
-
67
69
  **2. Validate everything is connected**
68
70
 
69
71
  ```bash
@@ -93,9 +95,7 @@ Findings (3 total)
93
95
 
94
96
  ---
95
97
 
96
- ## Using with Claude Code
97
-
98
- This is where Infrawise becomes most useful. Once wired up, Claude Code has live access to your infrastructure graph — it stops guessing and starts knowing.
98
+ ## Using with AI coding assistants
99
99
 
100
100
  ### Step 1: Start the MCP server
101
101
 
@@ -111,9 +111,9 @@ MCP endpoint: http://localhost:3000/mcp
111
111
  Available tools: http://localhost:3000/mcp/tools
112
112
  ```
113
113
 
114
- ### Step 2: Add to Claude Code settings
114
+ ### Step 2: Add to your editor settings
115
115
 
116
- Edit `.claude/settings.json` in your repo (project-level) or `~/.claude/settings.json` (global):
116
+ **Claude Code** — edit `.claude/settings.json` in your repo (project-level) or `~/.claude/settings.json` (global):
117
117
 
118
118
  ```json
119
119
  {
@@ -125,9 +125,7 @@ Edit `.claude/settings.json` in your repo (project-level) or `~/.claude/settings
125
125
  }
126
126
  ```
127
127
 
128
- Restart Claude Code. The tools are now available in every conversation.
129
-
130
- Alternatively, let Claude Code manage the server lifecycle automatically:
128
+ To let Claude Code manage the server lifecycle automatically:
131
129
 
132
130
  ```json
133
131
  {
@@ -140,11 +138,11 @@ Alternatively, let Claude Code manage the server lifecycle automatically:
140
138
  }
141
139
  ```
142
140
 
143
- ### Step 3: What Claude can now do
141
+ **Cursor** and **Windsurf** — add `http://localhost:3000/mcp` as an MCP server in editor settings.
144
142
 
145
- Claude gains 13 tools it calls silently while helping you:
143
+ ### MCP tools
146
144
 
147
- | Tool | What it gives Claude |
145
+ | Tool | What it provides |
148
146
  |---|---|
149
147
  | `get_infra_overview` | Complete snapshot — all services, counts, and high-severity findings |
150
148
  | `get_graph_summary` | Full infrastructure graph — all nodes, edges, and findings |
@@ -160,24 +158,6 @@ Claude gains 13 tools it calls silently while helping you:
160
158
  | `get_lambda_overview` | Lambda functions — runtime, memory, timeout, env var key names |
161
159
  | `get_log_errors` | CloudWatch error patterns and counts (no raw log messages) |
162
160
 
163
- ### What changes in practice
164
-
165
- **Before Infrawise:**
166
- > You: "Write a function to get all orders by userId"
167
- > Claude: *writes a DynamoDB `.scan()` filtered client-side — no schema context*
168
-
169
- **After Infrawise:**
170
- > You: "Write a function to get all orders by userId"
171
- > Claude: *calls `get_graph_summary` → sees Orders has a `userId-index` GSI → writes a `.query()` against the GSI → notes `listAllOrders()` already does a full scan and flags it proactively*
172
-
173
- ### Using with other AI editors
174
-
175
- Infrawise works with any editor or tool that supports MCP or can call an HTTP API:
176
-
177
- - **Cursor** — add `http://localhost:3000/mcp` as an MCP server in Cursor settings
178
- - **Windsurf** — same, via MCP server configuration
179
- - **Any Claude API project** — call the endpoint directly from your own tooling
180
-
181
161
  ---
182
162
 
183
163
  ## CLI reference
@@ -290,13 +270,13 @@ For Amazon RDS: allow inbound on port 5432 from your machine's IP in the securit
290
270
 
291
271
  ---
292
272
 
293
- ## Language support
273
+ ## Analysis capabilities
294
274
 
295
- Infrawise has two analysis layers with different language requirements:
275
+ Infrawise has two analysis layers:
296
276
 
297
- ### Infrastructure-level analysis any project, any language
277
+ ### Infrastructure analysis (all languages)
298
278
 
299
- The following analyzers work purely from infrastructure metadata (AWS APIs, database schema introspection, IaC files). They have no dependency on your application code or language:
279
+ Works from AWS APIs, database schema introspection, and IaC files no dependency on application code:
300
280
 
301
281
  | Service | What it checks |
302
282
  |---|---|
@@ -310,9 +290,9 @@ The following analyzers work purely from infrastructure metadata (AWS APIs, data
310
290
  | CloudWatch Logs | Log groups with no retention policy |
311
291
  | Terraform / CloudFormation / CDK | IaC drift vs deployed state |
312
292
 
313
- ### Code-level analysis TypeScript and JavaScript only
293
+ ### Code correlation analysis (TypeScript / JavaScript)
314
294
 
315
- The repository scanner uses [ts-morph](https://ts-morph.com/) for static AST analysis. It detects which functions call which tables and how, enabling pattern detection that requires correlating code with infrastructure:
295
+ Uses [ts-morph](https://ts-morph.com/) AST analysis to detect which functions call which tables and how:
316
296
 
317
297
  | Analyzer | Severity | What it detects |
318
298
  |---|---|---|
@@ -327,15 +307,25 @@ The repository scanner uses [ts-morph](https://ts-morph.com/) for static AST ana
327
307
  | Missing Mongo Index | Medium | Collections queried without secondary indexes |
328
308
  | Collection Scan | High | `find()` calls without filter predicates |
329
309
 
330
- **Non-TypeScript/JavaScript projects** still get full value from all infrastructure-level analyzers. The code correlation layer (which functions hit which tables, N+1 patterns) is skipped — run `infrawise analyze` and it will report 0 code operations while still surfacing all schema, configuration, and IaC findings.
310
+ Non-TypeScript/JavaScript projects still get full value from infrastructure-level analyzers code correlation (function-to-table mapping, N+1 patterns) is skipped.
331
311
 
332
- The scanner detects these patterns in TypeScript and JavaScript files:
312
+ The scanner supports: AWS SDK v3/v2 for DynamoDB, `pg`/Prisma/Knex for PostgreSQL, `mysql2`/Knex for MySQL, driver/Mongoose for MongoDB, and AWS SDK v3 for SQS/SNS/SSM/Secrets/Lambda.
313
+
314
+ ---
333
315
 
334
- - **DynamoDB** AWS SDK v3 (`client.send(new QueryCommand(...))`) and v2-style (`dynamoDb.scan(...)`)
335
- - **PostgreSQL** — `pg` pool/client queries, Prisma, Knex
336
- - **MySQL** `mysql2` connection/pool queries, Knex with MySQL dialect
337
- - **MongoDB** driver `collection.find/findOne/aggregate`, Mongoose models
338
- - **SQS / SNS / SSM / Secrets / Lambda** — AWS SDK v3 command pattern
316
+ ## How it works
317
+
318
+ 1. Infrawise scans your repository and infrastructure metadata
319
+ 2. A graph engine maps services, schemas, indexes, and query patterns
320
+ 3. Rule-based analyzers detect infrastructure and query anti-patterns
321
+ 4. The resulting context is exposed through MCP
322
+ 5. AI coding assistants query this context while generating code
323
+
324
+ ---
325
+
326
+ ## Deterministic analysis
327
+
328
+ Infrawise does not use an LLM to analyze your infrastructure. All extraction and analysis are deterministic: AST parsing, schema introspection, rule-based analyzers, and graph correlation. LLMs are only consumers of the generated context through MCP.
339
329
 
340
330
  ---
341
331
 
@@ -348,7 +338,7 @@ The scanner detects these patterns in TypeScript and JavaScript files:
348
338
 
349
339
  ---
350
340
 
351
- ## Architecture
341
+ ## Architecture overview
352
342
 
353
343
  ```
354
344
  Your repo (any language) Your repo (TS/JS only)
@@ -375,8 +365,6 @@ Your repo (any language) Your repo (TS/JS only)
375
365
  └──────────────────┘ ◄── Windsurf
376
366
  ```
377
367
 
378
- The analysis is entirely deterministic — no LLM is involved in extracting or analyzing your infrastructure. AI is only at the consumption layer.
379
-
380
368
  ### Source layout
381
369
 
382
370
  ```
@@ -394,15 +382,28 @@ src/
394
382
 
395
383
  ---
396
384
 
385
+ ## Current limitations
386
+
387
+ - Code-level correlation supports TypeScript and JavaScript only
388
+ - Dynamically constructed queries may not always be resolved statically
389
+ - Runtime tracing is not yet implemented
390
+ - Large monorepos may require future incremental analysis optimization
391
+
392
+ ---
393
+
397
394
  ## Roadmap
398
395
 
399
- - [x] MySQL adapter
400
- - [x] MongoDB adapter
401
- - [x] Terraform / CloudFormation schema correlation
402
- - [ ] Latency tracing integration
403
- - [ ] VS Code extension
404
- - [ ] Kubernetes workload graph
405
- - [ ] Infra drift detection
396
+ ### Planned
397
+ - Runtime tracing integration
398
+ - Incremental analysis for large monorepos
399
+ - Kubernetes workload graphing
400
+ - VS Code extension
401
+ - Infrastructure drift detection
402
+
403
+ ### Under consideration
404
+ - OpenTelemetry integration
405
+ - CI/CD reporting mode
406
+ - Multi-repository graph correlation
406
407
 
407
408
  ---
408
409
 
@@ -410,16 +411,7 @@ src/
410
411
 
411
412
  ### Prerequisites
412
413
 
413
- | Requirement | Version |
414
- |---|---|
415
- | Node.js | 24+ |
416
- | pnpm | 9+ |
417
- | AWS CLI | any (for integration testing) |
418
-
419
- ```bash
420
- # Install pnpm if you don't have it
421
- npm install -g pnpm
422
- ```
414
+ Node.js 24+, pnpm 9+, AWS CLI (for integration testing).
423
415
 
424
416
  ### Setup
425
417
 
@@ -433,19 +425,12 @@ pnpm build
433
425
  ### Development workflow
434
426
 
435
427
  ```bash
436
- pnpm build # build all packages
428
+ pnpm build # compile
437
429
  pnpm test # run all tests
438
430
  pnpm typecheck # TypeScript strict check
439
431
  pnpm lint # ESLint
440
432
  ```
441
433
 
442
- Tests live in `src/**/__tests__/`:
443
- - `src/core/__tests__/` — config validation, cache
444
- - `src/graph/__tests__/` — graph builder
445
- - `src/analyzers/__tests__/` — all analyzers
446
- - `src/server/__tests__/` — MCP server (Fastify inject, all 13 tools)
447
- - `src/context/__tests__/` — repository scanner
448
-
449
434
  ### Adding a new analyzer
450
435
 
451
436
  1. Create your analyzer in `src/analyzers/`
@@ -468,7 +453,7 @@ export class MyAnalyzer implements Analyzer {
468
453
 
469
454
  ### Releasing
470
455
 
471
- The git tag is the source of truth. The version in root `package.json` and the tag must always match — the release script does both atomically.
456
+ The git tag is the source of truth. The version in root `package.json` and the tag must always match.
472
457
 
473
458
  ```bash
474
459
  pnpm release patch # 0.1.2 → 0.1.3 (bug fixes)
@@ -479,17 +464,11 @@ pnpm release 1.5.0 # explicit version
479
464
  git push origin main --tags
480
465
  ```
481
466
 
482
- **What happens after push:**
483
-
484
- 1. `release.yml` fires on the `v*.*.*` tag → creates a **draft** GitHub release with auto-generated notes
485
- 2. Review the draft on GitHub → click **Publish release**
486
- 3. `npm-publish.yml` fires on publish → reads the version from the tag, stamps it onto `package.json`, builds, and publishes to npm
487
-
488
- The CLI reads its version from root `package.json` at runtime, so `infrawise --version` always matches the installed package.
467
+ Pushing a `v*.*.*` tag creates a draft GitHub release. Publishing that release triggers npm publish automatically.
489
468
 
490
469
  ### PR checklist
491
470
 
492
- - `pnpm lint` passes (no errors)
471
+ - `pnpm lint` passes
493
472
  - `pnpm typecheck` passes
494
473
  - `pnpm test` passes
495
474
  - New analyzers have unit tests with mock graph data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infrawise",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "CLI-first infrastructure intelligence platform — analyzes DynamoDB, PostgreSQL, MySQL, MongoDB, SQS, SNS, SSM, Secrets Manager, Lambda, CloudWatch Logs and exposes findings as an MCP server for Claude Code",
5
5
  "keywords": [
6
6
  "infrastructure",