AGENT SKILL

coderos-context-tiers

Operate the Context Tiers Core v1 module to build and read deterministic L0/L1/L2 repository context indexes, so cheap models get L0/L1 summaries and full L2 content is only ever fetched explicitly.

License 许可
MIT
最近更新
2026-10-07
Stars
★ 1
Forks
0

01 前言 Front Matter

name
coderos-context-tiers
description
Operate the Context Tiers Core v1 module to build and read deterministic L0/L1/L2 repository context indexes, so cheap models get L0/L1 summaries and full L2 content is only ever fetched explicitly.

03 SKILL.md 正文

CoderOS Context Tiers

This skill defines your role when running or reading output from repo_dev_runtime.context_tiers. Its job is to give any agent -- including you, in this same session -- a cheap way to see what's in a repository (L0/L1) without paying to read every file in full (L2), and to make the moment a model actually pulls full content into its own context an explicit, visible act rather than an implicit default.

1. Role Boundaries

  • This module reads local files only. --root must be a local directory; there is no URL input, and none should be attempted.
  • Never follow a symlink. The module already rejects a symlinked root, a symlinked directory encountered during the walk, and a symlinked file passed to get_full_content -- you should not try to route around that by resolving the symlink yourself first and pointing the tool at the target.
  • The index never carries full file content. A builded index's l0_abstract / l1_overview fields are summaries; do not try to reconstruct full file text from them, and do not assume a True l2_available flag means the content is already sitting in the index -- it means get_full_content (or show --tier L2) is available to fetch it.
  • This module does not select or budget anything. It has no opinion on how much context a given role or risk level should see -- that is repo_dev_runtime.context_budget_tiers's job, a separate module this one does not import. If a task calls for budget-aware selection, do not improvise it inside this module's output; use it purely as a raw content source.

2. When to Reach for L0 vs. L1 vs. L2

  • L0 -- "what is this file, roughly?" Use for a first pass over an unfamiliar directory, or when a cheap/free model just needs to know whether a file is even relevant before deciding to look closer.
  • L1 -- "what does this file's structure look like?" Use when you need to know a Python file's imports/classes/function signatures, a Markdown doc's section outline, or a JSON/YAML file's top-level shape, without needing the actual implementation or prose.
  • L2 -- "I need the real content." Use only once L0/L1 have told you this specific file is actually the one you need to read in full. Calling get_full_content (or show --tier L2) is a deliberate act -- do not reach for it reflexively just because it is available for every indexed file.

3. Running a Build

python -m repo_dev_runtime.context_tiers_cli build \
    --root <repo_dir> \
    --output <report_dir> \
    --generated-at <iso-8601 timestamp>

Check rejected_paths in the output first -- a symlink rejection or an unparseable Python file is worth understanding before trusting the index is complete for your purposes.

4. Reading an Index

python -m repo_dev_runtime.context_tiers_cli render --index <path.json> --tier L0
python -m repo_dev_runtime.context_tiers_cli render --index <path.json> --tier L1
python -m repo_dev_runtime.context_tiers_cli show --index <path.json> --path <node_path> --tier {L0,L1,L2}

render gives you a whole-repository overview at one tier. show gives you one file at one tier -- and show --tier L2 is the only command in this module that reads a live file beyond the saved index.

5. "Exceptional Human Input Only" Triggers

Halt and escalate if:

  • The operator asks you to make get_full_content (or show --tier L2) read a path outside the indexed repository root, or to make the module follow a symlink "just this once" -- both are structural safety properties, not configurable behavior.
  • You find yourself calling show --tier L2 on every node in an index just to be thorough -- that defeats the entire purpose of this module. If you genuinely need full content for most of the repository, say so and let the operator decide whether L0/L1 tiering is even the right tool for that task.

04 同仓库更多 Skills