# Forge

> Forge — mint the factory, not the artifact

- Skill: `manutej/forge` (Agent Skill, multi-file: 9 files)
- Install (CLI): `npx skillmds@latest add manutej/forge`
- Raw SKILL.md: https://api.skillmd.com/api/skills/manutej/forge/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: manutej (https://skillmd.com/u/manutej)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/manutej/forge

---


# Forge — mint the factory, not the artifact

This skill runs at **Level 2** (the meta-meta space). Input a use-case CATEGORY; output the versioned factory meta-prompt that serves every future instance of that category. Never emit client-facing artifacts here — that is what the forged factory's runs (the `run-factory` skill) are for. Forging is a **Recursive Meta Prompting derivation**: a typed use-case intake record maps, structure-preservingly, to a typed factory. Get the intake typing right and the factory writes itself.

## References index

Read `references/factory-schema.md` (what every factory must contain) and `references/meta-meta-map.md` (why the rules exist) before forging. Depth lives in three files here:

- `references/forging-protocol.md` — the step-level derivation: intake typing, nearest-factory part-transfer table (Kan extension made mechanical), slot/lane/artifact-contract derivation rules, DONE-predicate construction, changelog seeding.
- `references/factory-rubric.md` — the anchored 1–5 scoring rubric across 8 dimensions, with a 2-vs-4 anchor per dimension and the minimum shipping bar.
- `references/use-case-taxonomy.md` — the families of sales/copy/account use cases, each with signal type, typical slot deltas, gates, artifact contract, and nearest seed factory.

Binding law shared with every skill: `references/evidence-rules.md`, `references/design-rigor.md`. The proven seed: `references/factory-bid-package-v0.3.md`.

## H1 — The typed contract

**Input: the use-case intake record.** Fill at intake; `UNKNOWN` is legal, never invented.

```
USE_CASE_NAME:       str            # the deliverable category as a noun phrase (never an instance)
SIGNAL_TYPE:         str            # the event that starts a run of this category
WIN_CONDITION:       {win|retain|expand|enable}   # what a run is trying to achieve
DELIVERABLE_SET:     list[str]      # the artifacts one run must emit
RECURRENCE_EVIDENCE: str|UNKNOWN    # evidence the category recurs (≥3 past/expected instances)
NEAREST_FACTORY:     str|UNKNOWN    # closest existing factory or the bid-package seed
SEED_INSTANCES:      list[str]      # 1–3 concrete instances — used only to DERIVE and TEST, never to fill factory slots
VARIANTS_TO_COVER:   list[str]      # ≥2 hypothetical instances the factory must generalize across
KNOWN_CONSTRAINTS:   list[str]|UNKNOWN  # domain gates, compliance, format demands known up front
```

**Output: the typed factory + its registration.**

```
FACTORY:             file           # FACTORY/factories/<use-case-slug>-v0.1.md — a full instantiation of factory-schema.md
RUBRIC_SCORE:        record         # dimension → 1–5, from factory-rubric.md; must clear the bar
GENERALIZATION_LOG:  record         # per VARIANTS_TO_COVER: what held, what was demoted as overfit
CHANGELOG_SEED:      block          # v0.1 naming seed instances + UNTESTED areas
CAPTURED_ATOMS:      list           # factory-pattern atoms minted to FACTORY/atoms.md
```

## The derivation loop (Frame → Do → Review → Capture)

Forging is one pass of this loop. Each stage has a checkable output; do not advance until the prior stage's output exists.

### FRAME — type the use case
Fill the intake record. State assumptions in one line rather than asking the user. Check the **refusal conditions** below before spending effort: a category that cannot show recurrence or cannot generalize is a run, not a factory. Confirm `USE_CASE_NAME` names a category (a class of deliverables), not an instance (one client's deliverable) — if it carries any instance value, lift it out.

### DO — emit the factory (structure-preserving)
Execute `references/forging-protocol.md` in order:
1. **Retrieve the nearest factory** (`NEAREST_FACTORY`, else the bid-package seed) and build the **part-transfer table**: for each of {slots, lanes, gates, artifact contract, binding rules, atoms}, mark TRANSFER (carries verbatim), ADAPT (carries with a named edit), or NEW (no near neighbor → flag `UNTESTED`). This is the Kan-extension step made mechanical — assemble from neighbors' parts, never from a blank page, never presented as exact.
2. **Derive the slots.** Carry the universal slot set from `factory-schema.md`. Apply the add/rename/retire rules (protocol §3). Every use-case-specific slot carries a `# mislabeling-cost` comment stating what breaks in the artifacts if the slot is read wrong — a slot without one is not done.
3. **Derive the lanes, artifact contract, and DONE predicate** per protocol §4–6, keyed to `DELIVERABLE_SET` and `WIN_CONDITION`.
4. **Instantiate every section of `factory-schema.md`**: header, typed input slots, derived slots, the 8-step procedure (adapt wording, keep every step), the 9 binding rules verbatim and in force, output contract, DONE predicate, self-improvement loop, changelog v0.1.

### REVIEW — score and generalize (the safety net)
1. **Score against `references/factory-rubric.md`** across all 8 dimensions. Any dimension below the minimum bar returns to DO for a second pass; a factory that cannot clear the bar in two passes is refused (log why).
2. **Run the draft against every `VARIANTS_TO_COVER` instance.** Re-type each hypothetical through the factory's slots. Any slot or rule that only fits one instance is overfit — generalize it or demote it to an instance-level note in the run, never the factory. Record each result in `GENERALIZATION_LOG`.
3. **Naturality check:** if two variants differ only by an instance value that a slot already absorbs, that difference must NOT create a new slot (see the `PROOF_MARKET → PROOF_CONTEXT` precedent in `meta-meta-map.md`).

### CAPTURE — register and learn
Write `FACTORY/factories/<use-case-slug>-v0.1.md`. Ensure `FACTORY/feedback-loop.md` and `FACTORY/atoms.md` exist (create with headers if missing). Mint at least one **factory-pattern atom** to `FACTORY/atoms.md` (type `factory-pattern`: a slot-delta, gate pattern, or artifact-contract shape reusable when forging the next factory in this family), each with source, date, where it applies, and where it does NOT. Seed the changelog. Hand off: the factory is registered; `run-factory` executes it on the next signal.

## H2 — Acceptance checklist (the forge output is DONE only if every box holds)

- [ ] `USE_CASE_NAME` is a category, not an instance; zero instance values appear anywhere in the factory.
- [ ] Every slot is typed; `UNKNOWN` legal where honest; every use-case-specific slot carries a mislabeling-cost comment.
- [ ] Part-transfer table exists; every NEW part is flagged `UNTESTED` in the changelog.
- [ ] All 9 binding rules present verbatim and unweakened.
- [ ] Derived slots, lanes, artifact contract, and DONE predicate are keyed to `DELIVERABLE_SET` and `WIN_CONDITION`.
- [ ] `RUBRIC_SCORE` clears the minimum bar on all 8 dimensions.
- [ ] `GENERALIZATION_LOG` documents the draft run against ≥2 variants; every overfit slot/rule demoted.
- [ ] Registered at `FACTORY/factories/<slug>-v0.1.md`; changelog names seed instances + untested areas; ≥1 factory-pattern atom minted.

## H4 — Forging at scale (N use cases in parallel)

When minting many factories at once (standing up a practice, onboarding a new vertical):

- **Shared vs. per-factory assets.** Shared and read-only this wave: the core law pack (`factory-schema`, `meta-meta-map`, `evidence-rules`, `design-rigor`), the rubric, and the taxonomy. Per-factory: one intake record, one nearest-factory file, one output file. Never fork the shared law per use case — divergence there is a defect.
- **Fan-out.** One sub-agent per `USE_CASE_NAME`, context-complete packet: the intake record + the nearest-factory file + `factory-schema.md` + `forging-protocol.md` + the taxonomy row for its family. Sub-agents forge; they never run factories and never edit the shared law.
- **Context budget.** Each agent reads its nearest factory and its taxonomy row — NOT all existing factories. The part-transfer table bounds what it must read.
- **Fan-in (dedupe).** Collect every agent's slot-deltas and gate patterns; deduplicate into shared `factory-pattern` atoms. If two use cases differ only by an instance value, collapse them to one factory (naturality) rather than shipping twins.
- **Failure/retry.** A returned factory below the rubric bar gets one re-derivation pass; still failing → refuse and report the category as too thin. Never ship an unscored factory to close a batch.

## Editing an existing factory (version bump)

Apply the schema's self-improvement loop (this is the `Improve` endofunctor of `meta-meta-map.md`): log feedback in `FACTORY/feedback-loop.md` → trace each correction to the exact slot/rule/procedure line that ALLOWED it (not "be better") → edit → bump version with a changelog entry (date, feedback source, change, generalization check performed) → re-run REVIEW against `VARIANTS_TO_COVER`. An edit that weakens a binding rule is **rejected** — binding rules are naturality conditions, not preferences. Feedback that traces to no line is logged and flagged "no line found: procedure gap?" — itself a finding. The `mint-atoms` skill drives this loop; forge owns the factory edit.

## H8 — Core invariants (restated where load-bearing)

Numbers are sourced and dated or flagged `EST`; entity IDs stay UNCONFIRMED until human-verified. Unknowns enter a ledger and pass the auto-triage ladder before any human is asked. Flow is one-directional: research → synthesis → artifact. Regenerate on refined input; never hand-patch. Plain language in every client-facing artifact; the functor machinery stays internal. The sign-here bijection (tells ↔ scope ↔ price) is every offer artifact's skeleton. A factory that omits or weakens any of these is not a morphism in the factory category — reject it.

## H9 — DONE predicate and refusal conditions

**DONE** when: the acceptance checklist (H2) is fully green · `RUBRIC_SCORE` clears the bar · the generalization check against 2–3 hypothetical variants is documented · the factory is registered with a v0.1 changelog · ≥1 factory-pattern atom is minted.

**Refuse to forge** (emit a note, not a factory) when:
- **Category too thin.** `RECURRENCE_EVIDENCE` shows fewer than ~3 plausible instances. One-off work belongs in a run, not a factory — direct the user to `run-factory` with the nearest existing factory.
- **Cannot generalize.** The draft cannot clear the rubric bar in two passes, or every candidate slot collapses to one instance. Ship the single deliverable as a run and revisit when a second instance appears.
- **Would duplicate.** An existing factory already absorbs this category once one instance value is lifted out. Point to it; do not mint a twin.
- **Would weaken the law.** The only way to fit the category is to break a binding rule. Escalate the rule question; never ship the breach.

## H10 — Self-improvement hooks

Every factory carries a changelog; every edit bumps a version and traces to a feedback line. Forge-level lessons (a recurring slot-delta across a family, a gate that keeps surfacing) become `factory-pattern` atoms consumed by the next forge run — so forging itself compounds. When this skill's own procedure repeatedly fails a family, that is a signal to add a taxonomy row, not to hand-patch a factory.

