forgecraft 1.1.0 → 1.2.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 CHANGED
@@ -1,8 +1,8 @@
1
1
  <p align="center">
2
- <img src="https://img.shields.io/npm/v/forgeai?style=flat-square&color=000" alt="npm version" />
2
+ <img src="https://img.shields.io/npm/v/forgecraft?style=flat-square&color=000" alt="npm version" />
3
3
  <img src="https://img.shields.io/badge/node-%3E%3D18-000?style=flat-square" alt="node version" />
4
4
  <img src="https://img.shields.io/github/license/joeljohn159/forgeai?style=flat-square&color=000" alt="license" />
5
- <img src="https://img.shields.io/badge/frameworks-Next.js%20%7C%20React%20%7C%20Django-000?style=flat-square" alt="frameworks" />
5
+ <img src="https://img.shields.io/badge/frameworks-Next.js%20%7C%20React%20%7C%20Django%20%7C%20Any-000?style=flat-square" alt="frameworks" />
6
6
  </p>
7
7
 
8
8
  <h1 align="center">ForgeAI</h1>
@@ -97,24 +97,33 @@ Each phase has a clear input, a clear output, and a gate between them. Stories t
97
97
  # Prerequisites: Node 18+, Claude Code CLI (logged in)
98
98
 
99
99
  # Install globally
100
- npm install -g forgeai
100
+ npm install -g forgecraft
101
101
 
102
102
  # Create a new project directory
103
103
  mkdir my-app && cd my-app
104
104
 
105
- # Initialize (choose Next.js, React+Vite, or Django)
105
+ # Initialize (choose Next.js, React+Vite, Django, or any stack)
106
106
  forge init
107
107
 
108
108
  # Build something
109
109
  forge auto "a task management app with projects, due dates, and team assignment"
110
110
 
111
+ # Full auto — skip all prompts
112
+ forge auto "an API with Express and MongoDB" --yes
113
+
114
+ # Attach references — drag & drop files into the terminal
115
+ forge auto "build this app" /path/to/mockup.png /path/to/spec.pdf
116
+ # Attachments:
117
+ # [Image1] mockup.png
118
+ # [Document1] spec.pdf
119
+
111
120
  # Start the dev server
112
121
  forge start
113
122
 
114
123
  # If interrupted, resume where you left off
115
124
  forge resume
116
125
 
117
- # Fix a bug (supports screenshots)
126
+ # Fix a bug (drag & drop screenshots or use --image)
118
127
  forge fix "the sidebar overlaps on mobile" --image screenshot.png
119
128
 
120
129
  # Push to GitHub manually (auto-push happens after forge auto)
@@ -150,6 +159,32 @@ Type a message at any point during the build. It gets queued and processed at th
150
159
  "what's the database schema?" → Orchestrator answers directly
151
160
  ```
152
161
 
162
+ ### Drag & Drop Attachments
163
+ Drag files directly into the terminal to attach mockups, specs, or screenshots. Forge detects the file paths, classifies them, and passes them to the agents as context.
164
+
165
+ ```bash
166
+ # Drag & drop images and documents right into your prompt
167
+ forge auto "build this landing page" /Users/me/mockup.png /Users/me/requirements.pdf
168
+
169
+ Attachments:
170
+ [Image1] mockup.png
171
+ [Document1] requirements.pdf
172
+
173
+ # Also works with forge fix
174
+ forge fix "match this design" /Users/me/screenshot.png
175
+ ```
176
+
177
+ Supports images (`.png`, `.jpg`, `.svg`, `.webp`), documents (`.pdf`, `.doc`, `.txt`, `.md`, `.csv`, `.json`, `.yaml`), and design files (`.figma`, `.sketch`). Files are copied to `.forge/attachments/` so agents can reference them.
178
+
179
+ ### Zero-Prompt Mode (`--yes`)
180
+ Skip every confirmation dialog — Claude Code permission prompts, review gates, resume confirmations. Fully hands-free.
181
+
182
+ ```bash
183
+ forge auto "a blog with auth" --yes
184
+ forge auto "a dashboard" -y --skip-design --quiet
185
+ forge resume -y
186
+ ```
187
+
153
188
  ### Screenshot-Based Bug Fixing
154
189
  Pass a screenshot to `forge fix` and Claude reads the image to understand the visual issue:
155
190
 
@@ -183,9 +218,18 @@ ForgeAI isn't locked to one framework. Each adapter knows how to scaffold, build
183
218
  | **Next.js** | TypeScript | Storybook | Stable |
184
219
  | **React + Vite** | TypeScript | Storybook | Stable |
185
220
  | **Django** | Python | Skipped | Stable |
186
- | Flutter | Dart | | Planned |
221
+ | **Any Stack** | Auto-detect | Skipped | Stable |
187
222
 
188
- Worker prompts automatically adapt to the frameworkNext.js gets App Router instructions, Vite gets SPA routing, Django gets migration commands.
223
+ The **"Other"** option in `forge init` enables a generic adapter that works with any tech stack Express, Vue, Svelte, Go, Rust, FastAPI, Flutter, Rails, and more. The agent auto-detects your project's language, package manager, build commands, and file structure from existing config files. If starting from scratch, it scaffolds using the standard tooling for the detected stack.
224
+
225
+ ```bash
226
+ # Works with anything
227
+ forge auto "a REST API with Express, Prisma, and PostgreSQL"
228
+ forge auto "a CLI tool in Rust that converts images to WebP"
229
+ forge auto "a FastAPI backend with SQLAlchemy and JWT auth"
230
+ ```
231
+
232
+ Worker prompts automatically adapt to the framework — Next.js gets App Router instructions, Vite gets SPA routing, Django gets migration commands, and generic projects get smart auto-detection.
189
233
 
190
234
  ### Sprint Resume
191
235
  If a build gets interrupted (auth expires, network drops, you close the terminal), your progress is saved. Run `forge resume` to pick up exactly where you left off. Blocked stories can be retried.
@@ -201,10 +245,12 @@ Pass `--deploy` and ForgeAI configures `next.config` for static export and creat
201
245
 
202
246
  ```bash
203
247
  forge auto "description" # Full autonomous pipeline (auto-pushes to GitHub)
248
+ forge auto "description" --yes # Skip all prompts (fully hands-free)
204
249
  forge auto "description" --skip-design # Skip Storybook previews (faster)
205
250
  forge auto "description" --deploy # Add GitHub Pages deployment
206
251
  forge auto "description" --mute # No notification sounds
207
252
  forge auto "description" --quiet # Spinners only, no tool details
253
+ forge auto "desc" file.png spec.pdf # Attach reference files (drag & drop)
208
254
  ```
209
255
 
210
256
  ### Step-by-Step Mode
@@ -286,6 +332,7 @@ src/
286
332
  │ │ ├── nextjs.ts # Next.js adapter
287
333
  │ │ ├── react-vite.ts # React + Vite adapter
288
334
  │ │ ├── django.ts # Django adapter
335
+ │ │ ├── generic.ts # Generic adapter (any tech stack)
289
336
  │ │ └── index.ts # Adapter registry + factory
290
337
  │ │
291
338
  │ ├── git/
@@ -295,6 +342,7 @@ src/
295
342
  │ │ └── index.ts # GitHub Issues sync (via gh CLI)
296
343
  │ │
297
344
  │ └── utils/
345
+ │ ├── attachments.ts # Drag & drop file attachment parser
298
346
  │ ├── config.ts # Config validation
299
347
  │ └── sound.ts # Notification sounds (macOS/Linux/fallback)
300
348
 
@@ -379,9 +427,10 @@ After `forge init`, your `forge.config.json` controls:
379
427
  | Git strategy | Manual | Manual | Manual | **Auto commits + tags + push** |
380
428
  | Parallelism | N/A | N/A | N/A | **Dependency-grouped parallel** |
381
429
  | Human oversight | Full control | None | Approve/reject | **Stage gates + live feedback** |
382
- | Bug fix with screenshots | N/A | N/A | N/A | **forge fix --image** |
430
+ | Bug fix with screenshots | N/A | N/A | N/A | **forge fix --image + drag & drop** |
383
431
  | SEO & assets | You remember | You remember | You remember | **Built-in defaults** |
384
- | Multi-framework | N/A | Any | Any | **Next.js, React, Django** |
432
+ | Multi-framework | N/A | Any | Any | **Next.js, React, Django, Any** |
433
+ | File attachments | N/A | N/A | N/A | **Drag & drop mockups/specs** |
385
434
  | Resume on failure | Start over | N/A | N/A | **Auto-save + resume** |
386
435
 
387
436
  <br/>
@@ -394,7 +443,7 @@ After `forge init`, your `forge.config.json` controls:
394
443
 
395
444
  **v0.3** — React + Vite and Django adapters, `forge map`, `forge resume`
396
445
 
397
- **v1.0** — Current
446
+ **v1.0** — Initial Release
398
447
  - 21 CLI commands covering the full development lifecycle
399
448
  - 3 framework adapters (Next.js, React + Vite, Django)
400
449
  - Framework-aware prompts via pluggable adapter system
@@ -406,10 +455,13 @@ After `forge init`, your `forge.config.json` controls:
406
455
  - Config validation with actionable error messages
407
456
  - Token expiry handling with auto-retry
408
457
 
409
- **v1.1** — Next Up
410
- - **Flutter adapter** — Dart support with widget-based design previews
411
- - **Vue.js / Nuxt adapter** — Vue 3 + Composition API + Nuxt 3 SSR support
412
- - **Svelte / SvelteKit adapter** — Svelte 5 with runes and SvelteKit routing
458
+ **v1.1** — Current
459
+ - **Any tech stack support** — generic adapter auto-detects language, package manager, build commands, and project structure. Works with Express, Vue, Svelte, Go, Rust, FastAPI, Rails, and more.
460
+ - **`--yes` flag** — skip all confirmation prompts for fully hands-free operation
461
+ - **Drag & drop attachments** — attach mockups, screenshots, specs, and design files by dragging into the terminal. Supports images, PDFs, docs, and design files.
462
+ - Published as `forgecraft` on npm
463
+
464
+ **v1.2** — Next Up
413
465
  - **Test generation phase** — auto-generate unit and integration tests after build (Vitest, pytest, Flutter test)
414
466
  - **Custom adapter plugin API** — drop a JS file in `.forge/adapters/` to add your own framework
415
467
 
@@ -2008,6 +2008,120 @@ var GitHubSync = class {
2008
2008
  }
2009
2009
  };
2010
2010
 
2011
+ // src/core/utils/attachments.ts
2012
+ import fs3 from "fs";
2013
+ import path3 from "path";
2014
+ var IMAGE_EXTS = /* @__PURE__ */ new Set([
2015
+ ".png",
2016
+ ".jpg",
2017
+ ".jpeg",
2018
+ ".gif",
2019
+ ".webp",
2020
+ ".svg",
2021
+ ".bmp",
2022
+ ".ico",
2023
+ ".tiff",
2024
+ ".avif"
2025
+ ]);
2026
+ var DOCUMENT_EXTS = /* @__PURE__ */ new Set([
2027
+ ".pdf",
2028
+ ".doc",
2029
+ ".docx",
2030
+ ".txt",
2031
+ ".md",
2032
+ ".csv",
2033
+ ".xls",
2034
+ ".xlsx",
2035
+ ".ppt",
2036
+ ".pptx",
2037
+ ".rtf",
2038
+ ".html",
2039
+ ".json",
2040
+ ".yaml",
2041
+ ".yml",
2042
+ ".xml",
2043
+ ".figma",
2044
+ ".sketch",
2045
+ ".xd"
2046
+ ]);
2047
+ var PATH_PATTERN = /(?:"([^"]+\.[\w]+)")|(?:'([^']+\.[\w]+)')|(?:((?:\/|[A-Z]:\\)(?:[^\s,;]|\\[ ])+\.[\w]+))/g;
2048
+ function parseAttachments(input) {
2049
+ const attachments = [];
2050
+ let imageCount = 0;
2051
+ let docCount = 0;
2052
+ let cleaned = input.replace(PATH_PATTERN, (match, quoted, singleQuoted, raw) => {
2053
+ const filePath = (quoted || singleQuoted || raw || "").replace(/\\ /g, " ").trim();
2054
+ if (!filePath) return match;
2055
+ const resolved = path3.resolve(filePath);
2056
+ if (!fs3.existsSync(resolved)) return match;
2057
+ const ext = path3.extname(resolved).toLowerCase();
2058
+ const fileName = path3.basename(resolved);
2059
+ let type;
2060
+ let label;
2061
+ if (IMAGE_EXTS.has(ext)) {
2062
+ imageCount++;
2063
+ type = "image";
2064
+ label = `[Image${imageCount}]`;
2065
+ } else if (DOCUMENT_EXTS.has(ext)) {
2066
+ docCount++;
2067
+ type = "document";
2068
+ label = `[Document${docCount}]`;
2069
+ } else {
2070
+ docCount++;
2071
+ type = "document";
2072
+ label = `[Document${docCount}]`;
2073
+ }
2074
+ attachments.push({
2075
+ label,
2076
+ originalPath: match,
2077
+ resolvedPath: resolved,
2078
+ type,
2079
+ ext,
2080
+ fileName
2081
+ });
2082
+ return label;
2083
+ });
2084
+ cleaned = cleaned.replace(/\s{2,}/g, " ").trim();
2085
+ return { description: cleaned, attachments };
2086
+ }
2087
+ function stageAttachments(attachments) {
2088
+ if (attachments.length === 0) return [];
2089
+ const attachDir = path3.join(process.cwd(), ".forge", "attachments");
2090
+ fs3.mkdirSync(attachDir, { recursive: true });
2091
+ const stagedPaths = [];
2092
+ for (const att of attachments) {
2093
+ const stagedName = att.label.replace(/[\[\]]/g, "").toLowerCase() + att.ext;
2094
+ const dest = path3.join(attachDir, stagedName);
2095
+ try {
2096
+ fs3.copyFileSync(att.resolvedPath, dest);
2097
+ stagedPaths.push(dest);
2098
+ } catch {
2099
+ }
2100
+ }
2101
+ return stagedPaths;
2102
+ }
2103
+ function formatAttachmentList(attachments) {
2104
+ if (attachments.length === 0) return "";
2105
+ return attachments.map((a) => ` ${a.label} ${a.fileName}`).join("\n");
2106
+ }
2107
+ function buildAttachmentPrompt(attachments) {
2108
+ if (attachments.length === 0) return "";
2109
+ const lines = attachments.map((a) => {
2110
+ const relPath = path3.relative(process.cwd(), a.resolvedPath);
2111
+ if (a.type === "image") {
2112
+ return `- ${a.label}: Image file at ${relPath} \u2014 read this file to see the visual reference`;
2113
+ }
2114
+ return `- ${a.label}: Document at ${relPath} \u2014 read this file for requirements/specs`;
2115
+ });
2116
+ return `
2117
+ ATTACHMENTS (provided by the user):
2118
+ ${lines.join("\n")}
2119
+
2120
+ Use these attachments as reference material. For images, match the visual style/layout.
2121
+ For documents, extract requirements and specifications from them.
2122
+ `;
2123
+ }
2124
+
2011
2125
  // src/core/pipeline/auto.ts
2012
2126
  var AutoPipeline = class {
2013
2127
  orchestrator;
@@ -2144,7 +2258,8 @@ var AutoPipeline = class {
2144
2258
  const planSpinner = ora2({ text: `${this.elapsed()} Planning...`, indent: 2 }).start();
2145
2259
  this.activeSpinner = planSpinner;
2146
2260
  try {
2147
- this.plan = await this.orchestrator.generatePlan(description);
2261
+ const attachmentContext = buildAttachmentPrompt(this.options.attachments || []);
2262
+ this.plan = await this.orchestrator.generatePlan(description + attachmentContext);
2148
2263
  planSpinner.succeed(`${this.elapsed()} Plan ready`);
2149
2264
  this.activeSpinner = null;
2150
2265
  this.displayPlan(this.plan);
@@ -2911,8 +3026,12 @@ export {
2911
3026
  GitManager,
2912
3027
  stateManager,
2913
3028
  Pipeline,
3029
+ parseAttachments,
3030
+ stageAttachments,
3031
+ formatAttachmentList,
3032
+ buildAttachmentPrompt,
2914
3033
  AutoPipeline,
2915
3034
  validateConfig,
2916
3035
  loadAndValidateConfig
2917
3036
  };
2918
- //# sourceMappingURL=chunk-WXVO3XYN.js.map
3037
+ //# sourceMappingURL=chunk-P5CLBIGQ.js.map