Install any skill in seconds. Free to start, no credit card required.
Get Started Free →自动分析项目结构并生成 project-structure skill。Use when 用户想初始化项目结构说明、生成项目结构文档、或说"初始化项目结构""生成项目结构""project init"时。
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 48% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 91% | 0% |
| case-13 | ✗→✓ | ▲ Improved | -20% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 51% | 0% |
| case-21 | ✗→✓ | ▲ Improved | 44% | 0% |
自动分析当前项目,生成 project-structure skill 到项目的 .claude/skills/ 目录下。
检测项目根目录下的配置文件:
| 文件 | 技术栈 | 框架识别方式 | |------|--------|--------------| | package.json | Node.js | 检测 dependencies 中的 react、vue、next、express、nestjs 等 | | go.mod | Go | 读取 module 和 require | | requirements.txt / pyproject.toml | Python | 检测 django、flask、fastapi 等 | | Cargo.toml | Rust | 读取 dependencies | | pom.xml / build.gradle | Java | 检测 spring-boot 等 |
根据 src/ 或 app/ 下的子目录划分模块,识别常见模式:
在项目的 .claude/skills/project-structure/ 目录下生成:
project-structure/
├── SKILL.md # 主索引(精简)
├── tech-stack.md # 技术栈 + 依赖说明
├── commands.md # 常用命令
├── conventions.md # 编码规范 + 注意事项
└── modules/ # 核心模块说明
├── [模块名].md
└── ...markdown--- name: project-structure description: 本项目结构说明。Use when 需要了解项目结构、模块说明、技术栈、开发规范时。触发词:项目结构、目录结构、技术栈、模块说明。 --- # 项目结构:{项目名} ## 技术栈 {技术栈简述},详见 [tech-stack.md](./tech-stack.md) ## 核心模块 | 模块 | 说明 | |------|------| {modules_table} ## 常用命令 详见 [commands.md](./commands.md) ## 开发规范 详见 [conventions.md](./conventions.md)
markdown# 技术栈 ## 运行环境 {runtime_info} ## 核心依赖 | 依赖 | 版本 | 用途 | |------|------|------| {core_deps} ## 开发依赖 | 依赖 | 版本 | 用途 | |------|------|------| {dev_deps}
markdown# 常用命令 ## 开发 {dev_commands} ## 构建 {build_commands} ## 测试 {test_commands} ## 其他 {other_commands}
markdown# 开发规范 ## 代码风格 {code_style} ## 目录约定 {dir_conventions} ## 注意事项 {notes}
markdown# 模块:{模块名} ## 目录结构 {dir_structure} ## 职责 {responsibility} ## 关键文件 | 文件 | 说明 | |------|------| {key_files} ## 依赖关系 - 依赖于:{dependencies} - 被依赖:{dependents}
输出类似:
已生成 project-structure skill 到 .claude/skills/project-structure/
检测到 CLAUDE.md 中以下内容与 skill 重复:
1. 技术栈说明(第 X-Y 行)
2. 目录结构说明(第 X-Y 行)
是否精简 CLAUDE.md?[Y/n]用户确认后:
精简后的引用格式:
markdown## 项目结构 详见 `.claude/skills/project-structure/` ## 开发命令 详见 `.claude/skills/project-structure/commands.md`
用户: /project-init
AI: 正在分析项目结构...
✓ 检测到技术栈: React + TypeScript + Vite
✓ 识别到 4 个核心模块: components, hooks, api, utils
正在生成 project-structure skill...
✓ 已生成到 .claude/skills/project-structure/
- SKILL.md
- tech-stack.md
- commands.md
- conventions.md
- modules/components.md
- modules/hooks.md
- modules/api.md
- modules/utils.md
检测到 CLAUDE.md 中以下内容与 skill 重复:
1. 技术栈说明(第 5-15 行)
2. 目录结构说明(第 20-35 行)
是否精简 CLAUDE.md?[Y/n]
用户: Y
AI: ✓ 已精简 CLAUDE.md,删除重复内容并添加引用。
完成!现在可以通过以下方式使用:
- 说"查看项目结构"加载 project-structure skill
- 说"技术栈""常用命令""开发规范"查看具体内容.claude/skills/project-structure/ 已存在,先询问用户是否覆盖执行完成后必须满足:
.claude/skills/project-structure/ 目录已创建Other measured skills in the registry, with their headline benchmark lift.