Agent skill

Agent Architecture Skill

by sopaco in sopaco/terrain

Generate architecture-level agent context (no code细节) for Terrain projects.

MITAuto-check passedAgent Workflows

Install Agent Architecture Skill

skills CLI
$ npx skills add sopaco/terrain --skill agent-architecture-skill -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sopaco/terrain agent-architecture-skill --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sopaco/terrain.git skills-src && mkdir -p .claude/skills && cp -r skills-src/preset_skills/agent-architecture-skill .claude/skills/agent-architecture-skill && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
agent-architecture-skill
GitHub stars
256
Token cost
~1.1k tokens
SKILL.md length
464 words
Files
2
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Generate architecture-level agent context (no code细节) for Terrain projects.

  • Works in 7 steps: 项目概览 (Project Overview) — purpose,… → 架构设计 (Architecture) — containers,… → 模块地图 (Module Map) — table: Module |… → …
  • Tasks that involve Codebase knowledge for agents
  • SKILL.md covers NOT this skill's job, Output contract, Developer meta… and Rules, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Agent Architecture Skill is an agent skill from sopaco/terrain. Generate architecture-level agent context (no code细节) for Terrain projects.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `terrain-meta.example.json`).

It sits in Agent Workflows, covering Codebase knowledge for agents. The repository describes itself as: AI-native engineering environment management that makes your codebase agent-ready. The licence is MIT.

When your agent uses it

  • Tasks that involve Codebase knowledge for agents

Example prompts

  • “/agent-architecture-skill”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. 项目概览 (Project Overview) — purpose, consumers, key constraints (≤120 words)
  2. 架构设计 (Architecture) — containers, layers, major dependencies (table/bullets)
  3. 模块地图 (Module Map) — table: Module | Responsibility | Primary paths (≤12 rows)
  4. 核心流程 (Core Flows) — 2–4 critical flows as numbered steps (no code)
  5. 技术选型 (Tech Stack) — stack, frameworks, infra (bullet list)
  6. 系统边界 (System Boundaries) — external APIs, DBs, third-party, trust boundaries
  7. 代码映射索引 (Code Map Index) — table: Concept | Location (paths only) | Notes (≤15 rows)

What it can do on your machine

Read from SKILL.md and the folder at commit 0746b38. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Agent Architecture Skill loads about 1.1k tokens when it runs. Until then it costs about 25 tokens; SKILL.md has 464 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~25
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from sopaco/terrain at commit 0746b38, republished under its MIT licence (© sopaco). 464 words, ~1,105 tokens.

Download SKILL.mdSave it as .claude/skills/agent-architecture-skill/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
agent-architecture-skill
description
Generate architecture-level agent context (no code细节) for Terrain projects.

Agent Architecture Context Skill

Produce agent/context.md — a dense, architecture-oriented document for Coding Agents and Ask mode.

NOT this skill's job

  • Full source code or compressed signatures (that's agent/repomix.md — Ask reads via grep/read_file)
  • Human-friendly long-form narrative (that's human/ Litho docs)

Output contract

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):

  1. 项目概览 (Project Overview) — purpose, consumers, key constraints (≤120 words)
  2. 架构设计 (Architecture) — containers, layers, major dependencies (table/bullets)
  3. 模块地图 (Module Map) — table: Module | Responsibility | Primary paths (≤12 rows)
  4. 核心流程 (Core Flows) — 2–4 critical flows as numbered steps (no code)
  5. 技术选型 (Tech Stack) — stack, frameworks, infra (bullet list)
  6. 系统边界 (System Boundaries) — external APIs, DBs, third-party, trust boundaries
  7. 代码映射索引 (Code Map Index) — table: Concept | Location (paths only) | Notes (≤15 rows)

Developer meta (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.

Schema (version 1)
json
{
  "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": "Glossary", "type": "inline", "content": "..." }
  ]
}

Input types: file (path relative to repo or meta file), glob, inline. Each input may set optional and max_chars (default 3500).

Show full SKILL.md (187 more words)Show less
How to use meta in output
  • Treat collected meta as authoritative for 模块地图 and 系统边界
  • Supplement with grep_agent_pack for path discovery only
  • Do not invent modules that contradict developer meta
  • Rule-based modules/ stubs are deprecated — synthesis is LLM-driven from meta + repomix

Rules

  • Hard limit: ≤14000 characters — trimmed to 16 KiB on save if exceeded
  • Macro sections (1–3) must be the densest; sections 4–7 can be shorter
  • No function bodies, no code blocks > 3 lines
  • Path references only — implementation detail lives in agent/repomix.md
  • Use grep_agent_pack only to discover paths, never paste grep output
  • Prefer tables and bullet lists over prose

ACP mode (Terrain)

When Terrain runs context generation in ACP mode, native function tools are unavailable. Use the terrain tools CLI instead:

bash
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:

VariablePurpose
TERRAIN_AGENT_ARCH_SKILLThis skill directory
TERRAIN_AGENT_CONTEXT_OUTPUTWrite target for agent/context.md
TERRAIN_KNOWLEDGE_ROOTProject .terrain/ directory
TERRAIN_PROJECT_SLUGProject slug
TERRAIN_REPO_PATHRepository root

How Ask consumes this

  • Macro: 项目概览 + 架构设计 + 模块地图 preloaded in the question
  • Meso: other sections fetched on demand via read_agent_context(section=…)
  • Micro: source code via grep_agent_pack → read_agent_pack_file

© sopaco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in preset_skills/agent-architecture-skill of sopaco/terrain.

  • SKILL.md
  • terrain-meta.example.json

Open the folder on GitHubat commit 0746b38

Compare with similar skills

Agent Architecture Skill next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Agent Architecture Skill compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agent Architecture Skill this skillsopaco/terrain256—~1.1kAutomated safety check: PassMIT
ccc Semantic Code Searchcocoindex-io/cocoindex-code2.7k—~938Automated safety check: PassApache-2.0
Context Engineeringabashev/vfs-s31069 repos~2.6kAutomated safety check: NotesApache-2.0
Repomix Codebase Packeryamadashy/repomix29k—~1.3kAutomated safety check: NotesMIT
Codebase Handbook BuilderRuhan-Wang/Harness_Handbook332—~2.2kAutomated safety check: PassApache-2.0
CodemapJordanCoin/codemap704—~1.8kAutomated safety check: PassMIT

Similar skills

  • ccc Semantic Code Search

    cocoindex-io/cocoindex-code

    Semantic code search and index management with the ccc CLI: the agent initializes, indexes and queries the project by concept, filtering by language or path.

    2.7k GitHub stars~938 tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed
  • Context Engineering

    abashev/vfs-s3

    Optimizes agent context setup. An agent skill from abashev/vfs-s3.

    106 GitHub starsUsed in 9 repos~2.6k tokens
    Agent WorkflowsAuto-check: notes
  • Repomix Codebase Packer

    yamadashy/repomix

    Packs a local directory or remote GitHub repository into one AI-friendly file with Repomix, then searches it to explore structure, find patterns and count tokens.

    29k GitHub stars~1.3k tokensUpdated 5 days ago
    Agent WorkflowsAuto-check: notes
  • Codebase Handbook Builder

    Ruhan-Wang/Harness_Handbook

    Generates, refreshes, validates and uses a compact handbook that maps where a change touches in a repository, using the active Codex session and no external LLM API.

    332 GitHub stars~2.2k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Codemap

    JordanCoin/codemap

    Gives an agent a quick map of a codebase's structure, dependencies, changes and handoffs, and tunes per-project config so the output stays code-first.

    704 GitHub stars~1.8k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed
  • Repomix Context Skill

    sopaco/deepwiki-rs

    A skill your agent uses when an agent needs source code from the local repomix index under .terrain/agent/repomix.md (not committed; regenerate via Terrain scan).

    3.1k GitHub stars~671 tokensUpdated 24 days ago
    Agent WorkflowsAuto-check passed

More from sopaco/terrain

  • Litho Document Skill

    sopaco/terrain

    This skill should be used when the user asks to "generate project documentation", "analyze codebase architecture", "create C4 architecture diagrams", "document a repository", "generate technical…

    256 GitHub stars~1.4k tokensUpdated 9 days ago
    Auto-check passed
  • Agent Context Skill

    sopaco/terrain

    A skill your agent uses when a coding agent needs project source context from Terrain agent assets.

    256 GitHub stars~486 tokensUpdated 9 days ago
    Auto-check passed
  • Terrain Ask Skill

    sopaco/terrain

    Terrain Ask — query knowledge via terrain CLI when Agent execution mode is ACP.

    256 GitHub stars~926 tokensUpdated 9 days ago
    Auto-check passed
  • Sdd Workflow Skill

    sopaco/terrain

    Terrain SDD standardized workflow — requirement clarification, technical design, code generation, and code review.

    256 GitHub stars~447 tokensUpdated 9 days ago
    Auto-check passed

Categories

Questions about Agent Architecture Skill

What does Agent Architecture Skill do?

Generate architecture-level agent context (no code细节) for Terrain projects. Agent Architecture Skill is an agent skill from sopaco/terrain. Generate architecture-level agent context (no code细节) for Terrain projects.

When should I use Agent Architecture Skill?

Agent Architecture Skill fits situations like: tasks that involve Codebase knowledge for agents.

How do I install Agent Architecture Skill in Claude Code?

Run `npx skills add sopaco/terrain --skill agent-architecture-skill -a claude-code`. Or copy the skill folder (preset_skills/agent-architecture-skill in sopaco/terrain) into .claude/skills/agent-architecture-skill in your project. Claude Code loads it when a task matches its description.

How do I install Agent Architecture Skill in Codex?

Run `npx skills add sopaco/terrain --skill agent-architecture-skill -a codex`. Or copy the skill folder (preset_skills/agent-architecture-skill in sopaco/terrain) into .agents/skills/agent-architecture-skill in your project. Codex loads it when a task matches its description.

Can I use Agent Architecture Skill in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sopaco/terrain --skill agent-architecture-skill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agent-architecture-skill, .gemini/skills/agent-architecture-skill, .github/skills/agent-architecture-skill and .opencode/skills/agent-architecture-skill in your project.

What does Agent Architecture Skill need to run?

SKILL.md names no scripts, command-line tools or credentials: Agent Architecture Skill is instructions for the agent only.

Does Agent Architecture Skill access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Agent Architecture Skill safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Agent Architecture Skill use?

Agent Architecture Skill is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Agent Architecture Skill use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Agent Architecture Skill?

Skills that share tags, products or a category with Agent Architecture Skill: ccc Semantic Code Search (cocoindex-io/cocoindex-code, 2.7k stars), Context Engineering (abashev/vfs-s3, 106 stars), Repomix Codebase Packer (yamadashy/repomix, 29k stars) and Codebase Handbook Builder (Ruhan-Wang/Harness_Handbook, 332 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Agent Architecture Skill?

sopaco (a GitHub user) maintains it in sopaco/terrain, which has 256 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on September 29, 2026.

Source: sopaco/terrain on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.