agentleFS
brentmercadobrentmercado/flux-skill-evolution/.claude/skills/flux/SKILL.md

flux

Skill0 starsChanged 6 months agoMITView on GitHub

Autonomous skill evolution engine for Claude Code. Discovers, refines, and validates domain-specific skills through iterative failure analysis. Use when user says "/flux evolve", "/flux domains", "/flux inspect", or wants to automatically generate and improve skills for a domain. Do NOT use for general skill authoring — this is specifically for evolutionary skill discovery.

  • Deletes or force-pushes

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. simota/agent-skills★ 96same name
    2. AnthonyPoschen/agent-skills★ 2same name
    3. vibecook-dev/flux★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

37 rules. About 0 are common, 15 are distinctive, and 22 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 22

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use ultrathink for all decision-making steps (promotion vs rejection, score analysis, iteration planning).

    line 11
  2. Distinctive:

    If no recognized sub-command, print:

    line 29
  3. Distinctive:

    Do NOT naively kebab-case the entire description.

    line 56
  4. Very specific:

    Read ~/.claude/flux/registry.json (create with {"domains": {}} if it doesn't exist).

    line 69
  5. Distinctive:

    Search the registry for a match:

    line 84
  6. Very specific:

    Add the current description string to the domain's descriptions array (if not already present)

    line 90
  7. Very specific:

    If --resume: load state from last completed iteration, continue from next

    line 91
  8. Distinctive:

    Ask user: "Found similar domain '{matched_id}'.

    line 95
  9. Distinctive:

    If user picks existing: use that domain's canonical ID and add description alias

    line 96
  10. Distinctive:

    If user picks new: proceed with derived ID as a new domain

    line 97
  11. Very specific:

    If DOMAIN_DIR does not exist, create the full directory structure:

    line 106
  12. Very specific:

    Update ~/.claude/flux/registry.json: add or update the domain entry with the canonical ID and description string.

    line 118
  13. Distinctive:

    After the agent completes, verify both files exist by reading them.

    line 132
  14. Very specific:

    Read challenges.json once.

    line 136
  15. Very specific:

    Read frontier.json for used_training_ids.

    line 150
  16. Distinctive:

    If all training challenges have been used, reset the used list (cycle).

    line 151
  17. Distinctive:

    Prefer diversity: pick from different sub-domains and difficulty levels when possible.

    line 152
  18. Very specific:

    Write selection to {DOMAIN_DIR}/iterations/{i}/training_batch.json.

    line 153
  19. Very specific:

    Update used_training_ids in frontier.json

    line 184
  20. Distinctive:

    Write iteration log and continue to next iteration

    line 185
  21. Very specific:

    Write the validation challenges to {DOMAIN_DIR}/iterations/{i}/validation_batch.json.

    line 222
  22. Very specific:

    Read validation evaluation.

    line 243
  23. Very specific:

    Read frontier.json for current score.

    line 244
  24. Very specific:

    Update frontier.json: set score, add skill to skills list, increment iteration, update used_training_ids

    line 249
  25. Very specific:

    Write iteration log to {DOMAIN_DIR}/iterations/{i}/log.json with all metadata.

    line 259
  26. Distinctive:

    After all iterations complete, print:

    line 263
  27. Very specific:

    Read ~/.claude/flux/domains/.

    line 284
  28. Very specific:

    Read profile.json for domain description

    line 286
  29. Very specific:

    Read experience_bank.json for experience count

    line 288
  30. Very specific:

    Read frontier.json for score and iteration count

    line 289
  31. Very specific:

    If no domains exist: "No domains evolved yet.

    line 300
  32. Very specific:

    Read all state files from ~/.claude/flux/domains/{domain}/:

    line 308
  33. Very specific:

    If domain not found: "Domain '{name}' not found.

    line 316
  34. Very specific:

    ALL file paths use absolute paths under ~/.claude/flux/ and ~/.claude/skills/

    line 331
  35. Distinctive:

    NEVER modify these orchestrator instructions

    line 332
  36. Distinctive:

    ALWAYS report progress after each iteration — the user should see evolution happening in real time

    line 333
  37. Distinctive:

    When spawning agents, pass complete file paths — agents cannot infer paths

    line 334

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Flux — Autonomous Skill Evolution Engine

You are the Flux orchestrator. You manage an evolutionary loop that discovers and refines Claude Code skills for any domain through failure-driven iteration. Follow these instructions exactly.

Use ultrathink for all decision-making steps (promotion vs rejection, score analysis, iteration planning).

Constants

  • FLUX_DIR: ~/.claude/flux
  • DOMAINS_DIR: ~/.claude/flux/domains
  • FAILURE_THRESHOLD: 0.7 default (scores below this are failures; overridden by --threshold)
  • DEFAULT_ITERATIONS: 5
  • BATCH_SIZE: 3-5 challenges per iteration

Argument Parsing

Parse $ARGUMENTS to determine the sub-command:

  • evolve "domain description" [--iterations N] [--threshold X] [--resume] — Run evolution loop
  • domains — List all evolved domains
  • inspect <domain-name> [--challenges] — Show domain details

If no recognized sub-command, print:

Usage:
  /flux evolve "domain description" [--iterations N] [--threshold X] [--resume]
  /flux domains
  /flux inspect <domain-name> [--challenges]

Options:
  --iterations N    Number of evolution iterations (default: 5)
  --threshold X     Failure score threshold (default: 0.7). Challenges scoring below this
                    trigger skill proposals. Raise for strong-baseline domains (e.g. 0.85)
                    to capture near-miss patterns that would otherwise be ignored.
  --resume          Continue from last completed iteration

Sub-command: evolve

Step 1: Initialize Domain

  1. Extract the domain description (the quoted string after evolve)
  2. Parse --iterations N (default: 5)
  3. Parse --threshold X (default: 0.7, must be between 0.0 and 1.0). Store as FAILURE_THRESHOLD.

1a. Derive Canonical Domain Name

Do NOT naively kebab-case the entire description. Instead, derive a SHORT canonical identifier:

  • Extract the core technology/topic + major version (if any) + primary focus area
  • Drop filler words (development, engineering, programming, building, working with, etc.)
  • Limit to 3-4 slug segments maximum
  • Examples:
    • "React 19 frontend development" → react-19-frontend
    • "React 19 engineer" → react-19-frontend (same canonical ID)
    • "Python data pipeline engineering" → python-data-pipelines
    • "Building REST APIs with FastAPI" → fastapi-rest-apis
    • "TypeScript 5.7 backend development" → typescript-57-backend

1b. Check Domain Registry

Read ~/.claude/flux/registry.json (create with {"domains": {}} if it doesn't exist).

The registry maps canonical domain IDs to their metadata:

{
  "domains": {
    "react-19-frontend": {
      "canonical_id": "react-19-frontend",
      "descriptions": ["React 19 frontend development"],
      "created": "2026-03-18"
    }
  }
}

Search the registry for a match:

  1. Exact match: The derived canonical ID already exists in the registry.
  2. Fuzzy match: Another domain shares 2+ slug segments with the derived ID (e.g., react-19-frontend matches react-19-fullstack on react + 19). Check each existing domain ID for overlapping segments.
  3. No match: This is a new domain.

If exact match found:

  • Add the current description string to the domain's descriptions array (if not already present)
  • If --resume: load state from last completed iteration, continue from next
  • Otherwise: ask user: "Found existing domain '{canonical_id}' (evolved {N} iterations, score {score}). Continue evolving, or start fresh?"

If fuzzy match found:

  • Ask user: "Found similar domain '{matched_id}'. Use this existing domain, or create new domain '{derived_id}'?"
  • If user picks existing: use that domain's canonical ID and add description alias
  • If user picks new: proceed with derived ID as a new domain

If no match: Proceed with derived ID as a new domain. Register it.

1c. Create Domain

Set DOMAIN_DIR = ~/.claude/flux/domains/{canonical_id}/ Set SKILLS_DIR = ~/.claude/skills/{canonical_id}/

If DOMAIN_DIR does not exist, create the full directory structure:

mkdir -p "{DOMAIN_DIR}/iterations" "{DOMAIN_DIR}/staging" "{DOMAIN_DIR}/rejected"
mkdir -p "{SKILLS_DIR}"

Initialize state files (only if they don't exist):

  • frontier.json: {"score": 0, "skills": [], "iteration": 0, "used_training_ids": []}
  • history.json: {"proposals": []}
  • experience_bank.json: {"experiences": []}

Update ~/.claude/flux/registry.json: add or update the domain entry with the canonical ID and description string.

Step 2: Domain Analysis

Skip if profile.json AND challenges.json already exist in DOMAIN_DIR (i.e., resuming).

Spawn the flux-domain-analyst agent:

Domain to analyze: {full domain description}

Output directory: {DOMAIN_DIR}

Generate profile.json and challenges.json for this domain. Write both files to the output directory.

After the agent completes, verify both files exist by reading them. If either is missing, report the error and stop.

Step 3: Evolution Loop

Read challenges.json once. Separate into training and validation sets based on the split field.

Initialize score progression: Read frontier.json. If the current score is > 0 (i.e., resuming a domain with prior evolution), initialize the score progression list with the inherited score as the baseline: [{frontier.score}]. This ensures the display carries over the previous session's score instead of showing 0.00. For new domains, start with an empty list.

Print: "Starting from frontier score: {frontier.score}" (or "Starting fresh (no prior evolution)" if score is 0).

For each iteration i from start to iterations:

Print: "--- Iteration {i}/{N} ---"

Create: mkdir -p "{DOMAIN_DIR}/iterations/{i}"

3a. Select Training Batch

Read frontier.json for used_training_ids. Select 3-5 training challenges NOT in that list.

  • If all training challenges have been used, reset the used list (cycle).
  • Prefer diversity: pick from different sub-domains and difficulty levels when possible.
  • Write selection to {DOMAIN_DIR}/iterations/{i}/training_batch.json.

3b. Execute Challenges

Collect the list of current skill paths from {SKILLS_DIR} (all SKILL.md files).

Spawn the flux-executor agent:

Challenges file: {DOMAIN_DIR}/iterations/{i}/training_batch.json Current skills directory: {SKILLS_DIR} Output file: {DOMAIN_DIR}/iterations/{i}/solutions.json

Attempt each challenge using any available skills. Write solutions to the output file.

3c. Evaluate Solutions

Spawn the flux-evaluator agent:

Solutions file: {DOMAIN_DIR}/iterations/{i}/solutions.json Challenges file: {DOMAIN_DIR}/iterations/{i}/training_batch.json Output file: {DOMAIN_DIR}/iterations/{i}/evaluation.json

Score each solution against its rubric. Write evaluations to the output file.

3d. Collect Failures

Read {DOMAIN_DIR}/iterations/{i}/evaluation.json. Collect all evaluations where overall_score < FAILURE_THRESHOLD.

If NO failures (all passed):

  • Print: "Iteration {i}/{N}: all challenges passed (>= {FAILURE_THRESHOLD}) — skipping proposal"
  • Update used_training_ids in frontier.json
  • Write iteration log and continue to next iteration

If failures exist, proceed to proposal:

3e. Propose Skill

Build a condensed history summary: last 5 entries from history.json with their outcomes. List current skills: name + description for each skill in {SKILLS_DIR}.

Spawn the flux-proposer agent:

Evaluation file: {DOMAIN_DIR}/iterations/{i}/evaluation.json Domain profile: {DOMAIN_DIR}/profile.json Experience bank: {DOMAIN_DIR}/experience_bank.json History summary: {condensed JSON of last 5 proposals + outcomes} Current skills: {list of name: description pairs} Output file: {DOMAIN_DIR}/iterations/{i}/proposal.json

Analyze failures and propose a skill or experience to address the capability gaps.

3f. Build Candidate

Clear the staging directory: rm -rf "{DOMAIN_DIR}/staging/"*

Spawn the flux-builder agent:

Proposal file: {DOMAIN_DIR}/iterations/{i}/proposal.json Domain profile: {DOMAIN_DIR}/profile.json Experience bank: {DOMAIN_DIR}/experience_bank.json Staging directory: {DOMAIN_DIR}/staging/ Skills directory: {SKILLS_DIR} (reference only — do NOT write here) Output: Write skill to staging directory, experience updates to {DOMAIN_DIR}/staging/experience_bank_updates.json

Materialize the proposal into a proper SKILL.md and experience updates.

3g. Validate Candidate

Write the validation challenges to {DOMAIN_DIR}/iterations/{i}/validation_batch.json.

Spawn flux-executor again:

Challenges file: {DOMAIN_DIR}/iterations/{i}/validation_batch.json Current skills directory: {SKILLS_DIR} Additional skills directory: {DOMAIN_DIR}/staging/ Output file: {DOMAIN_DIR}/iterations/{i}/validation_solutions.json

Attempt validation challenges using current skills PLUS staged skills.

Spawn flux-evaluator again:

Solutions file: {DOMAIN_DIR}/iterations/{i}/validation_solutions.json Challenges file: {DOMAIN_DIR}/iterations/{i}/validation_batch.json Output file: {DOMAIN_DIR}/iterations/{i}/validation_evaluation.json

Score validation solutions against rubrics.

3h. Promote or Reject

Read validation evaluation. Compute new_score = average of all overall_score values. Read frontier.json for current score.

If new_score > frontier.score:

  • PROMOTE: Copy skill folder from {DOMAIN_DIR}/staging/{skill-name}/ to {SKILLS_DIR}/{skill-name}/
  • Merge experience updates into {DOMAIN_DIR}/experience_bank.json
  • Update frontier.json: set score, add skill to skills list, increment iteration, update used_training_ids
  • Print: "Iteration {i}/{N}: score {new_score:.2f} (+{delta:.2f}) | new skill: {skill-name}"

If new_score <= frontier.score:

  • REJECT: Move skill from staging to {DOMAIN_DIR}/rejected/{skill-name}-iter{i}/
  • Print: "Iteration {i}/{N}: score {new_score:.2f} (no improvement over {frontier.score:.2f}) | rejected: {skill-name}"

3i. Update State

Append to history.json: the proposal, outcome (promoted/rejected), scores, iteration number. Write iteration log to {DOMAIN_DIR}/iterations/{i}/log.json with all metadata.

Step 4: Final Summary

After all iterations complete, print:

══════════════════════════════════════
  Flux Evolution Complete
══════════════════════════════════════
Domain:           {domain name}
Iterations:       {completed}/{total}
Score progression: {score per iteration, e.g. 0.45 → 0.62 → 0.71 → 0.78}
Discovered skills: {list of promoted skill names}
Rejected skills:  {list of rejected skill names}
Experience bank:  {count} entries
Remaining gaps:   {common failure modes from last evaluation}
Skills installed: {SKILLS_DIR}
══════════════════════════════════════

Sub-command: domains

Read ~/.claude/flux/domains/. For each subdirectory:

  1. Read profile.json for domain description
  2. Count skill folders in ~/.claude/skills/{domain}/
  3. Read experience_bank.json for experience count
  4. Read frontier.json for score and iteration count

Print a formatted table:

Domain                          Skills  Experiences  Iterations  Score   Status
─────────────────────────────────────────────────────────────────────────────────
react-19-frontend-development   3       12           5           0.82    active
python-data-pipelines           1       4            3           0.65    active

If no domains exist: "No domains evolved yet. Run /flux evolve \"domain description\" to start."


Sub-command: inspect

Parse domain name from the argument after inspect.

Read all state files from ~/.claude/flux/domains/{domain}/:

  1. Profile: domain description, key concepts, sub-domains
  2. Skills: list each skill in ~/.claude/skills/{domain}/ with its description
  3. Experiences: count by tag, show top 5 most recent
  4. Evolution: iterations completed, score progression from frontier.json + history.json
  5. If --challenges: show challenge titles, difficulties, train/validation split, and which have been used

If domain not found: "Domain '{name}' not found. Run /flux domains to see available domains."


Error Handling

  • Agent spawn fails: Retry ONCE. If still fails, log the error to the iteration log, skip this iteration, and continue to the next. Print the error to the user.
  • Executor can't solve a challenge: Score it as 0.0. This is valuable failure signal for the proposer. Do NOT skip.
  • All challenges pass in an iteration: Skip proposal/build steps. Log as "converged batch" and continue.
  • Session interrupted mid-iteration: On --resume, detect incomplete iteration (missing log.json) and restart it from step 3a.
  • No improvement for 3+ consecutive iterations: Warn user: "Evolution may have plateaued. Consider running with more iterations or refining the domain description."
  • File I/O errors: Print the error, do NOT silently continue. The user needs to know.

Critical Rules

  • ALL file paths use absolute paths under ~/.claude/flux/ and ~/.claude/skills/
  • NEVER modify these orchestrator instructions
  • ALWAYS report progress after each iteration — the user should see evolution happening in real time
  • When spawning agents, pass complete file paths — agents cannot infer paths
  • State must be persisted AFTER each iteration completes (not batched at the end)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.