用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/sopaco/terrain --skill agent-architecture-skill命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | agent-architecture-skill |
| description | Generate architecture-level agent context (no code细节) for Terrain projects. |
Produce agent/context.md — a dense, architecture-oriented document for Coding Agents and Ask mode.
agent/repomix.md — Ask reads via grep/read_file)human/ Litho docs)When Terrain runs context generation, return the complete markdown document as your reply;
Terrain persists it as agent/context.md. Do not write the output file yourself in that
mode — a reply that is only a completion summary will overwrite a good on-disk document.
When a prompt explicitly delegates file writing to you (no “Terrain will persist your reply”
clause), write to TERRAIN_AGENT_CONTEXT_OUTPUT or the path given in the prompt.
Required sections (Markdown ## headings), in the language specified by the
prompt's LANGUAGE directive (Chinese names below; English equivalents in
parentheses — the prompt's explicit section list takes precedence):
terrain-meta.json)Repositories may ship one or more terrain-meta.json files (repo root, .terrain/, or nested). Before generating context, Terrain programmatically collects referenced files and injects them into the LLM prompt. The bundle is also written to agent/meta-inputs.md.
See terrain-meta.example.json in this skill directory.
{
"version": 1,
"hints": {
"module_roots": ["crates/", "src/"],
"notes": "Free-form team hints"
},
"inputs": [
{ "label": "Modules doc", "type": "file", "path": "docs/architecture.md" },
{ "label": "ADRs", "type": "glob", "pattern": "docs/adr/*.md", "optional": true },
{ "label"
Input types: file (path relative to repo or meta file), glob, inline. Each input may set optional and max_chars (default 3500).
grep_agent_pack for path discovery onlymodules/ stubs are deprecated — synthesis is LLM-driven from meta + repomixagent/repomix.mdgrep_agent_pack only to discover paths, never paste grep outputWhen Terrain runs context generation in ACP mode, native function tools are unavailable. Use the terrain tools CLI instead:
terrain tools pack-meta --project {slug}
terrain tools grep-pack --project {slug} --pattern "module_name"
terrain tools read-pack-file --project {slug} --file src/foo.rs --start-line 1 --end-line 80
See terrain-ask-skill for the full CLI reference. Do not read the live repository filesystem.
Environment variables set by Terrain:
| Variable | Purpose |
|---|---|
TERRAIN_AGENT_ARCH_SKILL | This skill directory |
TERRAIN_AGENT_CONTEXT_OUTPUT | Write target for agent/context.md |
TERRAIN_KNOWLEDGE_ROOT | Project .terrain/ directory |
TERRAIN_PROJECT_SLUG | Project slug |
TERRAIN_REPO_PATH | Repository root |
read_agent_context(section=…)grep_agent_pack → read_agent_pack_file