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/humanize_chart.py
View on GitHub"""Plain-language labels for the audit JPEG. Deterministic. No model."""
from __future__ import annotations
from typing import Any
_STATE = {
"ready": "ready",
"frozen": "frozen",
"bound": "bound",
"rendered": "rendered",
"packaged": "packaged",
"aligned": "aligned",
"decided": "decided",
"captured": "captured",
"admitted": "admitted",
"verified": "verified",
"checked": "checked",
}
_COPULA_IS = {
"source",
"plan",
"release",
"card",
"prompt",
"package",
"record",
"file",
"image",
"harness",
"response",
"reply",
}
_ASSET = {
"file": "must choose a file",
"image": "must choose an image",
"video": "must choose a video",
"audio": "must choose audio",
"json": "must choose a JSON value",
"data": "must choose typed data",
}
def words(value: str) -> list[str]:
return [part for part in str(value or "").replace("-", "_").split("_") if part]
def title_id(value: str) -> str:
parts = words(value)
if not parts:
return "Milestone"
if parts[-1] in _STATE and len(parts) > 1:
head = " ".join(parts[:-1])
last = parts[-2]
copula = "is" if last in _COPULA_IS or not last.endswith("s") else "are"
if last.endswith("ss"):
copula = "is"
return f"{head} {copula} {_STATE[parts[-1]]}".capitalize()
return " ".join(parts).capitalize()
def asset_line(kind: str) -> str:
return _ASSET.get(str(kind or "").lower(), "must produce the declared asset")
def _kind(node: dict[str, Any]) -> str:
outputs = node.get("outputs") if isinstance(node.get("outputs"), list) else []
if outputs and isinstance(outputs[0], dict):
return str(outputs[0].get("kind") or "")
return str(
node.get("asset_kind")
or ((node.get("asset") or {}).get("kind") if isinstance(node.get("asset"), dict) else "")
or ""
)
def success_line(node: dict[str, Any]) -> str:
"""Expectation summary for review artifacts. Explicit YAML wins."""
explicit = str(node.get("success") or "").strip()
if explicit:
return explicit
mid = str(node.get("id") or "")
kind = _kind(node)
loop = str(node.get("loop") or "none")
extra = ""
if loop == "judge":
extra += " Retry until the semantic judge returns PASS."
cycle = node.get("cycle") if isinstance(node.get("cycle"), dict) else None
if cycle:
declared = str(cycle.get("pass") or "").strip()
extra += " " + (declared or "Then cycle: pass preserves the round; fail purges residue.")
branch = node.get("branch") if isinstance(node.get("branch"), dict) else None
if branch:
paths = []
for item in branch.get("paths") or []:
if isinstance(item, dict) and item.get("id"):
paths.append(str(item["id"]))
elif item:
paths.append(str(item))
extra += f" Then branch ({' / '.join(paths)})."
return f"{title_id(mid)} — {asset_line(kind)} as the chosen output bundle.{extra}".strip()
def humanize_milestone(node: dict[str, Any]) -> dict[str, str]:
mid = str(node.get("id") or "")
kind = _kind(node)
loop = str(node.get("loop") or "none")
extra = ""
ledger = node.get("ledger") if isinstance(node.get("ledger"), dict) else None
if loop == "for" and ledger:
extra = f" Walks ledger `{ledger.get('path')}` until remaining is 0."
elif loop == "judge":
extra = " Retry until the semantic judge returns PASS."
cycle = node.get("cycle") if isinstance(node.get("cycle"), dict) else None
if cycle:
extra = (extra + " Then cycle: pass preserves the round and updates the ledger; fail purges residue.").strip()
branch = node.get("branch") if isinstance(node.get("branch"), dict) else None
if branch:
paths = []
for item in branch.get("paths") or []:
if isinstance(item, dict) and item.get("id"):
paths.append(str(item["id"]))
elif item:
paths.append(str(item))
extra = (extra + f" Then branch ({' / '.join(paths)}).").strip()
status = str(node.get("status") or "").upper()
success = success_line(node)
caption = f"{title_id(mid)} — {asset_line(kind)}.{extra}".strip()
if status:
caption = f"{caption} [{status}]"
return {
"id": mid,
"title": title_id(mid),
"asset": asset_line(kind),
"success": success,
"caption": caption,
"kind": kind or "required",
"status": status,
"loop": loop,
}
def humanize_flowstep(step: dict[str, Any], index: int) -> dict[str, str]:
fid = str(step.get("id") or step.get("tool") or f"step_{index}")
tool = str(step.get("tool") or "")
title = title_id(fid)
if tool:
body = f"{title}, using tool `{tool}`"
else:
body = f"{title} (no preferred tool; recover like a normal agent)"
return {"id": fid, "title": title, "tool": tool, "caption": body}
def focus_milestone(
nodes: list[dict[str, Any]],
focus_id: str | None = None,
) -> dict[str, Any] | None:
if focus_id:
for item in nodes:
if str(item.get("id") or "") == focus_id:
return item
with_steps = [item for item in nodes if item.get("flowsteps")]
if not with_steps:
return nodes[0] if nodes else None
def _rank(item: dict[str, Any]) -> tuple[int, int]:
loop_bonus = 1 if str(item.get("loop") or "") == "judge" else 0
return (len(item.get("flowsteps") or []), loop_bonus)
ranked = sorted(with_steps, key=_rank, reverse=True)
return ranked[0]
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 |