# IV. Skill Forge

If memory is *what your agent knows*, skills are *what your agent can do*. The Forge is where reusable prompts, rubrics, and workflows live a real life — proposed, tested, versioned, promoted, and (sometimes) retired.

## The skill lifecycle

```
   ┌──────────┐    accept    ┌──────────┐   test ok   ┌──────────┐
   │suggested │ ───────────▶│ accepted │ ──────────▶│ testing  │
   └──────────┘              └──────────┘             └────┬─────┘
        ▲                                                  │
        │ re-suggest                              promote  ▼
        │                                            ┌──────────┐
        └──────────────────── archive ─────────────  │ promoted │
                                                      └──────────┘
```

Only **promoted** skills are auto-included in chat prompts. Everything else is parked.

## What a skill is

```ts
type Skill = {
  id: string;
  user_id: string;
  name: string;
  description: string | null;
  category: string | null;     // "writing" | "code" | "ops" | ...
  status: "suggested"|"accepted"|"testing"|"promoted"|"archived";
  score: number;               // 0.0–1.0 — last Mirror Mode evaluation
  version: number;             // increments on every template change
  template_prompt: string | null;
};
```

## Suggesting a skill

Click **Suggest Skill** with some context (or empty). The page calls the server fn `suggestSkill`:

```ts
const suggest = useServerFn(suggestSkill);
const skill = await suggest({ data: { context: ctx } });
// returns a draft Skill row with status: "suggested"
```

The handler:

1. Pulls the user's bound Hermes Agent (or the platform fallback model).
2. Sends a structured "propose a reusable skill from this context" prompt.
3. Parses JSON: `{ name, description, category, template_prompt }`.
4. Inserts a `suggested` row.

## Testing and promoting

* **Accept** — moves to `accepted`, ready for live use but not auto-injected.
* **Test** — opens a side-by-side console where the skill is injected vs. not, against a fixed prompt.
* **Promote** — the skill now ships in every relevant chat. `version` bumps if `template_prompt` changed since last promotion.
* **Archive** — soft-delete; the skill is hidden but recoverable.

## Versioning

Editing a skill's `template_prompt` while it's `promoted` immediately bumps `version` and writes the old prompt to a history row. This means **you can always roll back** a skill that started misbehaving after a tweak.

## Sharing

From the Forge you can right-click a skill → **Export as Template**. That sends it through the Templates page (see [Community Templates](/entermirari-docs/the-six-rites/templates.md)) where identifying strings are stripped before publishing.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://entermirari.gitbook.io/entermirari-docs/the-six-rites/skill-forge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
