forgedev 1.1.3 → 1.3.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 +58 -10
- package/bin/chainproof.js +126 -0
- package/bin/devforge.js +2 -1
- package/package.json +33 -7
- package/src/chainproof-bridge.js +330 -0
- package/src/ci-mode.js +85 -0
- package/src/claude-configurator.js +87 -49
- package/src/cli.js +35 -12
- package/src/composer.js +159 -34
- package/src/doctor-checks-chainproof.js +106 -0
- package/src/doctor-checks.js +39 -20
- package/src/doctor-prompts.js +9 -9
- package/src/doctor.js +37 -4
- package/src/guided.js +3 -3
- package/src/index.js +31 -10
- package/src/init-mode.js +64 -11
- package/src/menu.js +178 -0
- package/src/prompts.js +5 -12
- package/src/recommender.js +134 -10
- package/src/scanner.js +57 -2
- package/src/uat-generator.js +204 -189
- package/src/update-check.js +9 -4
- package/src/update.js +1 -1
- package/src/utils.js +65 -6
- package/templates/ai/guardrails-py/backend/app/ai/__init__.py +29 -0
- package/templates/ai/guardrails-py/backend/app/ai/audit_log.py +133 -0
- package/templates/ai/guardrails-py/backend/app/ai/client.py.template +323 -0
- package/templates/ai/guardrails-py/backend/app/ai/health.py.template +157 -0
- package/templates/ai/guardrails-py/backend/app/ai/input_guard.py +98 -0
- package/templates/ai/guardrails-ts/src/lib/ai/audit-log.ts.template +164 -0
- package/templates/ai/guardrails-ts/src/lib/ai/client.ts.template +403 -0
- package/templates/ai/guardrails-ts/src/lib/ai/health.ts.template +165 -0
- package/templates/ai/guardrails-ts/src/lib/ai/index.ts.template +17 -0
- package/templates/ai/guardrails-ts/src/lib/ai/input-guard.ts.template +124 -0
- package/templates/auth/nextauth/src/lib/auth.ts.template +12 -7
- package/templates/backend/express/Dockerfile.template +18 -0
- package/templates/backend/express/package.json.template +33 -0
- package/templates/backend/express/src/index.ts.template +34 -0
- package/templates/backend/express/src/routes/health.ts.template +27 -0
- package/templates/backend/express/tsconfig.json +17 -0
- package/templates/backend/fastapi/backend/Dockerfile.template +5 -0
- package/templates/backend/fastapi/backend/app/api/health.py.template +1 -1
- package/templates/backend/fastapi/backend/app/core/config.py.template +1 -1
- package/templates/backend/fastapi/backend/app/core/errors.py +1 -1
- package/templates/backend/fastapi/backend/app/main.py.template +3 -1
- package/templates/backend/fastapi/backend/requirements.txt.template +2 -0
- package/templates/backend/hono/Dockerfile.template +18 -0
- package/templates/backend/hono/package.json.template +31 -0
- package/templates/backend/hono/src/index.ts.template +32 -0
- package/templates/backend/hono/src/routes/health.ts.template +27 -0
- package/templates/backend/hono/tsconfig.json +18 -0
- package/templates/base/docs/plans/.gitkeep +0 -0
- package/templates/base/docs/uat/UAT_CHECKLIST.csv.template +2 -0
- package/templates/base/docs/uat/UAT_TEMPLATE.md.template +22 -0
- package/templates/chainproof/base/.chainproof/config.json.template +11 -0
- package/templates/chainproof/base/.chainproof/mcp-server.mjs +310 -0
- package/templates/chainproof/base/.mcp.json +9 -0
- package/templates/chainproof/fastapi/.chainproof/middleware.json.template +14 -0
- package/templates/chainproof/nextjs/.chainproof/hooks.json.template +19 -0
- package/templates/chainproof/polyglot/.chainproof/config.json.template +21 -0
- package/templates/claude-code/agents/architect.md +25 -11
- package/templates/claude-code/agents/build-error-resolver.md +22 -7
- package/templates/claude-code/agents/chief-of-staff.md +42 -8
- package/templates/claude-code/agents/code-quality-reviewer.md +15 -1
- package/templates/claude-code/agents/database-reviewer.md +16 -2
- package/templates/claude-code/agents/deep-reviewer.md +191 -0
- package/templates/claude-code/agents/doc-updater.md +19 -5
- package/templates/claude-code/agents/docs-lookup.md +19 -5
- package/templates/claude-code/agents/e2e-runner.md +26 -12
- package/templates/claude-code/agents/enforcement-gate.md +102 -0
- package/templates/claude-code/agents/frontend-builder.md +188 -0
- package/templates/claude-code/agents/harness-optimizer.md +61 -0
- package/templates/claude-code/agents/loop-operator.md +27 -12
- package/templates/claude-code/agents/planner.md +21 -7
- package/templates/claude-code/agents/product-strategist.md +138 -0
- package/templates/claude-code/agents/production-readiness.md +14 -0
- package/templates/claude-code/agents/prompt-auditor.md +115 -0
- package/templates/claude-code/agents/refactor-cleaner.md +22 -8
- package/templates/claude-code/agents/security-reviewer.md +15 -0
- package/templates/claude-code/agents/spec-validator.md +45 -1
- package/templates/claude-code/agents/tdd-guide.md +21 -7
- package/templates/claude-code/agents/uat-validator.md +18 -0
- package/templates/claude-code/claude-md/base.md +15 -7
- package/templates/claude-code/claude-md/fastapi.md +8 -8
- package/templates/claude-code/claude-md/fullstack.md +6 -6
- package/templates/claude-code/claude-md/hono.md +18 -0
- package/templates/claude-code/claude-md/nextjs.md +5 -5
- package/templates/claude-code/claude-md/remix.md +18 -0
- package/templates/claude-code/commands/audit-security.md +14 -0
- package/templates/claude-code/commands/audit-spec.md +14 -0
- package/templates/claude-code/commands/audit-wiring.md +14 -0
- package/templates/claude-code/commands/build-fix.md +28 -0
- package/templates/claude-code/commands/build-ui.md +59 -0
- package/templates/claude-code/commands/code-review.md +54 -26
- package/templates/claude-code/commands/fix-loop.md +211 -0
- package/templates/claude-code/commands/full-audit.md +37 -8
- package/templates/claude-code/commands/generate-prd.md +1 -1
- package/templates/claude-code/commands/generate-sdd.md +74 -0
- package/templates/claude-code/commands/generate-uat.md +107 -35
- package/templates/claude-code/commands/help.md +68 -0
- package/templates/claude-code/commands/live-uat.md +268 -0
- package/templates/claude-code/commands/optimize-claude-md.md +15 -1
- package/templates/claude-code/commands/plan.md +3 -3
- package/templates/claude-code/commands/pre-pr.md +57 -19
- package/templates/claude-code/commands/product-strategist.md +21 -0
- package/templates/claude-code/commands/resume-session.md +10 -10
- package/templates/claude-code/commands/run-uat.md +59 -2
- package/templates/claude-code/commands/save-session.md +10 -10
- package/templates/claude-code/commands/simplify.md +36 -0
- package/templates/claude-code/commands/tdd.md +17 -18
- package/templates/claude-code/commands/verify-all.md +24 -0
- package/templates/claude-code/commands/verify-intent.md +55 -0
- package/templates/claude-code/commands/workflows.md +52 -37
- package/templates/claude-code/hooks/polyglot.json +10 -1
- package/templates/claude-code/hooks/python.json +10 -1
- package/templates/claude-code/hooks/scripts/autofix-polyglot.mjs +20 -10
- package/templates/claude-code/hooks/scripts/autofix-python.mjs +4 -5
- package/templates/claude-code/hooks/scripts/autofix-typescript.mjs +4 -4
- package/templates/claude-code/hooks/scripts/code-hygiene.mjs +293 -0
- package/templates/claude-code/hooks/scripts/guard-protected-files.mjs +2 -2
- package/templates/claude-code/hooks/scripts/pre-commit-gate.mjs +207 -0
- package/templates/claude-code/hooks/typescript.json +10 -1
- package/templates/claude-code/skills/ai-prompts/SKILL.md +119 -41
- package/templates/claude-code/skills/git-workflow/SKILL.md +6 -6
- package/templates/claude-code/skills/nextjs/SKILL.md +1 -1
- package/templates/claude-code/skills/playwright/SKILL.md +6 -5
- package/templates/claude-code/skills/security-api/SKILL.md +1 -1
- package/templates/claude-code/skills/security-web/SKILL.md +2 -1
- package/templates/claude-code/skills/testing-patterns/SKILL.md +9 -9
- package/templates/database/prisma-postgres/{.env.example → .env.example.template} +1 -0
- package/templates/database/sqlalchemy-postgres/{.env.example → .env.example.template} +1 -0
- package/templates/docs-portal/fastapi/backend/app/portal/__init__.py +0 -0
- package/templates/docs-portal/fastapi/backend/app/portal/__pycache__/docs_reader.cpython-314.pyc +0 -0
- package/templates/docs-portal/fastapi/backend/app/portal/docs_reader.py +201 -0
- package/templates/docs-portal/fastapi/backend/app/portal/html_renderer.py +229 -0
- package/templates/docs-portal/fastapi/backend/app/portal/router.py.template +35 -0
- package/templates/docs-portal/nextjs/src/app/portal/[category]/[slug]/page.tsx +81 -0
- package/templates/docs-portal/nextjs/src/app/portal/[category]/page.tsx +65 -0
- package/templates/docs-portal/nextjs/src/app/portal/layout.tsx.template +54 -0
- package/templates/docs-portal/nextjs/src/app/portal/page.tsx +85 -0
- package/templates/docs-portal/nextjs/src/components/portal/markdown-renderer.tsx +101 -0
- package/templates/docs-portal/nextjs/src/components/portal/mobile-portal-nav.tsx +81 -0
- package/templates/docs-portal/nextjs/src/components/portal/portal-nav.tsx +86 -0
- package/templates/docs-portal/nextjs/src/lib/docs.ts +139 -0
- package/templates/frontend/nextjs/package.json.template +3 -1
- package/templates/frontend/react/index.html.template +12 -0
- package/templates/frontend/react/package.json.template +34 -0
- package/templates/frontend/react/src/App.tsx.template +10 -0
- package/templates/frontend/react/src/index.css +1 -0
- package/templates/frontend/react/src/main.tsx +10 -0
- package/templates/frontend/react/tsconfig.json +17 -0
- package/templates/frontend/react/vite.config.ts.template +15 -0
- package/templates/frontend/react/vitest.config.ts +9 -0
- package/templates/frontend/remix/app/root.tsx.template +31 -0
- package/templates/frontend/remix/app/routes/_index.tsx.template +19 -0
- package/templates/frontend/remix/app/routes/api.health.ts.template +10 -0
- package/templates/frontend/remix/app/tailwind.css +1 -0
- package/templates/frontend/remix/package.json.template +39 -0
- package/templates/frontend/remix/tsconfig.json +18 -0
- package/templates/frontend/remix/vite.config.ts.template +7 -0
- package/templates/infra/github-actions/.github/workflows/ci.yml.template +52 -0
- package/templates/testing/pytest/backend/tests/__init__.py +0 -0
- package/templates/testing/pytest/backend/tests/conftest.py.template +11 -0
- package/templates/testing/pytest/backend/tests/test_health.py.template +10 -0
- package/templates/testing/vitest/vitest.config.ts.template +18 -0
- package/CLAUDE.md +0 -38
- package/templates/claude-code/commands/done.md +0 -19
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DevForge
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AI-first project scaffolding CLI. Describe what you're building, get the right stack recommended, and ship with Claude Code infrastructure pre-configured.
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
@@ -106,7 +106,7 @@ $ npx forgedev init
|
|
|
106
106
|
✓ CLAUDE.md — project context + rules
|
|
107
107
|
✓ .claude/hooks/ — auto-lint, quality gate, file protection
|
|
108
108
|
✓ .claude/agents/ — code quality, security, spec validator
|
|
109
|
-
✓ .claude/commands/ — workflows, status, next,
|
|
109
|
+
✓ .claude/commands/ — workflows, status, next, audit, pre-pr
|
|
110
110
|
✓ .claude/skills/ — framework-specific knowledge
|
|
111
111
|
✓ docs/uat/ — acceptance test templates
|
|
112
112
|
|
|
@@ -171,21 +171,21 @@ Every project includes:
|
|
|
171
171
|
|
|
172
172
|
- **Project scaffold** with working code, configs, and dependencies
|
|
173
173
|
- **Health check endpoints** (`/health`, `/healthz`)
|
|
174
|
-
- **Graceful shutdown handlers**
|
|
174
|
+
- **Graceful shutdown handlers** (SIGTERM/SIGINT)
|
|
175
175
|
- **Database connection retry** with exponential backoff
|
|
176
|
-
- **Structured error responses** (
|
|
176
|
+
- **Structured error responses** (custom error classes, no raw stack traces in responses)
|
|
177
177
|
|
|
178
178
|
With Claude Code infrastructure enabled (default):
|
|
179
179
|
|
|
180
180
|
- **CLAUDE.md** tailored to your stack (with pitfalls and agents quick-reference)
|
|
181
181
|
- **Hooks** — cross-platform Node.js `.mjs` hooks (auto-lint on edit, quality gate, protected file guard)
|
|
182
|
-
- **
|
|
183
|
-
- **
|
|
182
|
+
- **22 Agents** — verification, development, review, enforcement, and orchestration (see below)
|
|
183
|
+
- **27 Commands** — daily workflow, verification, release, development, strategy, session management
|
|
184
184
|
- **8 Skills** — framework-specific + universal knowledge
|
|
185
185
|
- **UAT templates** — scenario packs and CSV checklists
|
|
186
186
|
- **Prompt library** — the complete development prompt library
|
|
187
187
|
|
|
188
|
-
## Agents (
|
|
188
|
+
## Agents (22)
|
|
189
189
|
|
|
190
190
|
Every scaffolded project gets these agents in `.claude/agents/`:
|
|
191
191
|
|
|
@@ -196,13 +196,18 @@ Every scaffolded project gets these agents in `.claude/agents/`:
|
|
|
196
196
|
| `chief-of-staff` | Orchestrate multiple agents for complex tasks | Write |
|
|
197
197
|
| `code-quality-reviewer` | Code quality review | Read-only |
|
|
198
198
|
| `database-reviewer` | Query optimization, schema review, N+1 detection | Read-only |
|
|
199
|
+
| `deep-reviewer` | Line-by-line diff review with test case generation | Read-only |
|
|
199
200
|
| `doc-updater` | Keep docs in sync with code changes | Write |
|
|
200
201
|
| `docs-lookup` | Search framework docs for answers | Read-only |
|
|
201
202
|
| `e2e-runner` | Generate and run Playwright E2E tests | Write |
|
|
203
|
+
| `enforcement-gate` | Independently verify agent claims before phase transitions | Read-only |
|
|
204
|
+
| `frontend-builder` | Build frontend UI with Google Stitch + UI UX Pro Max, preview for acceptance | Write |
|
|
202
205
|
| `harness-optimizer` | Audit Claude Code setup, suggest optimizations | Read-only |
|
|
203
206
|
| `loop-operator` | Autonomous improvement loops with stop conditions | Write |
|
|
204
207
|
| `planner` | Create implementation plans before coding | Read-only |
|
|
208
|
+
| `product-strategist` | Research competitors, evaluate maturity, recommend improvements | Read-only |
|
|
205
209
|
| `production-readiness` | Production deployment readiness review | Read-only |
|
|
210
|
+
| `prompt-auditor` | Audit agent prompts for clarity, consistency, and intent protocol compliance | Read-only |
|
|
206
211
|
| `refactor-cleaner` | Dead code removal, duplicate elimination | Write |
|
|
207
212
|
| `security-reviewer` | Security audit | Read-only |
|
|
208
213
|
| `spec-validator` | Validate implementation matches specification | Read-only |
|
|
@@ -237,7 +242,9 @@ node bin/devforge.js update # check for updates
|
|
|
237
242
|
|
|
238
243
|
```
|
|
239
244
|
devforge/
|
|
240
|
-
├── bin/
|
|
245
|
+
├── bin/
|
|
246
|
+
│ ├── devforge.js # DevForge CLI entry point
|
|
247
|
+
│ └── chainproof.js # ChainProof CLI entry point
|
|
241
248
|
├── src/
|
|
242
249
|
│ ├── cli.js # Command router (new, init, doctor, update)
|
|
243
250
|
│ ├── index.js # New project orchestrator (guided + developer)
|
|
@@ -254,7 +261,16 @@ devforge/
|
|
|
254
261
|
│ ├── doctor-prompts.js # Fix prompt generators
|
|
255
262
|
│ ├── update-check.js # npm registry version check
|
|
256
263
|
│ ├── update.js # Update command handler
|
|
264
|
+
│ ├── chainproof-bridge.js # ChainProof Node.js bridge (pure crypto)
|
|
265
|
+
│ ├── ci-mode.js # CI/CD health check mode
|
|
257
266
|
│ └── utils.js # File ops, logging, colors
|
|
267
|
+
├── chainproof/ # Python backend (FastAPI + SQLAlchemy)
|
|
268
|
+
│ ├── core/crypto.py # Ed25519 + SHA-256 primitives
|
|
269
|
+
│ ├── models/ # SQLAlchemy models (NLL, CodeArtifact, TrustChain, AnomalyEvent)
|
|
270
|
+
│ ├── schemas/ # Pydantic request/response schemas
|
|
271
|
+
│ ├── mcp/server.py # MCP server stubs
|
|
272
|
+
│ └── tests/ # Pytest tests
|
|
273
|
+
├── sdk/ # @chainproof/sdk TypeScript types + client
|
|
258
274
|
├── templates/ # Scaffold templates by category
|
|
259
275
|
│ ├── base/ # Every project gets this
|
|
260
276
|
│ ├── frontend/nextjs/ # Next.js App Router
|
|
@@ -263,12 +279,13 @@ devforge/
|
|
|
263
279
|
│ ├── auth/ # NextAuth, JWT
|
|
264
280
|
│ ├── testing/ # Vitest, Playwright, Pytest
|
|
265
281
|
│ ├── infra/ # Docker Compose, GitHub Actions
|
|
282
|
+
│ ├── chainproof/ # ChainProof per-stack configs
|
|
266
283
|
│ └── claude-code/ # Hooks, CLAUDE.md, skills, agents, commands
|
|
267
284
|
├── tests/ # Vitest tests
|
|
268
285
|
└── docs/ # Reference documentation
|
|
269
286
|
```
|
|
270
287
|
|
|
271
|
-
## Claude Code Commands (
|
|
288
|
+
## Claude Code Commands (27)
|
|
272
289
|
|
|
273
290
|
After running `npx forgedev init`, these slash commands are available inside Claude Code:
|
|
274
291
|
|
|
@@ -279,7 +296,7 @@ After running `npx forgedev init`, these slash commands are available inside Cla
|
|
|
279
296
|
| `/workflows` | Lists all available workflows |
|
|
280
297
|
| `/status` | Project dashboard — tests, branch, changes |
|
|
281
298
|
| `/next` | Figures out your next task |
|
|
282
|
-
| `/
|
|
299
|
+
| `/help` | Interactive guide — tells you which workflow to use |
|
|
283
300
|
|
|
284
301
|
**Verification:**
|
|
285
302
|
|
|
@@ -291,6 +308,7 @@ After running `npx forgedev init`, these slash commands are available inside Cla
|
|
|
291
308
|
| `/audit-wiring` | Finds dead or unwired features |
|
|
292
309
|
| `/audit-security` | Runs a security audit |
|
|
293
310
|
| `/code-review` | Reviews uncommitted changes for security and quality |
|
|
311
|
+
| `/verify-intent` | Verify all agents comply with Intent Verification Protocol |
|
|
294
312
|
|
|
295
313
|
**Release:**
|
|
296
314
|
|
|
@@ -298,6 +316,7 @@ After running `npx forgedev init`, these slash commands are available inside Cla
|
|
|
298
316
|
|---------|-------------|
|
|
299
317
|
| `/pre-pr` | Runs the complete pre-PR checklist |
|
|
300
318
|
| `/run-uat` | Executes UAT scenarios |
|
|
319
|
+
| `/live-uat` | Interactive browser/API testing against a running app |
|
|
301
320
|
|
|
302
321
|
**Development:**
|
|
303
322
|
|
|
@@ -305,10 +324,14 @@ After running `npx forgedev init`, these slash commands are available inside Cla
|
|
|
305
324
|
|---------|-------------|
|
|
306
325
|
| `/plan` | Invoke planner agent for implementation planning |
|
|
307
326
|
| `/build-fix` | Incrementally fix build/lint/type errors |
|
|
327
|
+
| `/fix-loop` | Automated fix-review-regression loop until green |
|
|
328
|
+
| `/build-ui` | Build frontend UI with AI-powered generation (Google Stitch + UI UX Pro Max) |
|
|
308
329
|
| `/tdd` | Enforce test-driven development cycle |
|
|
309
330
|
| `/generate-prd` | Generates a PRD with Mermaid diagrams |
|
|
331
|
+
| `/generate-sdd` | Generates a Software Design Document from codebase |
|
|
310
332
|
| `/generate-uat` | Generates UAT scenarios from codebase |
|
|
311
333
|
| `/optimize-claude-md` | Proposes splitting an oversized CLAUDE.md |
|
|
334
|
+
| `/simplify` | Review code for reuse, quality, and structural hygiene |
|
|
312
335
|
|
|
313
336
|
**Session:**
|
|
314
337
|
|
|
@@ -317,6 +340,12 @@ After running `npx forgedev init`, these slash commands are available inside Cla
|
|
|
317
340
|
| `/save-session` | Save work context for later resumption |
|
|
318
341
|
| `/resume-session` | Load saved session and continue where you left off |
|
|
319
342
|
|
|
343
|
+
**Strategy:**
|
|
344
|
+
|
|
345
|
+
| Command | What It Does |
|
|
346
|
+
|---------|-------------|
|
|
347
|
+
| `/product-strategist` | Competitive analysis against real competitors with scored benchmarks |
|
|
348
|
+
|
|
320
349
|
## Install
|
|
321
350
|
|
|
322
351
|
```bash
|
|
@@ -329,6 +358,25 @@ npm install -g forgedev
|
|
|
329
358
|
|
|
330
359
|
Package name on npm: [`forgedev`](https://www.npmjs.com/package/forgedev)
|
|
331
360
|
|
|
361
|
+
## ChainProof — Verified AI Software Delivery
|
|
362
|
+
|
|
363
|
+
DevForge includes **ChainProof**, a trust chain system for tracking AI-generated code provenance.
|
|
364
|
+
|
|
365
|
+
Every scaffolded project gets a `.chainproof/` directory with:
|
|
366
|
+
- **Hash chain** — SHA-256 linked entries forming an immutable ledger
|
|
367
|
+
- **Ed25519 signatures** — Cryptographic proof of each decision
|
|
368
|
+
- **Code artifact tracking** — Who/what generated each file, when, with what prompt
|
|
369
|
+
|
|
370
|
+
**Local CLI** (no server required):
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
chainproof status # Show trust chain status
|
|
374
|
+
chainproof verify # Verify hash chain integrity
|
|
375
|
+
chainproof log # Show NLL (Natural Language Ledger) entries
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
All operations are local and file-based — no server required.
|
|
379
|
+
|
|
332
380
|
## Roadmap
|
|
333
381
|
|
|
334
382
|
- [ ] Go + Gin/Chi backend
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ChainProof CLI - local trust chain operations.
|
|
5
|
+
* All commands are file-based, no server required.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import { verifyChain, getChainStatus } from '../src/chainproof-bridge.js';
|
|
10
|
+
import fs from 'node:fs';
|
|
11
|
+
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
const command = args[0];
|
|
14
|
+
const projectDir = process.cwd();
|
|
15
|
+
|
|
16
|
+
function printUsage() {
|
|
17
|
+
console.log(`
|
|
18
|
+
ChainProof - Verified AI software delivery
|
|
19
|
+
|
|
20
|
+
Usage:
|
|
21
|
+
chainproof status Show trust chain status
|
|
22
|
+
chainproof verify Verify hash chain integrity
|
|
23
|
+
chainproof log Show NLL entries
|
|
24
|
+
|
|
25
|
+
Options:
|
|
26
|
+
-h, --help Show this help message
|
|
27
|
+
`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (!command || command === '--help' || command === '-h') {
|
|
31
|
+
printUsage();
|
|
32
|
+
process.exit(0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (command === 'status') {
|
|
36
|
+
try {
|
|
37
|
+
const status = getChainStatus(projectDir);
|
|
38
|
+
if (!status.initialized) {
|
|
39
|
+
console.log(' ChainProof is not initialized in this directory.');
|
|
40
|
+
console.log(' Run "devforge init" to set up trust chain tracking.');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
console.log('');
|
|
44
|
+
console.log(' ChainProof Status');
|
|
45
|
+
console.log(' -----------------');
|
|
46
|
+
console.log(` Project: ${status.projectName}`);
|
|
47
|
+
console.log(` NLL Entries: ${status.entryCount}`);
|
|
48
|
+
console.log(` Code Artifacts: ${status.artifactCount}`);
|
|
49
|
+
const hash = status.currentHash || '';
|
|
50
|
+
console.log(` Current Hash: ${hash.slice(0, 16)}...`);
|
|
51
|
+
console.log(` Unsigned Entries: ${status.unsignedEntries}`);
|
|
52
|
+
if (status.createdAt) console.log(` Created: ${status.createdAt}`);
|
|
53
|
+
if (status.lastEntry) console.log(` Last Entry: ${status.lastEntry}`);
|
|
54
|
+
console.log('');
|
|
55
|
+
} catch (err) {
|
|
56
|
+
console.error(` Failed to read chain status: ${err.message}`);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (command === 'verify') {
|
|
63
|
+
const cpDir = path.join(projectDir, '.chainproof');
|
|
64
|
+
if (!fs.existsSync(cpDir)) {
|
|
65
|
+
console.log(' ChainProof is not initialized. Nothing to verify.');
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
const result = verifyChain(projectDir);
|
|
71
|
+
if (result.valid) {
|
|
72
|
+
console.log(' ✓ Trust chain integrity verified.');
|
|
73
|
+
const status = getChainStatus(projectDir);
|
|
74
|
+
console.log(` ${status.entryCount} entries, all hashes valid.`);
|
|
75
|
+
process.exit(0);
|
|
76
|
+
} else {
|
|
77
|
+
console.error(' ✗ Trust chain integrity is broken:');
|
|
78
|
+
for (const err of result.errors) {
|
|
79
|
+
console.error(` - ${err}`);
|
|
80
|
+
}
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
} catch (err) {
|
|
84
|
+
console.error(` Failed to verify chain: ${err.message}`);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (command === 'log') {
|
|
90
|
+
const chainPath = path.join(projectDir, '.chainproof', 'chain.json');
|
|
91
|
+
if (!fs.existsSync(chainPath)) {
|
|
92
|
+
console.log(' ChainProof is not initialized. No entries to show.');
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
let chain;
|
|
97
|
+
try {
|
|
98
|
+
chain = JSON.parse(fs.readFileSync(chainPath, 'utf-8'));
|
|
99
|
+
} catch (err) {
|
|
100
|
+
console.error(` Could not read chain.json: ${err.message}`);
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (chain.entries.length === 0) {
|
|
105
|
+
console.log(' No entries in the trust chain yet.');
|
|
106
|
+
process.exit(0);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
console.log('');
|
|
110
|
+
console.log(` ChainProof Log (${chain.entries.length} entries)`);
|
|
111
|
+
console.log(' -------------------------------------');
|
|
112
|
+
for (const entry of chain.entries) {
|
|
113
|
+
const signed = entry.signature ? '✓' : '○';
|
|
114
|
+
console.log(` ${signed} [${entry.entryType}] ${entry.timestamp}`);
|
|
115
|
+
console.log(` ${entry.content.slice(0, 100)}${entry.content.length > 100 ? '...' : ''}`);
|
|
116
|
+
console.log(` hash: ${entry.chainHash.slice(0, 16)}...`);
|
|
117
|
+
console.log('');
|
|
118
|
+
}
|
|
119
|
+
process.exit(0);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Sanitize user input before printing
|
|
123
|
+
const sanitized = String(command).replace(/[\x00-\x1f\x7f-\x9f]/g, '');
|
|
124
|
+
console.error(` Unknown command: "${sanitized}"`);
|
|
125
|
+
printUsage();
|
|
126
|
+
process.exit(1);
|
package/bin/devforge.js
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forgedev",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Universal, AI-first project scaffolding CLI with Claude Code infrastructure",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"forgedev": "bin/devforge.js",
|
|
8
|
-
"devforge": "bin/devforge.js"
|
|
8
|
+
"devforge": "bin/devforge.js",
|
|
9
|
+
"chainproof": "bin/chainproof.js"
|
|
9
10
|
},
|
|
10
11
|
"scripts": {
|
|
11
12
|
"test": "vitest run",
|
|
12
|
-
"test:watch": "vitest"
|
|
13
|
+
"test:watch": "vitest",
|
|
14
|
+
"e2e": "vitest run tests/e2e-scaffold.test.js tests/uat-verification.test.js tests/user-flows.test.js",
|
|
15
|
+
"test:imports": "vitest run tests/imports-runtime.test.js",
|
|
16
|
+
"test:uat": "vitest run tests/uat-verification.test.js",
|
|
17
|
+
"test:quality": "vitest run tests/quality-gate.test.js",
|
|
18
|
+
"test:boot": "vitest run tests/boot-test.test.js --config vitest.boot.config.js",
|
|
19
|
+
"verify": "vitest run",
|
|
20
|
+
"verify:all": "vitest run && node bin/devforge.js --version",
|
|
21
|
+
"lint": "eslint \"eslint.config.js\" \"bin/**/*.js\" \"src/**/*.js\" \"tests/**/*.js\"",
|
|
22
|
+
"lint:fix": "eslint \"eslint.config.js\" \"bin/**/*.js\" \"src/**/*.js\" \"tests/**/*.js\" --fix",
|
|
23
|
+
"format": "prettier --write \"src/**/*.js\" \"bin/**/*.js\"",
|
|
24
|
+
"format:check": "prettier --check \"src/**/*.js\" \"bin/**/*.js\""
|
|
13
25
|
},
|
|
14
26
|
"keywords": [
|
|
15
27
|
"scaffolding",
|
|
@@ -18,16 +30,30 @@
|
|
|
18
30
|
"claude-code",
|
|
19
31
|
"ai-first"
|
|
20
32
|
],
|
|
21
|
-
"author": "",
|
|
33
|
+
"author": "DevForge Contributors",
|
|
22
34
|
"license": "MIT",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/abbasasad057/devforge.git"
|
|
38
|
+
},
|
|
23
39
|
"dependencies": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
40
|
+
"@inquirer/prompts": "^7.10.0",
|
|
41
|
+
"chalk": "^5.4.1"
|
|
26
42
|
},
|
|
27
43
|
"devDependencies": {
|
|
44
|
+
"@eslint/js": "^10.0.1",
|
|
45
|
+
"eslint": "^10.1.0",
|
|
46
|
+
"prettier": "^3.8.1",
|
|
28
47
|
"vitest": "^3.1.1"
|
|
29
48
|
},
|
|
30
49
|
"engines": {
|
|
31
50
|
"node": ">=18.0.0"
|
|
32
|
-
}
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"bin/",
|
|
54
|
+
"src/",
|
|
55
|
+
"templates/",
|
|
56
|
+
"LICENSE",
|
|
57
|
+
"README.md"
|
|
58
|
+
]
|
|
33
59
|
}
|