knowledge-base
Project-specific prompt optimization knowledge management. Use when storing or retrieving learned patterns from comparisons. Provides schema, extraction criteria, capacity management, and retention scoring.
What this skill does
# Knowledge Base Skill
## Storage Location
```
{project_root}/.claude/.rashomon/prompt-knowledge.yaml
```
## Schema
```yaml
patterns:
- name: "Pattern name"
what_to_look_for: |
When this pattern applies
improvement: |
How to improve when detected
learned_from: "Date and context"
confidence: 0.0-1.0
times_applied: 0
anti_patterns:
- name: "Anti-pattern name"
what_to_look_for: |
What to avoid
why_bad: |
Why problematic in this project
learned_from: "Date and context"
confidence: 0.0-1.0
metadata:
last_updated: "ISO-8601 timestamp"
total_comparisons: 0
patterns_count: 0
anti_patterns_count: 0
max_entries: 20
```
## Extraction Criteria
### Save as Improvement Pattern
**ALL conditions must be true**:
- Optimized prompt showed **structural improvement** (not variance)
- Improvement is **project-specific** (not explained by BP-001~008)
- Pattern is likely to **recur** in this project
**Confidence Assignment**:
| Evidence | Confidence |
|----------|------------|
| Multiple comparisons confirmed | 0.8+ |
| Single comparison, clear effect | 0.5-0.7 |
| Effect present but uncertain | 0.3-0.5 |
**Minimum threshold**: 0.3 (entries below this are skipped)
### Save as Anti-Pattern
**ALL conditions must be true**:
- Original had problem **specific to this project**
- Problem is **project-specific** (beyond standard patterns BP-001~008)
- Problem **likely to recur**
### Extraction Scope
Save only entries that are:
- Project-specific (beyond standard best practices BP-001~008)
- Likely to recur in this project
- Showing clear effect (structural improvement, confidence ≥ 0.3)
## Capacity Management
**Maximum**: 20 entries (patterns + anti_patterns combined)
**Retention Score**: `confidence * (1 + log(times_applied + 1))`
This formula:
- Prioritizes high-confidence entries
- Rewards frequently-used patterns
- Treats all entries equally regardless of age
**Key Principle**: Old entries are valuable. Retention depends on confidence and usage frequency.
**Eviction Process**:
1. Calculate retention scores for all entries
2. Calculate score for new candidate
3. If new > lowest existing: remove lowest, add new
4. Otherwise: skip new entry
## Operations
### Retrieval
At start of prompt analysis:
1. Read `.claude/.rashomon/prompt-knowledge.yaml` (if exists)
2. For each entry, check `what_to_look_for` against current prompt
3. Return relevant entries with relevance scores
4. Increment `times_applied` for patterns used
### Storage
After comparison (if structural improvement found):
1. Evaluate against extraction criteria
2. Generate candidate entries
3. Check for duplicates
4. Apply capacity management
5. Write updated knowledge base
6. Update metadata
## Example Entry
```yaml
patterns:
- name: "TypeScript interface reference"
what_to_look_for: |
Code generation prompts creating TypeScript types without
referencing existing type definitions in src/types/
improvement: |
Add: "Reference existing types in src/types/ to maintain
consistency and avoid duplicate type definitions"
learned_from: "2026-01-14: Comparison showed better type reuse"
confidence: 0.7
times_applied: 3
```
## Feedback-Based Adjustments
When comparison results require knowledge base updates:
**Confidence Adjustments**:
- User confirms improvement: +0.1 (cap at 0.95)
- Pattern led to worse result: -0.2
- Remove entry if confidence < 0.2 after decrease
**Entry Management**:
- Add new entries from user insight (initial confidence: 0.5)
- Remove entries that fall below confidence threshold
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.