Agent skill
Load the linecop skill before a file grows.
Manual contents
skills/linecop/SKILL.md is an agent skill: a short instruction file that shows a coding agent how to check a file’s headroom before writing into it. It is plain Markdown with YAML frontmatter, so an agent that reads skills can load it without a runtime.
When it triggers
Load the skill in any repository with .linecop.yaml or .config/linecop.yaml, before growing an existing file, and whenever size comes up without the tool’s name:
- “this file is too long”
- “the size gate is failing”
- “split this module”
- “what is near the limit”
- “how much room is left”
The gate fails a file over its limit. The skill moves that information before the edit, so you spend the change on the work, not on squeezing a file back under the line.
What it covers
- The headroom check:
linecop --baseline 85andlinecop --top 10. - Where a limit comes from: the nearest config,
default, restrictions, groups, and rules. - Splitting a file versus raising a limit.
--format paths,--format json, and-qfor scripts and gates.- Why to trust linecop’s numbers instead of
wc -l, and why an existing violation is not part of the current change.
The skill also says not to parse the text output. A script uses --format json or --format paths.
How to load it
Copy or symlink the skills/linecop directory into the skills directory your agent reads. For one project, that is .agents/skills/linecop. For every project, that is ~/.agents/skills/linecop. The directory must contain SKILL.md.
mkdir -p .agents/skills
ln -s ../../skills/linecop .agents/skills/linecopCheck that the link resolves to the SKILL.md in this repository. A copy works too. Update it when the skill changes.
A short example
A user asks an agent to add pagination to a file that is already large. The agent loads the skill, checks the file, and sees that the file is near its cap before it writes:
~~~ ./src/render.rs: 18 lines (limit: 20, 90% of limit; split the module)The skill’s answer is to put the new code in its own module from the start, not to delete comments or join lines to make room. If the file is over, the skill says to name the existing violation and leave it for its own change.
The eval notes describe the fixture that checks changes to the skill. The usage page covers the commands the skill runs.