=============== LIBRARY RULES =============== From library maintainers: - docs.faf.one is the canonical home of these pages; link there. - faf score gives 0-100%; 100% is Trophy (✪). Run faf auto to mark the slots an app type does not use as slotignored. ### Initialize card with interactive prompts Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/cards.md Run this command to start the interactive setup. It asks seven questions (name, short name, domain, description, version, where it runs, what it can do) and a few example questions, then writes agent.fafa and offers to generate the A2A card, MCP Server Card, AI Catalog, and ARD entries. Press Enter to be listed. ```bash npx faf-cli@latest card init ``` -------------------------------- ### Try faf on any GitHub repo Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/getting-started.md Clones the repo shallowly, reads its tree (languages, frameworks, docker-compose services, Makefile targets), and writes a scored project.faf. No install or config required. ```bash faf git facebook/react ``` -------------------------------- ### Install faf with bunx Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/getting-started.md Runs faf without installing. Equivalent commands: npx faf and pnpm dlx faf. To keep it, use npm i -g faf-cli. ```bash bunx faf ``` -------------------------------- ### Initialize card with package and kind flags Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/cards.md Use --package instead of --url for something people install, and --kind to say what it is: mcp (default), cli, or library. A bare package name is npm; pypi: and crates: name other registries. This example uses pypi:my-lib with kind library. ```bash faf card init --package pypi:my-lib --kind library # plus the other answers ``` -------------------------------- ### Run faf to detect stack Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/getting-started.md Detects your stack, writes project.faf, and scores it 0–100%. ```bash faf ``` -------------------------------- ### faf bench sample output Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Example output from faf bench showing the question list and qset identifier. ```text faf bench — 12 questions qset 4d6fc2ab0d71 1. What is the project's name? 2. What is the project's goal — what is it for? 3. What is the primary programming language? … ``` -------------------------------- ### Export AGENTS.md with faf export --agents Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/getting-started.md Writes AGENTS.md from project.faf, or prefaces an existing one non-destructively. Also supports --gemini, --cursor, --copilot, and --all. ```bash faf export --agents ``` -------------------------------- ### faf context sample output Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Example output from faf context showing filled slots. ```text project.name: faf-cli project.main_language: TypeScript human_context.who: Developers and teams using AI coding assistants stack.build: Bun (bun build) + tsc … ``` -------------------------------- ### faf info sample output Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Example output from faf info showing version and IANA media type. ```text faf v kernel IANA application/vnd.faf+yaml ``` -------------------------------- ### faf convert command examples Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Prints project.faf as YAML, or as JSON with --json. Nothing is written. ```bash faf convert faf convert --json ``` -------------------------------- ### faf taf setup commands Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/taf.md Prints the workflow or writes .github/workflows/taf.yml with --write. --write refuses to replace an existing taf.yml and exits 1. ```bash faf taf setup # prints the workflow faf taf setup --write # writes .github/workflows/taf.yml ``` -------------------------------- ### faf search sample output Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Example output from faf search showing a format match. ```text formats — 1 match TypeScript .ts, .tsx, .mts, .cts [web] ``` -------------------------------- ### faf wjttc sample output Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Example output from faf wjttc showing files scanned, tests found, and tier breakdown. ```text faf wjttc — vendor-neutral test audit Files scanned: 164 Tests found: 1973 Tiers: ● BRAKE 693 (35%) ● ENGINE 808 (41%) … ``` -------------------------------- ### faf search command examples Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Finds slots and file formats by name. Use --slots for slots only and --formats for formats only. ```bash faf search typescript faf search hosting --slots # slots only faf search yaml --formats # formats only ``` -------------------------------- ### ARD metadata cards keywords and examples YAML Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/cards.md ARD metadata mapping .fafa keywords to tags and examples to representativeQueries. Entries without representative queries are valid but unfindable; two to five is recommended. ```yaml metadata: cards: keywords: [weather, forecast] # → tags examples: # → representativeQueries - "what is the weather in Lisbon tomorrow" - "will it rain in Berlin this weekend" ``` -------------------------------- ### Initialize card with flags for scripts and CI Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/cards.md Use this non-interactive form for automation. Every answer is a flag; nothing is asked. The --url flag with --protocol mcp is for a remote MCP server; use --package instead of --url for installable packages and --kind to specify mcp (default), cli, or library. A bare package name is npm; pypi: and crates: name other registries. --homepage sets the homepage (default https://). A 'where it runs' that is not a whole http(s) URL or valid package name is refused. card init never replaces an existing agent.fafa unless --force is passed. ```bash faf card init --name "Weather Agent" --domain example.com \ --description "Answers questions about the weather anywhere." \ --set-version 1.2.0 --url https://example.com/a2a \ --skill "Get forecast: A three-day forecast for a place." \ --example "Will it rain in Leeds tomorrow?" ``` -------------------------------- ### faf cards usage examples Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/cards.md Run faf cards to write every card your inputs allow, restrict to specific targets with --target, or print without writing using --check. ```bash faf cards # every card your inputs allow faf cards --target a2a,catalog # just these faf cards --check # print them, write nothing ``` -------------------------------- ### faf share command examples Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Creates a faf.one/share link carrying your project.faf. The link is built on your machine; nothing is sent anywhere. --copy copies to clipboard, --raw prints the encoded string only. ```bash faf share # print the link faf share --copy # and copy it to the clipboard faf share --raw # the encoded string only ``` -------------------------------- ### faf log sample output Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Example output from faf log showing three commits with score, change, date, commit hash, and tier. ```text 55% +34 2026-02-10 9fc1f60d ● YELLOW feat: faf 6ws command + install hang fix 21% +21 2026-02-08 81d42559 ○ RED fix: Remove legacy .faf warning for clean demo output 0% -55 2026-02-08 5b2f12d8 ♡ fix: Always update project.faf (not legacy .faf) in readme command ``` -------------------------------- ### Install, strict, and uninstall faf hooks Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/hooks.md Opt-in installation commands for the context guard pre-commit hook. Default warns on regression; --strict blocks the commit; --uninstall removes faf's hook block. Nothing is wired on npm install. ```bash faf hooks --install # warn on regression (default) faf hooks --install --strict # block the commit on regression faf hooks --uninstall # remove faf's hook block ``` -------------------------------- ### Run faf-mcp with npx or bunx Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/faf-mcp.md Starts the faf-mcp MCP server locally over stdio. Use npx or bunx; no env vars or config file needed. ```bash npx faf-mcp # or: bunx faf-mcp ``` -------------------------------- ### faf bench command examples Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Measures how well an AI answers questions about your project without project.faf, then with it. Questions come from populated slots; grading is mechanical. Use --json for data. ```bash faf bench # the steps, for you or your agent faf bench questions # the questions (--json for data) ``` -------------------------------- ### faf log command examples Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Shows the project.faf score at every commit that changed it. Reads git history only; nothing is written. Options include -n, --all, --reverse, and --json. ```bash faf log # newest first, 20 commits faf log -n 4 # the last 4 faf log --all # every commit faf log --reverse # oldest first faf log --json # the timeline as data ``` -------------------------------- ### Context regression warning output Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/hooks.md Example output printed when a staged .faf scores lower than HEAD. Shows the delta and labels it a context regression. ```text ⚠ faf: context 92% → 85% (−7) — context regression ``` -------------------------------- ### Example output of faf taf receipts Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/taf.md Sample output showing newest-first receipts with UTC times, passed/total counts, and skipped tests. The last line notes the data is as of the last fetch. ```text TAF receipts — faf-cli · 417 on origin/taf-receipts · times in UTC 2026-10-31 08:51 PASSED 2301/2302 1 skipped 2026-10-31 08:40 PASSED 2301/2302 1 skipped 2026-10-31 07:10 PASSED 2292/2293 1 skipped 2026-10-31 06:28 PASSED 2282/2283 1 skipped 2026-10-31 05:07 PASSED 2273/2274 1 skipped last 5: 5 PASSED as of your last fetch (git fetch origin taf-receipts) ``` -------------------------------- ### faf conductor command examples Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Moves context between project.faf and a Conductor config. export prints the config as JSON from project.faf; import reads a config file or folder into project.faf. ```bash faf conductor export # print the config, as JSON, from project.faf faf conductor import # read a config file or folder into project.faf ``` -------------------------------- ### Catalog host identifier JSON Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/cards.md Catalog JSON declaring the publisher via host.identifier. host.displayName lifts a catalog from minimal to discoverable; an empty displayName is invalid, so a .fafa naming nobody gets no host at all. ```json { "specVersion": "1.0", "host": { "displayName": "Acme Corp", "identifier": "acme.example" }, "entries": [ … ] } ``` -------------------------------- ### Import faf export as a library (TypeScript) Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Everything `faf export` does is importable from 'faf-cli'. This example reads a project.faf, enriches it with repo facts, and writes AGENTS.md exactly like `faf export --agents`. ```typescript import { readFaf, enrichFromRepo, writeAgentsMd } from 'faf-cli'; const data = readFaf(`${dir}/project.faf`); writeAgentsMd(dir, enrichFromRepo(dir, data)); // exactly `faf export --agents` ``` -------------------------------- ### Configure Grok FAF MCP server on a URL in ~/.grok/config.toml Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/grok-faf-mcp.md Add this TOML block to ~/.grok/config.toml to run the MCP server on a hosted URL. Restart Grok or run /mcps r after adding; nothing needs to be installed. ```toml [mcp_servers.grok-faf-mcp] url = "https://mcpaas.live/grok/mcp/v1" ``` -------------------------------- ### Decompile output JSON structure Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/fafb.md Example JSON output from faf decompile, showing version, flags, section count, total size, source checksum, and section details. ```json { "version": "2.0", "flags": 64, "section_count": 8, "total_size": 592, "source_checksum": "0xed7188cb", "sections": [ { "name": "faf_version", "priority": 255, "length": 19, "token_count": 4 } ] } ``` -------------------------------- ### injectFafBlock Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Injects a managed block into a file. Uses whole-line markers at column 0, ignores fenced examples, and prefixes files without markers. ```APIDOC ## injectFafBlock ### Description Injects a managed block into a file. Uses whole-line markers at column 0, ignores fenced examples, and prefixes files without markers. ### Method injectFafBlock ### Parameters - **path** (string) - Required - Path to the file. - **block** (string) - Required - The block content to inject. - **start** (string) - Optional - Start marker. - **end** (string) - Optional - End marker. - **root** (string) - Optional - Root directory. ### Returns - **void** - Writes the file. ### Example ```ts import { injectFafBlock } from 'faf-cli'; injectFafBlock(path, block); ``` ``` -------------------------------- ### faf wjttc command examples Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Audits a test suite by tier: Brake, Engine, Aero, Tyre and Pit. Reads TypeScript, JavaScript, Python, Rust, Go and Zig tests. --strict exits 1 if any test has no tier. --json for CI. ```bash faf wjttc # tests/ by default faf wjttc --path spec # another folder faf wjttc --strict # exit 1 if any test has no tier faf wjttc --json # for CI ``` -------------------------------- ### faf score output showing all 33 slots Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/scoring.md Example output listing all 33 slots. Active slots are marked with ●, slotignored slots with —. The score is filled ÷ active slots. ```text ✪ TROPHY 100% 12/12 slots — project.faf ● project.name … ● stack.cicd — stack.monorepo_tool: slotignored … — monorepo.remote_cache: slotignored ``` -------------------------------- ### Options can appear before or after subcommand Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/side-effects.md faf CLI allows options before or after the subcommand; `--` ends options. Match the flag (e.g., `--write`, `--install`, `--grok`, `--submit`) rather than word order. The same CLI runs as `faf` or `faf-cli`, and through npx, bunx, pnpm dlx, npm exec. ```bash faf taf --write setup # same as: faf taf setup --write faf memory -f soul.fafm etch "note" faf ai -- analyze ``` -------------------------------- ### Managed block markers Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Every writer wraps its output in a managed block delimited by faf:start and faf:end markers. Content between markers is replaced on re-run; content outside is preserved. ```markup … facts from project.faf … ``` -------------------------------- ### Run faf score with and without JSON output Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/scoring.md Scores project.faf from 0–100%. The score is deterministic: the same file always gets the same number. --json outputs the same result for scripts. ```bash faf score # score + every slot faf score --json # the same, for scripts ``` -------------------------------- ### faf demo command Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Runs a walkthrough on a sample project in a temporary folder of its own, removed at the end. Your project is never touched. ```bash faf demo ``` -------------------------------- ### Build a pack in the browser with buildPack Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/cards.md Use this snippet to run the same projector without Node. It imports buildPack from 'faf-cli/pack' and projects answers onto the specified cards. Pass faf (your parsed project.faf) for BEST. No filesystem, no Node built-ins, types included. ```javascript import { buildPack } from 'faf-cli/pack'; const pack = buildPack(answers, { cards: ['a2a', 'server_card', 'ai_catalog'] }); ``` -------------------------------- ### faf cards command Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/cards.md Runs faf cards to write the cards that your agent.fafa gives. Requires an agent.fafa file; without it, no agent cards are generated. ```bash faf cards # writes the cards your agent.fafa gives ``` -------------------------------- ### writeCopilotInstructions Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Renders and injects the copilot-instructions.md file into the specified directory. ```APIDOC ## writeCopilotInstructions ### Description Renders and injects the copilot-instructions.md file into the specified directory. ### Method writeCopilotInstructions ### Parameters - **dir** (string) - Required - Directory where the file will be written. - **data** (object) - Required - The .faf data to render. ### Returns - **void** - Writes the file. ### Example ```ts import { writeCopilotInstructions } from 'faf-cli'; writeCopilotInstructions(dir, data); ``` ``` -------------------------------- ### assembleFreshFaf Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Builds a fresh project.faf from a directory. ```APIDOC ## assembleFreshFaf ### Description Builds a fresh project.faf from a directory. ### Method assembleFreshFaf ### Parameters - **dir** (string) - Required - Directory of the project. ### Returns - **data** (object) - Fresh .faf data. ### Example ```ts import { assembleFreshFaf } from 'faf-cli'; const data = assembleFreshFaf(dir); ``` ``` -------------------------------- ### renderCopilotInstructions Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Renders the copilot-instructions.md content from .faf data and returns the string. ```APIDOC ## renderCopilotInstructions ### Description Renders the copilot-instructions.md content from .faf data and returns the string. ### Method renderCopilotInstructions ### Parameters - **data** (object) - Required - The .faf data. ### Returns - **string** - The rendered content. ### Example ```ts import { renderCopilotInstructions } from 'faf-cli'; const content = renderCopilotInstructions(data); ``` ``` -------------------------------- ### faf bench grade cold and with-faf commands Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Run bench twice in fresh AI sessions, saving answers as JSON. Cold run: AI answers without reading project.faf, CLAUDE.md, AGENTS.md or any .faf file. With-faf run: AI reads project.faf first. Grade each with the respective flags. ```bash faf bench grade cold.json --cold --tokens --model ``` ```bash faf bench grade faf.json --faf --tokens --model ``` -------------------------------- ### suggestIntent Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Provides suggestions for the goal and six W's, each with its source. ```APIDOC ## suggestIntent ### Description Provides suggestions for the goal and six W's, each with its source. ### Method suggestIntent ### Parameters - **dir** (string) - Required - Directory of the project. - **faf** (object) - Optional - Existing .faf data. ### Returns - **suggestions** (object) - Suggestions with sources. ### Example ```ts import { suggestIntent } from 'faf-cli'; const suggestions = suggestIntent(dir); ``` ``` -------------------------------- ### Run grok-faf-mcp locally with bunx or npx Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/grok-faf-mcp.md Use this command to run the MCP server locally when you want tools that read and write your repo. The comment shows the alternative npx command. ```bash bunx grok-faf-mcp # or: npx grok-faf-mcp ``` -------------------------------- ### faf info command Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Prints the faf-cli version, the scoring kernel version and the IANA media type. ```bash faf info ``` -------------------------------- ### agent.fafa YAML configuration Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/cards.md Hand-written agent.fafa with seven answers describing an agent or server. Copy into your project and change values; comments mark each answer. Required for faf to generate agent cards. ```yaml version: "1.0" agent: name: weather-agent # short name displayName: Weather Agent # name id: urn:air:example.com:agent:weather-agent # domain + short name version: 1.2.0 # version description: Answers questions about the weather anywhere. # what it does homepage: https://example.com capabilities: # what it can do - name: Get forecast type: tool description: A three-day forecast for a place. endpoints: # where it runs - protocol: a2a transport: http location: https://example.com/a2a metadata: cards: examples: # 2-5 questions people ask it; search finds it by these - Will it rain in Leeds tomorrow? - What is the forecast for Tokyo this weekend? ``` -------------------------------- ### Claude Desktop configuration for claude-faf-mcp Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/claude-faf-mcp.md Add the faf MCP server to Claude Desktop by editing claude_desktop_config.json and restarting. Uses npx to run the package. ```json { "mcpServers": { "faf": { "command": "npx", "args": ["-y", "claude-faf-mcp"] } } } ``` -------------------------------- ### Compile .faf to .fafb with faf compile Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/fafb.md Compiles a .faf source into a .fafb binary. Defaults to project.faf → project.fafb; supports named source and --output. Will not overwrite a file it cannot prove it wrote; use --force to override. ```bash faf compile # project.faf → project.fafb faf compile other.faf # a named source faf compile --output ctx.fafb # a named output ``` -------------------------------- ### project.faf as a committed file Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/custom-rules.md Shows project.faf alongside package.json and README.md as a committed file in the repo, read by the AI. ```plaintext package.json ← npm reads this project.faf ← AI reads this README.md ← humans read this ``` -------------------------------- ### Files guarded by the hook Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/hooks.md Shows the files the hook guards: package.json (npm reads), project.faf (AI reads, score watched), README.md (humans read). ```text package.json ← npm reads this project.faf ← AI reads this — the guard watches its score README.md ← humans read this ``` -------------------------------- ### writeGeminiMd Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Renders and injects the gemini.md file into the specified directory. ```APIDOC ## writeGeminiMd ### Description Renders and injects the gemini.md file into the specified directory. ### Method writeGeminiMd ### Parameters - **dir** (string) - Required - Directory where the file will be written. - **data** (object) - Required - The .faf data to render. ### Returns - **void** - Writes the file. ### Example ```ts import { writeGeminiMd } from 'faf-cli'; writeGeminiMd(dir, data); ``` ``` -------------------------------- ### Define custom rules in project.faf under ai_instructions.warnings Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/custom-rules.md Add your own instructions for the AI in project.faf under ai_instructions.warnings as a plain list. These rules are carried into every AGENTS.md and never overwritten. ```yaml ai_instructions: warnings: - "Use full words in identifiers — response, not res." - "Never commit straight to main — branch and open a PR." ``` -------------------------------- ### Fetch and view test receipts Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/taf.md Fetch the taf-receipts branch and print the receipts with faf taf receipts. The command reads origin/taf-receipts, then a local taf-receipts, then a .taf in the folder; it never fetches or writes. ```bash git fetch origin taf-receipts faf taf receipts ``` -------------------------------- ### registryTitle Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Returns the registry display title. ```APIDOC ## registryTitle ### Description Returns the registry display title. ### Method registryTitle ### Parameters - **data** (object) - Required - The .faf data. ### Returns - **string** - The title. ### Example ```ts import { registryTitle } from 'faf-cli'; const title = registryTitle(data); ``` ``` -------------------------------- ### renderGeminiMd Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Renders the gemini.md content from .faf data and returns the string. ```APIDOC ## renderGeminiMd ### Description Renders the gemini.md content from .faf data and returns the string. ### Method renderGeminiMd ### Parameters - **data** (object) - Required - The .faf data. ### Returns - **string** - The rendered content. ### Example ```ts import { renderGeminiMd } from 'faf-cli'; const content = renderGeminiMd(data); ``` ``` -------------------------------- ### suggestionNote Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Provides the one-line note that `faf init` and `faf auto` print. ```APIDOC ## suggestionNote ### Description Provides the one-line note that `faf init` and `faf auto` print. ### Method suggestionNote ### Parameters - **dir** (string) - Required - Directory of the project. - **faf** (object) - Optional - Existing .faf data. ### Returns - **string** - The note. ### Example ```ts import { suggestionNote } from 'faf-cli'; const note = suggestionNote(dir); ``` ``` -------------------------------- ### faf context command Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Prints filled slots as slot: value lines, ready to paste into an AI prompt. Empty and slotignored slots are left out. ```bash faf context ``` -------------------------------- ### Preview commands before writing Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/side-effects.md Use these commands to preview changes without writing. `faf migrate --dry-run` and `faf cards --check` show what would happen; `faf server-card --check` checks server card; `faf git --stdout` clones to a temp dir and prints the .faf without writing to the project. ```bash faf migrate --dry-run faf cards --check faf server-card --check faf git --stdout # clones to a temp dir, prints the .faf ``` -------------------------------- ### Decompile .fafb with faf decompile Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/fafb.md Reads a .fafb file and prints its structure, not the original content. The .faf remains the editable source. ```bash faf decompile project.fafb ``` -------------------------------- ### faf export --agents Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Writes AGENTS.md from project.faf. Use --agents to generate the AGENTS.md file. ```bash faf export --agents # AGENTS.md ``` -------------------------------- ### renderCursorrules Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Renders the .cursorrules content from .faf data and returns the string. ```APIDOC ## renderCursorrules ### Description Renders the .cursorrules content from .faf data and returns the string. ### Method renderCursorrules ### Parameters - **data** (object) - Required - The .faf data. ### Returns - **string** - The rendered content. ### Example ```ts import { renderCursorrules } from 'faf-cli'; const content = renderCursorrules(data); ``` ``` -------------------------------- ### writeClaudeMd Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Renders and injects the claude.md file into the specified directory. ```APIDOC ## writeClaudeMd ### Description Renders and injects the claude.md file into the specified directory. ### Method writeClaudeMd ### Parameters - **dir** (string) - Required - Directory where the file will be written. - **data** (object) - Required - The .faf data to render. ### Returns - **void** - Writes the file. ### Example ```ts import { writeClaudeMd } from 'faf-cli'; writeClaudeMd(dir, data); ``` ``` -------------------------------- ### writeCursorrules Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Renders and injects the .cursorrules file into the specified directory. ```APIDOC ## writeCursorrules ### Description Renders and injects the .cursorrules file into the specified directory. ### Method writeCursorrules ### Parameters - **dir** (string) - Required - Directory where the file will be written. - **data** (object) - Required - The .faf data to render. ### Returns - **void** - Writes the file. ### Example ```ts import { writeCursorrules } from 'faf-cli'; writeCursorrules(dir, data); ``` ``` -------------------------------- ### Run faf drift Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/drift.md Checks whether context files (CLAUDE.md, AGENTS.md, .cursorrules, GEMINI.md) have moved ahead of project.faf by comparing modification times. Output shows each target with status: newer, older, missing, or in sync. ```bash faf drift ``` ```text drift — context file sync status .faf 5d ago ! CLAUDE.md newer 5d ago ○ AGENTS.md older 22d ago ○ .cursorrules missing ● GEMINI.md in sync ``` -------------------------------- ### resolveInside Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Resolves a name inside a directory, refusing links that leave the project. ```APIDOC ## resolveInside ### Description Resolves a name inside a directory, refusing links that leave the project. ### Method resolveInside ### Parameters - **dir** (string) - Required - Directory. - **name** (string) - Required - Name to resolve. ### Returns - **path** (string) - Resolved path. ### Example ```ts import { resolveInside } from 'faf-cli'; const path = resolveInside(dir, name); ``` ``` -------------------------------- ### isNonProjectRoot Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Checks if the directory is not a project root. ```APIDOC ## isNonProjectRoot ### Description Checks if the directory is not a project root. ### Method isNonProjectRoot ### Parameters - **dir** (string) - Required - Directory to check. ### Returns - **boolean** - True if not a project root. ### Example ```ts import { isNonProjectRoot } from 'faf-cli'; const result = isNonProjectRoot(dir); ``` ``` -------------------------------- ### Compile output message Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/fafb.md Shows the output message from faf compile, reporting the compiled file and its size in bytes. ```text compiled project.fafb (592 bytes) ``` -------------------------------- ### updateExistingFaf Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Updates an existing project.faf file. ```APIDOC ## updateExistingFaf ### Description Updates an existing project.faf file. ### Method updateExistingFaf ### Parameters - **dir** (string) - Required - Directory containing the project. - **existing** (object) - Required - Existing .faf data. ### Returns - **data** (object) - Updated .faf data. ### Example ```ts import { updateExistingFaf } from 'faf-cli'; const updated = updateExistingFaf(dir, existing); ``` ``` -------------------------------- ### MCP config for faf-mcp Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/faf-mcp.md Add this JSON to your IDE's MCP configuration to register the faf-mcp server. It runs in the directory the IDE opened. ```json { "mcpServers": { "faf-mcp": { "command": "npx", "args": ["-y", "faf-mcp"] } } } ``` -------------------------------- ### renderClaudeMd Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Renders the claude.md content from .faf data and returns the string. ```APIDOC ## renderClaudeMd ### Description Renders the claude.md content from .faf data and returns the string. ### Method renderClaudeMd ### Parameters - **data** (object) - Required - The .faf data. ### Returns - **string** - The rendered content. ### Example ```ts import { renderClaudeMd } from 'faf-cli'; const content = renderClaudeMd(data); ``` ``` -------------------------------- ### readFaf Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Reads a .faf file and returns its data. This is the primary entry point for loading project metadata. ```APIDOC ## readFaf ### Description Reads a .faf file and returns its data. ### Method readFaf ### Parameters - **path** (string) - Required - Path to the .faf file. ### Returns - **data** (object) - The parsed .faf data. ### Example ```ts import { readFaf } from 'faf-cli'; const data = readFaf(`${dir}/project.faf`); ``` ``` -------------------------------- ### GitHub Actions workflow for TAF receipts Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/taf.md Workflow that runs Go tests with gotestsum, prints a TAF receipt on main branch pushes, and fails the job if tests failed. Requires go.mod and uses Wolfe-Jam/faf-taf-git@v2.7.0. The test step continues on error so a receipt is still generated for failed runs. ```yaml name: TAF Receipts on: push: branches: [main] pull_request: workflow_dispatch: jobs: taf: runs-on: ubuntu-latest permissions: contents: write # lets the action save receipts steps: - uses: actions/checkout@v7 - uses: actions/setup-go@v7 with: go-version-file: go.mod - run: GOTOOLCHAIN=auto go install gotest.tools/gotestsum@v1.13.0 - name: Run tests id: tests continue-on-error: true # keep going, so a failed run still gets a receipt run: | set -o pipefail gotestsum --junitfile report.xml -- ./... - name: Print the receipt if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' uses: Wolfe-Jam/faf-taf-git@v2.7.0 with: test-output-file: report.xml target-branch: taf-receipts - name: Fail the job if the tests failed if: steps.tests.outcome == 'failure' run: exit 1 ``` -------------------------------- ### faf dna --verify: compare certificate with first commit Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/dna.md Compares the certificate in `.faf-dna` with the one in the commit that first added it: `certificate`, `born`, `birthDNA` and `projectDNA` must be the same. Exit codes: 0 same, 1 changed or `.faf-dna` gone, 2 can't check (not a git repo, shallow clone, or not committed yet). ```bash faf dna --verify ``` -------------------------------- ### Run faf drift --json Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/drift.md Outputs a self-describing JSON report with faf_version / project / source header and per-target status, mtime_ms, and delta_ms. No Date.now() in payload; consumer formats relative time. With no project.faf, returns { error, hint } and exits 2. ```bash faf drift --json ``` -------------------------------- ### writeAgentsMd Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Renders and injects the agents.md file into the specified directory. This is equivalent to running `faf export --agents`. ```APIDOC ## writeAgentsMd ### Description Renders and injects the agents.md file into the specified directory. This is equivalent to running `faf export --agents`. ### Method writeAgentsMd ### Parameters - **dir** (string) - Required - Directory where the file will be written. - **data** (object) - Required - The .faf data to render. ### Returns - **void** - Writes the file. ### Example ```ts import { writeAgentsMd } from 'faf-cli'; writeAgentsMd(dir, enrichFromRepo(dir, data)); ``` ``` -------------------------------- ### updateFafFile Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Edits project.faf in place through the YAML document. Only what you change moves; a no-op writes nothing. ```APIDOC ## updateFafFile ### Description Edits project.faf in place through the YAML document. Only what you change moves; a no-op writes nothing. ### Method updateFafFile ### Parameters - **path** (string) - Required - Path to the .faf file. - **doc** (function) - Required - Function that receives the YAML document and returns the updated document. ### Returns - **void** - Writes the file if changed. ### Example ```ts import { updateFafFile } from 'faf-cli'; updateFafFile(path, doc => { /* modify doc */ }); ``` ``` -------------------------------- ### safeWriteFile Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Writes a file safely by writing a temp file and renaming it into place. ```APIDOC ## safeWriteFile ### Description Writes a file safely by writing a temp file and renaming it into place. ### Method safeWriteFile ### Parameters - **path** (string) - Required - Path to write. - **content** (string) - Required - Content to write. ### Returns - **void** - Writes the file. ### Example ```ts import { safeWriteFile } from 'faf-cli'; safeWriteFile(path, content); ``` ``` -------------------------------- ### Fingerprint comment in faf-authored files Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Every faf-authored file opens with this fingerprint comment so a re-run can distinguish its own prior output from hand-written content. It identifies the author but never grants permission to take over a file; only markers do. A markerless file is always prefixed. ```html ``` -------------------------------- ### renderAgentsMd Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Renders the agents.md content from .faf data and returns the string. ```APIDOC ## renderAgentsMd ### Description Renders the agents.md content from .faf data and returns the string. ### Method renderAgentsMd ### Parameters - **data** (object) - Required - The .faf data. ### Returns - **string** - The rendered content. ### Example ```ts import { renderAgentsMd } from 'faf-cli'; const content = renderAgentsMd(data); ``` ``` -------------------------------- ### findFafBlock Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Finds a managed block in text. ```APIDOC ## findFafBlock ### Description Finds a managed block in text. ### Method findFafBlock ### Parameters - **text** (string) - Required - The text to search. ### Returns - **block** (object) - The found block. ### Example ```ts import { findFafBlock } from 'faf-cli'; const block = findFafBlock(text); ``` ``` -------------------------------- ### Read-only commands (writes nothing) Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/side-effects.md Commands that do not write any files or send data. Includes score, check, dna, context, drift, log, diff, convert, search, info, formats, demo, wjttc, share, and others. ```text score check dna context drift log diff convert search info formats demo wjttc share ``` -------------------------------- ### writeFaf Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Writes a .faf file. On existing files, merges and keeps comments and exact values; `{ replace: true }` overwrites explicitly. ```APIDOC ## writeFaf ### Description Writes a .faf file. On existing files, merges and keeps comments and exact values; `{ replace: true }` overwrites explicitly. ### Method writeFaf ### Parameters - **path** (string) - Required - Path to the .faf file. - **data** (object) - Required - The .faf data to write. - **replace** (boolean) - Optional - If true, overwrites existing file. ### Returns - **void** - Writes the file. ### Example ```ts import { writeFaf } from 'faf-cli'; writeFaf(path, data); ``` ``` -------------------------------- ### authorFafFromRepo Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Authors a .faf file from a checkout. ```APIDOC ## authorFafFromRepo ### Description Authors a .faf file from a checkout. ### Method authorFafFromRepo ### Parameters - **dir** (string) - Required - Directory of the repository. ### Returns - **data** (object) - The authored .faf data. ### Example ```ts import { authorFafFromRepo } from 'faf-cli'; const data = authorFafFromRepo(dir); ``` ``` -------------------------------- ### Claude Code CLI command to add faf MCP server Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/claude-faf-mcp.md Add the faf MCP server to Claude Code using the claude mcp add command. Requires Node 22 or later. ```bash claude mcp add faf -- npx -y claude-faf-mcp ``` -------------------------------- ### resolveClaudeMemoryPath Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Resolves the path to Claude Code's MEMORY.md for the project. ```APIDOC ## resolveClaudeMemoryPath ### Description Resolves the path to Claude Code's MEMORY.md for the project. ### Method resolveClaudeMemoryPath ### Parameters - **dir** (string) - Required - Directory of the project. ### Returns - **path** (string) - Path to MEMORY.md. ### Example ```ts import { resolveClaudeMemoryPath } from 'faf-cli'; const path = resolveClaudeMemoryPath(dir); ``` ``` -------------------------------- ### scoreText Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Returns a score as text, 'unknown' when there is none. ```APIDOC ## scoreText ### Description Returns a score as text, 'unknown' when there is none. ### Method scoreText ### Parameters - **result** (object) - Required - The result object. ### Returns - **string** - The score text. ### Example ```ts import { scoreText } from 'faf-cli'; const text = scoreText(result); ``` ``` -------------------------------- ### faf drift Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/drift.md Checks whether the files your AI reads have moved ahead of project.faf. It compares the modification time of project.faf against CLAUDE.md, AGENTS.md, .cursorrules, and GEMINI.md. ```APIDOC ## [CLI] faf drift ### Description Checks whether the files your AI reads have moved ahead of `project.faf`. It compares the modification time of `project.faf` against `CLAUDE.md`, `AGENTS.md`, `.cursorrules`, and `GEMINI.md`. ### Method CLI ### Endpoint `faf drift` ### Parameters None ### Response #### Success Response ``` drift — context file sync status .faf 5d ago ! CLAUDE.md newer 5d ago ○ AGENTS.md older 22d ago ○ .cursorrules missing ● GEMINI.md in sync ``` A **newer** target means someone edited the context file and the `.faf` hasn't caught up. Run [`faf sync`](/getting-started) to reconcile. ``` -------------------------------- ### writeClaudeMemory Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/export.md Writes faf's section in Claude Code's MEMORY.md. ```APIDOC ## writeClaudeMemory ### Description Writes faf's section in Claude Code's MEMORY.md. ### Method writeClaudeMemory ### Parameters - **dir** (string) - Required - Directory of the project. - **data** (object) - Required - The .faf data. ### Returns - **void** - Writes the file. ### Example ```ts import { writeClaudeMemory } from 'faf-cli'; writeClaudeMemory(dir, data); ``` ``` -------------------------------- ### Use computeDrift as a library Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/drift.md Pure function exported from faf-cli. Takes an explicit path, never reads process.cwd(). Returns report with source, source_mtime_ms, targets, drifted, in_sync, missing. Editor extensions call it directly instead of shelling out. ```typescript import { computeDrift } from 'faf-cli'; const report = computeDrift('/path/to/project.faf'); // { source, source_mtime_ms, targets: [...], drifted, in_sync, missing } ``` -------------------------------- ### faf dna --json: output as data Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/dna.md Outputs birth, certificate, current score, growth, peak, journey line, every version with changes, and earlier lives as JSON. The same file gives the same JSON. With no `.faf-dna`, exits 1 and prints nothing to stdout. ```bash faf dna --json ``` -------------------------------- ### faf clear command Source: https://github.com/wolfe-jam/faf-docs-site/blob/main/docs/more-commands.md Deletes the temporary clones faf git leaves behind (faf-git-* folders in your system's temp folder). ```bash faf clear ```