agentsclimarketplace

Add target

Skill StringKe/std-agent/.clinerules/skills/add-target

给 stdagent 新增一个 AI CLI 工具 target(transformer + 调研 + 测试 + 文档),逐步指引From its SKILL.md

Install
npx -y skills add StringKe/std-agent --skill add-target

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
  • runs commandsInstructs the agent to run 3 commands, including `mise run build` and 2 more.

SKILL.md

3.7 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

<!-- Generated by stdagent dev. Source: .stdai/standards/skills/add-target/SKILL.md. Run `stdagent sync` to regenerate. Do not edit by hand. --> <!-- std-agent degraded skills: add-target --> <!-- Target tool "cline" does not natively support this type. Skill is an on-demand capability pack; AI loads it when the description matches user intent. -->

加一个新 target

stdagent 的扩展点是 internal/transformer/:每个 AI CLI 工具一个 .go 文件,实现 Plan(docs, cfg) (*Plan, error)。本 skill 给你完整的加 target 工作流。

触发场景

  • 用户提到"加 X 工具"、"支持 Y AI CLI"
  • 看到 docs/targets/ 出现新的 .md 但 internal/transformer/ 还没对应实现
  • 收到 issue 请求新 target

流程

1. 调研先行(必须)

在 docs/targets/ 写一份调研 docs/targets/<kebab-name>.md,覆盖:

  • 工具官方仓库 + 主页 URL
  • 它读哪些路径(根文件名 + 子目录约定)
  • frontmatter 字段方言(applyTo / globs / type 字段是否有特殊形式)
  • 字节 / 字符上限(如有,记 SOFT 与 HARD 两档)
  • 注入 marker 是否允许(comment vs frontmatter,对该工具有没有反作用)
  • skill / command / subagent 概念是否原生支持,对应路径

调研不充分就动代码:一定踩坑。

2. 实现 transformer

新文件 internal/transformer/<name>.go

package transformer

import (
    "std-agent/internal/config"
    "std-agent/internal/parser"
    "std-agent/internal/writer"
)

type fooTransformer struct{}

func init() { Register("foo", &fooTransformer{}) }

func (t *fooTransformer) Plan(docs []*parser.Document, cfg *config.Config) (*writer.Plan, error) {
    plan := &writer.Plan{Target: "foo"}
    // ... fan out 逻辑
    return plan, nil
}

参考最简的 aider.go(reuse AGENTS.md,noop)或最复杂的 claude_code.go(root + .claude/rules/ + skills + commands + subagents + mcp)。

3. config 注册

internal/config/config.go 已经按 map 加载,无需改。但 internal/cli/init_assets/ 的样板 config 与 README*.md 的 target 列表要加。

4. 测试

最低门槛:internal/transformer/smoke_test.go 里加一个 case,断言 Plan 返回非空 + 关键 path 出现。建议加专门的 <name>_test.go 覆盖 rules / skills / commands 各 type 的 fanout。

5. 文档

  • README 6 个语言版本的 Tier 1 / Tier 2 表格加一行
  • docs/conversion-rules.md 加列
  • docs/spec.md Part 2 加章节(如果 frontmatter 方言独特)

6. 验证

# 在仓库自己的 .stdai/ 里开启新 target,跑 sync 看真实产物
mise run build
./bin/stdagent sync --target=<new-name>
ls -la .<new-name>/   # 或对应的根文件

已实现的 23 个 target(参考实现深度)

target实现复杂度参考
aider极简(reuse AGENTS.md)aider.go
antigravity简单antigravity.go
cline中等(数字前缀文件名排序)cline.go
continue.dev中等continue.go
codex中(spillover 处理)codex.go
copilot中(applyTo -> .instructions.md)copilot.go
cursor中(.mdc frontmatter 方言)cursor.go
gemini简单(GEMINI.md + commands toml)gemini.go
opencode简单opencode.go
windsurf中(rules/skills/workflows 分目录)windsurf.go
claude-code高(subagents / skill packages / mcp)claude_code.go

入门读 aider + gemini,进阶读 cursor + copilot,全功能读 claude_code。

<!-- /Generated by stdagent -->

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.