forgedev 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.
Files changed (64) hide show
  1. package/README.md +80 -7
  2. package/bin/devforge.js +11 -1
  3. package/docs/00-README.md +310 -0
  4. package/docs/01-universal-prompt-library.md +1049 -0
  5. package/docs/02-claude-code-mastery-playbook.md +283 -0
  6. package/docs/03-multi-agent-verification.md +565 -0
  7. package/docs/04-errata-and-verification-checklist.md +284 -0
  8. package/docs/05-universal-scaffolder-vision.md +452 -0
  9. package/docs/06-confidence-assessment-and-repo-prompt.md +407 -0
  10. package/docs/errata.md +58 -0
  11. package/docs/multi-agent-verification.md +66 -0
  12. package/docs/plans/.gitkeep +0 -0
  13. package/docs/playbook.md +95 -0
  14. package/docs/prompt-library.md +160 -0
  15. package/docs/uat/UAT_CHECKLIST.csv +9 -0
  16. package/docs/uat/UAT_TEMPLATE.md +163 -0
  17. package/package.json +10 -2
  18. package/src/claude-configurator.js +2 -0
  19. package/src/cli.js +16 -5
  20. package/src/doctor-prompts.js +9 -2
  21. package/src/doctor.js +19 -0
  22. package/src/index.js +7 -0
  23. package/src/update-check.js +49 -0
  24. package/src/update.js +33 -0
  25. package/src/utils.js +1 -1
  26. package/templates/auth/jwt-custom/backend/app/core/security.py.template +4 -1
  27. package/templates/backend/fastapi/backend/app/core/config.py.template +2 -2
  28. package/templates/base/docs/plans/.gitkeep +0 -0
  29. package/templates/base/docs/uat/UAT_CHECKLIST.csv.template +2 -0
  30. package/templates/base/docs/uat/UAT_TEMPLATE.md.template +22 -0
  31. package/templates/claude-code/agents/build-error-resolver.md +4 -4
  32. package/templates/claude-code/agents/code-quality-reviewer.md +1 -1
  33. package/templates/claude-code/agents/database-reviewer.md +2 -2
  34. package/templates/claude-code/agents/doc-updater.md +1 -1
  35. package/templates/claude-code/agents/harness-optimizer.md +26 -0
  36. package/templates/claude-code/agents/loop-operator.md +1 -1
  37. package/templates/claude-code/agents/product-strategist.md +124 -0
  38. package/templates/claude-code/agents/security-reviewer.md +1 -0
  39. package/templates/claude-code/agents/spec-validator.md +31 -1
  40. package/templates/claude-code/agents/uat-validator.md +6 -1
  41. package/templates/claude-code/claude-md/base.md +3 -2
  42. package/templates/claude-code/claude-md/nextjs.md +1 -1
  43. package/templates/claude-code/commands/build-fix.md +1 -1
  44. package/templates/claude-code/commands/code-review.md +6 -1
  45. package/templates/claude-code/commands/full-audit.md +61 -0
  46. package/templates/claude-code/commands/workflows.md +4 -0
  47. package/templates/claude-code/hooks/scripts/autofix-polyglot.mjs +28 -10
  48. package/templates/claude-code/hooks/scripts/autofix-python.mjs +11 -4
  49. package/templates/claude-code/hooks/scripts/autofix-typescript.mjs +11 -3
  50. package/templates/claude-code/hooks/scripts/guard-protected-files.mjs +2 -2
  51. package/templates/claude-code/skills/ai-prompts/SKILL.md +1 -0
  52. package/templates/claude-code/skills/fastapi/SKILL.md +1 -1
  53. package/templates/claude-code/skills/git-workflow/SKILL.md +3 -3
  54. package/templates/claude-code/skills/nextjs/SKILL.md +1 -1
  55. package/templates/claude-code/skills/playwright/SKILL.md +8 -7
  56. package/templates/claude-code/skills/security-api/SKILL.md +2 -2
  57. package/templates/claude-code/skills/security-web/SKILL.md +1 -0
  58. package/templates/database/sqlalchemy-postgres/.env.example +1 -0
  59. package/templates/infra/github-actions/.github/workflows/ci.yml.template +49 -0
  60. package/templates/testing/pytest/backend/tests/__init__.py +0 -0
  61. package/templates/testing/pytest/backend/tests/conftest.py.template +11 -0
  62. package/templates/testing/pytest/backend/tests/test_health.py.template +10 -0
  63. package/templates/testing/vitest/vitest.config.ts.template +18 -0
  64. package/CLAUDE.md +0 -38
@@ -16,7 +16,7 @@ description: API security best practices
16
16
  - Validate all input with Pydantic models
17
17
  - Set max lengths on string fields
18
18
  - Validate email formats, URLs, phone numbers
19
- - Reject unexpected fields (Pydantic does this by default)
19
+ - Reject unexpected fields (set `extra = "forbid"` in Pydantic model config)
20
20
  - Validate file uploads (size, type, extension)
21
21
 
22
22
  ## SQL Injection Prevention
@@ -38,7 +38,7 @@ description: API security best practices
38
38
  - Never expose stack traces to clients
39
39
  - Use generic error messages for auth failures
40
40
  - Log detailed errors server-side only
41
- - Return structured error responses: `{ error: { code, message } }`
41
+ - Return structured error responses: `{ "error": { "code": "ERR_CODE", "message": "Error description" } }`
42
42
 
43
43
  ## Secrets Management
44
44
  - Store secrets in environment variables, never in code
@@ -39,3 +39,4 @@ description: Web application security best practices
39
39
  - Use Prisma `select` or `omit` to control returned fields
40
40
  - Never log sensitive data
41
41
  - Strip internal IDs from client-facing responses when possible
42
+
@@ -1 +1,2 @@
1
1
  DATABASE_URL="postgresql+asyncpg://postgres:postgres@localhost:5432/{{PROJECT_NAME_SNAKE}}"
2
+ JWT_SECRET_KEY="change-me-generate-a-random-secret"
@@ -0,0 +1,49 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint-and-test:
11
+ runs-on: ubuntu-latest
12
+
13
+ services:
14
+ postgres:
15
+ image: postgres:17-alpine
16
+ env:
17
+ POSTGRES_DB: {{PROJECT_NAME_SNAKE}}
18
+ POSTGRES_USER: postgres
19
+ POSTGRES_PASSWORD: postgres
20
+ ports:
21
+ - 5432:5432
22
+ options: >-
23
+ --health-cmd pg_isready
24
+ --health-interval 10s
25
+ --health-timeout 5s
26
+ --health-retries 5
27
+
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+
31
+ - name: Setup Node.js
32
+ uses: actions/setup-node@v4
33
+ with:
34
+ node-version: '22'
35
+ cache: 'npm'
36
+
37
+ - name: Install dependencies
38
+ run: npm ci
39
+
40
+ - name: Lint
41
+ run: {{LINT_COMMAND}}
42
+
43
+ - name: Type check
44
+ run: {{TYPE_CHECK_COMMAND}}
45
+
46
+ - name: Test
47
+ run: {{TEST_COMMAND}}
48
+ env:
49
+ DATABASE_URL: postgresql://postgres:postgres@localhost:5432/{{PROJECT_NAME_SNAKE}}
@@ -0,0 +1,11 @@
1
+ import pytest
2
+ from httpx import ASGITransport, AsyncClient
3
+
4
+ from app.main import app
5
+
6
+
7
+ @pytest.fixture
8
+ async def client():
9
+ transport = ASGITransport(app=app)
10
+ async with AsyncClient(transport=transport, base_url="http://test") as ac:
11
+ yield ac
@@ -0,0 +1,10 @@
1
+ import pytest
2
+
3
+
4
+ @pytest.mark.asyncio
5
+ async def test_health_endpoint(client):
6
+ response = await client.get("/health")
7
+ assert response.status_code == 200
8
+ data = response.json()
9
+ assert data["status"] == "ok"
10
+ assert data["service"] == "{{PROJECT_NAME}}"
@@ -0,0 +1,18 @@
1
+ import { defineConfig } from 'vitest/config';
2
+ import path from 'path';
3
+
4
+ export default defineConfig({
5
+ test: {
6
+ environment: 'node',
7
+ include: ['src/**/*.test.{ts,tsx}'],
8
+ coverage: {
9
+ provider: 'v8',
10
+ reporter: ['text', 'json', 'html'],
11
+ },
12
+ },
13
+ resolve: {
14
+ alias: {
15
+ '@': path.resolve(__dirname, './src'),
16
+ },
17
+ },
18
+ });
package/CLAUDE.md DELETED
@@ -1,38 +0,0 @@
1
- # DevForge
2
-
3
- ## WHAT
4
- - Node.js CLI tool for universal project scaffolding
5
- - ESM modules only (no require/CommonJS)
6
- - Dependencies: Inquirer.js (prompts), Chalk (colors), Vitest (tests)
7
-
8
- ## Directory Map
9
- - `bin/` — CLI entry point (`devforge.js`)
10
- - `src/` — Core logic (index, prompts, recommender, composer, claude-configurator, uat-generator, utils)
11
- - `templates/` — Scaffold templates organized by category (base, frontend, backend, database, auth, testing, infra, claude-code)
12
- - `tests/` — Vitest test files
13
- - `docs/` — Reference documentation (prompt library, playbook, multi-agent verification)
14
-
15
- ## HOW
16
- - Lint: `npx eslint . --ext .js` (when eslint is added)
17
- - Test: `npx vitest run`
18
- - Test (watch): `npx vitest`
19
- - Manual test: `node bin/devforge.js test-output`
20
-
21
- ## Commands
22
- - `/workflows`, `/status`, `/next`, `/done` — daily workflow
23
- - `/verify-all`, `/audit-spec`, `/audit-wiring`, `/audit-security` — verification
24
- - `/pre-pr`, `/run-uat` — release workflow
25
-
26
- ## Agents (all READ-ONLY, disallowedTools: Write/Edit/MultiEdit)
27
- - code-quality-reviewer, security-reviewer, spec-validator, production-readiness, uat-validator
28
-
29
- ## RULES
30
- - ESM only — use `import`/`export`, never `require()`
31
- - All source files are plain `.js` (no TypeScript for the CLI itself)
32
- - Templates use `{{VARIABLE_NAME}}` placeholders — replaced via simple regex
33
- - Files ending in `.template` get variable substitution; all others are binary-copied
34
- - Template modules are composable: `templates/<category>/<stack>/` mirrors the output project structure
35
- - Never modify files in `docs/` — those are read-only reference documents
36
- - Keep `src/` files focused: each file has a single responsibility
37
- - The recommender is a pure function: `(serviceType, refinements) → stackConfig`
38
- - V1 supports 3 stacks: Next.js full-stack, FastAPI backend, polyglot (Next.js + FastAPI)