跳到正文
Skillpedia
智能体41k · #6953

working-with-skills

它能做什么

本技能提供创建、读取和编辑共享 PostHog 技能的实用规则,避免做无用功。适合维护包含许多文件的大型技能的人和智能体。

适用场景

  • ✓当你即将创建、编辑或更新某项共享 PostHog 技能时。
  • ✓当某次技能改动被拒绝,你需要了解原因的时候。
  • ✓当某个大型技能包含许多附带文件,而你只需修改其中一部分时。

技能链接

https://github.com/PostHog/posthog/blob/master/products/skills/skills/working-with-skills/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/PostHog/posthog/blob/master/products/skills/skills/working-with-skills/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请只更新我们大型报告技能中的一个章节,而不要重写整个技能。”

每周 5 个新技能,1 分钟读完。

工作原理

它会说明每类改动应选用哪种工具,例如小范围的定向编辑,而不是整体重写;并说明如何避免覆盖他人最近的改动。它建议先读取该技能,以获取其当前版本。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Working with PostHog skills

This skill teaches agents how to use the skill-* MCP tools well — minimum context, minimum round-trips, minimum mistakes. If you are not yet familiar with the tool surface itself, read the skills-store skill first for the catalog. This document is about how to choose between the tools and how to scale the workflow when skills get big.

Operating principles

  1. Progressive disclosure is non-negotiable. Lists return descriptions, get returns body + manifest, file-get returns one file. Never preload bundled files "just in case" — every preloaded script is wasted context for the actual task.
  2. Pick the smallest write primitive that does the job. A targeted edits or file_edits is cheaper, safer, and clearer in version history than a full body or full bundle replacement.
  3. Reads are cheap; concurrent overwrites are not. Always have a recent version from skill-get (or from the response of the previous write) before calling any write tool, and pass it as base_version.
  4. Authoring follows the Agent Skills spec. Keep name kebab-case, descriptions trigger-rich, body short, bulky material in bundled files.

Decision tree: which tool do I call?

Need to know what's available?
  └─► skill-list                    (names + descriptions only)

Need to use / inspect a specific skill?
  └─► skill-get                     (body + file manifest, NO file contents)
        └─► skill-file-get          (one file, on demand, only as referenced)

Authoring a brand new skill?
  └─► skill-create                  (body + all initial files in one call)

Editing an existing skill?
  ├─ Body change?
  │    ├─ Substantial rewrite ............. update(body=...)
  │    └─ Surgical tweak .................. update(edits=[{old, new}, ...])
  ├─ Bundled file content change?
  │    └─ update(file_edits=[{path, edits:[...]}, ...])
  ├─ Add / remove / rename a file?
  │    ├─ Add ............................. skill-file-create
  │    ├─ Delete .......................... skill-file-delete
  │    └─ Rename .......................... skill-file-rename
  └─ Wholesale bundle reset (rare!) ....... update(files=[...])  # replaces ALL files

Renaming the skill itself?
  └─► skill-rename                  (keeps versions, files, and owners)

Want a fork as the starting point?
  └─► skill-duplicate               (then update the copy)

Done with a skill entirely?
  └─► skill-archive                 (hides ALL versions; cannot be undone)

If you find yourself reaching for update(body=...) plus a sprawling files=[...] to change one paragraph and one script, stop — that's two narrower calls (update(edits=[...]) plus update(file_edits=[...])) or even a single update carrying both edits and file_edits.

Discover before you fetch

posthog:skill-list
{ "search": "fractal" }

skill-list is the right tool to "find a skill" — it returns names and descriptions only. Reading the descriptions is the entire point: pick the right skill before pulling any body. If search doesn't narrow it enough, list without it and scan, but do not start fetching candidate bodies blindly.

skill-get should be called once per skill per task, not per question. Cache the body in your working memory; fetch again only if you suspect the skill changed under you (e.g. a 409 on write — see "Concurrency" below).

Reading a large skill efficiently

Big skills (long body, many bundled files) are the case where lazy loading matters most.

  1. skill-get(skill_name=...) — read body + files[] manifest.
  2. Scan the body's table of contents / headings. The body should already tell you which file goes with which task — that's why bodies stay short and reference files by path.
  3. For each file the body explicitly points at for the current task, call skill-file-get(file_path=...). Skip everything else.
  4. If the body references "see scripts/X for the rare case Y" and you are not in case Y, do not fetch scripts/X.

When in doubt, fewer files. You can always fetch one more on the next turn.

Authoring a new skill

Use a single skill-create call with body and initial files — the skill lands at version: 1 complete. Do not create the skill empty and then make N follow-up skill-file-create calls; that's N extra versions and N extra round-trips for no benefit.

posthog:skill-create
{
  "nam
常见问题

为什么要避免重写整个技能?

小范围的定向编辑更安全,也更容易在版本历史中审查。

如果两个人同时编辑同一项技能怎么办?

技能包含版本检查,因此最近的改动不会被悄无声息地覆盖。

它会解释技能的格式吗?

会。它遵循 Agent Skills 规范,该规范使名称保持简单、描述保持清晰。

详情

作者的原始描述

Best practices for agents managing PostHog skills via the MCP `skill-*` tools — how to discover, read, create, update, and refactor skills efficiently, especially large skills with many bundled files. Use whenever you are about to call any `skill-*` tool, asked to author or edit a shared skill, or troubleshoot why a skill write was rejected. Also use when asked what skills are good for or how to shape one (project hub, runbook, catalog, handover, daily driver). Pairs with `skills-store` (which covers the raw tool surface) by adding the decision-tree, efficiency, pattern, and pitfall guidance.

repo: PostHog/posthog

热度

GitHub 星标
41k
排名
#6953
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能