Project: SOP-to-Excel Agent

Capstone project one: an agent that reads a Standard Operating Procedure and safely updates Excel workbooks — every discipline from Stages 6–8 in one build.

▶ Watch this reel

What you'll learn

  1. Parse the SOP
  2. Plan the changes
  3. Execute via Excel MCP
  4. Verify, approve, roll back

Remember this

Parse

Plan

Execute

Verify & govern

Build order: MCP server → extraction recall → plan renderer (owner-approved) → execution → verification drill.

Code: The pipeline, end to end

async def sop_to_excel(sop_text: str, approver: User):
    # 1 · PARSE → structured rules (with quotes, validated targets)
    rules = await parse_sop(sop_text)

    # 2 · PLAN → per-file diffs + formula impact + conflicts
    plan = await build_plan(rules)
    report = render_review(plan)                    # human language
    token = await human_approve(report, approver)   # AG-17 gate

    # 3 · EXECUTE via Excel MCP (AG-09 tools only)
    for fchange in plan.files:                      # durable, checkpointed
        backup = excel.preview_write(...)           # backup + dry-run
        excel.write_cells(..., confirm_token=token)
        assert read_back(fchange) == fchange.planned   # verify
        audit.log(file=fchange.name, backup=backup)

    # 4 · VERIFY + package
    discrepancies = sample_verify(plan)
    return evidence_package(rules, plan, audit, discrepancies)