Agent 生成器
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- 数据
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- Docker
- 底层运行要求
- Docker
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: agent-instruction-forge
description: Guide humans through creating effective instruction rules for coding agents (Copilot, Claude Cod…
category: 数据
runtime: Docker
---
# agent-instruction-forge 输出预览
## PART A: 任务判断
- 适用问题:表格、CSV、数据集、指标或分析流程。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Seven Properties of a Great Rule / Rules Should NOT Contain / PHASE 1 — Codebase Discovery (Automated)”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于表格、CSV、数据集、指标或分析流程,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Seven Properties of a Great Rule / Rules Should NOT Contain / PHASE 1 — Codebase Discovery (Automated)”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“Seven Properties of a Great Rule / Rules Should NOT Contain / PHASE 1 — Codebase Discovery (Automated)”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: agent-instruction-forge
description: Guide humans through creating effective instruction rules for coding agents (Copilot, Claude Cod…
category: 数据
source: tomevault-io/skills-registry
---
# agent-instruction-forge
## 什么时候使用
- 把数据处理方向的常用动作沉淀成 Agent 可调用的技能 适合处理表格、CSV、指标、数据集、分析和可视化报告,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步…
- 面向表格、CSV、数据集、指标或分析流程,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Seven Properties of a Great Rule / Rules Should NOT Contain / PHASE 1 — Codebase Discovery (Automated)」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "agent-instruction-forge" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Seven Properties of a Great Rule / Rules Should NOT Contain / PHASE 1 — Codebase Discovery (Automated)
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Docker | 读取文件、写入/修改文件 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Agent Instruction Forge
Exceptional agent instructions encode specific implicit knowledge, not generic advice. Generic rules ("write clean code") hurt performance (ETH Zurich 2024: LLM-generated context files reduce success ~3%). What works: non-obvious knowledge every team member carries but no file says.
Modes (detected in Phase 1):
- Greenfield: No instruction files. Read codebase, extract, synthesize.
- Augment: Files exist. Audit, validate against code, fill gaps, strengthen.
- Interview-Only: No codebase access. Skip Phase 1 Steps 2-4. Lean on Failure Round + Resource Ingestion. Flag: "Can't validate against code — file paths need manual verification."
Seven Properties of a Great Rule
Specific & falsifiable — agent can verify compliance. Unfailable = not a rule.
"Write clean code"→"Every external API call must return Result<T, AppError>, never throw."Encodes WHY — without rationale, agents optimize around rules.
"Don't use console.log"→"Use src/lib/logger.ts — console.log bypasses Datadog correlation IDs."Born from real failure — past pain produces specificity.
"Never add indexes to reservations table without DBA approval — Q2 2024 compound index locked table 47min."Scoped correctly — highest directory where universally true. Test: "Applies to ALL code agent sees in this directory?" If not, push deeper.
Points to canonical example.
"New endpoints follow src/api/reservations/create.ts — handler → validation → service → response."Includes anti-pattern — overrides training priors when codebase deviates.
"We do NOT use repository pattern. Services call Prisma directly."Token-efficient.
"When writing tests, please make sure to use Vitest and not Jest."→"Tests: Vitest, never Jest."
Rules Should NOT Contain
- Things fixable in code (better type signature, clearer name, linter rule)
- Things linting already enforces
- Language documentation (agent knows the language)
- Obvious patterns derivable from reading the code
- Aspirational rules nobody follows (document reality unless explicitly marked aspirational)
PHASE 1 — Codebase Discovery (Automated)
Read codebase before asking anything. Don't ask what code already answers.
Step 1: Discover instruction infrastructure
Scan: AGENTS.md, CLAUDE.md, GEMINI.md, .cursorrules, .windsurfrules, .github/copilot-instructions.md, .github/instructions/*.instructions.md, .github/prompts/*.prompt.md, .context/, .ctx, README.md, ARCHITECTURE.md, CONTRIBUTING.md, ADR dirs, formatter/linter configs, tsconfig/pyproject.toml, Makefile/justfile, CI/Docker configs.
For each file: topics, staleness, format/tone.
Step 2: Codebase topology
Map: languages, frameworks, package managers, directory structure (2-3 levels), entry points, test structure, external integrations.
Step 3: Pattern extraction
Sample 3-5 files from most-modified directories (git log --stat or inferred from size/complexity). Detect: naming, error handling, import organization, logging, test patterns.
Step 3b: History mining (if git/PR available)
git log for reverts, migrations, convention enforcement, hotfixes — each encodes an implicit rule. Keywords: convention, instead, revert, breaking, deprecated, don't.
PR access (gh pr list --state merged --limit 30): scan review corrections ("nit:", "use X instead"), architectural rationale in descriptions, repeated feedback. Capture: source, candidate rule, category (C1-C9), confidence.
If unavailable: ask in Phase 2: "Patterns you correct repeatedly in reviews but aren't documented?"
Step 4: Rule Audit (Augment Mode Only)
For each existing rule:
- Seven Properties Score (0-7). Flag <=2. P1 failure (specific/falsifiable) = noise regardless of other scores.
- Code Alignment: Confirmed | Stale | Aspirational | Contradicted | Unverifiable
- Coverage: C1 Architecture, C2 Domain/Business, C3 Conventions, C4 Integrations, C5 Operations, C6 Testing, C7 Security, C8 Performance, C9 Historical Decisions
- Redundancy: duplicated by lint/types/CI? Contradicts other rules?
- Scope: over-scoped (push down), under-scoped (pull up), wildcard abuse, missing intermediate levels
Output:
Rule | Score | Alignment | Scope | Verdict (Keep/Rewrite/Verify/Remove/Re-scope)
Summary: N total → keep[n] rewrite[n] verify[n] remove[n] re-scope[n]
Coverage: C1[●/◐/○] ... C9[●/◐/○]
Token budget: ~[current] / [limit] — headroom: [remaining]
Scope health: [N] correct, [N] over-scoped, [N] under-scoped
Step 5: Discovery Brief
- Greenfield: target system, what code reveals, top candidate rules from history, highest-value gaps
- Augment: rule health summary, top issues, undocumented rules from history, coverage gaps
Verify: any "remove" rules actually important? "Confirmed" rules outdated? Which history-surfaced rules are real conventions? Which gaps matter most?
PHASE 2 — Knowledge Extraction (Interactive)
2-4 questions per round. Don't dump 20.
In Augment mode, weave three workstreams:
- Verify flagged rules: "This rule says [X]. Still accurate?"
- Fill coverage gaps: skip well-covered categories, focus on empty ones
- Strengthen weak rules: "Why? What goes wrong otherwise?" / "File that best exemplifies this?"
Prioritize areas where (a) agent writes code most often, (b) code is most ambiguous, (c) existing rules are weakest.
Round 1 — Failures (Always Start Here)
Highest-signal source. Ask 2-4:
- "Last time a developer (human or AI) made a frustrating mistake — what happened, what should they have done?"
- "Landmines where the obvious approach leads to subtle bugs?"
- "Most common mistake from new team members?"
- "Recurring annoyances in agent-generated code you fix every time?"
Probe: "Point me to a file?" / "Correct version?" / "Why this way?"
Round 2 — Conventions
Where codebase deviates from framework defaults — where agent training priors mislead.
- "Where does your codebase intentionally deviate from the framework's recommended approach?"
- "Patterns you enforce in code review that linting/CI doesn't catch?"
- "One rule that eliminates 50% of review nit-picks?"
Round 3 — Architecture
Module boundaries, data flow, where new code goes.
- "How should an agent decide which module/directory new code goes in?"
- "Files that shouldn't be modified without extra caution?"
- "How does data flow for the most common operation?"
Round 4 — Integrations (if external services detected)
API quirks, dependency approval process, wrapper conventions.
Round 5 — Testing
Philosophy, patterns to follow/avoid, mock boundaries.
Round 6 — Resource Ingestion (optional)
"Any existing resource I should read? (Wiki, ADR, Slack thread, postmortem)" — extract using Seven Properties.
Adapt by: codebase type (frontend→components, backend→endpoints), team size (solo→future-self, large→consistency), agent system (Copilot→completion-level, Claude Code→task-level), human energy (target 15-20 min).
PHASE 3 — Synthesis
Greenfield Mode
# [Project] — Agent Instructions
## Philosophy — [2-3 sentences anchoring judgment]
## Critical Rules — [violations break things: what + why + anti-pattern]
## Conventions — [review friction: pattern + example file]
## Architecture — [boundaries, data flow, where new code goes]
## Testing — [philosophy + patterns + mock boundaries]
Augment Mode
Do NOT rewrite from scratch. Produce a reviewable changeset:
- Remove low-signal rules
- Rewrite rules in place, preserving grouping/tone
- Add rules for coverage gaps
- Re-scope rules to appropriate directory
- Show delta from Phase 1
Per edit: what changed, why. Include before/after example.
Both Modes
- Scope: root=universal, package-level=local,
applyToglobs only when truly file-type-specific - Every rule specific and falsifiable (P1)
- Order by impact (critical first — long files may truncate)
- Match existing format/tone in augment mode
Token Budgets
| System | Unit | Root limit | Notes |
|---|---|---|---|
| Copilot | chars | <1000 lines | Code review reads first 4000 chars/file |
| Claude Code | tokens | <4000 | Subdir: <1000 tokens |
| Cursor/Windsurf/AGENTS.md | tokens | ~4000 | Similar to Claude Code |
When WHY and brevity conflict, keep WHY. Main lever: scope rules down to reduce root file size.
PHASE 3b — Adversarial Validation
Before showing rules, stress-test with three isolated subagents receiving ONLY the synthesized file. Read references/adversarial-validation.md for prompts.
Run in parallel:
- Newcomer — finds gaps
- Prior Override — checks rules beat common training priors
- Contradiction Finder — finds conflicts and ambiguities
Update rules. Include summary of gaps, weak spots, resolved contradictions.
PHASE 4 — Review & Delivery
Present rules. Iterate on feedback.
Write to target:
| System | Files |
|---|---|
| Copilot | .github/copilot-instructions.md (repo-wide) + .github/instructions/NAME.instructions.md (scoped) + .github/prompts/NAME.prompt.md |
| Claude Code | CLAUDE.md (root + subdirs) |
| Cursor | .cursorrules |
| Windsurf | .windsurfrules |
| Generic | AGENTS.md (root + subdirs) |
If target unclear, ask. If multiple, generate for primary. Copilot always uses three-layer structure.
After delivery: suggest running agent on a real task. Next mistake = next rule. Revisit monthly.
Source: AndurilCode/craftwork — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核