Yeda AI Tips · #196

Español

Keep Skills Flat, Keep Helpers in Source

Your AI skill folder is becoming a shadow codebase.

It starts innocently: a skill needs to parse a file, so you drop a little script next to it. Then another skill needs almost the same thing, so you copy it. Soon your skills directory is full of nested helpers, utility modules, and scripts — logic that is untested, duplicated across skills, and drifting away from the real code it was supposed to mirror. That's a shadow codebase, and it's the thing skills were meant to avoid.

Why nesting helpers backfires

A skill is a methodology — guidance the model reads and follows. A helper script is deterministic code — it runs the same way every time. Mixing them puts real logic somewhere with none of the safeguards real logic needs:

The mechanism: flat skills, sourced helpers

Two rules keep the boundary clean:

  1. Keep each skill a flat, single file — one self-contained methodology per skill, no nested script tree. If a skill grows past what one file should hold, split it into flat sibling files, not into subfolders of code.
  2. Put deterministic helpers in your real source tree, where they are tested, reviewed, and versioned. The skill references the tool; it doesn't contain it.
# Anti-pattern: shadow codebase
skills/
  release/
    SKILL.md
    scripts/
      bump_version.py      # untested, duplicated in two other skills
      changelog_utils.py

# Better: flat skill, helper lives in source
skills/
  release.md               # methodology only; says "run scripts/release/bump.py"
src/
  release/
    bump.py                # in the test suite, reviewed, single source of truth
    changelog.py
tests/
  release/test_bump.py

The skill tells the agent what to do and when; the source tree holds the code that does it deterministically.

Methodology vs. deterministic code

Belongs in a skillBelongs in source
NatureJudgment, guidance, when/whyFixed, repeatable behavior
TestedNo (it's prose)Yes, in your suite
Should be duplicatedNeverNever — import it
Changes viaEditing the docReviewed pull request

Progressive disclosure does the rest

Flat sibling skills pair naturally with progressive disclosure: the agent loads only the files a task actually needs, instead of pulling a whole nested tree into context. Fewer files loaded, each one focused, none of them a copy of code that lives — and is tested — somewhere else.

Power moves

Resources

Shipping AI or cloud systems? Yeda AI audits and hardens production LLM and agent pipelines. Talk to us · Read the blog