agentleFS
jacksonwilliamsvajacksonwilliamsva/kiro-skills-library/skills/context-engineering/SKILL.md

context-engineering

Skill2 starsChanged 7 months agoMITView on GitHub

Use when agent output quality degrades, when starting a new session or project, when switching tasks, or when configuring steering files and context for Kiro

82 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use using-agent-skills, constraint-driven-development and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • LLl0k0laDSkill

    using-agent-skills

    Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.

    Also in 24 projects that use this

  • vinvcnSkill

    constraint-driven-development

    把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。

    Also in 4 projects that use this

  • LLl0k0laDSkill

    git-workflow-and-versioning

    Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.

    Also in 25 projects that use this

  • +5 more from LLl0k0laD

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 77 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always-included markdown in .kiro/.

    line 32
  2. Very specific:

    Use ctx_index or ctx_fetch_and_index to persist docs, specs, and references.

    line 40
  3. Distinctive:

    No steering file exists in the project

    line 69

“Common” is measured: kept by at least 6 in 10 of the 77 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Context Engineering

Feed the agent the right information at the right time. Context is the single biggest lever for output quality — too little and the agent hallucinates, too much and it loses focus.

The Context Hierarchy

Structure context from most persistent to most transient:

┌─────────────────────────────────────┐
│  1. Steering Files (.kiro/*.md)     │ ← Always loaded, project-wide
├─────────────────────────────────────┤
│  2. Skills (~/.kiro/skills/)        │ ← Loaded when triggered
├─────────────────────────────────────┤
│  3. Knowledge Bases (indexed)       │ ← Searched on demand via ctx_search
├─────────────────────────────────────┤
│  4. Relevant Source Files           │ ← Loaded per task
├─────────────────────────────────────┤
│  5. Error Output / Test Results     │ ← Loaded per iteration
├─────────────────────────────────────┤
│  6. Conversation History            │ ← Accumulates, compacts
└─────────────────────────────────────┘

Level 1: Steering Files

Always-included markdown in .kiro/. Highest-leverage context. Cover: tech stack, commands, conventions, boundaries, patterns.

Level 2: Skills

Reusable techniques at ~/.kiro/skills/*/SKILL.md. Triggered by description match — not always loaded.

Level 3: Knowledge Bases

Use ctx_index or ctx_fetch_and_index to persist docs, specs, and references. Query with ctx_search. Content stays out of context until needed.

Level 4–6: Task Context

Load only what's relevant. Use ctx_execute_file to analyze without flooding context. Use ctx_batch_execute to gather and search in one call.

Context Packing Strategies

Selective Include — only load files relevant to the current task. One example of the pattern to follow beats five files of background.

Hierarchical Summary — maintain a project map in a steering file. Load only the relevant section.

Knowledge Base Offload — index large docs once, search on demand. Raw content never enters context.

Anti-Rationalization Table

RationalizationReality
"The agent should figure out conventions"Write a steering file — 10 min saves hours
"I'll correct it when it goes wrong"Prevention beats correction. Upfront context prevents drift
"More context is always better"Performance degrades with excess instructions. Be selective
"The context window is huge, use it all"Window size ≠ attention budget. Focused context wins

Red Flags — Refresh Context When:

  • Output doesn't match project conventions
  • Agent invents APIs or imports that don't exist
  • Agent re-implements utilities already in the codebase
  • Quality degrades as conversation lengthens
  • No steering file exists in the project

Quick Reference

ActionTool
Always-on project rules.kiro/*.md steering files
Reusable techniques~/.kiro/skills/*/SKILL.md
Index docs/specsctx_index or ctx_fetch_and_index
Search indexed contentctx_search
Analyze files without floodingctx_execute_file
Batch gather + searchctx_batch_execute
Fresh sessionStart new chat when context drifts

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.