site2skill 0.2.0b2__py3-none-win_amd64.whl
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.
- site2skill/__init__.py +43 -0
- site2skill/__main__.py +6 -0
- site2skill/bin/site2skill.exe +0 -0
- site2skill-0.2.0b2.dist-info/METADATA +126 -0
- site2skill-0.2.0b2.dist-info/RECORD +8 -0
- site2skill-0.2.0b2.dist-info/WHEEL +4 -0
- site2skill-0.2.0b2.dist-info/entry_points.txt +2 -0
- site2skill-0.2.0b2.dist-info/licenses/LICENSE +21 -0
site2skill/__init__.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""site2skill - Turn any documentation website into a Claude Agent Skill."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import stat
|
|
5
|
+
import subprocess
|
|
6
|
+
import sys
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def get_binary_path() -> Path:
|
|
11
|
+
"""Return the path to the bundled binary."""
|
|
12
|
+
package_dir = Path(__file__).parent
|
|
13
|
+
binary_name = "site2skill.exe" if sys.platform == "win32" else "site2skill"
|
|
14
|
+
binary = package_dir / "bin" / binary_name
|
|
15
|
+
|
|
16
|
+
# Ensure binary is executable on Unix
|
|
17
|
+
if sys.platform != "win32" and binary.exists():
|
|
18
|
+
current_mode = os.stat(binary).st_mode
|
|
19
|
+
if not (current_mode & stat.S_IXUSR):
|
|
20
|
+
os.chmod(binary, current_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
|
|
21
|
+
|
|
22
|
+
return binary
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def main():
|
|
26
|
+
"""Execute the bundled binary."""
|
|
27
|
+
binary = get_binary_path()
|
|
28
|
+
|
|
29
|
+
if not binary.exists():
|
|
30
|
+
print(f"Error: Binary not found at {binary}", file=sys.stderr)
|
|
31
|
+
sys.exit(1)
|
|
32
|
+
|
|
33
|
+
if sys.platform == "win32":
|
|
34
|
+
# On Windows, use subprocess to properly handle signals
|
|
35
|
+
result = subprocess.run([str(binary)] + sys.argv[1:])
|
|
36
|
+
sys.exit(result.returncode)
|
|
37
|
+
else:
|
|
38
|
+
# On Unix, exec replaces the process
|
|
39
|
+
os.execvp(str(binary), [str(binary)] + sys.argv[1:])
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
if __name__ == "__main__":
|
|
43
|
+
main()
|
site2skill/__main__.py
ADDED
|
Binary file
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: site2skill
|
|
3
|
+
Version: 0.2.0b2
|
|
4
|
+
Summary: Turn any documentation website into a Claude Agent Skill
|
|
5
|
+
Author-email: laiso <laiso@users.noreply.github.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: agent,claude,cli,documentation,rust,skill
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Rust
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# site2skill
|
|
20
|
+
|
|
21
|
+
**Turn any documentation website into a Claude Agent Skill.**
|
|
22
|
+
|
|
23
|
+
`site2skill` is a tool that scrapes a documentation website, converts it to Markdown, and packages it as a Claude [Agent Skill](https://www.anthropic.com/news/skills) (ZIP format) with a proper `SKILL.md` entry point.
|
|
24
|
+
|
|
25
|
+
Agent Skills are dynamically loaded knowledge modules that Claude uses on demand. They work across Claude Code, Claude apps, and the API.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
**Requirements:**
|
|
30
|
+
* **Python 3.10+**
|
|
31
|
+
* **wget**: Must be installed and available in your PATH.
|
|
32
|
+
* macOS: `brew install wget`
|
|
33
|
+
* Linux: `apt install wget`
|
|
34
|
+
* Windows: Use WSL, or install via `choco install wget` / `scoop install wget`
|
|
35
|
+
|
|
36
|
+
### Install from PyPI
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Standard installation with pip
|
|
40
|
+
pip install site2skill
|
|
41
|
+
|
|
42
|
+
# Or with uv
|
|
43
|
+
uv tool install site2skill
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Run without Installation
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Run directly with uvx
|
|
50
|
+
uvx site2skill <URL> <SKILL_NAME>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Install from GitHub (Latest)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install git+https://github.com/laiso/site2skill.git
|
|
57
|
+
uvx --from git+https://github.com/laiso/site2skill site2skill <URL> <SKILL_NAME>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Basic usage
|
|
64
|
+
site2skill <URL> <SKILL_NAME>
|
|
65
|
+
|
|
66
|
+
# Example: Create a skill for PAY.JP
|
|
67
|
+
site2skill https://docs.pay.jp/v1/ payjp
|
|
68
|
+
|
|
69
|
+
# Example: Create a skill for uv documentation
|
|
70
|
+
site2skill https://docs.astral.sh/uv/ uv-docs
|
|
71
|
+
|
|
72
|
+
# Target specific agent (sets default output directory)
|
|
73
|
+
site2skill <URL> <SKILL_NAME> --target claude-desktop
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## CLI Options
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
site2skill <URL> <SKILL_NAME> [options]
|
|
80
|
+
|
|
81
|
+
Options:
|
|
82
|
+
--target Target agent (claude|claude-desktop|cursor|gemini|codex). Sets default output directory
|
|
83
|
+
--output, -o Base output directory for skill structure (overrides target default)
|
|
84
|
+
--skill-output Output directory for .skill file (default: .)
|
|
85
|
+
--temp-dir Temporary directory for processing (default: build)
|
|
86
|
+
--skip-fetch Skip the download step (use existing files in temp dir)
|
|
87
|
+
--clean Clean up temporary directory after completion
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## How it works
|
|
91
|
+
|
|
92
|
+
1. **Fetch**: Downloads the documentation site recursively using `wget`.
|
|
93
|
+
2. **Convert**: Converts HTML pages to Markdown using `beautifulsoup4` and `markdownify`.
|
|
94
|
+
3. **Normalize**: Cleans up links and formatting.
|
|
95
|
+
4. **Validate**: Checks the skill structure and size limits.
|
|
96
|
+
5. **Package**: Generates `SKILL.md` and zips everything into a `.skill` file.
|
|
97
|
+
|
|
98
|
+
## Output
|
|
99
|
+
|
|
100
|
+
The tool generates a skill directory in `.claude/skills/<skill_name>/` containing:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
<skill_name>/
|
|
104
|
+
├── SKILL.md # Entry point with usage instructions
|
|
105
|
+
├── references/ # Markdown documentation files (preferred)
|
|
106
|
+
└── scripts/
|
|
107
|
+
└── search_docs.py # Search tool for documentation
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Additionally, a `<skill_name>.skill` file (ZIP archive) is created in the current directory.
|
|
111
|
+
|
|
112
|
+
Legacy note: older skills may use `docs/` instead of `references/`. The search tool and validator
|
|
113
|
+
now support both, preferring `references/` when present.
|
|
114
|
+
|
|
115
|
+
### Search Tool
|
|
116
|
+
|
|
117
|
+
Each generated skill includes a search script:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
python scripts/search_docs.py "<query>"
|
|
121
|
+
python scripts/search_docs.py "<query>" --json --max-results 5
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
MIT
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
site2skill/__init__.py,sha256=neB2BGgKk7FQbIJlVP0prbHilf33u8Hhrv4-KYT8Qcw,1295
|
|
2
|
+
site2skill/__main__.py,sha256=u2WGnS0AawJNAvAniYKnk0tlXVsXW6fwRandNq-CsjI,128
|
|
3
|
+
site2skill/bin/site2skill.exe,sha256=_VzYFKY1plYu-kRoNsfDaV_GGMGhQY1sjE5hYOf90RY,6687232
|
|
4
|
+
site2skill-0.2.0b2.dist-info/METADATA,sha256=FF43uNh-Hpr19lUHQdJ59CKqsnr8bP3UTGCPySOXSmE,3852
|
|
5
|
+
site2skill-0.2.0b2.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
6
|
+
site2skill-0.2.0b2.dist-info/entry_points.txt,sha256=dGti9y6iPFjQ7QFqhnTdSVIdYWZT36HRM4LVR7xVA_4,47
|
|
7
|
+
site2skill-0.2.0b2.dist-info/licenses/LICENSE,sha256=WQQK6cACZjWJwBIlcfnlbpAvJbiKajTl_Mdphg1IsFs,1083
|
|
8
|
+
site2skill-0.2.0b2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 laiso
|
|
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.
|