Agent Skills › crbnos/carbon › create-agents-md

create-agents-md

GitHub

根据源代码生成或刷新 AGENTS.md,确保所有声明均通过 grep 验证并追溯至真实函数、表或导出。适用于新增模块/包、审计发现过时文档或显式请求场景。

.claude/skills/create-agents-md/SKILL.md crbnos/carbon

Trigger Scenarios

添加新模块或包时 AGENTS.md 被标记为过时 显式请求生成或刷新文档

Install

npx skills add crbnos/carbon --skill create-agents-md -g -y
More Options

Non-standard path

npx skills add https://github.com/crbnos/carbon/tree/main/.claude/skills/create-agents-md -g -y

Use without installing

npx skills use crbnos/carbon@create-agents-md

指定 Agent (Claude Code)

npx skills add crbnos/carbon --skill create-agents-md -a claude-code -g -y

安装 repo 全部 skill

npx skills add crbnos/carbon --all -g -y

预览 repo 内 skill

npx skills add crbnos/carbon --list

SKILL.md

Frontmatter
{
    "name": "create-agents-md",
    "description": "Create or refresh an AGENTS.md for a Carbon package or ERP module by reading the actual source code — every claim traced to a real function, table, or export. Use when adding a new module\/package, when the conductor's freshness audit or \/self-review flags a stale AGENTS.md, or on explicit request. Do not write an AGENTS.md from memory or by copying a sibling's content."
}

create-agents-md — generate or refresh an AGENTS.md

Produce a prescriptive AGENTS.md grounded in source. Every claim MUST trace to a real function name, table name, import path, or file — grep and verify; never describe what "might" exist.

Announce at start: "Using the create-agents-md skill — generating/refreshing the AGENTS.md for {target}."

Step 1: Identify the target

  • Package: packages/{name}/ → budget ≤100 lines
  • Module: apps/erp/app/modules/{name}/ → budget 60–100 lines

Step 2: Read the actual source

# Module:
ls apps/erp/app/modules/{name}/
grep -n "^export" apps/erp/app/modules/{name}/{name}.service.ts
grep -n "export const.*=.*z\." apps/erp/app/modules/{name}/{name}.models.ts
grep -rn "\.from(" apps/erp/app/modules/{name}/{name}.service.ts | sed 's/.*\.from("\([^"]*\)").*/\1/' | sort -u
grep -rn "\.rpc(" apps/erp/app/modules/{name}/ | sed 's/.*\.rpc("\([^"]*\)".*/\1/' | sort -u
grep -rn "requirePermissions" apps/erp/app/routes/x+/{name}* | head -10

# Package:
ls packages/{name}/src/
cat packages/{name}/src/index.ts
cat packages/{name}/package.json | jq '.exports'

Step 3: If refreshing, read the existing file

  • Preserve human-added notes, warnings, and domain explanations.
  • Update stale function/table/import names (verify each with grep).
  • Add new exports/tables/patterns; remove references to deleted code.

Step 4: Read the relevant rules

Find the .claude/rules/ files that govern this area (via the root AGENTS.md Task Router) and reference them in the Rules References section — only files that actually exist.

Step 5: Write it

Module template

# {Module Name} Module

{One line: what this module does in the ERP domain.}

## Key Domain Concepts
{3–6 terms a non-manufacturing AI needs. **Term** — plain-English definition.
 Include status lifecycles.}

## Safety
### Always
- MUST {do X} — `{function/table}` depends on it.   {3–5 rules, grounded}
### Ask First
- {action} — {why risky}.                            {2–3 items}
### Never
- {action} — {what breaks}.                          {2–3 items}

## Validation Commands
```bash
pnpm exec turbo run typecheck --filter=erp
pnpm --filter erp test
```

## Key Data Model
| Table / View | Purpose |
|---|---|

## Key Service Functions
- `{functionName}` — {what it does}   {only what another module would call}

## Copy From   {OPTIONAL — only if this module is a good template}
| To build… | Copy from… | Then change… |

## Related Modules
- **{module}** — {integration point}

## Rules References
- `.claude/rules/{file}.md` — {what it covers}

Package template

# @carbon/{name}

{One line.}

## Always / Ask First / Never
{Same shape as the module template.}

## Validation Commands
```bash
pnpm --filter @carbon/{name} typecheck
pnpm --filter @carbon/{name} test
```

## Key Exports
| Subpath | Provides |
|---------|----------|
| `.` | {…} |          {real subpaths from package.json exports}

## Cross-References
{rules, related packages, consuming apps}

Done when — verify each line

  • Every function name exists: grep -n "export.*{name}" {file} hits
  • Every table name exists: grep in the service file hits
  • Every import path is real (check the barrel / exports field)
  • Every referenced .claude/rules/ file exists
  • Tone is prescriptive ("MUST use X"), not descriptive ("X is used")
  • Line count within budget; no {placeholder} / TBD left
  • Modules: Key Domain Concepts present; Never section present
  • Refresh: human-added notes preserved

Anti-patterns

  • Listing functions you didn't grep for (renamed/deleted ones will lie)
  • Abstract architecture prose ("uses a service layer" says nothing)
  • Copying a sibling AGENTS.md and renaming — every module has different tables, functions, and concepts
  • Vague bullets: "Services handle data access" ❌ vs "MUST use insertManualInventoryAdjustment for quantity changes — it creates ledger entries and updates tracked entities" ✅

Version History

  • dd8f587 Current 2026-08-20 16:17

Same Skill Collection

.claude/skills/agent-browser/SKILL.md
.claude/skills/auth/SKILL.md
.claude/skills/debugging-difficult-bugs/SKILL.md
.claude/skills/error/SKILL.md
.claude/skills/execute/SKILL.md
.claude/skills/make-interfaces-feel-better/SKILL.md
.claude/skills/plan/SKILL.md
.claude/skills/pr-explainer/SKILL.md
.claude/skills/pr-splitter/SKILL.md
.claude/skills/research/SKILL.md
.claude/skills/resolving-merge-conflicts/SKILL.md
.claude/skills/root-cause/SKILL.md
.claude/skills/rust-best-practices/SKILL.md
.claude/skills/smoke-test/SKILL.md
.claude/skills/supabase-postgres-best-practices/SKILL.md
.claude/skills/tdd/SKILL.md
.claude/skills/test-driven-development/SKILL.md
.claude/skills/test/SKILL.md
.claude/skills/writing-skills/SKILL.md
.claude/skills/carbon-design/SKILL.md
.claude/skills/carbon-docs/SKILL.md
.claude/skills/changelog-entry/SKILL.md
.claude/skills/check-and-commit/SKILL.md
.claude/skills/explain/SKILL.md
.claude/skills/feature/SKILL.md
.claude/skills/fix/SKILL.md
.claude/skills/grill/SKILL.md
.claude/skills/improve/SKILL.md
.claude/skills/inngest/SKILL.md
.claude/skills/rust/SKILL.md
.claude/skills/self-review/SKILL.md
.claude/skills/spec-writing/SKILL.md
.claude/skills/translate/SKILL.md
.claude/skills/ui/SKILL.md

Metadata

Files
0
Version
f9d7efd
Hash
c179edaf
Indexed
2026-08-20 16:17

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-24 13:52
浙ICP备14020137号-1