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/m8m_local_bundle.py
View on GitHub"""Export reusable builder definitions or collect semantic installation context."""
import argparse
from io import BytesIO
import json
from pathlib import Path
import sys
import zipfile
sys.path.insert(0, str(Path(__file__).resolve().parent))
from m8m_delivery_common import collect, encoded, immutable, relative, sha256
FORBIDDEN = {"room_id", "thread_id", "wait_id", "task_state", "task_output", "ledger", "progress", "source_message_id"}
def reusable(value):
if isinstance(value, dict):
if FORBIDDEN & set(value):
raise ValueError("Reusable definitions must not contain live Task/session state.")
for child in value.values():
reusable(child)
elif isinstance(value, list):
for child in value:
reusable(child)
def main(argv=None):
if hasattr(sys.stdout, "reconfigure"):
sys.stdout.reconfigure(encoding="utf-8")
parser = argparse.ArgumentParser(description=__doc__)
commands = parser.add_subparsers(dest="command", required=True)
task = commands.add_parser("task")
for key in ("key", "title"):
task.add_argument("--" + key, required=True)
for key in ("goal", "master-prompt", "output-schema", "output"):
task.add_argument("--" + key, type=Path, required=True)
for key in ("workflow-references", "resource-requirements", "runtime-configuration"):
task.add_argument("--" + key, type=Path)
schedule = commands.add_parser("schedule")
schedule.add_argument("--key", required=True)
schedule.add_argument("--definition", type=Path, required=True)
schedule.add_argument("--output", type=Path, required=True)
bundle = commands.add_parser("bundle")
bundle.add_argument("--source", type=Path, action="append", required=True)
bundle.add_argument("--output", type=Path, required=True)
args = parser.parse_args(argv)
if args.command == "task":
schema = json.loads(args.output_schema.read_bytes())
if not isinstance(schema, (dict, bool)):
raise ValueError("The output schema must be a JSON Schema object or boolean.")
# The server validates the complete schema during semantic preparation;
# exporting context requires only the standard Python library.
value = {"schema": "m8m.task_template.v1", "template_key": args.key, "title": args.title,
"definition": {"goal": args.goal.read_bytes().decode("utf-8"),
"master_prompt": args.master_prompt.read_bytes().decode("utf-8"), "output_schema": schema,
"workflows": json.loads(args.workflow_references.read_bytes()) if args.workflow_references else {}},
"resource_requirements": json.loads(args.resource_requirements.read_bytes()) if args.resource_requirements else []}
if args.runtime_configuration:
value["runtime_configuration"]=json.loads(args.runtime_configuration.read_bytes())
reusable(value)
payload = encoded(value)
elif args.command == "schedule":
value = {"schema": "m8m.schedule_template.v1", "template_key": args.key, "definition": json.loads(args.definition.read_bytes())}
reusable(value)
if value["definition"].get("target", {}).get("kind") == "resume_session":
raise ValueError("Create a reminder from its real server Task wait; export only reusable follow-up policy.")
payload = encoded(value)
else:
members = {}
for root in args.source:
for path, data in collect(root).items():
name = relative(root.name + "/" + path if root.is_dir() else path)
if name in members:
raise ValueError("Bundle sources have conflicting relative names.")
members[name] = data
from m8m_delivery_common import MAX_BYTES, MAX_FILES
if len(members) > MAX_FILES or sum(map(len, members.values())) > MAX_BYTES:
raise ValueError("Combined bundle exceeds the server transport bound.")
memory = BytesIO()
with zipfile.ZipFile(memory, "w", compression=zipfile.ZIP_DEFLATED) as archive:
for name, data in sorted(members.items()):
info = zipfile.ZipInfo(name, date_time=(1980, 1, 1, 0, 0, 0))
info.compress_type = zipfile.ZIP_DEFLATED
archive.writestr(info, data)
payload = memory.getvalue()
immutable(args.output.absolute(), payload)
print(encoded({"path": str(args.output.absolute()), "digest": sha256(payload), "bytes": len(payload)}).decode())
return 0
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 |