Command Palette

Search for a command to run...

Back to skills
skill № 34210

project-navigator

项目结构导航:先判断框架仓库还是孵化项目,再索引页面、组件、lib 函数、数据与配置,速查「改一件事要动哪些文件」。触发词:项目结构、文件在哪、定位、目录说明、这个功能在哪、找文件、参考代码、已有组件、代码位置、哪个文件

FreeNo executable scripts
bkywksjby bkywksj★ 55 GitHub stars

Install project-navigator in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

项目导航(project-navigator)

何时使用

  • 不知道文件在哪里、某个功能的代码在哪
  • 想了解项目目录结构与每个目录的职责
  • 开发前找参考代码、找已有的组件与工具函数
  • 判断当前目录是框架模板还是孵化出来的项目
  • 想知道「改 X 需要动哪几个文件」

其他常见说法:目录、在哪里、已有组件。

第一步:判断当前在哪个仓库(必须先做)

ls .framework-sync.json .claude/PROJECT.md 2>/dev/null; grep -m1 '"name"' package.json; ls astro.config.* src/site.config.ts 2>/dev/null; git log --oneline -1

按顺序判定:

特征 身份 含义
有 .framework-sync.json 孵化出来的项目 业务在这里开发;框架核心文件尽量不改,确需改就单独提交、scope 写 framework(见 CLAUDE.md「框架核心 vs 业务代码」)
没有 .framework-sync.json,且 package.json 的 name 为 next-ai-astro 框架仓库本身 核心文件就是开发对象,正常开发;示例数据是演示用的,改动会影响所有之后孵化的项目
有 .claude/PROJECT.md 项目事实与专属禁令 开发前先读,优先级高于 CLAUDE.md
以上都不是(没有 astro.config.* / src/site.config.ts) 不是本框架体系的项目 🔴 不要套用本技能下面的路径;改用 Glob / Grep 现场探索,或问用户项目在哪

用户问的是别的项目(不是当前工作目录)时,同样不要拿本技能的路径去猜——先确认那个项目的根目录,再按上表判定。 孵化项目可能用 module-strip 裁掉了部分模块(.framework-sync.json 的 strippedModules),下面索引里的文件以实际存在为准,找不到先 ls 核对,别凭索引断言。


目录总览

.
├── astro.config.ts          # 构建行为:site、trailingSlash、compressHTML、集成、图片域名
├── package.json             # 脚本见下方「可用脚本」
├── tsconfig.json            # 路径别名 @/* → src/*
├── vitest.config.ts         # 单测(复用 Astro 的 Vite 配置)
├── playwright.config.ts     # E2E(desktop + mobile 两个 project,预览端口 4329,channel: chromium)
├── Dockerfile / docker-compose.yml / deploy/nginx/   # 部署(compose 的 image / container_name = 项目标识)
├── cc.bat / cx.bat          # 在本项目里免确认启动 Claude Code / Codex(自主循环用;hook 仍然生效)
├── .framework-sync.json     # 仅孵化项目有:孵化来源与同步记录
├── src/
│   ├── site.config.ts       # ★ 站点唯一配置
│   ├── content.config.ts    # ★ 内容集合(= 数据库表)
│   ├── data/                # 集合 JSON 数据 + faq.json + ai-crawlers.json
│   ├── content/posts/       # Markdown 文章
│   ├── layouts/             # BaseLayout(全站唯一 HTML 骨架)
│   ├── components/          # seo / layout / ui / works / islands
│   ├── lib/                 # 纯函数与集合查询
│   ├── pages/               # 文件即路由
│   └── styles/global.css    # Tailwind 入口 + 设计令牌
├── public/                  # 原样复制的静态资源(favicon、og 图、示例封面)
├── scripts/
│   ├── check-seo.mjs        # 构建后 SEO/GEO 校验
│   ├── sync/                # 数据同步:run.mjs + context.mjs + sources/*.mjs
│   ├── validate-skills.mjs  # 技能体系一致性校验(pnpm check:skills)
│   └── sync-agents-skills.mjs  # 生成 Codex 技能镜像(pnpm agents:sync)
├── tests/unit/ tests/e2e/   # Vitest / Playwright
├── docs/                    # 真相源:需求文档、原型、任务台账、测试计划与报告、BLOCKERS
└── .claude/ .codex/ .agents/ # AI 技能体系(技能、命令、hook;孵化项目另有 PROJECT.md)

可用脚本(package.json)

脚本 作用
pnpm dev 开发服务器,http://localhost:4321/
pnpm build / pnpm build:fast astro check && astro build / 只构建不做类型检查
pnpm preview --port 4329 预览构建产物,http://localhost:4329/
pnpm check 只跑 astro check
pnpm verify build + check:seo + test(提交前验证门)
pnpm check:seo 扫描 dist/ 的 SEO/GEO 字段
pnpm sync [源名] [--dry-run] 数据同步
pnpm test / pnpm test:e2e Vitest / Playwright
pnpm agents:sync / pnpm check:skills 技能镜像同步 / 技能体系校验
pnpm format Prettier

脚本以实际 package.json 为准,快速列出:node -e "console.log(Object.keys(require('./package.json').scripts).join('\n'))"


资源索引

页面(src/pages/)

URL 文件 说明
/ index.astro Hero + 精选 + 分类入口 + 最新文章 + FAQ(数据为空的区块不渲染)
/works/ works/index.astro 列表页,挂 WorksExplorer island(client:load)
/works/<id>/ works/[id].astro 作品详情,getStaticPaths 按集合生成
/works/category/<id>/ works/category/[id].astro 分类落地页,纯静态
/posts/ posts/index.astro 文章列表
/posts/<id>/ posts/[...id].astro 文章详情([...id] 支持子目录)
/about/ about.astro 关于
/404.html 404.astro noindex
/robots.txt robots.txt.ts 生成型端点:先 User-agent: *,再按 src/data/ai-crawlers.json 逐个输出 Allow / Disallow
/llms.txt llms.txt.ts 生成型端点,从集合生成
/sitemap-index.xml @astrojs/sitemap 自动生成 在 astro.config.ts 配置过滤

组件(src/components/)

目录 组件 用途
seo/ SEOHead.astro(导出类型 SEOProps) title / description / canonical / OG / Twitter / JSON-LD(经 BaseLayout 调用)
layout/ SiteHeader SiteFooter ThemeScript ThemeToggle Analytics 页头页脚、暗色模式、统计
ui/ Container Section Button Badge Breadcrumbs 通用 UI,详见 ui-components 技能
works/ WorkCard.tsx:导出 WorkCard(props work / eager / priority / headingLevel)、coverTransitionName()、类型 WorkCardData 作品卡片(静态渲染与 island 两用);eager = 不懒加载,priority = fetchpriority=high,每页只给一张
islands/ WorksExplorer.tsx 搜索 / 分类 / 标签 / 排序 / 加载更多,状态同步到 URL

工具函数(src/lib/)

文件 导出 用途
seo.ts buildTitle absoluteUrl truncate serializeJsonLd AI_CRAWLERS websiteJsonLd breadcrumbJsonLd faqJsonLd articleJsonLd,类型 JsonLd Crumb FaqItem CrawlerRule CrawlerPurpose SEO 纯函数(框架核心)
`works.ts
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the project-navigator skill do?

项目结构导航:先判断框架仓库还是孵化项目,再索引页面、组件、lib 函数、数据与配置,速查「改一件事要动哪些文件」。触发词:项目结构、文件在哪、定位、目录说明、这个功能在哪、找文件、参考代码、已有组件、代码位置、哪个文件

How do I install the project-navigator skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the project-navigator skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare project-navigator with