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/tool_vs_intelligence.py
View on GitHub"""Tool-vs-intelligence table: schema, sample rows, and markdown."""
from __future__ import annotations
from typing import Any
from flowstep_runtime import local_tool_package_name
TABLE_SCHEMA = "tool_vs_intelligence_table_v1"
TOOL_TEST = "same input → same action; fixture-testable; receipt not opinion; junior can implement from schema"
INTEL_TEST = "fails at least one of the four tests; no fixture without a model"
EXAMPLE_ROWS: list[dict[str, str]] = [
{
"id": "fetch_record",
"class": "tool",
"test": "same id → same record",
"why": "structured read; MCP/DB/HTTP GET",
"destination": "flowsteps/tools/fetch_record/",
},
{
"id": "crop_4x5",
"class": "tool",
"test": "fixture PNG in, transformed PNG out",
"why": "pixel math; not a milestone",
"destination": "flowsteps/tools/crop_4x5/",
},
{
"id": "hash_bind",
"class": "tool",
"test": "same bytes → same sha256",
"why": "optional checksum for an explicit request or external API contract",
"destination": "flowsteps/tools/hash_bind/",
},
{
"id": "schema_validate",
"class": "tool",
"test": "pass/fail from rules",
"why": "JSON Schema gate",
"destination": "flowsteps/tools/schema_validate/",
},
{
"id": "render_html_shell",
"class": "tool",
"test": "fixture HTML → screenshot file",
"why": "fixed viewport generator",
"destination": "flowsteps/tools/render_html_shell/",
},
{
"id": "materialize_package",
"class": "tool",
"test": "typed inputs → zip/manifest",
"why": "assembly of already-valid receipts",
"destination": "flowsteps/tools/materialize_package/",
},
{
"id": "plan_frozen",
"class": "intelligence",
"test": "no fixture without a model",
"why": "editorial plan is not a typed transform",
"milestone": "plan_frozen",
},
{
"id": "choose_lesson",
"class": "intelligence",
"test": "no fixture without a model",
"why": "judgment among plausible alternatives",
"milestone": "plan_frozen",
},
{
"id": "image_generate",
"class": "intelligence",
"test": "model produces bytes",
"why": "invention; runtime admits the declared image output",
"milestone": "assets_bound",
},
{
"id": "release_judge",
"class": "intelligence",
"test": "not a pixel measurement",
"why": "taste / teaching quality; footer geometry stays a tool",
"milestone": "release_packaged",
},
]
def make_table(rows: list[dict[str, Any]], *, flow_id: str | None = None) -> dict[str, Any]:
cleaned: list[dict[str, Any]] = []
seen: set[str] = set()
for row in rows:
item_id = str(row.get("id") or "").strip()
klass = row.get("class")
if not item_id or klass not in {"tool", "intelligence"} or item_id in seen:
continue
seen.add(item_id)
entry: dict[str, Any] = {
"id": item_id,
"class": klass,
"test": str(row.get("test") or (TOOL_TEST if klass == "tool" else INTEL_TEST)),
"why": str(row.get("why") or ("premade toolbox function" if klass == "tool" else "judgment the schema cannot compute")),
}
if row.get("milestone"):
entry["milestone"] = str(row["milestone"])
if row.get("destination"):
entry["destination"] = str(row["destination"])
elif klass == "tool":
entry["destination"] = f"flowsteps/tools/{item_id}/"
cleaned.append(entry)
table: dict[str, Any] = {"schema": TABLE_SCHEMA, "rows": cleaned}
if flow_id:
table["flow_id"] = flow_id
return table
def example_table() -> dict[str, Any]:
return make_table(EXAMPLE_ROWS, flow_id="m8m_examples")
def doctrine_table() -> dict[str, Any]:
return example_table()
def from_audit(audit: dict[str, Any]) -> dict[str, Any]:
rows: list[dict[str, Any]] = []
for item in audit.get("proposed_milestones") or []:
mid = str(item.get("id") or "")
intel = item.get("intelligence") or "none"
if intel not in {None, "none"}:
rows.append(
{
"id": mid,
"class": "intelligence",
"test": INTEL_TEST,
"why": item.get("model_justification") or f"{intel} on milestone {mid}",
"milestone": mid,
}
)
bindings = (
(item.get("execution") or {}).get("tool_bindings") or []
if isinstance(item.get("execution"), dict)
else []
)
packages = (
[
local_tool_package_name(
str(binding.get("ref") or ""),
label=(
f"{mid}.execution.tool_bindings"
f"[{binding.get('tool')}].ref"
),
)
for binding in bindings
if isinstance(binding, dict) and binding.get("ref")
]
if bindings
else [str(tool_id) for tool_id in item.get("tools") or [] if tool_id]
)
for tool_id in packages:
rows.append(
{
"id": str(tool_id),
"class": "tool",
"test": TOOL_TEST,
"why": "listed toolbox function for this milestone",
"milestone": mid,
"destination": f"flowsteps/tools/{tool_id}/",
}
)
for item in audit.get("python_standardization") or []:
tool_id = str(item.get("tool_id") or "")
if tool_id:
rows.append(
{
"id": tool_id,
"class": "tool",
"test": TOOL_TEST,
"why": item.get("reason") or "promote to project toolbox",
"destination": item.get("destination") or f"flowsteps/tools/{tool_id}/",
}
)
flow_id = (audit.get("grade") or {}).get("flow_id") or (audit.get("audited_skill") or {}).get("name")
table = make_table(rows, flow_id=str(flow_id) if flow_id else None)
if not table["rows"]:
table = make_table(
[
{
"id": "schema_validate",
"class": "tool",
"test": TOOL_TEST,
"why": "structural validation of declared outputs",
"destination": "flowsteps/tools/schema_validate/",
}
],
flow_id=str(flow_id) if flow_id else None,
)
return table
def from_flow(flow: dict[str, Any]) -> dict[str, Any]:
rows: list[dict[str, Any]] = []
for step in flow.get("steps") or []:
mid = str(step.get("id") or "")
intel = step.get("intelligence") or step.get("model") or "none"
if intel not in {None, "none"}:
rows.append(
{
"id": mid,
"class": "intelligence",
"test": INTEL_TEST,
"why": step.get("model_justification") or f"{intel} on milestone {mid}",
"milestone": mid,
}
)
bindings = (
(step.get("execution") or {}).get("tool_bindings") or []
if isinstance(step.get("execution"), dict)
else []
)
packages = (
[
local_tool_package_name(
str(binding.get("ref") or ""),
label=(
f"{mid}.execution.tool_bindings"
f"[{binding.get('tool')}].ref"
),
)
for binding in bindings
if isinstance(binding, dict) and binding.get("ref")
]
if bindings
else [str(item) for item in step.get("tools") or [] if item]
)
for tool_id in packages:
rows.append(
{
"id": str(tool_id),
"class": "tool",
"test": TOOL_TEST,
"why": "listed toolbox function for this milestone",
"milestone": mid,
"destination": f"flowsteps/tools/{tool_id}/",
}
)
if not packages and (intel in {None, "none"}):
klass = "tool" if step.get("class") != "intelligence" else "intelligence"
rows.append(
{
"id": mid,
"class": klass,
"test": TOOL_TEST if klass == "tool" else INTEL_TEST,
"why": step.get("handler") or mid,
"milestone": mid,
}
)
return make_table(rows, flow_id=str(flow.get("flow_id") or "") or None)
def render_markdown(table: dict[str, Any]) -> str:
lines = [
"| id | class | test | why |",
"| --- | --- | --- | --- |",
]
for row in table.get("rows") or []:
lines.append(
f"| `{row['id']}` | `{row['class']}` | {row['test']} | {row['why']} |"
)
if len(lines) == 2:
lines.append("| (none) | | | |")
return "\n".join(lines)
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 |