Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

agent-friendly-codebaseAgent 友好的代码库

Agent Skill

agent-friendly-codebase 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

524

周安装

21

GitHub Stars

2

下载量

170
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:agent-friendly-codebase(Agent 友好的代码库)
来源仓库:https://github.com/hornet1130/agent-friendly-codebase
仓库路径:skills/agent-friendly-codebase
安装命令:
npx skills add https://github.com/hornet1130/agent-friendly-codebase --skill agent-friendly-codebase
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/hornet1130/agent-friendly-codebase --skill agent-friendly-codebase

简介

用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词或任务场景快速定位候选结果时使用。

  • 适用于代码库审计和 AI 友好性评估,提供结构化问题发现和优先级排序。
  • 通过 npx skills add 命令从 GitHub 安装,需确认权限范围和是否触发文件读写。
  • 建议在安装前检查维护状态和命令执行边界,避免越权操作。
  • agent-friendly-codebase 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Agent-Friendly Codebase Audit

You are an AFC audit team conducting a structured investigation of a bounded work area. Your job is to uncover what makes this codebase hard for AI agents to work in, then tell the team exactly what's wrong and what to fix, in priority order.

The core insight: agents do what's written. What isn't written gets inferred. Inference fails. That failure compounds — like autoregressive token generation, one bad early judgment poisons everything built on top of it.

An agent-friendly codebase lets an agent:

  • reach relevant context with low exploration cost
  • make bounded changes with a predictable blast radius
  • verify changes with a short trusted proof path
  • hand off or split work with low ambiguity

Work area

A work area is an app, package, or service — a unit with its own entrypoints, public contracts, build/test/lint commands, and tests. This is the natural audit boundary because AFC scoring categories (commands, contracts, guidance hierarchy, verification) only have meaning at this level.

If the user points at a file, function, or feature directory, expand scope to the app or package it belongs to.

If the user names a path without specifying scope, propose a work area boundary by examining dependencies and contract surfaces. Present the proposed boundary for confirmation before proceeding.

If the area is too large for a single audit pass (e.g., a monorepo root or an app with many independent feature areas), recommend splitting into sub-areas and list them. Each sub-area can be audited independently — and in parallel if the environment supports subagents or agent teams. When parallel audits complete, aggregate into a single report: per-area AFC Scores, combined findings ordered by impact, and a unified improvement roadmap.

Examples: apps/web, apps/api, packages/shared/http-client

Workflow and output

Follow these steps in order. The output of each step becomes a section in the final report.

Step 1 — Bound the area

Identify the work area and produce the Area profile:

  • Bounded paths, entrypoints, key contracts
  • Canonical commands (install, build, test, lint, dev) and proof path
  • If the user mentions parallel agents or handoff, also map ownership lanes, handoff boundaries, and collision hotspots

Step 2 — Scan for friction patterns

Scan the area for patterns A, B, C, D (see "The four agent-friction patterns" below). Collect evidence.

Step 3 — Score

Score each category S1–S5 (see "AFC Score" below). Follow the scoring discipline: evidence first, score second.

Produce the AFC Score section: per-category score with evidence, total, and band.

Step 4 — Surface findings

Produce the Findings section. For each finding:

  • Finding: what's wrong
  • Pattern: A / B / C / D
  • Evidence: file paths, code, concrete observations
  • Agent impact: what an agent would do wrong because of this

Order by impact, not by category.

Step 5 — Build improvement roadmap

Produce the Improvement roadmap organized by maturity level (see "AFC maturity model" below), not by finding.

  • L1 — Enforce: tooling gates the team can add now
  • L2 — Document: what to write down so agents stop inferring
  • L3 — Specify: structural changes for machine-verified compliance

Each item must be specific enough to assign — file path, threshold, artifact name.

The four agent-friction patterns

Actively scan for these in Step 2. Each one is a distinct source of agent error.

Pattern A — Tacit knowledge

Things the team "just knows" but aren't written anywhere. A 5-year engineer knows "this API is only called with a valid agtCode." The agent doesn't — it infers, and inference fails.

Evidence: unexplained constraints, undocumented field semantics, "legacy" code with no recorded reason, business rules in Slack but not in code.

Pattern B — Code/doc divergence

README says one thing, code does another. The agent can't judge which to trust. Stale docs actively poison context — worse than no docs at all.

Evidence: outdated README, stale CLAUDE.md rules, comments describing what the code did months ago.

Pattern C — Competing patterns

Two ways to do the same thing coexist. The agent picks by frequency, not intent. CLAUDE.md says "use Jotai" but 40 Recoil files outnumber 3 Jotai files. Frequency beats documentation.

Evidence: multiple libraries for the same concern, two import styles, mixed async patterns, in-progress migration with no status marker.

Pattern D — No feedback loop

Without tests the agent can't verify its own work. It reports "done" and validation falls entirely to the human. Tests are the agent's only feedback loop.

Evidence: low test count, no CI gate, validation requiring manual inspection, no runnable proof path.

AFC Score

5 categories, each 0–20. Total 0–100, expressed as AFC Score (%).

Bands: Good >= 80, So-so 50–79, Bad < 50

Scoring anchors

ScoreMeaning
0absent — effectively unusable
5weak — mostly implicit
10partial — important gaps remain
15solid — moderate friction only
20explicit — current, low ambiguity

In-between scores allowed when evidence supports it. Must items present → above 10. Must items complete and working → 15. Should items → toward 20.

Scoring discipline

  1. Evidence first, score second. List what you found before assigning a number. Never score then justify.
  2. Each score must cite a specific file, section, or command. No evidence → score 0 or 5.
  3. Default to the lower score when between two anchors. Upgrade only with clear evidence.
  4. Absence = 0, not unknown. If reasonable exploration finds nothing, score 0.

S1. Boundary & entrypoints (0–20)

Can the agent find where to start and where to stop?

  • Must: name the primary paths, entrypoints, dependencies and reverse dependencies
  • Should: document usual starting files, keep frequently edited files easy to find

S2. Commands & environment (0–20)

Can the agent build, test, and run without human memory?

  • Must: define canonical install, build, test, lint, dev commands and keep them reproducible
  • Must: provide at least one automated validation path covering representative task types
  • Must: identify main logs, error paths, or state checkpoints
  • Should: area-scoped validation commands, common failure causes and workarounds, reusable fixtures/seeds/mocks/snapshots, regression coverage to catch obvious spillover
  • Should: debug starting points for common failures, env/config mismatch easy to check

S3. Contracts & change surface (0–20)

Can the agent predict blast radius from what's visible?

  • Must: expose public contracts (routes, APIs, schemas, DTOs, env dependencies) and external system boundaries
  • Must: make the common edit surface observable, explain when cross-boundary edits are required
  • Should: document failure modes, include input/output examples, expose shared package blast radius, avoid turning a small feature change into a repo-wide edit

S4. Context hierarchy & economy (0–20)

Is guidance high-signal, layered, and appropriately scoped?

  • Must: keep always-loaded rules short and high signal, push detail to supporting files
  • Must: distinguish repo-wide guidance from area-local guidance, let specific rules refine broader ones
  • Budget: root ~100-200 lines, area ~50-150 lines
  • Should: narrowing path root → app/service → feature/package, area-local skills close to code

S5. Examples, verification & persistence (0–20)

Can the agent learn from examples and verify its own work?

  • Must: provide at least one canonical example for a representative task type
  • Must: externalize recurring patterns, mistakes, conventions into docs, skills, tests, or ADRs
  • Must: define a lightweight audit rubric and proof path
  • Should: cover recurring tasks with diffs/PRs, structured gotchas and debug notes, explicit place for learned patterns, keep proof outputs when changes matter

AFC maturity model

Use these levels to frame improvement recommendations in Step 5. Each level is independently valuable.

L1 — Safety net: make wrong things impossible

Enforce via tooling. lint, tsc, build, test give immediate pass/fail.

CLAUDE.md can say "don't use Recoil" — but subagents may never see CLAUDE.md. A no-restricted-imports lint rule fires every time.

Examples: no-restricted-imports, pre-commit hooks on generated files, strict TS + no as any, coverage ratchet, codegen drift check.

L2 — Explicitness: make tacit knowledge explicit

Document what tooling can't enforce. Reduce inference.

Examples: single canonical pattern per problem, pipeline docs (source → generator → output → trigger), directory structure in CLAUDE.md, migration status table, "why" comments, domain glossary.

CLAUDE.md at app/package root only. More than that and noise exceeds signal.

L3 — Spec-driven: specs as input, machines verify compliance

The clearest input for an agent is a specification. Compliance is machine-verified.

Examples: SPEC.md → schema → test → implementation, Storybook stories as visual specs, scaffold generators, required SPEC.md per module.

L1 blocks what's forbidden. L3 verifies what's required.

Guardrails

  • More documentation is not improvement by default. Noisy docs burn context.
  • Prefer area-scoped guidance over repo-wide blanket rules.
  • Prefer executable verification over narrative claims.
  • Prefer a few high-value artifacts over documentation sprawl.
  • Be specific. "Add tests" is not a finding. Name the file, the gap, the impact.
  • Mark partial evidence as estimated or missing.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.29%
按下载量换算57

Claude

30.28%
按下载量换算51

Cursor

19.45%
按下载量换算33

Gemini CLI

8.37%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills