Skip to content

Auto Engineer

AutoEngineer component — mvp.auto_engineer

Cluster: Code Intelligence | Type: component | MCP Tools: 35

Overview

Pilot-ready, not enterprise-complete

auto_engineer is intended for local pilot workflows and fast component scaffolding. It rejects unresolved imports, avoids executing generated code during import checks, constrains generated file writes to the supplied workspace_root, and requires workspace_root for rollback when files were written. Treat generated output as a draft: preview diffs, run tests, and review changes before relying on it in production. It does not yet provide enterprise-grade concurrent build locking, full clean-machine MCP install verification, or an in-product generated-file diff approval UI.

Code generation flywheel that scaffolds new G6 components — source files, MCP sub-packages, and test suites — from a structured specification. Supports four operations (scaffold_all, scaffold_component, scaffold_mcp, scaffold_tests) plus preview for dry-run output; optionally writes generated files to disk and uses an exemplar store and LLM chain to improve generation quality over time.

When to use:

  • Bootstrapping a new Polylith component with schema, block, MCP server, and test templates in a single call
  • Previewing generated file contents before committing them to the workspace
  • Integrating component scaffolding into the G6 recursive architect or CI pipeline
  • Inspecting capability metadata (capabilities, list_generation_backends, describe_write_policy, get_build_artifacts) before routing generated work as complete

Honesty envelope: MCP outputs include completion_state, warning_card, evidence, and request/run identifiers when supplied. Advisory wiring operations (wire_cross_pkg, wire_navigator) are surfaced as qualified-draft and do not claim native mutation.

Example:

from mvp.auto_engineer import AutoEngineerBlock, AutoEngineerInput

block = AutoEngineerBlock(name="auto_engineer")
result = block.infer(AutoEngineerInput(
    operation="scaffold_all",
    name="image_classifier",
    description="Classifies images using a pre-trained CNN",
    write_to_disk=False,
))
# result.ok → True; result.value → AutoEngineerOutput with files list, message

Works well with: meta_programming, self_debug, recursive_architect

Public API

AutoEngineerBlock(AIBlock[AutoEngineerInput, AutoEngineerOutput, None])

Tier 1 AutoEngineer — dispatches scaffold operations to ComponentCreatorBlock.

Field Type Default
name str 'auto_engineer'

Methods:

infer(inp: AutoEngineerInput) -> Result[AutoEngineerOutput]

Dispatch on inp.operation.

FlywheelOrchestrator

Orchestrates the data flywheel pipeline with HITL gates.

Field Type Default
db_path str ':memory:'

Methods:

store()

run(inp: FlywheelInput) -> Result[FlywheelOutput]

FlywheelCandidate(BaseModel)

Accumulator envelope flowing through the flywheel pipeline.

Field Type Default
candidate_id str ''
stage int 0
research_json dict[str, Any] {}
assessment_json dict[str, Any] \| None None
synthesis_json dict[str, Any] \| None None
integration_json dict[str, Any] \| None None

GateDecision(BaseModel)

HITL gate decision record.

Field Type Default
gate_id str ''
gate_number int 0
cycle_id str ''
status str 'pending'
payload_json dict[str, Any] {}
decision_json dict[str, Any] {}
decided_at str ''

FlywheelInput(BaseModel)

Field Type Default
op FlywheelOp required
cycle_id str ''
gate_id str ''
technique_name str ''
decision_json str ''

FlywheelOutput(BaseModel)

Field Type Default
cycle_id str ''
stage int 0
status str ''
gate GateDecision \| None None
message str ''
candidates list[dict[str, Any]] \| None None
report dict[str, Any] \| None None

AutoEngineerInput(BaseModel)

Input for the AutoEngineer block.

Field Type Default
operation Literal['scaffold_all', 'scaffold_component', 'scaffold_mcp', 'scaffold_tests', 'preview'] 'scaffold_all'
name str ''
description str ''
prefix str ''
operations list[str] Field(default_factory=list)
mcp_operations list[str] Field(default_factory=list)
input_fields list[dict] Field(default_factory=list)
output_fields list[dict] Field(default_factory=list)
workspace_root str ''
write_to_disk bool False
production_mode bool False
approval_artifact_id str ''

AutoEngineerOutput(BaseModel)

Output from the AutoEngineer block.

Field Type Default
operation str ''
files list[dict] Field(default_factory=list)
message str ''
errors list[str] Field(default_factory=list)
degraded bool False
degradation_reason str ''
completion_state Literal['verified', 'qualified-draft', 'blocked-escalated'] 'qualified-draft'
warning_card dict Field(default_factory=dict)
evidence dict Field(default_factory=dict)
request_id str ''
task_id str ''
run_id str ''

MCP Tools

Operation Source
spec_parse auto_engineer_mcp
spec_validate auto_engineer_mcp
spec_from_nl auto_engineer_mcp
design_component auto_engineer_mcp
design_review auto_engineer_mcp
gen_schema auto_engineer_mcp
gen_block auto_engineer_mcp
gen_mcp auto_engineer_mcp
gen_tests auto_engineer_mcp
gen_skill auto_engineer_mcp
wire_init auto_engineer_mcp
wire_deps auto_engineer_mcp
wire_registry auto_engineer_mcp
wire_cross_pkg auto_engineer_mcp
wire_navigator auto_engineer_mcp
validate_syntax auto_engineer_mcp
validate_imports auto_engineer_mcp
validate_conventions auto_engineer_mcp
validate_structure auto_engineer_mcp
validate_e2e auto_engineer_mcp
build_component auto_engineer_mcp
build_status auto_engineer_mcp
list_builds auto_engineer_mcp
rollback auto_engineer_mcp
info auto_engineer_mcp
capabilities auto_engineer_mcp
list_templates auto_engineer_mcp
describe_template auto_engineer_mcp
list_generation_backends auto_engineer_mcp
describe_write_policy auto_engineer_mcp
get_build_artifacts auto_engineer_mcp
list_patterns auto_engineer_mcp
native auto_engineer_mcp
advisory auto_engineer_mcp
read_only auto_engineer_mcp