autoforge — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited autoforge (Agent Skill) and scored it 87/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 3 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 3 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Stop reflecting. Start converging. Every iteration is measured, logged, and validated — not vibed.
AutoForge replaces ad-hoc "improve this" prompts with a rigorous optimization loop: define evals, run iterations, track pass rates in TSV, report live to your channel, and stop only when math says you're done. Multi-model cross-validation prevents the "same model grades its own homework" blind spot.
Four modes. One convergence standard.
| Mode | What it does | Best for |
|---|---|---|
prompt | Simulate 5 scenarios/iter, evaluate Yes/No | SKILL.md, prompts, doc templates |
code | Sandboxed test execution, measure exit/stdout/stderr | Shell scripts, Python tools, pipelines |
audit | Test CLI commands live, verify SKILL.md matches reality | CLI skill documentation |
project | Scan whole repo, cross-file consistency analysis | README↔CLI drift, Dockerfile↔deps, CI gaps |
Agent (you)
├── State: results.tsv, current target file state, iteration counter
├── Iteration 1: evaluate → improve → write TSV → report
├── Iteration 2: evaluate → improve → write TSV → report
├── ...
└── Finish: report.sh --final → configured channel"Sub-Agent" is a conceptual role, not a separate process. You (the top-agent) execute each iteration yourself: simulate/execute → evaluate → write TSV → call report.sh. The templates below describe what you do PER ITERATION — not what you send to another agent.
For code mode, run tests using the exec tool.
For complex audits, you can split two roles across different models:
| Role | Model | Task |
|---|---|---|
| Optimizer | Opus / GPT-4.1 | Analyzes, finds issues, writes fixes |
| Validator | GPT-5 / Gemini (different model) | Checks against ground truth, provides pass rate |
Flow: Optimizer and Validator alternate. Optimizer iterations have status improved/retained/discard. Validator iterations confirm or refute the pass rate. Spawn validators as sub-agents with sessions_spawn and explicit model.
When to use Multi-Model: Deep Audits (>5 iterations expected), complex ground truth, or when a single model is blind to its own errors.
When Single-Model suffices: Simple CLI audits, prompt optimization, code with clear tests.
AutoForge uses environment variables for reporting. All are optional — without them, output goes to stdout.
| Variable | Default | Description |
|---|---|---|
AF_CHANNEL | telegram | Messaging channel for reports |
AF_CHAT_ID | _(none)_ | Chat/group ID for report delivery |
AF_TOPIC_ID | _(none)_ | Thread/topic ID within the chat |
These rules apply always, regardless of mode:
results/[target]-results.tsv.report.sh immediately after every TSV row.*-proposed.md, and reports are written.baseline.You are assigned ONE mode. Ignore all sections for other modes.
| Mode | What happens | Output |
|---|---|---|
prompt | Mentally simulate skill/prompt, evaluate against evals | Improved prompt text |
code | Run tests in sandbox, measure results | Improved code |
audit | Test CLI commands (read-only only!) + verify SKILL.md against reality | Improved SKILL.md |
project | Scan whole repo, cross-file analysis, fix multiple files per iteration | Improved repository |
Your mode is in the task prompt. Everything else is irrelevant to you.
printf '%s\t%s\t%s\t%s\t%s\n' "iteration" "prompt_version_summary" "pass_rate" "change_description" "status" > results/[target]-results.tsvprintf '%s\t%s\t%s\t%s\t%s\n' "1" "Baseline" "58%" "Original version" "baseline" >> results/[target]-results.tsvUse `printf` not `echo -e`!echo -einterprets backslashes in field values.printf '%s'outputs strings literally.
| # | Column | Type | Rules |
|---|---|---|---|
| 1 | iteration | Integer | 1, 2, 3, ... |
| 2 | prompt_version_summary | String | Max 50 Unicode chars. No tabs, no newlines. |
| 3 | pass_rate | String | Number + %: 58%, 92%, 100%. Always integer. |
| 4 | change_description | String | Max 100 Unicode chars. No tabs, no newlines. |
| 5 | status | Enum | Exactly one of: baseline · improved · retained · discard |
| - (never leave empty)printf '%s' or escape with \$ (prevents unintended variable interpolation)baseline — Mandatory for Iteration 1. Evaluate original version only.improved — Pass rate higher than previous best → new version becomes current stateretained — Pass rate equal or marginally better → predecessor remainsdiscard — Pass rate lower → change discarded, revert to best stateAfter EVERY TSV row (including baseline):
bash scripts/report.sh results/[target]-results.tsv "[Skill Name]"After loop ends, additionally with --final:
bash scripts/report.sh results/[target]-results.tsv "[Skill Name]" --finalThe report script reads AF_CHANNEL, AF_CHAT_ID, and AF_TOPIC_ID from environment. Without them, it prints to stdout with ANSI colors.
Priority — first matching condition wins, top to bottom:
3× 100% = three iterations with pass_rate == 100%, not necessarily consecutive.5× retained and 3× discard = consecutive (in a row).baseline counts toward no series.improved interrupts retained and discard series.At 100% in early iterations: Keep going! Test harder edge cases. Only 3× 100% after the minimum confirms true perfection.
In multi-model setups, the Validator can produce false positives — fails that aren't real issues:
agents.list[] ≠ agents_list tool)runtime: "acp")Rule: If after all real fixes >3 discards come in a row and the fail justifications don't hold up under scrutiny → declare convergence, don't validate endlessly.
| Flag | Behavior |
|---|---|
--dry-run (default) | Only TSV + proposed files. Target file/repo remains unchanged. |
--live | Target file/repo is overwritten. Auto-backup → results/backups/ |
--resume | Read existing TSV, continue from last iteration. On invalid format: abort. |
Only read if your task contains `mode: prompt`!
improved: propose minimal, surgical improvementBest version → results/[target]-proposed.md + report.sh --final
Only read if your task contains `mode: code`!
SCRATCH=$(mktemp -d) && cd $SCRATCHtimeout 60s)improved: minimal code improvement + verify again| Eval Type | Description | Example |
|---|---|---|
exit_code | Process exit code | exit_code == 0 |
output_contains | stdout contains string | "SUCCESS" in stdout |
output_matches | stdout matches regex | r"Total: \d+" |
test_pass | Test framework green | pytest exit 0 |
runtime | Runtime limit | < 5000ms |
no_stderr | No error output | stderr == "" |
file_exists | Output file created | result.json exists |
json_valid | Output is valid JSON | json.loads(stdout) |
Best code → results/[target]-proposed.[ext] + report.sh --final
Only read if your task contains `mode: audit`!
⚠️ DO NOT write your own code. Only test CLI commands of the target tool (--help + read-only).
Simple Audit (CLI skill, clear commands):
--help output and simple command structureDeep Audit (complex docs, many checks):
results/[target]-proposed.mdresults/[target]-audit-details.md (NOT in TSV!)--finalresults/[target]-proposed.md or results/[target]-v1.md--finalOnly read if your task contains `mode: project`!
⚠️ This mode operates on an ENTIRE repository/directory, not a single file. Cross-file consistency is the core feature — this is NOT "audit on many files."
Project mode runs through three sequential phases. Phases 1 and 2 happen once (in Iteration 1 = Baseline). Phase 3 is the iterative fix loop.
# Discover structure
tree -L 3 --dirsfirst [target_dir]
ls -la [target_dir]| Priority | Files |
|---|---|
| critical | README, Dockerfile, CI workflows (.github/workflows), package.json/requirements.txt, main entry points |
| normal | Tests, configs, scripts, .env.example, .gitignore |
| low | Docs, examples, LICENSE, CHANGELOG |
Run consistency checks across files. Each check = one eval point:
| Check | What it verifies |
|---|---|
| README ↔ CLI | Documented commands/flags match actual --help output |
| Dockerfile ↔ deps | requirements.txt / package.json versions match what Dockerfile installs |
| CI ↔ project structure | Workflow references correct paths, scripts, test commands |
| `.env.example` ↔ code | Every env var in code has a corresponding entry in .env.example |
| Imports ↔ dependencies | Every import / require has a matching dependency declaration |
| Tests ↔ source | Test files exist for critical modules |
| `.gitignore` ↔ artifacts | Build outputs, secrets, and caches are excluded |
Result of Phase 2: A complete eval checklist with per-file and cross-file checks, each scored Yes/No.
Same loop logic as prompt/code/audit — TSV, report.sh, stop conditions. Key differences:
"Fix Dockerfile + CI workflow sync"improved: apply minimal, surgical fixes to the fewest files necessary| Flag | Behavior |
|---|---|
--dry-run (default) | Fixed files → results/[target]-proposed/ directory (mirrors repo structure). Original repo untouched. |
--live | Files overwritten in-place. Originals backed up → results/backups/ (preserving directory structure). |
These evals are automatically used when the user doesn't provide custom evals. The agent detects which are applicable based on what exists in the repo:
| # | Eval | Condition | |||
|---|---|---|---|---|---|
| 1 | README accurate? (describes actual features/commands) | README exists | |||
| 2 | Tests present and green? (pytest / npm test / go test) | Test files or test config detected | |||
| 3 | CI configured and syntactically correct? | .github/workflows/ or .gitlab-ci.yml exists | |||
| 4 | No hardcoded secrets? (`grep -rE "(password | api_key | token | secret)\s*="`) | Always |
| 5 | Dependencies complete? (requirements.txt ↔ imports, package.json ↔ requires) | Dependency file exists | |||
| 6 | Dockerfile functional? (docker build succeeds or Dockerfile syntax valid) | Dockerfile exists | |||
| 7 | .gitignore sensible? (no secrets, build artifacts excluded) | .gitignore exists | |||
| 8 | License present? | Always |
Pass Rate = (Passing Evals / Total Applicable Evals) × 100Evals that don't apply (e.g. "Dockerfile functional?" when no Dockerfile exists) are excluded from the total, not counted as passes.
--dry-run: All proposed changes → results/[target]-proposed/ directory--live: Changes already applied, backups in results/backups/--finalresults/[target]-project-details.md with per-file findings (NOT in TSV!)autoforge/
├── SKILL.md ← This file
├── results/
│ ├── [target]-results.tsv ← TSV logs
│ ├── [target]-proposed.md ← Proposed improvement (prompt/audit)
│ ├── [target]-proposed/ ← Proposed repo changes (project mode)
│ │ ├── README.md
│ │ ├── Dockerfile
│ │ └── ...
│ ├── [target]-v1.md ← Deep audit final version
│ ├── [target]-audit-details.md ← Audit details (audit mode only)
│ ├── [target]-project-details.md ← Project details (project mode only)
│ └── backups/ ← Auto-backups (--live)
│ ├── [file].bak ← Single file backups (prompt/code/audit)
│ └── [target]-backup/ ← Full directory backup (project mode)
├── scripts/
│ ├── report.sh ← Channel reporting
│ └── visualize.py ← PNG chart (optional)
├── references/
│ ├── eval-examples.md ← Pre-built evals
│ └── ml-mode.md ← ML training guide
└── examples/
├── demo-results.tsv ← Demo data
└── example-config.json ← Example configurationAutoForge is not a CLI tool — it's a skill prompt for the agent:
# Optimize a prompt
"Start autoforge mode: prompt for the coding-agent skill.
Evals: PTY correct? Workspace protected? Clearly structured?"
# Audit a CLI skill (simple)
"Start autoforge mode: audit for notebooklm-py."
# Deep audit with multi-model
"Start autoforge mode: audit (deep) for subagents docs.
Optimizer: Opus, Validator: GPT-5
Extract ground truth from source, validate iteratively."
# Optimize code
"Start autoforge mode: code for backup.sh.
File: ./backup.sh
Test: bash backup.sh personal --dry-run
Evals: exit_code==0, backup file created, < 10s runtime"
# Optimize a whole repository
"Start autoforge mode: project for ./my-app
Evals: Tests green? CI correct? No hardcoded secrets? README accurate?"
# Project mode with custom focus
"Start autoforge mode: project for /path/to/api-server
Focus: Docker + CI pipeline consistency
Evals: docker build succeeds, CI workflow references correct paths,
.env.example covers all env vars used in code"
# Project mode dry-run (default)
"Start autoforge mode: project for ./my-tool --dry-run
Use default evals. Show me what needs fixing."references/eval-examples.md provides ready-to-use Yes/No evals grouped by category. Here's how they map to AutoForge modes:
| eval-examples.md Category | AutoForge Mode | Notes |
|---|---|---|
| Briefing, Email, Calendar, Summary, Proposal | prompt | Mental simulation with scenario evals |
| Python Script, Shell Script, API, Data Pipeline, Build | code | Real execution with measurable criteria |
| CI/CD, Docker, Helm, Kubernetes, Terraform | code or project | code for single files, project for cross-file |
| Code Review, API Documentation | audit | Verify docs match reality |
| Project / Repository, Cross-File Consistency, Security Baseline | project | Whole-repo scanning and cross-file checks |
Pick evals from the matching category and paste them into your task prompt as the eval set.
--dry-runprompt = think, code = execute, audit = test CLI, project = optimize reporeferences/ml-mode.md~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.