codeninja 3.2.0 → 4.0.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/README.md +15 -4
- package/agent/database-agent.md +24 -1
- package/agent/nodejs-agent.md +79 -0
- package/cli.js +27 -7
- package/commands/audit.workflow.md +4 -1
- package/commands/db-create-table.workflow.md +1 -1
- package/commands/initialize-project.workflow.md +21 -0
- package/ide/antigravity/.agents/personas/database-architect.md +431 -153
- package/ide/antigravity/.agents/personas/global-orchestrator.md +202 -85
- package/ide/antigravity/.agents/personas/nodejs-backend.md +368 -133
- package/ide/antigravity/.agents/personas/reactjs-frontend.md +182 -101
- package/ide/antigravity/.agents/skills/api-builder/SKILL.md +58 -0
- package/ide/antigravity/.agents/skills/code-intelligence/SKILL.md +22 -0
- package/ide/antigravity/.agents/skills/database/SKILL.md +32 -0
- package/ide/antigravity/.agents/skills/mcp-and-context/SKILL.md +76 -82
- package/ide/antigravity/.agents/skills/reactjs/SKILL.md +36 -0
- package/ide/antigravity/.agents/workflows/codeninja-api.md +76 -83
- package/ide/antigravity/.agents/workflows/codeninja-audit.md +82 -44
- package/ide/antigravity/.agents/workflows/codeninja-db-create.md +107 -94
- package/ide/antigravity/.agents/workflows/codeninja-db-drop.md +89 -67
- package/ide/antigravity/.agents/workflows/codeninja-db-index.md +86 -54
- package/ide/antigravity/.agents/workflows/codeninja-db-modify.md +126 -68
- package/ide/antigravity/.agents/workflows/codeninja-db-seed.md +87 -59
- package/ide/antigravity/.agents/workflows/codeninja-db-sync.md +77 -41
- package/ide/antigravity/.agents/workflows/codeninja-debug.md +35 -21
- package/ide/antigravity/.agents/workflows/codeninja-design.md +49 -35
- package/ide/antigravity/.agents/workflows/codeninja-explain.md +41 -20
- package/ide/antigravity/.agents/workflows/codeninja-init.md +479 -289
- package/ide/antigravity/.agents/workflows/codeninja-integrate-api.md +253 -136
- package/ide/antigravity/.agents/workflows/codeninja-modularize.md +250 -132
- package/ide/antigravity/.agents/workflows/codeninja-optimize.md +71 -29
- package/ide/antigravity/.agents/workflows/codeninja-refactor.md +50 -42
- package/ide/antigravity/.agents/workflows/codeninja-review.md +38 -21
- package/ide/antigravity/.agents/workflows/codeninja-sync.md +922 -141
- package/ide/antigravity/.agents/workflows/codeninja-test.md +34 -49
- package/ide/antigravity/.agents/workflows/codeninja-validate-page.md +449 -151
- package/ide/claude-code/.claude/CLAUDE.md +99 -0
- package/ide/claude-code/.claude/agents/database-agent.md +535 -0
- package/ide/claude-code/.claude/agents/nodejs-agent.md +493 -0
- package/ide/claude-code/.claude/agents/reactjs-agent.md +267 -0
- package/ide/claude-code/.claude/commands/codeninja-api.md +104 -0
- package/ide/claude-code/.claude/commands/codeninja-audit.md +119 -0
- package/ide/claude-code/.claude/commands/codeninja-db-create.md +138 -0
- package/ide/claude-code/.claude/commands/codeninja-db-drop.md +109 -0
- package/ide/claude-code/.claude/commands/codeninja-db-index.md +103 -0
- package/ide/claude-code/.claude/commands/codeninja-db-modify.md +165 -0
- package/ide/claude-code/.claude/commands/codeninja-db-seed.md +104 -0
- package/ide/claude-code/.claude/commands/codeninja-db-sync.md +106 -0
- package/ide/claude-code/.claude/commands/codeninja-debug.md +99 -0
- package/ide/claude-code/.claude/commands/codeninja-design.md +68 -0
- package/ide/claude-code/.claude/commands/codeninja-explain.md +61 -0
- package/ide/claude-code/.claude/commands/codeninja-init.md +529 -0
- package/ide/claude-code/.claude/commands/codeninja-integrate-api.md +453 -0
- package/ide/claude-code/.claude/commands/codeninja-modularize.md +334 -0
- package/ide/claude-code/.claude/commands/codeninja-optimize.md +129 -0
- package/ide/claude-code/.claude/commands/codeninja-refactor.md +76 -0
- package/ide/claude-code/.claude/commands/codeninja-review.md +87 -0
- package/ide/claude-code/.claude/commands/codeninja-sync.md +964 -0
- package/ide/claude-code/.claude/commands/codeninja-test.md +45 -0
- package/ide/claude-code/.claude/commands/codeninja-validate-page.md +548 -0
- package/ide/cursor/.cursor/rules/01-global-orchestrator.mdc +12 -13
- package/ide/cursor/.cursor/rules/02-mcp-and-context.mdc +47 -31
- package/ide/cursor/.cursor/rules/03-api-builder.mdc +32 -110
- package/ide/cursor/.cursor/rules/04-nodejs-generation.mdc +58 -0
- package/ide/cursor/.cursor/rules/05-database.mdc +54 -0
- package/ide/cursor/.cursor/rules/06-reactjs.mdc +36 -0
- package/ide/cursor/.cursor/rules/07-reactjs-generation.mdc +49 -0
- package/ide/cursor/.cursor/rules/08-code-intelligence.mdc +56 -0
- package/ide/cursor/.cursor/rules/09-workflow-steps.mdc +53 -0
- package/ide/vscode/.github/copilot-instructions.md +67 -382
- package/ide/vscode/.vscode/instructions/code-intelligence.instructions.md +58 -0
- package/ide/vscode/.vscode/instructions/database.instructions.md +55 -0
- package/ide/vscode/.vscode/instructions/nodejs.instructions.md +77 -0
- package/ide/vscode/.vscode/instructions/reactjs.instructions.md +42 -0
- package/package.json +2 -2
- package/tasks/ask-hashing-library.task.md +31 -0
- package/tasks/ask-language-type.task.md +26 -0
- package/tasks/ask-new-module-name.task.md +13 -0
- package/tasks/ask-new-service-name.task.md +13 -0
- package/tasks/ask-old-module-name.task.md +15 -0
- package/tasks/ask-old-service-name.task.md +13 -0
- package/tasks/ask-orm-type.task.md +26 -0
- package/tasks/collect-seed-data.task.md +19 -0
- package/tasks/generate-app.task.md +42 -0
- package/tasks/generate-common.task.md +13 -0
- package/tasks/generate-constants.task.md +13 -0
- package/tasks/generate-database.task.md +32 -0
- package/tasks/generate-encryption.task.md +28 -0
- package/tasks/generate-fast-defaults.task.md +7 -0
- package/tasks/generate-hashing.task.md +180 -0
- package/tasks/generate-headerValidator.task.md +13 -0
- package/tasks/generate-ioRedis.task.md +20 -0
- package/tasks/generate-language-en.task.md +12 -0
- package/tasks/generate-logging.task.md +12 -0
- package/tasks/generate-model.task.md +74 -6
- package/tasks/generate-notification.task.md +12 -0
- package/tasks/generate-package-json.task.md +69 -0
- package/tasks/generate-prisma-client.task.md +56 -0
- package/tasks/generate-prisma-schema.task.md +71 -0
- package/tasks/generate-rateLimiter.task.md +20 -0
- package/tasks/generate-readme.task.md +24 -0
- package/tasks/generate-response.task.md +27 -0
- package/tasks/generate-route-manager.task.md +32 -0
- package/tasks/generate-route.task.md +37 -0
- package/tasks/generate-swagger.task.md +8 -0
- package/tasks/generate-template.task.md +12 -0
- package/tasks/generate-tsconfig.task.md +38 -0
- package/tasks/generate-validator.task.md +31 -0
- package/ide/cursor/.cursor/rules/04-database.mdc +0 -90
- package/ide/cursor/.cursor/rules/05-reactjs.mdc +0 -147
- package/ide/cursor/.cursor/rules/06-code-intelligence.mdc +0 -112
package/README.md
CHANGED
|
@@ -2,8 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
AI agent scaffolding system for Node.js, React, and PostgreSQL projects.
|
|
4
4
|
|
|
5
|
-
**
|
|
6
|
-
|
|
5
|
+
**v4.0** — Multi-agent architecture with true parallel sub-agents. Full Claude Code support, TypeScript scaffolding, Prisma ORM, and bcrypt/argon2 password hashing. IDE-aware installer for Claude Code, Antigravity, Cursor, and VS Code.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What is new in v4.0
|
|
10
|
+
|
|
11
|
+
- **Multi-agent architecture** — True parallel sub-agents in Claude Code and Antigravity. Orchestrator spawns `nodejs-agent` and `database-agent` simultaneously during `/codeninja:init`
|
|
12
|
+
- **Claude Code support** — Full `.claude/` integration: `CLAUDE.md` orchestrator, 20 slash commands, 3 dedicated sub-agents
|
|
13
|
+
- **TypeScript support** — NodeJS services can now be scaffolded in TypeScript. All generated files support both JS and TS
|
|
14
|
+
- **Prisma ORM** — Optional Prisma support for PostgreSQL, MySQL, and MongoDB alongside the existing raw driver path
|
|
15
|
+
- **Password hashing** — Replaced reversible AES encryption of passwords with bcrypt/argon2 hashing via `utilities/hashing.js`
|
|
16
|
+
- **5 missing task files** — Fixed workflow references to previously missing tasks
|
|
7
17
|
|
|
8
18
|
---
|
|
9
19
|
|
|
@@ -16,10 +26,11 @@ npx codeninja init
|
|
|
16
26
|
Auto-detects your IDE. Force a specific one with `--ide`:
|
|
17
27
|
|
|
18
28
|
```bash
|
|
29
|
+
npx codeninja init --ide=claude-code # Claude Code
|
|
19
30
|
npx codeninja init --ide=antigravity # Google Antigravity IDE
|
|
20
31
|
npx codeninja init --ide=cursor # Cursor
|
|
21
32
|
npx codeninja init --ide=vscode # VS Code + GitHub Copilot
|
|
22
|
-
npx codeninja init --ide=all # All
|
|
33
|
+
npx codeninja init --ide=all # All four
|
|
23
34
|
```
|
|
24
35
|
|
|
25
36
|
---
|
|
@@ -84,7 +95,7 @@ npx codeninja init --ide=all # All three
|
|
|
84
95
|
| `/codeninja:refactor` | Rename with full context tracking |
|
|
85
96
|
| `/codeninja:sync` | Scan repo and rebuild context |
|
|
86
97
|
|
|
87
|
-
### Code intelligence
|
|
98
|
+
### Code intelligence
|
|
88
99
|
|
|
89
100
|
| Command | Description |
|
|
90
101
|
|---|---|
|
package/agent/database-agent.md
CHANGED
|
@@ -296,7 +296,11 @@ Tables that NEVER receive seed data in the table file:
|
|
|
296
296
|
|
|
297
297
|
Seed data rules:
|
|
298
298
|
- Seed INSERT always comes AFTER the GRANT line
|
|
299
|
-
- Passwords in seed data
|
|
299
|
+
- Passwords in seed data MUST be pre-hashed using bcrypt (salt rounds 12+). Never store
|
|
300
|
+
plaintext passwords. Never store AES-encrypted passwords (reversible — security risk).
|
|
301
|
+
When the user needs to seed a password value, show this instruction:
|
|
302
|
+
"Generate a bcrypt hash first: node -e \"require('bcryptjs').hash('yourpassword', 12).then(console.log)\""
|
|
303
|
+
The agent never generates a hash value — the developer provides it.
|
|
300
304
|
- Use multi-row INSERT (single INSERT with multiple value tuples) for efficiency
|
|
301
305
|
|
|
302
306
|
---
|
|
@@ -439,6 +443,25 @@ echo "Database reset complete."
|
|
|
439
443
|
|
|
440
444
|
---
|
|
441
445
|
|
|
446
|
+
## Prisma Schema Generation (orm == "prisma" only)
|
|
447
|
+
|
|
448
|
+
When `context.db.orm == "prisma"`, the `@db:create-table` command generates BOTH:
|
|
449
|
+
1. The SQL migration file (always — source of truth for DBA review and version control)
|
|
450
|
+
2. A Prisma model block appended to `prisma/schema.prisma`
|
|
451
|
+
|
|
452
|
+
### SQL table → Prisma model mapping rules:
|
|
453
|
+
- `tbl_users` → `model Users` (strip `tbl_`, PascalCase)
|
|
454
|
+
- `id` BIGINT IDENTITY → `id BigInt @id @default(autoincrement())`
|
|
455
|
+
- `created_at TIMESTAMPTZ` → `createdAt DateTime @default(now()) @map("created_at")`
|
|
456
|
+
- `updated_at TIMESTAMPTZ` → `updatedAt DateTime? @updatedAt @map("updated_at")`
|
|
457
|
+
- `is_deleted BOOLEAN` → `isDeleted Boolean @default(false) @map("is_deleted")`
|
|
458
|
+
- FK `user_id BIGINT` → `userId BigInt @map("user_id")` + relation field pointing to Users
|
|
459
|
+
- Always add `@@map("tbl_users")` at the end of every model (maps Prisma name to actual table)
|
|
460
|
+
|
|
461
|
+
After appending to schema.prisma → always tell user: `npx prisma generate`
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
442
465
|
## ══════════════════════════════════════
|
|
443
466
|
## SUPPORTED COMMANDS
|
|
444
467
|
## ══════════════════════════════════════
|
package/agent/nodejs-agent.md
CHANGED
|
@@ -230,6 +230,85 @@ Both use AES-256-CBC with KEY (32 chars) and IV (16 chars) from .env.
|
|
|
230
230
|
|
|
231
231
|
---
|
|
232
232
|
|
|
233
|
+
## Password Hashing Utility
|
|
234
|
+
|
|
235
|
+
`utilities/hashing.js` (or `.ts`) is the ONLY file that handles password hashing.
|
|
236
|
+
Never use `utilities/encryption.js` for passwords — encryption is reversible.
|
|
237
|
+
|
|
238
|
+
| Library | When used | Notes |
|
|
239
|
+
|---|---|---|
|
|
240
|
+
| `bcryptjs` | Fast init (default) + most deployments | Pure JS, no native build tools required |
|
|
241
|
+
| `argon2` | Manual init, user preference | Stronger algorithm, requires native build tools |
|
|
242
|
+
|
|
243
|
+
**Usage in model files (JavaScript):**
|
|
244
|
+
```javascript
|
|
245
|
+
const { hashPassword, verifyPassword } = require('../../utilities/hashing');
|
|
246
|
+
// Register: const hash = await hashPassword(plainText)
|
|
247
|
+
// Login: const ok = await verifyPassword(plainText, storedHash)
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Usage in model files (TypeScript):**
|
|
251
|
+
```typescript
|
|
252
|
+
import { hashPassword, verifyPassword } from '../../utilities/hashing';
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Wave 1 generation: `generate-hashing` runs in Wave 1 alongside `generate-encryption`.
|
|
256
|
+
Both are independent foundation utilities with no dependencies on each other.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## ORM / Database Access
|
|
261
|
+
|
|
262
|
+
Read `context.db.orm`:
|
|
263
|
+
|
|
264
|
+
| `orm` value | Config file | Query style |
|
|
265
|
+
|---|---|---|
|
|
266
|
+
| `"none"` | `config/database.js` or `.ts` — pg/mysql2/mongoose Pool | Parameterized SQL: `$1`, `$2` placeholders |
|
|
267
|
+
| `"prisma"` | `config/prisma.js` or `.ts` — PrismaClient singleton | Prisma Client API methods |
|
|
268
|
+
|
|
269
|
+
**Prisma rules (when orm == "prisma"):**
|
|
270
|
+
- NEVER instantiate `new PrismaClient()` in model files — always import from `config/prisma`
|
|
271
|
+
- Accessor naming: `tbl_users` → `prisma.users` (lowercase, no `tbl_` prefix)
|
|
272
|
+
- Always use `select` — never return all columns
|
|
273
|
+
- After generating `prisma/schema.prisma` → tell user to run `npx prisma generate`
|
|
274
|
+
- After `@db:create-table` with Prisma → append model block to schema.prisma AND run `npx prisma generate`
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## TypeScript Support
|
|
279
|
+
|
|
280
|
+
Read `context.services[name].language` (or `context.current_init.language`).
|
|
281
|
+
|
|
282
|
+
### When `language == "typescript"`:
|
|
283
|
+
- All generated service files use `.ts` extension
|
|
284
|
+
- Use `import`/`export` syntax (ES modules, compiled to CommonJS via tsconfig)
|
|
285
|
+
- Every function and parameter has explicit type annotations
|
|
286
|
+
- `app.ts` entry point imports: `import express, { Application } from 'express'`
|
|
287
|
+
- Route files import: `import { Router, Request, Response } from 'express'`
|
|
288
|
+
- `tsconfig.json` generated at service root (Wave 1)
|
|
289
|
+
- `package.json` includes typescript, ts-node, nodemon, and all @types/* packages
|
|
290
|
+
- Build: `npm run build` compiles to `dist/`; `npm run dev` runs via ts-node
|
|
291
|
+
|
|
292
|
+
### When `language == "javascript"`:
|
|
293
|
+
- All generated service files use `.js` extension (existing behavior)
|
|
294
|
+
- Use `require()`/`module.exports` (CommonJS)
|
|
295
|
+
- No type annotations, no tsconfig.json, no typescript in package.json
|
|
296
|
+
|
|
297
|
+
### File extension mapping:
|
|
298
|
+
| File | JS | TS |
|
|
299
|
+
|---|---|---|
|
|
300
|
+
| app | `app.js` | `app.ts` |
|
|
301
|
+
| config/database | `database.js` | `database.ts` |
|
|
302
|
+
| config/prisma | `prisma.js` | `prisma.ts` |
|
|
303
|
+
| utilities/encryption | `encryption.js` | `encryption.ts` |
|
|
304
|
+
| utilities/hashing | `hashing.js` | `hashing.ts` |
|
|
305
|
+
| utilities/response | `response.js` | `response.ts` |
|
|
306
|
+
| middleware/headerValidator | `headerValidator.js` | `headerValidator.ts` |
|
|
307
|
+
| modules/v1/*/route | `route.js` | `route.ts` |
|
|
308
|
+
| modules/v1/*/_model | `_model.js` | `_model.ts` |
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
233
312
|
## Response Wrapper Behavior
|
|
234
313
|
|
|
235
314
|
Read `context.services[<name>].encrypted_transport`:
|
package/cli.js
CHANGED
|
@@ -12,10 +12,11 @@
|
|
|
12
12
|
* codeninja version Show installed version
|
|
13
13
|
*
|
|
14
14
|
* Supported IDEs:
|
|
15
|
+
* claude-code Claude Code (.claude/ structure with CLAUDE.md + commands + agents)
|
|
15
16
|
* antigravity Google Antigravity IDE (.agents/ structure + slash commands)
|
|
16
17
|
* cursor Cursor IDE (.cursor/rules/ + .cursor/mcp.json)
|
|
17
18
|
* vscode VS Code / GitHub Copilot (.github/ + .vscode/mcp.json)
|
|
18
|
-
* all Install files for all
|
|
19
|
+
* all Install files for all four IDEs
|
|
19
20
|
*/
|
|
20
21
|
|
|
21
22
|
const fs = require('fs');
|
|
@@ -49,9 +50,18 @@ process.exit(1);
|
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* Detects which IDE is likely active by checking for known config files and env vars.
|
|
52
|
-
* @returns {'antigravity'|'cursor'|'vscode'|'unknown'}
|
|
53
|
+
* @returns {'claude-code'|'antigravity'|'cursor'|'vscode'|'unknown'}
|
|
53
54
|
*/
|
|
55
|
+
// IDE detection priority:
|
|
56
|
+
// 1. .claude/ → claude-code
|
|
57
|
+
// 2. .agents/ → antigravity
|
|
58
|
+
// 3. .cursor/ → cursor
|
|
59
|
+
// 4. .vscode/ → vscode
|
|
54
60
|
function detectIDE() {
|
|
61
|
+
// Check for Claude Code (highest priority)
|
|
62
|
+
if (fs.existsSync(path.join(projectRoot, '.claude'))) {
|
|
63
|
+
return 'claude-code';
|
|
64
|
+
}
|
|
55
65
|
// Antigravity: ~/.gemini/antigravity/ directory exists
|
|
56
66
|
if (process.env.ANTIGRAVITY_IDE ||
|
|
57
67
|
fs.existsSync(path.join(os.homedir(), '.gemini', 'antigravity'))) {
|
|
@@ -79,13 +89,13 @@ function runInit() {
|
|
|
79
89
|
if (!ideFlag && targetIDE === 'unknown') {
|
|
80
90
|
console.log('\ncodeninja could not auto-detect your IDE.');
|
|
81
91
|
console.log('Installing for all supported IDEs instead.');
|
|
82
|
-
console.log('(Use --ide=antigravity | --ide=cursor | --ide=vscode to be specific)\n');
|
|
92
|
+
console.log('(Use --ide=claude-code | --ide=antigravity | --ide=cursor | --ide=vscode to be specific)\n');
|
|
83
93
|
targetIDE = 'all';
|
|
84
94
|
}
|
|
85
95
|
|
|
86
96
|
const detectedLabel = ideFlag ? 'forced via --ide' : 'auto-detected';
|
|
87
97
|
console.log('\ncodeninja — installing into ' + projectRoot);
|
|
88
|
-
console.log('IDE: ' + (installAll ? 'all (antigravity + cursor + vscode)' : targetIDE)
|
|
98
|
+
console.log('IDE: ' + (installAll ? 'all (claude-code + antigravity + cursor + vscode)' : targetIDE)
|
|
89
99
|
+ ' (' + detectedLabel + ')\n');
|
|
90
100
|
|
|
91
101
|
if (fs.existsSync(destDir)) {
|
|
@@ -124,10 +134,11 @@ function runInit() {
|
|
|
124
134
|
|
|
125
135
|
// ── 4: IDE-specific project files ─────────────────────────────────────
|
|
126
136
|
console.log('\n[ 4/6 ] Writing IDE-specific files...');
|
|
127
|
-
const ides = installAll ? ['antigravity', 'cursor', 'vscode'] : [targetIDE];
|
|
137
|
+
const ides = installAll ? ['claude-code', 'antigravity', 'cursor', 'vscode'] : [targetIDE];
|
|
128
138
|
for (const ide of ides) {
|
|
129
139
|
console.log('\n ── ' + ide.toUpperCase() + ' ──');
|
|
130
|
-
if (ide === '
|
|
140
|
+
if (ide === 'claude-code') installClaudeCodeFiles();
|
|
141
|
+
else if (ide === 'antigravity') installAntigravityFiles();
|
|
131
142
|
else if (ide === 'cursor') installCursorFiles();
|
|
132
143
|
else if (ide === 'vscode') installVSCodeFiles();
|
|
133
144
|
else console.log(' Unknown IDE: ' + ide + ' — skipped');
|
|
@@ -176,6 +187,14 @@ function runInit() {
|
|
|
176
187
|
|
|
177
188
|
// ─── IDE file installers ──────────────────────────────────────────────────────
|
|
178
189
|
|
|
190
|
+
function installClaudeCodeFiles() {
|
|
191
|
+
const src = path.join(srcDir, 'ide', 'claude-code', '.claude');
|
|
192
|
+
const dest = path.join(projectRoot, '.claude');
|
|
193
|
+
if (!fs.existsSync(src)) { console.log(' [SKIP] ide/claude-code source not found'); return; }
|
|
194
|
+
copyDir(src, dest);
|
|
195
|
+
console.log('✓ Installed .claude/ (CLAUDE.md + 20 commands + 3 agents)');
|
|
196
|
+
}
|
|
197
|
+
|
|
179
198
|
function installAntigravityFiles() {
|
|
180
199
|
const src = path.join(srcDir, 'ide', 'antigravity', '.agents');
|
|
181
200
|
const dest = path.join(projectRoot, '.agents');
|
|
@@ -342,10 +361,11 @@ Usage:
|
|
|
342
361
|
codeninja help Show this help
|
|
343
362
|
|
|
344
363
|
IDE values for --ide:
|
|
364
|
+
claude-code → .claude/ (CLAUDE.md + 20 commands + 3 agents)
|
|
345
365
|
antigravity → .agents/ structure (slash commands)
|
|
346
366
|
cursor → .cursor/rules/ + mcp.json
|
|
347
367
|
vscode → .github/copilot-instructions.md + .vscode/mcp.json
|
|
348
|
-
all → all
|
|
368
|
+
all → all four IDEs
|
|
349
369
|
|
|
350
370
|
Examples:
|
|
351
371
|
codeninja init
|
|
@@ -66,7 +66,10 @@ a major refactor.
|
|
|
66
66
|
- [ ] All model functions return exactly { responsecode, responsemsg,
|
|
67
67
|
responsedata } — no extra keys, no throws?
|
|
68
68
|
- [ ] No req/res objects in any model file?
|
|
69
|
-
- [ ] Passwords encrypted using utilities/
|
|
69
|
+
- [ ] Passwords HASHED (not encrypted) using `utilities/hashing.js` before storage?
|
|
70
|
+
Correct: `await hashPassword(plainText)` — one-way bcrypt/argon2 hash
|
|
71
|
+
Wrong: `encrypt(password)` from encryption.js — reversible AES, not safe for passwords
|
|
72
|
+
- [ ] No direct bcrypt/argon2 imports in route.js or model files? All hashing routed through utilities/hashing.js?
|
|
70
73
|
- [ ] Session tokens generated only via common.generateSessionCode?
|
|
71
74
|
- [ ] No crypto-js or cryptlib imported directly in model files?
|
|
72
75
|
- [ ] No direct res.json() calls in route.js files?
|
|
@@ -105,7 +105,7 @@ file must pass ALL rules defined in database-agent.md.
|
|
|
105
105
|
11. Run task: `ask-table-seed-data`
|
|
106
106
|
- Ask: "Does this table need seed/initial data?"
|
|
107
107
|
- Guidance: suggest YES only for reference/master data tables
|
|
108
|
-
- If yes → run task: `
|
|
108
|
+
- If yes → run task: `collect-seed-data`
|
|
109
109
|
- Stores: `context.current_db.seed_rows[]`
|
|
110
110
|
|
|
111
111
|
---
|
|
@@ -89,6 +89,10 @@ After all three tasks:
|
|
|
89
89
|
- Run task: `ask-encrypted-transport`
|
|
90
90
|
Stores: `context.current_init.encrypted_transport`
|
|
91
91
|
|
|
92
|
+
- Run task: `ask-language-type`
|
|
93
|
+
Stores: `context.current_init.language`
|
|
94
|
+
Only runs for project_type == nodejs. Skipped for reactjs and database-only.
|
|
95
|
+
|
|
92
96
|
- Run task: `ask-supported-languages`
|
|
93
97
|
Stores: `context.current_init.supported_languages[]`
|
|
94
98
|
|
|
@@ -118,6 +122,10 @@ After all three tasks:
|
|
|
118
122
|
use existing or configure new?
|
|
119
123
|
- Stores: `context.db.type`
|
|
120
124
|
|
|
125
|
+
4.5. Run task: `ask-orm-type`
|
|
126
|
+
- Stores: `context.db.orm`
|
|
127
|
+
- Fast mode: silently sets orm = "none"
|
|
128
|
+
|
|
121
129
|
5. If `init_mode == "manual"`:
|
|
122
130
|
Run task: `ask-database-config`
|
|
123
131
|
- Collects: name, host, port, user in one grouped display
|
|
@@ -241,6 +249,11 @@ not encrypted.
|
|
|
241
249
|
`context.current_init.redis_port`
|
|
242
250
|
(If init_mode == "fast" → handled by generate-fast-defaults)
|
|
243
251
|
|
|
252
|
+
21. If `init_mode == "manual"` AND `project_type == "nodejs"`:
|
|
253
|
+
Run task: `ask-hashing-library`
|
|
254
|
+
- Options: bcryptjs (recommended) / argon2
|
|
255
|
+
- Stores: `context.current_init.hashing_library`
|
|
256
|
+
|
|
244
257
|
---
|
|
245
258
|
|
|
246
259
|
### Phase 5b — Auto-populate Defaults (fast mode, nodejs only)
|
|
@@ -254,6 +267,7 @@ Run task: `generate-fast-defaults`
|
|
|
254
267
|
- Silently sets all values not yet in context.current_init
|
|
255
268
|
- No output, no questions — values appear in summary
|
|
256
269
|
- See task description for full list of what is auto-generated
|
|
270
|
+
- `hashing_library` → "bcryptjs" (fast mode default — no native bindings, production-safe)
|
|
257
271
|
|
|
258
272
|
---
|
|
259
273
|
|
|
@@ -326,7 +340,13 @@ Run task: `generate-fast-defaults`
|
|
|
326
340
|
- config/template.js → task: generate-template
|
|
327
341
|
- logger/logging.js → task: generate-logging
|
|
328
342
|
- utilities/encryption.js → task: generate-encryption
|
|
343
|
+
- utilities/hashing.js (or .ts) → task: generate-hashing
|
|
344
|
+
- tsconfig.json → task: generate-tsconfig
|
|
345
|
+
(Only generated when language == "typescript")
|
|
329
346
|
- languages/<lang>.js for each in supported_languages[] → task: generate-language-en
|
|
347
|
+
- If `context.db.orm == "prisma"`:
|
|
348
|
+
- prisma/schema.prisma → task: generate-prisma-schema
|
|
349
|
+
- config/prisma.js (or .ts) → task: generate-prisma-client
|
|
330
350
|
- enc_dec.html OR enc_dec.php (based on client_type) → task: generate-enc-dec-html or generate-enc-dec-php
|
|
331
351
|
- <service_name>/pem/ directory with .gitkeep
|
|
332
352
|
- <service_name>/images/ directory with .gitkeep
|
|
@@ -338,6 +358,7 @@ Run task: `generate-fast-defaults`
|
|
|
338
358
|
while Wave 1 is still completing.
|
|
339
359
|
|
|
340
360
|
- config/database.js → task: generate-database
|
|
361
|
+
(Skipped when orm == "prisma" — Prisma client replaces it)
|
|
341
362
|
- utilities/ioRedis.js → task: generate-ioRedis
|
|
342
363
|
- utilities/response.js → task: generate-response
|
|
343
364
|
|