# Kmg rules capture

> Kmg rules capture is an open-source agent skill for knowledge and memory. Spots mid-session behavioral corrections and routes them to the right rules file. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/technomensch/knowledge-graph/tree/main/skills/kmg-rules-capture
- **Repository:** https://github.com/technomensch/knowledge-graph
- **GitHub stars:** 6
- **License:** MIT
- **Skill name:** kmg-rules-capture
- **Collection:** https://github.com/technomensch/knowledge-graph
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-12-03

## About

This skill watches the conversation for implicit corrections and standing preferences the user states without asking to record anything. When one is found, it drafts the instruction as a short always or never statement and offers to save it, rather than writing it silently.

Before suggesting a destination, the skill works out where a rule belongs. It checks whether the project has a platform configuration file such as CLAUDE.md, GEMINI.md, .cursor rules or AGENTS.md, and separates project-wide rules from personal style notes. It also avoids firing on one-time or time-bounded instructions and on code-style remarks, and it defers to other capture skills when the user explicitly asks to capture or save something.

The skill is written for the knowledge-management-graph setup, using paths such as knowledge/rules.md and a personal ~/.kmgraph folder, and it hands the actual write to a separate rules-capture agent. Its detection logic relies on file and directory checks in the project root.

## When your agent uses it

> Detect implicit mid-session behavioral corrections and route to the correct rules file

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/technomensch/knowledge-graph/tree/HEAD/skills/kmg-rules-capture)
- [License: MIT](https://github.com/technomensch/knowledge-graph/tree/HEAD/skills/kmg-rules-capture)

## Features

- **Implicit correction detection:** Recognizes phrases like always, never, from now on and going forward as standing behavioral directives.
- **Ephemeral instruction filtering:** Skips session-only or time-bounded instructions such as anything ending in yet or until a condition.
- **Scope classification:** Separates project rules, project-personal notes, and personal rules and style preferences.
- **Platform-aware routing:** Detects the AI client config file present in the project and suggests it as a write target.
- **Trigger pairing prompt:** Asks whether a phase-specific rule should apply only in certain situations.

## Good for

- Save a standing instruction like never force-push so future sessions follow it
- Record a personal writing style preference across all projects
- Route a project workflow rule into the team rules file
- Store a platform-specific convention in the matching client config file

## Install

### Claude Code

This skill ships in the `kmgraph` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add technomensch/knowledge-graph
/plugin install kmgraph@knowledge-management-graph
```

Or copy only this skill to `~/.claude/skills/kmg-rules-capture`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/technomensch/knowledge-graph.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/kmg-rules-capture &&
cp -R "$tmp/skills/kmg-rules-capture" ~/.claude/skills/kmg-rules-capture &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/kmg-rules-capture` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/kmg-rules-capture` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/technomensch/knowledge-graph.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/kmg-rules-capture &&
cp -R "$tmp/skills/kmg-rules-capture" ~/.agents/skills/kmg-rules-capture &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/kmg-rules-capture` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/kmg-rules-capture` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/technomensch/knowledge-graph.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/kmg-rules-capture &&
cp -R "$tmp/skills/kmg-rules-capture" ~/.cursor/skills/kmg-rules-capture &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/kmg-rules-capture` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/technomensch/knowledge-graph.git --path skills/kmg-rules-capture
```

Or copy the folder to `~/.gemini/skills/kmg-rules-capture` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/kmg-rules-capture`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/technomensch/knowledge-graph.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/kmg-rules-capture &&
cp -R "$tmp/skills/kmg-rules-capture" ~/.copilot/skills/kmg-rules-capture &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/kmg-rules-capture` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/technomensch/knowledge-graph.git
```

Then copy `knowledge-graph/skills/kmg-rules-capture` into your agent's skills folder as `kmg-rules-capture`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What triggers Kmg rules capture?

Phrases such as always, never, from now on, going forward, or I prefer that express standing behavior rather than a one-off task.

### Does Kmg rules capture write rules automatically?

No. It shows a one-line suggestion with a target and waits for the user to accept, pick another target, or decline. Writes are handled by a separate agent.

### Which files does Kmg rules capture detect?

It checks the project root for .claude, .cursor, GEMINI.md, .windsurfrules, .github/copilot-instructions.md, .zed, .rules and AGENTS.md, plus the CLAUDE.md variant, to choose a platform target.

### What does Kmg rules capture skip?

Temporary instructions such as don't push yet, observations about past events, one-time clarifications, and code-style remarks about a diff.

### How do I install Kmg rules capture in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/kmg-rules-capture to use it in all your projects, or to .claude/skills/kmg-rules-capture in one project. Or install the kmgraph plugin, which includes it: /plugin marketplace add technomensch/knowledge-graph, then /plugin install kmgraph@knowledge-management-graph.

### Does Kmg rules capture run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Kmg rules capture?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Kmg rules capture?

The closest alternatives to Kmg rules capture are Kmg capture router, Kmg lesson capture, Kmg knowledge graph usage, Kmg update profile and Remember.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Kmg capture router](https://ai-powered.com/skills/kmg-capture-router): Kmg capture router is an open-source agent skill for knowledge and memory.
- [Kmg lesson capture](https://ai-powered.com/skills/kmg-lesson-capture): Kmg lesson capture is an open-source agent skill for knowledge and memory.
- [Kmg knowledge graph usage](https://ai-powered.com/skills/kmg-knowledge-graph-usage): Kmg knowledge graph usage is an open-source agent skill for knowledge and memory.
- [Kmg update profile](https://ai-powered.com/skills/kmg-update-profile): Kmg update profile is an open-source agent skill for knowledge and memory.
- [Remember](https://ai-powered.com/skills/remember-ajyadav013-2): Remember is an open-source agent skill for knowledge and memory.
- [Kmg brainstorm recall](https://ai-powered.com/skills/kmg-brainstorm-recall): Kmg brainstorm recall is an open-source agent skill for knowledge and memory.
- [Memory distill](https://ai-powered.com/skills/memory-distill): Memory distill is an open-source agent skill for knowledge and memory.
- [Docbrain capture](https://ai-powered.com/skills/docbrain-capture): Docbrain capture is an open-source agent skill for knowledge and memory.

---
Source: https://ai-powered.com/skills/kmg-rules-capture
