agentleFS
kwhornekwhorne/elyra-skills/skills/context-engineering/SKILL.md

context-engineering

Skill1 starsChanged 6 months agoMITView on GitHub

Write and maintain agent context files (AGENTS.md, CLAUDE.md, .cursorrules) that actually steer coding agents - commands, conventions, architecture, and boundaries, without bloat. Use when the user wants to set up or improve agent instructions for a project, asks why an agent keeps making the same mistake, or wants to make a codebase agent-friendly.

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 9 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

    shipping-and-launch

    Use when preparing to deploy to production. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.

    Also in 26 projects that use this

  • galandoSkill

    source-driven-development

    Version-aware, source-driven development — fetch official docs before writing framework code

    Also in 25 projects that use this

  • az9713Skill

    deprecation-and-migration

    Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.

    Also in 22 projects that use this

  • +6 more from LLl0k0laD

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 77 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    Instead of describing patterns, link them: "New Livewire components follow app/Livewire/Products/Index.php." One good example outperforms …

    line 72
  2. Distinctive:

    Don't duplicate; deeper files override/extend the root

    line 78
  3. Distinctive:

    Update in the same PR that changes a command or convention — a stale context file is worse than none

    line 87
  4. Distinctive:

    When auditing an existing file, report:

    line 92

“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

A context file is a standing prompt every agent session pays for. Every line either prevents a mistake or wastes tokens and attention.

When to use

  • "Set up an AGENTS.md / CLAUDE.md for this project"
  • An agent repeatedly makes the same mistake (wrong test command, wrong patterns, touching forbidden files)
  • Onboarding a codebase for agent-heavy development
  • Auditing an existing context file that has grown stale or bloated

Principles

  • Write what the agent can't infer. It can read code; it can't read your team's intentions, taboos, or tribal knowledge. Don't restate what ls reveals.
  • Commands over descriptions. composer test -- --filter=X beats a paragraph about the testing philosophy.
  • Every line earns its place. Context files are read on every session. 400 lines of boilerplate buries the 20 lines that matter.
  • Falsifiable rules. "Write clean code" steers nothing. "Controllers never touch Eloquent directly — go through a Service" is checkable.

Process

1. Mine the real friction

The best source is past mistakes: what has an agent (or new hire) gotten wrong in this repo?

  • Wrong build/test/lint commands
  • Ignored architectural rules (layering, naming, where things live)
  • Touched generated/vendored files
  • Used a deprecated pattern that still exists in the code as bad examples

2. Structure the file

Recommended skeleton (order = priority):

# <Project>

One paragraph: what this is, stack, what kind of app.

## Commands
- dev / build / test (full + single test) / lint / format — exact, copy-pasteable

## Architecture
3–8 bullets: layers, where things live, the one diagram-in-words that matters.

## Conventions
The rules an agent would otherwise break. Each one concrete:
- "X goes in Y"
- "Never do Z; do W instead (see path/to/good-example)"

## Boundaries
- Files/dirs never to edit (generated, vendored, migrations already run)
- Actions requiring explicit confirmation (deploys, destructive db ops)

## Gotchas
Known traps: flaky test X, env var Y required locally, …

3. Point to exemplars

Instead of describing patterns, link them: "New Livewire components follow app/Livewire/Products/Index.php." One good example outperforms three paragraphs.

4. Layer for monorepos / large projects

  • Root file: global commands + cross-cutting rules only
  • Per-package/dir context files for local conventions — agents pick up the nearest one
  • Don't duplicate; deeper files override/extend the root

5. Test it

  • Fresh agent session, representative task, zero extra instructions — does it use the right commands and patterns?
  • Each failure = a missing or unclear line. Add the rule, not a transcript of the incident.

6. Maintain

  • Update in the same PR that changes a command or convention — a stale context file is worse than none
  • Quarterly prune: delete lines that no longer prevent anything

Output format

When auditing an existing file, report:

## Context audit: <file>

**Verified commands:** ran them — pass/fail per command.
**Keep:** lines doing real work.
**Fix:** stale/wrong lines (with correction).
**Cut:** boilerplate that restates the obvious — N lines.
**Add:** missing rules, sourced from <evidence: code pattern / past mistake>.

Anti-patterns

  • ❌ Generic filler: "write tests", "follow best practices", "be careful"
  • ❌ Documenting the directory tree the agent can ls itself
  • ❌ Context written once at project start and never touched again
  • ❌ One 600-line root file for a monorepo instead of layered files
  • ❌ Commands that were never actually run to verify they work
  • ❌ Describing a pattern in prose when a file path to a good example exists
  • ❌ Treating it as marketing copy ("this elegant codebase…") — it's an operations manual

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.