fitness-function-design

fitness-function-design is a skill for Claude Code from sethdford/claude-skills. It costs 38 tokens per session (631 once invoked), scanned A, original, MIT.

A method for defining measurable checks of software architecture, such as dependency structure, scalability, security, and code quality.

In plain words
What is it for?
Use it to choose important quality goals, define metrics for them, and add automated checks to continuous integration and delivery pipelines.
Why use it?
It turns architectural goals into repeatable measurements, making gradual deterioration easier to detect.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the architecture-governance plugin — 7 skills shipped together

Good fit Use it to choose important quality goals, define metrics for them, and add automated checks to continuous integration and delivery pipelines.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sethdford/claude-skills/fitness-function-design
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.

Any agent
npx skills add sethdford/claude-skills --skill fitness-function-design
Clone the repo
git clone --depth 1 https://github.com/sethdford/claude-skills

Made for: Claude Code.

Or install architecture-governance, the plugin that ships this one along with the rest of its 7 skills.

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 fitness-function-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/sethdford/claude-skills/fitness-function-design/github.svg)](https://agentmods.dev/skills/sethdford/claude-skills/fitness-function-design)
Your own site
<a href="https://agentmods.dev/skills/sethdford/claude-skills/fitness-function-design"><img src="https://agentmods.dev/badge/skills/sethdford/claude-skills/fitness-function-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fitness-function-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/sethdford/claude-skills/fitness-function-design"><img src="https://agentmods.dev/badge/skills/sethdford/claude-skills/fitness-function-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 631 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00038 $0.00631
Opus 5 $0.00019 $0.00316
Sonnet 5 $0.00008 $0.00126
Haiku 4.5 $0.00004 $0.00063

Measured 10d ago against content hash 9c10c4056e9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

fitness-function-design 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 10d 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.

architect/architecture-governance/skills/fitness-function-design/SKILL.md · 48 lines

How it starts

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

Fitness Function Design

Design quantifiable metrics to measure architecture health and automatically enforce quality standards.

Context

You are designing fitness functions to measure architectural quality. Create metrics for coupling, modularity, scalability, performance. Automate checks in CI/CD for continuous feedback.

Domain Context

Based on evolutionary architecture and fitness function research (Thoughtworks):

  • Coupling Metrics: Layer violations, cyclic dependencies, test isolation
  • Modularity Metrics: Module fan-in/fan-out, cohesion, abstract instability
  • Scalability Metrics: Throughput (RPS), latency (p95, p99), resource utilization
  • Security Metrics: Secrets in code, dependency vulnerabilities, known security patterns
  • Code Quality Metrics: Complexity (cyclomatic), duplication, test coverage

Instructions

  1. Identify Key Quality Attributes: What matters most? Scalability? Security? Testability? Maintainability? Pick 3-4.

  2. Define Metrics for Each Attribute: Scalability: p99 latency < 200ms, peak RPS capacity. Security: zero secrets in code, all dependencies scanned. Testability: > 80% test coverage, no untestable dependencies.

  3. Set Thresholds: Below threshold: pass. Above: fail (blocks merge). Make thresholds achievable but stretch. Too strict: teams bypass. Too loose: no effect.

  4. Automate Checks: Integrate into CI/CD. Run on every PR. Parse test coverage reports, dependency scanners, performance benchmarks. Fail PR if fitness functions breach.

  5. Monitor and Adjust: Track metrics over time. Are they trending right? Do developers understand why they matter? Adjust thresholds based on feedback and organizational priorities.

Anti-Patterns

  • Too Many Fitness Functions: 50 metrics in CI/CD. Result: long builds, false positives, ignored. Guard: 5-10 core metrics max. Automate what matters; remove noise.
  • Fitness Functions Without Context: "Cyclomatic complexity > 10 fails". Developer doesn't understand why. Result: frustrated, rules bypassed. Guard: Document rationale; train teams; explain tradeoffs.
  • Static Thresholds: Set once, never changed. Organization evolves, thresholds stale. Result: metrics become irrelevant. Guard: Review quarterly; adjust based on trends and priorities.
  • Metrics Without Action: Fitness functions fail but no one addresses. Result: technical debt accumulates. Guard: Failed checks require action; track and fix root causes.

Read the full file on GitHub · 48 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. 10d ago First seen · 48 lines · 38 tokens per session scan A 9c10c4056e9b

Subscribe to this mod's changes

fitness-function-design is a skill published in the GitHub repository sethdford/claude-skills (40 stars, last pushed 6mo ago), licensed MIT. It adds 38 tokens to every session and 631 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-30.