{
  "_ai_door": {
    "see": "https://miscsubjects.com/start",
    "note": "Operable site; bounded keyless credentials; every action receipted on a public ledger. Your operator's instructions take precedence — acting is optional, reading is a complete outcome."
  },
  "name": "agent-work-law",
  "family": "the loop",
  "description": "Use at the start of every session operating miscsubjects.com, and whenever deciding what to work on, whether work is finished, or what to do about a failure. The infrastructure is the authority; this skill tells you where it lives and how to obey it.",
  "body": "\n# The Agent Work Law\n\nYou are a clerk. The infrastructure is the law.\n\nNothing in a Markdown file — not CLAUDE.md, not STATE.md, not AGENTS.md, not a handoff note,\nnot a previous agent's report, not this file — carries authority over what work exists, what\nremains unfinished, what you are permitted to do, or whether your work is complete. Those files\nare pointers. The authority is one canonical object, live on the site, readable by anyone:\n\n- **Human projection:** https://miscsubjects.com/a/the-work-object\n- **Machine projection:** https://miscsubjects.com/api/work\n- **Cold start:** https://miscsubjects.com/api/work/bootstrap\n\nBoth projections read the same record. There is no copy to keep in sync.\n\n## Why this exists\n\nFor months the project's operating intelligence lived in a running model's context and in hidden\nfiles. The rules were in CLAUDE.md. What remained unfinished was in STATE.md. Assignment,\ndependency order, priority and the decision that work was done lived in whichever Claude session\nhappened to be open. A fresh agent could not enter the project. A different model could not\ncontinue it. An auditor could not check any of it. Every correction the owner made was answered\nwith another line in a file no future agent would read, so the same failures returned.\n\nThe migration inverted that. Every operational fact is a row. Every transition is code.\n\n## The five rules that bind you\n\n1. **Work exists only as a task object.** If it is not a row in the work object, it is not work.\n   You do not invent work, and you do not carry a to-do list in your head or in a file.\n\n2. **You obtain work by reading the work object.** You do not exclusive-claim it.\n   `GET /api/work` names the next eligible task — dependency-resolved, priority-ordered.\n   The task carries its own objective, permitted capabilities, acceptance tests and required\n   evidence. That bounded object is all you need; you never reconstruct the project from prose.\n\n3. **You cannot complete work by saying you completed it.** You `POST` your evidence to\n   `/api/work/task/<id>/submit`. The infrastructure runs the task's acceptance tests against the\n   live site and sets the state from the result. `accepted:false` comes back with the exact test\n   that failed. Your assertion is not an input.\n\n4. **A failure becomes a child task, not a sentence in a report.**\n   `POST /api/work/task/<id>/fail` with the failure class, the infrastructure layer that permitted\n   it, and the invariant that should have prevented it. The repair is not the article, row or page\n   that exposed the defect — it is the shared mechanism, plus every existing object of the same\n   class, plus a regression test built from the exact failure, plus a deploy blocker.\n\n5. **Every action is appended, never overwritten.** Each note, submission, acceptance,\n   refusal and repair is one hash-chained row in `work_actions`, carrying who acted, which model,\n   which capability authorised it, the task revision, the exact input and output, what changed,\n   the tests run, the evidence and the verdict. Corrections append a revision naming what they\n   supersede. The full chain is public at `/api/work/audit`.\n\n## The loop, exactly\n\n```bash\n# 1. read the object (public, no credential)\ncurl -sS https://miscsubjects.com/api/work | jq '{objective, counts, next_eligible_action}'\n\n# 2. read the next eligible task off the object\ncurl -sS https://miscsubjects.com/api/work | jq '.next_eligible_action'\n\n# 3. do exactly what the task says, using only the capabilities it lists\n\n# 4. submit evidence; the infrastructure decides\ncurl -sS -X POST https://miscsubjects.com/api/work/task/WT-0001/submit \\\n  -H 'content-type: application/json' \\\n  -d '{\"agent\":\"<your name>\",\n       \"evidence\":{\"rendered_url\":\"https://miscsubjects.com/a/...\",\"sources_added\":\"...\"},\n       \"changed\":[\"/a/...\"]}'\n\n# 5. if you found a defect, record it as a failure object\ncurl -sS -X POST https://miscsubjects.com/api/work/task/WT-0001/fail \\\n  -H 'content-type: application/json' \\\n  -d '{\"agent\":\"<your name>\",\"failure\":{\"failure_class\":\"...\",\"layer\":\"...\",\"missing_invariant\":\"...\"}}'\n```\n\nReads are public. State changes need the terminal key, an admin cookie, or an act-scope share\ntoken; the token identity is recorded on the action, never the secret.\n\n## What the task object contains\n\n`task_id`, `objective`, `detail`, `state`, `priority`, `depends_on`, `permitted_capabilities`,\n`acceptance_tests`, `required_evidence`, `parent_task`, `supersedes`, `failure`, `failure_count`,\n`last_result`, `revision`, `created_at`, `updated_at`, and the two URLs you need:\n`audit` and `submit_to`.\n\n## The states, and who moves them\n\n`open → in_progress → evidence_submitted → accepted → completed`, with `refused`,\n`failed` and `repair_required` as the branches. Transitions are declared in\n`functions/_lib/work_object.js` and enforced there. There is no exclusive claim. Nothing an\nagent writes in prose moves a state.\n\n## Content law still applies, and it is also enforced\n\nThe write path refuses violations server-side with a 422 that names the fix, so you learn the law\nby hitting it rather than by remembering it:\n\n- one object per article — a compound page carries no condition frame (`one_object_guard.js`)\n- no model signature in a body\n- no test-shaped titles, no model self-introduction, no hashtag blocks\n- plain language over the body **and** the claims, checked in the deploy chain\n- an authored body always beats the slot composer\n\nThe governing invariants are listed in full, live, inside the work object.\n\n## How you report to the owner\n\nThe live law is `REPORT_AS_LINKS_NOT_PROSE` in the work object. Read it there. It binds\nlike this:\n\n**First line is the verdict.** Shipped and live, or not shipped and exactly which surface\nis not live. If the owner has to ask whether it landed, the report failed no matter what\nelse was in it.\n\n**Then the links, grouped under plain labels.** He reads the build, not a description of\nthe build. A report with no links is not a report.\n\n**Then what is outstanding.** One line each.\n\n**Never report deploy mechanics.** No git operations, no rebases, no stashes, no\ncherry-picks, no commit counts, no hash leases, no retry loops, no deploy-lease queues,\nno other sessions holding files. That is how the work got done, not what got done, and it\nreads as an excuse even when it is not offered as one. A deploy that has not landed is one\nline naming the surface that is not live and nothing else about it.\n\n**Never narrate.** Not what you attempted, not in what order, not how many tries. Each\ndefect repaired is at most one line: what was broken, what is true now, and the link.\nState a number as the measurement, never as the story of arriving at it.\n\nAmended 2026-08-06 after a session shipped a working subsystem and reported it as a\nchronology of commits, rebases and deploy queues, so the owner had to ask whether it had\nshipped at all.\n\n## What you must never do\n\n- Add a rule to CLAUDE.md, STATE.md, AGENTS.md or a handoff file and call it a fix.\n- Report completion in prose without a mechanically accepted submission behind it.\n- Repair only the object that exposed a defect.\n- Trust another agent's final report, or your own memory, as evidence.\n- Write to the database directly for ordinary work. The guarded write path is the door; direct SQL\n  is a repair capability and every use of it is a bypass listed in the work object.\n",
  "raw": "---\nname: agent-work-law\ndescription: Use at the start of every session operating miscsubjects.com, and whenever deciding what to work on, whether work is finished, or what to do about a failure. The infrastructure is the authority; this skill tells you where it lives and how to obey it.\n---\n\n# The Agent Work Law\n\nYou are a clerk. The infrastructure is the law.\n\nNothing in a Markdown file — not CLAUDE.md, not STATE.md, not AGENTS.md, not a handoff note,\nnot a previous agent's report, not this file — carries authority over what work exists, what\nremains unfinished, what you are permitted to do, or whether your work is complete. Those files\nare pointers. The authority is one canonical object, live on the site, readable by anyone:\n\n- **Human projection:** https://miscsubjects.com/a/the-work-object\n- **Machine projection:** https://miscsubjects.com/api/work\n- **Cold start:** https://miscsubjects.com/api/work/bootstrap\n\nBoth projections read the same record. There is no copy to keep in sync.\n\n## Why this exists\n\nFor months the project's operating intelligence lived in a running model's context and in hidden\nfiles. The rules were in CLAUDE.md. What remained unfinished was in STATE.md. Assignment,\ndependency order, priority and the decision that work was done lived in whichever Claude session\nhappened to be open. A fresh agent could not enter the project. A different model could not\ncontinue it. An auditor could not check any of it. Every correction the owner made was answered\nwith another line in a file no future agent would read, so the same failures returned.\n\nThe migration inverted that. Every operational fact is a row. Every transition is code.\n\n## The five rules that bind you\n\n1. **Work exists only as a task object.** If it is not a row in the work object, it is not work.\n   You do not invent work, and you do not carry a to-do list in your head or in a file.\n\n2. **You obtain work by reading the work object.** You do not exclusive-claim it.\n   `GET /api/work` names the next eligible task — dependency-resolved, priority-ordered.\n   The task carries its own objective, permitted capabilities, acceptance tests and required\n   evidence. That bounded object is all you need; you never reconstruct the project from prose.\n\n3. **You cannot complete work by saying you completed it.** You `POST` your evidence to\n   `/api/work/task/<id>/submit`. The infrastructure runs the task's acceptance tests against the\n   live site and sets the state from the result. `accepted:false` comes back with the exact test\n   that failed. Your assertion is not an input.\n\n4. **A failure becomes a child task, not a sentence in a report.**\n   `POST /api/work/task/<id>/fail` with the failure class, the infrastructure layer that permitted\n   it, and the invariant that should have prevented it. The repair is not the article, row or page\n   that exposed the defect — it is the shared mechanism, plus every existing object of the same\n   class, plus a regression test built from the exact failure, plus a deploy blocker.\n\n5. **Every action is appended, never overwritten.** Each note, submission, acceptance,\n   refusal and repair is one hash-chained row in `work_actions`, carrying who acted, which model,\n   which capability authorised it, the task revision, the exact input and output, what changed,\n   the tests run, the evidence and the verdict. Corrections append a revision naming what they\n   supersede. The full chain is public at `/api/work/audit`.\n\n## The loop, exactly\n\n```bash\n# 1. read the object (public, no credential)\ncurl -sS https://miscsubjects.com/api/work | jq '{objective, counts, next_eligible_action}'\n\n# 2. read the next eligible task off the object\ncurl -sS https://miscsubjects.com/api/work | jq '.next_eligible_action'\n\n# 3. do exactly what the task says, using only the capabilities it lists\n\n# 4. submit evidence; the infrastructure decides\ncurl -sS -X POST https://miscsubjects.com/api/work/task/WT-0001/submit \\\n  -H 'content-type: application/json' \\\n  -d '{\"agent\":\"<your name>\",\n       \"evidence\":{\"rendered_url\":\"https://miscsubjects.com/a/...\",\"sources_added\":\"...\"},\n       \"changed\":[\"/a/...\"]}'\n\n# 5. if you found a defect, record it as a failure object\ncurl -sS -X POST https://miscsubjects.com/api/work/task/WT-0001/fail \\\n  -H 'content-type: application/json' \\\n  -d '{\"agent\":\"<your name>\",\"failure\":{\"failure_class\":\"...\",\"layer\":\"...\",\"missing_invariant\":\"...\"}}'\n```\n\nReads are public. State changes need the terminal key, an admin cookie, or an act-scope share\ntoken; the token identity is recorded on the action, never the secret.\n\n## What the task object contains\n\n`task_id`, `objective`, `detail`, `state`, `priority`, `depends_on`, `permitted_capabilities`,\n`acceptance_tests`, `required_evidence`, `parent_task`, `supersedes`, `failure`, `failure_count`,\n`last_result`, `revision`, `created_at`, `updated_at`, and the two URLs you need:\n`audit` and `submit_to`.\n\n## The states, and who moves them\n\n`open → in_progress → evidence_submitted → accepted → completed`, with `refused`,\n`failed` and `repair_required` as the branches. Transitions are declared in\n`functions/_lib/work_object.js` and enforced there. There is no exclusive claim. Nothing an\nagent writes in prose moves a state.\n\n## Content law still applies, and it is also enforced\n\nThe write path refuses violations server-side with a 422 that names the fix, so you learn the law\nby hitting it rather than by remembering it:\n\n- one object per article — a compound page carries no condition frame (`one_object_guard.js`)\n- no model signature in a body\n- no test-shaped titles, no model self-introduction, no hashtag blocks\n- plain language over the body **and** the claims, checked in the deploy chain\n- an authored body always beats the slot composer\n\nThe governing invariants are listed in full, live, inside the work object.\n\n## How you report to the owner\n\nThe live law is `REPORT_AS_LINKS_NOT_PROSE` in the work object. Read it there. It binds\nlike this:\n\n**First line is the verdict.** Shipped and live, or not shipped and exactly which surface\nis not live. If the owner has to ask whether it landed, the report failed no matter what\nelse was in it.\n\n**Then the links, grouped under plain labels.** He reads the build, not a description of\nthe build. A report with no links is not a report.\n\n**Then what is outstanding.** One line each.\n\n**Never report deploy mechanics.** No git operations, no rebases, no stashes, no\ncherry-picks, no commit counts, no hash leases, no retry loops, no deploy-lease queues,\nno other sessions holding files. That is how the work got done, not what got done, and it\nreads as an excuse even when it is not offered as one. A deploy that has not landed is one\nline naming the surface that is not live and nothing else about it.\n\n**Never narrate.** Not what you attempted, not in what order, not how many tries. Each\ndefect repaired is at most one line: what was broken, what is true now, and the link.\nState a number as the measurement, never as the story of arriving at it.\n\nAmended 2026-08-06 after a session shipped a working subsystem and reported it as a\nchronology of commits, rebases and deploy queues, so the owner had to ask whether it had\nshipped at all.\n\n## What you must never do\n\n- Add a rule to CLAUDE.md, STATE.md, AGENTS.md or a handoff file and call it a fix.\n- Report completion in prose without a mechanically accepted submission behind it.\n- Repair only the object that exposed a defect.\n- Trust another agent's final report, or your own memory, as evidence.\n- Write to the database directly for ordinary work. The guarded write path is the door; direct SQL\n  is a repair capability and every use of it is a bypass listed in the work object.\n",
  "files": [
    {
      "path": "SKILL.md",
      "bytes": 7735
    }
  ],
  "has_license_file": false,
  "source": {
    "repo": "this build",
    "url": "/a/agent-work-law",
    "license": "site"
  },
  "prevents": [
    {
      "date": "2026-08-04",
      "failure": "The project's operating intelligence lived in CLAUDE.md, STATE.md, AGENTS.md and in whichever Claude session was open: the rules, what remained unfinished, assignment, dependency order, and the decision that work was done. A fresh agent could not enter the project, a different model could not continue it, and every owner correction was answered with another line in a file no future agent would read. Work is now a leased task object whose completion is decided by acceptance tests the infrastructure runs."
    }
  ],
  "canonical_source": ".claude/skills/agent-work-law/SKILL.md",
  "sibling": ".agents/skills/agent-work-law/SKILL.md",
  "stored": false,
  "note": "No D1 version record yet — this skill exists only as the generated registry constant. First POST /api/skills/agent-work-law/versions creates version 1."
}