agent-primer 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +192 -0
- package/dist/apx.js +23257 -0
- package/dist/index.js +23151 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# agent-primer
|
|
2
|
+
|
|
3
|
+
Prime your agent sessions with preloaded skills and domain knowledge.
|
|
4
|
+
|
|
5
|
+
Agent Primer cuts through the noise of available skills by letting you
|
|
6
|
+
assert what matters for each session. Selected primitives are injected
|
|
7
|
+
into the system prompt so the agent has the right context from the first
|
|
8
|
+
message.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# With bun (recommended)
|
|
14
|
+
bun install -g agent-primer
|
|
15
|
+
|
|
16
|
+
# With npm
|
|
17
|
+
npm install -g agent-primer
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
> Requires [Bun](https://bun.sh) runtime and [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code)
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Launch the interactive wizard
|
|
26
|
+
ap
|
|
27
|
+
|
|
28
|
+
# List all available primitives
|
|
29
|
+
ap --list
|
|
30
|
+
|
|
31
|
+
# Dangerous mode (skips permission prompts)
|
|
32
|
+
apx
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
ap # Standard mode
|
|
39
|
+
apx # Dangerous mode (skips permission prompts)
|
|
40
|
+
agent-primer # Full command name
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### What happens when you run `ap`
|
|
44
|
+
|
|
45
|
+
1. Scans global and local directories for skills and domains
|
|
46
|
+
2. Shows per-type pickers (skills first, then domains)
|
|
47
|
+
3. Recently used items are marked and sorted to the top
|
|
48
|
+
4. Asks for confirmation before launching
|
|
49
|
+
5. Launches Claude with selected primitives injected via `--append-system-prompt`
|
|
50
|
+
|
|
51
|
+
## Primitives
|
|
52
|
+
|
|
53
|
+
Agent Primer uses the concept of "primitives" -- units of knowledge that
|
|
54
|
+
can be preloaded into an agent session. Each primitive type serves a
|
|
55
|
+
different purpose.
|
|
56
|
+
|
|
57
|
+
### Skills
|
|
58
|
+
|
|
59
|
+
Behavioral patterns and best practices. Skills tell the agent *how* to
|
|
60
|
+
work: coding standards, review processes, tool-specific patterns.
|
|
61
|
+
|
|
62
|
+
```tree
|
|
63
|
+
~/.claude/skills/
|
|
64
|
+
└── my-skill/
|
|
65
|
+
├── SKILL.md # Required: main skill file
|
|
66
|
+
└── references/ # Optional: additional context
|
|
67
|
+
├── patterns.md
|
|
68
|
+
└── examples.md
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
SKILL.md uses YAML frontmatter:
|
|
72
|
+
|
|
73
|
+
````markdown
|
|
74
|
+
---
|
|
75
|
+
name: my-skill
|
|
76
|
+
description: Brief description shown in the selector
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
# My Skill
|
|
80
|
+
|
|
81
|
+
Instructions, patterns, and best practices for the agent to follow.
|
|
82
|
+
````
|
|
83
|
+
|
|
84
|
+
### Domains
|
|
85
|
+
|
|
86
|
+
Reference knowledge about a subject area. Domains tell the agent *what*
|
|
87
|
+
it is working with: business context, specifications, terminology,
|
|
88
|
+
architecture docs.
|
|
89
|
+
|
|
90
|
+
```tree
|
|
91
|
+
~/.claude/domains/
|
|
92
|
+
└── my-domain/
|
|
93
|
+
├── DOMAIN.md # Required: main domain file
|
|
94
|
+
└── references/ # Optional: deeper reference material
|
|
95
|
+
├── glossary.md
|
|
96
|
+
└── api-spec.md
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
DOMAIN.md uses YAML frontmatter:
|
|
100
|
+
|
|
101
|
+
````markdown
|
|
102
|
+
---
|
|
103
|
+
name: my-domain
|
|
104
|
+
description: Brief description shown in the selector
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
# My Domain
|
|
108
|
+
|
|
109
|
+
Core concepts, terminology, and reference material.
|
|
110
|
+
````
|
|
111
|
+
|
|
112
|
+
## Primitive Locations
|
|
113
|
+
|
|
114
|
+
| Location | Scope | Primitive Types |
|
|
115
|
+
| -------------------- | ------ | --------------------------------- |
|
|
116
|
+
| `~/.claude/skills/` | Global | Skills available in all projects |
|
|
117
|
+
| `./.claude/skills/` | Local | Project-specific skills |
|
|
118
|
+
| `~/.claude/domains/` | Global | Domains available in all projects |
|
|
119
|
+
| `./.claude/domains/` | Local | Project-specific domains |
|
|
120
|
+
|
|
121
|
+
Items are labeled `[global]` or `[local]` in the picker.
|
|
122
|
+
|
|
123
|
+
## Commands
|
|
124
|
+
|
|
125
|
+
| Command | Description |
|
|
126
|
+
| -------------- | ------------------------------------------------------------- |
|
|
127
|
+
| `ap` | Standard mode - prompts for permissions |
|
|
128
|
+
| `apx` | Dangerous mode - auto-passes `--dangerously-skip-permissions` |
|
|
129
|
+
| `agent-primer` | Full command (same as `ap`) |
|
|
130
|
+
|
|
131
|
+
## Options
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
-h, --help Show help message
|
|
135
|
+
-l, --list List available primitives and exit
|
|
136
|
+
--clear-recent Clear the recent selections cache
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Passing Options to Claude
|
|
140
|
+
|
|
141
|
+
Use `--` to separate agent-primer options from Claude options:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
ap -- --model opus # Use Opus model
|
|
145
|
+
ap -- --model sonnet # Use Sonnet model
|
|
146
|
+
ap -- -p "prompt" # Non-interactive prompt mode
|
|
147
|
+
ap -- -c # Continue previous conversation
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Examples
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Interactive wizard
|
|
154
|
+
ap
|
|
155
|
+
|
|
156
|
+
# List everything available
|
|
157
|
+
ap --list
|
|
158
|
+
|
|
159
|
+
# Dangerous mode with Opus
|
|
160
|
+
apx -- --model opus
|
|
161
|
+
|
|
162
|
+
# Non-interactive with preloaded primitives
|
|
163
|
+
ap -- -p "refactor this function"
|
|
164
|
+
|
|
165
|
+
# Clear the recent selections cache
|
|
166
|
+
ap --clear-recent
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## How It Works
|
|
170
|
+
|
|
171
|
+
1. Scans both global and local directories for each primitive type
|
|
172
|
+
2. Presents a separate multi-select picker per type with badge headers
|
|
173
|
+
3. Shows a confirmation step (Yes / No, start over / Exit)
|
|
174
|
+
4. Loads full content from selected SKILL.md and DOMAIN.md files
|
|
175
|
+
5. Formats each primitive type with distinct framing so the agent
|
|
176
|
+
understands the difference between skills (behavioral) and domains
|
|
177
|
+
(reference)
|
|
178
|
+
6. Concatenates and passes everything to Claude via `--append-system-prompt`
|
|
179
|
+
|
|
180
|
+
## Cache
|
|
181
|
+
|
|
182
|
+
Recent selections are cached at `~/.cache/agent-primer/recent.json` to
|
|
183
|
+
surface frequently used items first in the picker.
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Clear the cache
|
|
187
|
+
ap --clear-recent
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## License
|
|
191
|
+
|
|
192
|
+
MIT
|