Stop bloating your context window.

TL;DR: Create small, specialized files with specific rules to keep your AI focused, accurate and preventing hallucinations.

Common Mistake āŒ

You know the drill - you paste your entire project documentation or every coding rule into a single massive Readme.md or Agents.md.

Then you expect the AI to somehow remember everything at once.

This overwhelms the model and leads to "hallucinations" or ignored instructions.

Problems Addressed šŸ˜”

How to Do It šŸ› ļø

  1. Find repetitive tasks you do very often, for example: writing unit tests, creating React components, adding coverage, formatting Git commits, etc.
  2. Write a small Markdown file (a.k.a. skill) for each task. Keep it between 20 and 50 lines.
  3. Follow the Agent Skills format.
  4. Add a "trigger" at the top of the file. This tells the AI when to use these specific rules.
  5. Include the technology (e.g., Python, JUnit) and the goal of the skill in the metadata.
  6. Give the files to your AI assistant (Claude, Cursor, or Windsurf) only when you need them, restricting context to cheaper subagents (Junior AIs) invoking them from a more intelligent (and expensive) orchestrator.
  7. Have many very short agents.md for specific tasks following the divide-and-conquer principle.
  8. Put the relevant skills on agents.md.

Benefits šŸŽÆ

Context 🧠

Modern AI models have a limited "attention span."

When you dump too much information on them, the model literally loses track of the middle part of your prompt.

Breaking instructions into "skills" mimics how human experts actually work: they pull specific knowledge from their toolbox only when a specific problem comes up.

Skills.md is an open, standardized format for packaging procedural knowledge that agents can use.

Originally developed by Anthropic and now adopted across multiple agent platforms.

SKILL.md file contains instructions in a structured format with YAML.

The file also has progressive disclosure. Agents first see only the skill name and description, then load full instructions only when relevant (when the trigger is pulled).

Prompt Reference šŸ“

Bad prompt 🚫

Here are 50 pages of our company coding standards and business rules. 

Now, please write a simple function to calculate taxes.

Good prompt šŸ‘‰

After you install your skill:

Good Prompt

Use the PHP-Clean-Code skill. 

Create a tax calculator function 
from the business specification taxes.md

Follow the 'Early Return' rule defined in that skill.

Considerations āš ļø

Using skills for small projects is overkill.

If all your code fits comfortably in your context window, you're wasting time writing agents.md or skills.md files.

You also need to keep your skills updated regularly.

If your project architecture changes, your skill files must change too, or the AI will give you outdated advice.

Remember, outdated documentation is much worse than no documentation at all.

Type šŸ“

[X] Semi-Automatic

Limitations āš ļø

Don't go crazy creating too many tiny skills.

If you have 100 skills for one project, you'll spend more time managing files than actually coding.

Group related rules into logical sets.

Tags šŸ·ļø

Level šŸ”‹

[X] Intermediate

Conclusion šŸ

Modular skills turn a generic AI into a specialized engineer that knows exactly how you want your code written.

When you keep your instructions small, incremental, and sharp, you get better results.

More Information ā„¹ļø

https://skills.sh/?embedable=true

https://agentskills.io/home?embedable=true

Also Known As šŸŽ­

Tools 🧰

Most skills come in different flavors for:

Disclaimer šŸ“¢

The views expressed here are my own.

I am a human who writes as best as possible for other humans.

I use AI proofreading tools to improve some texts.

I welcome constructive criticism and dialogue.

I shape these insights through 30 years in the software industry, 25 years of teaching, and writing over 500 articles and a book.


This article is part of the AI Coding Tip series.

https://hackernoon.com/ai-coding-tip-003-force-read-only-planning?embedable=true