claude-code-prompt-improver
CLAUDE.md1.9k starsChanged 10 months agoMITView on GitHub
A declarative hook engine driven by a JSON nudge registry. One engine dispatches every hook event; each prompt-improvement capability is a data row in nudges/<EventName>/*.json, not a separate script. Adding an inject-context nudge is a single JSON file with zero Python changes. Core functionality: - One engine entry point (engine.py <EventName>) dispatched per hook event from hooks.json - Reads stdin once, runs the event's rules, merges inject_context fragments by priority, emits one JSON object, exits 0 always - improve nudge…
Trending
More talk lately.thin dataabout the whole repository
Who's talking about severity1/claude-code-prompt-improver
- @qdrddr.bsky.social“Prompt Enhancing #plugin for #Claude #Code #OSS MIT lic #PromptEngineering #ContextEngineering #CodeAgent …”Bluesky · May 16, 2026 · 7 likes
- @tom-doerr.bsky.social“https://github.com/severity1/claude-code-prompt-improver”Bluesky · Jun 14, 2026 · 1 likes
- anthropics/claude-code“[FEATURE] unvibe user prompts with optional prompt optimizer”GitHub · Oct 17, 2025 · 1 reactions
- sudosubin/agents.nix“claude-code-plugins.github.severity1.claude-code-prompt-improver: init at 0.6.3”GitHub · Oct 4, 2026
- sudosubin/agents.nix“agent-skills.github.severity1.claude-code-prompt-improver: 0.6.1 → 0.6.3”GitHub · Oct 3, 2026
The biggest 5 of 9 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 9
Talked about on GitHub and Bluesky (9 times).
On GitHub · 7
- Oct 17, 2025[FEATURE] unvibe user prompts with optional prompt optimizer — anthropics/claude-code1 reaction · 3 comments
- Oct 4, 2026claude-code-plugins.github.severity1.claude-code-prompt-improver: init at 0.6.3 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.severity1.claude-code-prompt-improver: 0.6.1 → 0.6.3 — sudosubin/agents.nix0 reactions
- Oct 2, 2026agent-skills.github.severity1.claude-code-prompt-improver: init at 0.6.1 — sudosubin/agents.nix0 reactions
- Mar 7, 2026feat: Add hook+skill two-layer prompt evaluation recipe to hooks-patterns — Jamie-BitFlight/claude_skills0 reactions · 5 comments
2 more on GitHub
- Dec 13, 2025Add auto-memory and prompt-improver plugins — anthropics/claude-plugins-official0 reactions
- Nov 6, 2025feat: integrate claude-code-prompt-improver with sequential hooks — azalio/map-framework0 reactions
On Bluesky · 2
- May 16, 2026Prompt Enhancing #plugin for #Claude #Code #OSS MIT lic #PromptEngineering #ContextEngineering #CodeAgent #AI #LLM #Agents #Coding… — @qdrddr.bsky.social7 likes and reposts
- Jun 14, 2026https://github.com/severity1/claude-code-prompt-improver — @tom-doerr.bsky.social1 likes and repost
In this repositoryOne other file it gives its agents.
- prompt-improverSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
20 rules. About 0 are common, 13 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Run all tests: pytest tests/ or python -m pytest
- Distinctive: line 30
Run specific test suite:
- Very specific: line 113
Do NOT add hooks field to plugin.json - hooks/hooks.json at standard location is auto-discovered
- Very specific: line 114
Do NOT add skills field to plugin.json - skills/ directory at standard location is auto-discovered
- Very specific: line 122
Default bypass policy in the engine suppresses prompt-targeted criteria rules on */#/empty/machine events.
- Distinctive: line 125
Use forward slashes (Unix-style) per Claude Code standards
- Distinctive: line 126
All paths in plugin configuration use forward slashes
- Distinctive: line 169
If clear: proceed immediately
- Distinctive: line 170
If vague: invoke prompt-improver skill, then research, questions, execute
- Distinctive: line 173
Create dynamic research plan via TodoWrite
- Distinctive: line 177
Use conversation history to avoid redundant exploration
- Distinctive: line 217
Keep the engine minimal - it runs on every prompt submission.
- Very specific: line 218
Prefer a pure-data nudges/<EventName>/*.json row over a new handler.
- Very specific: line 219
Add new handlers/matchers to the nudge_builtins allowlist dicts by string name only - never use eval/importlib/getattr-on-path
- Very specific: line 220
Never rename nudge_builtins to builtins - the stdlib module shadows any local builtins.py and the import silently resolves to stdlib
- Distinctive: line 224
Test bypass prefixes whenever modifying handler logic to prevent breaking slash commands
- Distinctive: line 225
When writing skill research steps, always pass file paths, errors, and prior decisions into every Explore prompt - Explore has no …
- Distinctive: line 226
Never call Glob, Grep, WebSearch, or WebFetch directly in main skill context - route them through Task/Explore to preserve context isolation
- Distinctive: line 240
Trust user intent: - Only ask when genuinely unclear
- Distinctive: line 241
Use conversation history: - Avoid redundant exploration
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude Code Prompt Improver
This file provides guidance to Claude Code when working with code in this repository.
<!-- AUTO-MANAGED: project-description -->Overview
A declarative hook engine driven by a JSON nudge registry. One engine dispatches every hook event; each prompt-improvement capability is a data row in nudges/<EventName>/*.json, not a separate script. Adding an inject-context nudge is a single JSON file with zero Python changes.
Core functionality:
- One engine entry point (
engine.py <EventName>) dispatched per hook event fromhooks.json - Reads stdin once, runs the event's rules, merges
inject_contextfragments by priority, emits one JSON object, exits 0 always improvenudge (always fires on UserPromptSubmit): evaluates clarity; clear prompts proceed, vague prompts invoke the prompt-improver skillapproach-assessmentnudge (UserPromptSubmit, priority 10, keyword match on non-trivial-work verbs, non_slash, ignorecase): injects approach-selection guidance (subagent vs orchestration vs just do it) and reminds that spawned subagents need context passed explicitly; self-cancels false positives with a leading conditionworkflownudge (UserPromptSubmit, priority 20): injects model-routing and plan-mode-first HITL guidance for workflow/deep-research/ultracode requestsplan-modenudge (UserPromptSubmit, priority 50, non_slash, always-evaluate): judges whether task complexity warrants entering plan mode before starting; owns the 'whether to plan at all' decision; approach-assessment owns 'which approach'plannudge (PreToolUse, self-gates on tool_name=EnterPlanMode): injects plan readability guidancesubagent-routingnudge (SubagentStart): injects breadth-over-depth guidance when an Explore or Plan agent spawnsbackground-execnudge (PreToolUse, matches tool_input.command on Bash): encourages background execution and token-efficient polling for long-running/never-exiting commandsoutput-readabilitynudge (UserPromptSubmit, keyword match): self-cancelling reminder to make substantial deliverables (report/review/summary/analysis) human-parsableask-user-questionnudge (UserPromptSubmit, priority 40, keyword match on decision/fork language, non_slash, ignorecase): self-cancelling nudge to route genuine user-owned decisions through AskUserQuestion tool with concrete options; research first when context is thin; pick sensible default for minor/reversible choices- Uses AskUserQuestion tool for targeted clarifying questions (1-6 questions)
<!-- END AUTO-MANAGED --><!-- AUTO-MANAGED: build-commands -->Build & Development Commands
Testing:
- Run all tests:
pytest tests/orpython -m pytest - Run specific test suite:
- Engine tests (end-to-end, subprocess per event):
pytest tests/test_engine.py - Rules tests (validate_rule, capability matrix, loader):
pytest tests/test_rules.py - Builtins tests (improve/workflow/saved_workflow_exists):
pytest tests/test_nudge_builtins.py - Skill tests:
pytest tests/test_skill.py - Integration tests:
pytest tests/test_integration.py - Plan guidance tests:
pytest tests/test_plan_guidance.py
- Engine tests (end-to-end, subprocess per event):
Installation:
- Add marketplace:
claude plugin marketplace add severity1/severity1-marketplace - Via marketplace:
claude plugin install prompt-improver@severity1-marketplace - Local dev:
claude plugin marketplace add /path/to/claude-code-prompt-improver/.dev-marketplace/.claude-plugin/marketplace.jsonthenclaude plugin install prompt-improver@local-dev - Manual: copy
scripts/engine.py,scripts/rules.py,scripts/nudge_builtins.py, and the wholenudges/tree withcp -r(keepscripts/andnudges/siblings), then add per-eventengine.py <EventName>dispatch entries to settings.json
<!-- END AUTO-MANAGED --><!-- AUTO-MANAGED: architecture -->Architecture
Engine Layer (scripts/):
engine.py: Event dispatcher and sole entry point - invoked asengine.py <EventName>- Reads stdin once as UTF-8 bytes (not text mode, which uses the locale code page on Windows); treats empty/invalid JSON as
{}(centralizes exit-0) - Runs the event's rules (each wrapped in try/except so one bad rule cannot suppress others), merges
inject_contextfragments byprioritywith a blank-line join _render_actionevaluatesappend_whenclauses against the rule'smatch_targetvalue (not hardcoded prompt) - required for non-prompt targets likeagent_type- Emits one
hookSpecificOutputobject; exits 0 always - missing/unknown event or no rules is a clean no-op that never reads stdin
- Reads stdin once as UTF-8 bytes (not text mode, which uses the locale code page on Windows); treats empty/invalid JSON as
rules.py: JSON loader,validate_rule, the event->capability matrix,rules_for(event)- Loads/validates
nudges/<EventName>/*.json(recursive glob); each rule'seventfield must match its parent directory name - mismatches skipped with a stderr note; files loose innudges/root are also skipped; loading never raises - Regexes compiled once per dispatched event, not at file load
- Loads/validates
nudge_builtins.py: The escape hatch - two allowlist dicts,MATCHERSandHANDLERSHANDLERS:improve(clarity wrapper, owns*///#bypass),workflow(model-routing guidance, owns keyword/slash detection +*/#bypass)MATCHERS:saved_workflow_exists(saved-workflow filesystem scan, resolves cwd/HOME at call time)- Referenced by string name only; unknown name = load-time skip + stderr. Never
eval/importlib/getattr-on-path - Named
nudge_builtins(notbuiltins) because the stdlibbuiltinsis loaded before user code and would permanently shadow a localbuiltins.py
Nudge Registry (nudges/<EventName>/*.json):
nudges/UserPromptSubmit/00-improve.json-improvehandler, always-fires clarity wrappernudges/UserPromptSubmit/10-approach-assessment.json- pure data, priority 10, keyword match on non-trivial-work verbs (implement/build/refactor/migrate/redesign/rewrite/integrate/set up/across/multiple), non_slash, ignorecase, approach-selection guidance (subagent/orchestration/just-do-it) + subagent context reminder; plan judgment removed (owned by plan-mode nudge)nudges/UserPromptSubmit/20-workflow.json-workflowhandler, priority 20, workflow routing guidancenudges/UserPromptSubmit/30-output-readability.json- pure data, keyword match, self-cancelling human-parsable-deliverable remindernudges/UserPromptSubmit/40-ask-user-question.json- pure data, priority 40, keyword match on decision/fork language (which/should/prefer/choose/decide/decision/options/recommend/better/versus/vs/trade-offs/pick), non_slash, ignorecase, AskUserQuestion routing + research-first + sensible-default guidancenudges/UserPromptSubmit/50-plan-mode.json- pure data, non_slash only (no match patterns = always evaluates), priority 50, plan-mode judgment nudge - instructs model to self-assess complexity and enter plan mode if warranted; self-cancels on trivial tasks; owns "whether to plan at all"nudges/PreToolUse/00-plan.json- pure data, self-gates on match_target tool_name=EnterPlanMode, plan readability guidancenudges/PreToolUse/10-background-exec.json- pure data, match_target command (tool_input.command on Bash), background-execution + token-efficiency guidancenudges/SubagentStart/00-subagent-routing.json- pure data, match_target agent_type, breadth-over-depth guidance for Explore/Plan agents
Skill Layer (skills/prompt-improver/):
SKILL.md: Research and question workflow- 4-phase process: Research, Questions, Clarify, Execute
- Assumes prompt already determined vague by the improve nudge
- Links to reference files for progressive disclosure
references/: Detailed guides loaded on-demandquestion-patterns.md: Question templates and effective patternsresearch-strategies.md: Context gathering strategiesexamples.md: Real prompt transformations
Directory structure:
scripts/- Engine implementation (engine.py, rules.py, nudge_builtins.py)nudges/- Declarative rule rows, organized asnudges/<EventName>/*.jsonskills/prompt-improver/- Skill and reference filestests/- Test suite (engine, rules, nudge_builtins, skill, integration, plan_guidance)hooks/- Hook configuration (hooks.json, auto-discovered).claude-plugin/- Plugin metadata
<!-- END AUTO-MANAGED --><!-- AUTO-MANAGED: conventions -->Code Conventions
Hook output format:
- JSON structure following Claude Code specification
- UserPromptSubmit format:
{"hookSpecificOutput": {"hookEventName": "UserPromptSubmit", "additionalContext": "..."}} - PreToolUse/SubagentStart format: same shape with the matching
hookEventName - The engine echoes the dispatched event name into
hookEventName - Exit code 0 for all success paths and all no-op paths
- Hook commands use
python3 || pythonfallback for Windows compatibility
Declarative nudge schema (nudges/<EventName>/*.json):
- Each rule:
id(required),event(required, validated against the capability matrix),description(optional, never emitted) - Exactly one of
action(pure data:{type: inject_context, text: [lines], append_when: [...]}) orhandler(string naming a callable innudge_builtins.HANDLERS) textis an array of lines joined with newlines at load (clean multiline diffs)append_whenclauses match against the rule'smatch_targetvalue (not always the prompt) - required for rules withmatch_target: agent_typeortool_name- Optional
criteria(absent = always fire):match/excluderegex arrays,match_target(prompt|tool_name|agent_type|command, wherecommandreads the nestedtool_input.command),non_slash,flags,builtin(allowlisted matcher name) - Optional
bypass(default suppresses on*/#/empty for prompt targets;nonedisables) andpriority(int merge order, lower first)
Plugin auto-discovery:
- Do NOT add
hooksfield toplugin.json-hooks/hooks.jsonat standard location is auto-discovered - Do NOT add
skillsfield toplugin.json-skills/directory at standard location is auto-discovered - Integration test
test_plugin_configurationasserts both fields are absent
Bypass prefixes:
*prefix: Skip evaluation entirely, strip prefix from prompt (improve emits the bare prompt)/prefix: Slash commands bypass automatically#prefix: Memorize commands bypass automatically- Harness machine events (prompt starts with
<task-notification>,<command-name>,<command-message>,<local-command-stdout|stderr|caveat>, or<system-reminder>) bypass all prompt nudges; the prefix list lives once innudge_builtins.is_machine_event, shared by the engine and both handlers - Default
bypasspolicy in the engine suppresses prompt-targeted criteria rules on*/#/empty/machine events; handlers own their own bypass logic
File paths:
- Use forward slashes (Unix-style) per Claude Code standards
- All paths in plugin configuration use forward slashes
Skill structure:
- YAML frontmatter with name and description
- Skill name: lowercase, hyphens, max 64 chars
- Description: under 1024 chars, includes activation triggers
- Reference files: self-contained, one-level deep
- Writing style: imperative/infinitive form (avoid "you/your")
Testing:
- Tests use pytest-compatible functions (no test classes)
- Engine tests run
engine.py <event>via subprocess and validate merged JSON outputtest_rules_for_raising_still_exits_zero: in-process monkeypatch; forcesrules_forto raise, assertsmain()still exits 0 (issue #1)test_drop_in_fixture_nudge_fires_end_to_end: writes a fixture nudge JSON, verifies it fires on trigger and is absent on non-match, cleans up in finally (extensibility guarantee)test_append_when_respects_match_target: fixture nudge withmatch_target=agent_typeandappend_when; verifies appended text appears when agent_type matches (issue #3)test_approach_assessment_fires_on_complexity_keyword/test_approach_assessment_silent_on_trivial_prompt: verify approach-assessment nudge fires on non-trivial-work verbs and stays silent on trivial promptstest_ask_user_question_fires_on_decision_keyword/test_ask_user_question_silent_on_plain_prompt: verify ask-user-question nudge fires on decision/fork language and stays silent on plain promptstest_plan_mode_evaluates_on_any_prompt/test_plan_mode_silent_on_bypass: verify plan-mode nudge fires on every non-bypass prompt (including trivial ones) and stays silent on*prefix bypass
- Builtins tests unit-test
improve/workflow/saved_workflow_existsin-process - Rules tests cover
validate_rulerejection cases, the capability matrix, and the loader - Skill tests validate file structure, frontmatter, and references
- Integration tests verify end-to-end flow and architecture separation
- Python standard library only (json, sys, subprocess, pathlib, re, copy)
<!-- END AUTO-MANAGED --><!-- AUTO-MANAGED: patterns -->Detected Patterns
Declarative dispatch:
- One engine, many events:
engine.py <EventName>runs only that event's rules - A new inject-context capability is a
nudges/<EventName>/*.jsonrow, not a new script; the directory name is authoritative for the event - Pure-data rules (action) vs escape-hatch rules (handler) - exactly one per rule
- Fragments merge by
prioritywith a blank-line join, reproducing the old multi-hook concatenation
Progressive disclosure:
- Clear prompts: evaluation only, no skill load
- Vague prompts: evaluation + skill load + references
- Reference materials load only when needed
- Zero context penalty for unused reference materials
Evaluation flow:
- Engine runs the improve nudge, which wraps the prompt with evaluation instructions
- Claude evaluates using conversation history
- If clear: proceed immediately
- If vague: invoke prompt-improver skill, then research, questions, execute
Research and questioning:
- Create dynamic research plan via TodoWrite
- Research what needs clarification (not just the project)
- Ground questions in research findings (not generic assumptions)
- Support 1-6 questions for complex scenarios
- Use conversation history to avoid redundant exploration
Tool dispatch model (skill research phase):
- Task/Explore is the primary research carrier for broad codebase exploration
- Glob, Grep, WebSearch, WebFetch, and multi-file Read must be dispatched via Task/Explore - never called directly in main context
- Bash (git commands) runs in main context only - Explore agents cannot run Bash
- Explore agents are context-blind (no access to prior conversation turns) - every Explore prompt must include relevant context explicitly
<!-- END AUTO-MANAGED --><!-- AUTO-MANAGED: git-insights -->Git Insights
Key architectural decisions:
- Migrated from hook-only to skill-based architecture for significant token reduction on clear prompts
- Auto-discovery: both
hooks/hooks.jsonandskills/at standard locations remove need forhooksorskillsfields inplugin.json - Plugin distributed via severity1-marketplace for easy installation
- Progressive disclosure pattern chosen to minimize context overhead for the common case (clear prompts)
- Added PreToolUse/EnterPlanMode hook to inject plan readability guidance without modifying the skill layer
- Collapsed three separate hook scripts into one declarative engine driven by a JSON nudge registry; a new inject-context capability is now a data row, not a new script
- Escape-hatch module named
nudge_builtins(notbuiltins) because the stdlibbuiltinsis loaded before user code and would permanently shadow a localbuiltins.py; handlers/matchers referenced by allowlisted string name only (no eval/importlib) - Added SubagentStart nudge (model/token-efficiency guidance per agent type) - a capability the old script layer could not express
Evolution:
- Started as embedded evaluation logic in hook script
- Extracted skill layer to separate evaluation (hook) from enrichment (skill)
- Added marketplace support for distribution
- Adopted subagent-first research dispatch: broad exploration (Glob, Grep, WebSearch, WebFetch, multi-file Read) routed through Task/Explore to isolate main context
- Added plan-guidance.py as a second hook script targeting plan mode entry
- Added workflow-guidance.py as a third hook script injecting model-routing guidance for dynamic workflow requests
- Refactored to a declarative engine:
improve/workflowbecame named handlers innudge_builtins.py,planbecame a pure-data nudge row, the three scripts and their two test files were deleted, and the test harness was rewritten onto the engine/rules/builtins seams (parity verified byte-for-byte against the old scripts) - Reorganized nudges/ from flat (
nudges/*.json) to per-event subdirectories (nudges/<EventName>/*.json); the loader now globs recursively and enforces that each rule'seventfield matches its parent directory name - files loose innudges/root are skipped; deletednudges/mcp-tools.json - Added output-readability nudge (UserPromptSubmit, keyword match, self-cancelling); moved background-exec from UserPromptSubmit to PreToolUse/Bash so it fires only when a Bash command is actually about to run - PreToolUse matcher now covers both EnterPlanMode and Bash
- Swapped merge priority of approach-assessment and workflow nudges on UserPromptSubmit: approach-assessment (general approach-selection guidance) now fires at priority 10 before workflow (narrow orchestration specialization) at priority 20; files renamed to match (10-approach-assessment.json, 20-workflow.json)
- Added ask-user-question nudge (UserPromptSubmit, priority 40, keyword match on decision/fork language): routes genuine user-owned ambiguous forks through AskUserQuestion with concrete options; research-first when context is thin; pick sensible default for minor choices - extends the "fire wide, self-cancel cheap" pattern
- Extracted plan-mode judgment from approach-assessment into a dedicated
50-plan-mode.jsonnudge (UserPromptSubmit, priority 50, always-evaluate via non_slash-only criteria); approach-assessment now focuses purely on approach selection (subagent/orchestration/just-do-it); plan-mode nudge owns "whether to plan at all" via model self-assessment with no keyword gate (complexity is not lexical)
<!-- END AUTO-MANAGED --><!-- AUTO-MANAGED: best-practices -->Best Practices
- Keep the engine minimal - it runs on every prompt submission; never add heavy imports or network calls
- Prefer a pure-data
nudges/<EventName>/*.jsonrow over a new handler; reach for a handler only when bypass logic or filesystem access is genuinely needed - Add new handlers/matchers to the
nudge_builtinsallowlist dicts by string name only - never use eval/importlib/getattr-on-path - Never rename
nudge_builtinstobuiltins- the stdlib module shadows any localbuiltins.pyand the import silently resolves to stdlib - Resolve cwd/HOME at call time in matchers (not module load) so tests can relocate them via monkeypatch
- A new event needs one dispatch entry in
hooks.json, an entry in therules.pycapability matrix, and anudges/<EventName>/subdirectory; keep tool matchers (e.g. EnterPlanMode) inhooks.jsonso the interpreter is not spawned on every tool call - Reference files should be self-contained so they work when loaded independently
- Test bypass prefixes whenever modifying handler logic to prevent breaking slash commands
- When writing skill research steps, always pass file paths, errors, and prior decisions into every Explore prompt - Explore has no conversation history access
- Never call Glob, Grep, WebSearch, or WebFetch directly in main skill context - route them through Task/Explore to preserve context isolation
- The workflow handler gates filesystem scanning behind a leading "/" check - non-slash prompts do zero I/O; preserve this pattern
- The workflow handler uses a conditional guard in its guidance to handle false positives at the model level - preserve this pattern when modifying guidance text
_render_actionevaluatesappend_whenclauses against the rule'smatch_target(not hardcoded prompt) - preserve this when modifying_render_actionor rules with non-prompt targets
<!-- END AUTO-MANAGED --><!-- MANUAL -->Design Philosophy
- Improve the prompt-to-output path - "prompt improvement" means shaping the total context so the first output lands, not literally rewriting the user's text. Clarifying a vague prompt and injecting a constraint the user would otherwise add by hand are the same job. This is why behavioral nudges (plan, workflow, approach-assessment, background-exec, subagent-routing, output-readability) belong here alongside
improve. - Rarely intervene - Most prompts pass through unchanged; each nudge fires only when it applies
- Fire wide, self-cancel cheap - a missed nudge costs a full correction loop, a false fire costs a few ignored tokens. The asymmetry justifies high-recall gates plus a leading "If this is X... if not, ignore" guard so false positives self-cancel at the model
- Serve both efficiency and quality, waste no tokens - every nudge must improve token efficiency and output quality, and the injected text is itself a token cost, so keep it directive: condition plus action, no flourish or restated motivation (modeled on
workflow). A nudge that spends tokens pushing for more work without a quality payoff is a violation - Steer, don't prescribe - give the agent the goal and the why, then trust it to find the how (modeled on
workflow), never a checklist or decision tree. Steering generalizes and self-cancels naturally; prescription reads as a mandatory procedure the agent follows even when it does not fit. Approach guidance (workflow,approach-assessment) has no single right answer, so it is pure steering; format conventions (plan,output-readability) have a defensibly right shape, so keep the concrete specifics and soften only the rule-like tone - Trust user intent - Only ask when genuinely unclear
- Use conversation history - Avoid redundant exploration
- Max 1-6 questions - Enough for complex scenarios, still focused
- Transparent - Injected context visible in conversation
Authoring rules (contributor guidelines)
- Audience rule - hook output is read by a specific audience:
SubagentStarttext is read by the subagent (how it should behave),UserPromptSubmit/PreToolUsetext by the main agent. Never inject author-side or parent-side advice where it cannot be acted on. (Example: "a subagent cannot see this conversation, so pass it context" is parent-side advice and belongs on a parent-read event likeUserPromptSubmit(approach-assessment), not onSubagentStart.) - Timing rule -
PreToolUseadditionalContextlands next to the tool result, read on the next model request. ForEnterPlanModethat context persists for the whole plan-mode session, so it is the right place for pre-presentation guidance (plan readability and the self-review pass) - it covers both initial creation and every revision. AnExitPlanModenudge would land after the plan is already presented (too late), and the engine only emitsinject_context, notpermissionDecisiongating, so it could not block either. - Self-cancel iff high-recall gate - a nudge gated by a high-recall regex (cannot read intent) leads with a condition and ends with "if not, ignore" so false positives self-cancel cheaply. A nudge gated by an exact match (e.g.
planontool_name=EnterPlanMode) needs no self-cancel - the condition is already certain at fire time.
<!-- END MANUAL -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

