vibe-forge 0.3.12 → 0.8.1
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/.claude/commands/clear-attention.md +63 -63
- package/.claude/commands/compact-context.md +52 -0
- package/.claude/commands/configure-vcs.md +102 -0
- package/.claude/commands/forge.md +218 -171
- package/.claude/commands/need-help.md +77 -77
- package/.claude/commands/update-status.md +64 -64
- package/.claude/commands/worker-loop.md +106 -106
- package/.claude/hooks/worker-loop.js +217 -0
- package/.claude/scripts/setup-worker-loop.sh +45 -45
- package/.claude/settings.json +89 -0
- package/LICENSE +21 -21
- package/README.md +253 -230
- package/agents/aegis/personality.md +303 -269
- package/agents/anvil/personality.md +278 -211
- package/agents/architect/personality.md +260 -0
- package/agents/crucible/personality.md +362 -285
- package/agents/crucible-x/personality.md +210 -0
- package/agents/ember/personality.md +293 -245
- package/agents/flux/personality.md +248 -0
- package/agents/furnace/personality.md +342 -262
- package/agents/herald/personality.md +249 -247
- package/agents/loki/personality.md +108 -0
- package/agents/oracle/personality.md +284 -0
- package/agents/pixel/personality.md +140 -0
- package/agents/planning-hub/personality.md +473 -251
- package/agents/scribe/personality.md +253 -231
- package/agents/slag/personality.md +268 -0
- package/agents/temper/personality.md +270 -0
- package/bin/cli.js +372 -325
- package/bin/dashboard/api/agents.js +333 -0
- package/bin/dashboard/api/dispatch.js +507 -0
- package/bin/dashboard/api/tasks.js +416 -0
- package/bin/dashboard/public/assets/index-BpHfsx1r.js +2 -0
- package/bin/dashboard/public/assets/index-QODv4Zn9.css +1 -0
- package/bin/dashboard/public/index.html +14 -0
- package/bin/dashboard/server.js +645 -0
- package/bin/forge-daemon.sh +477 -775
- package/bin/forge-setup.sh +661 -532
- package/bin/forge-spawn.sh +164 -159
- package/bin/forge.cmd +83 -83
- package/bin/forge.sh +566 -393
- package/bin/lib/agents.sh +177 -177
- package/bin/lib/check-aliases.js +50 -0
- package/bin/lib/colors.sh +44 -44
- package/bin/lib/config.sh +347 -271
- package/bin/lib/constants.sh +241 -171
- package/bin/lib/daemon/budgets.sh +107 -0
- package/bin/lib/daemon/dependencies.sh +146 -0
- package/bin/lib/daemon/display.sh +128 -0
- package/bin/lib/daemon/notifications.sh +273 -0
- package/bin/lib/daemon/routing.sh +93 -0
- package/bin/lib/daemon/state.sh +163 -0
- package/bin/lib/daemon/sync.sh +103 -0
- package/bin/lib/database.sh +357 -224
- package/bin/lib/frontmatter.js +106 -0
- package/bin/lib/heimdall-setup.js +113 -0
- package/bin/lib/heimdall.js +265 -0
- package/bin/lib/json.sh +264 -0
- package/bin/lib/terminal.js +452 -0
- package/bin/lib/util.sh +126 -0
- package/bin/lib/vcs.js +349 -0
- package/config/agent-manifest.yaml +237 -230
- package/config/agents.json +207 -85
- package/config/task-template.md +159 -87
- package/config/task-types.yaml +111 -106
- package/config/templates/handoff-template.md +40 -0
- package/context/agent-overrides/README.md +41 -0
- package/context/architecture.md +42 -0
- package/context/modern-conventions.md +129 -129
- package/context/project-context-template.md +122 -122
- package/docs/agents.md +473 -0
- package/docs/architecture.md +194 -0
- package/docs/commands.md +451 -0
- package/docs/security.md +195 -144
- package/package.json +77 -48
- package/.claude/hooks/worker-loop.sh +0 -141
- package/.claude/settings.local.json +0 -29
- package/agents/forge-master/capabilities.md +0 -144
- package/agents/forge-master/context-template.md +0 -128
- package/agents/forge-master/personality.md +0 -138
- package/agents/sentinel/personality.md +0 -194
- package/context/forge-state.yaml +0 -19
- package/docs/TODO.md +0 -176
- package/docs/npm-publishing.md +0 -95
- package/tasks/review/task-001.md +0 -78
package/config/task-types.yaml
CHANGED
|
@@ -1,106 +1,111 @@
|
|
|
1
|
-
# Vibe Forge Task Types
|
|
2
|
-
# Used by
|
|
3
|
-
|
|
4
|
-
task_types:
|
|
5
|
-
frontend:
|
|
6
|
-
agent: anvil
|
|
7
|
-
description: "UI components, React/Vue/Svelte, CSS, client-side logic"
|
|
8
|
-
file_patterns:
|
|
9
|
-
- "src/components/**"
|
|
10
|
-
- "src/pages/**"
|
|
11
|
-
- "src/styles/**"
|
|
12
|
-
- "*.css"
|
|
13
|
-
- "*.scss"
|
|
14
|
-
|
|
15
|
-
backend:
|
|
16
|
-
agent: furnace
|
|
17
|
-
description: "API endpoints, server logic, database operations"
|
|
18
|
-
file_patterns:
|
|
19
|
-
- "src/api/**"
|
|
20
|
-
- "src/services/**"
|
|
21
|
-
- "src/models/**"
|
|
22
|
-
- "src/middleware/**"
|
|
23
|
-
- "prisma/**"
|
|
24
|
-
|
|
25
|
-
test:
|
|
26
|
-
agent: crucible
|
|
27
|
-
description: "Unit tests, integration tests, E2E tests, bug fixes"
|
|
28
|
-
file_patterns:
|
|
29
|
-
- "**/*.test.ts"
|
|
30
|
-
- "**/*.spec.ts"
|
|
31
|
-
- "tests/**"
|
|
32
|
-
- "e2e/**"
|
|
33
|
-
|
|
34
|
-
docs:
|
|
35
|
-
agent: scribe
|
|
36
|
-
description: "Documentation, README, API docs, inline comments"
|
|
37
|
-
file_patterns:
|
|
38
|
-
- "docs/**"
|
|
39
|
-
- "*.md"
|
|
40
|
-
- "openapi.yaml"
|
|
41
|
-
|
|
42
|
-
review:
|
|
43
|
-
agent: sentinel
|
|
44
|
-
description: "Code review, quality checks, PR review"
|
|
45
|
-
auto_assign: true # All completed tasks auto-route here
|
|
46
|
-
|
|
47
|
-
release:
|
|
48
|
-
agent: herald
|
|
49
|
-
description: "Version bumps, changelog, deployment, release notes"
|
|
50
|
-
file_patterns:
|
|
51
|
-
- "CHANGELOG.md"
|
|
52
|
-
- "package.json (version)"
|
|
53
|
-
- ".github/workflows/**"
|
|
54
|
-
|
|
55
|
-
devops:
|
|
56
|
-
agent: ember
|
|
57
|
-
description: "Infrastructure, CI/CD, Docker, server management"
|
|
58
|
-
file_patterns:
|
|
59
|
-
- "Dockerfile"
|
|
60
|
-
- "docker-compose.yaml"
|
|
61
|
-
- ".github/workflows/**"
|
|
62
|
-
- "terraform/**"
|
|
63
|
-
- "k8s/**"
|
|
64
|
-
|
|
65
|
-
security:
|
|
66
|
-
agent: aegis
|
|
67
|
-
description: "Security audit, vulnerability fixes, auth hardening"
|
|
68
|
-
requires_approval: true # Needs Planning Hub sign-off
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
description: "
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
1
|
+
# Vibe Forge Task Types
|
|
2
|
+
# Used by Planning Hub for routing decisions
|
|
3
|
+
|
|
4
|
+
task_types:
|
|
5
|
+
frontend:
|
|
6
|
+
agent: anvil
|
|
7
|
+
description: "UI components, React/Vue/Svelte, CSS, client-side logic"
|
|
8
|
+
file_patterns:
|
|
9
|
+
- "src/components/**"
|
|
10
|
+
- "src/pages/**"
|
|
11
|
+
- "src/styles/**"
|
|
12
|
+
- "*.css"
|
|
13
|
+
- "*.scss"
|
|
14
|
+
|
|
15
|
+
backend:
|
|
16
|
+
agent: furnace
|
|
17
|
+
description: "API endpoints, server logic, database operations"
|
|
18
|
+
file_patterns:
|
|
19
|
+
- "src/api/**"
|
|
20
|
+
- "src/services/**"
|
|
21
|
+
- "src/models/**"
|
|
22
|
+
- "src/middleware/**"
|
|
23
|
+
- "prisma/**"
|
|
24
|
+
|
|
25
|
+
test:
|
|
26
|
+
agent: crucible
|
|
27
|
+
description: "Unit tests, integration tests, E2E tests, bug fixes"
|
|
28
|
+
file_patterns:
|
|
29
|
+
- "**/*.test.ts"
|
|
30
|
+
- "**/*.spec.ts"
|
|
31
|
+
- "tests/**"
|
|
32
|
+
- "e2e/**"
|
|
33
|
+
|
|
34
|
+
docs:
|
|
35
|
+
agent: scribe
|
|
36
|
+
description: "Documentation, README, API docs, inline comments"
|
|
37
|
+
file_patterns:
|
|
38
|
+
- "docs/**"
|
|
39
|
+
- "*.md"
|
|
40
|
+
- "openapi.yaml"
|
|
41
|
+
|
|
42
|
+
review:
|
|
43
|
+
agent: sentinel
|
|
44
|
+
description: "Code review, quality checks, PR review"
|
|
45
|
+
auto_assign: true # All completed tasks auto-route here
|
|
46
|
+
|
|
47
|
+
release:
|
|
48
|
+
agent: herald
|
|
49
|
+
description: "Version bumps, changelog, deployment, release notes"
|
|
50
|
+
file_patterns:
|
|
51
|
+
- "CHANGELOG.md"
|
|
52
|
+
- "package.json (version)"
|
|
53
|
+
- ".github/workflows/**"
|
|
54
|
+
|
|
55
|
+
devops:
|
|
56
|
+
agent: ember
|
|
57
|
+
description: "Infrastructure, CI/CD, Docker, server management"
|
|
58
|
+
file_patterns:
|
|
59
|
+
- "Dockerfile"
|
|
60
|
+
- "docker-compose.yaml"
|
|
61
|
+
- ".github/workflows/**"
|
|
62
|
+
- "terraform/**"
|
|
63
|
+
- "k8s/**"
|
|
64
|
+
|
|
65
|
+
security:
|
|
66
|
+
agent: aegis
|
|
67
|
+
description: "Security audit, vulnerability fixes, auth hardening"
|
|
68
|
+
requires_approval: true # Needs Planning Hub sign-off
|
|
69
|
+
|
|
70
|
+
redteam:
|
|
71
|
+
agent: slag
|
|
72
|
+
description: "Offensive security testing, penetration testing, red team engagements"
|
|
73
|
+
requires_approval: true # All red team actions need sign-off
|
|
74
|
+
|
|
75
|
+
priorities:
|
|
76
|
+
critical:
|
|
77
|
+
sla_hours: 0
|
|
78
|
+
description: "Blocking other work, production issue"
|
|
79
|
+
|
|
80
|
+
high:
|
|
81
|
+
sla_hours: 8
|
|
82
|
+
description: "Sprint commitment, needed today"
|
|
83
|
+
|
|
84
|
+
medium:
|
|
85
|
+
sla_hours: 40
|
|
86
|
+
description: "Sprint goal, this sprint"
|
|
87
|
+
|
|
88
|
+
low:
|
|
89
|
+
sla_hours: null
|
|
90
|
+
description: "Nice to have, when available"
|
|
91
|
+
|
|
92
|
+
complexity:
|
|
93
|
+
trivial:
|
|
94
|
+
estimated_minutes: 15
|
|
95
|
+
description: "Config change, typo fix"
|
|
96
|
+
|
|
97
|
+
low:
|
|
98
|
+
estimated_minutes: 30
|
|
99
|
+
description: "Simple function, minor feature"
|
|
100
|
+
|
|
101
|
+
medium:
|
|
102
|
+
estimated_minutes: 60
|
|
103
|
+
description: "New component, API endpoint"
|
|
104
|
+
|
|
105
|
+
high:
|
|
106
|
+
estimated_minutes: 180
|
|
107
|
+
description: "Complex feature, refactoring"
|
|
108
|
+
|
|
109
|
+
unknown:
|
|
110
|
+
estimated_minutes: null
|
|
111
|
+
description: "Needs investigation"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
task_id: {{TASK_ID}}
|
|
3
|
+
agent: {{AGENT}}
|
|
4
|
+
handoff_reason: context_limit | task_too_large | blocked | shift_change
|
|
5
|
+
created: {{ISO_TIMESTAMP}}
|
|
6
|
+
status: pending
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Session Handoff: {{TASK_ID}}
|
|
10
|
+
|
|
11
|
+
## What Was Done
|
|
12
|
+
|
|
13
|
+
- [ ] List completed subtasks or acceptance criteria
|
|
14
|
+
|
|
15
|
+
## What Remains
|
|
16
|
+
|
|
17
|
+
- [ ] List remaining subtasks or acceptance criteria
|
|
18
|
+
|
|
19
|
+
## Current State
|
|
20
|
+
|
|
21
|
+
Describe the exact state of the work so the next agent can resume:
|
|
22
|
+
|
|
23
|
+
- **Last file touched:** `path/to/file.ts`
|
|
24
|
+
- **Pattern being used:** (e.g., "React Hook Form with Zod validation")
|
|
25
|
+
- **Branch:** `task/TASK-XXX-description`
|
|
26
|
+
- **Commits so far:** (list or count)
|
|
27
|
+
|
|
28
|
+
## Key Context
|
|
29
|
+
|
|
30
|
+
Anything the next agent needs to know that isn't in the task file:
|
|
31
|
+
|
|
32
|
+
- Decisions made during this session
|
|
33
|
+
- Gotchas discovered
|
|
34
|
+
- Dependencies or blockers encountered
|
|
35
|
+
|
|
36
|
+
## Resume Instructions
|
|
37
|
+
|
|
38
|
+
1. Read this handoff file
|
|
39
|
+
2. Check out branch `task/TASK-XXX-description`
|
|
40
|
+
3. Continue from [specific file/function/line]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Agent Overrides
|
|
2
|
+
|
|
3
|
+
Place per-agent override files here to customize agent behavior for this project.
|
|
4
|
+
|
|
5
|
+
## How It Works
|
|
6
|
+
|
|
7
|
+
When Planning Hub spawns a worker, it appends the contents of
|
|
8
|
+
`context/agent-overrides/<agent-name>.md` to the agent's system prompt.
|
|
9
|
+
This lets you add project-specific rules without modifying the global
|
|
10
|
+
personality files.
|
|
11
|
+
|
|
12
|
+
## File Naming
|
|
13
|
+
|
|
14
|
+
Use the canonical agent name (matching `config/agents.json`):
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
context/agent-overrides/
|
|
18
|
+
anvil.md # Frontend-specific project rules
|
|
19
|
+
furnace.md # Backend-specific project rules
|
|
20
|
+
crucible.md # Testing conventions for this project
|
|
21
|
+
...
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## What to Put Here
|
|
25
|
+
|
|
26
|
+
- Tech stack constraints ("Use React Query, not SWR")
|
|
27
|
+
- Naming conventions specific to this project
|
|
28
|
+
- Files or directories the agent should never touch
|
|
29
|
+
- Patterns the agent should follow or avoid
|
|
30
|
+
- Project-specific testing requirements
|
|
31
|
+
|
|
32
|
+
## Example
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
# Anvil Overrides
|
|
36
|
+
|
|
37
|
+
- Use Tailwind CSS utility classes, no custom CSS files
|
|
38
|
+
- All components must be in `src/components/` with PascalCase naming
|
|
39
|
+
- Use `shadcn/ui` for base components, don't reinvent
|
|
40
|
+
- Never import from `@/lib/legacy/` (deprecated)
|
|
41
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Project Architecture
|
|
2
|
+
|
|
3
|
+
This file contains project-specific architectural decisions and guardrails.
|
|
4
|
+
Agents read this during planning and task execution to stay aligned.
|
|
5
|
+
|
|
6
|
+
For Vibe Forge's own architecture, see [docs/architecture.md](../docs/architecture.md).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Key Decisions
|
|
11
|
+
|
|
12
|
+
<!-- Add project-specific architectural decisions here -->
|
|
13
|
+
<!-- Example:
|
|
14
|
+
- **Auth:** JWT with httpOnly cookies, refresh token rotation
|
|
15
|
+
- **Database:** PostgreSQL via Prisma ORM, no raw SQL outside migrations
|
|
16
|
+
- **API:** REST for CRUD, WebSocket for real-time updates
|
|
17
|
+
-->
|
|
18
|
+
|
|
19
|
+
## Patterns
|
|
20
|
+
|
|
21
|
+
<!-- Document patterns agents should follow -->
|
|
22
|
+
<!-- Example:
|
|
23
|
+
- Repository pattern for data access (no direct DB queries in handlers)
|
|
24
|
+
- Error boundaries at route level, not in services
|
|
25
|
+
- All new endpoints require OpenAPI spec before implementation
|
|
26
|
+
-->
|
|
27
|
+
|
|
28
|
+
## Guardrails
|
|
29
|
+
|
|
30
|
+
<!-- Things agents must NOT do -->
|
|
31
|
+
<!-- Example:
|
|
32
|
+
- Never modify schema files without running `prisma migrate dev`
|
|
33
|
+
- No new dependencies without architect approval
|
|
34
|
+
- No `any` types in TypeScript
|
|
35
|
+
-->
|
|
36
|
+
|
|
37
|
+
## ADR Index
|
|
38
|
+
|
|
39
|
+
<!-- Link to Architecture Decision Records as they're created -->
|
|
40
|
+
<!-- Example:
|
|
41
|
+
- [ADR-001](../docs/adr/ADR-001-daemon-module-extraction.md) - Daemon module extraction
|
|
42
|
+
-->
|
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
# Modern Development Conventions
|
|
2
|
-
|
|
3
|
-
Reference for up-to-date tooling and naming conventions. Knowledge cutoffs can cause outdated suggestions - prefer these modern approaches.
|
|
4
|
-
|
|
5
|
-
## Docker & Containers
|
|
6
|
-
|
|
7
|
-
### Compose (V2+, 2021)
|
|
8
|
-
|
|
9
|
-
- **File name:** `compose.yml` or `compose.yaml` (NOT `docker-compose.yml`)
|
|
10
|
-
- **Command:** `docker compose` (NOT `docker-compose`)
|
|
11
|
-
- Compose V2 is built into Docker CLI, no separate install needed
|
|
12
|
-
- `docker-compose` (hyphenated) is legacy V1
|
|
13
|
-
|
|
14
|
-
```yaml
|
|
15
|
-
# compose.yml (modern)
|
|
16
|
-
services:
|
|
17
|
-
app:
|
|
18
|
-
build: .
|
|
19
|
-
ports:
|
|
20
|
-
- "3000:3000"
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Docker Best Practices
|
|
24
|
-
|
|
25
|
-
- Use multi-stage builds for smaller images
|
|
26
|
-
- Prefer `COPY` over `ADD` unless extracting archives
|
|
27
|
-
- Use `.dockerignore` to exclude node_modules, .git, etc.
|
|
28
|
-
- Pin base image versions (e.g., `node:20-alpine`, not `node:latest`)
|
|
29
|
-
|
|
30
|
-
## Package Managers
|
|
31
|
-
|
|
32
|
-
### Node.js
|
|
33
|
-
|
|
34
|
-
- **npm:** v7+ supports workspaces, lockfile v2
|
|
35
|
-
- **pnpm:** Preferred for monorepos, faster, stricter
|
|
36
|
-
- **Bun:** Fast runtime + package manager, growing adoption
|
|
37
|
-
|
|
38
|
-
### Python
|
|
39
|
-
|
|
40
|
-
- **uv:** Modern, fast replacement for pip/pip-tools (2024+)
|
|
41
|
-
- **poetry:** Dependency management + packaging
|
|
42
|
-
- **pipx:** For CLI tools (don't pip install globally)
|
|
43
|
-
|
|
44
|
-
## TypeScript
|
|
45
|
-
|
|
46
|
-
- **Config:** `tsconfig.json` with `"moduleResolution": "bundler"` for modern bundlers
|
|
47
|
-
- **Strict mode:** Always enable `"strict": true`
|
|
48
|
-
- **Node types:** `@types/node` version should match Node.js version
|
|
49
|
-
|
|
50
|
-
## Testing
|
|
51
|
-
|
|
52
|
-
### JavaScript/TypeScript
|
|
53
|
-
|
|
54
|
-
- **Vitest:** Modern, fast, Vite-native (preferred for new projects)
|
|
55
|
-
- **Jest:** Still widely used, v30+ reduces deprecated deps
|
|
56
|
-
- **Playwright:** E2E testing, cross-browser
|
|
57
|
-
|
|
58
|
-
### Python
|
|
59
|
-
|
|
60
|
-
- **pytest:** Standard, use over unittest
|
|
61
|
-
- **pytest-cov:** Coverage reporting
|
|
62
|
-
|
|
63
|
-
## CI/CD
|
|
64
|
-
|
|
65
|
-
### GitHub Actions
|
|
66
|
-
|
|
67
|
-
- Use `actions/checkout@v4`, `actions/setup-node@v4` (latest major versions)
|
|
68
|
-
- Prefer `npm ci` over `npm install` in CI
|
|
69
|
-
- Use job matrices for cross-platform testing
|
|
70
|
-
|
|
71
|
-
## Linting & Formatting
|
|
72
|
-
|
|
73
|
-
### JavaScript/TypeScript
|
|
74
|
-
|
|
75
|
-
- **ESLint v9+:** Flat config (`eslint.config.js`, not `.eslintrc`)
|
|
76
|
-
- **Prettier:** Code formatting (or use ESLint with stylistic rules)
|
|
77
|
-
- **Biome:** Fast all-in-one linter + formatter (Rust-based)
|
|
78
|
-
|
|
79
|
-
### Python
|
|
80
|
-
|
|
81
|
-
- **Ruff:** Fast linter + formatter (replaces flake8, black, isort)
|
|
82
|
-
- **mypy:** Type checking
|
|
83
|
-
|
|
84
|
-
## API Design
|
|
85
|
-
|
|
86
|
-
### REST
|
|
87
|
-
|
|
88
|
-
- Use plural nouns for collections (`/users`, not `/user`)
|
|
89
|
-
- HTTP methods: GET (read), POST (create), PUT/PATCH (update), DELETE
|
|
90
|
-
- Status codes: 200 OK, 201 Created, 400 Bad Request, 404 Not Found, 500 Server Error
|
|
91
|
-
|
|
92
|
-
### Authentication
|
|
93
|
-
|
|
94
|
-
- **JWTs:** Short expiry + refresh tokens, store in httpOnly cookies (not localStorage)
|
|
95
|
-
- **OAuth 2.0 / OIDC:** For third-party auth
|
|
96
|
-
- **Passkeys/WebAuthn:** Modern passwordless option
|
|
97
|
-
|
|
98
|
-
## Database
|
|
99
|
-
|
|
100
|
-
### ORMs
|
|
101
|
-
|
|
102
|
-
- **Prisma:** Type-safe, great DX for Node.js/TypeScript
|
|
103
|
-
- **Drizzle:** Lightweight, SQL-like syntax
|
|
104
|
-
- **SQLAlchemy 2.0:** Python standard (note: 2.0 syntax differs from 1.x)
|
|
105
|
-
|
|
106
|
-
### Migrations
|
|
107
|
-
|
|
108
|
-
- Always use migrations, never manual schema changes in production
|
|
109
|
-
- Version control migration files
|
|
110
|
-
|
|
111
|
-
## Frontend
|
|
112
|
-
|
|
113
|
-
### React
|
|
114
|
-
|
|
115
|
-
- **React 18+:** Concurrent features, Suspense
|
|
116
|
-
- Prefer function components + hooks over class components
|
|
117
|
-
- Use React Server Components where appropriate (Next.js 13+)
|
|
118
|
-
|
|
119
|
-
### State Management
|
|
120
|
-
|
|
121
|
-
- Start with React Context + useReducer
|
|
122
|
-
- **Zustand:** Simple, minimal boilerplate
|
|
123
|
-
- **TanStack Query:** For server state (caching, refetching)
|
|
124
|
-
|
|
125
|
-
## Monorepos
|
|
126
|
-
|
|
127
|
-
- **Turborepo:** Fast builds, caching
|
|
128
|
-
- **Nx:** Full-featured, good for enterprise
|
|
129
|
-
- **pnpm workspaces:** Native package manager support
|
|
1
|
+
# Modern Development Conventions
|
|
2
|
+
|
|
3
|
+
Reference for up-to-date tooling and naming conventions. Knowledge cutoffs can cause outdated suggestions - prefer these modern approaches.
|
|
4
|
+
|
|
5
|
+
## Docker & Containers
|
|
6
|
+
|
|
7
|
+
### Compose (V2+, 2021)
|
|
8
|
+
|
|
9
|
+
- **File name:** `compose.yml` or `compose.yaml` (NOT `docker-compose.yml`)
|
|
10
|
+
- **Command:** `docker compose` (NOT `docker-compose`)
|
|
11
|
+
- Compose V2 is built into Docker CLI, no separate install needed
|
|
12
|
+
- `docker-compose` (hyphenated) is legacy V1
|
|
13
|
+
|
|
14
|
+
```yaml
|
|
15
|
+
# compose.yml (modern)
|
|
16
|
+
services:
|
|
17
|
+
app:
|
|
18
|
+
build: .
|
|
19
|
+
ports:
|
|
20
|
+
- "3000:3000"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Docker Best Practices
|
|
24
|
+
|
|
25
|
+
- Use multi-stage builds for smaller images
|
|
26
|
+
- Prefer `COPY` over `ADD` unless extracting archives
|
|
27
|
+
- Use `.dockerignore` to exclude node_modules, .git, etc.
|
|
28
|
+
- Pin base image versions (e.g., `node:20-alpine`, not `node:latest`)
|
|
29
|
+
|
|
30
|
+
## Package Managers
|
|
31
|
+
|
|
32
|
+
### Node.js
|
|
33
|
+
|
|
34
|
+
- **npm:** v7+ supports workspaces, lockfile v2
|
|
35
|
+
- **pnpm:** Preferred for monorepos, faster, stricter
|
|
36
|
+
- **Bun:** Fast runtime + package manager, growing adoption
|
|
37
|
+
|
|
38
|
+
### Python
|
|
39
|
+
|
|
40
|
+
- **uv:** Modern, fast replacement for pip/pip-tools (2024+)
|
|
41
|
+
- **poetry:** Dependency management + packaging
|
|
42
|
+
- **pipx:** For CLI tools (don't pip install globally)
|
|
43
|
+
|
|
44
|
+
## TypeScript
|
|
45
|
+
|
|
46
|
+
- **Config:** `tsconfig.json` with `"moduleResolution": "bundler"` for modern bundlers
|
|
47
|
+
- **Strict mode:** Always enable `"strict": true`
|
|
48
|
+
- **Node types:** `@types/node` version should match Node.js version
|
|
49
|
+
|
|
50
|
+
## Testing
|
|
51
|
+
|
|
52
|
+
### JavaScript/TypeScript
|
|
53
|
+
|
|
54
|
+
- **Vitest:** Modern, fast, Vite-native (preferred for new projects)
|
|
55
|
+
- **Jest:** Still widely used, v30+ reduces deprecated deps
|
|
56
|
+
- **Playwright:** E2E testing, cross-browser
|
|
57
|
+
|
|
58
|
+
### Python
|
|
59
|
+
|
|
60
|
+
- **pytest:** Standard, use over unittest
|
|
61
|
+
- **pytest-cov:** Coverage reporting
|
|
62
|
+
|
|
63
|
+
## CI/CD
|
|
64
|
+
|
|
65
|
+
### GitHub Actions
|
|
66
|
+
|
|
67
|
+
- Use `actions/checkout@v4`, `actions/setup-node@v4` (latest major versions)
|
|
68
|
+
- Prefer `npm ci` over `npm install` in CI
|
|
69
|
+
- Use job matrices for cross-platform testing
|
|
70
|
+
|
|
71
|
+
## Linting & Formatting
|
|
72
|
+
|
|
73
|
+
### JavaScript/TypeScript
|
|
74
|
+
|
|
75
|
+
- **ESLint v9+:** Flat config (`eslint.config.js`, not `.eslintrc`)
|
|
76
|
+
- **Prettier:** Code formatting (or use ESLint with stylistic rules)
|
|
77
|
+
- **Biome:** Fast all-in-one linter + formatter (Rust-based)
|
|
78
|
+
|
|
79
|
+
### Python
|
|
80
|
+
|
|
81
|
+
- **Ruff:** Fast linter + formatter (replaces flake8, black, isort)
|
|
82
|
+
- **mypy:** Type checking
|
|
83
|
+
|
|
84
|
+
## API Design
|
|
85
|
+
|
|
86
|
+
### REST
|
|
87
|
+
|
|
88
|
+
- Use plural nouns for collections (`/users`, not `/user`)
|
|
89
|
+
- HTTP methods: GET (read), POST (create), PUT/PATCH (update), DELETE
|
|
90
|
+
- Status codes: 200 OK, 201 Created, 400 Bad Request, 404 Not Found, 500 Server Error
|
|
91
|
+
|
|
92
|
+
### Authentication
|
|
93
|
+
|
|
94
|
+
- **JWTs:** Short expiry + refresh tokens, store in httpOnly cookies (not localStorage)
|
|
95
|
+
- **OAuth 2.0 / OIDC:** For third-party auth
|
|
96
|
+
- **Passkeys/WebAuthn:** Modern passwordless option
|
|
97
|
+
|
|
98
|
+
## Database
|
|
99
|
+
|
|
100
|
+
### ORMs
|
|
101
|
+
|
|
102
|
+
- **Prisma:** Type-safe, great DX for Node.js/TypeScript
|
|
103
|
+
- **Drizzle:** Lightweight, SQL-like syntax
|
|
104
|
+
- **SQLAlchemy 2.0:** Python standard (note: 2.0 syntax differs from 1.x)
|
|
105
|
+
|
|
106
|
+
### Migrations
|
|
107
|
+
|
|
108
|
+
- Always use migrations, never manual schema changes in production
|
|
109
|
+
- Version control migration files
|
|
110
|
+
|
|
111
|
+
## Frontend
|
|
112
|
+
|
|
113
|
+
### React
|
|
114
|
+
|
|
115
|
+
- **React 18+:** Concurrent features, Suspense
|
|
116
|
+
- Prefer function components + hooks over class components
|
|
117
|
+
- Use React Server Components where appropriate (Next.js 13+)
|
|
118
|
+
|
|
119
|
+
### State Management
|
|
120
|
+
|
|
121
|
+
- Start with React Context + useReducer
|
|
122
|
+
- **Zustand:** Simple, minimal boilerplate
|
|
123
|
+
- **TanStack Query:** For server state (caching, refetching)
|
|
124
|
+
|
|
125
|
+
## Monorepos
|
|
126
|
+
|
|
127
|
+
- **Turborepo:** Fast builds, caching
|
|
128
|
+
- **Nx:** Full-featured, good for enterprise
|
|
129
|
+
- **pnpm workspaces:** Native package manager support
|