Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add an AGENTS.md line-budget pre-commit check to scripts/lint.py to prevent cumulative prompt context inflation

Closed Beginner friendly
#262 4 comments 1 reaction 1 assignee View on GitHub

Maintainers usually reply within 1 day

@JohnStrunk is already working on this.

Since Oct 12, 2026.

  • #271 by @fullsend-ai-coder — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start with scripts/lint.py and the spec-hierarchy-sync hook in .pre-commit-config.yaml, since the proposed scripts/check_agents_budget.py should follow the same pattern as scripts/check_spec_hierarchy.py. Confirm the budget ceiling (350 lines) with a maintainer before coding. Done when python scripts/lint.py --all-files passes on the current 324-line AGENTS.md and fails with the budget error once the file exceeds the limit.

Written by the indexing model from the issue text.

Description

enhancement feature infra ready-for-triage triaged

What happened

On PR #257, fullsend-ai-coder added 40 lines of new meta-rules to AGENTS.md, growing the file from 324 lines to 364 lines (over 2,300 words). ProtoBot's pre-commit suite and offline hook runner (python scripts/lint.py) passed without error, as did CI workflows (e.g. run 37963244752). The PR underwent 4 review rounds and 3 fix iterations before being closed unmerged by maintainer John Strunk due to token bloat ("That's a lot of tokens to add to AGENTS for a simple heading change.").

Historical analysis of AGENTS.md reveals that the file originated at 6 lines and 31 words (commit 1c05265) and has grown 65-fold over 30+ commits—primarily driven by successive retro-generated issues that added extensive meta-governance and prescriptive "Review agents must check..." instructions. AGENTS.md is injected into the system prompt of every agent dispatched in the repository (triage, code, review, fix, retro).

What could go better

ProtoBot has no deterministic gate preventing AGENTS.md from expanding indefinitely. Pre-commit hooks already validate formatting, yaml syntax, Go code, secrets, and spec hierarchy synchronization (scripts/check_spec_hierarchy.py), but line count and context budget for AGENTS.md are completely unconstrained.

If the repository maintained a line-budget check (e.g., hard cap of 350 lines or requiring consolidation for rule additions), the code agent on PR #257 would have caught the budget violation locally during pre-commit execution (python scripts/lint.py), preventing a bloated 40-line diff from being submitted and avoiding 4 review runs, 3 fix iterations, and $8.64 in wasted agent execution.

Confidence: High. ProtoBot already uses local Python scripts in scripts/ hooked into .pre-commit-config.yaml and scripts/lint.py for repository-specific invariants.

Proposed change

In redhat-et/ProtoBot:

  1. Create a lightweight check script scripts/check_agents_budget.py that:
    • Counts non-empty lines in AGENTS.md.
    • Enforces a maximum ceiling (e.g., 350 lines; AGENTS.md is currently 324 lines).
    • Exits non-zero with a clear error message if AGENTS.md exceeds the budget: ERROR: AGENTS.md exceeds the 350-line budget (%d lines). Consolidate existing rules or migrate instructions to on-demand skills before adding new prose.
  2. Register check_agents_budget.py as a local hook in .pre-commit-config.yaml under repo: local (similar to spec-hierarchy-sync) and wire it into scripts/lint.py.
  3. Add AGENTS.md budget verification to offline pre-commit runs so coding agents catch prompt bloat locally before committing.

Validation criteria

  1. Running python scripts/lint.py --all-files passes against the current 324-line AGENTS.md.
  2. Artificially adding >26 lines to AGENTS.md causes python scripts/lint.py and git commit to fail with the line-budget error.
  3. The next 5 PRs modifying AGENTS.md in redhat-et/ProtoBot remain under the 350-line budget or consolidate existing sections rather than inflating prompt size.

Generated by retro agent from https://github.com/redhat-et/ProtoBot/pull/257

Dominant language
Go
Stars
6
Forks
6
Avg merge
1d 2h
Merged PRs (30d)
96

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from redhat-et/ProtoBot

All issues in redhat-et/ProtoBot

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.