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.
- package/README.md +80 -7
- package/bin/devforge.js +11 -1
- package/docs/00-README.md +310 -0
- package/docs/01-universal-prompt-library.md +1049 -0
- package/docs/02-claude-code-mastery-playbook.md +283 -0
- package/docs/03-multi-agent-verification.md +565 -0
- package/docs/04-errata-and-verification-checklist.md +284 -0
- package/docs/05-universal-scaffolder-vision.md +452 -0
- package/docs/06-confidence-assessment-and-repo-prompt.md +407 -0
- package/docs/errata.md +58 -0
- package/docs/multi-agent-verification.md +66 -0
- package/docs/plans/.gitkeep +0 -0
- package/docs/playbook.md +95 -0
- package/docs/prompt-library.md +160 -0
- package/docs/uat/UAT_CHECKLIST.csv +9 -0
- package/docs/uat/UAT_TEMPLATE.md +163 -0
- package/package.json +10 -2
- package/src/claude-configurator.js +2 -0
- package/src/cli.js +16 -5
- package/src/doctor-prompts.js +9 -2
- package/src/doctor.js +19 -0
- package/src/index.js +7 -0
- package/src/update-check.js +49 -0
- package/src/update.js +33 -0
- package/src/utils.js +1 -1
- package/templates/auth/jwt-custom/backend/app/core/security.py.template +4 -1
- package/templates/backend/fastapi/backend/app/core/config.py.template +2 -2
- 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/claude-code/agents/build-error-resolver.md +4 -4
- package/templates/claude-code/agents/code-quality-reviewer.md +1 -1
- package/templates/claude-code/agents/database-reviewer.md +2 -2
- package/templates/claude-code/agents/doc-updater.md +1 -1
- package/templates/claude-code/agents/harness-optimizer.md +26 -0
- package/templates/claude-code/agents/loop-operator.md +1 -1
- package/templates/claude-code/agents/product-strategist.md +124 -0
- package/templates/claude-code/agents/security-reviewer.md +1 -0
- package/templates/claude-code/agents/spec-validator.md +31 -1
- package/templates/claude-code/agents/uat-validator.md +6 -1
- package/templates/claude-code/claude-md/base.md +3 -2
- package/templates/claude-code/claude-md/nextjs.md +1 -1
- package/templates/claude-code/commands/build-fix.md +1 -1
- package/templates/claude-code/commands/code-review.md +6 -1
- package/templates/claude-code/commands/full-audit.md +61 -0
- package/templates/claude-code/commands/workflows.md +4 -0
- package/templates/claude-code/hooks/scripts/autofix-polyglot.mjs +28 -10
- package/templates/claude-code/hooks/scripts/autofix-python.mjs +11 -4
- package/templates/claude-code/hooks/scripts/autofix-typescript.mjs +11 -3
- package/templates/claude-code/hooks/scripts/guard-protected-files.mjs +2 -2
- package/templates/claude-code/skills/ai-prompts/SKILL.md +1 -0
- package/templates/claude-code/skills/fastapi/SKILL.md +1 -1
- package/templates/claude-code/skills/git-workflow/SKILL.md +3 -3
- package/templates/claude-code/skills/nextjs/SKILL.md +1 -1
- package/templates/claude-code/skills/playwright/SKILL.md +8 -7
- package/templates/claude-code/skills/security-api/SKILL.md +2 -2
- package/templates/claude-code/skills/security-web/SKILL.md +1 -0
- package/templates/database/sqlalchemy-postgres/.env.example +1 -0
- package/templates/infra/github-actions/.github/workflows/ci.yml.template +49 -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
|
@@ -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 (
|
|
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
|
|
@@ -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}}
|
|
File without changes
|
|
@@ -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)
|