azclaude-copilot 0.7.11 → 0.7.12
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-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +5 -5
- package/bin/cli.js +1 -1
- package/package.json +2 -2
- package/templates/agents/orchestrator.md +8 -6
- package/templates/agents/problem-architect.md +9 -0
- package/templates/commands/kill.md +128 -0
- package/templates/commands/run.md +168 -0
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"plugins": [
|
|
9
9
|
{
|
|
10
10
|
"name": "azclaude",
|
|
11
|
-
"description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs
|
|
12
|
-
"version": "0.7.
|
|
11
|
+
"description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs 42 commands, 10 auto-invoked skills, 15 specialized agents, 5 hooks, a real-time pipeline visualizer, and a persistent memory system — in one command.\n\nKey features:\n• Memory across sessions — goals.md + checkpoints injected automatically before every session\n• Self-improving loop — /reflect fixes stale CLAUDE.md rules, /reflexes learns from tool-use patterns, /evolve creates agents from git evidence\n• Autonomous copilot mode — /copilot runs a three-tier team (orchestrator → problem-architect → milestone-builder) across sessions until the product ships\n• Spec-driven workflow — /constitute writes project rules, /spec writes structured ACs, /analyze detects plan drift and ghost milestones, /blueprint traces every milestone to a spec\n• Security layer — 111-rule environment scan (/sentinel), pre-write secret blocking, pre-ship credential audit\n• Progressive levels 0–10 — start with CLAUDE.md, grow into multi-agent pipelines and self-evolving environments\n• Zero dependencies — no npm packages, no external APIs, no vector databases. Plain markdown files and Claude Code's native architecture.\n• Smart install — npx azclaude-copilot@latest auto-detects first install vs upgrade vs verify. Context-aware onboarding shows the right next command for your project state.\n\nExample use cases:\n• /setup — scan an existing project, detect stack + domain + scale, fill CLAUDE.md, generate project-specific skills and agents automatically\n• /copilot \"Build a compliance SaaS with trilingual support\" — walk away, come back to working code across multiple sessions\n• /sentinel — run a scored security audit (0–100, grade A–F) across hooks, permissions, MCP servers, agent configs, and secrets\n• /evolve — detect gaps in the environment, generate new skills and agents from git co-change evidence, report score delta (e.g. 42/100 → 68/100)\n• /constitute — write your project's constitution (non-negotiables, architectural commitments, definition of done) — gates all future AI actions\n• /analyze — cross-artifact consistency check: ghost milestones, spec vs. code drift, unplanned commits\n• /reflect — find stale, missing, or contradicting rules in CLAUDE.md and propose exact fixes\n• /debate \"REST vs GraphQL for this project\" — adversarial evidence-based decision with order-independent scoring, logged to decisions.md",
|
|
12
|
+
"version": "0.7.12",
|
|
13
13
|
"source": {
|
|
14
14
|
"source": "github",
|
|
15
15
|
"repo": "haytamAroui/AZ-CLAUDE-COPILOT",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azclaude",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs
|
|
3
|
+
"version": "0.7.12",
|
|
4
|
+
"description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs 42 commands, 10 auto-invoked skills, 15 specialized agents, 5 hooks, a real-time pipeline visualizer, and a persistent memory system — in one command.\n\nKey features:\n• Memory across sessions — goals.md + checkpoints injected automatically before every session\n• Self-improving loop — /reflect fixes stale CLAUDE.md rules, /reflexes learns from tool-use patterns, /evolve creates agents from git evidence\n• Autonomous copilot mode — /copilot runs a three-tier team (orchestrator → problem-architect → milestone-builder) across sessions until the product ships\n• Spec-driven workflow — /constitute writes project rules, /spec writes structured ACs, /analyze detects plan drift and ghost milestones, /blueprint traces every milestone to a spec\n• Security layer — 111-rule environment scan (/sentinel), pre-write secret blocking, pre-ship credential audit\n• Progressive levels 0–10 — start with CLAUDE.md, grow into multi-agent pipelines and self-evolving environments\n• Zero dependencies — no npm packages, no external APIs, no vector databases. Plain markdown files and Claude Code's native architecture.\n• Smart install — npx azclaude-copilot@latest auto-detects first install vs upgrade vs verify. Context-aware onboarding shows the right next command for your project state.\n\nExample use cases:\n• /setup — scan an existing project, detect stack + domain + scale, fill CLAUDE.md, generate project-specific skills and agents automatically\n• /copilot \"Build a compliance SaaS with trilingual support\" — walk away, come back to working code across multiple sessions\n• /sentinel — run a scored security audit (0–100, grade A–F) across hooks, permissions, MCP servers, agent configs, and secrets\n• /evolve — detect gaps in the environment, generate new skills and agents from git co-change evidence, report score delta (e.g. 42/100 → 68/100)\n• /constitute — write your project's constitution (non-negotiables, architectural commitments, definition of done) — gates all future AI actions\n• /analyze — cross-artifact consistency check: ghost milestones, spec vs. code drift, unplanned commits\n• /reflect — find stale, missing, or contradicting rules in CLAUDE.md and propose exact fixes\n• /debate \"REST vs GraphQL for this project\" — adversarial evidence-based decision with order-independent scoring, logged to decisions.md",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "haytamAroui",
|
|
7
7
|
"url": "https://github.com/haytamAroui"
|
package/README.md
CHANGED
|
@@ -110,7 +110,7 @@ npx azclaude-copilot@latest
|
|
|
110
110
|
|
|
111
111
|
One command, no flags. Auto-detects whether this is a fresh install or an upgrade:
|
|
112
112
|
|
|
113
|
-
- **First time** → full install (
|
|
113
|
+
- **First time** → full install (42 commands, 5 hooks, 15 agents, 10 skills, memory, reflexes). Creates folders, instructions, and hooks — **no manual setup required.**
|
|
114
114
|
- **Already installed, older version** → auto-upgrades everything to latest templates
|
|
115
115
|
- **Already up to date** → verifies, no overwrites
|
|
116
116
|
|
|
@@ -123,7 +123,7 @@ npx azclaude-copilot@latest doctor # 32 checks — verify everything is wired
|
|
|
123
123
|
|
|
124
124
|
## What You Get
|
|
125
125
|
|
|
126
|
-
**
|
|
126
|
+
**42 commands** · **10 auto-invoked skills** · **15 agents** · **5 hooks** · **memory across sessions** · **learned reflexes** · **self-evolving environment**
|
|
127
127
|
|
|
128
128
|
```
|
|
129
129
|
.claude/
|
|
@@ -272,7 +272,7 @@ Claude Code
|
|
|
272
272
|
│ └── stop.js → Session cleanup, friction logging
|
|
273
273
|
│
|
|
274
274
|
└── Markdown files (capability — Claude reads natively, zero overhead)
|
|
275
|
-
├──
|
|
275
|
+
├── 42 commands → Claude reads the .md, follows instructions
|
|
276
276
|
├── 15 agents → Claude spawns as subagents with Task tool
|
|
277
277
|
├── 10 skills → Auto-invoked when relevant context detected
|
|
278
278
|
├── 48 capabilities → Lazy-loaded via manifest.md (~100 tokens overhead)
|
|
@@ -637,11 +637,11 @@ AZCLAUDE is a lazy-loaded environment of 48 capability modules. It only loads wh
|
|
|
637
637
|
|
|
638
638
|
## Verified
|
|
639
639
|
|
|
640
|
-
|
|
640
|
+
1996 tests. Every template, command, capability, agent, hook, and CLI feature verified.
|
|
641
641
|
|
|
642
642
|
```bash
|
|
643
643
|
bash tests/test-features.sh
|
|
644
|
-
# Results:
|
|
644
|
+
# Results: 1996 passed, 0 failed, 1996 total
|
|
645
645
|
```
|
|
646
646
|
|
|
647
647
|
---
|
package/bin/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ const { execSync } = require('child_process');
|
|
|
8
8
|
|
|
9
9
|
const TEMPLATE_DIR = path.join(__dirname, '..', 'templates');
|
|
10
10
|
const CORE_COMMANDS = ['setup', 'fix', 'add', 'audit', 'test', 'blueprint', 'ship', 'pulse', 'explain', 'snapshot', 'persist'];
|
|
11
|
-
const EXTENDED_COMMANDS = ['dream', 'refactor', 'doc', 'loop', 'migrate', 'deps', 'find', 'create', 'reflect', 'hookify', 'sentinel', 'clarify', 'spec', 'analyze', 'constitute', 'tasks', 'issues', 'driven', 'mcp', 'verify', 'inoculate', 'ghost-test', 'visualize'];
|
|
11
|
+
const EXTENDED_COMMANDS = ['dream', 'refactor', 'doc', 'loop', 'migrate', 'deps', 'find', 'create', 'reflect', 'hookify', 'sentinel', 'clarify', 'spec', 'analyze', 'constitute', 'tasks', 'issues', 'driven', 'mcp', 'verify', 'inoculate', 'ghost-test', 'visualize', 'kill', 'run'];
|
|
12
12
|
const ADVANCED_COMMANDS = ['evolve', 'debate', 'level-up', 'copilot', 'reflexes', 'parallel'];
|
|
13
13
|
const COMMANDS = [...CORE_COMMANDS, ...EXTENDED_COMMANDS, ...ADVANCED_COMMANDS];
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azclaude-copilot",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "AI coding environment —
|
|
3
|
+
"version": "0.7.12",
|
|
4
|
+
"description": "AI coding environment — 42 commands, 10 skills, 15 agents, real-time visualizer, memory, reflexes, evolution. Install: npx azclaude-copilot@latest, then open Claude Code.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"azclaude": "bin/cli.js",
|
|
7
7
|
"azclaude-copilot": "bin/copilot.js"
|
|
@@ -208,21 +208,23 @@ Load `capabilities/shared/context-relay.md` for relay protocol and role-based fi
|
|
|
208
208
|
4. If problem-architect returned a `## Relay` section, include it in the builder prompt as-is
|
|
209
209
|
5. **Skill consistency** — collect the UNION of all skills from all Team Specs in this wave. Every agent in the wave loads the SAME skill set (not just its own). This ensures consistent patterns across parallel agents.
|
|
210
210
|
6. **Include Verify commands** from each Team Spec in the agent prompt — the builder uses these in its exit gate
|
|
211
|
-
7.
|
|
212
|
-
8.
|
|
213
|
-
9.
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
7. **Model routing** — read `Model Recommendation` from each Team Spec. Pass it as `model: "{value}"` on the Task/Agent call. If absent, fall back to the agent's frontmatter `model:` field. Model selection varies per milestone — always use the actual recommendation, not a hardcoded assumption.
|
|
212
|
+
8. Spawn each builder via Task with `isolation: "worktree"` and `model: "{from Team Spec}"` in the same message (true parallel)
|
|
213
|
+
9. Include worktree rules + **test scope** (`Test scope: {test-dir}`) in every parallel prompt
|
|
214
|
+
10. **Merge-on-complete**: as each agent reports done, merge its branch immediately (don't wait for all)
|
|
215
|
+
11. After each merge: check if newly-unblocked milestones exist → dispatch them immediately
|
|
216
|
+
12. If `max_parallel <= 3` or merge conflicts detected: fall back to batch-merge (wait for all, then merge)
|
|
216
217
|
|
|
217
218
|
**Sequential dispatch (single milestone OR overlapping files):**
|
|
218
219
|
|
|
219
220
|
Load `capabilities/shared/context-inoculation.md` and prepend its Required Preamble to the agent prompt below.
|
|
220
221
|
Load `capabilities/shared/context-relay.md` for relay protocol and size limits.
|
|
221
222
|
|
|
222
|
-
Spawn milestone-builder via Task with fully packaged context:
|
|
223
|
+
Spawn milestone-builder via Task with `model: "{Model Recommendation from Team Spec}"` and fully packaged context:
|
|
223
224
|
|
|
224
225
|
```
|
|
225
226
|
Task: Implement Milestone {N} — {title}
|
|
227
|
+
Model: {from Team Spec — opus|sonnet|haiku, default sonnet}
|
|
226
228
|
|
|
227
229
|
Agent role: {agent-name from spec} (owns {directories})
|
|
228
230
|
Skills to activate: {skill list from spec}
|
|
@@ -180,6 +180,15 @@ If YES: topic = {what orchestrator must /debate before dispatching}
|
|
|
180
180
|
SIMPLE (< 3 files) | MEDIUM (3-8 files) | COMPLEX (8+ files)
|
|
181
181
|
COMPLEX → orchestrator gives builder 3 fix attempts instead of 2
|
|
182
182
|
|
|
183
|
+
### Model Recommendation
|
|
184
|
+
{opus | sonnet | haiku}
|
|
185
|
+
Decision logic (use the FIRST matching rule):
|
|
186
|
+
1. Read-only validation, checklist matching, constitution check → **haiku**
|
|
187
|
+
2. Structural Decision: YES, OR Complexity: COMPLEX + touches schemas/APIs/auth → **opus**
|
|
188
|
+
3. Everything else (standard implementation, follows patterns) → **sonnet**
|
|
189
|
+
The orchestrator passes this as `model:` when spawning the agent via Task.
|
|
190
|
+
If omitted, the orchestrator falls back to the agent's frontmatter `model:` field.
|
|
191
|
+
|
|
183
192
|
### Verify
|
|
184
193
|
Read CLAUDE.md `## Verify` field for the project's commands. Scope them to this milestone:
|
|
185
194
|
- Quick: `{Tier 1 command}` — static check, MANDATORY before done
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kill
|
|
3
|
+
description: >
|
|
4
|
+
Kill all running dev/testing servers on common development ports.
|
|
5
|
+
Triggers on: "kill servers", "kill ports", "free ports", "kill dev server",
|
|
6
|
+
"port still in use", "EADDRINUSE", "address already in use", "stop all servers",
|
|
7
|
+
"kill background processes", "clean up ports".
|
|
8
|
+
Safe by design — only kills processes bound to TCP ports, never MCP servers (stdio, no ports).
|
|
9
|
+
argument-hint: "[port number | --all (default) | --ports 3000,8080]"
|
|
10
|
+
disable-model-invocation: false
|
|
11
|
+
allowed-tools: Bash, Read, Glob
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# /kill — Kill Dev Servers
|
|
15
|
+
|
|
16
|
+
$ARGUMENTS
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Safety guarantee
|
|
21
|
+
|
|
22
|
+
Killing by TCP port is inherently MCP-safe.
|
|
23
|
+
MCP servers use stdio transport — they hold **no TCP ports**.
|
|
24
|
+
Any process on a TCP port is a dev/test server, not Claude infrastructure.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Step 1 — Parse target ports
|
|
29
|
+
|
|
30
|
+
**If $ARGUMENTS contains a port number** (e.g., `/kill 3000`):
|
|
31
|
+
→ Kill only that specific port. Skip to Step 3.
|
|
32
|
+
|
|
33
|
+
**If $ARGUMENTS is `--ports <list>`** (e.g., `/kill --ports 3000,5173`):
|
|
34
|
+
→ Parse the comma-separated list. Skip to Step 3.
|
|
35
|
+
|
|
36
|
+
**Default (`--all` or no argument)**:
|
|
37
|
+
→ Target the full dev port list below. Continue to Step 2.
|
|
38
|
+
|
|
39
|
+
### Default dev port list
|
|
40
|
+
```
|
|
41
|
+
3000 3001 3002 3003 4000 4200 4321
|
|
42
|
+
5000 5001 5173 5174 6006 7000 8000
|
|
43
|
+
8001 8080 8081 8888 9000 9001 9229
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> Note: 9229 is Node.js debugger. Kill only if you're not actively debugging.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Step 2 — Detect which ports are actually in use
|
|
51
|
+
|
|
52
|
+
**Unix/macOS:**
|
|
53
|
+
```bash
|
|
54
|
+
for port in 3000 3001 3002 3003 4000 4200 4321 5000 5001 5173 5174 6006 7000 8000 8001 8080 8081 8888 9000 9001 9229; do
|
|
55
|
+
pid=$(lsof -ti tcp:$port 2>/dev/null)
|
|
56
|
+
if [ -n "$pid" ]; then
|
|
57
|
+
echo " PORT $port → PID $pid ($(ps -p $pid -o comm= 2>/dev/null))"
|
|
58
|
+
fi
|
|
59
|
+
done
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Windows:**
|
|
63
|
+
```bash
|
|
64
|
+
for port in 3000 3001 3002 3003 4000 4200 4321 5000 5001 5173 5174 6006 7000 8000 8001 8080 8081 8888 9000 9001 9229; do
|
|
65
|
+
result=$(netstat -ano 2>/dev/null | grep ":$port " | grep LISTENING | awk '{print $5}' | head -1)
|
|
66
|
+
if [ -n "$result" ]; then
|
|
67
|
+
echo " PORT $port → PID $result"
|
|
68
|
+
fi
|
|
69
|
+
done
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Print summary of occupied ports. If none found: print `No dev servers found on standard ports.` and stop.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Step 3 — Kill strategy
|
|
77
|
+
|
|
78
|
+
### Primary (cross-platform, requires Node):
|
|
79
|
+
```bash
|
|
80
|
+
npx --yes kill-port <PORTS>
|
|
81
|
+
```
|
|
82
|
+
Example: `npx --yes kill-port 3000 5173 8080`
|
|
83
|
+
|
|
84
|
+
This is safe, silent on ports that are already free, and exits 0 on success.
|
|
85
|
+
|
|
86
|
+
### Fallback — Unix/macOS (if npx not available):
|
|
87
|
+
```bash
|
|
88
|
+
for port in <PORTS>; do
|
|
89
|
+
lsof -ti tcp:$port | xargs -r kill -9 2>/dev/null
|
|
90
|
+
echo " Killed port $port"
|
|
91
|
+
done
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Fallback — Windows (if npx not available):
|
|
95
|
+
```bash
|
|
96
|
+
for port in <PORTS>; do
|
|
97
|
+
pid=$(netstat -ano | findstr ":$port " | grep LISTENING | awk '{print $5}' | head -1)
|
|
98
|
+
if [ -n "$pid" ]; then
|
|
99
|
+
taskkill /PID $pid /F
|
|
100
|
+
echo " Killed PID $pid on port $port"
|
|
101
|
+
fi
|
|
102
|
+
done
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Step 4 — Verify
|
|
108
|
+
|
|
109
|
+
After killing, re-run the detection from Step 2.
|
|
110
|
+
|
|
111
|
+
**Expected output:**
|
|
112
|
+
```
|
|
113
|
+
No dev servers found on standard ports.
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
If any port is still occupied: report it and its PID. Do not retry — report to user.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Completion rule
|
|
121
|
+
|
|
122
|
+
Print a summary:
|
|
123
|
+
```
|
|
124
|
+
Killed: ports 3000, 5173
|
|
125
|
+
Still running: (none)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Never say "should be free now." Run the verification and show the output.
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: run
|
|
3
|
+
description: >
|
|
4
|
+
Auto-detect the project tech stack and run the appropriate dev server.
|
|
5
|
+
Triggers on: "run the server", "start dev server", "run the app", "start the app",
|
|
6
|
+
"run project", "run dev", "how do I start this", "start this project",
|
|
7
|
+
"run my app", "launch server", "dev server".
|
|
8
|
+
Detects: Node.js, Next.js, Nuxt, Vite, Astro, SvelteKit, Remix, Angular,
|
|
9
|
+
Python (Django, FastAPI, Flask), Rust, Go, Ruby (Rails), PHP (Laravel), Java.
|
|
10
|
+
argument-hint: "[stack override | --port <port> | blank for auto-detect]"
|
|
11
|
+
disable-model-invocation: false
|
|
12
|
+
allowed-tools: Bash, Read, Glob
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# /run — Run Dev Server
|
|
16
|
+
|
|
17
|
+
$ARGUMENTS
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Step 1 — Parse arguments
|
|
22
|
+
|
|
23
|
+
**If $ARGUMENTS contains a stack name** (e.g., `/run django`):
|
|
24
|
+
→ Skip detection, use the named stack's command from the table in Step 3.
|
|
25
|
+
|
|
26
|
+
**If $ARGUMENTS contains `--port <number>`**:
|
|
27
|
+
→ Append port override to the detected command (e.g., `--port 4000`).
|
|
28
|
+
|
|
29
|
+
**Default (no arguments)**:
|
|
30
|
+
→ Run auto-detection in Step 2.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Step 2 — Auto-detect stack
|
|
35
|
+
|
|
36
|
+
Run detection in this **exact priority order** — stop at the first match.
|
|
37
|
+
|
|
38
|
+
Check with: `ls <file>` or `test -f <file>` (do not read file contents unless needed for sub-detection).
|
|
39
|
+
|
|
40
|
+
### Priority chain
|
|
41
|
+
|
|
42
|
+
| Priority | File to check | Stack detected | Step to jump to |
|
|
43
|
+
|----------|--------------|----------------|-----------------|
|
|
44
|
+
| 1 | `package.json` | Node-based — sub-detect framework | Step 2a |
|
|
45
|
+
| 2 | `Cargo.toml` | Rust | Step 3 → Rust |
|
|
46
|
+
| 3 | `go.mod` | Go | Step 3 → Go |
|
|
47
|
+
| 4 | `manage.py` | Django | Step 3 → Django |
|
|
48
|
+
| 5 | `pyproject.toml` | Python (FastAPI/Flask) | Step 2b |
|
|
49
|
+
| 6 | `requirements.txt` | Python generic | Step 3 → Python generic |
|
|
50
|
+
| 7 | `Gemfile` + `config/routes.rb` | Rails | Step 3 → Rails |
|
|
51
|
+
| 8 | `composer.json` + `artisan` | Laravel | Step 3 → Laravel |
|
|
52
|
+
| 9 | `pom.xml` | Maven/Spring Boot | Step 3 → Java/Maven |
|
|
53
|
+
| 10 | `build.gradle` | Gradle/Spring Boot | Step 3 → Java/Gradle |
|
|
54
|
+
| 11 | `pubspec.yaml` | Flutter/Dart | Step 3 → Flutter |
|
|
55
|
+
|
|
56
|
+
If **no file matches**: print `Could not detect stack. Run: /run <stack>` and list available stacks. Stop.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
### Step 2a — Node sub-detection (package.json found)
|
|
61
|
+
|
|
62
|
+
**First: check if `"dev"` script exists in package.json:**
|
|
63
|
+
```bash
|
|
64
|
+
node -e "const p=require('./package.json'); console.log(p.scripts && p.scripts.dev || '')"
|
|
65
|
+
```
|
|
66
|
+
If non-empty → use `npm run dev` (or `yarn dev` / `pnpm dev` based on lock file presence). Jump to Step 4.
|
|
67
|
+
|
|
68
|
+
**If no `"dev"` script, check dependencies for framework:**
|
|
69
|
+
Read `package.json` dependencies + devDependencies and check for these keys (first match wins):
|
|
70
|
+
|
|
71
|
+
| Dependency key | Framework | Command | Default port |
|
|
72
|
+
|---------------|-----------|---------|--------------|
|
|
73
|
+
| `"next"` | Next.js | `npm run dev` | 3000 |
|
|
74
|
+
| `"nuxt"` | Nuxt | `npm run dev` | 3000 |
|
|
75
|
+
| `"@astrojs/core"` or `"astro"` | Astro | `npm run dev` | 4321 |
|
|
76
|
+
| `"@sveltejs/kit"` | SvelteKit | `npm run dev` | 5173 |
|
|
77
|
+
| `"vite"` | Vite | `npm run dev` | 5173 |
|
|
78
|
+
| `"@remix-run/react"` | Remix | `npm run dev` | 3000 |
|
|
79
|
+
| `"@angular/core"` | Angular | `ng serve` | 4200 |
|
|
80
|
+
| `"express"` or `"fastify"` or `"hono"` | Node server | `node index.js` or `node src/index.js` | user-defined |
|
|
81
|
+
| (none of the above) | Node generic | `npm start` | 3000 |
|
|
82
|
+
|
|
83
|
+
**If multiple frameworks detected** (e.g., monorepo): list all candidates and ask:
|
|
84
|
+
```
|
|
85
|
+
Multiple frameworks detected:
|
|
86
|
+
1. Next.js (packages/web)
|
|
87
|
+
2. Express (packages/api)
|
|
88
|
+
Which would you like to run? (1/2)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Jump to Step 4.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### Step 2b — Python sub-detection (pyproject.toml found, no manage.py)
|
|
96
|
+
|
|
97
|
+
Read `pyproject.toml` and check `[project.dependencies]` or `[tool.poetry.dependencies]`:
|
|
98
|
+
|
|
99
|
+
| Dependency | Command |
|
|
100
|
+
|-----------|---------|
|
|
101
|
+
| `fastapi` | `uvicorn main:app --reload` |
|
|
102
|
+
| `flask` | `flask run` |
|
|
103
|
+
| `starlette` | `uvicorn main:app --reload` |
|
|
104
|
+
| (none) | `python -m <package_name>` |
|
|
105
|
+
|
|
106
|
+
Jump to Step 3.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Step 3 — Command table
|
|
111
|
+
|
|
112
|
+
| Stack | Command | Default port |
|
|
113
|
+
|-------|---------|--------------|
|
|
114
|
+
| Rust | `cargo run` | user-defined |
|
|
115
|
+
| Go | `go run .` | user-defined |
|
|
116
|
+
| Django | `python manage.py runserver` | 8000 |
|
|
117
|
+
| FastAPI | `uvicorn main:app --reload` | 8000 |
|
|
118
|
+
| Flask | `flask run` | 5000 |
|
|
119
|
+
| Python generic | `python app.py` | user-defined |
|
|
120
|
+
| Rails | `bundle exec rails server` | 3000 |
|
|
121
|
+
| Laravel | `php artisan serve` | 8000 |
|
|
122
|
+
| Java/Maven | `mvn spring-boot:run` | 8080 |
|
|
123
|
+
| Java/Gradle | `./gradlew bootRun` | 8080 |
|
|
124
|
+
| Flutter | `flutter run` | n/a |
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Step 4 — Pre-flight check
|
|
129
|
+
|
|
130
|
+
Before running, check if the target port is already occupied:
|
|
131
|
+
|
|
132
|
+
**Unix/macOS:** `lsof -ti tcp:<PORT>`
|
|
133
|
+
**Windows:** `netstat -ano | findstr ":<PORT> " | grep LISTENING`
|
|
134
|
+
|
|
135
|
+
If occupied: print
|
|
136
|
+
```
|
|
137
|
+
Port <PORT> is already in use. Run /kill <PORT> first, then retry.
|
|
138
|
+
```
|
|
139
|
+
Stop. Do not force-kill automatically — user decides.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Step 5 — Run
|
|
144
|
+
|
|
145
|
+
Print the detected stack and command before executing:
|
|
146
|
+
```
|
|
147
|
+
Detected: Next.js
|
|
148
|
+
Command: npm run dev
|
|
149
|
+
Port: 3000
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Then run the command. Stream output to the terminal.
|
|
153
|
+
|
|
154
|
+
If the process exits with a non-zero code within 5 seconds: print the last 20 lines of output and stop. Do not retry automatically.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Completion rule
|
|
159
|
+
|
|
160
|
+
The server is running when output contains a "ready" or "listening" line (e.g., `ready on http://localhost:3000`, `Uvicorn running on http://0.0.0.0:8000`).
|
|
161
|
+
|
|
162
|
+
Print:
|
|
163
|
+
```
|
|
164
|
+
Server running: http://localhost:<PORT>
|
|
165
|
+
Stack: <detected stack>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Never say "it should be running." Show the actual server output line.
|