简介
纯文档型代码库智能导航,构建持久化 MAP 索引节省 80-95% 探索 token,实现高效代码定位与团队 onboarding。
原始描述
Codebase intelligence — generates structured navigation maps with file:line references so agents stop re-scanning the same files every session. Use when exploring code, answering "where is X?", or onboarding to a new codebase.
通过你的 Agent 添加
安装目录:atris/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心功能
Atris 是一款面向 AI Agent 的代码库智能导航工具,通过构建结构化的 atris/MAP.md 导航地图,彻底解决代码探索中的重复扫描问题。其核心机制遵循"MAP-first"原则:任何代码搜索前先查阅地图,发现新符号后立即归档,实现知识的持久累积。
显著优点
1. Token 效率革命 开发者估算可节省 80-95% 的代码探索 Token 消耗,对于大型代码库和频繁会话场景尤为关键。
2. 精准定位能力
所有引用均包含精确的文件路径和行号(如 src/auth/login.ts:45-89),消除模糊搜索的不确定性。
3. 渐进式知识积累 地图随使用自然进化,新发现即时归档,避免重复劳动,形成可复用的团队资产。
4. 多维度组织视角 同时提供按功能(By-Feature)和按关注点(By-Concern)的双重视图,兼顾业务逻辑与技术架构。
5. 零配置启动
仅需 ripgrep 依赖,无需复杂初始化,支持任何语言的项目。
潜在局限
- 依赖外部工具:必须安装
rg (ripgrep),Windows 用户需额外配置
- 维护成本:代码库大幅重构时需手动更新或分段再生地图
- 初始扫描质量:首代地图质量取决于扫描规则配置,复杂项目可能需要人工调优
- 无自动同步:变更检测依赖用户主动执行,缺乏监听机制
- 语言覆盖:内置扫描规则偏向 JS/TS/Python,其他语言需自定义正则
适合人群
- 频繁切换代码库的开发者或 Agent
- 需要快速 onboarding 新项目的团队成员
- 大型单体仓库的维护者
- 注重 Token 预算的 AI 辅助开发用户
常规风险
风险类型
等级
说明
敏感信息泄露
低
明确排除 .env*, *.key, credentials* 等文件
地图过时
中
可能导致跳转到错误行号,需定期维护
依赖缺失
低
无 rg 时功能不可用
权限问题
低
仅需读取代码权限,无写入敏感区域需求
rg (ripgrep),Windows 用户需额外配置- 频繁切换代码库的开发者或 Agent
- 需要快速 onboarding 新项目的团队成员
- 大型单体仓库的维护者
- 注重 Token 预算的 AI 辅助开发用户
常规风险
风险类型
等级
说明
敏感信息泄露
低
明确排除 .env*, *.key, credentials* 等文件
地图过时
中
可能导致跳转到错误行号,需定期维护
依赖缺失
低
无 rg 时功能不可用
权限问题
低
仅需读取代码权限,无写入敏感区域需求
| 风险类型 | 等级 | 说明 |
|---|---|---|
| 敏感信息泄露 | 低 | 明确排除 .env*, *.key, credentials* 等文件 |
| 地图过时 | 中 | 可能导致跳转到错误行号,需定期维护 |
| 依赖缺失 | 低 | 无 rg 时功能不可用 |
| 权限问题 | 低 | 仅需读取代码权限,无写入敏感区域需求 |
安全认证显示该 Skill 为纯 Markdown 文档,无可执行代码,通过 S 级安全评级。
技能正文
name: atris description: Codebase intelligence — generates structured navigation maps with file:line references so agents stop re-scanning the same files every session. Use when exploring code, answering "where is X?", or onboarding to a new codebase. version: 1.0.0 requires: bins: - rg tags:
- developer-tools
- codebase-navigation
- token-optimization
- code-map
- context-management
Atris — Codebase Intelligence
Maintain a structured map of the codebase with exact file:line references. One scan, permanent knowledge. Saves 80-95% of tokens on code exploration.
Scope
- Use in any repo where you need to navigate code.
- Creates
atris/MAP.md as the single navigation index.
MAP-first rule
atris/MAP.md as the single navigation index.Before searching for anything in the codebase:
- Read
atris/MAP.md - Found your keyword → go directly to file:line. Done.
- Not found → search once with
rg, then add the result to MAP.md
The map gets smarter every time you use it. Never let a discovery go unrecorded.
First time setup
If atris/MAP.md doesn't exist, generate it:
- Create
atris/folder in the project root - Scan the codebase (rules below)
- Write the result to
atris/MAP.md - Tell the user: "Built your codebase map at atris/MAP.md."
If atris/MAP.md already exists, use it. Regenerate only if the user requests it or the map is clearly stale (references missing files, line numbers way off).
How to scan
Skip: node_modules, .git, dist, build, vendor, __pycache__, .venv, .env*, *.key, *.pem, credentials*, secrets*
Use ripgrep to extract structure:
# Key definitions
rg "^(export|function|class|const|def |async def |router\.|app\.|@app\.)" --line-number -g "!node_modules" -g "!.git" -g "!dist" -g "!.env*"
# Route definitions
rg "(get|post|put|delete|patch)\s*\(" --line-number -g "*.ts" -g "*.js" -g "*.py"
# Entry points
rg "listen|createServer|app\.start|if __name__" --line-number
MAP.md structure
# MAP.md — [Project Name] Navigation Guide
> Generated by Atris | Last updated: YYYY-MM-DD
## Quick Reference
rg "functionName" path/to/file.ext # Description (line N)
rg "className" path/to/file.ext # Description (line N)
# MAP.md — [Project Name] Navigation Guide
> Generated by Atris | Last updated: YYYY-MM-DD
## Quick Reference
rg "functionName" path/to/file.ext # Description (line N)
rg "className" path/to/file.ext # Description (line N)
Extract the top 15-25 most important symbols: entry points, exports, route handlers, main classes, config loaders.
By-Feature Map
Group code by what it does. Every reference includes exact file path and line numbers.
### Feature: User Authentication
**Purpose:** Login, registration, token management
- **Entry:** `src/auth/login.ts:45-89` (handleLogin)
- **Validation:** `src/auth/validate.ts:12-67` (validateToken)
- **Model:** `src/models/user.ts:8-34` (User schema)
- **Routes:** `src/routes/auth.ts:5-28` (POST /login, POST /register)
By-Concern Map
Group by cross-cutting patterns (error handling, logging, auth middleware, etc).
Critical Files
Flag high-impact files with why they matter and key functions with line numbers.
Entry Points
How execution flows — dev server startup, request lifecycle, build pipeline.
Keeping it fresh
Update MAP.md surgically when the codebase changes:
- New file → add to relevant section
- Moved/renamed → update all references
- New important function → add to Quick Reference
- Deleted file → remove from map
- Major refactor → regenerate affected sections
Small updates, not full regeneration. The map evolves with the code.
Anti-patterns
- Searching without checking MAP first
- Letting discoveries go unrecorded
- Regenerating the full map when a surgical update would do
- Including secrets, credentials, or .env files in the map
- Guessing file locations instead of using the index
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。