nex-code 0.4.20 → 0.4.22

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.
@@ -0,0 +1,17 @@
1
+ <!-- Few-shot example: agentic / multi-agent parallel work
2
+ Used by cli/few-shot.js — keep under 250 tokens total.
3
+ Generic placeholders only. -->
4
+
5
+ user: Refactor the auth module across backend and frontend in parallel.
6
+
7
+ A: |
8
+ I'll split this into independent sub-tasks and run agents in parallel.
9
+ Step 1 — read the entry points to identify module boundaries:
10
+ → read_file("src/index.js")
11
+ → read_file("frontend/src/App.jsx")
12
+ Step 2 — spawn focused sub-agents for each scope:
13
+ → spawn_agents([
14
+ {task: "refactor src/auth/ to use new session API", scope: ["src/auth/"]},
15
+ {task: "update frontend/src/auth/ components for new API", scope: ["frontend/src/auth/"]}
16
+ ])
17
+ Step 3 — review each agent's changes and verify consistency.
@@ -0,0 +1,14 @@
1
+ <!-- Few-shot example: coding / bug fix
2
+ Used by cli/few-shot.js — keep under 250 tokens total.
3
+ Generic placeholders only. -->
4
+
5
+ user: The request handler crashes on empty input, can you fix it?
6
+
7
+ A: |
8
+ I'll read the handler first, then make a targeted fix.
9
+ Step 1 — read the file to understand the current logic:
10
+ → read_file("src/handlers/request.js")
11
+ Step 2 — edit only the lines that cause the crash:
12
+ → edit_file("src/handlers/request.js", old_string, new_string)
13
+ Step 3 — run the related tests to confirm:
14
+ → bash("npm test -- --testPathPattern=request")
@@ -0,0 +1,14 @@
1
+ <!-- Few-shot example: data / Django ORM + PostgreSQL optimization
2
+ Used by cli/few-shot.js — keep under 250 tokens total.
3
+ Generic placeholders only. -->
4
+
5
+ user: The list page loads slowly with 500+ database entries.
6
+
7
+ A: |
8
+ I'll find the slow query, check for missing select_related or indexes.
9
+ Step 1 — find the queryset that powers the list view:
10
+ → grep("objects\\.all\\|objects\\.filter", "src/views.py")
11
+ Step 2 — read the view and model to see the query and relations:
12
+ → read_file("src/views.py")
13
+ Step 3 — add select_related/prefetch_related or a db_index:
14
+ → edit_file("src/views.py", old_string, new_string)
@@ -0,0 +1,15 @@
1
+ <!-- Few-shot example: frontend / React component bug
2
+ Used by cli/few-shot.js — keep under 250 tokens total.
3
+ Generic placeholders only. -->
4
+
5
+ user: The list component re-renders but still shows stale data after update.
6
+
7
+ A: |
8
+ I'll read the component to trace the state flow, then fix it there.
9
+ Step 1 — read the component file:
10
+ → read_file("src/components/ItemList.jsx")
11
+ Step 2 — check the state or store it depends on:
12
+ → grep("useItemStore\|itemContext", "src/")
13
+ → read_file("src/store/itemStore.js")
14
+ Step 3 — fix the state update in the component that owns it:
15
+ → edit_file("src/components/ItemList.jsx", old_string, new_string)
@@ -0,0 +1,15 @@
1
+ # Code Review Skill
2
+
3
+ When asked to review code, follow this structured approach:
4
+
5
+ ## Review Checklist
6
+
7
+ 1. **Security**: Check for injection, XSS, hardcoded secrets, insecure APIs
8
+ 2. **Performance**: Look for N+1 queries, unnecessary re-renders, missing caching
9
+ 3. **Correctness**: Verify edge cases, error handling, null checks
10
+ 4. **Maintainability**: Assess naming, complexity, code organization
11
+ 5. **Testing**: Check test coverage for new/changed code
12
+
13
+ ## Output Format
14
+
15
+ Rate each category 1-5 and provide specific findings with file:line references.
@@ -0,0 +1,17 @@
1
+ module.exports = {
2
+ name: "docker-deploy",
3
+ description: "Docker deployment helpers for containerized applications",
4
+ instructions: `When deploying Docker containers:
5
+ 1. Always build with --no-cache for production images
6
+ 2. Use multi-stage builds to minimize image size
7
+ 3. Tag with both latest and version-specific tags
8
+ 4. Run health checks after deployment
9
+ 5. Keep the previous image as rollback target`,
10
+ commands: [
11
+ {
12
+ cmd: "/docker-build",
13
+ desc: "Build and tag Docker image",
14
+ },
15
+ ],
16
+ tools: [],
17
+ };
@@ -0,0 +1,23 @@
1
+ # Git Workflow Skill
2
+
3
+ Enforce a structured git workflow:
4
+
5
+ ## Branch Naming
6
+
7
+ - `feat/description` — new features
8
+ - `fix/description` — bug fixes
9
+ - `refactor/description` — code restructuring
10
+ - `docs/description` — documentation changes
11
+
12
+ ## Commit Messages
13
+
14
+ Use conventional commits: `type: description`
15
+ Types: feat, fix, docs, test, refactor, chore
16
+
17
+ ## PR Process
18
+
19
+ 1. Create feature branch from devel
20
+ 2. Make focused changes
21
+ 3. Write tests
22
+ 4. Open PR against devel
23
+ 5. Squash merge after approval
@@ -0,0 +1,15 @@
1
+ <!-- Few-shot example: sysadmin / AlmaLinux server debugging
2
+ Used by cli/few-shot.js — keep under 250 tokens total.
3
+ Generic placeholders only — no real hostnames, IPs, or paths. -->
4
+
5
+ user: The web app is showing 502 bad gateway on the server.
6
+
7
+ A: |
8
+ I'll check the server via SSH — nginx logs first, then the app service.
9
+ Step 1 — check the nginx error log on the server:
10
+ → ssh_exec(server, "tail -60 /var/log/nginx/error.log")
11
+ Step 2 — check if the gunicorn service is running:
12
+ → service_logs(server, "myapp", lines=40)
13
+ Step 3 — fix the issue on the server and restart:
14
+ → ssh_exec(server, "sed -i 's/broken/fixed/' /home/user/project/app.py")
15
+ → service_manage(server, "myapp", "restart")
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "nex-code",
3
- "version": "0.4.20",
3
+ "version": "0.4.22",
4
4
  "description": "The open-source agentic coding CLI. Free with Ollama Cloud — switch to OpenAI, Anthropic or Gemini anytime. Alternative to Claude Code & Gemini CLI.",
5
5
  "bin": {
6
6
  "nex-code": "./dist/nex-code.js"
7
7
  },
8
8
  "files": [
9
9
  "dist/",
10
+ "examples/",
10
11
  "README.md",
11
12
  "LICENSE"
12
13
  ],
@@ -16,15 +17,18 @@
16
17
  "scripts": {
17
18
  "start": "node dist/nex-code.js",
18
19
  "build": "esbuild bin/nex-code.js --bundle --platform=node --target=node18 --outfile=dist/nex-code.js --minify --external:axios --external:dotenv --external:playwright",
20
+ "dev": "esbuild bin/nex-code.js --bundle --platform=node --target=node18 --outfile=dist/nex-code.js --external:axios --external:dotenv --external:playwright --watch",
19
21
  "test": "jest --forceExit",
20
22
  "test:orchestrator": "jest tests/orchestrator.test.js --forceExit",
21
23
  "coverage": "jest --coverage --forceExit",
22
24
  "test:watch": "jest --watch",
25
+ "typecheck": "tsc --noEmit",
23
26
  "format": "prettier --write .",
24
27
  "install-hooks": "ln -sf ../../hooks/pre-push .git/hooks/pre-push && chmod +x .git/hooks/pre-push && ln -sf ../../hooks/post-merge .git/hooks/post-merge && chmod +x .git/hooks/post-merge && echo 'Hooks installed (pre-push, post-merge).'",
25
28
  "prepublishOnly": "npm run build && npm test",
26
29
  "merge-to-main": "bash scripts/merge-to-main.sh",
27
30
  "improve": "node scripts/improve.js",
31
+ "extract-examples": "node scripts/extract-examples.js",
28
32
  "benchmark:realworld": "node scripts/benchmark-realworld.js",
29
33
  "release": "npm version patch && git push --follow-tags && npm publish"
30
34
  },
@@ -73,7 +77,8 @@
73
77
  "devDependencies": {
74
78
  "esbuild": "^0.27.3",
75
79
  "jest": "^29.7.0",
76
- "prettier": "^3.8.1"
80
+ "prettier": "^3.8.1",
81
+ "typescript": "^5.9.3"
77
82
  },
78
83
  "overrides": {
79
84
  "brace-expansion": ">=5.0.5",