You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes#50.
Lets scouts and results live outside the ralph-for-kiro checkout via a
documented resolution order:
1. --user-dir <path> (highest priority)
2. $RALPH_USER_DIR
3. $XDG_CONFIG_HOME/ralph-for-kiro/ (honored only when present)
4. process.cwd() (legacy fallback — preserves existing crons)
Implementation:
- src/utils/paths.ts — new getUserDir() / resolveUserDir() /
setUserDir() helpers; scoutsDir() / resultsDir() /
watchManifestFile() getters replace the old SCOUTS_DIR /
RESULTS_DIR / WATCH_MANIFEST_FILE constants.
- src/index.ts — --user-dir is a global program option; a
preSubcommand commander hook calls setUserDir() once before any
subcommand handler runs, so every path helper reads a stable value
for the duration of the process.
- src/core/watch-runner.ts + src/commands/{watch,scout}.ts — all path
call sites migrated to the new getters.
- src/commands/scout.ts — new `--from-example <template>` option on
`ralph scout init`. A SCOUT_EXAMPLES registry maps template keys to
bundled manifest JSON + steering markdown (currently: hn-frontpage).
`ralph scout init --from-example hn-frontpage my-hn-scout` copies
both files into the new scout's tree; ensureScoutKiroTree
preserves steering on first run so the template customization
survives.
- scouts/README.md — documents the resolution order, drops the
incorrect "4am CST cron" reference (cron times run in the host's
local TZ, not ours), and shows a generic cron example that pins
$RALPH_USER_DIR explicitly.
Tests:
- tests/user-dir.test.ts — 6 new tests for the full resolution
precedence, including XDG-when-absent falling through to cwd,
and scoutsDir/resultsDir/watchManifestFile following the active
user dir.
- tests/scout-init.test.ts — 2 new tests for --from-example:
happy path (manifest + steering land) and unknown-template
rejection.
Backwards compatibility: setting no flag / env / XDG dir results in the
previous repo-relative behavior. Existing cron invocations keep working
without modification.
Verified with live CLI runs: `--user-dir`, `RALPH_USER_DIR`, and
`scout init --from-example` all produce expected files; backwards-compat
fallback correctly reports no scouts when cwd is empty.
All gates green: typecheck, biome, 101/101 tests.
0 commit comments