重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
agents-md-generator by julianromli/ai-skills
npx skills add https://github.com/julianromli/ai-skills --skill agents-md-generator为 AI 编码智能体生成层次化的 AGENTS.md 结构,优化以减少令牌使用。
分析并报告:
apps/web, apps/api, apps/mobile)
* 服务 (services/auth, services/transcribe)
* 包 (, )
* 工作进程 (, )广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
packages/uipackages/sharedworkers/queueworkers/cron在生成文件前,以结构化地图形式呈现。
创建轻量级根目录文件(约 100-200 行):
# 项目名称
## 项目概览
[3-5 行:仓库类型、技术栈、关于子 AGENTS.md 文件的说明]
## 根目录设置命令
[5-10 行:安装、构建所有、类型检查所有、测试所有]
## 通用约定
[5-10 行:代码风格、提交格式、分支策略、PR 要求]
## 安全与密钥
[3-5 行:切勿提交令牌、.env 模式、PII 处理]
## 即时索引
### 包结构
- Web UI: `apps/web/` -> [参见 apps/web/AGENTS.md](apps/web/AGENTS.md)
- API: `apps/api/` -> [参见 apps/api/AGENTS.md](apps/api/AGENTS.md)
### 快速查找命令
- 搜索函数:`rg -n "functionName" apps/** packages/**`
- 查找组件:`rg -n "export.*ComponentName" apps/web/src`
- 查找 API 路由:`rg -n "export const (GET|POST)" apps/api`
## 完成定义
[3-5 行:PR 前必须通过的事项]
为每个主要包创建详细的 AGENTS.md:
# 包名称
## 包标识
[2-3 行:功能、主要技术]
## 设置与运行
[5-10 行:安装、开发、构建、测试、代码检查命令]
## 模式与约定
[10-20 行 - 最重要的部分]
- 文件组织规则
- 命名约定
- 包含实际文件路径的示例:
- 正确做法:使用 `src/components/Button.tsx` 中的模式
- 错误做法:像 `src/legacy/OldButton.tsx` 这样的类组件
- 表单:复制 `src/components/forms/ContactForm.tsx`
- API 调用:参见 `src/hooks/useUser.ts`
## 关键文件
[5-10 行:理解包所需的重要文件]
- 认证:`src/auth/provider.tsx`
- API 客户端:`src/lib/api.ts`
- 类型:`src/types/index.ts`
## 即时索引提示
[5-10 行:针对此包的搜索命令]
- 查找组件:`rg -n "export function .*" src/components`
- 查找钩子:`rg -n "export const use" src/hooks`
- 查找测试:`find . -name "*.test.ts"`
## 常见陷阱
[3-5 行,如适用]
- "客户端认证需要 NEXT_PUBLIC_ 前缀"
- "始终使用 @/ 导入进行绝对路径引用"
## 提交 PR 前检查
[2-3 行:可复制粘贴的命令]
pnpm --filter @repo/web typecheck && pnpm --filter @repo/web test
## 设计系统
- 组件:`packages/ui/src/components/**`
- 使用来自 `packages/ui/src/tokens.ts` 的设计令牌
- 组件库:`pnpm --filter @repo/ui storybook`
- 示例:
- 按钮:`packages/ui/src/components/Button/Button.tsx`
- 表单:`packages/ui/src/components/Input/Input.tsx`
## 数据库
- ORM:Prisma / Drizzle / TypeORM
- 模式:`prisma/schema.prisma`
- 迁移:`pnpm db:migrate`
- 连接:通过 `src/lib/db.ts` 单例
- 切勿在测试中运行迁移
## API 模式
- REST 路由:`src/routes/**/*.ts`
- 认证中间件:`src/middleware/auth.ts`
- 验证:`src/schemas/**` 中的 Zod 模式
- 错误:来自 `src/lib/errors.ts` 的 `ApiError`
- 示例:`src/routes/users/get.ts`
## 测试
- 单元测试:`*.test.ts` 与代码文件放在一起
- 集成测试:`tests/integration/**`
- 端到端测试:`tests/e2e/**` (Playwright)
- 单个测试:`pnpm test -- path/to/file.test.ts`
- 模拟:`src/test/mocks/**`
按顺序提供文件:
格式:
---
文件:`AGENTS.md` (根目录)
---
[内容]
---
文件:`apps/web/AGENTS.md`
---
[内容]
生成前,请验证:
每周安装次数
68
仓库
GitHub 星标数
150
首次出现
2026年1月20日
安全审计
安装于
codex53
opencode53
gemini-cli50
claude-code48
cursor45
github-copilot44
Generate hierarchical AGENTS.md structures optimized for AI coding agents with minimal token usage.
Analyze and report:
apps/web, apps/api, apps/mobile)services/auth, services/transcribe)packages/ui, packages/shared)workers/queue, workers/cron)Present as structured map before generating files.
Create lightweight root (~100-200 lines):
# Project Name
## Project Snapshot
[3-5 lines: repo type, tech stack, note about sub-AGENTS.md files]
## Root Setup Commands
[5-10 lines: install, build all, typecheck all, test all]
## Universal Conventions
[5-10 lines: code style, commit format, branch strategy, PR requirements]
## Security & Secrets
[3-5 lines: never commit tokens, .env patterns, PII handling]
## JIT Index
### Package Structure
- Web UI: `apps/web/` -> [see apps/web/AGENTS.md](apps/web/AGENTS.md)
- API: `apps/api/` -> [see apps/api/AGENTS.md](apps/api/AGENTS.md)
### Quick Find Commands
- Search function: `rg -n "functionName" apps/** packages/**`
- Find component: `rg -n "export.*ComponentName" apps/web/src`
- Find API routes: `rg -n "export const (GET|POST)" apps/api`
## Definition of Done
[3-5 lines: what must pass before PR]
For each major package, create detailed AGENTS.md:
# Package Name
## Package Identity
[2-3 lines: what it does, primary tech]
## Setup & Run
[5-10 lines: install, dev, build, test, lint commands]
## Patterns & Conventions
[10-20 lines - MOST IMPORTANT SECTION]
- File organization rules
- Naming conventions
- Examples with actual file paths:
- DO: Use pattern from `src/components/Button.tsx`
- DON'T: Class components like `src/legacy/OldButton.tsx`
- Forms: Copy `src/components/forms/ContactForm.tsx`
- API calls: See `src/hooks/useUser.ts`
## Key Files
[5-10 lines: important files to understand package]
- Auth: `src/auth/provider.tsx`
- API client: `src/lib/api.ts`
- Types: `src/types/index.ts`
## JIT Index Hints
[5-10 lines: search commands for this package]
- Find component: `rg -n "export function .*" src/components`
- Find hook: `rg -n "export const use" src/hooks`
- Find tests: `find . -name "*.test.ts"`
## Common Gotchas
[3-5 lines if applicable]
- "Auth requires NEXT_PUBLIC_ prefix for client-side"
- "Always use @/ imports for absolute paths"
## Pre-PR Checks
[2-3 lines: copy-paste command]
pnpm --filter @repo/web typecheck && pnpm --filter @repo/web test
## Design System
- Components: `packages/ui/src/components/**`
- Use design tokens from `packages/ui/src/tokens.ts`
- Component gallery: `pnpm --filter @repo/ui storybook`
- Examples:
- Buttons: `packages/ui/src/components/Button/Button.tsx`
- Forms: `packages/ui/src/components/Input/Input.tsx`
## Database
- ORM: Prisma / Drizzle / TypeORM
- Schema: `prisma/schema.prisma`
- Migrations: `pnpm db:migrate`
- Connection: via `src/lib/db.ts` singleton
- NEVER run migrations in tests
## API Patterns
- REST routes: `src/routes/**/*.ts`
- Auth middleware: `src/middleware/auth.ts`
- Validation: Zod schemas in `src/schemas/**`
- Errors: `ApiError` from `src/lib/errors.ts`
- Example: `src/routes/users/get.ts`
## Testing
- Unit: `*.test.ts` colocated
- Integration: `tests/integration/**`
- E2E: `tests/e2e/**` (Playwright)
- Single test: `pnpm test -- path/to/file.test.ts`
- Mocks: `src/test/mocks/**`
Provide files in order:
Format:
---
File: `AGENTS.md` (root)
---
[content]
---
File: `apps/web/AGENTS.md`
---
[content]
Before generating, verify:
Weekly Installs
68
Repository
GitHub Stars
150
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex53
opencode53
gemini-cli50
claude-code48
cursor45
github-copilot44
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
71,500 周安装