bundles/planning/skills/rules-capture/SKILL.md
Automatically detects and documents user preferences, coding standards, and workflow rules from conversation — capturing them to `.agents/memory/captured-rules.md` for promotion to permanent project or user rules. Triggers on: "always do X", "never do X", "from now on", "the rule is", "stop doing X", "I prefer", frustration indicators, or any correction to AI behavior.
npx skillsauth add shipshitdev/library rules-captureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Inputs:
Outputs:
Creates/Modifies:
.agents/memory/captured-rules.md (marked status: temporary)External Side Effects:
Confirmation Required:
Delegates To:
skill-capture when the rule is a reusable workflow that should become a skillagent-config-audit when the rule may affect multiple config filessession-documenter when the rule should be noted in session historyAutomatically activate when the user mentions ANY of these:
When a rule/preference is detected:
I noticed you expressed a preference/rule. Let me capture this.
Parse the user's statement to identify:
Append to .agents/memory/captured-rules.md (create the file if absent, with a YAML front-matter block including status: temporary):
### [YYYY-MM-DD HH:MM] - [Category]: [Short Title]
**User said (redacted):**
> "[Short supporting quote with secrets replaced by [REDACTED_SECRET]]"
**Rule extracted:**
- **Type**: [ALWAYS | NEVER | PREFER | AVOID]
- **Action**: [What to do/not do]
- **Context**: [When this applies]
- **Category**: [coding | naming | imports | patterns | tools | communication | workflow]
**Example:**
```[language]
// Good
[good example]
// Bad
[bad example]
```
Status: PENDING_REVIEW
### 4. Confirm with User
Captured this rule:
Should I add this to the permanent rules? [Yes/No/Modify]
### 5. On Confirmation
- **Personal preferences** → append to the user's platform-level instruction file under the appropriate section
- **Shared project coding standards** → append to the applicable `AGENTS.md`
- **Scoped project overrides** → use `AGENTS.override.md` only when inherited guidance must be replaced for a subtree
- **Claude-specific behavior** → append to `CLAUDE.md`
- **Durable project facts** (architecture, deployment notes, gotchas) → add/update a file in `.agents/memory/`
- Remove the entry from `.agents/memory/captured-rules.md` (or mark it PROCESSED)
---
## Rule Categories
### Coding Rules
- Pattern preferences
- Import conventions
- Naming conventions
- File structure
- Component patterns
### Workflow Rules
- Build/test preferences
- Git workflow
- Documentation requirements
- Communication style
### Tool Rules
- CLI preferences
- IDE settings
- Terminal behavior
- Background processes
### Communication Rules
- Response style
- Verbosity preferences
- Explanation depth
- Acknowledgment patterns
---
## Storage Locations
| Rule Type | Storage Location |
|-----------|------------------|
| Personal preferences | User-level platform instruction file |
| Project coding standards | Repo-level agent instruction file |
| Durable project facts | `.agents/memory/<topic>.md` |
| Pending review | `.agents/memory/captured-rules.md` (`status: temporary`) |
---
## Redaction Rules
Before writing or displaying a captured quote:
- Replace API keys, tokens, passwords, cookies, private URLs, and credentials
with `[REDACTED_SECRET]`.
- Keep only the shortest quote needed to justify the rule. Summarize the rest.
- If the rule itself is about handling a secret, capture the policy, not the
secret value.
## Auto-Capture File Format
File: `.agents/memory/captured-rules.md`
```markdown
---
status: temporary
last_verified: YYYY-MM-DD
---
# Captured Rules - Pending Review
Rules automatically captured from conversations. Review and promote to permanent storage.
---
## Pending Rules
[Auto-captured rules appear here]
---
## Processed Rules
[Rules that have been promoted to CLAUDE.md or .agents/memory/]
```
---
## Integration with Other Skills
This skill works with:
- **docs**: For formatting captured rules properly
- **session-documenter**: Rules captured during session are included in session docs
---
## Cleanup Command
When user says "clean up rules" or "process captured rules":
1. Read `.agents/memory/captured-rules.md`
2. Present each pending rule for review
3. User can: Approve, Modify, Delete
4. Approved rules get promoted to CLAUDE.md or `.agents/memory/` as appropriate
5. File is cleaned up
---
## Example Interaction
**User**: "stop using console.log for debugging, use the logger service"
**Agent**:
```
I noticed a new rule. Let me capture it:
Rule: Use logger service instead of console.log for debugging
Category: Coding
Type: NEVER (console.log) / ALWAYS (logger service)
Added to captured rules. Should I promote this to permanent coding rules?
```
---
## Activation Triggers
The skill activates on these regex patterns:
```regex
# Direct commands
(always|never|don't|stop|from now on|going forward)\s+.+
(prefer|like|want|need)\s+(you to|it to|this to)\s+.+
(the rule is|the standard is|the convention is)\s+.+
# Frustration signals
(why (did|do) you|stop doing|I told you|I already said)\s+.+
(that's (wrong|not right|incorrect)|fix this|change this)\s+.+
# Questions about standards
(what's the (rule|standard|convention) for|how should I|which way is)\s+.+
```
development
TypeScript refactoring and modernization guidelines from a principal specialist perspective. This skill should be used when refactoring, reviewing, or modernizing TypeScript code to ensure type safety, compiler performance, and idiomatic patterns. Triggers on tasks involving TypeScript type architecture, narrowing, generics, error handling, or migration to modern TypeScript features.
tools
Resolves TypeScript and JavaScript problems across type-level programming, performance, monorepo management, migration, and modern tooling. Invoke when diagnosing "type instantiation excessively deep" errors, migrating JS to TS, configuring strict tsconfig, debugging module resolution, or choosing between Biome/ESLint/Turborepo/Nx.
tools
Turborepo monorepo build system guidance. Triggers on: `turbo.json`, task pipelines, `dependsOn`, caching, remote cache, the `turbo` CLI, `--filter`, `--affected`, CI optimization, environment variables, internal packages, monorepo structure, and package boundaries. Use when the user configures tasks or workflows, creates packages, sets up a monorepo, shares code between apps, runs changed packages, debugs cache behavior, or works in an `apps/` plus `packages/` workspace.
tools
Provides Tailwind CSS v4 performance optimization and best practices guidelines. Triggers when writing, reviewing, or refactoring Tailwind CSS v4 code; when working with Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.