Skip to content

feat(loop): cross-platform /goal + /loop, external-runner wiring, v0.20.0 - #61

Merged
PDgit12 merged 1 commit into
mainfrom
feat/goal-loop-cross-platform
Jul 8, 2026
Merged

feat(loop): cross-platform /goal + /loop, external-runner wiring, v0.20.0#61
PDgit12 merged 1 commit into
mainfrom
feat/goal-loop-cross-platform

Conversation

@PDgit12

@PDgit12 PDgit12 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

What

Bring both loop front doors to full parity on every platform with a slash surface, and wire /loop to the external runner (knitbrain loop) instead of the in-agent run_loop tool.

/loop — launches the external runner (owns control flow)

Background-launches knitbrain loop <goalfile> detached: spawns a fresh agent per checkbox, verify-gated, survives the context window, doesn't depend on any model choosing to continue. A slash command can't be an hour-long loop, so it launches the runner and hands back a watch handle (PID + log).

/goal — in-session gate orchestration (was Claude-only)

knitbrain_run → adopt skill → drive knitbrain_run_loop each cycle until the verify gate exits 0. Now emitted for all slash-capable platforms via a shared goalOrchestrationInstructions() helper.

Per-platform native formats (verified against live docs)

Platform /goal + /loop
Claude Code .claude/commands/*.md
Gemini CLI .gemini/commands/*.toml
VS Code Copilot .github/prompts/*.prompt.md
Windsurf .windsurf/workflows/*.md
Codex CLI ~/.codex/prompts/*.md (global, snippet)
Cursor terminal knitbrain loop — no slash API, documented in rules
  • slashCommands() registers /goal + /loop on all five slash platforms (claude-code was missing /goal).
  • Onboarding hints + README platform table updated to the honest split.
  • v0.20.0 bump; +7 tests (618 green); consistency + bench pass.

Honest caveats (baked into the command text)

  • VS Code / Windsurf are IDE-embedded — no headless self to spawn — so their runner drives an installed CLI worker (default claude -p, override --agent).
  • Cursor has no markdown slash-command mechanism at all → terminal-only.

https://claude.ai/code/session_01Mnwx3jqRivG66r1aneoZYf

…20.0

Rewire /loop to LAUNCH the external runner (knitbrain loop) detached instead
of the in-agent run_loop tool, and bring both front doors to full parity on
every host with a slash surface:

- /loop: background-launch knitbrain loop <goalfile> (owns control flow, fresh
  agent per iteration, survives context window) — Claude, Codex, Gemini,
  VS Code, Windsurf; Cursor via terminal (documented in rules).
- /goal: in-session gate orchestration (knitbrain_run -> knitbrain_run_loop),
  now emitted for all slash-capable platforms via a shared
  goalOrchestrationInstructions() helper (was Claude-only).
- Per-platform native formats: Gemini .gemini/commands/*.toml, VS Code
  .github/prompts/*.prompt.md, Windsurf .windsurf/workflows/*.md, Codex
  ~/.codex/prompts (snippet). Formats verified against live docs.
- slashCommands() registers /goal + /loop on all five slash platforms
  (claude-code was missing /goal in the registry).
- Onboarding hints + README platform table updated to the honest split.
- +7 tests (618 green), consistency + bench pass.

Claude-Session: https://claude.ai/code/session_01Mnwx3jqRivG66r1aneoZYf
Copilot AI review requested due to automatic review settings July 8, 2026 06:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@PDgit12
PDgit12 merged commit d023710 into main Jul 8, 2026
5 checks passed
@PDgit12
PDgit12 deleted the feat/goal-loop-cross-platform branch July 8, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants