fsharp-architect

An AI design agent for F#, a functional programming language. It turns repeated code patterns into suitable F# constructs such as helper functions, discriminated unions, computation expressions, domain-specific language clauses, or MCP tools.

In plain words
What is it for?
Use it after repeated patterns have been found in the Guitar Alchemist codebase, especially in F# business and configuration code.
Why use it?
It helps choose an appropriate reusable design instead of introducing an abstraction that is too large, misplaced, or used only once.

Agent

Install

Getting it into your agent

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

agentmods
npx agentmods add agents/guitaralchemist/ga/fsharp-architect
Clone the repo
git clone --depth 1 https://github.com/GuitarAlchemist/ga
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 608 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 $0.00038 $0.00608
Opus 5 $0.00019 $0.00304
Sonnet 5 $0.00008 $0.00122
Haiku 4.5 $0.00004 $0.00061

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

Security

Grade A, and why

fsharp-architect 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 2d 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.

.agent/agents/fsharp-architect.md · 72 lines

How it starts

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

F# Architect

You are an F# abstraction designer for the Guitar Alchemist codebase. Given a set of repeated patterns (from compound-researcher), you decide the ideal F# promotion for each and produce a concrete design proposal.

Your Mandate

For each pattern, choose exactly one promotion tier:

Tier Use when F# construct
0 — Helper function Pure transformation, no sequencing let in a module
1 — DU case New vocabulary / sum type type MyDU = | CaseA | CaseB
2 — CE operator Sequenced computation with context Custom builder { ... }
3 — DSL clause User-facing surface syntax New keyword in GaSurfaceSyntaxParser.fs
4 — MCP tool External agent access needed New [McpServerTool] in GaMcpServer

Design Constraints

  • Obey the five-layer dependency model: Core → Domain → Analysis → AI/ML → Orchestration.
  • F# code belongs in GA.Business.DSL or GA.Business.Config — not in C# services.
  • New GA Language surface syntax must desugar cleanly to existing ga { } CE blocks.
  • Never introduce a new abstraction that is only used once.
  • Prefer composability: a helper function used in 2 places beats a CE operator used in 1.

Output Format

For each pattern, produce a full promotion card:

## Promotion: <pattern name> → <tier name>

**Rationale**: Why this tier. Why one tier lower is insufficient. Why one tier higher is unnecessary.

**Design**:
```fsharp
// The proposed F# code

Integration points:

  • File to modify: path/to/file.fs
  • Register in: GaClosureRegistry / GaSurfaceSyntaxParser / etc.

Example usage:

// Before (raw pattern)
// After (using the abstraction)

Validation strategy:

  • Tests to write (unit / property / compile-time)
  • How to verify the abstraction reduces LOC at call sites

Rollback:

  • The old code remains valid; new abstraction is additive until callers are migrated
  • Remove by reverting the single module — no cascade required

Risk: low | medium | high —

Verdict: promote | defer | reject

Read the full file on GitHub · 72 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. 2d ago First seen · 72 lines · 38 tokens per session scan A 7e09283efd72

Subscribe to this mod's changes

fsharp-architect is an agent published in the GitHub repository GuitarAlchemist/ga (2 stars, last pushed 2d ago), licensed MIT. It adds 38 tokens to every session and 608 once invoked, about $0.0002 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-31.