build-afm

build-afm is a skill for Claude Code, Codex from scouzi1966/maclocal-api. It costs 23 tokens per session (292 once invoked), scanned A, original, MIT.

A set of required build and test procedures for AFM, a Swift-based server for running machine-learning models. It uses a project-specific wrapper to build and test the software with Xcode 27 and MLX.

In plain words
What is it for?
Use it to compile AFM, run its tests, check dependency boundaries, prepare packaged binaries, and benchmark model inference with Release builds.
Why use it?
It avoids common build and test failures involving Swift packages, compiled GPU resources, and dependency versions. It also sets rules for producing reliable performance measurements.

Skill for Claude CodeCodex

Install

Getting it into your agent

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

agentmods
npx agentmods add skills/scouzi1966/maclocal-api/build-afm
Any agent
npx skills add scouzi1966/maclocal-api --skill build-afm
Clone the repo
git clone --depth 1 https://github.com/scouzi1966/maclocal-api

Made for: Claude Code, Codex.

Wrote this? Show the measurements

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

agentmods badge for build-afm

README.md
[![agentmods](https://agentmods.dev/badge/skills/scouzi1966/maclocal-api/build-afm.svg)](https://agentmods.dev/skills/scouzi1966/maclocal-api/build-afm)
Your own site
<a href="https://agentmods.dev/skills/scouzi1966/maclocal-api/build-afm"><img src="https://agentmods.dev/badge/skills/scouzi1966/maclocal-api/build-afm.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 292 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

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

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.00292
Opus 5 $0.00012 $0.00146
Sonnet 5 $0.00005 $0.00058
Haiku 4.5 $0.00002 $0.00029

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

Security

Grade A, and why

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

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

Nothing flagged

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

.agents/skills/build-afm/SKILL.md · 37 lines

What it actually says

Build AFM

Run commands from the maclocal-api repository root.

SwiftPM

Never invoke raw swift build or swift test. Always use:

Scripts/swiftpm-reliable.sh build -c release --product afm
Scripts/swiftpm-reliable.sh test -c release

The wrapper selects the known-good Xcode 27 SwiftPM driver, repairs stale explicit-module state, resolves AFMKit's committed default.metallib, and stages mlx.metallib for XCTest. Do not work around metallib failures with one-off environment values.

Normal builds consume the immutable AFMKit revision and exact AFM-compatible MLX tags. They do not compile or mutate vendor/mlx-swift-lm. Use Scripts/check-afmkit-consumer-boundary.sh after dependency or packaging changes. The legacy patch stack requires an explicit maintenance opt-in.

The comprehensive assertion harness must continue to delegate its Swift tests to this wrapper. Local copied XCTest binaries also have a source-checkout fallback in MLXMetalLibrary; packaged binaries must carry their resource bundle or loose default.metallib beside the executable.

Performance

Use Release binaries for inference benchmarks. Never report Debug throughput.

Changes

What this file has done since we first saw it

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

  1. 6d ago First seen · 37 lines · 23 tokens per session scan A 13e4e18e6ab0

Subscribe to this mod's changes

build-afm is a skill published in the GitHub repository scouzi1966/maclocal-api (337 stars, last pushed yesterday), licensed MIT. It adds 23 tokens to every session and 292 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.