new-subcommand SKILL.md skillA
new-subcommand from minleev5/devkeel is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add minleev5/devkeel/new-subcommand@v1.0.0Pins v1.0.0 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- minleev5/devkeel
- Path
.harness/skills/new-subcommand/SKILL.md- Versions recorded
- 1
- Latest version
- v1.0.0, committed Sep 22, 2026
- Size
- 1,730 bytes
- Repository stars
- 6
- License
- MIT
为 DevKeel CLI 新增子命令的标准开发流程.
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
# 子命令实现
## 何时使用
为 DevKeel CLI 新增一个子命令时(如 `harness <new-cmd>`)。
## 流程
### Step 1: 注册命令
在 `src/index.ts` 中添加:
```typescript
import { runNewCmd } from './commands/new-cmd.js'
program
.command('new-cmd')
.description('中文功能描述')
.option('--flag', '选项说明')
.action((opts) => runNewCmd(opts))
```
### Step 2: 实现命令层
创建 `src/commands/new-cmd.ts`:
```typescript
import * as p from '@clack/prompts'
import { someLogic } from '../lib/new-cmd.js'
export async function runNewCmd(opts?: { flag?: boolean }): Promise<void> {
p.intro('harness new-cmd')
// 交互 + 调用 lib
p.outro('完成')
}
```
命令层只做:读参数 → 交互 → 调用 lib → 输出结果。
### Step 3: 实现逻辑层
创建 `src/lib/new-cmd.ts`:
- 纯函数,不引入 `@clack/prompts`
- 文件操作前 `fs.existsSync` 守卫
- 返回 plain object 或 null,不 throw
### Step 4: 编写测试
创建 `tests/new-cmd.test.ts`:
- 临时目录隔离(`fs.mkdtempSync`)
- 真实文件系统验证
- 覆盖正常路径 + 缺失输入 + 幂等性
### Step 5: 验证
```bash
pnpm lint && pnpm test && pnpm build
node bin/devkeel.js new-cmd --help
```
## Checklist
- [ ] `src/index.ts` 注册命令
- [ ] `src/commands/new-cmd.ts` 交互层
- [ ] `src/lib/new-cmd.ts` 逻辑层(如有复杂逻辑)
- [ ] `tests/new-cmd.test.ts` 测试
- [ ] `pnpm lint` + `pnpm test` 通过Read the whole file at its exact version.
How to install
mdr add minleev5/devkeel/new-subcommand@sha256:83b813cff1129487The line at the top of this page pins the label v1.0.0, 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_pyte2pgzblfkabeq)
3 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 1 version of this file, committed on Sep 22, 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 (1730 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
minleev5/devkeel · 6 stars · license MIT · pushed 2026-10-26 · branch master
API
GET https://markdownregistry.com/api/v1/artifacts/art_pyte2pgzblfkabeq GET https://markdownregistry.com/api/v1/resolve?ref=minleev5/devkeel/new-subcommand GET https://markdownregistry.com/api/v1/blob/83b813cff1129487f45b2b7f5e5804ca81130939d47403d9a6186713b8d088ce
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.