Skip to content
Back to skills

205 Fn 917 D5a6abcf

ASecurity

Implement ralph spawning and detach behavior for TUI.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
developmenttypescript

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 205-fn-917_d5a6abcf --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 205 Fn 917 D5a6abcf?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 205 Fn 917 D5a6abcf
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-205-fn-917-d5a6abcf/badge)](https://www.skillsdirectory.com/skills/tools-only-205-fn-917-d5a6abcf)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# fn-9.17 Run spawning and detach

## Description
Implement ralph spawning and detach behavior for TUI.

### File

`src/lib/spawn.ts`

### Functions

```typescript
// Locate ralph.sh
function findRalphScript(): string | null

// Spawn ralph detached, return run ID
async function spawnRalph(epicId: string): Promise<{runId: string, pid: number}>

// Check if ralph is running for a run
async function isRalphRunning(runId: string): Promise<boolean>
```

### ralph.sh location

Search order:
1. `scripts/ralph/ralph.sh` (repo-local after /flow-next:ralph-init)
2. `plugins/flow-next/skills/flow-next-ralph-init/templates/ralph.sh`
3. Error with instructions to run `/flow-next:ralph-init`

### Detach semantics

- Spawn ralph via `Bun.spawn` with `detached: true`
- TUI Ctrl+C exits cleanly, ralph keeps running
- Store PID for potential future actions (stop/signal)

### Run ID

Ralph creates run ID in format `YYYY-MM-DD-NNN`. After spawn, poll `scripts/ralph/runs/` to detect new run.
## Acceptance
- [ ] `findRalphScript()` locates ralph.sh or returns null
- [ ] `spawnRalph()` starts ralph detached
- [ ] TUI exit (Ctrl+C) does not kill spawned ralph
- [ ] Run ID returned matches new run directory
- [ ] Missing ralph.sh shows helpful error message
## Done summary
- Added `spawn.ts` with ralph spawning and detach functionality
- `findRalphScript()` searches scripts/ralph then plugin template
- `spawnRalph()` spawns detached, polls for new run ID
- `isRalphRunning()` checks progress.txt for COMPLETE marker

- Enables TUI to spawn ralph without blocking
- Clean Ctrl+C exit won't kill spawned ralph process

- All tests pass (383 total, 7 new for spawn.ts)
- Lint clean
## Evidence
- Commits: 49e181519aafc7d70070cd354bdddbf1f161565b
- Tests: bun test
- PRs:

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.