feat: add bridge script for Claude Code → LM Studio execution (v3.12.1)
Bridge script enables local execution of Claude Code plans via LM Studio: - Python CLI with 5 components (DoobidooReader, LMStudioClient, Validator, StepExecutor, PlanExecutor) - JSON Schema for plan validation (bridge-plan-schema.json) - Cost optimization: Plan with Opus (~$0.50-2), execute free locally (80-90% savings) - 4 validation types: json, syntax_check, contains_keys, non_empty - CLI: --health, --list, --plan ID, -v verbose mode Documentation: - New section "Local Execution Bridge" in ultimate-guide.md §11.2 - scripts/README.md with full usage documentation - machine-readable/reference.yaml entries for discoverability Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
2ace737018
commit
96da6ebd7e
10 changed files with 1223 additions and 10 deletions
126
examples/scripts/bridge-plan-schema.json
Normal file
126
examples/scripts/bridge-plan-schema.json
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "bridge-plan-v1",
|
||||
"title": "Bridge Plan Schema",
|
||||
"description": "Schema for Claude Code → LM Studio bridge execution plans",
|
||||
"type": "object",
|
||||
"required": ["$schema", "id", "status", "context", "steps"],
|
||||
"properties": {
|
||||
"$schema": {
|
||||
"type": "string",
|
||||
"const": "bridge-plan-v1"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^plan_[a-z0-9_]+$",
|
||||
"description": "Unique plan identifier (e.g., plan_auth_refactor)"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["pending", "in_progress", "completed", "failed"],
|
||||
"default": "pending"
|
||||
},
|
||||
"context": {
|
||||
"type": "object",
|
||||
"required": ["objective"],
|
||||
"properties": {
|
||||
"project": {
|
||||
"type": "string",
|
||||
"description": "Absolute path to project root"
|
||||
},
|
||||
"objective": {
|
||||
"type": "string",
|
||||
"description": "High-level description of what the plan achieves"
|
||||
},
|
||||
"constraints": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Constraints or requirements for execution"
|
||||
},
|
||||
"files_context": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string",
|
||||
"enum": ["LOAD", "REFERENCE"],
|
||||
"description": "LOAD = inject content, REFERENCE = mention path only"
|
||||
},
|
||||
"description": "Files to include in execution context"
|
||||
}
|
||||
}
|
||||
},
|
||||
"steps": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "type", "description", "prompt"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"description": "Step number (1-indexed)"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["analysis", "code_generation", "code_modification", "decision"],
|
||||
"description": "Type of task for this step"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"maxLength": 200,
|
||||
"description": "Short description of what this step does"
|
||||
},
|
||||
"prompt": {
|
||||
"type": "string",
|
||||
"description": "Full prompt to send to LM Studio"
|
||||
},
|
||||
"depends_on": {
|
||||
"type": "array",
|
||||
"items": {"type": "integer"},
|
||||
"default": [],
|
||||
"description": "Step IDs that must complete before this one"
|
||||
},
|
||||
"validation": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["json", "syntax_check", "contains_keys", "non_empty"],
|
||||
"description": "Validation method for step output"
|
||||
},
|
||||
"keys": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Required keys for contains_keys validation"
|
||||
}
|
||||
},
|
||||
"required": ["type"]
|
||||
},
|
||||
"file_output": {
|
||||
"type": "string",
|
||||
"description": "Path to write output (relative to project root)"
|
||||
},
|
||||
"on_failure": {
|
||||
"type": "string",
|
||||
"enum": ["retry_with_context", "skip", "halt"],
|
||||
"default": "retry_with_context",
|
||||
"description": "Behavior when step fails validation"
|
||||
},
|
||||
"max_retries": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 5,
|
||||
"default": 2,
|
||||
"description": "Maximum retry attempts"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"rollback_strategy": {
|
||||
"type": "string",
|
||||
"enum": ["revert_files", "none"],
|
||||
"default": "none",
|
||||
"description": "What to do on plan failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue