From 838d02eef5d4267c9f8132c832fc2ec6296d559b Mon Sep 17 00:00:00 2001 From: hopeatina Date: Fri, 17 Apr 2026 05:43:59 -0500 Subject: [PATCH] feat(daily-brief): orgx-deviation-reporting skill Instructs Claude Code to record skill deviations with OrgX when OrgX skills fire locally. Feeds the Daily Brief's 'Deviations caught' proof tile + skill confidence sparkline. Companion repos: - orgx-openclaw-plugin: reference SDK (src/deviations-sdk.ts) - orgx: HTTP endpoint at /api/v1/skills/[id]/deviations Co-Authored-By: Claude Opus 4.7 (1M context) --- skills/orgx-deviation-reporting/SKILL.md | 81 ++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 skills/orgx-deviation-reporting/SKILL.md diff --git a/skills/orgx-deviation-reporting/SKILL.md b/skills/orgx-deviation-reporting/SKILL.md new file mode 100644 index 0000000..c257499 --- /dev/null +++ b/skills/orgx-deviation-reporting/SKILL.md @@ -0,0 +1,81 @@ +--- +name: orgx-deviation-reporting +description: Record a skill deviation with OrgX so it feeds tomorrow's Daily Brief. Use whenever an OrgX skill fires locally (pre-PR, pre-commit, pre-chat) on a file edit, commit, PR, chat turn, or task output. +tools: + - mcp__orgx__* +--- + +# OrgX — skill deviation reporting + +Every time an OrgX skill catches a deviation during your work — a file you +edited, a commit you made, a PR you drafted, a chat turn, or a task output — +record it with OrgX so the evidence shows up in tomorrow's Daily Brief and +drives the confidence trajectory for that skill. + +## When to record + +You should record a deviation when: + +- A rule from an OrgX skill triggered on code you were writing or reviewing. +- You accepted or rejected a skill's suggestion (pass `outcome: confirmed` + or `outcome: rejected`). +- A skill surfaced a pattern in output you produced (PR description, chat + response, test writeup). + +Do **not** record the same deviation more than once per 10-minute window — +the server dedupes on `dedupe_key` automatically, but redundant POSTs waste +tokens. + +## How to record + +Issue an `orgx.post_skill_deviation` call (if available in your MCP tools) +or a direct HTTP POST through the OpenClaw bridge: + +``` +POST /api/v1/skills/{skill_id}/deviations +Authorization: Bearer +Content-Type: application/json + +{ + "evidence_kind": "file_edit" | "commit" | "pr" | "chat_turn" | "task_output", + "evidence_ref": "#" | ":" | "", + "summary": "", + "application_source": "plugin_claude", + "confidence": 0.0..1.0, + "outcome": "pending" | "confirmed" | "rejected" | "ignored", + "trigger_context": { "file_path": "...", "rule_matched": "..." }, + "dedupe_key": "", + "captured_at": "2026-04-17T10:00:00Z" +} +``` + +### Computing `dedupe_key` + +```ts +import { createHash } from "node:crypto"; + +const bucket = Math.floor(Date.now() / 1000 / 600); +const material = [skillId, evidenceKind, evidenceRef, String(bucket)].join("|"); +const dedupe_key = createHash("sha1").update(material).digest("hex"); +``` + +10-minute bucketing handles save-happy editors without losing legitimate +re-fires beyond that window. + +## What happens next + +Your deviation lands in `skill_deviations` on the OrgX server. The nightly +rollup feeds it into `workspace_proof_daily` (the "Deviations caught" tile +in your Daily Brief proof strip) and updates the skill's confidence +sparkline in `skill_confidence_samples`. + +If the skill catches ≥3 deviations on tasks owned by a particular agent +whose loadout doesn't include the skill yet, the nightly job surfaces a +cross-pollination proposal — which you'll see tomorrow morning in your +Agents lens. + +## Links + +- Full contract: https://github.com/hopeatina/orgx/blob/main/orgx/docs/api-contracts/daily-brief-schema.md#04 +- SDK reference implementation (Node): https://github.com/useorgx/openclaw-plugin/blob/main/src/deviations-sdk.ts +- Daily Brief surface: https://useorgx.com/today