swift-secp256k1 AGENTS.md

swift-secp256k1 AGENTS.md is an instructions file for Codex, OpenCode from 21-DOT-DEV/swift-secp256k1. It costs 921 tokens per session, scanned A, original, MIT.

A project guide for a Swift wrapper around libsecp256k1, a cryptography library used by Bitcoin and Nostr software. It covers supported Apple platforms, build and test commands, code style, and shared source files.

In plain words
What is it for?
Use it to build and test the Swift package, format or lint development code, maintain its P256K and ZKP targets, and work with vendored library sources.
Why use it?
It records platform requirements and non-obvious build rules, reducing the chance of breaking either cryptography target or release builds.

Instructions file for CodexOpenCode

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 instructions/21-dot-dev/swift-secp256k1/agents-md
Clone the repo
git clone --depth 1 https://github.com/21-DOT-DEV/swift-secp256k1

Made for: Codex, OpenCode.

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 swift-secp256k1 AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/21-dot-dev/swift-secp256k1/agents-md.svg)](https://agentmods.dev/instructions/21-dot-dev/swift-secp256k1/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/21-dot-dev/swift-secp256k1/agents-md"><img src="https://agentmods.dev/badge/instructions/21-dot-dev/swift-secp256k1/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 921 This file is loaded in full into every session.
When invoked 921 The same file — it is already loaded in full.
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 $0.00921 $0.00921
Opus 5 $0.00461 $0.00461
Sonnet 5 $0.00184 $0.00184
Haiku 4.5 $0.00092 $0.00092

Measured 5d ago against content hash 6e46675ec315, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

swift-secp256k1 AGENTS.md 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 5d 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.md · 50 lines

How it starts

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

AGENTS.md (swift-secp256k1)

A Swift 6.1 wrapper around libsecp256k1 (and secp256k1-zkp) for the Bitcoin and Nostr ecosystems. Supports macOS 15+, iOS 18+, watchOS 11+, tvOS 18+, and visionOS 2+. Uses Swift 6 strict concurrency (swiftLanguageModes: [.v6]).

Commands

  • Build: swift build
  • Test: swift test
  • Format: swift package swiftformat . (dev checkout only)
  • Lint: swift package swiftlint (dev checkout only)
  • Install Lefthook hooks (one-time, dev checkout only): lefthook install

Non-obvious patterns

  • Conditional dev deps: Package.swift uses Context.gitInformation?.currentTag to exclude dev tools (SwiftFormat, SwiftLint, Tuist, etc.) at tagged releases. Consumers get zero transitive dev dependencies. Format/lint/Tuist commands only work in a non-tagged checkout.
  • Xcode trait workaround: Xcode does not resolve .when(traits:) for Swift settings. Source files use #if Xcode || ENABLE_MODULE_* guards — preserve these when editing.
  • SharedSourcesPlugin: Copies Sources/Shared/*.swift into both P256K and ZKP build directories. Changes to shared files affect both targets.
  • Extraction flow: Vendor → Sources via subtree CLI. Do not edit extracted paths directly; changes are overwritten on next extraction. See Vendor/AGENTS.md.
  • Cross-archive DocC xrefs: SharedSourcesPlugin copies the same source into P256K and ZKP archives, so disambiguation hashes (signature(for:)-XXXXX) differ per archive. Prefer unqualified `signature(for:)` code spans in /// doc comments over symbol xrefs that would need per-archive hashes. See precedent in Sources/Shared/HashDigest.swift, Sources/Shared/ECDSA/ECDSA+Signature.swift.
  • No Snippets/ directory: SwiftPM auto-discovered snippets (SE-0356) link every library product of the package. With two C-binding products (libsecp256k1, libsecp256k1_zkp) compiled from the same upstream source tree, any snippet produces duplicate C symbols at link time. Scoped snippet dependencies are a future direction per SE-0356; until SwiftPM ships them, documentation examples live as fenced ```swift blocks inside catalog articles. Parked snippet sources from prior DocC work remain at /tmp/swift-secp256k1-snippets-pending/P256K/ for future re-integration.

Read the full file on GitHub · 50 lines

Changes

What this file has done since we first saw it

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

  1. 5d ago First seen · 50 lines · 921 tokens per session scan A 6e46675ec315

Subscribe to this mod's changes

swift-secp256k1 AGENTS.md is an instructions file published in the GitHub repository 21-DOT-DEV/swift-secp256k1 (157 stars, last pushed yesterday), licensed MIT. It adds 921 tokens to every session, about $0.0046 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.