MCP Server Builder
anthropics/skills
Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.
Plan a feature or task in fast, full, or ultra mode. An agent skill from unxed/f4.
$ npx skills add unxed/f4 --skill aif-plan -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install unxed/f4 aif-plan --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/aif-plan .claude/skills/aif-plan && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "aif-plan" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-plan into .claude/skills/aif-plan/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-plan", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/unxed/f4/tree/main/.agents/skills/aif-planType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add unxed/f4 --skill aif-plan -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install unxed/f4 aif-plan --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/aif-plan .agents/skills/aif-plan && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "aif-plan" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-plan into .agents/skills/aif-plan/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-plan", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add unxed/f4 --skill aif-plan -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install unxed/f4 aif-plan --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/aif-plan .cursor/skills/aif-plan && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "aif-plan" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-plan into .cursor/skills/aif-plan/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-plan", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/unxed/f4.git --path .agents/skills/aif-plan--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add unxed/f4 --skill aif-plan -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install unxed/f4 aif-plan --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/aif-plan .gemini/skills/aif-plan && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "aif-plan" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-plan into .gemini/skills/aif-plan/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-plan", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install unxed/f4 aif-planInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add unxed/f4 --skill aif-plan -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/aif-plan .github/skills/aif-plan && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "aif-plan" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-plan into .github/skills/aif-plan/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-plan", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add unxed/f4 --skill aif-plan -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install unxed/f4 aif-plan --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/aif-plan .opencode/skills/aif-plan && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "aif-plan" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-plan into .opencode/skills/aif-plan/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-plan", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
aif-planPlan a feature or task in fast, full, or ultra mode. An agent skill from unxed/f4.
Aif Plan is an agent skill from unxed/f4. Plan a feature or task in fast, full, or ultra mode. Ultra creates an indexed multi-file bundle with deeply specified phases for execution by a smaller model. Use for "plan", "new feature", "start feature", "create tasks", or exhaustive implementation planning.
Its SKILL.md is about 13k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/EXAMPLES.md`, `references/TASK-FORMAT.md` and `references/ULTRA-FORMAT.md`).
It sits in Agent Workflows. The repository describes itself as: dual pane like a charm. The licence is BSD-3-Clause.
12 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 772edc7. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteGlobGrepBash(git *)Bash(cd *)Bash(cp *)Bash(mkdir *)Bash(basename *)Bash(shasum -a 256 *)…and 12 more on the same allowed-tools line.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gitFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Aif Plan loads about 13k tokens when it runs, and up to ~17k if it reads all its reference files. Until then it costs about 68 tokens; SKILL.md has 5,565 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from unxed/f4 at commit 772edc7, republished under its BSD-3-Clause licence (© unxed). 5,565 words, ~12,618 tokens.
.claude/skills/aif-plan/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.Create an implementation plan for a feature or task. Three modes:
.ai-factory/PLAN.md)index.md is the manifest/progress ledger and every implementation phase is a separate, deeply specified markdown file. Use it when planning with a stronger model for later execution by a smaller model.For ultra layout, detail requirements, integrity checks, and consumer behavior,
read references/ULTRA-FORMAT.md before creating or modifying the bundle.
Determine Handoff mode, task ID, and branch contract. Resolve each value independently so legacy callers that pass only HANDOFF_MODE and HANDOFF_TASK_ID still enter Handoff mode correctly:
HANDOFF_MODE: explicit prompt value if present; otherwise environment value; otherwise empty string.HANDOFF_TASK_ID: explicit prompt value if present; otherwise environment value; otherwise empty string.HANDOFF_BRANCH_PREPARED: explicit prompt value if present; otherwise environment value; otherwise 0.HANDOFF_BRANCH_NAME: explicit prompt value if present; otherwise environment value; otherwise empty string.Use the Bash tool only for values that were not passed explicitly in the prompt:
Bash: printenv HANDOFF_MODE || true
Bash: printenv HANDOFF_TASK_ID || true
Bash: printenv HANDOFF_BRANCH_PREPARED || true
Bash: printenv HANDOFF_BRANCH_NAME || trueThen check HANDOFF_MODE:
HANDOFF_MODE is 1 (autonomous Handoff agent)The Handoff coordinator already manages status transitions and DB writes directly. Do NOT call MCP tools (handoff_sync_status, handoff_push_plan). Instead:
AskUserQuestion — use sensible defaults (verbose logging, yes to tests, yes to docs, skip roadmap linkage).fast.HANDOFF_TASK_ID is non-empty, you MUST insert <!-- handoff:task:<HANDOFF_TASK_ID> --> as the very first line of the plan entrypoint (index.md for ultra; the plan file otherwise), before the title. This annotation links the plan to its Handoff task for bidirectional sync. Omitting this annotation when HANDOFF_TASK_ID is set is a bug — verify before completing.Handoff owns branch creation at the agent-code level. The skill must NOT create or switch branches when Handoff has prepared one. Apply these rules:
If HANDOFF_BRANCH_PREPARED is 1:
git checkout, git pull, or git checkout -b.--parallel as disabled for all downstream behavior.HANDOFF_BRANCH_NAME from the prompt / env.Bash: git rev-parse --abbrev-ref HEADHANDOFF_BRANCH_NAME exactly. Do not accept partial matches, prefix matches, or "branch contains /" heuristics.HANDOFF_BRANCH_NAME, STOP. Report a blocker in the plan summary:
Branch drift: expected <HANDOFF_BRANCH_NAME>, actual <current>.Do NOT "fix" drift by switching or creating a branch — Handoff classifies that asBranchIsolationError/blocked_external.
HANDOFF_BRANCH_NAME (with / replaced by -) as the full/ultra plan identifier stem. Full writes <configured plans dir>/<stem>.md; ultra writes <configured plans dir>/<stem>/index.md. Skip the slug derivation in Step 1.2.If HANDOFF_MODE is 1 but HANDOFF_BRANCH_PREPARED is unset or 0:
git.create_branches config.HANDOFF_MODE is NOT 1 (manual Claude Code session)If polishing an existing plan, extract the Handoff task ID from the <!-- handoff:task:<id> --> annotation on the first line of the plan entrypoint (if present). If creating a new plan and no annotation context exists, skip all MCP sync — there is no linked Handoff task.
If a task ID IS found in the plan annotation, sync with Handoff via MCP tools:
handoff_sync_status with { taskId: <extracted-id>, newStatus: "planning", sourceTimestamp: "<current UTC time in ISO 8601 format>", direction: "aif_to_handoff", paused: true }.handoff_push_plan with { taskId: <extracted-id>, planContent: <full plan text> }. For ultra, serialize the bundle as index.md followed by every Phase Index file in order, each prefixed with <!-- ultra-phase:<relative-path> -->. Then call handoff_sync_status with { taskId: <extracted-id>, newStatus: "plan_ready", sourceTimestamp: "<current UTC time in ISO 8601 format>", direction: "aif_to_handoff", paused: true }.CRITICAL: Always pass paused: true with every handoff_sync_status call except done. This prevents the autonomous Handoff agent from picking up the task while you work manually. Only done passes paused: false.
Preserve the <!-- handoff:task:<id> --> annotation on the first line when rewriting the plan entrypoint.
FIRST: Read .ai-factory/config.yaml if it exists to resolve:
paths.description, paths.architecture, paths.roadmap, paths.research, paths.rules_file, paths.plan, paths.plans, paths.patches, paths.evolutions, paths.specs, paths.rules, and paths.archiveresearch_bundles_dir = <parent directory of paths.research>/research/ for opt-in ultra research bundles. No additional config key is required.language.ui for AskUserQuestion prompts, language.artifacts for generated plan files, and language.technical_terms for human-readable technical terminology in plan artifactsgit.enabled, git.base_branch, git.create_branches, and git.branch_prefixworkflow.plan_id_format — controls the full/ultra plan identifier shape. Allowed values: slug (default), timestamp, uuid, sequential. Only slug and sequential are active; timestamp and uuid are reserved and currently behave like slug (with an INFO log). The sequential value writes a full plan as <NNNN>_<plan_file_stem>.md and an ultra bundle as <NNNN>_<plan_file_stem>/index.md (see Step 1.2 for the canonical stem and algorithm). Treat any unknown value as slug and emit WARN [aif-plan] unknown workflow.plan_id_format=<value>; falling back to slug.If config.yaml doesn't exist, use defaults:
.ai-factory/ for all artifactsui_language: enartifact_language: entechnical_terms_policy: keepenabled: true, base_branch: main, create_branches: true, branch_prefix: feature/plan_id_format: slugResolved language values:
ui_language = language.ui || "en"artifact_language = language.artifacts || language.ui || "en"technical_terms_policy = language.technical_terms || "keep"If technical_terms_policy is not one of keep, translate, or mixed, treat it as keep. Legacy values such as english also behave like keep.
All AskUserQuestion prompts, progress updates, summaries, and next-step guidance MUST be written in ui_language.
Generated plan artifacts under paths.plan or paths.plans MUST be written in artifact_language.
For ultra this applies to index.md and every linked phase file.
Templates and examples define structure, not fixed English output. If artifact_language is not en, translate human-readable headings, labels, task prose, roadmap rationale, research summaries, settings explanations, and dependency notes before saving. Preserve markdown structure, checkbox syntax, task IDs, branch names, commit messages, commands, file paths, config keys, package names, API names, WARN/INFO labels, raw errors, and the exact ultra marker <!-- aif:plan-mode:ultra --> unchanged. Keep ## Research Context, Source:, Active Summary, Updated:, and SHA256: exact because downstream research drift checks parse them as compatibility tokens. Apply technical_terms_policy to other human-readable terminology.
Exception: the section heading and body of ## Original Request are fixed raw-source structure and must not be translated, summarized, normalized, or rewritten.
THEN: Read .ai-factory/DESCRIPTION.md (use path from config) if it exists to understand:
ALSO: Read the resolved architecture artifact if it exists (paths.architecture, default: .ai-factory/ARCHITECTURE.md) to understand:
Use this context when:
Read .ai-factory/skill-context/aif-plan/SKILL.md — MANDATORY if the file exists.
This file contains project-specific rules accumulated by /aif-evolve from patches,
codebase conventions, and tech-stack analysis. These rules are tailored to the current project.
How to apply skill-context rules:
Enforcement: After generating any output artifact, verify it against all skill-context rules. If any rule is violated — fix the output before presenting it to the user.
OPTIONAL (recommended): Read the resolved roadmap artifact if it exists (paths.roadmap, default: .ai-factory/ROADMAP.md):
/aif-implement milestone completion and /aif-verify roadmap gatesOPTIONAL (recommended): Resolve at most one relevant research source:
paths.research file.research_bundles_dir/<english-slug>/RESEARCH.md, but only when the sibling INDEX.md contains <!-- aif:research-mode:ultra --> exactly once and its ## Artifact Index links that RESEARCH.md. Do not treat arbitrary directories as research bundles.Status: active bundle; then the relevant legacy file. An explicit source means a concrete RESEARCH.md or bundle path named in the request or follow-up; it is user content, not a stripped command token.Topic: match, then a unique semantic match against Purpose / Active Summary. Never pick by recency. If no single match is clear or multiple sources would change scope, ask instead of merging or guessing. An explicitly referenced paused or superseded bundle requires a warning before use.INDEX.md first, then its linked RESEARCH.md. Read C4/ADR/dependency artifacts only for rationale needed by this plan. They are not independent requirement sources; material conclusions must already be reflected in the Active Summary.selected_research_path. Treat its ## Active Summary (input for /aif-plan) as an additional requirements source.## Sessions and linked optional artifacts only when you need deeper rationale.paths.research Active Summary topic when available. Otherwise use a single active marked ultra bundle; if several active bundles exist, ask the user to choose rather than guessing.research_influenced_plan = true only when the Active Summary supplies the default description or when constraints, decisions, goals, open questions, or session rationale from the research artifact shape the plan scope, tasks, settings, or tradeoffs. If the research artifact exists but is stale or unrelated to the user's requested task, leave research_influenced_plan = false, ignore it for plan requirements, and do not add ## Research Context.## Research Context with canonical Source: `<selected_research_path>` (Active Summary, Updated: <timestamp>, SHA256: <digest>) metadata. Omitting this plan-owned research copy is a bug because downstream skills treat the embedded Research Context as the plan's authoritative requirements and use the source research file only for drift checks.## Research Context after the Source: line, remove HTML comment blocks, preserve line order and leading whitespace, trim trailing spaces from every line, use LF line endings, and end with exactly one final newline. Calculate the digest without writing any temporary file or repository artifact: feed the normalized text through stdin / inline shell input to shasum -a 256; if shasum is unavailable, feed the same normalized text to sha256sum. Use the first output field as the SHA256: value.Do not auto-run git init.
Resolve the current git mode from config first:
git.enabled: true → git-aware workflow is allowedgit.enabled: false → no-git workflow onlygit.base_branch → target branch for diffs/merge guidance (default: detected branch or main)git.create_branches: true → full/ultra mode may create a branch/worktreegit.create_branches: false → full/ultra mode still creates its plan artifact, but stays on the current branch / repository stateIf git.enabled = false:
paths.plans/<slug>.md and ultra bundles under paths.plans/<slug>/index.md--parallel, --list, and --cleanup as unavailableIf git.enabled = true but the repository is not actually inside a git work tree:
Extract flags and mode from $ARGUMENTS:
--parallel → Enable parallel worktree mode (full/ultra only; requires `git.enabled=true` and `git.create_branches=true`)
--list → Show all active worktrees, then STOP (git-only)
--cleanup <branch> → Remove worktree and optionally delete branch, then STOP (git-only)
fast → Fast mode (first word)
full → Full mode (first word)
ultra → Ultra mode (first word)Parsing rules:
$ARGUMENTS:fast, full, or ultra only when used as the leading mode token--parallel, --list, and --cleanup <branch>original_user_request when it is non-empty: trim only outer whitespace introduced by command parsing, but keep internal whitespace, line breaks, wording, casing, and punctuation exactly. This is the user's original planning request and MUST be saved into the plan entrypoint later.--list and --cleanup execute immediately and STOP (do NOT continue to Step 1+)git.enabled = false, reject --parallel, --list, and --cleanup with a short explanation instead of trying git commands--parallel is set while git.create_branches = false, reject it with a short explanation because parallel mode requires branch creationIf the description is empty:
paths.research file exists and its Active Summary has a non-empty Topic:, default the description to that topic (no extra user input required), set it as selected_research_path, and leave original_user_request empty.RESEARCH.md has a non-empty Topic:, use that topic and file. If multiple marked active bundles exist, ask the user to select a topic/source.RESEARCH.md without an explicit user request MUST NOT include an Original Request section.original_user_request and save it into the plan entrypoint later.Original request contract:
/aif-plan ТУТ ЗАПРОС НА ПЛАН, /aif-plan full ТУТ ЗАПРОС НА ПЛАН, /aif-plan ultra ТУТ ЗАПРОС НА ПЛАН, or an answer to the description prompt), the generated plan entrypoint MUST include ## Original Request.## Original Request contains the exact user-provided request text after only recognized command tokens are removed and only outer whitespace is trimmed. Do not rewrite, summarize, translate, or normalize its wording, even when artifact_language differs.RESEARCH.md because the user did not provide a request, omit ## Original Request; the committed source is ## Research Context instead.## Original Request and ## Research Context.If --list is present, jump to --list Subcommand.
If --cleanup is present, jump to --cleanup Subcommand.
Mode selection:
fast keyword → fast modefull keyword → full modeultra keyword → ultra modeultra mode token:AskUserQuestion: Which planning mode?
Options:
1. Full (Recommended) — richer plan, asks preferences, optional branch/worktree flow when git settings allow it
2. Fast – quick plan, no branch, saves to the resolved fast plan pathIf the user did not provide a description and a research source was selected:
Active Summary topicfull vs fast (no description prompt needed)ultra tokenFor concrete parsing examples and expected behavior per command shape, read references/EXAMPLES.md (Argument Parsing).
From the description, extract:
Use Task tool with subagent_type: Explore to understand the relevant parts of the codebase. This runs as a subagent and keeps the main context clean.
Based on the parsed description, launch 1-2 Explore agents in parallel:
Task(subagent_type: Explore, model: sonnet, prompt:
"In [project root], find files and modules related to [feature domain keywords].
Report: key directories, relevant files, existing patterns, integration points.
Thoroughness: quick. Be concise — return a structured summary, not file contents.")Rules:
ULTRA-FORMAT.md..ai-factory/DESCRIPTION.md already provides sufficient context, this step can be skippedThis step produces two distinct values:
branch_name — the git branch (only when git.enabled = true and git.create_branches = true)plan_file_stem — the canonical unprefixed plan stem under <configured plans dir>/plan_identifier — plan_file_stem with an optional NNNN_ prefix; it becomes the full-plan filename stem or ultra directory nameThese are derived in a fixed order so the producer here and the branch-based consumers in /aif-implement / /aif-improve / /aif-verify / /aif-rules-check always agree on either the full-plan file or ultra entrypoint.
plan_file_stemPick the first matching case:
HANDOFF_BRANCH_PREPARED = 1 → plan_file_stem = HANDOFF_BRANCH_NAME with every / replaced by -. Skip slug generation entirely. No branch_name is created here (Handoff already owns the branch).git.enabled = true AND git.create_branches = true → generate a description slug, then branch_name = <git.branch_prefix><slug> (default prefix: feature/). Set plan_file_stem = branch_name with every / replaced by - (for example feature-user-authentication).git.enabled = false OR git.create_branches = false) → plan_file_stem = <description slug>. No branch_name is created.Slug rules (cases 2 and 3):
Branch examples (case 2):
feature/user-authenticationfix/cart-total-calculationrefactor/api-error-handlingchore/upgrade-dependenciesInvariant: branch-based consumer skills compute their lookup stem as current-branch-with-slashes-replaced. Cases 1 and 2 above already match that. Case 3 never has a branch, so consumers fall back to the lone full/ultra plan artifact in <configured plans dir>/ (see aif-implement Step 0.2). Producing a plan_file_stem outside these rules breaks discovery.
workflow.plan_id_format prefixDefault: no prefix. Set plan_identifier = plan_file_stem. Full writes
<configured plans dir>/<plan_identifier>.md; ultra writes
<configured plans dir>/<plan_identifier>/index.md.
Format-specific handling:
slug (default) → no prefix.timestamp / uuid → reserved values; treat as slug for now. Emit INFO [aif-plan] workflow.plan_id_format=<value> is reserved and behaves like slug; numbering is not applied. Do NOT invent a stem shape — branch-based consumers do not know how to discover non-sequential prefixes.WARN [aif-plan] unknown workflow.plan_id_format=<value>; falling back to slug. Behaves like slug here.sequential → apply the algorithm in 1.2.c to plan_file_stem to produce
plan_identifier.Sequential is force-disabled when HANDOFF_BRANCH_PREPARED = 1. In that case keep the bare plan_file_stem and emit INFO [aif-plan] sequential numbering disabled under HANDOFF_BRANCH_PREPARED=1.
Prepend a 4-digit numeric prefix to plan_file_stem to produce
plan_identifier. Compute the prefix from existing numbered full-plan files and
numbered directories whose index.md contains the exact ultra marker in
<configured plans dir>. The branch name (when one exists) stays unchanged so
existing git tooling, CI, and PR conventions are unaffected.
1. Find existing numbered plans in <configured plans dir>:
Glob A: <configured plans dir>/[0-9][0-9][0-9][0-9]_*.md
Glob B: <configured plans dir>/[0-9][0-9][0-9][0-9]_*/index.md
2. Every Glob A match is a numbered full-plan candidate.
For every Glob B match, Read index.md and keep it only when it contains the
exact marker <!-- aif:plan-mode:ultra -->. Ignore numbered directories whose
index.md lacks the marker; they are not plans and cannot consume an ID.
3. Parse the leading 4 digits from each retained full-plan filename or marked
ultra directory
basename into an integer. Deduplicate equal prefixes.
Filter out entries whose relevant basename does not match
^[0-9]{4}_.+(\.md)?$.
4. If any matches exist:
max_existing = max(prefixes)
If max_existing >= 9999:
ABORT with error:
"sequential cap reached: a plan numbered 9999 already exists in <configured plans dir>."
"Switch workflow.plan_id_format back to slug, or move the 9999-numbered file out of the directory (note: doing so will free 9999 for the next plan to reuse)."
next = max_existing + 1
Else:
next = 1
5. prefix = zero-padded 4-digit string of next (e.g. 1 → "0001", 42 → "0042")
6. Set plan_identifier = <prefix>_<plan_file_stem>
7. Final artifact:
full → <configured plans dir>/<plan_identifier>.md
ultra → <configured plans dir>/<plan_identifier>/index.mdImplementation notes:
Glob to enumerate candidates and Read to validate every numbered
ultra candidate's marker. Do NOT shell out to ls — aif-plan's
frontmatter does not grant Bash(ls *), so the ls path would fail in production.[0-9][0-9][0-9][0-9] glob is strict by contract: the format supports 0001..9999 only. The error in step 4 enforces this.--parallel scope (TL;DR — source-worktree scoped):<configured plans dir>
(the repo where /aif-plan was invoked) — i.e. exactly here, in Step 1.2.c.cd <WORKTREE> in Step 1.4.cd <WORKTREE>. The target dir is typically empty and would
re-allocate 0001 on every parallel run, breaking the cross-worktree numbering
contract on merge.Rules:
<configured plans dir>. Unmarked numbered directories are ignored. Deleting or moving a numbered plan out of the directory can free that number for reuse on the next run — keep plans in place if you rely on stable cross-references.paths.archive/plans/ by /aif-archive are not in <configured plans dir> and therefore not counted. Archiving the highest-numbered plan frees that number for reuse.10000_… so consumer globs (also 4-digit) cannot drift out of contract.<branch_prefix><slug> without a number.paths.plan is a single file) and fix plans (paths.fix_plan is a single file).Logging: INFO [aif-plan] resolved plan artifact: <path> (mode=<mode>, format=<value>).
IMPORTANT: Always ask the user before proceeding:
AskUserQuestion: Before we start, a few questions:
1. Should I write tests for this feature?
a. Yes, write tests
b. No, skip tests
2. Logging level for implementation:
a. Verbose (recommended) - detailed DEBUG logs for development
b. Standard - INFO level, key events only
c. Minimal - only WARN/ERROR
3. Documentation policy after implementation?
a. Yes — mandatory docs checkpoint at completion (recommended)
b. No — warn-only (`WARN [docs]`), no mandatory checkpoint
4. Roadmap milestone linkage (only if the resolved roadmap artifact exists):
a. Link this plan to a milestone
b. Skip — no linkage (allowed; `/aif-verify --strict` should report WARN, not fail, for missing linkage alone)
5. Any specific requirements or constraints?Default to verbose logging. AI-generated code benefits greatly from extensive logging because:
Store all preferences — they will be used in the plan entrypoint and passed to /aif-implement.
Docs policy semantics:
Docs: yes → /aif-implement MUST show a mandatory documentation checkpoint and route docs changes through /aif-docsDocs: no (or unset) → /aif-implement emits WARN [docs] and continues without a mandatory docs checkpointIf the resolved roadmap artifact exists and the user chose milestone linkage:
If HANDOFF_BRANCH_PREPARED = 1 (Handoff owns the branch):
HANDOFF_BRANCH_NAME (slashes replaced by -) as the stem.git checkout, git pull, git checkout -b, or git worktree add.--parallel as disabled: do not create a worktree and do not auto-invoke /aif-implement.If git.enabled = false or git.create_branches = false:
paths.plansIf --parallel flag is set → create worktree:
Sequential prefix is already locked in. Step 1.2.c computed the
NNNN_prefix from the source worktree's<configured plans dir>before this step. Do NOT recompute it aftercd <WORKTREE>— the target worktree's plans dir is typically empty and would re-allocate0001, breaking the numbering contract on merge.
DIRNAME=$(basename "$(pwd)")
git branch <branch-name> <configured-base-branch>
git worktree add ../${DIRNAME}-<branch-name-with-hyphens> <branch-name>Convert branch name for directory: replace / with -.
Example:
Project dir: my-project
Branch: feature/user-auth
Worktree: ../my-project-feature-user-authCopy context files so the worktree has full AI context:
.ai-factory/skill-context/ as-is into the worktree.paths.patches directory into the same configured relative path inside the worktree.patch-cursor.json when you copied only a truncated patch set; that cursor is valid only with the full patch history..claude/) and untracked CLAUDE.md when present.Create changes directory and switch:
cd "${WORKTREE}"Display confirmation:
Parallel worktree created!
Branch: <branch-name>
Directory: <worktree-path>
To manage worktrees later:
/aif-plan --list
/aif-plan --cleanup <branch-name>Continue to Step 2.
If no --parallel → create branch normally:
git checkout <configured-base-branch>
git pull origin <configured-base-branch>
git checkout -b <branch-name>If branch already exists, ask user:
Ultra uses the full-mode preferences and optional branch/worktree setup above, then applies a stricter planning gate:
references/ULTRA-FORMAT.md completely.ULTRA-FORMAT.md.index.md last, after phase contents are stable, so its Phase Index,
task links, dependencies, and commit groups exactly match the phase files.ULTRA-FORMAT.md before presenting the
plan. Fix broken links, missing/duplicate task IDs, orphan phase files, and
inconsistent dependencies.Ultra must not defer material implementation decisions to the smaller model.
If evidence is insufficient for a safe decision, record a blocking open question
in index.md and stop the plan as not implementation-ready instead of hiding the
gap behind vague instructions.
Ask a shorter set of questions:
AskUserQuestion: Before we start:
1. Should I include tests in the plan?
a. Yes, include tests
b. No, skip tests
2. Any specific requirements or constraints?
3. Roadmap milestone linkage (only if the resolved roadmap artifact exists):
a. Link this plan to a milestone
b. Skip — no linkage (allowed; `/aif-verify --strict` should report WARN, not fail, for missing linkage alone)Plan file: Always the resolved paths.plan file (default: .ai-factory/PLAN.md).
From the description, identify:
If requirements are ambiguous, ask clarifying questions:
I need a few clarifications before creating the plan:
1. [Specific question about scope]
2. [Question about approach]Before planning, understand the existing code through parallel exploration.
Use Task tool with subagent_type: Explore to investigate the codebase in parallel. This keeps the main context clean and speeds up research.
Launch 2-3 Explore agents simultaneously, each focused on a different aspect:
Agent 1 — Architecture & affected modules:
Task(subagent_type: Explore, model: sonnet, prompt:
"Find files and modules related to [feature domain]. Map the directory structure,
key entry points, and how modules interact. Thoroughness: medium.")
Agent 2 — Existing patterns & conventions:
Task(subagent_type: Explore, model: sonnet, prompt:
"Find examples of similar functionality already implemented in the project.
Show patterns for [relevant patterns: API endpoints, services, models, etc.].
Thoroughness: medium.")
Agent 3 — Dependencies & integration points (if needed):
Task(subagent_type: Explore, model: sonnet, prompt:
"Find all files that import/use [module/service]. Identify integration points
and potential side effects of changes. Thoroughness: medium.")If full/ultra mode passed codebase reconnaissance from Step 1 — use it as a starting point. Focus Explore agents on areas that need deeper understanding.
For ultra, continue until the plan has code-level evidence for every phase:
Do not paste entire source files into phase plans; cite only the evidence needed to make implementation steps deterministic.
After agents return, synthesize:
Fallback: If Task tool is unavailable, use Glob/Grep/Read directly.
Create tasks using TaskCreate with clear, actionable items.
Task Guidelines:
Use TaskUpdate to set blockedBy relationships:
Determine plan artifact path: the values were already resolved in Step 1.2.
paths.plan.<configured plans dir>/<plan_identifier>.md.<configured plans dir>/<plan_identifier>/index.md plus
phase-NN-<slug>.md files in the same directory.slug, reserved timestamp / uuid, or Handoff-prepared branches,
plan_identifier = plan_file_stem.sequential, plan_identifier = <NNNN>_<plan_file_stem>.The plan_file_stem is always the canonical stem from Step 1.2.a (Handoff branch / git branch / description slug — in that order). Branch-based consumers reproduce the same stem at lookup time, so the producer must not deviate.
Before writing any unprefixed full/ultra target (default/reserved slug behavior
or a Handoff-prepared branch), check for the sibling representation
with the same stem: <plan_identifier>.md versus <plan_identifier>/index.md.
If either already exists, do not silently create a second active representation
or overwrite it. Ask the user to refine the existing plan, choose another
identifier, or explicitly replace it.
Before saving, ensure directory exists:
mkdir -p <configured plans dir>For ultra also create the resolved bundle directory before writing its files.
Full/fast plan file or ultra index.md must include:
<!-- aif:plan-mode:ultra --> exactly once near the top of index.md
(immediately after the optional first-line Handoff annotation). Never
translate, rewrite, or omit it. Consumers identify bundles by this marker,
not by localized human-readable labels such as Mode.Original Request section (required when the user explicitly supplied a planning request; omitted when the plan is created solely from RESEARCH.md)Settings section (Testing, Logging, Docs)Roadmap Linkage section (optional, only if the resolved roadmap artifact exists)Research Context section (optional, only if research content influenced this plan)Tasks section grouped by phases; in ultra this is the only task-checkbox sourceCommit Plan section when there are 5+ tasksIf original_user_request is non-empty:
## Original Request before ## SettingsIf the resolved roadmap artifact exists:
## Roadmap Linkage with Milestone: "..." and Rationale: ...## Roadmap Linkage with Milestone: "none" and Rationale: "Skipped by user"If research content influenced this plan:
## Research Context by copying only the Active Summary (do not paste full Sessions)Source: `<selected_research_path>` (Active Summary, Updated: <research Updated timestamp>, SHA256: <sha256 of copied Active Summary>) so /aif-implement, /aif-verify, /aif-improve, and related consumers know the exact committed research revisionshasum -a 256 or sha256sum through stdin / inline shell input, never through a temp file, and copy the first output field.Research Context as the plan-owned authoritative requirements copy. A later change to the selected RESEARCH.md must not override these requirements without an explicit drift warning and user-requested rebase/refinement.If research exists but did not influence this plan, do not include ## Research Context. An existing RESEARCH.md for topic A plus an explicit /aif-plan request for unrelated topic B must produce an unlinked plan for topic B.
Use the canonical template in references/TASK-FORMAT.md for fast/full.
Use references/ULTRA-FORMAT.md for ultra and verify every Phase Index link,
task mapping, dependency, and phase file before completion.
The canonical template defines the required sections and ordering only. Render all human-readable plan content in artifact_language before writing the file, applying technical_terms_policy and preserving stable tokens as described in Step 0.
Commit Plan Rules:
Full/ultra mode + parallel (--parallel): Automatically invoke /aif-implement — the whole point of parallel is autonomous end-to-end execution in an isolated worktree. If HANDOFF_BRANCH_PREPARED = 1, treat --parallel as disabled and do not auto-invoke /aif-implement.
/aif-implement
CONTEXT FROM /aif-plan:
- Plan artifact: <resolved plan file or ultra directory> # see Step 1.2 / Step 5
- Testing: yes/no
- Logging: verbose/standard/minimal
- Docs: yes/no # yes => mandatory docs checkpoint, no => warn-onlyFull/ultra mode normal: STOP after planning. The user reviews the plan and decides when to implement.
The next-step templates below define structure only. Render all human-readable text in these user-facing responses in ui_language. Preserve command names, configured paths, task counts, and TaskList references unchanged.
Plan created with [N] tasks.
Plan artifact: <resolved plan file or ultra directory>
To start implementation, run:
/aif-implement
To view tasks:
/tasks (or use TaskList)Fast mode: STOP after planning.
Plan created with [N] tasks.
Plan file: <resolved fast plan path>
To start implementation, run:
/aif-implement
To view tasks:
/tasks (or use TaskList)Suggest the user to free up context space if needed: /clear (full reset) or /compact (compress history).
When --list is passed, show all active worktrees and their feature status. Then STOP.
git worktree listFor each worktree path:
<worktree>/<resolved paths.plans>, default: <worktree>/.ai-factory/plans/) and contains any root *.md plans or direct child */index.md entrypoints containing <!-- aif:plan-mode:ultra -->Output format:
Active worktrees:
/path/to/my-project (<configured-base-branch>) <- you are here
/path/to/my-project-feature-user-auth (feature/user-auth) -> Plan: feature-user-auth.md
/path/to/my-project-feature-billing (feature/billing) -> Ultra: feature-billing/index.md
/path/to/my-project-fix-cart-bug (fix/cart-bug) -> No plan yetWhen workflow.plan_id_format = sequential, the displayed file or directory
includes the numeric prefix, e.g. Plan: 0042_feature-user-auth.md or
Ultra: 0042_feature-user-auth/index.md. Pick the highest-numbered match across
both representations for the worktree's branch stem.
When --cleanup <branch> is passed, remove the worktree and optionally delete the branch. Then STOP.
DIRNAME=$(basename "$(pwd)")
BRANCH_DIR=$(echo "<branch>" | tr '/' '-')
WORKTREE="../${DIRNAME}-${BRANCH_DIR}"
git worktree remove "${WORKTREE}"
git branch -d <branch> # -d (not -D) will fail if unmerged, which is safeIf git branch -d fails because the branch is unmerged:
Branch <branch> has unmerged changes.
To force-delete: git branch -D <branch>
To merge first: git checkout <configured-base-branch> && git merge <branch>If the worktree path doesn't exist, check git worktree list and suggest the correct path.
Every TaskCreate item MUST include:
Never create tasks without logging instructions.
Use canonical examples in references/TASK-FORMAT.md:
paths.plan. Full:
paths.plans/<plan_identifier>.md. Ultra:
paths.plans/<plan_identifier>/index.md plus phase files.
plan_identifier uses the canonical handoff/branch/slug stem and optional
sequential prefix from Step 1.2; timestamp and uuid fall back to slug.paths.plans). Use owner commands (/aif-roadmap, /aif-rules, /aif-explore) for their artifacts.## Roadmap Linkage section in the plan (or explicitly state it was skipped).Fast mode (paths.plan, default: .ai-factory/PLAN.md)
/aif-implement may offer deletion after completionFull mode (paths.plans/<plan_identifier>.md — default)
plan_file_stem comes from Step 1.2.a: Handoff branch name (slashes replaced) → git branch name (slashes replaced) → description slug, in that orderworkflow.plan_id_format = sequential, the filename becomes
paths.plans/<NNNN>_<plan_file_stem>.md — the prefix is the next 4-digit
number after the highest existing numbered plan in the directory, capped at
9999. Numbers are derived from currently existing files: deleting or moving
a numbered plan out of the directory can free that number for reuse on the
next run. The Handoff branch contract force-disables the prefix (see Step
1.2.b–c).timestamp and uuid are reserved values; both currently behave like
slug (no prefix is applied)Ultra mode (paths.plans/<plan_identifier>/index.md)
index.md is the manifest and progress source; direct child phase files are
implementation specificationsreferences/ULTRA-FORMAT.md; do not
flatten it into a local single-file planFor concrete end-to-end flows (fast/full/ultra/parallel/interactive), read references/EXAMPLES.md (Flow Scenarios).
© unxed, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files (references) in .agents/skills/aif-plan of unxed/f4.
Open the folder on GitHubat commit 772edc7
Aif Plan next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Aif Plan this skillunxed/f4 | 243 | — | ~13k | Automated safety check: Pass | BSD-3-Clause | |
| MCP Server Builderanthropics/skills | 180k | 63 repos | ~2.3k | Automated safety check: Pass | Apache-2.0 | |
| Hook Development for Claude Code Pluginsanthropics/claude-plugins-official | 38k | 10 repos | ~4.1k | Automated safety check: Notes | Apache-2.0 | |
| Using Superpowersfarm-fe/farm | 5.6k | 35 repos | ~1.4k | Automated safety check: Pass | MIT | |
| Executing Plans Inlineobra/superpowers | 297k | 2 repos | ~5.1k | Automated safety check: Pass | MIT | |
| Skill CreatorAzure/azqr | 796 | 89 repos | ~8.2k | Automated safety check: Pass | Apache-2.0 |
anthropics/skills
Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.
anthropics/claude-plugins-official
Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.
farm-fe/farm
A skill your agent uses when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions
obra/superpowers
Has the agent carry out an implementation plan itself, task by task in the current session, keeping a ledger, proving each step with a test and ending with one whole-branch review.
Azure/azqr
Create new skills, modify and improve existing skills, and measure skill performance.
anthropics/claude-plugins-official
Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.
unxed/f4
Comprehensive documentation guide for Golang projects, covering godoc comments, README, CONTRIBUTING, CHANGELOG, Go Playground, Example tests, API docs, and llms.txt.
unxed/f4
Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt.
unxed/f4
Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…
unxed/f4
Security audit checklist based on OWASP Top 10 and best practices.
unxed/f4
Go (Golang) naming conventions — covers packages, constructors, structs, interfaces, constants, enums, errors, booleans, receivers, getters/setters, functional options, acronyms, test functions, and…
unxed/f4
Golang concurrency design — goroutine lifecycle and leak prevention, channels and select, channel ownership and direction, sync.Mutex/RWMutex/sync.Map/sync.Once/atomics, errgroup, singleflight…
Categories
Plan a feature or task in fast, full, or ultra mode. An agent skill from unxed/f4. Aif Plan is an agent skill from unxed/f4. Plan a feature or task in fast, full, or ultra mode.
Aif Plan fits situations like: exhaustive implementation planning.
Run `npx skills add unxed/f4 --skill aif-plan -a claude-code`. Or copy the skill folder (.agents/skills/aif-plan in unxed/f4) into .claude/skills/aif-plan in your project. Claude Code loads it when a task matches its description.
Run `npx skills add unxed/f4 --skill aif-plan -a codex`. Or copy the skill folder (.agents/skills/aif-plan in unxed/f4) into .agents/skills/aif-plan in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add unxed/f4 --skill aif-plan -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/aif-plan, .gemini/skills/aif-plan, .github/skills/aif-plan and .opencode/skills/aif-plan in your project.
Going by SKILL.md and its folder, Aif Plan needs the command-line tools its instructions call (git). Its frontmatter pre-approves these tools: Read, Write, Glob, Grep, Bash(git *), Bash(cd *), Bash(cp *), Bash(mkdir *), Bash(basename *), Bash(shasum -a 256 *), Bash(sha256sum *), TaskCreate, TaskUpdate, TaskList, AskUserQuestion, Questions, Task, mcp__handoff__handoff_sync_status, mcp__handoff__handoff_push_plan, mcp__handoff__handoff_get_task, mcp__handoff__handoff_list_tasks, mcp__handoff__handoff_update_task.
SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Aif Plan is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 13k tokens (SKILL.md is roughly 50k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.5k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Aif Plan: MCP Server Builder (anthropics/skills, 180k stars), Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars), Using Superpowers (farm-fe/farm, 5.6k stars) and Executing Plans Inline (obra/superpowers, 297k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
unxed (a GitHub user) maintains it in unxed/f4, which has 243 GitHub stars. The repository holds 36 skills in this directory. The repository was last updated on October 10, 2026.
Source: unxed/f4 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.