skilly 0.0.2a0__tar.gz
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.
- skilly-0.0.2a0/.github/workflows/ci.yml +51 -0
- skilly-0.0.2a0/.github/workflows/publish.yml +20 -0
- skilly-0.0.2a0/.gitignore +27 -0
- skilly-0.0.2a0/.python-version +1 -0
- skilly-0.0.2a0/LICENSE +21 -0
- skilly-0.0.2a0/PKG-INFO +13 -0
- skilly-0.0.2a0/README.md +3 -0
- skilly-0.0.2a0/justfile +43 -0
- skilly-0.0.2a0/prek.toml +47 -0
- skilly-0.0.2a0/pyproject.toml +47 -0
- skilly-0.0.2a0/src/skilly/__init__.py +7 -0
- skilly-0.0.2a0/src/skilly/cli/__init__.py +0 -0
- skilly-0.0.2a0/src/skilly/cli/root.py +22 -0
- skilly-0.0.2a0/src/skilly/cli/util.py +32 -0
- skilly-0.0.2a0/src/skilly/filesystem.py +35 -0
- skilly-0.0.2a0/src/skilly/parsers.py +54 -0
- skilly-0.0.2a0/src/skilly/skills.py +431 -0
- skilly-0.0.2a0/src/skilly/util.py +17 -0
- skilly-0.0.2a0/tests/test_parsers.py +265 -0
- skilly-0.0.2a0/uv.lock +801 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Build and test python application
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.head_ref || github.run_id }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
|
|
18
|
+
lint:
|
|
19
|
+
name: Lint
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v6
|
|
23
|
+
- uses: extractions/setup-just@v3
|
|
24
|
+
- uses: astral-sh/setup-uv@v7
|
|
25
|
+
with:
|
|
26
|
+
cache-dependency-glob: "**/pyproject.toml"
|
|
27
|
+
- run: uv python install 3.10
|
|
28
|
+
- run: just install
|
|
29
|
+
- run: just lint
|
|
30
|
+
|
|
31
|
+
test:
|
|
32
|
+
name: Test
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
strategy:
|
|
35
|
+
fail-fast: false
|
|
36
|
+
matrix:
|
|
37
|
+
python-version:
|
|
38
|
+
- "3.10"
|
|
39
|
+
- "3.11"
|
|
40
|
+
- "3.12"
|
|
41
|
+
- "3.13"
|
|
42
|
+
- "3.14"
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v6
|
|
45
|
+
- uses: extractions/setup-just@v3
|
|
46
|
+
- uses: astral-sh/setup-uv@v7
|
|
47
|
+
with:
|
|
48
|
+
cache-dependency-glob: "**/pyproject.toml"
|
|
49
|
+
- run: uv python install ${{ matrix.python-version }}
|
|
50
|
+
- run: just install
|
|
51
|
+
- run: just test . --cov=. --cov-report xml -rs
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Publish Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types:
|
|
6
|
+
- published
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
environment: publish
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v6
|
|
14
|
+
- uses: extractions/setup-just@v3
|
|
15
|
+
- uses: astral-sh/setup-uv@v7
|
|
16
|
+
with:
|
|
17
|
+
cache-dependency-glob: "**/pyproject.toml"
|
|
18
|
+
- run: just publish
|
|
19
|
+
env:
|
|
20
|
+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Generated by Cargo
|
|
2
|
+
# will have compiled files and executables
|
|
3
|
+
debug
|
|
4
|
+
target
|
|
5
|
+
|
|
6
|
+
# These are backup files generated by rustfmt
|
|
7
|
+
**/*.rs.bk
|
|
8
|
+
|
|
9
|
+
# MSVC Windows builds of rustc generate these, which store debugging information
|
|
10
|
+
*.pdb
|
|
11
|
+
|
|
12
|
+
# Generated by cargo mutants
|
|
13
|
+
# Contains mutation testing data
|
|
14
|
+
**/mutants.out*/
|
|
15
|
+
|
|
16
|
+
# RustRover
|
|
17
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
18
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
19
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
20
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
21
|
+
.idea/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Added by cargo
|
|
25
|
+
|
|
26
|
+
/target
|
|
27
|
+
.venv
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
skilly-0.0.2a0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alex
|
|
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.
|
skilly-0.0.2a0/PKG-INFO
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: skilly
|
|
3
|
+
Version: 0.0.2a0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Requires-Dist: cyclopts>=4
|
|
8
|
+
Requires-Dist: niquests>=3
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
# skilly
|
|
12
|
+
|
|
13
|
+
Read agent skills from dependencies.
|
skilly-0.0.2a0/README.md
ADDED
skilly-0.0.2a0/justfile
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[private]
|
|
2
|
+
default:
|
|
3
|
+
@just --list
|
|
4
|
+
|
|
5
|
+
# update dependencies
|
|
6
|
+
update:
|
|
7
|
+
uv lock --upgrade
|
|
8
|
+
@just install
|
|
9
|
+
|
|
10
|
+
# upgrade dependencies
|
|
11
|
+
upgrade:
|
|
12
|
+
@just update
|
|
13
|
+
|
|
14
|
+
# install dependencies
|
|
15
|
+
install:
|
|
16
|
+
uv sync --all-extras --frozen
|
|
17
|
+
@just hook
|
|
18
|
+
|
|
19
|
+
# lint project
|
|
20
|
+
lint:
|
|
21
|
+
uv run prek run --all-files
|
|
22
|
+
|
|
23
|
+
# test project
|
|
24
|
+
test *args:
|
|
25
|
+
uv run --no-sync pytest {{ args }}
|
|
26
|
+
|
|
27
|
+
# type check project
|
|
28
|
+
typecheck:
|
|
29
|
+
uv run pyrefly check
|
|
30
|
+
|
|
31
|
+
# install pre-commit hooks
|
|
32
|
+
hook:
|
|
33
|
+
uv run prek install --install-hooks --overwrite
|
|
34
|
+
|
|
35
|
+
# uninstall pre-commit hooks
|
|
36
|
+
unhook:
|
|
37
|
+
uv run prek uninstall
|
|
38
|
+
|
|
39
|
+
# publish project on pypi
|
|
40
|
+
publish:
|
|
41
|
+
rm -rf dist
|
|
42
|
+
uv build
|
|
43
|
+
uv publish --token $PYPI_TOKEN
|
skilly-0.0.2a0/prek.toml
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Configuration file for `prek`, a git hook framework written in Rust.
|
|
2
|
+
# See https://prek.j178.dev for more information.
|
|
3
|
+
#:schema https://www.schemastore.org/prek.json
|
|
4
|
+
|
|
5
|
+
[[repos]]
|
|
6
|
+
repo = "https://github.com/astral-sh/ruff-pre-commit"
|
|
7
|
+
rev = "v0.15.8"
|
|
8
|
+
hooks = [
|
|
9
|
+
{
|
|
10
|
+
id = "ruff",
|
|
11
|
+
name = "ruff",
|
|
12
|
+
files = "^src|^tests",
|
|
13
|
+
args = ["--fix"]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id = "ruff-format",
|
|
17
|
+
files = "^src|^tests|^examples|^docs"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[[repos]]
|
|
22
|
+
repo = "https://github.com/pre-commit/pre-commit-hooks"
|
|
23
|
+
rev = "v6.0.0"
|
|
24
|
+
hooks = [
|
|
25
|
+
{ id = "end-of-file-fixer"},
|
|
26
|
+
{ id = "mixed-line-ending"}
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
[[repos]]
|
|
31
|
+
repo = "local"
|
|
32
|
+
hooks = [
|
|
33
|
+
{
|
|
34
|
+
id = "just-format",
|
|
35
|
+
name = "just format",
|
|
36
|
+
entry = "just --unstable --fmt",
|
|
37
|
+
language = "system",
|
|
38
|
+
pass_filenames = false
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id = "type",
|
|
42
|
+
name ="type",
|
|
43
|
+
entry = "just typecheck",
|
|
44
|
+
language = "system",
|
|
45
|
+
pass_filenames = false
|
|
46
|
+
},
|
|
47
|
+
]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = [
|
|
3
|
+
"hatchling", "hatch-vcs"
|
|
4
|
+
]
|
|
5
|
+
build-backend = "hatchling.build"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
[project]
|
|
9
|
+
name = "skilly"
|
|
10
|
+
description = "Add your description here"
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
dependencies = [
|
|
14
|
+
"cyclopts>=4",
|
|
15
|
+
"niquests>=3",
|
|
16
|
+
]
|
|
17
|
+
dynamic = ["version"]
|
|
18
|
+
|
|
19
|
+
[project.scripts]
|
|
20
|
+
skilly = "skilly.cli.root:cli"
|
|
21
|
+
|
|
22
|
+
[dependency-groups]
|
|
23
|
+
dev = [
|
|
24
|
+
"prek>=0.3.13",
|
|
25
|
+
"pyrefly>=0.64.0",
|
|
26
|
+
"pytest>=9.0.3",
|
|
27
|
+
"pytest-asyncio>=1.3.0",
|
|
28
|
+
"pytest-cov>=7.1.0",
|
|
29
|
+
"ruff>=0.15.12",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
[tool.pytest.ini_options]
|
|
34
|
+
addopts = [
|
|
35
|
+
"--import-mode=importlib",
|
|
36
|
+
"--ignore=.tox/",
|
|
37
|
+
"--ignore=tmp/"
|
|
38
|
+
]
|
|
39
|
+
pythonpath=["src", "tests"]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
[tool.hatch.version]
|
|
43
|
+
source = "vcs"
|
|
44
|
+
fallback-version = "0.0.1"
|
|
45
|
+
|
|
46
|
+
[tool.hatch.build.targets.wheel]
|
|
47
|
+
packages = ["src/skilly"]
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from cyclopts import App
|
|
4
|
+
from skilly.cli.util import util_cli
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
cli = App()
|
|
8
|
+
|
|
9
|
+
cli.command(util_cli)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@cli.command()
|
|
13
|
+
def list() -> None:
|
|
14
|
+
from skilly.parsers import parse_toml
|
|
15
|
+
from skilly.parsers import PyProjectInfo
|
|
16
|
+
from skilly.skills import VenvSkills
|
|
17
|
+
|
|
18
|
+
toml = parse_toml(Path("pyproject.toml"))
|
|
19
|
+
info = PyProjectInfo.from_pyproject_toml(toml)
|
|
20
|
+
venv_skills = VenvSkills.from_dir(Path(".venv"))
|
|
21
|
+
for skill in venv_skills.filter_skills(info.dependencies):
|
|
22
|
+
print(f"{skill.skill.name}: {skill.skill.description}")
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from typing import Sequence
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from cyclopts import App
|
|
4
|
+
|
|
5
|
+
util_cli = App("util")
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@util_cli.command()
|
|
9
|
+
def dependencies(
|
|
10
|
+
file: Path = Path("pyproject.toml"), dev: bool = False, extras: Sequence[str] = ()
|
|
11
|
+
) -> None:
|
|
12
|
+
# Todo: Sequence[str] might be wrong here for now
|
|
13
|
+
from skilly.parsers import parse_toml, PyProjectInfo
|
|
14
|
+
|
|
15
|
+
toml = parse_toml(file)
|
|
16
|
+
info = PyProjectInfo.from_pyproject_toml(
|
|
17
|
+
toml, include_dev=dev, include_extras=extras
|
|
18
|
+
)
|
|
19
|
+
for dep in info.dependencies:
|
|
20
|
+
print(dep.name)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@util_cli.command()
|
|
24
|
+
def venv(path: Path = Path(".venv")) -> None:
|
|
25
|
+
|
|
26
|
+
from skilly.skills import VenvSkills
|
|
27
|
+
|
|
28
|
+
skills = VenvSkills.from_dir(path)
|
|
29
|
+
for skill in skills.skills:
|
|
30
|
+
print(
|
|
31
|
+
f"{skill.skill.name}[{skill.package_name}=={skill.package_version}]: {skill.skill.description}"
|
|
32
|
+
)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Protocol, Sequence, Final
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class FileSystem(Protocol):
|
|
7
|
+
def read_file(self, path: Path) -> str:
|
|
8
|
+
"""Read a file and return its contents."""
|
|
9
|
+
|
|
10
|
+
def list_files(self, path: Path) -> Sequence[str]:
|
|
11
|
+
"""List child entry names in a directory."""
|
|
12
|
+
|
|
13
|
+
def is_dir(self, path: Path) -> bool:
|
|
14
|
+
"""Return whether the path is a directory."""
|
|
15
|
+
|
|
16
|
+
def resolve(self, path: Path) -> Path:
|
|
17
|
+
"""Return a normalized absolute path."""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class DefaultFileSystem(FileSystem):
|
|
21
|
+
def read_file(self, path: Path) -> str:
|
|
22
|
+
with open(path, encoding="utf-8") as file_handle:
|
|
23
|
+
return file_handle.read()
|
|
24
|
+
|
|
25
|
+
def list_files(self, path: Path) -> Sequence[str]:
|
|
26
|
+
return os.listdir(path)
|
|
27
|
+
|
|
28
|
+
def is_dir(self, path: Path) -> bool:
|
|
29
|
+
return os.path.isdir(path)
|
|
30
|
+
|
|
31
|
+
def resolve(self, path: Path) -> Path:
|
|
32
|
+
return path.resolve()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
DEFAULT_FILE_SYSTEM: Final[FileSystem] = DefaultFileSystem()
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import tomllib
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Any, Sequence
|
|
5
|
+
|
|
6
|
+
from packaging.requirements import Requirement
|
|
7
|
+
|
|
8
|
+
from .filesystem import DEFAULT_FILE_SYSTEM, FileSystem
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(frozen=True)
|
|
12
|
+
class PyProjectInfo:
|
|
13
|
+
dependencies: list[Requirement]
|
|
14
|
+
|
|
15
|
+
@classmethod
|
|
16
|
+
def _get_extra_requirements(
|
|
17
|
+
cls,
|
|
18
|
+
toml: dict[str, Any],
|
|
19
|
+
extras: Sequence[str],
|
|
20
|
+
) -> list[Requirement]:
|
|
21
|
+
dependency_groups = toml.get("dependency-groups", {})
|
|
22
|
+
extra_requirements = []
|
|
23
|
+
for extra in dependency_groups.keys():
|
|
24
|
+
if extra in extras:
|
|
25
|
+
for dep in dependency_groups[extra]:
|
|
26
|
+
extra_requirements.append(Requirement(dep))
|
|
27
|
+
|
|
28
|
+
return extra_requirements
|
|
29
|
+
|
|
30
|
+
@classmethod
|
|
31
|
+
def from_pyproject_toml(
|
|
32
|
+
cls,
|
|
33
|
+
toml: dict[str, Any],
|
|
34
|
+
include_dev: bool = False,
|
|
35
|
+
include_extras: Sequence[str] = (),
|
|
36
|
+
) -> "PyProjectInfo":
|
|
37
|
+
dependencies = []
|
|
38
|
+
for dep in toml.get("project", {}).get("dependencies", []):
|
|
39
|
+
dependencies.append(Requirement(dep))
|
|
40
|
+
|
|
41
|
+
extras = set(include_extras)
|
|
42
|
+
if include_dev:
|
|
43
|
+
extras.add("dev")
|
|
44
|
+
|
|
45
|
+
dependencies.extend(cls._get_extra_requirements(toml, extras))
|
|
46
|
+
return cls(dependencies=dependencies)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def parse_toml(
|
|
50
|
+
path: Path,
|
|
51
|
+
file_system: FileSystem = DEFAULT_FILE_SYSTEM,
|
|
52
|
+
) -> dict[str, Any]:
|
|
53
|
+
data = file_system.read_file(path)
|
|
54
|
+
return tomllib.loads(data)
|