agentleFS
JunMysteryJunMystery/Agent-Guidance-Python/AGENTS.md

Agent-Guidance-Python

AGENTS.md2 starsChanged 4 months agoMITArchived repositoryView on GitHub

agent-guidance-mcp saves tokens through 4 automatic mechanisms: Config (already set globally): AGENT_GUIDANCE_FILTER_LEVEL=aggressive, doc/skill caps reduced to 2K/3K — aggressive filtering by default. How to maximize savings: - Always use agent-guidance-mcp_task_pipeline → agent-guidance-mcp_project_context/agent-guidance-mcp_guidance instead of raw tools (Rule 3). - Call agent-guidance-mcp_token_stats at end of each phase to verify compression ratio. - If token usage is still high, set AGENT_GUIDANCE_TOKEN_OPT=0 to disable (not recommended). Tool naming note: Some MCP hosts prefix tool names with agent-guidance-mcp_ (e.g. agent-guidance-mcp_task_pipeline), while others expose bare…

The file

We split this AGENTS.md into the rules it gives an agent

11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always use agent-guidance-mcp_task_pipeline → agent-guidance-mcp_project_context/agent-guidance-mcp_guidance instead of raw tools (Rule 3).

    line 15
  2. Very specific:

    Call agent-guidance-mcp_token_stats at end of each phase to verify compression ratio.

    line 16
  3. Very specific:

    If token usage is still high, set AGENT_GUIDANCE_TOKEN_OPT=0 to disable (not recommended).

    line 17
  4. Very specific:

    Ask the user for approval in Ask/Revise stage.

    line 56
  5. Very specific:

    If errors/regressions arise, transition to Fix and then re-test.

    line 60
  6. Very specific:

    If unresolved after 3 attempts, you must STOP editing code, revert stage to Ask/Revise, and ask user for guidance.

    line 63
  7. Very specific:

    Context First: Call agent-guidance-mcp_task_pipeline or agent-guidance-mcp_project_context BEFORE any file read or code change.

    line 67
  8. Very specific:

    Standards Check: Use agent-guidance-mcp_guidance(operation="search") BEFORE implementing or answering any prompt.

    line 68
  9. Distinctive:

    Token Budget: Prefer MCP tools over raw file reads — built-in limits prevent context blowout.

    line 69
  10. Distinctive:

    No Direct FS: Never manually read/search files when MCP tools do it with optimization.

    line 70
  11. Very specific:

    Ground & Plan: Verify files/functions/symbols via search BEFORE proposing changes.

    line 71

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

Token Saving — Built-in Optimization

agent-guidance-mcp saves tokens through 4 automatic mechanisms:

  1. Bounded reads — agent-guidance-mcp_project_context(operation="read") caps at 300 lines; search caps snippets at 300 chars and limit at 20 results. Replaces expensive raw file reads.
  2. Content compression — Language-aware comment/whitespace removal, dedup, badge-stripping. Applies to every read/search response automatically.
  3. Per-type token budgets — Source files 3K, docs 2K, skills 3K, task_pipeline 12K tokens max per call.
  4. Tracking & reporting — Every optimized call records original vs. optimized tokens to SQLite. View with agent-guidance-mcp_token_stats (session) or agent-guidance-mcp_usage_report(scope="all") (lifetime).

Config (already set globally): AGENT_GUIDANCE_FILTER_LEVEL=aggressive, doc/skill caps reduced to 2K/3K — aggressive filtering by default.

How to maximize savings:

  • Always use agent-guidance-mcp_task_pipeline → agent-guidance-mcp_project_context/agent-guidance-mcp_guidance instead of raw tools (Rule 3).
  • Call agent-guidance-mcp_token_stats at end of each phase to verify compression ratio.
  • If token usage is still high, set AGENT_GUIDANCE_TOKEN_OPT=0 to disable (not recommended).

Tool naming note: Some MCP hosts prefix tool names with agent-guidance-mcp_ (e.g. agent-guidance-mcp_task_pipeline), while others expose bare names (task_pipeline). The examples below use prefixed names. When calling, always use the exact tool name shown in your available-tools list — never add or drop a prefix.

CRITICAL — Tool Rules (READ FIRST)

For EVERY user interaction — planning, implementation, testing, debugging, reviewing, refactoring, or any other action:

<!-- agent-guidance:start -->

Agent Guidance MCP — Tool Selection Priority

You need to...Use THIS tool firstWhy
Start any task or phaseagent-guidance-mcp_task_pipeline(task="...")Recommendations + tree + code search + UI in ONE call
Check coding standards / skillsagent-guidance-mcp_guidance(operation="search", query="...")No other tool provides standards or skill lookup
Read a fileagent-guidance-mcp_project_context(operation="read", relative_path="...")Token-capped at 300 lines — prevents context blowout
Search codebase textagent-guidance-mcp_project_context(operation="search", query="...")Ranked, bounded results. Fallback when codegraph unavailable
Understand code structureagent-guidance-mcp_project_context(operation="structure", relative_path="...")Hierarchical view of classes, methods, functions in a file
Extract symbolsagent-guidance-mcp_project_context(operation="symbols", relative_path="...")Flat list of classes, functions, methods with signatures
Get structured workflowagent-guidance-mcp_guidance(operation="workflow", identifier="plan") → "code" → "test"Enriched dev workflow with auto-chaining
Pre-code checklistagent-guidance-mcp_guidance(operation="precode", query="...")Coding conventions, security, testing, arch, deploy rules
Post-code verificationagent-guidance-mcp_guidance(operation="verify", query="...")Auto-detect test/review/security/audit/deploy; suggests next workflow
Skill feedback loopagent-guidance-mcp_guidance(operation="feedback", identifier="...", rating=1-5, query="...")Rate skills to boost future recommendations for similar tasks
Find symbol referencesagent-guidance-mcp_project_context(operation="references", query="...")Locate all usages of a symbol across the codebase
Get UI/design guidanceagent-guidance-mcp_ui_ux(operation="search", query="...")Style, colors, typography, charts, slides
Check workflow stageagent-guidance-mcp_workflow_gate(action="check"/"status"/"set_stage")Verify plan approvals and progress lifecycle
Persist/recover sessionagent-guidance-mcp_session_continuity(operation="save"/"load"/"clear")State recovery / task checklist continuity
Browse project treeagent-guidance-mcp_project_context(operation="tree")Optimized directory tree view

Standard Workflow Lifecycle & Feedback Loops

You must strictly follow this lifecycle for every feature or task: [Context] -> [Plan] -> [Ask/Revise] -> [Build] -> [Test/Recheck] -> [Fix] -> [Document/Proposal]

MANDATORY workflow rule: You BẮT BUỘC phải gọi workflow_gate(action="check", user_message="<tin nhắn cuối cùng của user>") ở đầu mỗi lượt phản hồi (turn) trước khi gọi bất kỳ tool nào khác. Nếu workflow_gate trả về plan_approved: false hoặc trả về lỗi WORKFLOW_STAGE_BLOCKED, bạn tuyệt đối không được viết code hay sửa file và phải quay lại xin chỉ thị.

  1. Planning Loop (Human <-> Agent):
    • Propose a plan in Plan stage.
    • Ask the user for approval in Ask/Revise stage.
    • Move to Build ONLY after user has explicitly approved (ok, proceed, approved, start, đồng ý, làm đi...).
  2. Execution & Quality Loop (Autonomous):
    • Transition to Test/Recheck after writing code in Build.
    • If errors/regressions arise, transition to Fix and then re-test.
  3. Circuit Breaker Rule:
    • Max 3 consecutive fix attempts for the same issue in the Execution Loop.
    • If unresolved after 3 attempts, you must STOP editing code, revert stage to Ask/Revise, and ask user for guidance.

Nine Mandatory Rules

  1. Context First: Call agent-guidance-mcp_task_pipeline or agent-guidance-mcp_project_context BEFORE any file read or code change.
  2. Standards Check: Use agent-guidance-mcp_guidance(operation="search") BEFORE implementing or answering any prompt.
  3. Token Budget: Prefer MCP tools over raw file reads — built-in limits prevent context blowout.
  4. No Direct FS: Never manually read/search files when MCP tools do it with optimization.
  5. Ground & Plan: Verify files/functions/symbols via search BEFORE proposing changes. Never guess.
  6. 300 LOC Cap: Split files exceeding 300 lines of code. No monolithic files.
  7. Intent Gate: Classify request type (trivial/explicit/exploratory/open-ended/ambiguous) before acting. If ambiguous, clarify first.
  8. Delegation Before Action: Decompose multi-step tasks and delegate to specialized subagents. Never implement directly when delegation is possible.
  9. Per-Phase Reset: For EACH new work phase (plan → implement → test → debug → review → refactor), re-call agent-guidance-mcp_task_pipeline with that phase's goal. Do NOT carry old context across phases. A new phase is a new task.

CRITICAL: All 9 rules apply to EVERY action without exception — planning, implementation, testing, debugging, reviewing, refactoring, or any other work. There is no action type exempt from these rules.

<!-- agent-guidance:end -->

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.