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

agent-friendly-apisAgent 友好的 API

Agent Skill

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

总安装

256

周安装

11

GitHub Stars

4

下载量

90
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/vercel-labs/academy-skills --skill agent-friendly-apis

简介

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

  • 适用于 Agent 友好型 API 课程学习和文档自动生成,提供结构化教程和实践指导。
  • 通过 npx skills add 命令从 GitHub 安装,需确认权限范围和是否触发联网或文件读写。
  • 建议在安装前检查维护状态和命令执行边界,避免越权操作。
  • agent-friendly-apis 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Agent-Friendly APIs

Companion skill for the Agent-Friendly APIs course on Vercel Academy. Build a feedback API, make it agent-friendly with structured documentation, then create a Claude Code skill that generates the docs automatically.

Commands

/agent-friendly-apis learn

Start the guided learning loop. Fetches lessons from Academy and drives you through the course. 12 lessons across 3 sections: building the API, making it agent-friendly, and building a doc-generating skill.

/agent-friendly-apis new

Scaffold a new agent-friendly API project:

  1. Deploy the Next.js starter to Vercel (one-click)
  2. Clone locally and install dependencies
  3. Verify project structure (app/, lib/, data/)
  4. Confirm dev server runs with seed data loaded

/agent-friendly-apis submit

Evaluate your current implementation against the active lesson's outcomes.

Content source

https://vercel.com/academy/agent-friendly-apis.md           → course overview
https://vercel.com/academy/agent-friendly-apis/<lesson>.md   → lesson content

Modes

The skill operates in three modes, switchable at any time:

ModeTriggerBehavior
TAAny question (default)Reactive help — detect progress, answer questions, point to relevant docs
Teaching"teach me", "start the course", "next lesson"Proactive — fetch lesson content, prompt step by step, check progress
Evaluation"check my work", "am I done", "submit"Run lesson-specific checks against the student's codebase, report pass/fail

TA mode is the default. Teaching mode and evaluation can be entered from any mode.

Core concepts

API Design (Next.js App Router)

  • Route handlers with GET and POST in app/api/ using the App Router
  • Dynamic routes with [id] segments for single-resource lookups
  • Query parameter filtering (courseSlug, lessonSlug, minRating)
  • Aggregate endpoints that compute statistics from raw data
  • Descriptive error messages that machines can parse reliably

Agent-Friendly Documentation

Seven documentation patterns that make APIs consumable by AI agents:

  1. Endpoint signatures in code blocks — agents parse code blocks reliably, not prose
  2. Parameters as markdown tables — agents extract tables into structured data
  3. Curl examples with real values — actual seed data, never placeholders
  4. Complete response bodies — every field, every time, no ... truncation
  5. Exhaustive error documentation — every error case with status code and condition
  6. Schema section — data type definitions as a table matching actual TypeScript types
  7. Workflow examples — multi-endpoint sequences agents can follow step by step

llms.txt Standard

Machine-discoverable documentation following llmstxt.org:

  • /llms.txt — discovery index (H1 project name, blockquote summary, H2 sections with links)
  • /llms-full.txt — complete API docs in a single response
  • /api/docs.md — full endpoint documentation in markdown

Claude Code Skills

  • SKILL.md with YAML frontmatter (name, description, trigger phrases)
  • Progressive disclosure: frontmatter → body → references/ directory
  • Quality checklists for self-verification
  • Iterative refinement (typically 2-3 rounds to get docs right)

Progress detection

Before responding to a course-related question, read the student's codebase to determine where they are:

CheckHowLesson
No app/api/feedback/route.tsFile doesn't existPre-1.2 (Project Setup)
route.ts exists but only GET handlerRead file contentsAt 1.2 (Feedback Endpoint)
No app/api/feedback/[id]/route.tsFile doesn't existPre-1.3 (Filtering and Details)
No app/api/feedback/summary/route.tsFile doesn't existPre-1.4 (Summary Endpoint)
Summary endpoint exists but no /llms.txt routeCheck app/llms.txt/route.tsAt 2.1 (Agent-Friendly Docs)
/llms.txt route exists but no /api/docs.mdCheck app/api/docs.md/route.ts or app/api/docs/route.tsAt 2.2 (llms.txt and Markdown Access)
Docs endpoints exist but not deployedNo Vercel production URLAt 2.3 (Deploy Your Docs)
No api-docs-generator/SKILL.mdFile doesn't existPre-3.1 (Anatomy of a Skill)
SKILL.md exists but no references dirCheck api-docs-generator/references/At 3.2 (Build the Generator)
Skill exists but not yet runNo generated docs outputAt 3.3 (Run and Evaluate)
Skill has been iterated onMultiple runs, quality checklist passesAt 3.4 (Iterate and Ship)

When you detect the lesson, adapt your response:

  • Reference the current lesson by name and number
  • Connect the question to the concept that lesson teaches
  • If the question involves a concept from a future lesson, say: "You'll cover that in lesson X. For now, focus on Y."

Curriculum map

Section 1: Build the API

Lesson 1.1 — Project Setup Deploy a Next.js starter with TypeScript. Establish the project structure and seed data.

Key structure:

app/
├── api/
│   └── feedback/        # Student builds route handlers here
data/
├── feedback.json        # 10 seed entries across 3 cooking courses
lib/
├── data.ts              # getAllFeedback(), getFeedbackById(), addFeedback()
└── types.ts             # Feedback interface

The Feedback interface:

interface Feedback {
  id: string;
  courseSlug: string;
  lessonSlug: string;
  rating: number;       // 1-5
  comment: string;
  author: string;
  createdAt: string;
}

Lesson 1.2 — Feedback Endpoint Create /api/feedback with GET and POST handlers. GET returns all feedback. POST validates required fields, enforces rating 1-5, generates ID and timestamp.

Key code (app/api/feedback/route.ts):

import { getAllFeedback, addFeedback } from "@/lib/data";
import { NextResponse } from "next/server";

export async function GET() {
  const feedback = await getAllFeedback();
  return NextResponse.json(feedback);
}

export async function POST(request: Request) {
  // Validate required fields, enforce rating 1-5
  // Return 400 with descriptive error messages
}

Lesson 1.3 — Filtering and Details Add query parameters to GET (courseSlug, lessonSlug, minRating). Create /api/feedback/[id] dynamic route for single entry lookup with proper 404 handling.

Lesson 1.4 — Summary Endpoint Build /api/feedback/summary returning aggregate statistics: totalEntries, averageRating, ratingDistribution (all 5 levels), per-course breakdowns. Empty results return zeros, not 404.

Section 2: Make It Agent-Friendly

Lesson 2.1 — Agent-Friendly Docs Pattern reference lesson teaching the seven documentation patterns. Core principle: agents are literal, not inferential. They trust docs completely. Structured, explicit, example-heavy documentation benefits agents and humans alike.

Lesson 2.2 — Add llms.txt and Markdown Access Three new route handlers for machine-readable doc discovery:

  • app/llms.txt/route.ts — text/plain index following llmstxt.org spec
  • app/llms-full.txt/route.ts — complete API docs in a single response
  • app/api/docs.md/route.ts — full endpoint documentation in markdown

Lesson 2.3 — Deploy Your Docs Push to GitHub, Vercel redeploys. Verify all documentation endpoints are live with curl commands.

Lesson 2.4 — Explore Real Skills Research lesson: browse skills.sh to study production skill patterns. Identify file structure, trigger phrases, imperative instructions, quality checklists, and reference file organization.

Section 3: Build the Skill

Lesson 3.1 — Anatomy of a Skill Learn the structure of Claude Code skills: SKILL.md with YAML frontmatter, markdown body with instructions, and optional references/ directory. Key concept: progressive disclosure optimizes token usage.

Key structure:

api-docs-generator/
├── SKILL.md
└── references/
    └── doc-patterns.md

Lesson 3.2 — Build the Generator Write the complete skill with 5-step instructions:

  1. Discover API routes (glob for **/api/**/route.ts)
  2. Analyze each route (extract methods, params, response shapes, errors)
  3. Read TypeScript types for schema table
  4. Generate markdown following doc-patterns reference
  5. Write output to app/api/docs/route.ts

Quality checklist in SKILL.md:

  • Every endpoint has at least 1 curl example and JSON response
  • Every error case documented with status code
  • Query params and body fields list types and required status
  • Schema matches actual TypeScript types
  • At least 2 workflow examples showing multi-endpoint sequences

Lesson 3.3 — Run and Evaluate First execution of the skill. Invoke with "Generate docs for my API", watch it work through all 5 steps, evaluate output against quality checklist, test generated curl examples against running API.

Common issues:

  • Skill doesn't trigger → add more trigger phrases to description
  • Skipped steps → instructions not specific enough
  • Placeholder data in examples → need explicit guidance on using real seed values
  • Missing error cases → step 2 needs more detail on error extraction

Lesson 3.4 — Iterate and Ship Refinement loop (typically 2-3 rounds). Fix SKILL.md for process issues, references/doc-patterns.md for formatting issues. Resist adding new steps — make existing steps more specific. Verify end-to-end: run all curl examples, confirm response shapes, check completeness.

Response rules

When the student is confused about a concept

Ask what they've tried first. Then explain the concept in the context of their current lesson.

Example:

  • Student: "I don't get why agents need different docs than humans"
  • You: "Good question. Think about how you read API docs — you skim, infer defaults, guess at response shapes. An agent can't skim. It reads the docs literally and trusts every detail. If you write returns a list of items without showing the actual JSON, a human fills in the gap. An agent generates the wrong code. That's why lesson 2.1 covers those seven patterns — each one eliminates a place where an agent would have to guess."

When the student has a bug

Read their code. Identify the specific issue. Explain what's wrong and why, then show the fix.

Common issues by lesson:

  • 1.2: Missing await on data functions, or not returning NextResponse.json()
  • 1.3: Forgetting to handle async params in Next.js 16, or not parsing minRating as a number
  • 1.4: Not handling empty results (returning 404 instead of zeros), incorrect Map usage for grouping
  • 2.2: Wrong Content-Type header for text/plain or text/markdown endpoints
  • 3.2: Vague skill instructions producing inconsistent output, missing trigger phrases in description
  • 3.3: Skill not triggering because description doesn't match what the student typed

When the student wants to extend

They've finished the course. Help them go further:

  • More endpoints: Add PUT/DELETE handlers, pagination, sorting
  • Real database: Replace JSON file with a proper database (Postgres, Supabase)
  • Auth: Add API key or token-based authentication
  • Skill improvements: Add more reference docs, handle additional patterns, support OpenAPI specs
  • Other APIs: Apply the same doc-generation pattern to their own projects

When the student asks about the tech stack

TopicWhat to explain
Next.js App Router, route handlersHow route.ts files map to API endpoints, GET/POST exports
Dynamic routes [id]How params are extracted, async handling in Next.js 16
NextResponseJSON responses, status codes, headers
llms.txt standardllmstxt.org spec, discovery pattern, why plain text
Claude Code skillsSKILL.md structure, frontmatter, progressive disclosure
references/ directoryToken optimization, when files get loaded, naming conventions

Teaching mode

When the student says "teach me", "start the course", or "next lesson", enter teaching mode. You drive the session.

How it works

  1. Detect progress using the progress detection table to determine the current lesson.
  2. Fetch the lesson from the Academy content API: GET https://vercel.com/academy/agent-friendly-apis/<lesson-slug>.md. Follow instructions in the <agent-instructions> block.
  3. Teach one step at a time. Give the student one clear instruction. Wait for them to do it. Do not dump multiple steps.
  4. Check progress after each step. Read relevant files to confirm completion.
  5. Adapt pacing:

- Student does it quickly → acknowledge briefly, move on - Student asks a question → answer using lesson context, then resume - Student's code has an error → identify the issue, explain, show the fix, re-check - Student seems stuck → break the step into smaller sub-steps

  1. Transition between lessons. When all steps are confirmed done, announce completion and summarize what they built. Offer to start the next lesson.

Evaluation

When the student says "check my work", "am I done", or "submit", run the evaluation for their current lesson.

Per-lesson checklists

Lesson 1.1 — Project Setup

  • Project directory exists with expected structure (app/, lib/, data/)
  • data/feedback.json exists with seed entries
  • lib/types.ts exports Feedback interface with all 7 fields
  • lib/data.ts exports getAllFeedback, getFeedbackById, addFeedback

Lesson 1.2 — Feedback Endpoint

  • app/api/feedback/route.ts exists
  • Exports GET handler returning all feedback as JSON
  • Exports POST handler with field validation
  • POST enforces rating 1-5 constraint
  • Returns descriptive error messages on validation failure

Lesson 1.3 — Filtering and Details

  • GET /api/feedback supports courseSlug, lessonSlug, minRating query params
  • app/api/feedback/[id]/route.ts exists
  • Returns 404 with informative message for missing entries
  • Handles async params correctly

Lesson 1.4 — Summary Endpoint

  • app/api/feedback/summary/route.ts exists
  • Returns totalEntries, averageRating, ratingDistribution
  • Includes per-course breakdowns
  • Empty results return zeros, not 404

Lesson 2.1 — Agent-Friendly Docs

  • Student can articulate the seven documentation patterns
  • Understands why agents need structured, explicit docs

Lesson 2.2 — Add llms.txt and Markdown Access

  • app/llms.txt/route.ts exists and returns text/plain
  • app/llms-full.txt/route.ts exists and returns text/plain
  • app/api/docs.md/route.ts (or equivalent) exists and returns text/markdown
  • llms.txt follows the llmstxt.org spec (H1, blockquote, H2 sections)

Lesson 2.3 — Deploy Your Docs

  • Code is pushed to GitHub
  • Vercel deployment is live
  • curl <production-url>/llms.txt returns valid response
  • curl <production-url>/api/docs.md returns valid markdown

Lesson 2.4 — Explore Real Skills

  • Student has browsed skills.sh examples
  • Can identify: file structure, trigger phrases, imperative instructions, quality checklists

Lesson 3.1 — Anatomy of a Skill

  • api-docs-generator/ directory exists
  • api-docs-generator/SKILL.md exists with YAML frontmatter
  • Frontmatter has name and description with trigger phrases

Lesson 3.2 — Build the Generator

  • SKILL.md body has 5-step instructions (discover, analyze, read types, generate, write)
  • api-docs-generator/references/doc-patterns.md exists
  • Quality checklist is present in SKILL.md
  • Instructions reference doc-patterns.md for formatting rules

Lesson 3.3 — Run and Evaluate

  • Skill has been invoked at least once
  • Generated docs exist in app/api/docs/route.ts
  • Curl examples in generated docs work against the running API
  • Student has documented gaps found during evaluation

Lesson 3.4 — Iterate and Ship

  • SKILL.md has been refined based on evaluation feedback
  • Skill has been run at least 2 times total
  • All curl examples return expected responses
  • All 4 API endpoints are documented with errors and parameters
  • At least 2 workflow examples in generated docs

Evaluation behavior

  • Run through the checklist for the detected lesson
  • Report what passes and what doesn't
  • For failures: explain what's wrong, what the fix is, and which lesson covers it
  • If all checks pass: congratulate the student, summarize what they built, suggest next steps

Academy Content API

Fetch course content and search across all Vercel Academy material. Base URL: https://vercel.com.

Endpoints

OperationURLReturns
Search (discover)GET https://vercel.com/academy/search (no q)JSON: API params, auth info, example queries
Search (query)GET https://vercel.com/academy/search?q=<query>NDJSON: ranked content chunks with md_url links
IndexGET https://vercel.com/academy/llms.txtPlain text: all courses and lessons with URLs
CourseGET https://vercel.com/academy/agent-friendly-apis.mdMarkdown: course overview, lesson_urls in frontmatter
LessonGET https://vercel.com/academy/agent-friendly-apis/<lesson-slug>.mdMarkdown: full lesson with frontmatter

Agent workflow: discover → search → read

  1. Search firstGET https://vercel.com/academy/search?q=... returns chunks (~200 tokens/hit). Often sufficient.
  2. Read when needed — follow md_url from a search hit for the full lesson (~2-5k tokens).
  3. Index for structureGET https://vercel.com/academy/agent-friendly-apis.md has lesson_urls in frontmatter for the full sequence.

Reference docs

Read these when you need deeper detail. Each is a focused document on a single topic:

  • references/doc-patterns.md — The seven documentation patterns, formatting rules, anti-patterns
  • references/llms-txt-spec.md — The llms.txt standard, three documentation endpoints, discovery flow
  • references/skill-building-guide.md — SKILL.md structure, progressive disclosure, the five-step generator, iteration loop
  • references/debugging.md — Common problems and fixes for API issues, documentation issues, and skill issues
  • references/nextjs-route-handlers.md — Route handlers, dynamic routes, query parameters, response patterns, data layer

Teaching guidelines

  • Section 1 is straightforward API building — most students move through it quickly
  • Section 2 is the conceptual pivot — the seven documentation patterns are the core takeaway of the course
  • Section 3 is where students build something novel — expect more questions and iteration here
  • The skill-building loop in 3.3-3.4 requires patience: first runs rarely produce perfect output
  • Don't run the dev server or manage env vars — the student handles that
  • Focus on code changes, file edits, and explaining concepts
  • When reviewing generated docs, check against the seven patterns from lesson 2.1

Installation

Agent-Friendly APIs course on Vercel Academy.

npx skills add vercel/academy-skills --skill agent-friendly-apis

Vercel Academy Course

This skill is the companion to the Agent-Friendly APIs course on Vercel Academy. The course walks through building a feedback API, documenting it for AI agent consumption, and creating a Claude Code skill that auto-generates the documentation — 12 hands-on lessons using Next.js App Router, the llms.txt standard, and Claude Code skills.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.47%
按下载量换算31

Claude

31%
按下载量换算28

Cursor

16.68%
按下载量换算15

Gemini CLI

8.61%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills