Turn any technical book PDF into a Claude Code skill — ready to study, reference, and use while you work.
Python agent-skillsai-agentsbook-to-skillcontext-engineeringdocument-processingedtechknowledge-baseknowledge-managementllmpdf-to-markdownragself-studystudy-tools
feat(skill): allow choosing project-local skill path (#210)
Hossein Rahimia45a2c9472a5
diff --git a/SKILL.md b/SKILL.mdindex 273a4e2..a2aa4d3 100644--- a/SKILL.md+++ b/SKILL.md@@ -78,7 +78,7 @@ This converter can run from multiple skill systems. When looking for this conver9. Hermes Agent personal skills: `$HERMES_HOME/skills/` (defaults to `~/.hermes/skills/`)10. Hermes Agent project skills: `.hermes/skills/` or `.agents/skills/`-For **generated** book skills, prefer the user-level cross-agent root `~/.agents/skills/` — one physical copy serves every supported host. Copilot CLI and Amp discover it natively; Claude Code needs a symlink from `~/.claude/skills/<skill_name>` (created in Step 10, see Step 5 for the rules). Pick a host-private or project-local root only when the user asks for one.+For **generated** book skills, prefer the user-level cross-agent root `~/.agents/skills/` — one physical copy serves every supported host. Copilot CLI and Amp discover it natively; Claude Code needs a symlink from `~/.claude/skills/<skill_name>` (created in Step 10, see Step 5 for the rules). Pick a host-private or project-local root only when the user explicitly asks for one. `BOOK_TO_SKILL_SCOPE=project` or `personal` can make that choice explicit for automation; do not ask a mandatory scope question merely because both scopes are available.---@@ -338,7 +338,7 @@ Otherwise, propose two options and let the user choose:Default to author-concept format if the book has a strong methodological identity.-Choose the destination skill root (`SKILLS_HOME`). For **personal** (user-level) installs, default to the cross-agent root `~/.agents/skills` — one physical copy that every host except Hermes Agent reaches, natively or through a symlink:+Choose the destination skill root (`SKILLS_HOME`). First resolve **scope** from an explicit user request or `BOOK_TO_SKILL_SCOPE`, then probe **host**. A request for project-local/project output selects the project-local row; a request for personal/global output selects the personal row. If neither scope is requested, preserve the established personal default (`~/.agents/skills` for non-Hermes hosts). Do not ask a mandatory scope question solely because project-local roots exist. The selected root may still require host approval before writing.| Host agent | Personal skill root | Project-local root ||---|---|---|diff --git a/docs/architecture.md b/docs/architecture.mdindex d406fb3..98b4aef 100644--- a/docs/architecture.md+++ b/docs/architecture.md@@ -37,13 +37,14 @@ document into clean text + metadata; the agent turns that into a structured skil└────────────────────────────────────────────────────────────────┘│▼- <SKILLS_HOME>/<slug>/ ← chosen per host:- ~/.copilot/skills/ GitHub Copilot CLI- ~/.agents/skills/ Copilot CLI or Amp (cross-agent)- ~/.claude/skills/ Claude Code- $HERMES_HOME/skills/<category>/ Hermes Agent- .github/skills/ | .claude/skills/ | .agents/skills/ project-local+ <SKILLS_HOME>/<slug>/ ← chosen per host + scope:+ ~/.copilot/skills/ GitHub Copilot CLI (personal)+ ~/.agents/skills/ Copilot CLI or Amp (cross-agent, personal)+ ~/.claude/skills/ Claude Code (personal)+ $HERMES_HOME/skills/<category>/ Hermes Agent (personal)+ .github/skills/ | .claude/skills/ | .agents/skills/ project-local (any host).hermes/skills/<category>/ Hermes project-local+ scope: personal vs project-local (Step 5, BOOK_TO_SKILL_SCOPE)SKILL.md core frameworks + chapter & topic index (~4K)chapters/*.md on-demand, loaded only when askedglossary.md termsdiff --git a/docs/install.md b/docs/install.mdindex 870f9de..7c1f49c 100644--- a/docs/install.md+++ b/docs/install.md@@ -76,6 +76,17 @@ Or manually using standard `git clone` (ensures modular engine files are fetched```bashgit clone https://github.com/virgiliojr94/book-to-skill.git ~/.claude/skills/book-to-skill+# Project-local (share with team via git):+# git clone https://github.com/virgiliojr94/book-to-skill.git .claude/skills/book-to-skill+```++> **Generated book skills — where do they go?** By default the converter uses the established **Personal (global)** root (`~/.agents/skills/<slug>/` for most hosts). **Project-local** output (`.claude/skills/<slug>/`, `.agents/skills/<slug>/`, or `.github/skills/<slug>/`) is an explicit choice for project-specific, git-shareable skills and may require host approval to write inside the project. Set `BOOK_TO_SKILL_SCOPE=project` or `personal` to make the scope explicit for automation; the converter does not ask a mandatory scope question merely because both scopes are available.++Scope-selection check:++```text+Before: no scope request or BOOK_TO_SKILL_SCOPE → personal default (~/.agents/skills)+After: BOOK_TO_SKILL_SCOPE=project or an explicit project-local request → project-local host root```Then in any agent session:diff --git a/tests/test_scope_selection_contract.py b/tests/test_scope_selection_contract.pynew file mode 100644index 0000000..38fe339--- /dev/null+++ b/tests/test_scope_selection_contract.py@@ -0,0 +1,27 @@+"""Scope-selection contract documented by the book-to-skill skill."""++from pathlib import Path+++ROOT = Path(__file__).resolve().parent.parent+SKILL = (ROOT / "SKILL.md").read_text(encoding="utf-8")+INSTALL = (ROOT / "docs" / "install.md").read_text(encoding="utf-8")+++def test_scope_defaults_to_personal_without_a_mandatory_prompt():+ assert "preserve the established personal default" in SKILL+ assert "Do not ask a mandatory scope question" in SKILL+ assert "does not ask a mandatory scope question" in INSTALL+++def test_explicit_project_scope_is_documented_as_opt_in():+ assert "BOOK_TO_SKILL_SCOPE=project" in SKILL+ assert "BOOK_TO_SKILL_SCOPE=project" in INSTALL+ assert "project-local/project output selects the project-local row" in SKILL+ assert "After: BOOK_TO_SKILL_SCOPE=project" in INSTALL+++def test_personal_destination_does_not_claim_approval_free_writes():+ assert "may still require host approval before writing" in SKILL+ assert "may require host approval to write inside the project" in INSTALL+ assert "no extra approval" not in SKILL