Agent Skills

Skill Feedback — capture the fuel for skill improvement

This skill closes the loop opened by docs/SKILL_QUALITY_GATE.md. The Quality Gate tells you whether a skill is good; this skill tells you how to make it better next time by recording what happened in real usage and turning it into a feed for skill-forge.

Without a feedback capture, improvement is guesswork. With it, every near-miss trigger and every manual correction becomes a concrete edit to a skill’s description / when_to_use / body.

When to use

DO NOT USE FOR

Auto-capture (make it automatic)

For the loop to run without manual nudging, capture feedback proactively. Append the rule from AGENTS_FRAGMENT.md (repo root) to your opencode AGENTS.md. Then any near-miss / manual correction is logged automatically — no explicit “remember this” needed. Each consumer grows their own skills locally; see docs/SKILL_QUALITY_GATE.md Layer C.

How feedback is stored

Each entry is one JSON object on its own line in:

feedback/<skill-name>/YYYY-MM-DD.jsonl

Entry schema:

{
  "ts": "2026-08-26T14:03:00",
  "skill": "api-contract-testing",
  "type": "near_miss_trigger",
  "request": "проверь, что эндпоинты совпадают со спецификацией",
  "detail": "skill did not auto-load; user had to invoke it manually",
  "suggested_fix": "add casual-phrasing trigger 'проверь эндпоинты' to when_to_use",
  "source": "user"
}

type is one of: near_miss_trigger, wrong_trigger, output_issue, manual_correction, description_gap.

The script

scripts/feedback.py — pure Python 3 stdlib, no third-party packages. Run it from this skill folder (e.g. python3 scripts/feedback.py …); the script resolves the repo root on its own, so the feedback/ store always lands in the right place regardless of current directory.

Command Effect Exit
python3 scripts/feedback.py add --skill NAME --type TYPE --request "..." --detail "..." [--fix "..."] append one entry 0 on success, 2 on invalid --type
python3 scripts/feedback.py report [--skill NAME] aggregate counts by skill+type, list recent near-miss request strings (the exact fuel for trigger optimization) 0 (prints no feedback recorded when empty)
python3 scripts/feedback.py export [--skill NAME] emit a prompt-ready digest for the skill-forge Improve / Optimize-description steps 0 (prints no feedback to export when empty)

Verification — capture evidence, not assertion

The loop is not “done” until the script proves the entry landed. After every add, capture two pieces of evidence:

  1. The printed line — add writes ok: appended to <path> on success. That line names the exact file the entry went into, so you can confirm the store grew.
  2. The exit status — 0 means the entry was written; 2 means the --type was rejected and nothing was saved. Treat any non-zero exit as a failure and fix the command before moving on.

Example evidence capture:

python3 scripts/feedback.py add \
  --skill api-contract-testing --type near_miss_trigger \
  --request "проверь, что эндпоинты совпадают со спецификацией" \
  --detail "skill did not auto-load; user had to invoke it manually" \
  --fix "add casual-phrasing trigger 'проверь эндпоинты' to when_to_use"
# expect: ok: appended to feedback/api-contract-testing/2026-08-26.jsonl
# expect: exit 0

report and export are read-only and always exit 0; run them before improving a skill to see the accumulated issues, and paste their output into the skill-forge session as the basis for trigger/description edits.

How it feeds the loop

  1. During/after a session, capture near-misses and corrections via add (or ask the user “should I log this as skill feedback?”).
  2. Before improving a skill, run report to see its accumulated issues.
  3. Feed the near-miss request strings into skill-forge’s Optimize description (they become the missing trigger queries); feed manual_correction suggested_fix into the Improve step.
  4. Re-run the Layer A/B audit (the docs/skill-quality-audit.md generator) to confirm the edit moved the needle.
  5. Commit the skill change — and optionally the feedback store — so the loop is reproducible.

Privacy & hygiene

Boundaries