infernoflow 0.10.16 โ†’ 0.10.17

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 +52 -363
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,408 +1,97 @@
1
1
  # ๐Ÿ”ฅ infernoflow
2
-
3
2
  > The forge for liquid code โ€” keep capabilities, contracts, and docs in sync with your codebase.
4
3
 
5
4
  ## What it does
6
-
7
- infernoflow ensures that when your code changes, your **capability contracts** and **documentation** stay in sync. It prevents "semantic drift" โ€” where code evolves but no one knows what the system can actually do.
8
-
9
- ```
10
- inferno/
11
- โ”œโ”€โ”€ contract.json โ† what your system promises to do
12
- โ”œโ”€โ”€ capabilities.json โ† registry of each capability
13
- โ”œโ”€โ”€ scenarios/ โ† test scenarios covering each capability
14
- โ””โ”€โ”€ CHANGELOG.md โ† history of capability changes
15
- ```
5
+ infernoflow ensures that when your code changes, your **capability contracts** and **documentation** stay in sync. It prevents semantic drift โ€” where code evolves but no one knows what the system can actually do.
16
6
 
17
7
  ## Install
18
-
19
8
  ```bash
20
9
  npm install -g infernoflow
21
- # or use without installing:
10
+ # or:
22
11
  npx infernoflow init
23
12
  ```
24
13
 
25
14
  ## Quick Start
26
-
27
15
  ```bash
28
- # 1. Scaffold in your project root:
29
16
  npx infernoflow init
30
-
31
- # Optional: same as init, plus Cursor hooks that append each Agent reply
32
- # to inferno/CONTEXT.draft.md (gitignored). Promote with npm run inferno:promote-draft.
33
- npx infernoflow init --yes --cursor-hooks
34
-
35
- # Optional: VS Code + GitHub Copilot agent hooks (Preview) โ€” same draft file + promote flow
36
- npx infernoflow init --yes --vscode-copilot-hooks
37
-
38
- # Or add hooks to an existing infernoflow project:
39
- npx infernoflow install-cursor-hooks
40
- npx infernoflow install-vscode-copilot-hooks
41
-
42
- # 2. See your contract health:
17
+ npx infernoflow install-cursor-hooks # installs MCP server + .cursor/mcp.json
18
+ # Restart Cursor โ†’ Settings โ†’ MCP โ†’ infernoflow: 4 tools enabled
43
19
  infernoflow status
44
-
45
- # 3. When you add a feature, let AI update the docs:
46
- infernoflow suggest "added email notifications and user profiles"
47
-
48
- # 4. Validate everything:
20
+ infernoflow suggest "added email notifications"
49
21
  infernoflow check
50
-
51
- # 5. In CI / pre-push hook:
52
- infernoflow doc-gate
53
- ```
54
-
55
- ## Adopt Existing Project
56
-
57
- Use this when your project already has code and you want InfernoFlow to bootstrap from current behavior.
58
-
59
- ```bash
60
- # from existing project root
61
- infernoflow init --adopt
62
- ```
63
-
64
- Non-interactive adoption:
65
-
66
- ```bash
67
- infernoflow init --adopt --yes
68
- ```
69
-
70
- Override detected stack during adoption:
71
-
72
- ```bash
73
- infernoflow init --adopt --lang ts --framework angular --project-type frontend
74
- ```
75
-
76
- C# / ASP.NET example:
77
-
78
- ```bash
79
- infernoflow init --adopt --lang cs --framework aspnet --project-type backend --report-human-only
80
- ```
81
-
82
- JSON report for CI/logging:
83
-
84
- ```bash
85
- infernoflow init --adopt --yes --report-json
86
22
  ```
87
23
 
88
- JSON-only output (clean machine output, no text logs):
24
+ ## Cursor MCP Integration (recommended)
89
25
 
90
- ```bash
91
- infernoflow init --adopt --yes --report-json-only
92
- ```
93
-
94
- Human-only output (visual report only, no JSON block):
26
+ After running `install-cursor-hooks`, infernoflow registers as an MCP server inside Cursor. No copy/paste โ€” Cursor calls infernoflow tools directly in chat.
95
27
 
28
+ ### Setup
96
29
  ```bash
97
- infernoflow init --adopt --yes --report-human-only
30
+ infernoflow install-cursor-hooks
31
+ # Restart Cursor
32
+ # Settings โ†’ MCP โ†’ infernoflow: 4 tools enabled
98
33
  ```
99
34
 
100
- What adoption creates:
101
- - `inferno/contract.json` (inferred capability baseline)
102
- - `inferno/capabilities.json` (inferred registry)
103
- - `inferno/scenarios/adoption_baseline.json` (coverage baseline)
104
- - `inferno/adoption_profile.json` (detected components, display fields, external libraries, UI layout, styling hints)
105
- - `inferno/adoption_profile.json` (detected components, display fields, external libraries, UI layout, styling hints, API call map)
106
- - `inferno/context-state.json` (saved development profile: language/framework/project type)
107
- - `inferno/CHANGELOG.md` (adoption entry)
108
-
109
- Safety:
110
- - Existing `inferno/` is not overwritten unless `--force` is provided.
111
- - Adoption prints an inferred capability report with source-file hints and confidence.
112
-
113
- ## Recommended Workflow
114
-
115
- ```bash
116
- # start a feature
117
- infernoflow context --intent "add search to tasks" --working "frontend search UX"
118
-
119
- # generate implementation prompt(s) for coding agent
120
- infernoflow implement "add server-side task search endpoint" --mode both
121
-
122
- # build code changes
123
-
124
- # sync inferno contract with AI assistance
125
- infernoflow suggest "added task search by title and due date"
126
-
127
- # verify no drift
128
- infernoflow status
129
- infernoflow check
130
- ```
131
-
132
- ## Team SOP (Developer Workflow)
133
-
134
- Use this checklist for every feature branch:
35
+ ### MCP tools
135
36
 
136
- 1) **Set intent**
137
- ```bash
138
- infernoflow context --intent "what feature is being built" --working "current slice"
139
- ```
140
-
141
- 2) **Build code**
142
- - Implement UI/API/tests as usual.
37
+ | Tool | What it does |
38
+ |---|---|
39
+ | `infernoflow_run` | Generates a task prompt from your contract |
40
+ | `infernoflow_apply` | Applies the JSON response โ€” updates contract + CHANGELOG |
41
+ | `infernoflow_check` | Validates contract sync |
42
+ | `infernoflow_status` | Shows contract health |
143
43
 
144
- 3) **Sync contract with `suggest`**
145
- ```bash
146
- infernoflow suggest "plain-language description of what changed"
44
+ ### Workflow in Cursor chat
147
45
  ```
148
- - Paste generated prompt into your AI.
149
- - Paste AI JSON back into terminal.
150
- - Approve with `y` only after preview looks correct.
151
-
152
- 4) **Validate before commit**
153
- ```bash
154
- infernoflow status
155
- infernoflow check
46
+ You: Use infernoflow_run with task "add search functionality"
47
+ Cursor: [calls infernoflow_run โ†’ returns prompt]
48
+ Cursor: [generates JSON]
49
+ Cursor: [calls infernoflow_apply]
50
+ โ†’ contract.json, capabilities.json, CHANGELOG.md updated + validated
156
51
  ```
157
52
 
158
- 5) **CI-safe checks**
53
+ ### Terminal fallback (without MCP)
159
54
  ```bash
160
- infernoflow status --json
161
- infernoflow check --json
162
- infernoflow doc-gate --json
55
+ infernoflow run "add search functionality"
56
+ # writes inferno/agent-prompt.md and waits
57
+ # paste prompt into Cursor/Claude โ†’ save JSON to inferno/agent-response.json
58
+ # infernoflow picks it up and applies automatically
163
59
  ```
164
60
 
165
- 6) **Definition of done**
166
- - Capability changes are reflected in `inferno/contract.json`.
167
- - New/changed capabilities exist in `inferno/capabilities.json`.
168
- - Scenario coverage updated under `inferno/scenarios/`.
169
- - `inferno/CHANGELOG.md` updated under `## Unreleased`.
170
- - `infernoflow check` passes.
171
-
172
61
  ## Commands
173
62
 
174
63
  | Command | Description |
175
64
  |---|---|
176
- | `infernoflow init` | Interactive scaffold โ€” creates `inferno/` in your project |
177
- | `infernoflow status` | At-a-glance health of your contract |
178
- | `infernoflow suggest` | Generate an AI prompt, apply capability updates |
179
- | `infernoflow implement` | Generate implementation prompts for coding agents |
180
- | `infernoflow run` | One-command local-model flow with validation and rollback |
181
- | `infernoflow pr-impact` | Analyze changed files and infer capability/doc drift |
182
- | `infernoflow sync --auto` | Deterministic sync flow for agents (skeleton) |
183
- | `infernoflow check` | Full validation: contract, capabilities, scenarios, changelog |
184
- | `infernoflow doc-gate` | Fails if code changed but docs weren't updated |
185
- | `infernoflow context` | Build/persist AI session context for this project |
186
- | `infernoflow install-cursor-hooks` | Install `.cursor/hooks` + `scripts/inferno-promote-draft.mjs` (Agent โ†’ draft โ†’ promote) |
187
- | `infernoflow install-vscode-copilot-hooks` | Install `.github/hooks` for VS Code + Copilot (Preview) + same promote script |
188
-
189
- ### Cursor hooks (draft โ†’ promote)
190
-
191
- [Cursor hooks](https://cursor.com/docs/agent/hooks) can run a small Node script after each assistant message. infernoflow can install:
192
-
193
- - **`.cursor/hooks.json`** โ€” `afterAgentResponse` and `stop` events
194
- - **`.cursor/hooks/inferno-session-draft.mjs`** โ€” appends assistant `text` to **`inferno/CONTEXT.draft.md`** (never overwrites `CONTEXT.md` automatically)
195
- - **`scripts/inferno-promote-draft.mjs`** + **`npm run inferno:promote-draft`** โ€” preview, `--append-notes` (merge under `## Decisions & notes` in `inferno/CONTEXT.md`), or `--clear`
196
- - **`.gitignore`** entry for `inferno/CONTEXT.draft.md` when possible
197
-
198
- Install with **`infernoflow install-cursor-hooks`** or **`infernoflow init --cursor-hooks`**. Restart Cursor after install. Review the draft before promoting; treat chat as **input**, not product truth.
199
-
200
- ### VS Code + GitHub Copilot hooks (draft โ†’ promote, Preview)
201
-
202
- VS Code can run [Agent hooks](https://code.visualstudio.com/docs/copilot/customization/hooks) from **`.github/hooks/*.json`**. infernoflow installs:
203
-
204
- - **`.github/hooks/infernoflow-drafts.json`** โ€” wires **`UserPromptSubmit`** (your prompt) and **`Stop`** (end of agent turn)
205
- - **`scripts/inferno-vscode-copilot-hook.mjs`** โ€” appends the user prompt on submit; on **Stop**, reads **`transcript_path`** from stdin (when present), parses **JSONL** or session **JSON**, and appends the **last assistant text** it can infer (format varies by VS Code / Copilot version โ€” if parsing fails, a short marker is still appended)
206
- - The same **`inferno:promote-draft`** script and **`.gitignore`** entry for **`inferno/CONTEXT.draft.md`** as the Cursor flow
207
-
208
- Install with **`infernoflow install-vscode-copilot-hooks`** or **`infernoflow init --vscode-copilot-hooks`**. Restart VS Code, confirm your org allows hooks, and use the **GitHub Copilot Chat Hooks** output channel for diagnostics.
209
-
210
- **Limitations:** Hooks are **Preview**; `transcript_path` / JSONL shape may differ by build; some hook events omit `transcript_path` ([vscode#300583](https://github.com/microsoft/vscode/issues/300583)). You still have the full **`infernoflow`** CLI in the terminal when hooks are not enough.
211
-
212
- ### Options
213
-
214
- ```bash
215
- infernoflow init --force # overwrite existing files
216
- infernoflow init --cursor-hooks # with init: install Cursor draft hooks (see above)
217
- infernoflow init --vscode-copilot-hooks # with init: install VS Code + Copilot draft hooks (Preview)
218
- infernoflow init --yes # skip prompts, use defaults
219
- infernoflow init --adopt # infer baseline from existing project
220
- infernoflow init --adopt --lang ts --framework react --project-type frontend
221
- infernoflow init --adopt --report-human-only
222
- infernoflow suggest "..." # describe what changed
223
- infernoflow implement "..." --mode both
224
- infernoflow implement "..." --mode cursor
225
- infernoflow implement "..." --mode generic
226
- infernoflow implement "..." --mode both --copy
227
- infernoflow run "add favorite badge to tasks"
228
- infernoflow run "sync check" --dry-run
229
- infernoflow run "sync check" --json
230
- infernoflow pr-impact
231
- infernoflow pr-impact --json
232
- infernoflow sync --auto
233
- infernoflow sync --auto --json
234
- npm run inferno:hooks # install local git hooks (after init)
235
- infernoflow install-cursor-hooks --force # overwrite hook files if present
236
- infernoflow install-vscode-copilot-hooks --force
237
- infernoflow check --json # machine-readable output for CI
238
- infernoflow check --skip-doc-gate
239
- infernoflow status --json # machine-readable status summary
240
- infernoflow doc-gate --json # machine-readable doc-gate result
241
- ```
242
-
243
- ## `infernoflow suggest` โ€” AI-powered updates
244
-
245
- When you add a feature, just describe it in plain language. infernoflow generates a prompt you can paste into **any AI** (Claude, ChatGPT, Copilot, Cursor, etc.), then applies the suggested changes automatically.
246
-
247
- ```bash
248
- infernoflow suggest "added payment processing and invoice generation"
249
- ```
250
-
251
- **What happens:**
252
- 1. infernoflow reads your current contract state
253
- 2. Generates a structured prompt with full context
254
- 3. You paste it into your AI of choice
255
- 4. Paste the JSON response back
256
- 5. infernoflow previews the changes and asks for confirmation
257
- 6. On approval โ€” updates `contract.json`, `capabilities.json`, `scenarios/`, and `CHANGELOG.md`
258
-
259
- **Example output:**
260
- ```
261
- Proposed Changes
262
-
263
- Summary: Added payment processing and invoice generation functionality.
264
-
265
- + New capabilities:
266
- ProcessPayment โ€” Process Payment
267
- GenerateInvoice โ€” Generate Invoice
268
-
269
- ~ Scenario updates:
270
- [update] happy_path.json
271
-
272
- ๐Ÿ“ Changelog: - Add payment processing and invoice generation capabilities.
273
-
274
- Apply these changes? (y/n)
275
- ```
276
-
277
- Works with any AI โ€” Claude, ChatGPT, GitHub Copilot, Cursor, or your own setup.
278
-
279
- ## `infernoflow run` โ€” zero copy/paste flow
280
-
281
- Run one command and infernoflow will:
282
- 1. Detect drift (`pr-impact`)
283
- 2. Resolve provider (`auto` defaults to IDE agent)
284
- 3. Generate suggestion
285
- 4. Apply inferno updates
286
- 5. Validate with `check`
287
- 6. Roll back automatically if validation fails
288
-
289
- ```bash
290
- infernoflow run "add favorite badge to tasks and filter by favorite"
291
- ```
292
-
293
- Machine mode:
294
-
295
- ```bash
296
- infernoflow run "sync check" --json
297
- ```
298
-
299
- Provider options:
300
-
301
- ```bash
302
- infernoflow run "task" --provider auto # default (IDE agent first)
303
- infernoflow run "task" --provider agent --ide cursor # require IDE agent
304
- infernoflow run "task" --provider local # explicit local model
305
- infernoflow run "task" --provider prompt # deterministic prompt fallback
306
- ```
307
-
308
- IDE routing behavior:
309
- - `auto` + agent available -> uses IDE agent
310
- - `auto` + no agent -> falls back to prompt mode (`FALLBACK_PROMPT_MODE`)
311
- - `agent` + no agent -> exits with `EXPLICIT_AGENT_REQUIRED`
312
-
313
- Local model configuration (optional):
314
-
315
- ```bash
316
- # local provider example: ollama
317
- set INFERNO_LOCAL_PROVIDER=ollama
318
- set INFERNO_LOCAL_ENDPOINT=http://127.0.0.1:11434/api/generate
319
- set INFERNO_LOCAL_MODEL=llama3.1:8b
320
- ```
321
-
322
- Optional OpenAI-compatible local server:
323
-
324
- ```bash
325
- set INFERNO_LOCAL_PROVIDER=openai
326
- set INFERNO_LOCAL_ENDPOINT=http://127.0.0.1:1234/v1/chat/completions
327
- set INFERNO_LOCAL_MODEL=local-model
328
- set INFERNO_LOCAL_API_KEY=local
329
- ```
330
-
331
- ## `infernoflow implement` โ€” code-agent execution prompts
332
-
333
- Generate coding prompts from your project context and inferno contract:
334
-
335
- ```bash
336
- infernoflow implement "add pagination to tasks" --mode both
337
- ```
338
-
339
- Modes:
340
- - `--mode cursor`: Cursor-specific coding prompt
341
- - `--mode generic`: generic prompt for any coding agent
342
- - `--mode both`: print both sections (default)
343
- - `--copy`: copy selected prompt output to clipboard
344
-
345
- Recommended chain:
346
- 1) `infernoflow context --intent "..."`
347
- 2) `infernoflow implement "..."`
348
- 3) run the coding agent and apply code changes
349
- 4) `infernoflow suggest "..."`
350
- 5) `infernoflow check`
351
-
352
- ## Troubleshooting
353
-
354
- - `Unknown command: suggest`:
355
- - Run `infernoflow --help` and confirm `suggest` appears.
356
- - If using `npx`, force a specific version: `npx infernoflow@latest --help`.
357
- - `infernoflow: command not found`:
358
- - Use `npx infernoflow ...` or install globally: `npm install -g infernoflow`.
359
- - `npm publish` fails with existing version:
360
- - Bump version first (`npm version patch|minor|major`) then publish.
361
- - `status` or `check` fails due to missing inferno files:
362
- - Run `infernoflow init` at project root.
363
- - Windows/Git Bash path confusion:
364
- - Prefer `node bin/infernoflow.mjs --help` from package root for local debugging.
365
-
366
- ## Why infernoflow?
367
-
368
- **The problem:** AI-assisted development moves fast. Code changes daily. But what does the system *actually do*? What changed? What's covered?
369
-
370
- **The metaphor:** A forge (ื›ื™ื‘ืฉืŸ). Metal becomes liquid โ€” flexible, shapeable. The forge is the controlled environment where that change happens safely, with molds (contracts) and tempering (validation).
371
-
372
- **The principle:** Liquid where you want flexibility. Solid where you need safety.
65
+ | `infernoflow init` | Scaffold inferno/ in your project |
66
+ | `infernoflow install-cursor-hooks` | MCP server + hooks + .cursor/mcp.json |
67
+ | `infernoflow install-vscode-copilot-hooks` | VS Code + Copilot hooks (Preview) |
68
+ | `infernoflow status` | Contract health at a glance |
69
+ | `infernoflow check` | Full validation |
70
+ | `infernoflow suggest` | AI-powered contract update |
71
+ | `infernoflow run` | One-command flow with rollback |
72
+ | `infernoflow implement` | Generate coding agent prompts |
73
+ | `infernoflow context` | Build AI session context |
74
+ | `infernoflow doc-gate` | Fail if docs not updated |
75
+ | `infernoflow pr-impact` | Analyze PR capability drift |
373
76
 
374
77
  ## CI Integration
375
-
376
78
  ```yaml
377
- # .github/workflows/ci.yml
378
- - name: infernoflow run (headless)
379
- run: npx infernoflow run "sync check" --provider prompt --json
380
- env:
381
- BASE_SHA: ${{ github.event.pull_request.base.sha }}
382
- HEAD_SHA: ${{ github.event.pull_request.head.sha }}
79
+ - name: infernoflow check
80
+ run: npx infernoflow check --json
81
+ - name: infernoflow doc-gate
82
+ run: npx infernoflow doc-gate --json
383
83
  ```
384
84
 
385
- When you run `infernoflow init`, it now scaffolds:
386
- - `scripts/inferno-install-hooks.mjs`
387
- - `.github/workflows/infernoflow-check.yml`
388
-
389
- Install local hooks once per clone:
390
-
391
- ```bash
392
- npm run inferno:hooks
393
- ```
85
+ ## Troubleshooting
394
86
 
395
- ## Release Checklist
87
+ - **MCP not showing in Cursor** โ€” restart Cursor completely after install-cursor-hooks
88
+ - `ide_agent_bridge_not_configured` โ€” use MCP tools in Cursor chat instead
89
+ - **infernoflow not found** โ€” use `npx infernoflow` or install globally
90
+ - **PowerShell scripts disabled** โ€” run `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass`
396
91
 
397
- ```bash
398
- npm test
399
- npm pack --dry-run
400
- node bin/infernoflow.mjs --help
401
- node bin/infernoflow.mjs check --help
402
- ```
92
+ ## Why infernoflow?
403
93
 
404
- Then bump version and publish.
94
+ AI-assisted development moves fast. Code changes daily. But what does the system *actually do*? infernoflow keeps the answer current โ€” automatically.
405
95
 
406
96
  ## License
407
-
408
- MIT
97
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infernoflow",
3
- "version": "0.10.16",
3
+ "version": "0.10.17",
4
4
  "description": "The forge for liquid code รขโ‚ฌโ€ keep capabilities, contracts, and docs in sync.",
5
5
  "type": "module",
6
6
  "bin": {