self-extension-workflow

self-extension-workflow is a cursor rule for Cursor from sordi-ai/skill-everything. It costs 27 tokens per session (1,849 once invoked), scanned A, original, MIT.

Rules for turning an agent mistake into a reviewed project rule through a fixed workflow. A pull request is a proposed code change that others review before it is merged.

In plain words
What is it for?
Use it after faulty code, corrective review feedback, deployment problems, or an explicit request to remember a mistake.
Why use it?
It prevents lessons from mistakes being added informally and requires searches, CI checks, and CODEOWNERS approval before they become permanent.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/sordi-ai/skill-everything/self-extension-workflow
Clone the repo
git clone --depth 1 https://github.com/sordi-ai/skill-everything

Made for: Cursor.

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 self-extension-workflow

README.md
[![agentmods](https://agentmods.dev/badge/rules/sordi-ai/skill-everything/self-extension-workflow.svg)](https://agentmods.dev/rules/sordi-ai/skill-everything/self-extension-workflow)
Your own site
<a href="https://agentmods.dev/rules/sordi-ai/skill-everything/self-extension-workflow"><img src="https://agentmods.dev/badge/rules/sordi-ai/skill-everything/self-extension-workflow.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,849 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00027 $0.01849
Opus 5 $0.00014 $0.00924
Sonnet 5 $0.00005 $0.00370
Haiku 4.5 $0.00003 $0.00185

Measured 4d ago against content hash 4f77efe4fd8d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

self-extension-workflow 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 4d 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.

.cursor/rules/self-extension-workflow.mdc · 181 lines

How it starts

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

Self-extension workflow

Exact prompt and procedure the agent executes after every mistake. The agent never pushes to main directly. Every self-extension is a PR.

Five agent steps plus a search-prerequisite, from mistake to merged rule. The agent never pushes to main. Every rule that lands is CODEOWNERS-approved. This page is the contract.


TRIGGER CONDITIONS

Five conditions. Any one of them starts the workflow.

The agent starts this workflow when any of these is met:

  • A test fails and the agent wrote the faulty code.
  • A code review comment corrects the agent.
  • The agent realises during implementation that its first approach was wrong.
  • A deployment problem occurs that the agent caused.
  • The user explicitly says: "That was wrong" / "Remember this".

STEP-BY-STEP PROCEDURE

Five steps after the search-prerequisite. Every step is mandatory before the next one.

Step 0 — Search before write

Mandatory. Duplicates in the error log destroy the signal.

Before creating a new error entry, search the existing error log:

1. Read skills/error-log/SKILL.md.
2. Search for similar errors (same category + similar context).
3. If a similar entry exists:
   - Increment its `count` field by 1.
   - Update `last_seen` to today.
   - Supplement the context if needed.
   - Do NOT create a new entry.
4. Only if no similar entry exists, continue with Step 1.

Step 1 — Analyse the error

The agent answers six questions before writing anything.

1. What exactly did I do? (concrete code/action)
2. What should I have done instead?
3. Why did I do it wrong? (false assumption, missing knowledge, carelessness)
4. Which category applies?
   - development: code error, wrong implementation
   - git: commit/branch mistake
   - deployment: deployment order, configuration
   - security: security vulnerability
   - performance: N+1, missing indexes, oversized datasets
   - domain: wrong understanding of business rules
5. How severe was the error? (critical/high/medium/low)
6. Which target file does the rule belong in?

Read the full file on GitHub · 181 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. 4d ago First seen · 181 lines · 27 tokens per session scan A 4f77efe4fd8d

Subscribe to this mod's changes

self-extension-workflow is a cursor rule published in the GitHub repository sordi-ai/skill-everything (20 stars, last pushed 3mo ago), licensed MIT. It adds 27 tokens to every session and 1,849 once invoked, about $0.0001 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.