skill-tuple-space 0.1.0__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.
Files changed (30) hide show
  1. skill_tuple_space-0.1.0/.devcontainer/maintainer/Containerfile +11 -0
  2. skill_tuple_space-0.1.0/.devcontainer/maintainer/devcontainer.json +29 -0
  3. skill_tuple_space-0.1.0/.devcontainer/maintainer/scripts/build.sh +19 -0
  4. skill_tuple_space-0.1.0/.devcontainer/maintainer/scripts/post-create.sh +12 -0
  5. skill_tuple_space-0.1.0/.devcontainer/maintainer/scripts/run.sh +30 -0
  6. skill_tuple_space-0.1.0/.github/workflows/ci.yml +57 -0
  7. skill_tuple_space-0.1.0/.github/workflows/publish.yml +75 -0
  8. skill_tuple_space-0.1.0/.github/workflows/set-label-triage-to-new-issue.yml +21 -0
  9. skill_tuple_space-0.1.0/.gitignore +46 -0
  10. skill_tuple_space-0.1.0/LICENSE +21 -0
  11. skill_tuple_space-0.1.0/PKG-INFO +86 -0
  12. skill_tuple_space-0.1.0/README.md +65 -0
  13. skill_tuple_space-0.1.0/config.example.toml +16 -0
  14. skill_tuple_space-0.1.0/pyproject.toml +45 -0
  15. skill_tuple_space-0.1.0/src/skill_space/__init__.py +3 -0
  16. skill_tuple_space-0.1.0/src/skill_space/cli.py +140 -0
  17. skill_tuple_space-0.1.0/src/skill_space/display.py +52 -0
  18. skill_tuple_space-0.1.0/src/skill_space/embedder.py +17 -0
  19. skill_tuple_space-0.1.0/src/skill_space/indexer.py +153 -0
  20. skill_tuple_space-0.1.0/src/skill_space/journal.py +40 -0
  21. skill_tuple_space-0.1.0/src/skill_space/matcher.py +185 -0
  22. skill_tuple_space-0.1.0/src/skill_space/predictor.py +68 -0
  23. skill_tuple_space-0.1.0/src/skill_space/store.py +129 -0
  24. skill_tuple_space-0.1.0/tests/__init__.py +0 -0
  25. skill_tuple_space-0.1.0/tests/test_cli.py +108 -0
  26. skill_tuple_space-0.1.0/tests/test_journal.py +69 -0
  27. skill_tuple_space-0.1.0/tests/test_matcher.py +157 -0
  28. skill_tuple_space-0.1.0/tests/test_predictor.py +109 -0
  29. skill_tuple_space-0.1.0/tests/test_skill_space.py +7 -0
  30. skill_tuple_space-0.1.0/tests/test_store.py +76 -0
@@ -0,0 +1,11 @@
1
+ FROM mcr.microsoft.com/devcontainers/python:3.12-bookworm
2
+
3
+ RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ git curl vim jq \
5
+ && rm -rf /var/lib/apt/lists/*
6
+
7
+ WORKDIR /workspace
8
+
9
+ RUN pip install --upgrade pip hatch ruff black mypy
10
+
11
+ USER vscode
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "aider-skills dev",
3
+ "build": {
4
+ "dockerfile": "Containerfile",
5
+ "context": "../.."
6
+ },
7
+ "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
8
+ "workspaceFolder": "/workspace",
9
+ "customizations": {
10
+ "vscode": {
11
+ "extensions": [
12
+ "ms-python.python",
13
+ "ms-python.black-formatter",
14
+ "charliermarsh.ruff",
15
+ "ms-python.mypy-type-checker",
16
+ "eamodio.gitlens"
17
+ ],
18
+ "settings": {
19
+ "python.defaultInterpreterPath": "/usr/local/bin/python",
20
+ "editor.formatOnSave": true,
21
+ "[python]": {
22
+ "editor.defaultFormatter": "ms-python.black-formatter"
23
+ }
24
+ }
25
+ }
26
+ },
27
+ "postCreateCommand": "bash .devcontainer/agentskills/scripts/post-create.sh",
28
+ "remoteUser": "vscode"
29
+ }
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ IMAGE_NAME="aider-skills-dev"
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
7
+ CONTAINERFILE="$SCRIPT_DIR/../Containerfile"
8
+
9
+ command -v podman &>/dev/null && RUNTIME="podman" || RUNTIME="docker"
10
+ echo "==> Runtime: $RUNTIME"
11
+
12
+ $RUNTIME build \
13
+ --file "$CONTAINERFILE" \
14
+ --tag "$IMAGE_NAME:latest" \
15
+ "$REPO_ROOT"
16
+
17
+ echo "==> Built: $IMAGE_NAME:latest"
18
+ echo " Next: .devcontainer/maintainer/scripts/run.sh"
19
+
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ echo "==> Installing aider-skills in editable (dev) mode ..."
5
+ pip install -e ".[dev]" --quiet
6
+
7
+ echo "==> Confirming CLI entry point ..."
8
+ aider-skills --version
9
+
10
+ echo "==> Dev environment ready!"
11
+ echo " Run: aider-skills --help"
12
+ echo " Run: pytest"
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env bash
2
+ # Usage:
3
+ # ./run.sh — interactive shell
4
+ # ./run.sh pytest — run tests and exit
5
+ # ./run.sh aider-skills --help
6
+ set -euo pipefail
7
+
8
+ IMAGE_NAME="aider-skills-dev"
9
+ CONTAINER_NAME="aider-skills-dev"
10
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11
+ REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
12
+
13
+ command -v podman &>/dev/null && RUNTIME="podman" || RUNTIME="docker"
14
+ $RUNTIME rm -f "$CONTAINER_NAME" 2>/dev/null || true
15
+
16
+ if [ $# -eq 0 ]; then
17
+ TTY_FLAGS=("-it"); EXEC_ARGS=("bash")
18
+ else
19
+ TTY_FLAGS=("-i"); EXEC_ARGS=("$@")
20
+ fi
21
+
22
+ $RUNTIME run \
23
+ "${TTY_FLAGS[@]}" \
24
+ --rm \
25
+ --name "$CONTAINER_NAME" \
26
+ --volume "$REPO_ROOT:/workspace:z" \
27
+ --workdir /workspace \
28
+ --user vscode \
29
+ "$IMAGE_NAME:latest" \
30
+ "${EXEC_ARGS[@]}"
@@ -0,0 +1,57 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint:
11
+ name: Lint
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: astral-sh/setup-uv@v5
16
+ with:
17
+ enable-cache: true
18
+ - name: Install dev dependencies
19
+ run: uv sync --extra dev
20
+ - name: Ruff check
21
+ run: uv run ruff check .
22
+ - name: Ruff format check
23
+ run: uv run ruff format --check .
24
+
25
+ typecheck:
26
+ name: Type check
27
+ runs-on: ubuntu-latest
28
+ continue-on-error: true
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: astral-sh/setup-uv@v5
32
+ with:
33
+ enable-cache: true
34
+ - name: Install dev dependencies
35
+ run: uv sync --extra dev
36
+ - name: mypy
37
+ run: uv run mypy src/
38
+
39
+ test:
40
+ name: Test / Python ${{ matrix.python-version }}
41
+ runs-on: ubuntu-latest
42
+ strategy:
43
+ fail-fast: false
44
+ matrix:
45
+ python-version:
46
+ - "3.12"
47
+ - "3.13"
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+ - uses: astral-sh/setup-uv@v5
51
+ with:
52
+ python-version: ${{ matrix.python-version }}
53
+ enable-cache: true
54
+ - name: Install dev dependencies
55
+ run: uv sync --extra dev
56
+ - name: Run tests
57
+ run: uv run pytest tests/ -v --tb=short
@@ -0,0 +1,75 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*" # triggers on v0.1.0, v1.2.3, etc.
7
+
8
+ jobs:
9
+ build:
10
+ name: Build distribution
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v4
23
+
24
+ - name: Build wheel and sdist
25
+ run: |
26
+ uv pip install hatchling --system
27
+ python -m hatchling build
28
+
29
+ - name: Upload dist artifacts
30
+ uses: actions/upload-artifact@v4
31
+ with:
32
+ name: dist
33
+ path: dist/
34
+
35
+ publish-pypi:
36
+ name: Publish to PyPI
37
+ needs: build
38
+ runs-on: ubuntu-latest
39
+ environment:
40
+ name: pypi
41
+ url: https://pypi.org/p/skill-tuple-space
42
+ permissions:
43
+ id-token: write # required for trusted publishing (no API key needed)
44
+
45
+ steps:
46
+ - name: Download dist artifacts
47
+ uses: actions/download-artifact@v4
48
+ with:
49
+ name: dist
50
+ path: dist/
51
+
52
+ - name: Publish to PyPI
53
+ uses: pypa/gh-action-pypi-publish@release/v1
54
+
55
+ publish-github-release:
56
+ name: Create GitHub Release
57
+ needs: build
58
+ runs-on: ubuntu-latest
59
+ permissions:
60
+ contents: write
61
+
62
+ steps:
63
+ - uses: actions/checkout@v4
64
+
65
+ - name: Download dist artifacts
66
+ uses: actions/download-artifact@v4
67
+ with:
68
+ name: dist
69
+ path: dist/
70
+
71
+ - name: Create GitHub Release
72
+ uses: softprops/action-gh-release@v2
73
+ with:
74
+ files: dist/*
75
+ generate_release_notes: true
@@ -0,0 +1,21 @@
1
+ name: Set label triage to new issue
2
+ on:
3
+ issues:
4
+ types:
5
+ - reopened
6
+ - opened
7
+ jobs:
8
+ label_issues:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ issues: write
12
+ steps:
13
+ - uses: actions/github-script@v6
14
+ with:
15
+ script: |
16
+ github.rest.issues.addLabels({
17
+ issue_number: context.issue.number,
18
+ owner: context.repo.owner,
19
+ repo: context.repo.repo,
20
+ labels: ["triage"]
21
+ })
@@ -0,0 +1,46 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+ *.pyd
6
+ .Python
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+ *.egg
11
+ *.whl
12
+ MANIFEST
13
+
14
+ # uv / hatch
15
+ .venv/
16
+ .hatch/
17
+ .uv/
18
+
19
+ # mypy
20
+ .mypy_cache/
21
+
22
+ # ruff
23
+ .ruff_cache/
24
+
25
+ # pytest
26
+ .pytest_cache/
27
+ htmlcov/
28
+ .coverage
29
+ coverage.xml
30
+
31
+ # skill-space runtime data
32
+ ~/.skill-space/
33
+
34
+ # IDE
35
+ .idea/
36
+ .vscode/
37
+ *.swp
38
+ *.swo
39
+
40
+ # OS
41
+ .DS_Store
42
+ Thumbs.db
43
+
44
+ # secrets
45
+ .env
46
+ *.env.local
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Robert Halter
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.
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.4
2
+ Name: skill-tuple-space
3
+ Version: 0.1.0
4
+ Summary: Fuzzy Tuple Space for Agent Skills — index, search, and predict across skill git repos
5
+ Author-email: roebi <roebi@users.noreply.github.com>
6
+ License: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.12
9
+ Requires-Dist: gitpython>=3.1
10
+ Requires-Dist: pyyaml>=6
11
+ Requires-Dist: rich>=13
12
+ Requires-Dist: sentence-transformers>=3
13
+ Requires-Dist: sqlite-vec>=0.1
14
+ Requires-Dist: typer>=0.12
15
+ Provides-Extra: dev
16
+ Requires-Dist: mypy>=1.10; extra == 'dev'
17
+ Requires-Dist: pytest>=8; extra == 'dev'
18
+ Requires-Dist: ruff>=0.4; extra == 'dev'
19
+ Requires-Dist: types-pyyaml>=6; extra == 'dev'
20
+ Description-Content-Type: text/markdown
21
+
22
+ # skill-tuple-space
23
+
24
+ **Fuzzy Tuple Space for Agent Skills.**
25
+
26
+ Inspired by David Gelernter's Linda coordination language and JavaSpaces,
27
+ `skill-tuple-space` indexes your agent skill git repos into a local SQLite store
28
+ and lets you query them using two complementary mechanisms:
29
+
30
+ - **Fuzzy layer** — membership-function scoring on structured metadata
31
+ (`skill_class`, `crud_verb`, `topic`, `requires_role`).
32
+ - **Semantic layer** — RAG / cosine similarity on SKILL.md descriptions
33
+ via `sentence-transformers`.
34
+
35
+ These are **two distinct things**: the semantic layer finds what is _similar_,
36
+ the fuzzy layer reasons about how well something _fits your current taxonomy and context_.
37
+
38
+ ## Install
39
+
40
+ ```bash
41
+ uv pip install -e ".[dev]"
42
+ ```
43
+
44
+ ## Quickstart
45
+
46
+ ```bash
47
+ # 1. Copy and edit config
48
+ mkdir -p ~/.skill-space
49
+ cp config.example.toml ~/.skill-space/config.toml
50
+
51
+ # 2. Index your repos
52
+ skill-space index run
53
+
54
+ # 3. Semantic + fuzzy search
55
+ skill-space search query "create something visual with 3d"
56
+
57
+ # 4. Linda-style template matching
58
+ skill-space search read "skill_class=Process, crud_verb=create, topic=*"
59
+
60
+ # 5. Learning journal
61
+ skill-space learn claim create-openscad-from-construction-image-en
62
+ skill-space learn done create-openscad-from-construction-image-en --level 4
63
+ skill-space learn next --topic agent-skills
64
+
65
+ # 6. Space health
66
+ skill-space space stats
67
+ skill-space space drift
68
+ ```
69
+
70
+ ## Architecture
71
+
72
+ ```
73
+ src/skill_space/
74
+ ├── cli.py # typer CLI entry point
75
+ ├── indexer.py # git clone + SKILL.md parse + embed
76
+ ├── embedder.py # sentence-transformers (all-MiniLM-L6-v2, 384-dim)
77
+ ├── store.py # SQLite + sqlite-vec persistence
78
+ ├── matcher.py # fuzzy membership functions + cosine combiner
79
+ ├── journal.py # learning events CRUD
80
+ ├── predictor.py # readiness scoring + next-skill suggestion
81
+ └── display.py # rich terminal output
82
+ ```
83
+
84
+ ## License
85
+
86
+ MIT
@@ -0,0 +1,65 @@
1
+ # skill-tuple-space
2
+
3
+ **Fuzzy Tuple Space for Agent Skills.**
4
+
5
+ Inspired by David Gelernter's Linda coordination language and JavaSpaces,
6
+ `skill-tuple-space` indexes your agent skill git repos into a local SQLite store
7
+ and lets you query them using two complementary mechanisms:
8
+
9
+ - **Fuzzy layer** — membership-function scoring on structured metadata
10
+ (`skill_class`, `crud_verb`, `topic`, `requires_role`).
11
+ - **Semantic layer** — RAG / cosine similarity on SKILL.md descriptions
12
+ via `sentence-transformers`.
13
+
14
+ These are **two distinct things**: the semantic layer finds what is _similar_,
15
+ the fuzzy layer reasons about how well something _fits your current taxonomy and context_.
16
+
17
+ ## Install
18
+
19
+ ```bash
20
+ uv pip install -e ".[dev]"
21
+ ```
22
+
23
+ ## Quickstart
24
+
25
+ ```bash
26
+ # 1. Copy and edit config
27
+ mkdir -p ~/.skill-space
28
+ cp config.example.toml ~/.skill-space/config.toml
29
+
30
+ # 2. Index your repos
31
+ skill-space index run
32
+
33
+ # 3. Semantic + fuzzy search
34
+ skill-space search query "create something visual with 3d"
35
+
36
+ # 4. Linda-style template matching
37
+ skill-space search read "skill_class=Process, crud_verb=create, topic=*"
38
+
39
+ # 5. Learning journal
40
+ skill-space learn claim create-openscad-from-construction-image-en
41
+ skill-space learn done create-openscad-from-construction-image-en --level 4
42
+ skill-space learn next --topic agent-skills
43
+
44
+ # 6. Space health
45
+ skill-space space stats
46
+ skill-space space drift
47
+ ```
48
+
49
+ ## Architecture
50
+
51
+ ```
52
+ src/skill_space/
53
+ ├── cli.py # typer CLI entry point
54
+ ├── indexer.py # git clone + SKILL.md parse + embed
55
+ ├── embedder.py # sentence-transformers (all-MiniLM-L6-v2, 384-dim)
56
+ ├── store.py # SQLite + sqlite-vec persistence
57
+ ├── matcher.py # fuzzy membership functions + cosine combiner
58
+ ├── journal.py # learning events CRUD
59
+ ├── predictor.py # readiness scoring + next-skill suggestion
60
+ └── display.py # rich terminal output
61
+ ```
62
+
63
+ ## License
64
+
65
+ MIT
@@ -0,0 +1,16 @@
1
+ # ~/.skill-space/config.toml
2
+ # List all skill git repos to index into your local space.
3
+ # trust: high | medium | low — influences result ranking.
4
+
5
+ [[repos]]
6
+ url = "https://github.com/roebi/agent-skills"
7
+ trust = "high"
8
+
9
+ [[repos]]
10
+ url = "https://github.com/roebi/new-work-skills"
11
+ trust = "high"
12
+
13
+ # Example: third-party repo with lower trust
14
+ # [[repos]]
15
+ # url = "https://github.com/someone/community-skills"
16
+ # trust = "low"
@@ -0,0 +1,45 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "skill-tuple-space"
7
+ version = "0.1.0"
8
+ description = "Fuzzy Tuple Space for Agent Skills — index, search, and predict across skill git repos"
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ authors = [{ name = "roebi", email = "roebi@users.noreply.github.com" }]
12
+ requires-python = ">=3.12"
13
+ dependencies = [
14
+ "typer>=0.12",
15
+ "rich>=13",
16
+ "gitpython>=3.1",
17
+ "sentence-transformers>=3",
18
+ "sqlite-vec>=0.1",
19
+ "pyyaml>=6",
20
+ ]
21
+
22
+ [project.optional-dependencies]
23
+ dev = [
24
+ "pytest>=8",
25
+ "mypy>=1.10",
26
+ "ruff>=0.4",
27
+ "types-PyYAML>=6",
28
+ ]
29
+
30
+ [project.scripts]
31
+ skill-space = "skill_space.cli:app"
32
+
33
+ [tool.hatch.build.targets.wheel]
34
+ packages = ["src/skill_space"]
35
+
36
+ [tool.hatch.envs.default]
37
+ installer = "uv"
38
+
39
+ [tool.mypy]
40
+ strict = false
41
+ warn_unused_ignores = true
42
+ ignore_missing_imports = true
43
+
44
+ [tool.ruff]
45
+ line-length = 100
@@ -0,0 +1,3 @@
1
+ """skill-space — Fuzzy Tuple Space for Agent Skills."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,140 @@
1
+ """skill-space CLI — Fuzzy Tuple Space for Agent Skills."""
2
+
3
+ import typer
4
+ from rich.console import Console
5
+
6
+ app = typer.Typer(
7
+ name="skill-space",
8
+ help="Fuzzy Tuple Space for Agent Skills. Index repos, search by fuzzy template, track learning.",
9
+ no_args_is_help=True,
10
+ )
11
+ console = Console()
12
+
13
+
14
+ # ── Sub-command groups ─────────────────────────────────────────────────────────
15
+
16
+ index_app = typer.Typer(help="Index skill git repos into the local space.")
17
+ search_app = typer.Typer(help="Search and match skills.")
18
+ learn_app = typer.Typer(help="Learning journal: claim, done, next.")
19
+ space_app = typer.Typer(help="Space health: stats, drift.")
20
+
21
+ app.add_typer(index_app, name="index")
22
+ app.add_typer(search_app, name="search")
23
+ app.add_typer(learn_app, name="learn")
24
+ app.add_typer(space_app, name="space")
25
+
26
+
27
+ # ── index ──────────────────────────────────────────────────────────────────────
28
+
29
+
30
+ @index_app.command("run")
31
+ def index_run(
32
+ repo: str = typer.Option(None, help="Single repo URL to index (overrides config)."),
33
+ force: bool = typer.Option(False, "--force", help="Re-index even if up to date."),
34
+ ) -> None:
35
+ """Crawl configured repos, parse SKILL.md files, embed and store."""
36
+ from skill_space.indexer import Indexer
37
+
38
+ indexer = Indexer()
39
+ indexer.run(repo_url=repo, force=force)
40
+
41
+
42
+ # ── search ─────────────────────────────────────────────────────────────────────
43
+
44
+
45
+ @search_app.command("query")
46
+ def search_query(
47
+ query: str = typer.Argument(
48
+ ..., help="Free-text query, e.g. 'create something visual with 3d'"
49
+ ),
50
+ skill_class: str = typer.Option(
51
+ None, "--class", help="Filter: Role | Topic | Process | OneStepProcess"
52
+ ),
53
+ lang: str = typer.Option("en", "--lang", help="Language filter."),
54
+ top: int = typer.Option(5, "--top", help="Number of results."),
55
+ ) -> None:
56
+ """Semantic + fuzzy search across all indexed skills."""
57
+ from skill_space.matcher import Matcher
58
+
59
+ matcher = Matcher()
60
+ results = matcher.search(query=query, skill_class=skill_class, lang=lang, top=top)
61
+ from skill_space.display import display_results
62
+
63
+ display_results(results)
64
+
65
+
66
+ @search_app.command("read")
67
+ def search_read(
68
+ template: str = typer.Argument(
69
+ ...,
70
+ help="Linda-style template, e.g. 'skill_class=Process, crud_verb=create, topic=*'",
71
+ ),
72
+ ) -> None:
73
+ """Template-based tuple matching (JavaSpaces / Linda style)."""
74
+ from skill_space.matcher import Matcher
75
+
76
+ matcher = Matcher()
77
+ results = matcher.read_template(template)
78
+ from skill_space.display import display_results
79
+
80
+ display_results(results)
81
+
82
+
83
+ # ── learn ──────────────────────────────────────────────────────────────────────
84
+
85
+
86
+ @learn_app.command("claim")
87
+ def learn_claim(skill_name: str = typer.Argument(...)) -> None:
88
+ """Mark a skill as 'currently learning'."""
89
+ from skill_space.journal import Journal
90
+
91
+ Journal().claim(skill_name)
92
+ console.print(f"[green]Claimed:[/green] {skill_name}")
93
+
94
+
95
+ @learn_app.command("done")
96
+ def learn_done(
97
+ skill_name: str = typer.Argument(...),
98
+ level: int = typer.Option(..., "--level", min=1, max=5, help="Mastery level reached (1–5)."),
99
+ ) -> None:
100
+ """Record completion of a skill at a given mastery level."""
101
+ from skill_space.journal import Journal
102
+
103
+ Journal().done(skill_name, level=level)
104
+ console.print(f"[green]Done:[/green] {skill_name} at level {level}")
105
+
106
+
107
+ @learn_app.command("next")
108
+ def learn_next(
109
+ topic: str = typer.Option(None, "--topic", help="Filter suggestions by topic."),
110
+ ) -> None:
111
+ """Predict the best next skill to learn based on your journal."""
112
+ from skill_space.predictor import Predictor
113
+
114
+ suggestion = Predictor().next_skill(topic=topic)
115
+ from skill_space.display import display_suggestion
116
+
117
+ display_suggestion(suggestion)
118
+
119
+
120
+ # ── space ──────────────────────────────────────────────────────────────────────
121
+
122
+
123
+ @space_app.command("stats")
124
+ def space_stats() -> None:
125
+ """Show space statistics: repos indexed, skill count, last sync."""
126
+ from skill_space.store import Store
127
+
128
+ Store().print_stats()
129
+
130
+
131
+ @space_app.command("drift")
132
+ def space_drift() -> None:
133
+ """Detect stale skills: pinned commits behind HEAD, old last-touched dates."""
134
+ from skill_space.indexer import Indexer
135
+
136
+ Indexer().drift_report()
137
+
138
+
139
+ if __name__ == "__main__":
140
+ app()