skill-distill 1.0.0
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/CHANGELOG.md +22 -0
- package/LICENSE +21 -0
- package/README.md +186 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1940 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +631 -0
- package/dist/index.js +2020 -0
- package/dist/index.js.map +1 -0
- package/package.json +77 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2024-01-20
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial release
|
|
12
|
+
- CLI commands: `distill`, `list`, `init`
|
|
13
|
+
- Multi-platform support: Claude Code, Codex CLI, Cursor
|
|
14
|
+
- Session loaders for reading conversation history
|
|
15
|
+
- LLM-powered distillation using Claude API
|
|
16
|
+
- Skill template generation with YAML frontmatter
|
|
17
|
+
- User prompt handling with Chinese/English support
|
|
18
|
+
- Platform-specific formatters and installers
|
|
19
|
+
- Interactive mode for session selection
|
|
20
|
+
- Configuration management via `~/.skill-distill/config.json`
|
|
21
|
+
- Comprehensive test suite with 49 tests
|
|
22
|
+
- GitHub CI workflow for automated testing and publishing
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Skill Distill Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Skill Distill 🪄
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://badge.fury.io/js/skill-distill)
|
|
5
|
+
|
|
6
|
+
**Skill Distill** is a powerful CLI tool that transforms your AI agent conversation histories into reusable, high-quality "Skills". By analyzing successful interactions, it extracts the essence of complex tasks and generates structured documentation and configurations that can be instantly re-used by Claude Code, Codex CLI, and Cursor.
|
|
7
|
+
|
|
8
|
+
## Why Skill Distill?
|
|
9
|
+
|
|
10
|
+
AI agents are excellent at solving complex problems, but the solutions often remain trapped within single chat sessions. When you encounter a similar problem later, you frequently have to start from scratch.
|
|
11
|
+
|
|
12
|
+
Skill Distill closes this loop by:
|
|
13
|
+
- **Preserving Expertise**: Captures the "how-to" from successful agent runs.
|
|
14
|
+
- **Ensuring Consistency**: Standardizes multi-step processes across your projects.
|
|
15
|
+
- **Multi-Platform Portability**: Converts skills between different AI agent formats effortlessly.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- 🔄 **Multi-Platform Support**: Seamlessly work with Claude Code, Codex CLI, and Cursor.
|
|
22
|
+
- 🧠 **Smart Extraction**: Uses Claude API to analyze sessions and extract parameters, steps, and requirements.
|
|
23
|
+
- 🛠️ **Automated Installation**: Directly install generated skills into your local agent's project directory.
|
|
24
|
+
- 💬 **Interactive Mode**: Easily select sessions and provide additional context for the distillation process.
|
|
25
|
+
- 📂 **Multiple Formats**: Export skills to `claude`, `codex`, or `cursor` formats.
|
|
26
|
+
- 🛡️ **Validation**: Built-in validation ensures generated skills meet platform requirements.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
Install Skill Distill globally via npm:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install -g skill-distill
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
*Note: Requires Node.js >= 18.0.0*
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
1. **Initialize your configuration**:
|
|
45
|
+
```bash
|
|
46
|
+
skill-distill init
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
2. **List your recent agent sessions**:
|
|
50
|
+
```bash
|
|
51
|
+
skill-distill list
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
3. **Distill your latest session**:
|
|
55
|
+
```bash
|
|
56
|
+
skill-distill distill --last --install
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## CLI Commands Reference
|
|
62
|
+
|
|
63
|
+
### `skill-distill distill [session]`
|
|
64
|
+
|
|
65
|
+
The main command to extract a Skill from a session history.
|
|
66
|
+
|
|
67
|
+
| Option | Shorthand | Description |
|
|
68
|
+
| :--- | :--- | :--- |
|
|
69
|
+
| `[session]` | - | Optional session ID to distill |
|
|
70
|
+
| `--last` | `-l` | Use the most recent session from the default platform |
|
|
71
|
+
| `--session <id>` | `-s` | Specify a specific session ID |
|
|
72
|
+
| `--prompt <text>` | `-p` | Add custom user instructions (can be used multiple times) |
|
|
73
|
+
| `--format <type>`| `-f` | Output format: `claude`, `codex`, `cursor`, or `all` (Default: `claude`) |
|
|
74
|
+
| `--output <dir>` | `-o` | Target directory for generated files (Default: `~/.skills`) |
|
|
75
|
+
| `--install` | - | Automatically install the skill to the local agent's path |
|
|
76
|
+
| `--interactive` | `-i` | Enable interactive session selection and prompt collection |
|
|
77
|
+
| `--verbose` | `-v` | Show detailed processing logs |
|
|
78
|
+
|
|
79
|
+
### `skill-distill list`
|
|
80
|
+
|
|
81
|
+
List available sessions from your AI agent history.
|
|
82
|
+
|
|
83
|
+
| Option | Shorthand | Description |
|
|
84
|
+
| :--- | :--- | :--- |
|
|
85
|
+
| `--limit <n>` | `-n` | Number of sessions to display (Default: 20) |
|
|
86
|
+
| `--platform <t>`| - | Filter sessions by platform: `claude`, `codex`, `cursor` |
|
|
87
|
+
|
|
88
|
+
### `skill-distill init`
|
|
89
|
+
|
|
90
|
+
Interactive setup to configure your environment, including:
|
|
91
|
+
- Default AI Agent platform
|
|
92
|
+
- Claude API Key (for LLM-powered distillation)
|
|
93
|
+
- Default output directory
|
|
94
|
+
- Auto-installation preferences
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Configuration
|
|
99
|
+
|
|
100
|
+
Skill Distill stores its configuration in `~/.skill-distill/config.json`.
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"defaultPlatform": "claude",
|
|
105
|
+
"apiKey": "sk-ant-...",
|
|
106
|
+
"outputDir": "/Users/user/.skills",
|
|
107
|
+
"autoInstall": true,
|
|
108
|
+
"sessionSources": {
|
|
109
|
+
"claude": "/Users/user/.claude/projects"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
- **apiKey**: Your Anthropic API key. This is required for the distillation process to analyze message history.
|
|
115
|
+
- **defaultPlatform**: The agent platform you use most frequently.
|
|
116
|
+
- **outputDir**: Where generated markdown and configuration files are saved.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Examples
|
|
121
|
+
|
|
122
|
+
### Distill with extra context
|
|
123
|
+
If you want the distilled skill to focus specifically on certain aspects (e.g., error handling), you can provide extra prompts:
|
|
124
|
+
```bash
|
|
125
|
+
skill-distill distill --last -p "Ensure we include detailed error handling for API failures"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Batch format export
|
|
129
|
+
Export a session as a skill compatible with all supported platforms:
|
|
130
|
+
```bash
|
|
131
|
+
skill-distill distill <session-id> --format all --output ./my-team-skills
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Interactive selection
|
|
135
|
+
Don't remember the session ID? Use interactive mode:
|
|
136
|
+
```bash
|
|
137
|
+
skill-distill distill --interactive
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Output Formats
|
|
143
|
+
|
|
144
|
+
| Format | Extension | Target |
|
|
145
|
+
| :--- | :--- | :--- |
|
|
146
|
+
| **Claude** | `.md` | Claude Code Skills (Custom Instructions) |
|
|
147
|
+
| **Codex** | `.yaml` | Codex CLI Commands/Workflows |
|
|
148
|
+
| **Cursor** | `.cursorrules`| Cursor project-specific rules |
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Development
|
|
153
|
+
|
|
154
|
+
We use `pnpm` for package management and `tsup` for building.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Install dependencies
|
|
158
|
+
pnpm install
|
|
159
|
+
|
|
160
|
+
# Build the project
|
|
161
|
+
pnpm build
|
|
162
|
+
|
|
163
|
+
# Run in development mode
|
|
164
|
+
pnpm dev
|
|
165
|
+
|
|
166
|
+
# Run tests
|
|
167
|
+
pnpm test
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Contributing
|
|
173
|
+
|
|
174
|
+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
|
|
175
|
+
|
|
176
|
+
1. Fork the Project
|
|
177
|
+
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
|
|
178
|
+
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
|
|
179
|
+
4. Push to the Branch (`git push origin feature/AmazingFeature`)
|
|
180
|
+
5. Open a Pull Request
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## License
|
|
185
|
+
|
|
186
|
+
Distributed under the MIT License. See `LICENSE` for more information.
|
package/dist/cli.d.ts
ADDED