forgedev 1.2.0 → 1.4.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 +57 -10
- package/bin/chainproof.js +126 -0
- package/bin/devforge.js +1 -1
- package/package.json +25 -7
- package/src/chainproof-bridge.js +330 -0
- package/src/ci-mode.js +85 -0
- package/src/claude-configurator.js +171 -78
- package/src/cli.js +30 -7
- package/src/composer.js +242 -214
- 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 +76 -12
- package/src/menu.js +178 -0
- package/src/prompts.js +5 -12
- package/src/recommender.js +163 -30
- package/src/scanner.js +57 -2
- package/src/uat-generator.js +204 -189
- package/src/update-check.js +9 -4
- package/src/update.js +57 -13
- package/src/utils.js +162 -5
- 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/.gitignore.template +3 -0
- package/templates/base/docs/uat/UAT_TEMPLATE.md.template +1 -1
- 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 +19 -5
- package/templates/claude-code/agents/chief-of-staff.md +42 -8
- package/templates/claude-code/agents/code-quality-reviewer.md +14 -0
- package/templates/claude-code/agents/database-reviewer.md +15 -1
- 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 +36 -1
- package/templates/claude-code/agents/loop-operator.md +27 -13
- package/templates/claude-code/agents/planner.md +21 -7
- package/templates/claude-code/agents/product-strategist.md +24 -10
- 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 +14 -0
- package/templates/claude-code/agents/spec-validator.md +15 -1
- package/templates/claude-code/agents/tdd-guide.md +21 -7
- package/templates/claude-code/agents/uat-validator.md +14 -0
- package/templates/claude-code/claude-md/base.md +14 -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 +53 -31
- package/templates/claude-code/commands/fix-loop.md +211 -0
- package/templates/claude-code/commands/full-audit.md +36 -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 -40
- 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 +2 -2
- package/templates/claude-code/hooks/scripts/autofix-python.mjs +1 -1
- package/templates/claude-code/hooks/scripts/autofix-typescript.mjs +1 -1
- package/templates/claude-code/hooks/scripts/code-hygiene.mjs +293 -0
- 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 +5 -5
- package/templates/claude-code/skills/nextjs/SKILL.md +1 -1
- package/templates/claude-code/skills/playwright/SKILL.md +5 -5
- package/templates/claude-code/skills/security-api/SKILL.md +1 -1
- package/templates/claude-code/skills/security-web/SKILL.md +1 -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/__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 +3 -0
- package/templates/infra/k8s/k8s/deployment.yml.template +70 -0
- package/templates/infra/k8s/k8s/hpa.yml.template +24 -0
- package/templates/infra/k8s/k8s/ingress.yml.template +26 -0
- package/templates/infra/k8s/k8s/kustomization.yml.template +13 -0
- package/templates/infra/k8s/k8s/namespace.yml.template +4 -0
- package/templates/infra/k8s/k8s/networkpolicy.yml.template +41 -0
- package/templates/infra/k8s/k8s/secrets.yml.template +10 -0
- package/templates/infra/k8s/k8s/service.yml.template +15 -0
- package/templates/testing/load/k6/README.md.template +48 -0
- package/templates/testing/load/k6/load-test.js.template +57 -0
- package/docs/00-README.md +0 -310
- package/docs/01-universal-prompt-library.md +0 -1049
- package/docs/02-claude-code-mastery-playbook.md +0 -283
- package/docs/03-multi-agent-verification.md +0 -565
- package/docs/04-errata-and-verification-checklist.md +0 -284
- package/docs/05-universal-scaffolder-vision.md +0 -452
- package/docs/06-confidence-assessment-and-repo-prompt.md +0 -407
- package/docs/errata.md +0 -58
- package/docs/multi-agent-verification.md +0 -66
- package/docs/playbook.md +0 -95
- package/docs/prompt-library.md +0 -160
- package/docs/uat/UAT_CHECKLIST.csv +0 -9
- package/docs/uat/UAT_TEMPLATE.md +0 -163
- package/templates/claude-code/commands/done.md +0 -19
- /package/{docs/plans/.gitkeep → templates/docs-portal/fastapi/backend/app/portal/__init__.py} +0 -0
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,14 +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 |
|
|
205
208
|
| `product-strategist` | Research competitors, evaluate maturity, recommend improvements | Read-only |
|
|
206
209
|
| `production-readiness` | Production deployment readiness review | Read-only |
|
|
210
|
+
| `prompt-auditor` | Audit agent prompts for clarity, consistency, and intent protocol compliance | Read-only |
|
|
207
211
|
| `refactor-cleaner` | Dead code removal, duplicate elimination | Write |
|
|
208
212
|
| `security-reviewer` | Security audit | Read-only |
|
|
209
213
|
| `spec-validator` | Validate implementation matches specification | Read-only |
|
|
@@ -238,7 +242,9 @@ node bin/devforge.js update # check for updates
|
|
|
238
242
|
|
|
239
243
|
```
|
|
240
244
|
devforge/
|
|
241
|
-
├── bin/
|
|
245
|
+
├── bin/
|
|
246
|
+
│ ├── devforge.js # DevForge CLI entry point
|
|
247
|
+
│ └── chainproof.js # ChainProof CLI entry point
|
|
242
248
|
├── src/
|
|
243
249
|
│ ├── cli.js # Command router (new, init, doctor, update)
|
|
244
250
|
│ ├── index.js # New project orchestrator (guided + developer)
|
|
@@ -255,7 +261,16 @@ devforge/
|
|
|
255
261
|
│ ├── doctor-prompts.js # Fix prompt generators
|
|
256
262
|
│ ├── update-check.js # npm registry version check
|
|
257
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
|
|
258
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
|
|
259
274
|
├── templates/ # Scaffold templates by category
|
|
260
275
|
│ ├── base/ # Every project gets this
|
|
261
276
|
│ ├── frontend/nextjs/ # Next.js App Router
|
|
@@ -264,12 +279,13 @@ devforge/
|
|
|
264
279
|
│ ├── auth/ # NextAuth, JWT
|
|
265
280
|
│ ├── testing/ # Vitest, Playwright, Pytest
|
|
266
281
|
│ ├── infra/ # Docker Compose, GitHub Actions
|
|
282
|
+
│ ├── chainproof/ # ChainProof per-stack configs
|
|
267
283
|
│ └── claude-code/ # Hooks, CLAUDE.md, skills, agents, commands
|
|
268
284
|
├── tests/ # Vitest tests
|
|
269
285
|
└── docs/ # Reference documentation
|
|
270
286
|
```
|
|
271
287
|
|
|
272
|
-
## Claude Code Commands (
|
|
288
|
+
## Claude Code Commands (27)
|
|
273
289
|
|
|
274
290
|
After running `npx forgedev init`, these slash commands are available inside Claude Code:
|
|
275
291
|
|
|
@@ -280,7 +296,7 @@ After running `npx forgedev init`, these slash commands are available inside Cla
|
|
|
280
296
|
| `/workflows` | Lists all available workflows |
|
|
281
297
|
| `/status` | Project dashboard — tests, branch, changes |
|
|
282
298
|
| `/next` | Figures out your next task |
|
|
283
|
-
| `/
|
|
299
|
+
| `/help` | Interactive guide — tells you which workflow to use |
|
|
284
300
|
|
|
285
301
|
**Verification:**
|
|
286
302
|
|
|
@@ -292,6 +308,7 @@ After running `npx forgedev init`, these slash commands are available inside Cla
|
|
|
292
308
|
| `/audit-wiring` | Finds dead or unwired features |
|
|
293
309
|
| `/audit-security` | Runs a security audit |
|
|
294
310
|
| `/code-review` | Reviews uncommitted changes for security and quality |
|
|
311
|
+
| `/verify-intent` | Verify all agents comply with Intent Verification Protocol |
|
|
295
312
|
|
|
296
313
|
**Release:**
|
|
297
314
|
|
|
@@ -299,6 +316,7 @@ After running `npx forgedev init`, these slash commands are available inside Cla
|
|
|
299
316
|
|---------|-------------|
|
|
300
317
|
| `/pre-pr` | Runs the complete pre-PR checklist |
|
|
301
318
|
| `/run-uat` | Executes UAT scenarios |
|
|
319
|
+
| `/live-uat` | Interactive browser/API testing against a running app |
|
|
302
320
|
|
|
303
321
|
**Development:**
|
|
304
322
|
|
|
@@ -306,10 +324,14 @@ After running `npx forgedev init`, these slash commands are available inside Cla
|
|
|
306
324
|
|---------|-------------|
|
|
307
325
|
| `/plan` | Invoke planner agent for implementation planning |
|
|
308
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) |
|
|
309
329
|
| `/tdd` | Enforce test-driven development cycle |
|
|
310
330
|
| `/generate-prd` | Generates a PRD with Mermaid diagrams |
|
|
331
|
+
| `/generate-sdd` | Generates a Software Design Document from codebase |
|
|
311
332
|
| `/generate-uat` | Generates UAT scenarios from codebase |
|
|
312
333
|
| `/optimize-claude-md` | Proposes splitting an oversized CLAUDE.md |
|
|
334
|
+
| `/simplify` | Review code for reuse, quality, and structural hygiene |
|
|
313
335
|
|
|
314
336
|
**Session:**
|
|
315
337
|
|
|
@@ -318,6 +340,12 @@ After running `npx forgedev init`, these slash commands are available inside Cla
|
|
|
318
340
|
| `/save-session` | Save work context for later resumption |
|
|
319
341
|
| `/resume-session` | Load saved session and continue where you left off |
|
|
320
342
|
|
|
343
|
+
**Strategy:**
|
|
344
|
+
|
|
345
|
+
| Command | What It Does |
|
|
346
|
+
|---------|-------------|
|
|
347
|
+
| `/product-strategist` | Competitive analysis against real competitors with scored benchmarks |
|
|
348
|
+
|
|
321
349
|
## Install
|
|
322
350
|
|
|
323
351
|
```bash
|
|
@@ -330,6 +358,25 @@ npm install -g forgedev
|
|
|
330
358
|
|
|
331
359
|
Package name on npm: [`forgedev`](https://www.npmjs.com/package/forgedev)
|
|
332
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
|
+
|
|
333
380
|
## Roadmap
|
|
334
381
|
|
|
335
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.4.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,13 +30,20 @@
|
|
|
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": {
|
|
@@ -34,7 +53,6 @@
|
|
|
34
53
|
"bin/",
|
|
35
54
|
"src/",
|
|
36
55
|
"templates/",
|
|
37
|
-
"docs/",
|
|
38
56
|
"LICENSE",
|
|
39
57
|
"README.md"
|
|
40
58
|
]
|