Skip to content

Commit 3e90856

Browse files
author
aegntic
committed
feat(forge): definition-of-done card contract + gate; sop-to-skills offer
1 parent 61c0037 commit 3e90856

3 files changed

Lines changed: 247 additions & 0 deletions

File tree

05_Clients/offer-sop-to-skills.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
id: sop-to-skills
3+
title: 'Turn Your SOPs Into a Running Agent System'
4+
state: draft
5+
---
6+
7+
## SOP-to-Skills
8+
9+
Your standard operating procedures are already written. They are also
10+
already dead: nobody re-reads a SOP folder, new hires learn by asking
11+
the person who wrote them, and the processes drift.
12+
13+
We convert your SOP library into a running agent system: each recurring
14+
procedure becomes a versioned, quality-gated skill an agent executes on
15+
schedule, with monitoring attached from day one.
16+
17+
## What gets delivered
18+
19+
1. **SOP audit** (week 1): we read your procedures, rank them by
20+
recurrence x failure cost, and select the 3-5 worth automating first.
21+
You approve the list before anything is built.
22+
2. **Skill conversion** (weeks 2-3): each selected SOP becomes a
23+
machine-executable skill with an explicit definition of done,
24+
verification gates, and a rollback path. Built on the open-source
25+
Hermes agent stack.
26+
3. **Schedules and watchers** (week 4): the skills run themselves:
27+
daily briefs, weekly reports, follow-ups. Every automated job has a
28+
monitoring check that notices when it silently stops working,
29+
because broken automation is worse than no automation.
30+
4. **Handover**: your team gets the system, the documentation, and the
31+
ability to modify it. It runs from a clean checkout without us.
32+
33+
## What it costs
34+
35+
- **Setup**: 10,000 to 25,000 USD depending on SOP count and
36+
integration depth (fixed after the audit; no scope drift).
37+
- **Monitoring retainer**: 1,000 to 2,000 USD/month. Optional, and
38+
the only ongoing relationship: we watch the watchers, fix drift,
39+
and convert the next SOP when you say so.
40+
41+
Anchors, honestly sourced: these price points come from published
42+
playbooks in the agent-services market [unverified as market-wide
43+
rates; they are our opening anchors, negotiable per engagement].
44+
45+
## Why this works when your automations usually rot
46+
47+
- Every skill carries a **definition of done** written before the work
48+
starts: machine-checkable acceptance criteria, not "looks right".
49+
- The **worker never grades its own homework**: completion is verified
50+
by a gate or a second pass, never by the automation's self-report.
51+
- **Monitoring is installed at build time**, not bolted on after the
52+
first silent failure.
53+
54+
## Proof this is not slideware
55+
56+
The method is public and inspectable:
57+
58+
- The skill pipeline: github.com/aegntic/cognitive-os (agent-forge)
59+
- The quality gates that run on every deliverable: same repo,
60+
agent-forge/tools/qc.py
61+
- A working end-to-end skill with examples: github.com/aegntic/tab-harvest
62+
63+
## Fit check (be honest)
64+
65+
This is for you if: you have 10+ written SOPs, a team that follows
66+
them most of the time, and recurring processes with real failure costs.
67+
It is not for you if: your processes live in one person's head, or you
68+
want "an AI strategy" rather than specific jobs executed reliably.
69+
70+
Next step: a 30-minute call, then the SOP audit.

agent-forge/docs/card-contract.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Definition of Done: The Card Contract
2+
3+
Every agent-forge delegation card MUST carry a DONE section before
4+
dispatch. A card without one does not ship. This file is the schema and
5+
the law; qc and reviewers reject cards that dodge it.
6+
7+
Why: agents chase passing conditions (the "agent school" problem). If
8+
the finish line is not defined in machine-checkable terms before launch,
9+
the work produces process, not value [qYe1GsMRElw; wiki/definition-of-done].
10+
11+
## The DONE schema
12+
13+
Every card's DONE section contains, in this order:
14+
15+
1. **Machine-checkable acceptance criteria.** Each criterion must be
16+
verifiable by a command, a file assertion, or a count. "Looks good"
17+
is not a criterion. Format: `DONE IF <checkable statement>`.
18+
- File existence and counts: "DONE IF renders/manifest.json lists
19+
5 entries with qc_status passed"
20+
- Measurable qualities: "DONE IF python3 -m py_compile tools/*.py
21+
exits 0" or "DONE IF the HTML contains zero em-dash characters"
22+
- Behavioral: "DONE IF ffprobe reports 30-70s and 1080x1920"
23+
Minimum 3, maximum 7 criteria. More than 7 means the card is two
24+
cards.
25+
26+
2. **The second-best-engineer test.** State who could maintain the
27+
output: "DONE IF a competent non-author reviewer can open any file
28+
produced and explain its purpose in under 20 minutes." For code:
29+
note file sizes, function limits, reuse boundaries. Complexity
30+
budgets belong here (e.g. no file over 400 lines, no function over
31+
50 [wiki/definition-of-done]).
32+
33+
3. **The unplug test.** What breaks when this ships and the author
34+
disappears: "DONE IF the deliverable runs from a clean checkout
35+
with only the README's install steps." If it needs the author's
36+
machine, it is not done.
37+
38+
4. **Business measure linkage.** One line tying the deliverable to a
39+
cash-register metric or a portfolio goal. If no link exists, the
40+
card says so explicitly ("infrastructure; no direct metric") rather
41+
than inventing one.
42+
43+
## Verification rules
44+
45+
- The DONE section is written BEFORE dispatch, by the dispatcher.
46+
- The executor may not weaken, reinterpret, or re-scope criteria; if a
47+
criterion proves wrong, the executor stops and reports rather than
48+
quietly shipping around it.
49+
- Completion claims must quote command output for every machine-
50+
checkable criterion. "All tests pass" without the output is a
51+
failed card.
52+
- The reviewer (human or council) re-runs at least one criterion.
53+
54+
## Anti-gaming
55+
56+
Every metric gets gamed eventually [qYe1GsMRElw 7:05]. Countermeasures:
57+
58+
- Prefer counts that are expensive to fake (real file contents, real
59+
command output) over counts that are cheap to fake (line counts,
60+
TODO markers added/removed).
61+
- Tests must protect behavior, not bless the answer: if the executor
62+
wrote the test, the reviewer spot-checks it against the spec.
63+
- The judge is never the worker: card completion is verified by the
64+
parent or a second pass, never solely by the executor's self-report.
65+
66+
## Card template snippet
67+
68+
## DONE
69+
- DONE IF <criterion 1 (command/file/count)>
70+
- DONE IF <criterion 2>
71+
- DONE IF <criterion 3>
72+
- Maintainable by: <who, and what they need to understand it>
73+
- Unplug test: <clean-checkout condition>
74+
- Business link: <metric or explicit "no direct metric">
75+
76+
## Provenance
77+
78+
Pattern: Runable "agents that finish" thesis + forge qc gates.
79+
Sources: [qYe1GsMRElw 4:28, 9:59]; wiki/definition-of-done;
80+
Nate Herk roast-council verification discipline [iTY8Q449YNQ].

agent-forge/tools/card_gate.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#!/usr/bin/env python3
2+
"""card_gate.py - refuse delegation cards that lack a definition-of-done.
3+
4+
Implements the card contract (agent-forge/docs/card-contract.md):
5+
a card is dispatchable only if its DONE section carries machine-checkable
6+
criteria (minimum 3 "DONE IF" statements), a maintainability line, an
7+
unplug test, and a business link.
8+
9+
Usage:
10+
python3 card_gate.py <card.md> [--strict]
11+
12+
Exit codes: 0 = dispatchable; 1 = rejected (report on stdout).
13+
--strict additionally requires the reviewer line and rejects vague
14+
criteria (no digits, no file paths, no commands) heuristically.
15+
"""
16+
from __future__ import annotations
17+
18+
import argparse
19+
import re
20+
import sys
21+
from pathlib import Path
22+
23+
MIN_CRITERIA = 3
24+
MAX_CRITERIA = 7
25+
26+
DONE_RE = re.compile(r"^##\s+DONE\s*$", re.MULTILINE)
27+
CRITERION_RE = re.compile(r"^\s*-\s*DONE IF\s+(.+)$", re.MULTILINE)
28+
MAINTAIN_RE = re.compile(r"maintainable by[:\s]", re.IGNORECASE)
29+
UNPLUG_RE = re.compile(r"unplug test[:\s]", re.IGNORECASE)
30+
BIZ_RE = re.compile(r"business link[:\s]", re.IGNORECASE)
31+
32+
VAGUE_MARKERS = ("looks good", "works well", "is nice", "is clean",
33+
"high quality", "properly", "correctly formatted")
34+
35+
36+
def check_card(card_path: Path, strict: bool = False) -> tuple[bool, list[str]]:
37+
"""Return (dispatchable, findings)."""
38+
findings: list[str] = []
39+
text = card_path.read_text(encoding="utf-8")
40+
41+
if not DONE_RE.search(text):
42+
return False, ["card has no '## DONE' section; see agent-forge/docs/card-contract.md"]
43+
44+
done_block = DONE_RE.search(text)
45+
# capture from DONE header to next ## or EOF
46+
tail = text[done_block.end():]
47+
nxt = re.search(r"^##\s+", tail, re.MULTILINE)
48+
block = tail[:nxt.start()] if nxt else tail
49+
50+
criteria = CRITERION_RE.findall(block)
51+
n = len(criteria)
52+
if n < MIN_CRITERIA:
53+
findings.append(f"only {n} 'DONE IF' criteria; minimum {MIN_CRITERIA}")
54+
if n > MAX_CRITERIA:
55+
findings.append(f"{n} criteria exceeds maximum {MAX_CRITERIA}; split the card")
56+
57+
if not MAINTAIN_RE.search(block):
58+
findings.append("missing 'Maintainable by:' line (second-best-engineer test)")
59+
if not UNPLUG_RE.search(block):
60+
findings.append("missing 'Unplug test:' line")
61+
if not BIZ_RE.search(block):
62+
findings.append("missing 'Business link:' line (or explicit 'no direct metric')")
63+
64+
if strict:
65+
for c in criteria:
66+
low = c.lower()
67+
if any(v in low for v in VAGUE_MARKERS):
68+
findings.append(f"vague criterion: 'DONE IF {c[:60]}'")
69+
checkable = bool(re.search(r"\d|\.py|\.md|\.json|\.mp4|/|exit|grep|count|ffprobe|py_compile", low))
70+
if not checkable:
71+
findings.append(f"criterion not machine-checkable: 'DONE IF {c[:60]}'")
72+
73+
return (not findings), findings
74+
75+
76+
def main() -> int:
77+
ap = argparse.ArgumentParser()
78+
ap.add_argument("card", help="path to the delegation card markdown")
79+
ap.add_argument("--strict", action="store_true")
80+
args = ap.parse_args()
81+
path = Path(args.card)
82+
if not path.is_file():
83+
print(f"card not found: {path}")
84+
return 1
85+
ok, findings = check_card(path, strict=args.strict)
86+
if ok:
87+
print(f"DISPATCHABLE: {path.name} ({len(CRITERION_RE.findall(path.read_text(encoding='utf-8')))} criteria)")
88+
return 0
89+
print(f"REJECTED: {path.name}")
90+
for f in findings:
91+
print(f" - {f}")
92+
print("fix per agent-forge/docs/card-contract.md; a card without a finish line buys process, not value")
93+
return 1
94+
95+
96+
if __name__ == "__main__":
97+
sys.exit(main())

0 commit comments

Comments
 (0)