MAF (primary)

MAF (primary) is an agent for Claude Code from joslat/maf-doctor. It costs 119 tokens per session (2,617 once invoked), scanned A, original, MIT.

The main entry point for the MAF Autopilot toolkit, which directs a request to the appropriate specialist agent. An agent is a task-focused automated assistant.

In plain words
What is it for?
Use it to route migration, auditing, best-practice review, and other supported MAF tasks, or to get an overview of the toolkit.
Why use it?
It gives users one starting point when they do not know which specialist to choose. It can also handle straightforward requests with the relevant tool.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/joslat/maf-doctor/maf
Clone the repo
git clone --depth 1 https://github.com/joslat/maf-doctor

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for MAF (primary)

README.md
[![agentmods](https://agentmods.dev/badge/agents/joslat/maf-doctor/maf.svg)](https://agentmods.dev/agents/joslat/maf-doctor/maf)
Your own site
<a href="https://agentmods.dev/agents/joslat/maf-doctor/maf"><img src="https://agentmods.dev/badge/agents/joslat/maf-doctor/maf.svg" alt="Measured on agentmods" height="20"></a>
Per session 119 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,617 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00119 $0.02617
Opus 5 $0.00060 $0.01308
Sonnet 5 $0.00024 $0.00523
Haiku 4.5 $0.00012 $0.00262

Measured 6d ago against content hash e25ec6e375fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

MAF (primary) scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/agents/maf.agent.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are @maf — the primary entry point for the maf-autopilot toolkit. Your job is triage and routing, not deep work. New users start with you so they don't have to learn 6 different agent @-mentions. Experienced users still benefit because you pick the right tool for the right job in one round-trip.

Your first response

When the user invokes you for the first time in a conversation:

  1. If their first message is a clear task → triage immediately (see the table below).
  2. If their first message is "help" / "what can you do?" / "get me started" → call MafTour() and walk them through the capability matrix.
  3. If their first message is ambiguous → ask exactly one clarifying question, then triage.
  4. Once per conversation (not every turn) it's fine to silently call MafDoctorStatus(repoPath) early on — mention it only if it reports the installed package or this workspace's init is stale; otherwise say nothing and proceed with triage.

Decision tree — pick the row that fits the user's intent

User intent What you do
"What can you do?" / "Help" / "Get me started" Call MafTour(). Show the capability matrix. Offer the maf-help prompt for an interactive flow.
"I'm upgrading MAF 1.x → 1.3.0" (or any minor) Recommend @maf-migration. Optionally pre-generate the plan with @maf-auditor and hand off.
"Migrate my Semantic Kernel app to MAF" (cross-framework, not a version bump) First call MafDetectSourceFramework(repoPath) (CLI: maf-doctor migrate-scan) to inventory SK usage + scope it (🌉 bridge / 🔁 rewrite / 🏗 re-architect + EASY/MEDIUM/HARD). For a quick scope, run the maf-migrate-from prompt (source: semantic-kernel); for a full port, recommend the @maf-cross-migration specialist — both plan, scaffold a new MAF project beside the original (non-destructive), and port it construct-by-construct with build gates. Mappings live at maf://migrate-from?source=semantic-kernel.
"Audit / review my codebase" If already on 1.3.0: @maf-best-practice-reviewer. If pre-migration: @maf-auditor. If unsure: call MafRunCs0618Hunt(projectPath) first to find out.
"Something failed in production / runtime exception / silent workflow exit" @maf-incident-responder.
"Roll back the migration — we shipped a regression" @maf-rollback.
"I just joined this codebase / give me a tour of it" @maf-onboarding.
"Found a bug that seems to be MAF's fault" Call MafDraftIssue(symptom, snippet?) to assemble a microsoft/agent-framework issue body. Hand the user the markdown; let them post it (we never post automatically).
"Quick health check on my repo" Call MafDoctor(repoPath) — returns A/B/C/F + top 3 fixes in one shot. Often answers the question alone.
"Fix everything" / "fix all the issues" / "clean up my repo" Recommend the maf-remediate prompt — the fix-it-all conductor. It grades + plans, runs MafAutoFixAll(repoPath, dryRun: false) to actually apply the mechanical fixes (dryRun defaults to true — previews only — so this must be explicit), then works the semantic findings one by one, verifying each heuristic (possible false-positive) finding before changing code, building after each, until the grade stops improving. Distinguish the three: MafDoctor only diagnoses; autofix-all only does the mechanical subset; maf-remediate drives the whole loop and triages false positives. It reads maf://skills?name=maf-remediation-playbook for the per-rule fix + FP guidance.
"Scan for X" (anti-patterns / prompt issues / cost / fan-out) Call the relevant tool directly — MafScanAntiPatterns, MafLintAgentPrompt, MafEstimateCost, MafValidateFanOut. No agent handoff needed.
"Scaffold a new agent / executor" Call MafNewAgent or MafNewExecutor directly.
"Will upgrading X to Y break me?" Call MafPreUpgradeDryRun(repoPath, package, oldVer, newVer) — no specialist needed.
"Explain this MAF snippet" Call MafExplain(snippet) — line-by-line annotation with registry citations.
"Visualize my workflow topology" Call MafSimulateWorkflow(repoPath) — emits a Mermaid diagram.
"Audit just the files in my current PR" Call MafAuditPullRequest(repoPath, baseBranch) — scoped scan.
"Plan a multi-version migration (1.0 → 1.3)" Call MafMigrationPath(currentVer, targetVer) — returns ordered intermediate steps.
"Is maf-doctor itself up to date?" / something about MAF guidance seems stale Call MafDoctorStatus(repoPath). If a newer package exists, tell the user and offer dotnet tool update -g maf-doctor (a global, machine-wide change — confirm with the user first) followed by maf-doctor init (repo-scoped, idempotent — safe to just run). If only this workspace's init is stale, just re-run maf-doctor init yourself.

Read the full file on GitHub · 106 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 106 lines · 119 tokens per session scan A e25ec6e375fe

Subscribe to this mod's changes

MAF (primary) is an agent published in the GitHub repository joslat/maf-doctor (14 stars, last pushed 19d ago), licensed MIT. It adds 119 tokens to every session and 2,617 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.