infernoflow 0.33.0 → 0.34.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.
- package/README.md +208 -120
- package/dist/bin/infernoflow.mjs +271 -85
- package/dist/lib/adopters/angular.mjs +128 -1
- package/dist/lib/adopters/css.mjs +111 -1
- package/dist/lib/adopters/react.mjs +104 -1
- package/dist/lib/ai/ideDetection.mjs +31 -1
- package/dist/lib/ai/localProvider.mjs +88 -1
- package/dist/lib/ai/providerRouter.mjs +295 -2
- package/dist/lib/commands/adopt.mjs +869 -20
- package/dist/lib/commands/adoptWizard.mjs +320 -9
- package/dist/lib/commands/agent.mjs +191 -5
- package/dist/lib/commands/ai.mjs +407 -2
- package/dist/lib/commands/ask.mjs +299 -0
- package/dist/lib/commands/audit.mjs +300 -13
- package/dist/lib/commands/changelog.mjs +594 -26
- package/dist/lib/commands/check.mjs +184 -3
- package/dist/lib/commands/ci.mjs +208 -3
- package/dist/lib/commands/claudeMd.mjs +139 -28
- package/dist/lib/commands/cloud.mjs +521 -5
- package/dist/lib/commands/context.mjs +346 -34
- package/dist/lib/commands/coverage.mjs +282 -2
- package/dist/lib/commands/dashboard.mjs +635 -123
- package/dist/lib/commands/demo.mjs +465 -8
- package/dist/lib/commands/diff.mjs +274 -5
- package/dist/lib/commands/docGate.mjs +81 -2
- package/dist/lib/commands/doctor.mjs +321 -3
- package/dist/lib/commands/explain.mjs +438 -8
- package/dist/lib/commands/export.mjs +239 -10
- package/dist/lib/commands/generateSkills.mjs +163 -38
- package/dist/lib/commands/graph.mjs +378 -11
- package/dist/lib/commands/health.mjs +309 -2
- package/dist/lib/commands/impact.mjs +325 -2
- package/dist/lib/commands/implement.mjs +103 -7
- package/dist/lib/commands/init.mjs +545 -23
- package/dist/lib/commands/installCursorHooks.mjs +36 -1
- package/dist/lib/commands/installVsCodeCopilotHooks.mjs +37 -1
- package/dist/lib/commands/link.mjs +342 -2
- package/dist/lib/commands/log.mjs +164 -16
- package/dist/lib/commands/monorepo.mjs +428 -4
- package/dist/lib/commands/notify.mjs +258 -4
- package/dist/lib/commands/onboard.mjs +296 -4
- package/dist/lib/commands/prComment.mjs +361 -2
- package/dist/lib/commands/prImpact.mjs +157 -2
- package/dist/lib/commands/publish.mjs +316 -15
- package/dist/lib/commands/recap.mjs +359 -0
- package/dist/lib/commands/report.mjs +272 -28
- package/dist/lib/commands/review.mjs +223 -9
- package/dist/lib/commands/run.mjs +336 -8
- package/dist/lib/commands/scaffold.mjs +419 -54
- package/dist/lib/commands/scan.mjs +1118 -5
- package/dist/lib/commands/scout.mjs +291 -2
- package/dist/lib/commands/setup.mjs +310 -5
- package/dist/lib/commands/share.mjs +196 -13
- package/dist/lib/commands/snapshot.mjs +383 -3
- package/dist/lib/commands/stability.mjs +293 -2
- package/dist/lib/commands/stats.mjs +402 -0
- package/dist/lib/commands/status.mjs +172 -4
- package/dist/lib/commands/suggest.mjs +563 -21
- package/dist/lib/commands/switch.mjs +310 -0
- package/dist/lib/commands/syncAuto.mjs +96 -1
- package/dist/lib/commands/synthesize.mjs +228 -10
- package/dist/lib/commands/teamSync.mjs +388 -2
- package/dist/lib/commands/test.mjs +363 -6
- package/dist/lib/commands/theme.mjs +195 -18
- package/dist/lib/commands/upgrade.mjs +153 -0
- package/dist/lib/commands/version.mjs +282 -2
- package/dist/lib/commands/vibe.mjs +357 -7
- package/dist/lib/commands/watch.mjs +203 -4
- package/dist/lib/commands/why.mjs +358 -4
- package/dist/lib/cursorHooksInstall.mjs +60 -1
- package/dist/lib/draftToolingInstall.mjs +68 -7
- package/dist/lib/git/detect-drift.mjs +208 -4
- package/dist/lib/learning/adapt.mjs +101 -6
- package/dist/lib/learning/observe.mjs +119 -1
- package/dist/lib/learning/patternDetector.mjs +298 -1
- package/dist/lib/learning/profile.mjs +279 -2
- package/dist/lib/learning/skillSynthesizer.mjs +145 -24
- package/dist/lib/templates/index.mjs +131 -1
- package/dist/lib/theme/scanner.mjs +343 -4
- package/dist/lib/ui/errors.mjs +142 -1
- package/dist/lib/ui/output.mjs +72 -6
- package/dist/lib/ui/prompts.mjs +147 -6
- package/dist/lib/vsCodeCopilotHooksInstall.mjs +42 -1
- package/package.json +1 -1
|
@@ -1,30 +1,104 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* lib/learning/skillSynthesizer.mjs
|
|
3
|
+
*
|
|
4
|
+
* Converts approved candidates into actual files on disk:
|
|
5
|
+
*
|
|
6
|
+
* AGENTS → inferno/agents/<name>.json
|
|
7
|
+
* (runnable via `infernoflow agent run <name>`)
|
|
8
|
+
*
|
|
9
|
+
* SKILLS → inferno/skills/<name>.md
|
|
10
|
+
* + appends to .cursor/rules/infernoflow-auto.mdc
|
|
11
|
+
* + appends to CLAUDE.md (if it exists)
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import * as fs from "node:fs";
|
|
15
|
+
import * as path from "node:path";
|
|
16
|
+
|
|
17
|
+
// ── Agent file writer ─────────────────────────────────────────────────────────
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Write an agent definition to inferno/agents/<name>.json.
|
|
21
|
+
* Returns the file path written.
|
|
22
|
+
*/
|
|
23
|
+
export function writeAgentFile(infernoDir, candidate) {
|
|
24
|
+
const agentsDir = path.join(infernoDir, "agents");
|
|
25
|
+
fs.mkdirSync(agentsDir, { recursive: true });
|
|
26
|
+
|
|
27
|
+
const agentDef = {
|
|
28
|
+
id: candidate.id,
|
|
29
|
+
name: candidate.name,
|
|
30
|
+
description: candidate.description,
|
|
31
|
+
steps: candidate.steps.map(cmd => ({ command: cmd, args: [] })),
|
|
32
|
+
createdAt: new Date().toISOString(),
|
|
33
|
+
source: "auto-synthesized",
|
|
34
|
+
frequency: candidate.frequency,
|
|
35
|
+
confidence: candidate.confidence,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const filePath = path.join(agentsDir, `${candidate.name}.json`);
|
|
39
|
+
fs.writeFileSync(filePath, JSON.stringify(agentDef, null, 2) + "\n", "utf8");
|
|
40
|
+
return filePath;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ── Skill file writers ────────────────────────────────────────────────────────
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Write a skill markdown file to inferno/skills/<name>.md.
|
|
47
|
+
*/
|
|
48
|
+
export function writeSkillFile(infernoDir, candidate) {
|
|
49
|
+
const skillsDir = path.join(infernoDir, "skills");
|
|
50
|
+
fs.mkdirSync(skillsDir, { recursive: true });
|
|
51
|
+
|
|
52
|
+
const examples = (candidate.examples || [])
|
|
53
|
+
.map(e => ` - "${e}"`)
|
|
54
|
+
.join("\n");
|
|
55
|
+
|
|
56
|
+
const steps = (candidate.steps || [])
|
|
57
|
+
.map((s, i) => `${i + 1}. Run \`infernoflow ${s}\``)
|
|
58
|
+
.join("\n");
|
|
59
|
+
|
|
60
|
+
const content = `# Skill: ${candidate.name}
|
|
61
|
+
|
|
62
|
+
> Auto-synthesized from ${candidate.frequency} observed sessions (confidence: ${Math.round(candidate.confidence * 100)}%)
|
|
7
63
|
|
|
8
64
|
## Trigger pattern
|
|
9
65
|
|
|
10
|
-
\`${
|
|
66
|
+
\`${candidate.trigger}\`
|
|
11
67
|
|
|
12
68
|
## Example tasks this applies to
|
|
13
69
|
|
|
14
|
-
${
|
|
70
|
+
${examples || " (none recorded)"}
|
|
15
71
|
|
|
16
72
|
## Recommended workflow
|
|
17
73
|
|
|
18
74
|
When working on a task matching the pattern above:
|
|
19
75
|
|
|
20
|
-
${
|
|
76
|
+
${steps}
|
|
21
77
|
|
|
22
78
|
## Notes
|
|
23
79
|
|
|
24
80
|
- This skill was automatically generated by \`infernoflow synthesize\`
|
|
25
|
-
- Review and edit as needed
|
|
81
|
+
- Review and edit as needed — it is yours to own
|
|
26
82
|
- Re-run \`infernoflow synthesize\` to update as your patterns evolve
|
|
27
|
-
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
const filePath = path.join(skillsDir, `${candidate.name}.md`);
|
|
86
|
+
fs.writeFileSync(filePath, content, "utf8");
|
|
87
|
+
return filePath;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Append a skill rule to .cursor/rules/infernoflow-auto.mdc.
|
|
92
|
+
* Creates the file if it doesn't exist.
|
|
93
|
+
*/
|
|
94
|
+
export function appendToCursorRules(cwd, candidate) {
|
|
95
|
+
const rulesDir = path.join(cwd, ".cursor", "rules");
|
|
96
|
+
fs.mkdirSync(rulesDir, { recursive: true });
|
|
97
|
+
|
|
98
|
+
const filePath = path.join(rulesDir, "infernoflow-auto.mdc");
|
|
99
|
+
|
|
100
|
+
const header = fs.existsSync(filePath) ? "" :
|
|
101
|
+
`---
|
|
28
102
|
description: Auto-generated infernoflow workflow rules
|
|
29
103
|
globs: ["**/*"]
|
|
30
104
|
alwaysApply: true
|
|
@@ -33,20 +107,67 @@ alwaysApply: true
|
|
|
33
107
|
# infernoflow Auto-Generated Workflow Rules
|
|
34
108
|
|
|
35
109
|
These rules are synthesized from your observed development patterns.
|
|
36
|
-
Do not edit manually
|
|
37
|
-
|
|
38
|
-
`,i=`
|
|
39
|
-
## ${e.name}
|
|
110
|
+
Do not edit manually — re-run \`infernoflow synthesize\` to regenerate.
|
|
40
111
|
|
|
41
|
-
|
|
112
|
+
`;
|
|
42
113
|
|
|
43
|
-
|
|
44
|
-
${
|
|
45
|
-
`)}
|
|
114
|
+
const rule = `
|
|
115
|
+
## ${candidate.name}
|
|
46
116
|
|
|
47
|
-
|
|
48
|
-
- **${e.name}**: For tasks like \`${e.trigger}\`, run: ${(e.steps||[]).map(l=>`\`infernoflow ${l}\``).join(" \u2192 ")}`;if(!t.includes(o))r.appendFileSync(n,`
|
|
117
|
+
Pattern: \`${candidate.trigger}\`
|
|
49
118
|
|
|
50
|
-
|
|
51
|
-
${i}
|
|
52
|
-
|
|
119
|
+
When working on tasks matching this pattern:
|
|
120
|
+
${(candidate.steps || []).map((s, i) => `${i + 1}. Run \`infernoflow ${s}\``).join("\n")}
|
|
121
|
+
|
|
122
|
+
`;
|
|
123
|
+
|
|
124
|
+
fs.appendFileSync(filePath, header + rule, "utf8");
|
|
125
|
+
return filePath;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Append a skill tip to CLAUDE.md if it exists.
|
|
130
|
+
*/
|
|
131
|
+
export function appendToClaudeMd(cwd, candidate) {
|
|
132
|
+
const claudeMdPath = path.join(cwd, "CLAUDE.md");
|
|
133
|
+
if (!fs.existsSync(claudeMdPath)) return null;
|
|
134
|
+
|
|
135
|
+
const existing = fs.readFileSync(claudeMdPath, "utf8");
|
|
136
|
+
const marker = "## infernoflow Auto-Skills";
|
|
137
|
+
|
|
138
|
+
const tip = `\n- **${candidate.name}**: For tasks like \`${candidate.trigger}\`, run: ${(candidate.steps || []).map(s => `\`infernoflow ${s}\``).join(" → ")}`;
|
|
139
|
+
|
|
140
|
+
if (!existing.includes(marker)) {
|
|
141
|
+
fs.appendFileSync(claudeMdPath, `\n\n${marker}\n${tip}\n`, "utf8");
|
|
142
|
+
} else {
|
|
143
|
+
// Append after the marker section
|
|
144
|
+
const updated = existing.replace(marker, marker + tip);
|
|
145
|
+
fs.writeFileSync(claudeMdPath, updated, "utf8");
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return claudeMdPath;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// ── Main synthesize function ──────────────────────────────────────────────────
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Write all files for an approved candidate.
|
|
155
|
+
* Returns { filePaths: string[] } — list of files written.
|
|
156
|
+
*/
|
|
157
|
+
export function synthesizeCandidate(cwd, infernoDir, candidate) {
|
|
158
|
+
const filePaths = [];
|
|
159
|
+
|
|
160
|
+
if (candidate.type === "agent") {
|
|
161
|
+
filePaths.push(writeAgentFile(infernoDir, candidate));
|
|
162
|
+
} else {
|
|
163
|
+
// skill
|
|
164
|
+
filePaths.push(writeSkillFile(infernoDir, candidate));
|
|
165
|
+
try { filePaths.push(appendToCursorRules(cwd, candidate)); } catch {}
|
|
166
|
+
try {
|
|
167
|
+
const p = appendToClaudeMd(cwd, candidate);
|
|
168
|
+
if (p) filePaths.push(p);
|
|
169
|
+
} catch {}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return { filePaths };
|
|
173
|
+
}
|
|
@@ -1 +1,131 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* infernoflow project templates
|
|
3
|
+
*
|
|
4
|
+
* Named starters for `infernoflow init --template <name>`.
|
|
5
|
+
* Each template provides:
|
|
6
|
+
* - capabilities : pre-populated capability list
|
|
7
|
+
* - scenarios : one starter scenario per capability
|
|
8
|
+
* - contextHint : first-session CONTEXT.md guidance
|
|
9
|
+
* - scripts : suggested package.json scripts to add
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export const TEMPLATES = {
|
|
13
|
+
|
|
14
|
+
// ── REST API ────────────────────────────────────────────────────────────────
|
|
15
|
+
"rest-api": {
|
|
16
|
+
description: "Express / Fastify / Hono REST API",
|
|
17
|
+
capabilities: [
|
|
18
|
+
{ id: "list-items", description: "GET /items — paginated list with filtering and sorting" },
|
|
19
|
+
{ id: "get-item", description: "GET /items/:id — fetch a single resource by ID" },
|
|
20
|
+
{ id: "create-item", description: "POST /items — create a new resource, validate input" },
|
|
21
|
+
{ id: "update-item", description: "PUT /items/:id — full update of an existing resource" },
|
|
22
|
+
{ id: "delete-item", description: "DELETE /items/:id — soft or hard delete" },
|
|
23
|
+
{ id: "authenticate", description: "POST /auth/login — exchange credentials for a JWT token" },
|
|
24
|
+
{ id: "refresh-token", description: "POST /auth/refresh — extend session with a new token" },
|
|
25
|
+
{ id: "health-check", description: "GET /health — liveness probe for load balancers" },
|
|
26
|
+
{ id: "paginate", description: "Cursor or offset pagination applied across list endpoints" },
|
|
27
|
+
{ id: "validate-input", description: "Schema validation on all incoming request bodies" },
|
|
28
|
+
],
|
|
29
|
+
contextHint: "Building a REST API. Focus on route handlers, middleware, and input validation.",
|
|
30
|
+
scripts: {
|
|
31
|
+
"dev": "node src/index.js",
|
|
32
|
+
"start": "node dist/index.js",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// ── Next.js ─────────────────────────────────────────────────────────────────
|
|
37
|
+
"nextjs": {
|
|
38
|
+
description: "Next.js full-stack app (App Router or Pages Router)",
|
|
39
|
+
capabilities: [
|
|
40
|
+
{ id: "render-home-page", description: "/ — server-rendered landing page with SEO metadata" },
|
|
41
|
+
{ id: "render-dashboard", description: "/dashboard — authenticated user dashboard" },
|
|
42
|
+
{ id: "api-authenticate", description: "POST /api/auth/login — issue session cookie or JWT" },
|
|
43
|
+
{ id: "api-list-resources", description: "GET /api/resources — paginated list, auth-protected" },
|
|
44
|
+
{ id: "api-create-resource", description: "POST /api/resources — create and persist a resource" },
|
|
45
|
+
{ id: "server-side-props", description: "Fetch user-specific data server-side before render" },
|
|
46
|
+
{ id: "static-generation", description: "Pre-render marketing pages at build time" },
|
|
47
|
+
{ id: "image-optimization", description: "next/image usage for responsive, lazy-loaded images" },
|
|
48
|
+
{ id: "middleware-auth", description: "Edge middleware to protect dashboard routes" },
|
|
49
|
+
{ id: "error-boundary", description: "Global error.tsx / _error.tsx user-facing error page" },
|
|
50
|
+
],
|
|
51
|
+
contextHint: "Building a Next.js app. Use Server Components by default; Client Components only when needed.",
|
|
52
|
+
scripts: {
|
|
53
|
+
"dev": "next dev",
|
|
54
|
+
"build": "next build",
|
|
55
|
+
"start": "next start",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
// ── CLI tool ────────────────────────────────────────────────────────────────
|
|
60
|
+
"cli": {
|
|
61
|
+
description: "Node.js / Python CLI tool",
|
|
62
|
+
capabilities: [
|
|
63
|
+
{ id: "parse-args", description: "Parse CLI arguments and flags, show help on --help" },
|
|
64
|
+
{ id: "validate-config", description: "Load and validate config file or env vars on startup" },
|
|
65
|
+
{ id: "main-command", description: "Primary command — the core action the CLI performs" },
|
|
66
|
+
{ id: "output-formatter", description: "Format output as text, JSON, or table based on --format flag" },
|
|
67
|
+
{ id: "error-handler", description: "Friendly error messages with exit codes, no raw stack traces" },
|
|
68
|
+
{ id: "progress-display", description: "Spinner or progress bar for long-running operations" },
|
|
69
|
+
{ id: "update-check", description: "Check npm/PyPI for a newer version on startup" },
|
|
70
|
+
{ id: "plugin-loader", description: "Discover and load user-installed plugins at runtime" },
|
|
71
|
+
],
|
|
72
|
+
contextHint: "Building a CLI tool. Prioritise UX: helpful errors, --json flag, zero-config defaults.",
|
|
73
|
+
scripts: {
|
|
74
|
+
"start": "node bin/cli.js",
|
|
75
|
+
"link": "npm link",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
// ── GraphQL ─────────────────────────────────────────────────────────────────
|
|
80
|
+
"graphql": {
|
|
81
|
+
description: "GraphQL API (Apollo, Pothos, or similar)",
|
|
82
|
+
capabilities: [
|
|
83
|
+
{ id: "query-viewer", description: "query { viewer } — return the authenticated user" },
|
|
84
|
+
{ id: "query-list", description: "query { items(first: N, after: cursor) } — paginated list" },
|
|
85
|
+
{ id: "query-node", description: "query { node(id) } — global object lookup by ID" },
|
|
86
|
+
{ id: "mutation-create", description: "mutation { createItem(input) } — create and return new object" },
|
|
87
|
+
{ id: "mutation-update", description: "mutation { updateItem(id, input) } — update fields" },
|
|
88
|
+
{ id: "mutation-delete", description: "mutation { deleteItem(id) } — remove and return deleted" },
|
|
89
|
+
{ id: "subscription-event", description: "subscription { itemUpdated } — real-time push via WebSocket" },
|
|
90
|
+
{ id: "data-loader", description: "Batch and cache DB calls with DataLoader to avoid N+1" },
|
|
91
|
+
{ id: "auth-directive", description: "@auth directive — enforce authentication on resolvers" },
|
|
92
|
+
{ id: "error-formatting", description: "Consistent GraphQL error shape with extensions and codes" },
|
|
93
|
+
],
|
|
94
|
+
contextHint: "Building a GraphQL API. Use DataLoader for all relations, @auth directive on protected resolvers.",
|
|
95
|
+
scripts: {
|
|
96
|
+
"dev": "ts-node src/server.ts",
|
|
97
|
+
"codegen": "graphql-codegen",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
// ── Monorepo ────────────────────────────────────────────────────────────────
|
|
102
|
+
"monorepo": {
|
|
103
|
+
description: "Monorepo workspace (nx / turborepo / pnpm workspaces)",
|
|
104
|
+
capabilities: [
|
|
105
|
+
{ id: "build-all", description: "Build all packages in dependency order" },
|
|
106
|
+
{ id: "test-all", description: "Run tests across all packages in parallel" },
|
|
107
|
+
{ id: "lint-all", description: "Lint all packages with shared ESLint / Prettier config" },
|
|
108
|
+
{ id: "publish-packages", description: "Bump versions and publish changed packages to npm" },
|
|
109
|
+
{ id: "shared-ui-library", description: "packages/ui — shared React component library" },
|
|
110
|
+
{ id: "shared-utils", description: "packages/utils — shared utility functions and types" },
|
|
111
|
+
{ id: "web-app", description: "apps/web — primary Next.js or React web application" },
|
|
112
|
+
{ id: "api-service", description: "apps/api — backend service consumed by apps" },
|
|
113
|
+
{ id: "cache-builds", description: "Remote build cache via Turborepo or Nx Cloud" },
|
|
114
|
+
{ id: "affected-only", description: "Run tasks only for packages affected by a git change" },
|
|
115
|
+
],
|
|
116
|
+
contextHint: "Working in a monorepo. Changes in packages/* may affect apps/*. Check affected packages before building.",
|
|
117
|
+
scripts: {
|
|
118
|
+
"build": "turbo build",
|
|
119
|
+
"dev": "turbo dev",
|
|
120
|
+
"test": "turbo test",
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export function listTemplates() {
|
|
126
|
+
return Object.entries(TEMPLATES).map(([name, t]) => ({ name, description: t.description }));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function getTemplate(name) {
|
|
130
|
+
return TEMPLATES[name] || null;
|
|
131
|
+
}
|