npm package: @fr0mpy/prompt-system
Description: Claude Code prompt engineering system: agents, skills, hooks, and smart context management
Author: fr0mpy
Latest version: 3.0.0

# @fr0mpy/prompt-system

Claude Code prompt engineering system with agents, skills, hooks, and intelligent context management.

## Installation

```bash
npx @fr0mpy/prompt-system
```

## What's Included

| Directory | Purpose |
|-----------|---------|
| `CLAUDE.md` | Behavioral rules loaded once at session start |
| `hooks/` | Lightweight context reminder (~75 tokens per prompt) |
| `skills/` | Prompt analyzer + format guides (rule, agent, command) |
| `agents/` | 26 task workers for specialized operations |
| `commands/` | Slash commands (`/review`, `/test`, `/commit`) |
| `settings.json` | Hook configuration, bash permissions, sandbox |

## Architecture

### Two-Layer Context Management

The system minimizes context window consumption through two complementary layers:

1. **CLAUDE.md** — Condensed behavioral rules (code standards, action announcements, constructive pushback). Loaded once at session start by Claude Code's native system.
2. **Hook reminder** — A ~75-token compressed reminder injected on every prompt via `UserPromptSubmit`, reinforcing key rules and triggering the prompt analyzer.

### Prompt Analyzer

A native Claude Code **forked skill** (`context: fork`) that dynamically selects relevant agents and skills per request:

- Reads agent/skill descriptions from YAML frontmatter
- Compares against the user's current prompt
- Returns only relevant matches (~50-100 tokens)
- Runs in isolated context — only the short result enters main conversation

This provides intelligent, context-aware routing without consuming main context window tokens for reasoning.

### Agents (26 included)

Organized by function:

| Category | Agents |
|----------|--------|
| **Core** | pre-code-check, package-checker, context-loader, structure-validator |
| **Planning** | intent-clarifier, assumption-challenger, breaking-change-predictor |
| **Code Quality** | legacy-archaeologist, dependency-detective, test-gap-finder, refactor-scope-limiter |
| **Workflow** | pr-narrator, migration-planner, incident-replayer |
| **Session** | context-curator, decision-logger, session-handoff, scope-creep-detector |
| **Domain** | api-contract-guardian, accessibility-auditor, performance-profiler, error-boundary-designer |
| **Thinking** | rubber-duck, devils-advocate, 10x-simplifier, future-you |

### Skills (4 included)

| Skill | Type | Purpose |
|-------|------|---------|
| `prompt-analyzer` | Auto (forked) | Dynamic agent/skill selection per prompt |
| `rule-format` | On-demand | Template for creating behavioral rules |
| `agent-format` | On-demand | Template for creating custom agents |
| `command-format` | On-demand | Template for creating slash commands |

## Usage

```bash
# Initialize
npx @fr0mpy/prompt-system

# Overwrite existing
npx @fr0mpy/prompt-system --force

# Remove installation
npx @fr0mpy/prompt-system --remove

# Selective updates (preserves settings.json and CLAUDE.md)
npx @fr0mpy/prompt-system --update-hooks
npx @fr0mpy/prompt-system --update-agents
npx @fr0mpy/prompt-system --update-skills
npx @fr0mpy/prompt-system --update-commands
```

## Coexistence

Designed to work alongside `@fr0mpy/component-system`. Both packages share the `.claude/` directory without conflicts — each manages only its own files during install, update, and removal.

```bash
npx @fr0mpy/component-system
```

## License

MIT