agentleFS
ChenneyZhuangChenneyZhuang/laya-browser-agent/skills/decide/SKILL.md

decide

Skill18 starsChanged 2 months agoApache-2.0View on GitHub

Use when you need fast, cheap, calibrated judgments about text — classification, routing, scoring, relevance, guardrails — with a local model instead of an LLM call. Covers the three question primitives and how to write good ones.

67 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use handover-prompt, scheduled-agent-design and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • dominik1001Skill

    handover-prompt

    Write a short handover prompt for a new session. Use when the user asks for a handover, or to continue this work in another session.

    Also in 5 projects that use this

  • dominik1001Skill

    scheduled-agent-design

    Use when creating, changing or reviewing a Claude Code routine (a scheduled or event-triggered cloud agent) for this repository, its prompt, schedule, model, environment or connectors, a skill a routine runs, or a file in `.agents/routines/`.

    Also in 5 projects that use this

  • ai-analyst-labSkill

    improve-context

    Diagnose a context-related analytical failure, propose the smallest relevant change, compare the same evaluation cases before and after, and produce an accept, revise, or revert receipt. Use when the user asks to improve context, fix a definition or example, test whether context helped, or invokes /improve-context.

    Also in 5 projects that use this

  • yn01Skill

    mcp-tool-design

    Use this skill when designing or reviewing MCP server tools — choosing between Tool, Resource, and Prompt primitives; writing tool descriptions that Claude will reliably select; designing input schemas; handling errors in agent-friendly ways; or thinking through idempotency and side effects. Also trigger when the user is building MCP tools intended for use by agents (orchestrators, subagents, Generator/Evaluator loops) rather than direct human interaction. When in doubt, trigger early — design mistakes are expensive to fix after integration.

    Also in 5 projects that use this

  • geemusSkill

    review-agents-md

    Audits AGENTS.md files and equivalent agent instruction files (CLAUDE.md, CURSOR.md, Copilot instructions) for completeness, accuracy, and agent-friendliness, producing structured, actionable feedback. Cross-references file paths, scripts, and branch names against the actual repository to catch stale or incorrect guidance. Formats every finding with format-review-comments and runs a refine-prose pass before presenting results. TRIGGER when: user asks to review, audit, check, inspect, analyze, or evaluate an AGENTS.md, CLAUDE.md, or agent instruction file. DO NOT TRIGGER when: user asks to review a pull request (use review-pr instead) or to evaluate a skill file (use review-skill instead).

    Also in 5 projects that use this

  • ModelEngine-GroupSkill

    upgrade-dependency

    升级项目中的指定依赖包到新版本并验证变更。当用户要求升级依赖、更新包版本时触发。参数为包名、原版本和新版本。

    Also in 5 projects that use this

  • +1 more from dominik1001

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 65 edited versions we read keep these.

  • 3

    Distinctive

    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. Very specific:

    One state, many questions: Every question in a single decide() call is answered in the same forward pass.

    line 63
  2. Distinctive:

    Put the evidence in the state, not the question: If the model needs a chunk of text to judge, that text is the state.

    line 67
  3. Distinctive:

    Do not: treat a high confidence as proof of correctness on a new domain.

    line 79
  4. Distinctive:

    Do not: use confidence gating as your only safety layer.

    line 80

“Common” is measured: kept by at least 6 in 10 of the 65 edited versions of this file we could read. “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

Typed decisions with a local System 1 model

localdecide runs an open-weight decision model locally. It answers questions about a state in one forward pass and returns calibrated probabilities. It never writes text — that is the point, not a limitation: prose costs latency and can be hallucinated, probabilities cannot.

Reach for this when you have a judgment to make many times, the answer is one of a few options (or a number, or yes/no), and you do not need an explanation.

The three primitives

from localdecide import Decider, choice, noul, score
PrimitiveQuestion shapeReturns
choicepick one of a closed set of named optionsthe key, probabilities per option, confidence
scoreplace the state on an ordered rubricexpected level (float over the levels), the distribution
noulis this proposition true?P(true) in 0..1
d = Decider()
r = d.decide(ticket_text, {
    "queue":   choice("Which team owns this?", {"billing": "refunds and invoices",
                                                "infra": "outages and deploys",
                                                "support": "how-to questions"}),
    "urgency": score("How urgent?", ["whenever", "this week", "today", "now"]),
    "angry":   noul("Does the writer express anger or threat?"),
})
if r.ok:
    if r.answers.confidence("queue") < 0.7:
        escalate(r)                                  # do not act on a coin flip
    elif r.answers.noul("angry") > 0.8:
        page_a_human(r)
    else:
        route(r.answers.choice("queue"))

Writing questions that work

Say what each option means, not just its name. The model reads your criteria text as its decision context. {"billing": "refunds, invoices, payment problems"} beats {"billing": "billing"}.

Keep choices narrow. Under ~20 options. Beyond that the per-option token budget degrades (the harness chunks automatically, but a two-step coarse-to-fine question is better written by you: pick the category, then the item).

Prefer score over five nouls. One ordered rubric gives you an expected value and a distribution; five separate yes/no questions give you five numbers you then have to combine yourself.

One state, many questions. Every question in a single decide() call is answered in the same forward pass. Asking three questions costs barely more than asking one, so batch them rather than looping.

Put the evidence in the state, not the question. If the model needs a chunk of text to judge, that text is the state. Questions should be short and structural.

Confidence: use it, do not worship it

The returned confidence is calibrated on the model's own training distribution, which means it is meaningful in-domain and meaningless outside it. The upstream Laya benchmarks show a model reporting 95% confidence while scoring 0% accuracy on a script it cannot read. So:

  • Do branch on confidence with a threshold tuned on your own labelled data.
  • Do route low-confidence items to a human or a bigger model.
  • Do not treat a high confidence as proof of correctness on a new domain.
  • Do not use confidence gating as your only safety layer.

Calibration

Base weights ship with raw temperature logits; fitting one scalar temperature on a sample of your own data materially improves calibration error (upstream reports ECE 0.466 → 0.081 for Laya with a single fitted scalar per question type). If you are about to gate on thresholds, fit the temperature first — otherwise your 0.7 threshold is arbitrary.

Failure behaviour

Everything fails open. No model, no key, timeout, rate limit, malformed answer, low confidence: you get Decision(ok=False) and your flow continues on its own path. Inspect .ok and .error — never assume success.

result = d.decide(state, questions)
if not result.ok:
    return my_rule_based_fallback(state)     # your existing logic stays in charge

When not to use this

  • Anything that needs prose out. It cannot write. Use it to decide, then let a normal model write.
  • Sequential reasoning. It answers one round of questions about one state. It has no scratchpad and no plan. Multi-step logic belongs in your code.
  • High-stakes single decisions with no verification. It is fast and cheap; when the cost of being wrong is high, use it to triage and verify the survivors properly.
  • A domain it was not trained on, with no fine-tuning budget. Zero-shot on your own data is weak. Budget for a fine-tune (upstream reports ~5 GPU-hours for a browser head) or do not adopt it for that task.

Cost and latency, honestly

On an M4 with the MLX runtime: 10–30 ms per decision on short states, up to ~100 decisions/second throughput, zero marginal cost, and nothing leaves the machine. A decision via a hosted equivalent costs about $0.00006–$0.0004 depending on payload, so the local runtime is a latency and privacy win more than a price win at small volume.

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.