add-command SKILL.md skillA
add-command from riot-org/riot is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add riot-org/riot/add-command@git:20260817.d00a470Pins git:20260817.d00a470 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- riot-org/riot
- Path
.riot/skills/add-command/SKILL.md- Versions recorded
- 1
- Latest version
- git:20260817.d00a470, committed Aug 17, 2026
- Size
- 3,384 bytes
- Repository stars
- 22
- License
- a license file GitHub does not identify
给前端加一个 Tauri 命令时用。要改五处,漏了其中三处只表现为运行时「command not found」;权限文件还有个先后顺序的坑会让 build.rs 直接 panic。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# 加一个 Tauri 命令
一个命令要在**五处**同时存在。`src-tauri/tests/acl.rs` 只守得住两处,
另外三处漏了不报编译错,表现是前端调用时 `<name> not allowed. Command not found`。
## 五处清单
**1. 命令本体** —— `src-tauri/src/lib.rs`
```rust
#[tauri::command]
async fn term_share(
terms: tauri::State<'_, term::Terminals>,
id: u32,
shared: bool,
) -> HostResult<()> {
terms.set_shared(id, shared);
Ok(())
}
```
返回 `HostResult<T>`,错误用 `HostError` 的现成变体(`HostError::Term`、
`HostError::Provider`、`HostError::Hook`…)。参数名用 snake_case,前端那边
传 camelCase,Tauri 自己转。
**2. 注册** —— `lib.rs` 的 `invoke_handler` 列表
`[约束]` `invoke_handler` 只能调用一次,调多次只有最后一次生效。所以是往
那个已有的列表里加一行,不是再写一个 `.invoke_handler(...)`。
**3. 声明存在** —— `src-tauri/build.rs` 的 `COMMANDS`
不加这里,自定义命令**默认对所有 window/webview 开放**,不受 capability
约束。那意味着将来加一个 OAuth window 或 devtools window,它自动拥有全部
命令权限。
**4. 授予可用** —— `src-tauri/capabilities/default.json` 的 `permissions`
形式是 `allow-<kebab-case>`,例:`term_share` → `"allow-term-share"`。
声明「存在」和授予「可用」是两件事,所以要改两处。
**5. 前端入口** —— `src/bridge/index.ts`
`[约束]` 这是**唯一**允许调 Tauri API 的地方。别处直接 `import
@tauri-apps/api` 会让前端无法脱离 Tauri 运行,组件测试全部失效。
## 那个会让 build.rs panic 的坑
…Read the whole file at its exact version.
How to install
mdr add riot-org/riot/add-command@sha256:2441f8e8cd9f2076The line at the top of this page pins the label git:20260817.d00a470, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_rku26w2ljb4na2gx)
5 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 1 version of this file, committed on Aug 17, 2026.
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (3384 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
riot-org/riot · 22 stars · license a license file GitHub does not identify · pushed 2026-10-29 · branch master
API
GET https://markdownregistry.com/api/v1/artifacts/art_rku26w2ljb4na2gx GET https://markdownregistry.com/api/v1/resolve?ref=riot-org/riot/add-command GET https://markdownregistry.com/api/v1/blob/2441f8e8cd9f2076096bf507f189ea9cee80677fd30ede18e622b4087574d877
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.