Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

abstract

Meta-skills infrastructure for the plugin ecosystem - skill authoring, hook development, and quality evaluation.

Overview

The abstract plugin provides tools for building, evaluating, and maintaining Claude Code plugins. It’s the toolkit for plugin developers.

Installation

/plugin install abstract@claude-night-market

Skills

SkillDescriptionWhen to Use
skill-authoringTDD methodology with Iron Law enforcementCreating new skills with quality standards
hook-authoringSecurity-first hook developmentBuilding safe, effective hooks
modular-skillsModular design patternsBreaking large skills into modules
rules-evalClaude Code rules validationAuditing .claude/rules/ for frontmatter, glob patterns, and content quality
skills-evalSkill quality assessmentAuditing skills for token efficiency
hooks-evalHook security scanningVerifying hook safety
escalation-governanceModel escalation decisionsDeciding when to escalate models
methodology-curatorExpert framework curationGrounding skills in proven methodologies
shared-patternsPlugin development patternsReusable templates
subagent-testingSubagent test patternsTesting subagent interactions

Commands

CommandDescription
/validate-plugin [path]Check plugin structure against requirements
/create-skillScaffold new skill with best practices
/create-commandScaffold new command
/create-hookScaffold hook with security-first design
/analyze-skillGet modularization recommendations
/bulletproof-skillAnti-rationalization workflow for hardening
/context-reportContext optimization report
/hooks-evaldetailed hook evaluation
/make-dogfoodAnalyze and enhance Makefiles
/rules-evalEvaluate Claude Code rules quality
/skills-evalRun skill quality assessment
/test-skillSkill testing with TDD methodology
/validate-hookValidate hook compliance

Agents

AgentDescription
meta-architectDesigns plugin ecosystem architectures
plugin-validatorValidates plugin structure
skill-auditorAudits skills for quality and compliance

Hooks

HookTypeDescription
homeostatic_monitor.pyPostToolUseReads stability gap metrics, queues degrading skills for auto-improvement
aggregate_learnings_daily.pyUserPromptSubmitDaily learning aggregation with severity-based issue creation
pre_skill_execution.pyPreToolUseSkill execution tracking
skill_execution_logger.pyPostToolUseSkill metrics logging
post-evaluation.jsonConfigQuality scoring and improvement tracking
pre-skill-load.jsonConfigPre-load validation for dependencies

Insight Engine

The insight engine transforms raw skill execution metrics into diverse findings posted to GitHub Discussions. Four trigger points feed a pluggable lens architecture through a deduplication registry.

Architecture

Stop Hook (lightweight) ──┐         /pr-review ──┐
Scheduled agent (deep) ───┤         /fix-pr ─────┤
/code-refinement ─────────┘                      │
        │                                        │
        v                                        v
  insight_analyzer.py              post_review_insights.py
  (loads lenses,                   (parses review markdown,
   runs analysis)                   already-curated findings)
        │                                        │
        └────────────┬───────────────────────────┘
                     v
              InsightRegistry
              (content-hash dedup, 30-day expiry)
                     │
                     v
            post_insights_to_discussions.py
            (posts to "Insights" category)

Two paths converge at the registry. The lens-driven path (hooks and scheduled agents) runs analysis to produce findings from raw metrics. The direct path (review commands) skips analysis because the review markdown already contains curated findings; post_review_insights.py just parses blockers and non-blocking notes and forwards them to the registry.

Lenses

Four built-in lightweight lenses run on every Stop hook:

LensWhat it detects
TrendLensDegradation or improvement over time
PatternLensShared failure modes across skills
HealthLensUnused skills, orphaned hooks, config drift
DeltaLensChanges since the last posted snapshot

LLM-augmented lenses (BugLens, OptimizationLens, ImprovementLens) run in the scheduled agent only.

Custom lenses drop into scripts/lenses/ and auto-discover via the LENS_META + analyze() convention.

Deduplication

Findings pass through four layers before posting:

  1. Content hash: deterministic SHA-256 from type, skill, and summary prevents re-posting identical findings.
  2. Snapshot diff: DeltaLens compares current metrics to the last snapshot and only surfaces changes.
  3. Staleness expiry: hashes expire after 30 days so persistent problems resurface with fresh data.
  4. Semantic dedup: Jaccard similarity against existing Discussions links related findings or skips near-duplicates.

Insight Types

TypePrefixSource
Trend[Trend]Script
Pattern[Pattern]Script
Bug Alert[Bug Alert]Agent
Optimization[Optimization]Agent
Improvement[Improvement]Agent
PR Finding[PR Finding]PR review
Health Check[Health Check]Script

Learning Post Enrichment

Phase 6a [Learning] posts (a separate path from the Insight pipeline above) are enriched by discussion_enrichment.py, which runs the same analysis lenses against LEARNINGS.md to embed recommendations into the discussion body and clusters error logs into named failure modes. This surfaces actionable patterns inline rather than leaving readers to interpret raw metrics.

See ADR 0007 for the GitHub Discussions integration design and the palace bridge for cross-plugin knowledge flow.

Self-Adapting System

A closed-loop system that monitors skill health and auto-triggers improvements:

  1. homeostatic_monitor.py checks stability gap after each Skill invocation
  2. Skills with gap > 0.3 are queued in improvement_queue.py
  3. After 3+ flags, the skill-improver agent runs automatically
  4. skill_versioning.py tracks changes via YAML frontmatter
  5. rollback_reviewer.py creates GitHub issues if regressions are detected
  6. experience_library.py stores successful trajectories for future context

Cross-plugin dependency: reads stability metrics from memory-palace’s .history.json.

Usage Examples

Create a New Skill

/create-skill

# Claude will:
# 1. Use brainstorming for idea refinement
# 2. Apply TDD methodology
# 3. Generate skill scaffold
# 4. Create tests

Evaluate Skill Quality

Skill(abstract:skills-eval)

# Scores skills on:
# - Token efficiency
# - Documentation quality
# - Trigger clarity
# - Modular structure

Validate Plugin Structure

/validate-plugin /path/to/my-plugin

# Checks:
# - plugin.json structure
# - Required files present
# - Skill format compliance
# - Command syntax

Best Practices

Skill Design

  1. Single Responsibility: Each skill does one thing well
  2. Clear Triggers: Include “Use when…” in descriptions
  3. Token Efficiency: Keep skills under 2000 tokens
  4. TodoWrite Integration: Output actionable items

Hook Security

  1. No Secrets: Never log sensitive data
  2. Fail Safe: Default to allowing operations
  3. Minimal Scope: Request only needed permissions
  4. Audit Trail: Log decisions for review
  5. Agent-Aware (2.1.2+): SessionStart hooks receive agent_type to customize context

Superpowers Integration

When superpowers is installed:

CommandEnhancement
/create-skillUses brainstorming for idea refinement
/create-commandUses brainstorming for concept development
/create-hookUses brainstorming for security design
/test-skillUses test-driven-development for TDD cycles
  • leyline: Infrastructure patterns abstract builds on
  • imbue: Review patterns for skill evaluation