astra-code-map AGENTS.md

Repository instructions for AstraMap, a Go tool that indexes source code and shows its structure and relationships.

In plain words
What is it for?
They guide changes to the Go indexer, code parser, call graph, command-line tool, web dashboard, documentation, and tests.
Why use it?
They make the required build, test, formatting, naming, indexing, and submission practices clear.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/sourceastra/astra-code-map/agents-md
Clone the repo
git clone --depth 1 https://github.com/SourceAstra/astra-code-map

Made for: Codex, OpenCode.

Per session 679 This file is loaded in full into every session.
When invoked 679 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00679 $0.00679
Opus 5 $0.00340 $0.00340
Sonnet 5 $0.00136 $0.00136
Haiku 4.5 $0.00068 $0.00068

Measured yesterday against content hash 792284356390, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

astra-code-map AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 39 lines

What it actually says

Repository Guidelines

项目结构

  • astramap/:核心 Go 实现,包括索引、Tree-sitter 解析、调用图、MCP 服务和 HTTP 服务。
  • cmd/amap/:命令行入口,提供 indexdashboardserve 等命令。
  • astramap/web/:Dashboard 的 HTML、CSS 和 JavaScript 前端资源。
  • docs/:设计文档和项目说明;README.mdQUICKSTART.md 提供用户级使用文档。
  • .astramap/:本地代码地图数据库和索引状态,不应提交生成数据。

构建、测试与开发

make build                 # 构建本地 amap 二进制
make test                  # 运行全部 Go 测试
make vet                   # 执行 go vet
./amap index --project .   # 构建或更新当前项目索引
./amap dashboard --project .  # 启动 Web Dashboard

发布 Linux 静态二进制使用 make build-static-linux;该命令要求构建机安装 musl-gcc。修改解析器或索引逻辑后,应重新运行 amap index --full 清理旧索引结果。

代码风格与命名

1.Go 代码使用 gofmt,保持制表符缩进;导出类型、函数和字段使用 PascalCase,内部变量使用 camelCase。错误应带上下文并向上传递。前端 JavaScript 使用现有模块和命名风格,避免引入重复的全局状态。提交前运行 gofmt -w 处理改动过的 Go 文件;

测试指南

测试框架使用 Go 标准库 testing,测试文件命名为 *_test.go,测试函数命名为 TestXxx。当前仓库测试数量较少;新增解析、索引或 API 行为时,应在对应包增加回归测试,并使用 go test ./... 验证。

提交与合并请求

提交信息采用简短的组件前缀和祈使式描述,例如 treesitter.go: narrow heuristic call resolutiontrace.js: preserve qualified names。合并请求应说明问题、实现范围和验证命令;涉及 Dashboard 的改动附上截图,涉及索引数据的改动说明是否需要重新生成 .astramap 数据。不要提交本地数据库、构建产物或临时截图。

AstraMap 工具约定

询问代码结构时优先使用 AstraMap 工具,而不是 grep 或递归文件搜索:定义用 astramap_search,上下文用 astramap_explore,源码详情用 astramap_node,调用方/被调用方用 astramap_callers / astramap_callees,影响范围用 astramap_impact,调用路径用 astramap_trace,索引状态用 astramap_status

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 39 lines · 679 tokens per session scan A 792284356390

Subscribe to this mod's changes

astra-code-map AGENTS.md is an instructions file published in the GitHub repository SourceAstra/astra-code-map (2 stars, last pushed 18d ago), licensed Apache-2.0. It adds 679 tokens to every session, about $0.0034 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories