Agent Skills › udecode/plate › best-api

best-api

GitHub

用于设计、审查或修复 Plate API 公共调用形态的决策技能,基于产品愿景和原则评估 API 形状。

.agents/skills/best-api/SKILL.md udecode/plate

触发场景

需要设计新的 API 接口 审查现有 API 方案 修复不规范的 API 使用示例

安装

npx skills add udecode/plate --skill best-api -g -y
更多选项

非标准路径

npx skills add https://github.com/udecode/plate/tree/main/.agents/skills/best-api -g -y

不安装直接使用

npx skills use udecode/plate@best-api

指定 Agent (Claude Code)

npx skills add udecode/plate --skill best-api -a claude-code -g -y

安装 repo 全部 skill

npx skills add udecode/plate --all -g -y

预览 repo 内 skill

npx skills add udecode/plate --list

SKILL.md

Frontmatter
{
    "name": "best-api",
    "metadata": {
        "skiller": {
            "source": ".agents\/rules\/best-api.mdc"
        }
    },
    "description": "Design, review or repair a Plate public call shape with the Plate API lens.",
    "argument-hint": "[design|review|repair] <API surface | diff | plan | correction>"
}

Best API

Handle $ARGUMENTS.

Own the public call-site decision. This is a taste and decision skill, not an implementation engine. It picks or judges a public call shape and leaves adoption to the Plan playbook. VISION.md holds Plate's product and API direction, so read it and cite it instead of restating it. Whether a direction earns any work at all is verdict's question, answered through the Verdict playbook.

Modes

Infer the mode when it is omitted. Do not invent more modes for workflow stages that another skill already owns.

  • design: choose the smallest materially justified API for a new or redesigned surface, and return one call-shape decision. When the work continues into an API plan, the Plan playbook runs pstack:architect under the api-plan reviews row.
  • review: judge one current or proposed API, diff or plan, recommend the better target and rank its findings on the architecture reference's P0 to P3 scale (.agents/playbooks/references/architecture.md#priority), which the Babysit playbook's P0 and P1 gate reads.
  • repair: edit the one Vision owner, then fix every example, recipe, check and doc that still teaches the rejected shape. See Repair.

A design or review verdict goes on a page, per AGENTS.md's Plan pages: the active plan's, or a one-off plan's.

Inputs

Read only what can change the decision:

  1. Root VISION.md.
  2. Prior art first, as the pstack:principle-redesign-from-first-principles skill says: existing Slate primitives, Plate components and the reference editors. A source-level editor comparison consumes research audit evidence.
  3. The public types, exports, docs, representative call sites, and owning implementation for the named surface.
  4. Existing plans and compatibility constraints, only after the ideal target is clear on its own.

Decide in two passes

1. The ideal target

Apply the pstack:principle-redesign-from-first-principles skill in full. Rank a public API in this order: correct ownership and truthful semantics, one obvious common path, discoverable inference, JSDoc and examples, progressive disclosure, stable composition points, locality, then ecosystem fit. Prefer the Slate and Plate idiom when two designs are equally good, and depart from it when another shape is materially cleaner or more scalable.

Show concrete call sites with their real public imports before naming abstractions: the normal path, one realistic customization path, and an advanced path only when a real job needs it. If the normal path needs explanation before it reads naturally, the API is not done. Resolve where every public noun is owned and imported from: root, feature entrypoint, registry or app. A short call site with the wrong owner is still a bad API.

Hard-cut gate. Treat every touched noun, namespace, plugin, abstraction, owner, layer and package as a candidate for deletion:

  1. Test deleting it and routing its current jobs through an existing canonical owner.
  2. Test merging or inlining it when deletion would leave only private mechanics.
  3. Look one owner above the named surface. Ask whether the capability is merely an input adapter, view, query, policy or payload of an authority that already exists.
  4. Keep it only when a hard correctness, security, serialized-data, native-behavior or runtime law requires the boundary, the user explicitly requires it, or source proves an independent current user job.
  5. Select the largest deletion cone that preserves those laws and jobs. Name the single surviving authority and any private adapter that still earns its keep.

Call count, implementation size, tests, docs, compatibility, migration cost and an accepted plan do not prove independent ownership; they change the adoption order only. A review is incomplete if it recommends renaming, moving, or wrapping a surface that can disappear. For harsh honest feedback, lead with the strongest materially justified cut, even when it invalidates the current plan.

2. Reality check

Then inspect current ownership, runtime truth, adoption, inference and breaking cost, with the ideal target still visible. Prefer a staged hard cut over a permanent hybrid. Never silently downgrade the target because the code already holds a registry, profile, lifecycle, builder, alias or accepted plan.

Implementation difficulty never gets a vote in the API verdict. When a compiler limit, declaration emit, compatibility or a deadline blocks the ideal call site, keep it as the recommendation, trace the blocker to its owning generic, layer or package contract, and name the durable repair there. Reject casts, annotations, aliases, wrappers, markers, carriers or parallel APIs whose only job is to avoid that repair. If an existing containment must remain while another owner is repaired, label it temporary debt with a deletion proof; it is never the selected API or completion evidence.

A target that adds, retains or changes hot runtime work stays provisional until Benchmark's pre-acceptance probe passes. Call syntax may settle without the probe only when live source proves the competing shapes share one runtime law and the verdict retains no runtime machinery. Type-only and zero-runtime work may record N/A with that source evidence.

Bounded exhaustiveness

When a design or review question touches colocation, inlining, helper survival, file topology or "the full list", build the architecture reference's Audit manifest for the complete bounded owner (.agents/playbooks/references/architecture.md#audit) before recommending a cleanup.

Review questions

  • What is the user trying to say, and does the call site say exactly that?
  • What is the real import path for every noun, and is that layer its honest owner?
  • Can an owner noun leave a scoped API, can nesting become a flat domain verb, and can inference remove a type, cast, helper or duplicated contract?
  • Is a customization path paying for an advanced case on every basic call? Search examples and docs for a placeholder value of a required option, such as the same ID in every demo; each one is a basic call paying for that case.
  • Were invariant, parameter, substitutable capability and app policy classified before a plugin was proposed?
  • Does the API remain coherent after three plausible future additions?
  • Can an agent find the canonical path from types, JSDoc and one example?
  • What is the maximum justified deletion cone, and which survivor has hard-law or independent-current-job evidence?
  • Am I selecting a workaround because the durable owner repair is harder?
  • When a guard's input widens for a new case, do existing guards, third-party ones included, still decide that case correctly unchanged? An optional field they ignore fails open; prefer a shape they already read, such as the actual landing parent, or an opt-in.
  • Do the exported types promise exactly what the runtime accepts: no option the runtime honors hidden behind a narrower type, and no parameter typed required that the runtime treats as optional?

Do not preserve a weaker proposal because it is more elaborate, more generic, more observable, or already documented.

Output

Lead with one recommendation, not a menu. For harsh honest feedback, the first sentence states the maximum materially justified cut.

design and review return the verdict and deletion cone; ideal call sites with exact public import paths; current source and caller evidence; why the target is the simplest truthful model; the alternatives rejected, with retention evidence for every surviving public concept; ownership by layer and the runtime and safety laws kept; the pre-acceptance scale receipt or source-backed zero-runtime N/A; breaking and adoption impact; the verification run; and the exact next owner. A review gives each finding its P0 to P3 priority.

Repair

Run repair when the user corrects an API recommendation in a reusable way, when an accepted design sets or rejects a reusable public API principle, or when a change removes, renames or reinterprets a reusable public API or its canonical pattern. This is an automatic closeout subtask of the API change. In a read-only request, report the exact repair instead of writing it. When the same API mistake comes back a second time, run /pstack:correct on its class first, so a type, lint or check stops it before doctrine text changes.

  1. Check the correction against live source and the current Vision owner. When it names an API the source lacks or contradicts settled law, stop the repair and run verdict on the correction, because changing settled law is a review question, not a repair.
  2. Edit the one Vision owner of the rule in VISION.md.
  3. Search every artifact that teaches the contract, its skills, examples, recipes, checks, docs, generated mirrors and generated reference output, for the rejected names, examples, and call shapes. Run node tooling/scripts/teaching-sweep.mjs <API name> [...] for that search instead of a hand-written grep. It splits each ASCII name into words at case changes and acronyms, matches those words in any case with at most one word between them, and lists every Chinese twin of an English docs hit. It groups hits as live, generated, release notes and history. History needs no change. It holds decision logs, package changelogs and plans whose every status label marks them finished, superseded or cancelled. Fix live hits, regenerate generated ones, and fix release notes that have not shipped. Read each twin around its English hit, and the prose of every page it hits, because a paraphrase without the name's words, or a translated one, matches nothing. When a generator fails at the base, regenerate its output as verify's command recipes say, or list the stale output as open work in the plan's Close. Update only skills that teach or enforce the changed contract, remove contradictions, and link the Vision owner instead of copying the doctrine.
  4. Regenerate skills and their resources per the pstack block's Agent files rule.
  5. Forward-test the affected action on a real API without seeding the expected answer.

Do not call the API migration complete while an owning or dependent skill still teaches the rejected shape. Do not turn product-specific decisions into universal rules. A rule that every long-running workflow needs goes to AGENTS.md or the block's shared source, never here.

Stop

Stop API design when one target clearly wins and its unresolved questions are implementation/proof questions. Route them to the Plan playbook or the owning package. Do not implement product API changes unless the user explicitly asks and the owning execution skill is loaded.

版本历史

  • c673d03 当前 2026-10-20 06:55

同 Skill 集合

.agents/skills/adversarial-document-reviewer/SKILL.md
.agents/skills/agent-browser-issue/SKILL.md
.agents/skills/agent-native-reviewer/SKILL.md
.agents/skills/architecture-strategist/SKILL.md
.agents/skills/autoclosure/SKILL.md
.agents/skills/autogoal/SKILL.md
.agents/skills/autoreview/SKILL.md
.agents/skills/benchmark/SKILL.md
.agents/skills/best-practices-researcher/SKILL.md
.agents/skills/changeset/SKILL.md
.agents/skills/chips/SKILL.md
.agents/skills/clawpatch/SKILL.md
.agents/skills/clawsweeper/SKILL.md
.agents/skills/cleanup/SKILL.md
.agents/skills/code-simplicity-reviewer/SKILL.md
.agents/skills/coherence-reviewer/SKILL.md
.agents/skills/components/SKILL.md
.agents/skills/continue/SKILL.md
.agents/skills/correctness-reviewer/SKILL.md
.agents/skills/dev-browser/SKILL.md
.agents/skills/diagnosing-bugs/SKILL.md
.agents/skills/docs-creator/SKILL.md
.agents/skills/editor-harvest-plan/SKILL.md
.agents/skills/editor-test-harvester/SKILL.md
.agents/skills/feasibility-reviewer/SKILL.md
.agents/skills/framework-docs-researcher/SKILL.md
.agents/skills/frontend-design/SKILL.md
.agents/skills/git-history-analyzer/SKILL.md
.agents/skills/gpt-pro/SKILL.md
.agents/skills/grill-me/SKILL.md
.agents/skills/hard-cut/SKILL.md
.agents/skills/issue-harvester/SKILL.md
.agents/skills/issue-intelligence-analyst/SKILL.md
.agents/skills/learnings-researcher/SKILL.md
.agents/skills/maintainability-reviewer/SKILL.md
.agents/skills/maintainer/SKILL.md
.agents/skills/major-task/SKILL.md
.agents/skills/north-star/SKILL.md
.agents/skills/orchestrator/SKILL.md
.agents/skills/pattern-recognition-specialist/SKILL.md
.agents/skills/performance-oracle/SKILL.md
.agents/skills/performance/SKILL.md
.agents/skills/plate-docs/SKILL.md
.agents/skills/plate-next/SKILL.md
.agents/skills/plate-plan/SKILL.md
.agents/skills/plate-plugin-creator/SKILL.md
.agents/skills/plate-plugins/SKILL.md
.agents/skills/plate-ui/SKILL.md
.agents/skills/potion-yjs-dev-browser-test/SKILL.md

元信息

文件数
0
版本
c673d03
Hash
2fee8a7e
收录时间
2026-10-20 06:55

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-02 03:35
浙ICP备14020137号-1