agentleFS
d-oitd-oit/rust-2026-template/.agents/skills/metrics-reporter/SKILL.md

metrics-reporter

Skill15 starsChanged 5 months agoMITView on GitHub

Record agentic task completion via event files for DORA observability.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Call this skill as the LAST step of any task or sub-task.

    line 20
  2. Distinctive:

    Prepare Directory: Ensure the daily directory exists.

    line 24
  3. Distinctive:

    Generate Filename: Create a unique filename for the event.

    line 31
  4. Distinctive:

    Verify: Ensure the JSON is valid and written to the correct location.

    line 53
  5. Very specific:

    When using the stacked-prs skill, add these optional fields to the event JSON:

    line 57
  6. Distinctive:

    Do NOT include these fields for non-stacked work.

    line 71

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: metrics-reporter

Purpose

Record agentic task completion by writing a per-event JSON file to .agents/events/. This pattern avoids Git merge conflicts and supports multi-agent coordination.

When to use

Call this skill as the LAST step of any task or sub-task.

Steps

  1. Prepare Directory: Ensure the daily directory exists.

    EVENT_DIR=".agents/events/$(date -u +%Y/%m/%d)"
    mkdir -p "${EVENT_DIR}"
  2. Generate Filename: Create a unique filename for the event.

    EVENT_FILE="${EVENT_DIR}/$(date -u +%Y-%m-%dT%H-%M-%SZ)-${AGENT_NAME:-unknown}-${TASK_ID:-$(date -u +%s)}.json"
  3. Write Event Data: Populated with task metadata and success status.

    {
      "event_id": "$(date -u +%s)-${AGENT_NAME}",
      "task_id": "${TASK_ID}",
      "skill": "${SKILL_NAME}",
      "status": "success",
      "started_at": "${STARTED_AT}",
      "finished_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
      "success": true,
      "human_interventions": 0,
      "git_sha": "$(git rev-parse --short HEAD)"
    }
  4. Verify: Ensure the JSON is valid and written to the correct location.

Stacked PR Metrics

When using the stacked-prs skill, add these optional fields to the event JSON:

{
  "stack_id": "billing-feature",
  "stack_position": 1,
  "stack_total": 3
}
  • stack_id: Identifier for the stack (feature name)
  • stack_position: This layer's position in the stack (1-indexed)
  • stack_total: Total number of layers in the stack

Do NOT include these fields for non-stacked work.

Human Interventions

Set human_interventions > 0 if:

  • A human corrected, rewrote, or reverted your code.
  • A PR required a fixup commit after your submission.
  • A review comment called out an error in your work.

Aggregation

Aggregated metrics are periodically generated by CI into .agents/aggregated/. The CI status files are in .agents/ci/. Do not hand-edit files in these directories.

Rationalizations

RationalizationReality
"I'll skip metrics — it's just paperwork."Without metrics, you can't prove AI tooling ROI or identify bottlenecks.
"I'll log it later."Later never happens. Log immediately after task completion.
"human_interventions doesn't matter."It's the key metric for measuring true agent autonomy vs human effort.

Red Flags

  • Not calling metrics-reporter as the last step of a task
  • Setting human_interventions to 0 when a human fixed your code
  • Using the old append-to-metrics.jsonl pattern instead of event files

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.