Ralphdex is a VS Code extension that:
- builds Ralph prompts from durable workspace files
- hands prepared prompts to AI IDE surfaces through clipboard plus configurable VS Code command IDs
- runs controlled CLI iterations (
codex,claude,copilot,copilot-foundry,azure-foundry,gemini) with deterministic verification, provenance, and stop behavior
- Edit
src/andtest/. Treatout/,out-test/, and packaged.vsixfiles as generated artifacts. - Keep
AGENTS.mdthin: AGENTS.md is a routing/control document, not the place for detailed durable rules. package.jsonis authoritative for commands, settings, activation events, scripts, and runtime expectations.- Keep docs aligned with code in the same change; prefer the focused doc that owns a rule over restating it elsewhere.
- README.md: product overview, quick start, and doc index
- docs/architecture.md: module boundaries and end-to-end flow
- docs/workflows.md: command-driven operator workflows
- docs/testing.md: validation gate and test coverage
- docs/invariants.md: control-plane, task-schema, and artifact-model invariants
- docs/provenance.md: prompt/plan/invocation/run trust chain
- docs/security.md: harness security/data-handling boundary and secret-handling expectations
- docs/verifier.md: verifier modes, outcome classes, and stop implications
- docs/boundaries.md: explicit non-goals, trust limits, and orchestration boundaries
- docs/multi-agent-readiness.md: historical acceptance record for the multi-agent readiness milestone
- docs/prompt-calibration.md: token target derivation, recalibration procedure, and reasoning effort overhead
src/commands/registerCommands.ts: command wiring and user-visible status/reporting behaviorsrc/prompt/promptBuilder.ts: prompt-kind selection, template rendering, and prompt evidencesrc/ralph/iterationEngine.ts: thin loop orchestrator and phase order wiringsrc/ralph/iteration/IterationExecutor.ts: CLI/provider execution and invocation persistence handoffsrc/ralph/iteration/VerificationRunner.ts: validation/git/task-state verifier orchestration and structured verification outputssrc/ralph/iteration/OutcomeClassifier.ts: deterministic outcome classification and iteration-result shapingsrc/ralph/iteration/RemediationCoordinator.ts: remediation synthesis and auto-apply coordinationsrc/ralph/iteration/ScmCoordinator.ts: branch-per-task + commit-on-done SCM actionssrc/ralph/iteration/ArtifactPersistenceService.ts: iteration/provenance artifact persistencesrc/ralph/iteration/LoopDecisionService.ts: loop continuation/stop decision evaluationsrc/ralph/completionReportParser.ts: completion-report parsing and structured extraction from Codex outputsrc/ralph/taskDecomposition.ts: remediation artifact shaping, deterministic child-task decomposition, and auto-remediation application (mark_blocked, decompose_task)src/ralph/taskCreation.ts: shared producer-facing task-creation pipeline for append, replace, and child-task persistencesrc/ralph/cliOutputFormatter.ts: claude stream-json line formatting for log outputsrc/ralph/reviewPolicy.ts: review-agent file-change anomaly detection and policy enforcementsrc/ralph/reconciliation.ts: completion-report reconciliation into task-state updates and warningssrc/ralph/preflight.ts: deterministic preflight diagnostics and blocking behaviorsrc/ralph/doctrine.ts: deterministic doctrine pack scaffolding and structural validationsrc/ralph/doctrineProposals.ts: doctrine-update proposal validation, classification, and artifact shaping without mutating doctrine filessrc/ralph/taskFile.ts: task schema, normalization, and deterministic selectionsrc/ralph/verifier.ts: verifier behavior and git-aware summariessrc/ralph/loopLogic.ts: outcome classification and stop decisionssrc/ralph/integrity.ts: hashing and execution-integrity helperssrc/ralph/executionIntegrity.ts: pre-execution integrity verification, integrity-failure error types, and stale-task detectionsrc/ralph/artifactStore.ts: artifact layout, latest pointers, run bundles, and retention cleanupsrc/codex/claudeCliProvider.ts: claude -p execution strategy and transcript buildersrc/ralph/pipeline.ts: end-to-end pipeline orchestration — PRD-fragment intake, task decomposition, agent loop, review-agent pass, SCM/PR submission, human-review gate coordination, and pipeline-run provenance artifactsrc/ralph/orchestrationSupervisor.ts: durable graph-backed orchestration — graph/state schema, single-transition-per-write advanceState, evidence-gated transitions, and orchestration artifact persistencesrc/ralph/handoffManager.ts: durable handoff contract lifecycle — propose/accept/reject/expire state machine, role-gated acceptance, contested-status detection, and atomic file-backed persistence under.ralph/handoffs/src/webview/: reusable webview infrastructure — WebviewPanelManager (named-panel lifecycle), MessageBridge (typed extension↔webview messaging), and shared stylesheet
-
Ralphdex: Prepare IDE Prompt -
Ralphdex: Open Codex IDE -
Ralphdex: Run Single Iteration -
Ralphdex: Run Loop -
Ralphdex: Run Multi-Agent Loop -
Ralphdex: Show Status -
Ralphdex: Initialize Doctrine Pack -
Ralphdex: Open Latest Ralph Summary -
Ralphdex: Open Latest Provenance Bundle -
Ralphdex: Open Latest Prompt Evidence -
Ralphdex: Open Latest CLI Transcript -
Ralphdex: Apply Latest Task Decomposition Proposal -
Ralphdex: Resolve Stale Task Claim -
Ralphdex: Reveal Latest Provenance Bundle Directory -
Ralphdex: Clean Up Old Run Artifacts -
Ralphdex: Reset Runtime State -
Ralphdex: Run Full Workflow -
Ralphdex: Open Latest Run Report -
Ralphdex: Regenerate PRD -
Ralphdex: Show Sidebar -
npm run check:docs: deterministic docs/architecture sanity checks for required files, headings, links, and ownership guardrails -
npm run validate: authoritative compile + type-check + test gate -
npm run test:activation: thin real Extension Development Host smoke path
tasks.json tasks may include an optional tier field (simple | medium | complex). When present, it overrides runtime heuristic scoring and forces selectModelForTask to use the declared tier directly. Omit it to let dynamic scoring decide.
{
"id": "T5",
"title": "Implement caching layer",
"status": "todo",
"tier": "complex"
}Full schema rules and invariants live in docs/invariants.md. The canonical normalized-task contract — field-presence categories, coercion rules, and child-task conversion behavior — lives in docs/invariants.md § Normalized Task Contract.
.ralph/crew.json is an optional JSON array that defines a named crew for multi-agent loops. Each entry requires id (string) and role (planner | implementer | reviewer), and accepts optional goal and backstory strings. When absent, Ralph synthesizes a uniform crew from ralphCodex.agentCount. ralphCodex.agentRole sets the active role for one running agent; the default is implementer.
ralphCodex.planningPass.enabled and ralphCodex.planningPass.mode control the pre-execution planning pass. Default: enabled=true, mode='inline'. Full workflow: docs/workflows.md. Readiness enforcement modes (ralphCodex.taskReadinessGate): docs/workflows.md.
Example .ralph/crew.json with one planner and two implementers:
[
{ "id": "planner-1", "role": "planner", "goal": "Decompose each task into a clear, executable plan.", "backstory": "An experienced software architect." },
{ "id": "impl-1", "role": "implementer", "goal": "Implement assigned tasks with complete, tested code.", "backstory": "A senior full-stack developer." },
{ "id": "impl-2", "role": "implementer", "goal": "Implement assigned tasks and write unit tests.", "backstory": "A backend engineer focused on correctness." }
]- IDE handoff is clipboard plus
vscode.commands.executeCommand(...); do not invent direct composer injection or unsupported AI IDE APIs. - Scripted automation runs through the configured provider execution path (
codex,claude,copilot,copilot-foundry,azure-foundry, orgemini). preferredHandoffMode = cliExecdoes not makeOpen Codex IDErun the CLI.- CLI runs can prove prepared-and-executed prompt integrity; IDE handoff only proves the prepared prompt bundle.