dse120071750/m8m-harness-builder / skills/m8m/m8m-harness-builder
m8m-harness-builder
FlaggedBuild and edit M8M harnesses that coordinate existing tools and FlowSteps, validate milestone outputs, and track progress and resume. Reuse working implementations in place. Compile workflow changes without runtime packaging; build portable packages when requested and deliver server installations through the dedicated M8M server installer.
scripts/run_m8m.py
View on GitHub"""Coordinate local workflows by default; package a runtime only when requested."""
from __future__ import annotations
import argparse
import json
import sys
from pathlib import Path
from flowstep_runtime import FlowError
from m8m_factory import BUILDER_FLOW, BUILDER_FLOW_ID, run_factory
def _assert_builder3_run(run_dir: Path | None) -> None:
if run_dir is None:
return
record_path = run_dir.resolve() / "flow-execution-record.json"
if not record_path.is_file():
return
try:
record = json.loads(record_path.read_text(encoding="utf-8"))
except (OSError, UnicodeError, json.JSONDecodeError) as exc:
raise FlowError(f"cannot read existing builder execution record: {exc}") from exc
flow_id = str(record.get("flow_id") or "")
if flow_id != BUILDER_FLOW_ID:
raise FlowError(
"Builder 3 cannot resume or execute a Builder 2 run; start a fresh "
"m8m_build_v2 session and import the old staged source as untrusted input"
)
def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--mode", choices=["coordinate", "package"], default="coordinate",
help="Compile and validate existing workflow source, or explicitly package and install it.")
parser.add_argument("--target", type=Path, required=True, help="Existing harness for coordination; source skill for package mode.")
parser.add_argument("--codebase", type=Path, required=True, help="Repository owning the workflow and existing tool bindings.")
parser.add_argument(
"--harness-root",
type=Path,
help="Mutable execution root (default: M8M_HARNESS_ROOT or %%SystemDrive%%\\NisanRuntime)",
)
parser.add_argument("--flow-id")
parser.add_argument("--skill-name")
parser.add_argument("--force", action="store_true")
parser.add_argument("--run-dir", type=Path, help="Resume one exact builder session")
parser.add_argument("--replace-milestone", help="Replace one chosen builder milestone and its dependents")
parser.add_argument(
"--continue-after-edit",
help="Adopt builder workflow edits and continue from this milestone using the same run-local assets",
)
return parser
def main(argv: list[str] | None = None) -> int:
args = build_parser().parse_args(argv)
try:
if args.mode == "coordinate":
if args.force or args.skill_name:
raise FlowError("--force and --skill-name are package options; coordinate updates the existing workflow")
if args.run_dir or args.replace_milestone or args.continue_after_edit:
raise FlowError("builder session options require --mode package; resume product progress with its runner")
from coordinate_workflow import prepare_workflow
result = prepare_workflow(args.target, args.codebase, flow_id=args.flow_id)
print(json.dumps(result, indent=2, ensure_ascii=False))
return 0
_assert_builder3_run(args.run_dir)
result = run_factory(
args.target,
args.codebase,
flow_id=args.flow_id,
skill_name=args.skill_name,
overwrite=args.force,
run_dir=args.run_dir,
replace_milestone=args.replace_milestone,
continue_after_edit=args.continue_after_edit,
harness_root=args.harness_root,
)
except FlowError as exc:
print(json.dumps({"status": "BLOCKED", "blockers": [str(exc)]}, indent=2), file=sys.stderr)
return 2
print(json.dumps(result, indent=2, ensure_ascii=False))
if result["status"] == "PASS":
return 0
return 3 if result["status"] == "FINDINGS" else 2
if __name__ == "__main__":
raise SystemExit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies. | Stars: 108k | Updated | Claude CodeCodex | Verified | Install |
| meeting-notesnexu-io/open-designMeeting notes page — title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "会议纪要". | Stars: 108k | Updated | Claude CodeCodex | Verified | Install |