Skip to content

refactor(tooling): remove stale prompt cruft and capture hook step - #152

Merged
e128 merged 1 commit into
mainfrom
refactor/tooling-prompt-audit
Nov 11, 2026
Merged

e128 merged 1 commit into
mainfrom
refactor/tooling-prompt-audit

Conversation

@e128

@e128 e128 commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Executive Summary

Two verified defects in the always-loaded instruction surface, plus one lost build step.

AGENTS.md told every session to cut the file past 60 lines and was itself 262 lines. A size rule the file visibly breaks teaches a model that the rules are aspirational. The 42-line maintenance method moves to a lode file, and AGENTS.md keeps three rules plus a pointer.

.claude/agent-memory/leverage-advisor/session-2026-04-11.md asserted that scripts/session-health.sh stats did not exist. It exists and has for months, so the memory steered later sessions away from a working script. It also named an agent and three plan IDs that no longer resolve.

Separately, .claude/skills/script-discovery/references/build-phase.md jumped from 5b to 5d. The hook-registration step was lost when that skill was extracted from a saved prompt, so the skill could build a script and never wire its guardrail.

No performance measurement applies. This change touches no source code.

Code Changes

  • AGENTS.md: drop "Exercise abstract thinking", a restatement of trained behavior. Replace the six maintenance passes with three rules and a pointer. 262 lines become 234.
  • lode/infrastructure/instruction-file-maintenance.md: new file that owns the six passes and the stop condition. Entry added to lode/lode-map.md.
  • .claude/skills/script-discovery/references/build-phase.md: new 5c step covers the hook, the ask-tier settings.json edit, and the opencode guardrail parity that CI lint enforces. 5d now names scripts/readme-table-diff.sh. 5a states the bash 4.0 floor.
  • .claude/agents/build-validator.md: rule wall rewritten as plain prose with reasons. The opencode mirror is regenerated.
  • .claude/agent-memory/leverage-advisor/session-2026-04-11.md: corrected against the scripts and plans that exist today.
  • Removed: prompts/deterministic.md, whose build steps now live in the skill, and three empty skill directories that held only .DS_Store.

Tests and Tooling

Build and tests did not run. The change set holds no .cs files, so check.sh cannot move its outcome.

Checks that did run:

  • scripts/internal/analyzer-release-check.sh: clean, 214 source IDs, 0 unshipped.
  • scripts/readme-table-diff.sh --analyzer: no drift.
  • scripts/internal/opencode-agents.sh sync: 16 generated, 0 differences.
  • scripts/lode-check.sh on both lode files: 0 style hits.
  • scripts/internal/precommit.sh: PII scan clean.
  • scripts/lint-shell.sh: not applicable, no shell file changed.

Review Guide

Read AGENTS.md section "Instruction Files as a Memory of Failures" against lode/infrastructure/instruction-file-maintenance.md. The split is the substance: the always-loaded file keeps the rules, and the method moves out.

Check the 5c text against .claude/hooks/ and .opencode/plugins/e128-guardrails/index.ts. It describes the contract those files implement, so a mismatch there is a defect.

Rollback

Revert the merge commit. The removed directories and the removed prompt file restore with it. No state, migration, or cache depends on this change.

🤖 Generated with Claude Code

Trim AGENTS.md from 262 to 234 lines. The memory-of-failures section
restated a 60-line size rule the file itself broke, so the six
maintenance passes move to lode/infrastructure/instruction-file-maintenance.md
and the file keeps three rules plus a pointer.

Correct the leverage-advisor memory file, which claimed
session-health.sh stats did not exist. It does. Drop the plan IDs that
no longer resolve.

Restore the missing hook step in the script-discovery build phase. The
extraction from the old prompt dropped it, leaving 5b to jump to 5d.
Add scripts/readme-table-diff.sh to the routing check and state the
bash 4.0 floor.

Rewrite the build-validator rule wall in plain prose with reasons.
Remove three empty skill directories and the duplicated
prompts/deterministic.md.

Co-Authored-By: Claude
@e128
e128 merged commit d222d29 into main Nov 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant