Skip to content

Code session — scaffolder — 2026-03-22

Code session — scaffolder — 2026-03-22

Section titled “Code session — scaffolder — 2026-03-22”

Executed docs/issues/GITHUB-ISSUES-2026-03-21-v0100-cli-rewrite.md top to bottom (34 operations, 7 phases).

Phase 1 — Remove dead CLI commands (decision-0002)

Section titled “Phase 1 — Remove dead CLI commands (decision-0002)”
  • Deleted 5 source files: scHelp.ts, scQueue.ts, scRuleset.ts, openVSCode.ts, session.ts
  • Removed all imports, functions, and switch cases for 11 commands
  • Inlined openVSCode into index.ts (one-line execSync call used by handleCreate)
  • Removed unused capitalize function
  • Fixed duplicate execSync import in index.ts
  • Updated usage text to show only: init, config, create, start, update, migrate-path
  • New handleStart: resolves project path from config.defaultDrive, verifies existence, launches harley
  • Added start case back to switch statement
  • Tested: usage error (no args), nonexistent project error, path resolution
  • Found and replaced hardcoded fallbacks in 5 files: createFolders.ts, index.ts, scMigratePath.ts, updateProject.ts (2 locations), config.ts
  • All now require config.defaultDrive; error out with clear message if not set
  • Renamed defaultScaleTier default from “hobby” to “basic” per decision-0001
  • Tested: empty defaultDrive produces “No default drive configured” error
  • Tested: list, get (valid key, invalid key), set (set/verify/restore), edge cases (missing args, no subcommand, empty value)
  • All tests passed. Closed #273.
  • Created test project, set version to 0.8.1, ran update to 0.9.0 — success
  • Discovered and fixed bug: createBackup crashed on subdirectory paths (ai-sessions/) because it didn’t create parent dirs in backup location
  • Tested rollback — success
  • Tested nonexistent project — clear error
  • Cleaned up test project and GitHub repo
  • Closed #269.
  • Created .claude/settings.json with SessionEnd hook
  • Hook auto-commits modified ai-sessions/ files on exit
  • Note: AI-generated content (CURRENT-CODE.md, session logs) still requires the session-end skill to run first; the hook catches anything left uncommitted
  • Clean build, sc —version 0.9.1, dry-run shows correct paths
  • Pushed feature/cli-rewrite, opened PR #319 to dev
  • PR merged by operator
  • Inlined openVSCode rather than keeping a one-line module
  • SessionEnd hook (not Stop) — Stop fires every turn which would be too noisy
  • Hook only auto-commits session files, doesn’t attempt AI-generated content
  • createBackup in updateProject.ts didn’t create subdirectories before copying files in nested paths
  • Duplicate execSync import in index.ts after replacing openVSCode import
  • feature/cli-rewrite merged to dev
  • CLI commands: init, config, create, start, update, migrate-path (6 total, down from ~17)
  • No hardcoded paths anywhere in src/
  • 2 issues remain open: #257 (README), #300 (docs audit)
  • Build clean
  • Joker session needed for #257 and #300
  • Then release flow: dev -> staging -> main -> tag v0.10.0