juno-code 1.0.49 → 1.0.50

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.
Files changed (32) hide show
  1. package/README.md +417 -203
  2. package/dist/bin/cli.d.mts +1 -1
  3. package/dist/bin/cli.d.ts +1 -1
  4. package/dist/bin/cli.js +1736 -976
  5. package/dist/bin/cli.js.map +1 -1
  6. package/dist/bin/cli.mjs +1735 -975
  7. package/dist/bin/cli.mjs.map +1 -1
  8. package/dist/bin/feedback-collector.js.map +1 -1
  9. package/dist/bin/feedback-collector.mjs.map +1 -1
  10. package/dist/index.d.mts +33 -7
  11. package/dist/index.d.ts +33 -7
  12. package/dist/index.js +202 -27
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.mjs +202 -27
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/templates/scripts/install_requirements.sh +41 -3
  17. package/dist/templates/scripts/kanban.sh +4 -0
  18. package/dist/templates/services/__pycache__/pi.cpython-313.pyc +0 -0
  19. package/dist/templates/services/pi.py +1281 -238
  20. package/dist/templates/skills/claude/kanban-workflow/SKILL.md +138 -0
  21. package/dist/templates/skills/claude/plan-kanban-tasks/SKILL.md +1 -1
  22. package/dist/templates/skills/claude/ralph-loop/scripts/kanban.sh +4 -0
  23. package/dist/templates/skills/claude/understand-project/SKILL.md +1 -1
  24. package/dist/templates/skills/codex/kanban-workflow/SKILL.md +139 -0
  25. package/dist/templates/skills/codex/plan-kanban-tasks/SKILL.md +32 -0
  26. package/dist/templates/skills/codex/ralph-loop/scripts/kanban.sh +4 -0
  27. package/dist/templates/skills/codex/understand-project/SKILL.md +46 -0
  28. package/dist/templates/skills/pi/kanban-workflow/SKILL.md +139 -0
  29. package/dist/templates/skills/pi/plan-kanban-tasks/SKILL.md +1 -1
  30. package/dist/templates/skills/pi/ralph-loop/SKILL.md +4 -0
  31. package/dist/templates/skills/pi/understand-project/SKILL.md +1 -1
  32. package/package.json +7 -5
package/README.md CHANGED
@@ -73,7 +73,7 @@ juno-code -b shell -s claude -m :opus -i 5 -v
73
73
  ./.juno_task/scripts/run_until_completion.sh -s claude -i 1 -v
74
74
 
75
75
  # Unlimited (like Ralph) - when you really want that
76
- juno-code -b shell -s claude
76
+ juno-code -b shell -s claude
77
77
  ```
78
78
 
79
79
  ### Task Tracking: Structured, Not Prose
@@ -89,6 +89,25 @@ Built-in kanban via [juno-kanban](https://pypi.org/project/juno-kanban/). Unlike
89
89
  ./.juno_task/scripts/kanban.sh list --limit 5 # Shows only what matters
90
90
  ```
91
91
 
92
+ ### Task Dependencies
93
+ Declare what must be done first. The kanban system builds a dependency graph so agents work in the right order:
94
+ ```bash
95
+ # Create a task that depends on another
96
+ ./.juno_task/scripts/kanban.sh create "Deploy API" --blocked-by A1b2C3
97
+
98
+ # Or use body markup (4 synonym tags supported)
99
+ ./.juno_task/scripts/kanban.sh create "Deploy API [blocked_by]A1b2C3[/blocked_by]"
100
+
101
+ # What's ready to work on right now?
102
+ ./.juno_task/scripts/kanban.sh ready
103
+
104
+ # Dependency-aware execution order
105
+ ./.juno_task/scripts/kanban.sh order --scores
106
+
107
+ # Inspect a task's dependency info
108
+ ./.juno_task/scripts/kanban.sh deps TASK_ID
109
+ ```
110
+
92
111
  ### Backend Choice: Use Any AI
93
112
  Switch between Claude, Codex, Gemini, Pi, or Cursor with one flag:
94
113
  ```bash
@@ -99,6 +118,22 @@ juno-code -b shell -s gemini -m :flash -i 1 -v
99
118
  juno-code -b shell -s pi -m :sonnet -i 1 -v
100
119
  ```
101
120
 
121
+ ### Parallel Execution
122
+ Run multiple tasks simultaneously with the parallel runner:
123
+ ```bash
124
+ # Run 3 kanban tasks in parallel
125
+ ./.juno_task/scripts/parallel_runner.sh --kanban T1,T2,T3 --parallel 3
126
+
127
+ # Visual monitoring in tmux
128
+ ./.juno_task/scripts/parallel_runner.sh --tmux --kanban T1,T2,T3 --parallel 5
129
+
130
+ # Process a CSV file with custom prompt
131
+ ./.juno_task/scripts/parallel_runner.sh --items-file data.csv --prompt-file instructions.md --strict
132
+
133
+ # Dependency-aware parallel execution
134
+ ./.juno_task/scripts/parallel_runner.sh --kanban-filter 'ready' --parallel 3
135
+ ```
136
+
102
137
  ### Full Traceability: Every Change Tracked
103
138
  - Every task links to a git commit
104
139
  - Jump to any point in development history
@@ -141,11 +176,11 @@ npm install -g juno-code
141
176
  # Initialize project
142
177
  juno-code init --task "Add user authentication..." --subagent claude
143
178
 
144
- # Start execution - uses .juno_task/int.md (optimized Ralph prompt)
179
+ # Start execution - uses .juno_task/init.md (optimized Ralph prompt)
145
180
  juno-code start -b shell -s claude -i 1 -v
146
181
 
147
182
  # Or with a custom prompt
148
- juno-code -b shell -s claude -i 5 -p "Fix the login bug"
183
+ juno-code -b shell -s claude -i 5 -p 'Fix the login bug'
149
184
 
150
185
  # Default Ralph based on kanban , without -p , juno-code uses .juno_task/prompt.md as prompt
151
186
  juno-code -b shell -s claude -i 5 -v
@@ -153,6 +188,18 @@ juno-code -b shell -s claude -i 5 -v
153
188
 
154
189
  **Key insight**: Running `juno-code start` without `-p` uses `.juno_task/prompt.md`—a production-ready prompt template that implements the Ralph method with guard rails.
155
190
 
191
+ ### Shell safety for prompts
192
+
193
+ When prompt text contains shell metacharacters (especially backticks `` `...` `` or `$()`), prefer one of these patterns so your shell does not execute substitutions before juno-code receives the prompt:
194
+
195
+ ```bash
196
+ juno-code -s claude -p 'literal text with `backticks` and $(dollar-parens)'
197
+ juno-code -s claude -f prompt.md
198
+ juno-code -s claude << 'EOF'
199
+ literal text with `backticks`
200
+ EOF
201
+ ```
202
+
156
203
  ## CLI Reference
157
204
 
158
205
  ### Core Commands
@@ -167,13 +214,17 @@ juno-code start -b shell -s claude -i 5 -v
167
214
  juno-code start -b shell -s codex -m :codex -i 10
168
215
 
169
216
  # Direct prompt execution
170
- juno-code -b shell -s claude -i 3 -p "your prompt"
217
+ juno-code -b shell -s claude -i 3 -p 'your prompt'
171
218
 
172
219
  # Quick subagent shortcuts
173
- juno-code claude "your task"
174
- juno-code codex "your task"
175
- juno-code gemini "your task"
176
- juno-code pi "your task"
220
+ juno-code claude 'your task'
221
+ juno-code codex 'your task'
222
+ juno-code gemini 'your task'
223
+ juno-code pi 'your task'
224
+
225
+ # AI-powered test generation
226
+ juno-code test --generate --framework vitest
227
+ juno-code test --run
177
228
 
178
229
  # View and parse log files
179
230
  juno-code view-log .juno_task/logs/claude_shell_*.log --output json-only --limit 50
@@ -183,7 +234,7 @@ juno-code view-log .juno_task/logs/claude_shell_*.log --output json-only --limit
183
234
 
184
235
  | Flag | Description |
185
236
  |------|-------------|
186
- | `-b, --backend <type>` | Backend: `mcp`, `shell` |
237
+ | `-b, --backend <type>` | Backend: `shell` |
187
238
  | `-s, --subagent <name>` | Service: `claude`, `codex`, `gemini`, `pi`, `cursor` |
188
239
  | `-m, --model <name>` | Model (supports shorthands like `:opus`, `:haiku`) |
189
240
  | `-i, --max-iterations <n>` | Iteration limit (-1 for unlimited) |
@@ -203,8 +254,8 @@ juno-code view-log .juno_task/logs/claude_shell_*.log --output json-only --limit
203
254
  ```bash
204
255
  juno-code session list # View all sessions
205
256
  juno-code session info abc123 # Session details
206
- juno-code --resume abc123 -p "continue" # Resume session
207
- juno-code --continue -p "keep going" # Continue most recent
257
+ juno-code --resume abc123 -p 'continue' # Resume session
258
+ juno-code --continue -p 'keep going' # Continue most recent
208
259
  ```
209
260
 
210
261
  ### Feedback System
@@ -218,6 +269,192 @@ juno-code feedback --interactive
218
269
  juno-code start -b shell -s claude --enable-feedback -i 10
219
270
  ```
220
271
 
272
+ ### Skills Management
273
+
274
+ Skills are Markdown instruction files (with YAML frontmatter) installed into agent-specific directories so each coding agent reads them as context. juno-code auto-provisions skills on every CLI run.
275
+
276
+ ```bash
277
+ # List installed skills
278
+ juno-code skills list
279
+
280
+ # Install/update skills
281
+ juno-code skills install
282
+ juno-code skills install --force
283
+
284
+ # Check skill status
285
+ juno-code skills status
286
+ ```
287
+
288
+ **Skill groups by agent:**
289
+
290
+ | Agent | Directory | Skills |
291
+ |-------|-----------|--------|
292
+ | Claude | `.claude/skills/` | `ralph-loop`, `plan-kanban-tasks`, `understand-project` |
293
+ | Codex | `.agents/skills/` | `ralph-loop` |
294
+ | Pi | `.pi/skills/` | (planned) |
295
+
296
+ ### Service Management
297
+
298
+ ```bash
299
+ # View installed services
300
+ juno-code services list
301
+
302
+ # Check service status
303
+ juno-code services status
304
+
305
+ # Force reinstall (get latest)
306
+ juno-code services install --force
307
+ ```
308
+
309
+ ## Backends & Services
310
+
311
+ ### Supported Services
312
+
313
+ | Service | Default Model | Shorthands |
314
+ |---------|---------------|------------|
315
+ | claude | `claude-sonnet-4-6` | `:haiku`, `:sonnet`, `:opus` |
316
+ | codex | `gpt-5.3-codex` | `:codex`, `:codex-mini`, `:gpt-5`, `:mini` |
317
+ | gemini | `gemini-2.5-pro` | `:pro`, `:flash`, `:pro-3`, `:flash-3` |
318
+ | pi | `anthropic/claude-sonnet-4-6` | `:pi`, `:sonnet`, `:opus`, `:gpt-5`, `:codex`, `:api-codex`, `:gemini-pro` |
319
+
320
+ > **Pi** is a multi-provider coding agent that supports Anthropic, OpenAI, Google, Groq, xAI, and more.
321
+ > It requires separate installation: `npm install -g @mariozechner/pi-coding-agent`
322
+
323
+ ### Custom Backends
324
+
325
+ Service scripts live in `~/.juno_code/services/`. Each is a Python script that accepts standard args (`-p/--prompt`, `-m/--model`, `-v/--verbose`) and outputs JSON events to stdout.
326
+
327
+ ## Hook System
328
+
329
+ Hooks allow user-defined shell commands at execution lifecycle points. Configure in `.juno_task/config.json`:
330
+
331
+ | Hook | When | Example Use |
332
+ |------|------|-------------|
333
+ | `START_RUN` | Before all iterations | Environment setup |
334
+ | `START_ITERATION` | Each iteration start | File size monitoring, linting |
335
+ | `END_ITERATION` | Each iteration end | Test execution |
336
+ | `END_RUN` | After all iterations | Cleanup, reports |
337
+ | `ON_STALE` | Stale iteration detected | Alert, auto-create task |
338
+
339
+ **Default hooks** (set up by `juno-code init`):
340
+ - `START_ITERATION`: CLAUDE.md / AGENTS.md file size checks, feedback cleanup
341
+ - `ON_STALE`: Creates a kanban warning task when no progress detected
342
+
343
+ Example config:
344
+ ```json
345
+ {
346
+ "hooks": {
347
+ "START_ITERATION": {
348
+ "commands": [
349
+ "test ! -f CLAUDE.md || [ $(wc -c < CLAUDE.md) -lt 40000 ] || echo 'WARNING: CLAUDE.md exceeds 40KB'",
350
+ "./.juno_task/scripts/cleanup_feedback.sh"
351
+ ]
352
+ },
353
+ "END_ITERATION": {
354
+ "commands": ["npm test"]
355
+ }
356
+ }
357
+ }
358
+ ```
359
+
360
+ ## Autonomous Execution
361
+
362
+ ### run_until_completion.sh
363
+
364
+ Continuously runs juno-code until all kanban tasks are completed. Uses a do-while loop: juno-code runs at least once, then continues while tasks remain in backlog, todo, or in_progress status.
365
+
366
+ ```bash
367
+ # Run until all tasks complete
368
+ ./.juno_task/scripts/run_until_completion.sh -s claude -i 5 -v
369
+
370
+ # With custom backend and model
371
+ ./.juno_task/scripts/run_until_completion.sh -b shell -s codex -m :codex -i 10
372
+ ```
373
+
374
+ #### Stale Detection
375
+
376
+ Tracks kanban state between iterations. After 3 consecutive iterations with no task changes (configurable), executes `ON_STALE` hook and exits.
377
+
378
+ ```bash
379
+ # Custom stale threshold
380
+ ./.juno_task/scripts/run_until_completion.sh -s claude -i 5 --stale-threshold 5
381
+
382
+ # Disable stale checking
383
+ ./.juno_task/scripts/run_until_completion.sh -s claude -i 5 --no-stale-check
384
+ ```
385
+
386
+ #### Pre-run Commands & Hooks
387
+
388
+ Execute commands or named hooks before the main loop:
389
+
390
+ ```bash
391
+ # Single pre-run command
392
+ ./.juno_task/scripts/run_until_completion.sh --pre-run "./scripts/lint.sh" -s claude -i 5
393
+
394
+ # Named hooks from config.json
395
+ ./.juno_task/scripts/run_until_completion.sh --pre-run-hook SLACK_SYNC -s claude -i 5
396
+
397
+ # Multiple pre-run commands (executed in order)
398
+ ./.juno_task/scripts/run_until_completion.sh \
399
+ --pre-run "./scripts/sync.sh" \
400
+ --pre-run "npm run build" \
401
+ -s claude -i 5 -v
402
+ ```
403
+
404
+ **Execution order** when both hooks and commands are specified:
405
+ 1. Hooks from `JUNO_PRE_RUN_HOOK` env var
406
+ 2. Hooks from `--pre-run-hook` flags (in order)
407
+ 3. Commands from `JUNO_PRE_RUN` env var
408
+ 4. Commands from `--pre-run` flags (in order)
409
+ 5. Main juno-code loop begins
410
+
411
+ ### Parallel Runner
412
+
413
+ Orchestrate N concurrent juno-code processes with queue management, structured output, and optional tmux visualization.
414
+
415
+ #### Input Modes
416
+
417
+ | Input | Description |
418
+ |-------|-------------|
419
+ | `--kanban T1,T2,T3` | Kanban task IDs |
420
+ | `--kanban-filter '--tag X --status Y'` | Query kanban, auto-extract IDs |
421
+ | `--kanban-filter 'ready'` | Dependency-aware: only unblocked tasks |
422
+ | `--items "a,b,c"` | Generic item list |
423
+ | `--items-file data.csv` | File input (JSONL, CSV, TSV, XLSX) |
424
+
425
+ #### Execution Modes
426
+
427
+ | Mode | Flag | Description |
428
+ |------|------|-------------|
429
+ | Headless | (default) | ThreadPoolExecutor, output to log files |
430
+ | Tmux Windows | `--tmux` | Each worker = tmux window |
431
+ | Tmux Panes | `--tmux panes` | Workers as split panes |
432
+
433
+ ```bash
434
+ # Headless parallel execution
435
+ ./.juno_task/scripts/parallel_runner.sh --kanban T1,T2,T3 --parallel 3
436
+
437
+ # Tmux visualization with 5 workers
438
+ ./.juno_task/scripts/parallel_runner.sh --tmux --kanban T1,T2,T3 --parallel 5
439
+
440
+ # Process file with extraction
441
+ ./.juno_task/scripts/parallel_runner.sh --items-file data.csv --prompt-file crawl.md --strict
442
+
443
+ # Use different AI backend
444
+ ./.juno_task/scripts/parallel_runner.sh -s codex -m :codex --kanban T1,T2
445
+
446
+ # Session control
447
+ ./.juno_task/scripts/parallel_runner.sh --stop --name my-batch
448
+ ./.juno_task/scripts/parallel_runner.sh --stop-all
449
+ ```
450
+
451
+ #### Output & Extraction
452
+
453
+ - **Per-task JSON**: `{output_dir}/{task_id}.json` with exit code, wall time, extracted response
454
+ - **Aggregation JSON**: All tasks merged into one file
455
+ - **Code block extraction**: Finds last fenced code block in output. `--strict` fails the task if not found
456
+ - **Pause/resume**: `touch .juno_task/scripts/logs/.pause_{name}` / remove to resume
457
+
221
458
  ## Slack Integration
222
459
 
223
460
  juno-code includes built-in Slack integration for team collaboration. The system monitors Slack channels and creates kanban tasks from messages, then posts agent responses as threaded replies.
@@ -228,8 +465,6 @@ juno-code includes built-in Slack integration for team collaboration. The system
228
465
  2. **Process**: The AI agent processes tasks and records responses in the kanban
229
466
  3. **Respond**: `slack_respond.sh` sends agent responses back to Slack as threaded replies
230
467
 
231
- This enables a workflow where team members can submit tasks via Slack and receive AI-generated responses without leaving their chat interface.
232
-
233
468
  ### Setup
234
469
 
235
470
  1. **Create a Slack App**:
@@ -266,8 +501,6 @@ This enables a workflow where team members can submit tasks via Slack and receiv
266
501
 
267
502
  ### Automated Slack Workflow with Hooks
268
503
 
269
- Use the `--pre-run` flag to sync with Slack before each juno-code run:
270
-
271
504
  ```bash
272
505
  # Fetch Slack messages before starting work
273
506
  ./.juno_task/scripts/run_until_completion.sh \
@@ -306,8 +539,6 @@ juno-code includes built-in GitHub integration for issue tracking and automated
306
539
  2. **Process**: The AI agent processes tasks and records responses in the kanban
307
540
  3. **Respond**: `github.py respond` posts agent responses as comments on GitHub issues and closes them
308
541
 
309
- This enables a workflow where team members can submit tasks via GitHub issues and receive AI-generated responses with automatic issue closure.
310
-
311
542
  ### Setup
312
543
 
313
544
  1. **Create a GitHub Personal Access Token**:
@@ -342,218 +573,143 @@ This enables a workflow where team members can submit tasks via GitHub issues an
342
573
  # Continuous sync mode with interval
343
574
  ./.juno_task/scripts/github.py sync --repo owner/repo --continuous --interval 600
344
575
 
345
- # One-time sync
346
- ./.juno_task/scripts/github.py sync --repo owner/repo --once
347
-
348
576
  # Dry run to preview what would be posted
349
577
  ./.juno_task/scripts/github.py respond --dry-run --verbose
350
578
  ```
351
579
 
352
- ### Key Features
353
-
354
- - **Tag-based identification**: Uses `github_issue_owner_repo_123` format for O(1) lookups
355
- - **State tracking**: Maintains state in `.juno_task/github/state.ndjson` and `responses.ndjson`
356
- - **Automatic closure**: Issues are automatically closed after posting the agent response
357
- - **Commit linking**: Includes commit hash in comment if available
358
- - **Response format**: Posts `agent_response` field from completed kanban tasks
359
-
360
580
  ### Automated GitHub Workflow with Hooks
361
581
 
362
- Use the `--pre-run` flag to sync with GitHub before each juno-code run:
363
-
364
- ```bash
365
- # Fetch GitHub issues before starting work
366
- ./.juno_task/scripts/run_until_completion.sh \
367
- --pre-run "./.juno_task/scripts/github.py fetch --repo owner/repo" \
368
- -s claude -i 5 -v
369
- ```
370
-
371
- Or configure hooks in `.juno_task/config.json`:
372
-
373
- ```json
374
- {
375
- "hooks": {
376
- "GITHUB_SYNC": {
377
- "commands": [
378
- "./.juno_task/scripts/github.py fetch --repo owner/repo --labels bug",
379
- "./.juno_task/scripts/github.py respond --tag github-issue"
380
- ]
381
- }
382
- }
383
- }
384
- ```
385
-
386
- Then run with the hook:
387
-
388
582
  ```bash
389
583
  ./.juno_task/scripts/run_until_completion.sh --pre-run-hook GITHUB_SYNC -s claude -i 5 -v
390
584
  ```
391
585
 
392
- ## run_until_completion.sh
393
-
394
- The `run_until_completion.sh` script continuously runs juno-code until all kanban tasks are completed. It uses a do-while loop pattern: juno-code runs at least once, then continues while tasks remain in backlog, todo, or in_progress status.
586
+ ## Log Scanner
395
587
 
396
- ### Basic Usage
588
+ Proactive error detection that scans log files and auto-creates kanban bug reports:
397
589
 
398
590
  ```bash
399
- # Run until all tasks complete
400
- ./.juno_task/scripts/run_until_completion.sh -s claude -i 5 -v
401
-
402
- # With custom backend and model
403
- ./.juno_task/scripts/run_until_completion.sh -b shell -s codex -m :codex -i 10
404
- ```
405
-
406
- ### Pre-run Commands (--pre-run)
407
-
408
- Execute commands before the main loop starts. Useful for syncing with external services, running linters, or preparing the environment.
591
+ # Scan for errors and create tasks
592
+ ./.juno_task/scripts/log_scanner.sh
409
593
 
410
- ```bash
411
- # Single pre-run command
412
- ./.juno_task/scripts/run_until_completion.sh --pre-run "./scripts/lint.sh" -s claude -i 5
594
+ # Dry run (report only)
595
+ ./.juno_task/scripts/log_scanner.sh --dry-run --verbose
413
596
 
414
- # Multiple pre-run commands (executed in order)
415
- ./.juno_task/scripts/run_until_completion.sh \
416
- --pre-run "./scripts/sync.sh" \
417
- --pre-run "npm run build" \
418
- -s claude -i 5 -v
597
+ # Check scan status
598
+ ./.juno_task/scripts/log_scanner.sh --status
419
599
 
420
- # Alternative: use environment variable
421
- JUNO_PRE_RUN="./scripts/prepare.sh" \
422
- ./.juno_task/scripts/run_until_completion.sh -s claude -i 5
600
+ # Reset scan state (re-scan everything)
601
+ ./.juno_task/scripts/log_scanner.sh --reset
423
602
  ```
424
603
 
425
- ### Pre-run Hooks (--pre-run-hook)
604
+ Detects Python errors (Traceback, ValueError, TypeError), Node.js errors (UnhandledPromiseRejection, ECONNREFUSED), and general patterns (FATAL, CRITICAL, PANIC, OOM). Uses ripgrep for high-performance scanning with grep fallback.
426
605
 
427
- Execute named hooks defined in `.juno_task/config.json`. Hooks group multiple commands that run together.
428
-
429
- **Define hooks in config.json:**
606
+ Use as a pre-run hook so the agent finds and fixes errors automatically:
430
607
  ```json
431
608
  {
432
609
  "hooks": {
433
610
  "START_ITERATION": {
434
- "commands": [
435
- "./scripts/lint.sh",
436
- "npm run typecheck"
437
- ]
438
- },
439
- "SLACK_SYNC": {
440
- "commands": [
441
- "./.juno_task/scripts/slack_fetch.sh --channel bugs",
442
- "./.juno_task/scripts/slack_respond.sh"
443
- ]
611
+ "commands": ["./.juno_task/scripts/log_scanner.sh"]
444
612
  }
445
613
  }
446
614
  }
447
615
  ```
448
616
 
449
- **Use hooks:**
450
- ```bash
451
- # Single hook
452
- ./.juno_task/scripts/run_until_completion.sh --pre-run-hook START_ITERATION -s claude -i 5
453
-
454
- # Multiple hooks (executed in order)
455
- ./.juno_task/scripts/run_until_completion.sh \
456
- --pre-run-hook SLACK_SYNC \
457
- --pre-run-hook START_ITERATION \
458
- -s claude -i 5
459
-
460
- # Alternative: use environment variable
461
- JUNO_PRE_RUN_HOOK="START_ITERATION" \
462
- ./.juno_task/scripts/run_until_completion.sh -s claude -i 5
463
- ```
464
-
465
- ### Execution Order
466
-
467
- When both hooks and pre-run commands are specified, the execution order is:
468
- 1. Hooks from `JUNO_PRE_RUN_HOOK` env var
469
- 2. Hooks from `--pre-run-hook` flags (in order)
470
- 3. Commands from `JUNO_PRE_RUN` env var
471
- 4. Commands from `--pre-run` flags (in order)
472
- 5. Main juno-code loop begins
473
-
474
- ### Environment Variables
475
-
476
- | Variable | Description |
477
- |----------|-------------|
478
- | `JUNO_DEBUG=true` | Show debug diagnostic messages |
479
- | `JUNO_VERBOSE=true` | Show informational status messages |
480
- | `JUNO_PRE_RUN` | Pre-run command (runs before --pre-run flags) |
481
- | `JUNO_PRE_RUN_HOOK` | Pre-run hook name (runs before --pre-run-hook flags) |
482
- | `JUNO_RUN_UNTIL_MAX_ITERATIONS` | Maximum iterations (0 = unlimited) |
483
-
484
617
  ## Kanban Commands
485
618
 
486
619
  The kanban.sh script wraps juno-kanban. Here are the actual commands:
487
620
 
488
621
  ```bash
489
- # List tasks
490
- ./.juno_task/scripts/kanban.sh list --limit 5
491
- ./.juno_task/scripts/kanban.sh list --status backlog todo in_progress
492
-
493
- # Get task details
622
+ # Task CRUD
623
+ ./.juno_task/scripts/kanban.sh create "Task body" --tags feature,backend
494
624
  ./.juno_task/scripts/kanban.sh get TASK_ID
625
+ ./.juno_task/scripts/kanban.sh update TASK_ID --response "Fixed it" --commit abc123
626
+ ./.juno_task/scripts/kanban.sh mark done --id TASK_ID --response "Completed, tests pass"
627
+ ./.juno_task/scripts/kanban.sh archive TASK_ID
628
+
629
+ # List & search
630
+ ./.juno_task/scripts/kanban.sh list --limit 5 --status backlog todo in_progress
631
+ ./.juno_task/scripts/kanban.sh search --tag backend --status todo
495
632
 
496
- # Mark task status (backlog, todo, in_progress, done)
497
- ./.juno_task/scripts/kanban.sh mark in_progress --ID TASK_ID
498
- ./.juno_task/scripts/kanban.sh mark done --ID TASK_ID --response "Fixed auth, added tests"
633
+ # Dependencies
634
+ ./.juno_task/scripts/kanban.sh create "Deploy" --blocked-by A1b2C3,X4y5Z6
635
+ ./.juno_task/scripts/kanban.sh deps TASK_ID # Show blockers & dependents
636
+ ./.juno_task/scripts/kanban.sh deps add --id T1 --blocked-by T2 # Add dependency
637
+ ./.juno_task/scripts/kanban.sh deps remove --id T1 --blocked-by T2
638
+ ./.juno_task/scripts/kanban.sh ready # Tasks with no unmet blockers
639
+ ./.juno_task/scripts/kanban.sh order --scores # Topological execution order
499
640
 
500
- # Update task with git commit reference
501
- ./.juno_task/scripts/kanban.sh update TASK_ID --commit abc123
641
+ # Merge (monorepo support)
642
+ ./.juno_task/scripts/kanban.sh merge source/ --into target/ --strategy keep-newer
502
643
  ```
503
644
 
504
- ## Backends & Services
645
+ **Task schema**: `{id, status, body, commit_hash, agent_response, created_date, last_modified, feature_tags[], related_tasks[], blocked_by[]}`
505
646
 
506
- ### Available Backends
647
+ **Status lifecycle**: `backlog → todo → in_progress → done → archive`
507
648
 
508
- - **shell** - Direct execution via service scripts (recommended for headless)
509
- - **mcp** - Model Context Protocol servers (full tool integration)
649
+ **Body markup** (auto-parsed on create):
650
+ - `[task_id]ID1, ID2[/task_id]` `related_tasks`
651
+ - `[blocked_by]ID1, ID2[/blocked_by]` → `blocked_by` (synonyms: `block_by`, `block`, `parent_task`)
510
652
 
511
- ### Supported Services
653
+ ## Configuration
512
654
 
513
- | Service | Default Model | Shorthands |
514
- |---------|---------------|------------|
515
- | claude | `claude-sonnet-4-6` | `:haiku`, `:sonnet`, `:opus` |
516
- | codex | `gpt-5.3-codex` | `:codex`, `:codex-mini`, `:gpt-5`, `:mini` |
517
- | gemini | `gemini-2.5-pro` | `:pro`, `:flash`, `:pro-3`, `:flash-3` |
518
- | pi | `anthropic/claude-sonnet-4-6` | `:pi`, `:sonnet`, `:opus`, `:gpt-5`, `:codex`, `:gemini-pro` |
655
+ ### Hierarchy (highest to lowest priority)
519
656
 
520
- > **Pi** is a multi-provider coding agent that supports Anthropic, OpenAI, Google, Groq, xAI, and more.
521
- > It requires separate installation: `npm install -g @mariozechner/pi-coding-agent`
657
+ 1. CLI arguments
658
+ 2. Environment variables (`JUNO_CODE_*`)
659
+ 3. Project config (`.juno_task/config.json`)
660
+ 4. Global config files
661
+ 5. Hardcoded defaults
522
662
 
523
- ### Custom Backends
663
+ ### Project Env Bootstrap (`.env.juno`)
524
664
 
525
- Service scripts live in `~/.juno_code/services/`. Each is a Python script:
665
+ `juno-code` now bootstraps a project env file automatically:
526
666
 
527
- ```bash
528
- # View installed services
529
- juno-code services list
667
+ - On `juno-code init`: creates an empty `.env.juno` in project root
668
+ - On any `juno-code` run: ensures `.env.juno` exists (creates if missing)
669
+ - Loads env values before execution so hooks and subagent processes receive them
670
+ - Supports custom env file path via `.juno_task/config.json`
530
671
 
531
- # Force reinstall (get latest)
532
- juno-code services install --force
672
+ Example config:
673
+
674
+ ```json
675
+ {
676
+ "envFilePath": ".env.local",
677
+ "envFileCopied": true
678
+ }
533
679
  ```
534
680
 
535
- To add a custom backend:
536
- 1. Create a Python script in `~/.juno_code/services/`
537
- 2. Accept standard args: `-p/--prompt`, `-m/--model`, `-v/--verbose`
538
- 3. Output JSON events to stdout for structured parsing
681
+ Notes:
682
+ - `envFilePath`: env file to load (relative to project root or absolute path)
683
+ - `envFileCopied`: tracks one-time initialization from `.env.juno` to custom env path
684
+ - Load order: `.env.juno` first, then `envFilePath` (custom file overrides defaults)
539
685
 
540
- ## Project Structure
686
+ ### Project Structure
541
687
 
542
688
  After `juno-code init`:
543
689
 
544
690
  ```
545
691
  your-project/
692
+ ├── .env.juno # Project env file auto-created and loaded on startup
546
693
  ├── .juno_task/
547
694
  │ ├── init.md # Task breakdown (your input)
548
695
  │ ├── prompt.md # AI instructions (Ralph-style prompt)
549
696
  │ ├── plan.md # Progress tracking
550
- │ ├── USER_FEEDBACK.md # Issue tracking
551
- │ ├── config.json # Configuration
697
+ │ ├── USER_FEEDBACK.md # Issue tracking (write here while agent runs)
698
+ │ ├── config.json # Hooks, agent config, project settings
552
699
  │ ├── scripts/ # Auto-installed utilities
553
- │ │ ├── run_until_completion.sh
554
700
  │ │ ├── kanban.sh
555
- │ │ └── install_requirements.sh
556
- └── tasks/ # Kanban tasks (ndjson)
701
+ │ │ ├── run_until_completion.sh
702
+ │ ├── parallel_runner.sh
703
+ │ │ ├── log_scanner.sh
704
+ │ │ ├── install_requirements.sh
705
+ │ │ ├── slack_fetch.sh / slack_fetch.py
706
+ │ │ ├── slack_respond.sh / slack_respond.py
707
+ │ │ ├── github.py
708
+ │ │ └── hooks/session_counter.sh
709
+ │ ├── tasks/ # Kanban tasks (NDJSON)
710
+ │ └── logs/ # Agent session logs
711
+ ├── .claude/skills/ # Claude agent skills (auto-provisioned)
712
+ ├── .agents/skills/ # Codex agent skills (auto-provisioned)
557
713
  ├── CLAUDE.md # Session learnings
558
714
  └── AGENTS.md # Agent performance
559
715
  ```
@@ -570,7 +726,23 @@ export JUNO_CODE_MAX_ITERATIONS=10
570
726
  # Service-specific
571
727
  export CODEX_HIDE_STREAM_TYPES="turn_diff,token_count"
572
728
  export GEMINI_API_KEY=your-key
573
- export CLAUDE_USER_MESSAGE_PRETTY_TRUNCATE=4
729
+
730
+ # Execution control
731
+ export JUNO_STALE_THRESHOLD=3 # Stale iteration limit
732
+ export JUNO_PRE_RUN="./scripts/sync.sh" # Pre-run command
733
+ export JUNO_PRE_RUN_HOOK="SLACK_SYNC" # Pre-run hook name
734
+ export JUNO_RUN_UNTIL_MAX_ITERATIONS=0 # Max iterations (0=unlimited)
735
+ export JUNO_SESSION_COUNTER_THRESHOLD=100 # Session length warning threshold
736
+
737
+ # Integration
738
+ export SLACK_BOT_TOKEN=xoxb-your-token
739
+ export SLACK_CHANNEL=bug-reports
740
+ export GITHUB_TOKEN=ghp_your-token
741
+ export GITHUB_REPO=owner/repo
742
+
743
+ # Debug
744
+ export JUNO_DEBUG=true # Enable [DEBUG] output
745
+ export JUNO_VERBOSE=true # Enable [INFO] output
574
746
 
575
747
  # Pi requires the pi-coding-agent CLI installed globally
576
748
  # npm install -g @mariozechner/pi-coding-agent
@@ -604,17 +776,44 @@ juno-code -b shell -s codex -p "Same investigation" -i 3
604
776
  juno-code -b shell -s pi -m :sonnet -p "Same investigation" -i 3
605
777
  ```
606
778
 
607
- ### Iterative Feature Development
779
+ ### Parallel Batch Processing
608
780
 
609
781
  ```bash
610
- # Tasks are tracked via kanban
611
- # (Tasks created by agent or imported)
782
+ # Process 100 kanban tasks with 5 workers
783
+ ./.juno_task/scripts/parallel_runner.sh --kanban T1,T2,...,T100 --parallel 5
612
784
 
613
- # Run until all tasks complete
614
- ./.juno_task/scripts/run_until_completion.sh -s claude -i 10 -v
785
+ # Visual monitoring
786
+ ./.juno_task/scripts/parallel_runner.sh --tmux --kanban T1,T2,T3 --parallel 3
787
+
788
+ # Process a CSV dataset
789
+ ./.juno_task/scripts/parallel_runner.sh --items-file data.csv --prompt-file process.md --strict --file-format csv
790
+ ```
791
+
792
+ ### Dependency-Aware Workflow
793
+
794
+ ```bash
795
+ # Create tasks with dependencies
796
+ ./.juno_task/scripts/kanban.sh create "Setup database" --tags infra
797
+ ./.juno_task/scripts/kanban.sh create "Build API [blocked_by]DBID[/blocked_by]" --tags backend
798
+ ./.juno_task/scripts/kanban.sh create "Build UI [blocked_by]APIID[/blocked_by]" --tags frontend
799
+
800
+ # See what's ready to work on
801
+ ./.juno_task/scripts/kanban.sh ready
802
+
803
+ # Execution order respecting dependencies
804
+ ./.juno_task/scripts/kanban.sh order --scores
805
+
806
+ # Run only unblocked tasks in parallel
807
+ ./.juno_task/scripts/parallel_runner.sh --kanban-filter 'ready' --parallel 3
808
+ ```
615
809
 
616
- # Each completed task has a git commit for traceability
617
- git log --oneline
810
+ ### Slack-Driven Development
811
+
812
+ ```bash
813
+ # Full automated loop: Slack → Agent → Slack
814
+ ./.juno_task/scripts/run_until_completion.sh \
815
+ --pre-run-hook SLACK_SYNC \
816
+ -s claude -i 5 -v
618
817
  ```
619
818
 
620
819
  ## Comparison: Ralph vs juno-code
@@ -625,39 +824,17 @@ git log --oneline
625
824
  | **Core Loop** | `while :; do claude; done` | Controlled iterations |
626
825
  | **Stopping** | Ctrl+C (guesswork) | `-i N` or "until tasks done" |
627
826
  | **Source of Truth** | Markdown files (TASKS.md, PLANNING.md) | Structured kanban over bash |
628
- | **Format Integrity** | Relies on LLM instruction-following | Strict format, always parseable |
827
+ | **Format Integrity** | Relies on LLM instruction-following | Strict NDJSON, always parseable |
629
828
  | **Multiple AIs** | Claude only | Claude, Codex, Gemini, Pi, Cursor |
829
+ | **Dependencies** | None | blocked_by, ready, topological sort |
830
+ | **Parallelism** | None | parallel_runner with N workers |
630
831
  | **Traceability** | None | Every task → git commit |
832
+ | **Integrations** | None | Slack, GitHub Issues |
631
833
  | **Hooks** | Claude-specific | Works with any backend |
834
+ | **Error Detection** | None | Log scanner with auto bug reports |
632
835
  | **Verbose** | Raw JSON | Human-readable + jq-friendly |
633
836
  | **Feedback** | None | Real-time during execution |
634
837
 
635
- ### Why Structured Kanban Over Markdown?
636
-
637
- Ralph uses markdown files (TASKS.md, PLANNING.md) as its source of truth. This works for **one-time tasks** like "migrate the whole repo from TypeScript to Rust."
638
-
639
- But for **iterative development**, markdown files break down:
640
-
641
- - **No strict format**: LLMs can corrupt the structure, add extra formatting, forget sections
642
- - **Context bloat**: Long plan.md files confuse agents and waste tokens
643
- - **No query capability**: Can't ask "what's in progress?" without parsing prose
644
- - **No task isolation**: Changes to one task can accidentally affect others
645
-
646
- juno-code uses **structured kanban over bash**:
647
-
648
- ```bash
649
- # Always parseable - the format can never break
650
- ./.juno_task/scripts/kanban.sh list --status in_progress
651
-
652
- # Query specific tasks
653
- ./.juno_task/scripts/kanban.sh get TASK_ID
654
-
655
- # Tasks stored as NDJSON - one line per task
656
- # Each task is self-contained and isolated
657
- ```
658
-
659
- This lets juno-code scale Ralph's insight (AI works better in loops) to **thousands of tasks** without the agent losing track or corrupting state.
660
-
661
838
  ## Troubleshooting
662
839
 
663
840
  ### Service scripts not updating
@@ -677,6 +854,43 @@ juno-code -v -b shell -s codex -m :codex -p "test"
677
854
  ./.juno_task/scripts/kanban.sh list --status backlog todo in_progress
678
855
  ```
679
856
 
857
+ ### Skills not appearing
858
+ ```bash
859
+ juno-code skills list
860
+ juno-code skills install --force
861
+ ```
862
+
863
+ ### Python environment issues
864
+ ```bash
865
+ # Force reinstall Python dependencies
866
+ ./.juno_task/scripts/install_requirements.sh --force-update
867
+ ```
868
+
869
+ ## Build from Source
870
+
871
+ ```bash
872
+ cd juno-code
873
+
874
+ # Build
875
+ npm run build
876
+
877
+ # Build as exp-juno-code (local testing)
878
+ npm run build:exp
879
+
880
+ # Remove exp-juno-code
881
+ npm run uninstall:exp
882
+
883
+ # Run tests
884
+ npm test # Fast tests
885
+ npm run test:full # Full suite
886
+ npm run test:coverage # With coverage
887
+
888
+ # Lint & format
889
+ npm run lint
890
+ npm run format:check
891
+ npm run typecheck
892
+ ```
893
+
680
894
  ## Credits
681
895
 
682
896
  juno-code is inspired by [Geoffrey Huntley's Ralph Method](https://ghuntley.com/ralph/)—the insight that AI delivers production software through iterative refinement. juno-code adds the structure that makes Ralph sustainable for real development work.