Back to Skills

llm-context-rule-creator

verified

Create optimized llm-context rules for specific tasks by analyzing codebase content and generating minimal file selection patterns

View on GitHub

Repository

cyberchitta/llm-context.py
289stars

src/llm_context/lc_resources/skills/llm-context-rule-creator/Skill.md

Last Verified

January 25, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/cyberchitta/llm-context.py/blob/992f7f051690c5c53c72bcfe6e55be0d647377d7/src/llm_context/lc_resources/skills/llm-context-rule-creator/Skill.md -a claude-code --skill llm-context-rule-creator

Installation paths:

Claude
.claude/skills/llm-context-rule-creator/
Powered by add-skill CLI

Instructions

# LLM Context Rule Creator

Create focused rules for specific development tasks.

## What Rules Do

Rules define which project files appear in LLM context. You specify **full files** (complete content) and **excerpted files** (structure/signatures only) to keep token usage reasonable. Without rules, you'd get thousands of files - build artifacts, dependencies, cache, etc. Rules filter and curate what matters for your task.

See **SYNTAX.md** for detailed field descriptions.

## Quick Workflow

1. **Understand task** - Extract goal, target files, scope
2. **Examine codebase** - Use `lc_outlines` and `lc_missing` to explore
3. **Determine filters** - Start with project defaults, check custom filters
4. **Select files** - 5-15 full, 10-30 excerpted
5. **Generate rule** - Use template with proper composition
6. **Estimate & save** - ~40k tokens target, save to `tmp-prm-<n>`

## Filtering is Critical

**Without filters, you get thousands of files** - build artifacts, dependencies, config noise, test data, etc. Always filter first.

**Start with project filters:**

- Check `.llm-context/rules/` for custom filters like `flt-repo-base`
- Use `lc/flt-base` as minimum (excludes binaries, logs, common noise)
- Compose filters in the `compose.filters` array

**Then refine with `also-include`:**

- After filtering removes unwanted files, use `also-include` to add back what you need
- This is much faster than dealing with thousands of irrelevant files

## File Selection Guide

**Full content (5-15 files):**

- Files to be modified
- Small configs
- Integration points

**Excerpted (10-30 files):**

- Related modules (structure only)
- Large files (signatures needed)
- Tests, dependencies

**Implementations:**

- Specific functions from large files

## Basic Template

```yaml
---
description: <one-line task>
overview: full
compose:
  filters: [lc/flt-base] # Always filter first to exclude noise
  excerpters: [lc/exc-base] # Required for outlining
also-include:
  full-files:
    - "

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
2981 chars