@mariozechner/pi-coding-agent 0.23.2 → 0.23.3

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/docs/skills.md CHANGED
@@ -1,72 +1,190 @@
1
1
  # Skills
2
2
 
3
- Skills are instruction files that the agent loads on-demand for specific tasks.
3
+ Skills are self-contained capability packages that the agent loads on-demand. A skill provides specialized workflows, setup instructions, helper scripts, and reference documentation for specific tasks.
4
4
 
5
- ## Skill Locations
5
+ **Example use cases:**
6
+ - Web search and content extraction (Brave Search API)
7
+ - Browser automation via Chrome DevTools Protocol
8
+ - Google Calendar, Gmail, Drive integration
9
+ - PDF/DOCX processing and creation
10
+ - Speech-to-text transcription
11
+ - YouTube transcript extraction
12
+
13
+ See [Skill Repositories](#skill-repositories) for ready-to-use skills.
14
+
15
+ ## When to Use Skills
16
+
17
+ | Need | Solution |
18
+ |------|----------|
19
+ | Always-needed context (conventions, commands) | AGENTS.md |
20
+ | User triggers a specific prompt template | Slash command |
21
+ | Additional tool directly callable by the LLM (like read/write/edit/bash) | Custom tool |
22
+ | On-demand capability package (workflows, scripts, setup) | Skill |
6
23
 
7
- Skills are discovered from these locations (in order of priority, later wins on name collision):
24
+ Skills are loaded when:
25
+ - The agent decides the task matches a skill's description
26
+ - The user explicitly asks to use a skill (e.g., "use the pdf skill to extract tables")
8
27
 
9
- 1. `~/.codex/skills/**/SKILL.md` (Codex CLI user skills, recursive)
10
- 2. `~/.claude/skills/*/SKILL.md` (Claude Code user skills)
11
- 3. `<cwd>/.claude/skills/*/SKILL.md` (Claude Code project skills)
12
- 4. `~/.pi/agent/skills/**/SKILL.md` (Pi user skills, recursive)
13
- 5. `<cwd>/.pi/skills/**/SKILL.md` (Pi project skills, recursive)
28
+ **Good skill examples:**
29
+ - Browser automation with helper scripts and CDP workflow
30
+ - Google Calendar CLI with setup instructions and usage patterns
31
+ - PDF processing with multiple tools and extraction patterns
32
+ - Speech-to-text transcription with API setup
14
33
 
15
- Skill names and descriptions are listed in the system prompt. When a task matches a skill's description, the agent uses the `read` tool to load it.
34
+ **Not a good fit for skills:**
35
+ - "Always use TypeScript strict mode" → put in AGENTS.md
36
+ - "Review my code" → make a slash command
37
+ - Need user confirmation dialogs or custom TUI rendering → make a custom tool
16
38
 
17
- ## Creating Skills
39
+ ## Skill Structure
18
40
 
19
- A skill is a markdown file with YAML frontmatter containing a `description` field:
41
+ A skill is a directory with a `SKILL.md` file. Everything else is freeform. Example structure:
42
+
43
+ ```
44
+ my-skill/
45
+ ├── SKILL.md # Required: frontmatter + instructions
46
+ ├── scripts/ # Helper scripts (bash, python, node)
47
+ │ └── process.sh
48
+ ├── references/ # Detailed docs loaded on-demand
49
+ │ └── api-reference.md
50
+ └── assets/ # Templates, images, etc.
51
+ └── template.json
52
+ ```
53
+
54
+ ### SKILL.md Format
20
55
 
21
56
  ```markdown
22
57
  ---
23
- description: Extract text and tables from PDF files
58
+ name: my-skill
59
+ description: What this skill does and when to use it. Be specific.
24
60
  ---
25
61
 
26
- # PDF Processing Instructions
62
+ # My Skill
63
+
64
+ ## Setup
65
+
66
+ Run once before first use:
67
+ \`\`\`bash
68
+ cd {baseDir}
69
+ npm install
70
+ \`\`\`
27
71
 
28
- 1. Use `pdftotext` to extract plain text
29
- 2. For tables, use `tabula-py` or similar
30
- 3. Always verify extraction quality
72
+ ## Usage
31
73
 
32
- Scripts are in: {baseDir}/scripts/
74
+ \`\`\`bash
75
+ {baseDir}/scripts/process.sh <input>
76
+ \`\`\`
77
+
78
+ ## Workflow
79
+
80
+ 1. First step
81
+ 2. Second step
82
+ 3. Third step
33
83
  ```
34
84
 
35
85
  ### Frontmatter Fields
36
86
 
37
87
  | Field | Required | Description |
38
88
  |-------|----------|-------------|
39
- | `description` | Yes | Short description for skill selection |
40
- | `name` | No | Override skill name (defaults to filename or directory name) |
89
+ | `description` | Yes | What the skill does and when to use it |
90
+ | `name` | No | Override skill name (defaults to directory name) |
41
91
 
42
- The parser only supports single-line `key: value` syntax. Multiline YAML blocks are not supported.
92
+ The `description` is critical. It's shown in the system prompt and determines when the agent loads the skill. Be specific about both what it does and when to use it.
43
93
 
44
- ### Variables
94
+ ### The `{baseDir}` Placeholder
45
95
 
46
- Use `{baseDir}` as a placeholder for the skill's directory. The agent is told each skill's base directory and will substitute it when following the instructions.
96
+ Use `{baseDir}` to reference files in the skill's directory. The agent sees each skill's base directory and substitutes it when following instructions:
47
97
 
48
- ### Subdirectories
98
+ ```markdown
99
+ Helper scripts: {baseDir}/scripts/
100
+ Config template: {baseDir}/assets/config.json
101
+ ```
102
+
103
+ ## Skill Locations
104
+
105
+ Skills are discovered from these locations (later wins on name collision):
106
+
107
+ 1. `~/.codex/skills/**/SKILL.md` (Codex CLI, recursive)
108
+ 2. `~/.claude/skills/*/SKILL.md` (Claude Code user, one level)
109
+ 3. `<cwd>/.claude/skills/*/SKILL.md` (Claude Code project, one level)
110
+ 4. `~/.pi/agent/skills/**/SKILL.md` (Pi user, recursive)
111
+ 5. `<cwd>/.pi/skills/**/SKILL.md` (Pi project, recursive)
112
+
113
+ ### Subdirectory Naming
49
114
 
50
- Pi and Codex skills in subdirectories use colon-separated names:
115
+ Pi skills in subdirectories use colon-separated names:
51
116
  - `~/.pi/agent/skills/db/migrate/SKILL.md` → `db:migrate`
52
117
  - `<cwd>/.pi/skills/aws/s3/upload/SKILL.md` → `aws:s3:upload`
53
118
 
54
- ## Claude Code Compatibility
119
+ ## How Skills Work
120
+
121
+ 1. At startup, pi scans skill locations and extracts names + descriptions
122
+ 2. The system prompt includes a list of available skills with their descriptions
123
+ 3. When a task matches, the agent uses `read` to load the full SKILL.md
124
+ 4. The agent follows the instructions, using `{baseDir}` to reference scripts/assets
125
+
126
+ This is progressive disclosure: only descriptions are always in context, full instructions load on-demand.
127
+
128
+ ## Example: Web Search Skill
129
+
130
+ ```
131
+ brave-search/
132
+ ├── SKILL.md
133
+ ├── search.js
134
+ └── content.js
135
+ ```
136
+
137
+ **SKILL.md:**
138
+ ```markdown
139
+ ---
140
+ name: brave-search
141
+ description: Web search and content extraction via Brave Search API. Use for searching documentation, facts, or any web content.
142
+ ---
143
+
144
+ # Brave Search
145
+
146
+ ## Setup
147
+
148
+ \`\`\`bash
149
+ cd {baseDir}
150
+ npm install
151
+ \`\`\`
152
+
153
+ ## Search
154
+
155
+ \`\`\`bash
156
+ {baseDir}/search.js "query" # Basic search
157
+ {baseDir}/search.js "query" --content # Include page content
158
+ \`\`\`
159
+
160
+ ## Extract Page Content
161
+
162
+ \`\`\`bash
163
+ {baseDir}/content.js https://example.com
164
+ \`\`\`
165
+ ```
166
+
167
+ ## Compatibility
55
168
 
56
- Pi reads Claude Code skills from `~/.claude/skills/*/SKILL.md`. The `allowed-tools` and `model` frontmatter fields are ignored since Pi cannot enforce them.
169
+ **Claude Code**: Pi reads skills from `~/.claude/skills/*/SKILL.md`. The `allowed-tools` and `model` frontmatter fields are ignored.
57
170
 
58
- ## Codex CLI Compatibility
171
+ **Codex CLI**: Pi reads skills from `~/.codex/skills/` recursively. Hidden files/directories and symlinks are skipped.
59
172
 
60
- Pi reads Codex CLI skills from `~/.codex/skills/`. Unlike Claude Code skills (one level deep), Codex skills are scanned recursively, matching Codex CLI's behavior. Hidden files/directories (starting with `.`) and symlinks are skipped.
173
+ ## Skill Repositories
174
+
175
+ For inspiration and ready-to-use skills:
176
+
177
+ - [Anthropic Skills](https://github.com/anthropics/skills) - Official skills for document processing (docx, pdf, pptx, xlsx), web development, and more
178
+ - [Pi Skills](https://github.com/badlogic/pi-skills) - Skills for web search, browser automation, Google APIs, transcription
61
179
 
62
180
  ## Disabling Skills
63
181
 
64
- CLI flag:
182
+ CLI:
65
183
  ```bash
66
184
  pi --no-skills
67
185
  ```
68
186
 
69
- Or in `~/.pi/agent/settings.json`:
187
+ Settings (`~/.pi/agent/settings.json`):
70
188
  ```json
71
189
  {
72
190
  "skills": {
@@ -74,25 +192,3 @@ Or in `~/.pi/agent/settings.json`:
74
192
  }
75
193
  }
76
194
  ```
77
-
78
- ## Example
79
-
80
- ```markdown
81
- ---
82
- description: Perform code review with security and performance analysis
83
- ---
84
-
85
- # Code Review
86
-
87
- Analyze:
88
-
89
- ## Security
90
- - Input validation
91
- - SQL injection
92
- - XSS vulnerabilities
93
-
94
- ## Performance
95
- - Algorithm complexity
96
- - Memory usage
97
- - Query efficiency
98
- ```
package/docs/theme.md CHANGED
@@ -74,7 +74,7 @@ Future-proofing for syntax highlighting support:
74
74
  | `syntaxOperator` | Operators (`+`, `-`, etc) |
75
75
  | `syntaxPunctuation` | Punctuation (`;`, `,`, etc) |
76
76
 
77
- ### Thinking Level Borders (5 colors)
77
+ ### Thinking Level Borders (6 colors)
78
78
 
79
79
  Editor border colors that indicate the current thinking/reasoning level:
80
80
 
@@ -84,11 +84,18 @@ Editor border colors that indicate the current thinking/reasoning level:
84
84
  | `thinkingMinimal` | Border for minimal thinking |
85
85
  | `thinkingLow` | Border for low thinking |
86
86
  | `thinkingMedium` | Border for medium thinking |
87
- | `thinkingHigh` | Border for high thinking (most prominent) |
87
+ | `thinkingHigh` | Border for high thinking |
88
+ | `thinkingXhigh` | Border for xhigh thinking (most prominent, OpenAI codex-max only) |
88
89
 
89
- These create a visual hierarchy: off → minimal → low → medium → high
90
+ These create a visual hierarchy: off → minimal → low → medium → high → xhigh
90
91
 
91
- **Total: 44 color tokens** (all required)
92
+ ### Bash Mode (1 color)
93
+
94
+ | Token | Purpose |
95
+ |-------|---------|
96
+ | `bashMode` | Editor border color when in bash mode (! prefix) |
97
+
98
+ **Total: 46 color tokens** (all required)
92
99
 
93
100
  ## Theme Format
94
101
 
@@ -420,8 +427,8 @@ class Theme {
420
427
 
421
428
  // Text attributes (preserve current colors)
422
429
  bold(text: string): string
423
- dim(text: string): string
424
430
  italic(text: string): string
431
+ underline(text: string): string
425
432
  }
426
433
  ```
427
434
 
@@ -453,6 +460,7 @@ TUI components (like `Markdown`, `SelectList`, `Editor`) are in the `@mariozechn
453
460
  export interface MarkdownTheme {
454
461
  heading: (text: string) => string;
455
462
  link: (text: string) => string;
463
+ linkUrl: (text: string) => string;
456
464
  code: (text: string) => string;
457
465
  codeBlock: (text: string) => string;
458
466
  codeBlockBorder: (text: string) => string;
@@ -460,21 +468,10 @@ export interface MarkdownTheme {
460
468
  quoteBorder: (text: string) => string;
461
469
  hr: (text: string) => string;
462
470
  listBullet: (text: string) => string;
463
- }
464
-
465
- export class Markdown {
466
- constructor(
467
- text: string,
468
- paddingX: number,
469
- paddingY: number,
470
- defaultTextStyle?: DefaultTextStyle,
471
- theme?: MarkdownTheme // Optional theme functions
472
- )
473
-
474
- // Usage in component
475
- renderHeading(text: string) {
476
- return this.theme.heading(text); // Applies color
477
- }
471
+ bold: (text: string) => string;
472
+ italic: (text: string) => string;
473
+ strikethrough: (text: string) => string;
474
+ underline: (text: string) => string;
478
475
  }
479
476
  ```
480
477
 
@@ -490,6 +487,7 @@ function getMarkdownTheme(): MarkdownTheme {
490
487
  return {
491
488
  heading: (text) => theme.fg('mdHeading', text),
492
489
  link: (text) => theme.fg('mdLink', text),
490
+ linkUrl: (text) => theme.fg('mdLinkUrl', text),
493
491
  code: (text) => theme.fg('mdCode', text),
494
492
  codeBlock: (text) => theme.fg('mdCodeBlock', text),
495
493
  codeBlockBorder: (text) => theme.fg('mdCodeBlockBorder', text),
@@ -497,6 +495,10 @@ function getMarkdownTheme(): MarkdownTheme {
497
495
  quoteBorder: (text) => theme.fg('mdQuoteBorder', text),
498
496
  hr: (text) => theme.fg('mdHr', text),
499
497
  listBullet: (text) => theme.fg('mdListBullet', text),
498
+ bold: (text) => theme.bold(text),
499
+ italic: (text) => theme.italic(text),
500
+ underline: (text) => theme.underline(text),
501
+ strikethrough: (text) => chalk.strikethrough(text),
500
502
  };
501
503
  }
502
504
 
@@ -530,7 +532,7 @@ theme.bg('toolSuccessBg', output)
530
532
 
531
533
  // Combine styles
532
534
  theme.bold(theme.fg('accent', 'Title'))
533
- theme.dim(theme.fg('muted', 'metadata'))
535
+ theme.italic(theme.fg('muted', 'metadata'))
534
536
 
535
537
  // Nested foreground + background
536
538
  const userMsg = theme.bg('userMessageBg',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mariozechner/pi-coding-agent",
3
- "version": "0.23.2",
3
+ "version": "0.23.3",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "piConfig": {
@@ -40,9 +40,9 @@
40
40
  "prepublishOnly": "npm run clean && npm run build"
41
41
  },
42
42
  "dependencies": {
43
- "@mariozechner/pi-agent-core": "^0.23.2",
44
- "@mariozechner/pi-ai": "^0.23.2",
45
- "@mariozechner/pi-tui": "^0.23.2",
43
+ "@mariozechner/pi-agent-core": "^0.23.3",
44
+ "@mariozechner/pi-ai": "^0.23.3",
45
+ "@mariozechner/pi-tui": "^0.23.3",
46
46
  "chalk": "^5.5.0",
47
47
  "diff": "^8.0.2",
48
48
  "file-type": "^21.1.1",