napoln 0.2.9__tar.gz → 0.2.11__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 (83) hide show
  1. napoln-0.2.11/.release-please-manifest.json +3 -0
  2. {napoln-0.2.9 → napoln-0.2.11}/CHANGELOG.md +30 -0
  3. {napoln-0.2.9 → napoln-0.2.11}/PKG-INFO +1 -1
  4. napoln-0.2.11/docs/specs/2026-04-25-enable-command.md +54 -0
  5. napoln-0.2.11/docs/superpowers/plans/2026-04-25-enable-command.md +410 -0
  6. {napoln-0.2.9 → napoln-0.2.11}/pyproject.toml +1 -1
  7. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/__init__.py +1 -1
  8. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/cli.py +28 -0
  9. napoln-0.2.11/src/napoln/commands/enable.py +200 -0
  10. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/core/agents.py +14 -1
  11. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/core/manifest.py +13 -1
  12. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/core/resolver.py +33 -7
  13. {napoln-0.2.9 → napoln-0.2.11}/tests/unit/test_agents.py +3 -0
  14. napoln-0.2.11/tests/unit/test_enable.py +117 -0
  15. {napoln-0.2.9 → napoln-0.2.11}/tests/unit/test_manifest.py +48 -0
  16. {napoln-0.2.9 → napoln-0.2.11}/tests/unit/test_resolver.py +107 -1
  17. napoln-0.2.9/.release-please-manifest.json +0 -3
  18. {napoln-0.2.9 → napoln-0.2.11}/.github/workflows/ci.yml +0 -0
  19. {napoln-0.2.9 → napoln-0.2.11}/.github/workflows/pr-title.yml +0 -0
  20. {napoln-0.2.9 → napoln-0.2.11}/.github/workflows/release-please.yml +0 -0
  21. {napoln-0.2.9 → napoln-0.2.11}/.github/workflows/release.yml +0 -0
  22. {napoln-0.2.9 → napoln-0.2.11}/.gitignore +0 -0
  23. {napoln-0.2.9 → napoln-0.2.11}/AGENTS.md +0 -0
  24. {napoln-0.2.9 → napoln-0.2.11}/ARCHITECTURE.md +0 -0
  25. {napoln-0.2.9 → napoln-0.2.11}/CLAUDE.md +0 -0
  26. {napoln-0.2.9 → napoln-0.2.11}/CONTRIBUTING.md +0 -0
  27. {napoln-0.2.9 → napoln-0.2.11}/LICENSE +0 -0
  28. {napoln-0.2.9 → napoln-0.2.11}/README.md +0 -0
  29. {napoln-0.2.9 → napoln-0.2.11}/justfile +0 -0
  30. {napoln-0.2.9 → napoln-0.2.11}/napoln-demo.gif +0 -0
  31. {napoln-0.2.9 → napoln-0.2.11}/release-please-config.json +0 -0
  32. {napoln-0.2.9 → napoln-0.2.11}/skills-lock.json +0 -0
  33. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/commands/__init__.py +0 -0
  34. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/commands/add.py +0 -0
  35. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/commands/config.py +0 -0
  36. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/commands/init.py +0 -0
  37. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/commands/install.py +0 -0
  38. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/commands/list_cmd.py +0 -0
  39. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/commands/remove.py +0 -0
  40. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/commands/setup.py +0 -0
  41. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/commands/upgrade.py +0 -0
  42. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/core/__init__.py +0 -0
  43. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/core/hasher.py +0 -0
  44. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/core/home.py +0 -0
  45. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/core/linker.py +0 -0
  46. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/core/merger.py +0 -0
  47. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/core/store.py +0 -0
  48. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/core/validator.py +0 -0
  49. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/errors.py +0 -0
  50. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/output.py +0 -0
  51. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/prompts.py +0 -0
  52. {napoln-0.2.9 → napoln-0.2.11}/src/napoln/skills/napoln-manage/SKILL.md +0 -0
  53. {napoln-0.2.9 → napoln-0.2.11}/tests/__init__.py +0 -0
  54. {napoln-0.2.9 → napoln-0.2.11}/tests/conftest.py +0 -0
  55. {napoln-0.2.9 → napoln-0.2.11}/tests/features/config.feature +0 -0
  56. {napoln-0.2.9 → napoln-0.2.11}/tests/features/first_run.feature +0 -0
  57. {napoln-0.2.9 → napoln-0.2.11}/tests/features/init.feature +0 -0
  58. {napoln-0.2.9 → napoln-0.2.11}/tests/features/install.feature +0 -0
  59. {napoln-0.2.9 → napoln-0.2.11}/tests/features/list.feature +0 -0
  60. {napoln-0.2.9 → napoln-0.2.11}/tests/features/setup.feature +0 -0
  61. {napoln-0.2.9 → napoln-0.2.11}/tests/features/upgrade.feature +0 -0
  62. {napoln-0.2.9 → napoln-0.2.11}/tests/fixtures/invalid-skill/SKILL.md +0 -0
  63. {napoln-0.2.9 → napoln-0.2.11}/tests/fixtures/multi-skill-repo/README.md +0 -0
  64. {napoln-0.2.9 → napoln-0.2.11}/tests/fixtures/multi-skill-repo/skills/skill-a/SKILL.md +0 -0
  65. {napoln-0.2.9 → napoln-0.2.11}/tests/fixtures/multi-skill-repo/skills/skill-b/SKILL.md +0 -0
  66. {napoln-0.2.9 → napoln-0.2.11}/tests/fixtures/valid-skill/SKILL.md +0 -0
  67. {napoln-0.2.9 → napoln-0.2.11}/tests/integration/test_cli.py +0 -0
  68. {napoln-0.2.9 → napoln-0.2.11}/tests/steps/__init__.py +0 -0
  69. {napoln-0.2.9 → napoln-0.2.11}/tests/steps/conftest.py +0 -0
  70. {napoln-0.2.9 → napoln-0.2.11}/tests/steps/test_config.py +0 -0
  71. {napoln-0.2.9 → napoln-0.2.11}/tests/steps/test_first_run.py +0 -0
  72. {napoln-0.2.9 → napoln-0.2.11}/tests/steps/test_init.py +0 -0
  73. {napoln-0.2.9 → napoln-0.2.11}/tests/steps/test_install.py +0 -0
  74. {napoln-0.2.9 → napoln-0.2.11}/tests/steps/test_list.py +0 -0
  75. {napoln-0.2.9 → napoln-0.2.11}/tests/steps/test_setup.py +0 -0
  76. {napoln-0.2.9 → napoln-0.2.11}/tests/steps/test_upgrade.py +0 -0
  77. {napoln-0.2.9 → napoln-0.2.11}/tests/unit/test_hasher.py +0 -0
  78. {napoln-0.2.9 → napoln-0.2.11}/tests/unit/test_linker.py +0 -0
  79. {napoln-0.2.9 → napoln-0.2.11}/tests/unit/test_merger.py +0 -0
  80. {napoln-0.2.9 → napoln-0.2.11}/tests/unit/test_resolve_and_store.py +0 -0
  81. {napoln-0.2.9 → napoln-0.2.11}/tests/unit/test_store.py +0 -0
  82. {napoln-0.2.9 → napoln-0.2.11}/tests/unit/test_validator.py +0 -0
  83. {napoln-0.2.9 → napoln-0.2.11}/uv.lock +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.2.11"
3
+ }
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.11](https://github.com/raiderrobert/napoln/compare/v0.2.10...v0.2.11) (2026-04-25)
4
+
5
+
6
+ ### Features
7
+
8
+ * add napoln enable command ([#72](https://github.com/raiderrobert/napoln/issues/72)) ([ba6e611](https://github.com/raiderrobert/napoln/commit/ba6e6111bee07f12f1de9dbbf617a46d72f7251c))
9
+
10
+
11
+ ### Documentation
12
+
13
+ * add implementation plan for napoln enable command ([d91a851](https://github.com/raiderrobert/napoln/commit/d91a8516cb55121b64ef8bc85956ef2eabdfdc3b))
14
+ * add spec for napoln enable command ([b9f5da2](https://github.com/raiderrobert/napoln/commit/b9f5da22fdbcbea5e7cafd429ac5e421e5af05d0))
15
+
16
+ ## [0.2.10](https://github.com/raiderrobert/napoln/compare/v0.2.9...v0.2.10) (2026-04-25)
17
+
18
+
19
+ ### Features
20
+
21
+ * add Hermes agent support ([e8745e1](https://github.com/raiderrobert/napoln/commit/e8745e19a29c7135014d4dc7e93798ea46079dc3))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * write manifest atomically via temp + rename ([#63](https://github.com/raiderrobert/napoln/issues/63)) ([7751e0f](https://github.com/raiderrobert/napoln/commit/7751e0fa796353b9833f74ae152419055caffdd1)), closes [#20](https://github.com/raiderrobert/napoln/issues/20)
27
+
28
+
29
+ ### Performance Improvements
30
+
31
+ * scope and throttle git fetches in resolve_git ([#66](https://github.com/raiderrobert/napoln/issues/66)) ([6c4d0da](https://github.com/raiderrobert/napoln/commit/6c4d0daee3afa975252c57b988de13a7c7684bbe)), closes [#25](https://github.com/raiderrobert/napoln/issues/25)
32
+
3
33
  ## [0.2.9](https://github.com/raiderrobert/napoln/compare/v0.2.8...v0.2.9) (2026-04-22)
4
34
 
5
35
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: napoln
3
- Version: 0.2.9
3
+ Version: 0.2.11
4
4
  Summary: A package manager for agent skills
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -0,0 +1,54 @@
1
+ # napoln enable Command
2
+
3
+ ## Overview
4
+
5
+ Add a new `enable` command that extends already-installed skills to additional agents without re-downloading.
6
+
7
+ ## Motivation
8
+
9
+ When adding a new agent support (e.g., Hermes), users need a way to enable existing skills for the new agent without re-installing. This provides better ergonomics than `napoln add` for this use case.
10
+
11
+ ## Command Interface
12
+
13
+ ```
14
+ napoln enable [agent] [--project] [--global]
15
+ ```
16
+
17
+ ### Without agent argument
18
+ 1. Interactive picker: select which agent(s) to enable
19
+ 2. Interactive picker: select which skills to enable for selected agent(s)
20
+ 3. Apply placements
21
+
22
+ ### With agent argument
23
+ 1. Read skills from manifest (respects `--project`/`--global`)
24
+ 2. Filter out skills already placed for that agent
25
+ 3. If no skills need enabling: `✓ All skills already enabled for <agent>`
26
+ 4. Interactive picker: select skills to enable
27
+ 5. Place selected skills and update manifest
28
+
29
+ ## Behavior
30
+
31
+ - Uses existing store entries (no re-download)
32
+ - Skips skills already placed for the target agent
33
+ - Supports `--project` flag for project-scoped operations
34
+ - Interactive picker via existing `pick_skills` infrastructure
35
+
36
+ ## Implementation
37
+
38
+ New file: `src/napoln/commands/enable.py`
39
+ - `run_enable()` function
40
+ - Import existing `_install_single_skill` logic or create shared placement helper
41
+ - Integrate with CLI in `src/napoln/cli.py`
42
+
43
+ ## Example
44
+
45
+ ```
46
+ $ napoln enable hermes
47
+ Found 5 skills. Already enabled: 2. Select skills to enable for Hermes:
48
+
49
+ [x] code-review v1.2.0 owner/repo
50
+ [ ] brainstorming v0.1.0 other/repo
51
+ [ ] citation v2.0.0 another/repo
52
+
53
+ ✓ Enabled 'code-review' for hermes → ~/.hermes/skills/code-review
54
+ ```
@@ -0,0 +1,410 @@
1
+ # napoln enable Command Implementation Plan
2
+
3
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
+
5
+ **Goal:** Add `napoln enable <agent>` command that extends already-installed skills to additional agents without re-downloading.
6
+
7
+ **Architecture:** New `enable.py` command module that reads from existing manifests, filters skills not yet placed for the target agent, and uses interactive pickers. Reuses existing `linker.place_skill` and `manifest` infrastructure.
8
+
9
+ **Tech Stack:** typer CLI, existing `prompts.py` pickers, existing `manifest.py`, existing `linker.py`
10
+
11
+ ---
12
+
13
+ ## File Structure
14
+
15
+ - **Create:** `src/napoln/commands/enable.py`
16
+ - **Modify:** `src/napoln/cli.py` (add enable command)
17
+ - **Create:** `tests/unit/test_enable.py`
18
+ - **Create:** `tests/integration/test_enable.py` (optional)
19
+
20
+ ---
21
+
22
+ ## Task 1: Create enable.py Command Module
23
+
24
+ **Files:**
25
+ - Create: `src/napoln/commands/enable.py`
26
+
27
+ - [ ] **Step 1: Write the command module**
28
+
29
+ ```python
30
+ """napoln enable — Extend installed skills to additional agents."""
31
+
32
+ from __future__ import annotations
33
+
34
+ from pathlib import Path
35
+ from typing import cast
36
+
37
+ from napoln import output
38
+ from napoln.core import agents as agents_mod
39
+ from napoln.core import linker, manifest, store
40
+ from napoln.core.home import get_napoln_home
41
+ from napoln.prompts import SkillChoice, pick_agents, pick_skills
42
+
43
+
44
+ def _get_skills_to_enable(
45
+ mf: manifest.Manifest,
46
+ agent_id: str,
47
+ ) -> list[manifest.SkillEntry]:
48
+ """Return skills not yet placed for the given agent."""
49
+ skills = []
50
+ for name, entry in mf.skills.items():
51
+ if agent_id not in entry.agents:
52
+ skills.append(entry)
53
+ return skills
54
+
55
+
56
+ def _place_skill_for_agent(
57
+ skill_entry: manifest.SkillEntry,
58
+ agent_config: agents_mod.AgentConfig,
59
+ napoln_home: Path,
60
+ home: Path,
61
+ scope: str,
62
+ project_root: Path | None,
63
+ ) -> bool:
64
+ """Place a single skill for an agent. Returns True on success."""
65
+ # Get store path
66
+ store_path = napoln_home / "store" / skill_entry.source.replace("/", "_")
67
+ # Find the actual versioned directory
68
+ version_prefix = skill_entry.version + "-"
69
+ for child in store_path.iterdir():
70
+ if child.is_dir() and child.name.startswith(version_prefix):
71
+ store_path = child
72
+ break
73
+ else:
74
+ output.warning(f"Store entry not found for '{skill_entry.source}'")
75
+ return False
76
+
77
+ # Get target path
78
+ target_path = agent_config.skill_path(home, skill_entry.source.split("/")[-1], scope, project_root)
79
+
80
+ # Place
81
+ try:
82
+ link_mode = linker.place_skill(store_path, target_path)
83
+ linker.write_provenance(
84
+ target_path,
85
+ skill_entry.source,
86
+ skill_entry.version,
87
+ skill_entry.store_hash,
88
+ link_mode,
89
+ )
90
+ return True
91
+ except Exception as e:
92
+ output.error(f"Failed to place skill: {e}")
93
+ return False
94
+
95
+
96
+ def run_enable(
97
+ agent_ids: list[str] | None,
98
+ scope: str = "global",
99
+ project_root: Path | None = None,
100
+ ) -> int:
101
+ """Execute the enable command.
102
+
103
+ Args:
104
+ agent_ids: Specific agent IDs to enable, or None to pick interactively.
105
+ scope: "global" or "project".
106
+ project_root: Project root for project scope.
107
+
108
+ Returns:
109
+ Exit code (0=success, 1=error).
110
+ """
111
+ import os
112
+
113
+ napoln_home = get_napoln_home()
114
+ home = Path(os.environ.get("HOME", Path.home()))
115
+
116
+ # Determine which agents to enable
117
+ if agent_ids:
118
+ # Validate agent IDs
119
+ for aid in agent_ids:
120
+ if aid not in agents_mod.AGENTS:
121
+ output.error(f"Unknown agent: {aid}. Available: {', '.join(agents_mod.AGENTS.keys())}")
122
+ return 1
123
+ target_agents = [agents_mod.AGENTS[aid] for aid in agent_ids]
124
+ else:
125
+ # Interactive agent picker
126
+ available = agents_mod.detect_agents(home, project_root, scope)
127
+ if not available:
128
+ output.error("No agents detected. Install an agent first.")
129
+ return 1
130
+
131
+ selected = pick_agents(available)
132
+ if selected is None:
133
+ return 1 # User cancelled
134
+ if not selected:
135
+ output.info("No agents selected.")
136
+ return 0
137
+ target_agents = cast(list[agents_mod.AgentConfig], selected)
138
+
139
+ # Load manifest
140
+ manifest_path = manifest.get_manifest_path(napoln_home, scope, project_root)
141
+ mf = manifest.read_manifest(manifest_path)
142
+
143
+ if not mf.skills:
144
+ output.info("No skills installed.")
145
+ return 0
146
+
147
+ # Process each agent
148
+ for agent in target_agents:
149
+ skills_to_enable = _get_skills_to_enable(mf, agent.id)
150
+
151
+ if not skills_to_enable:
152
+ output.success(f"All skills already enabled for {agent.display_name}")
153
+ continue
154
+
155
+ output.info(f"Found {len(skills_to_enable)} skills. Select skills to enable for {agent.display_name}:")
156
+
157
+ # Build picker choices
158
+ choices = [
159
+ SkillChoice(
160
+ name=name,
161
+ description=entry.source,
162
+ path=Path(entry.source),
163
+ )
164
+ for name, entry in mf.skills.items()
165
+ if agent.id not in entry.agents
166
+ ]
167
+
168
+ selected = pick_skills(choices)
169
+ if not selected:
170
+ output.info(f"No skills selected for {agent.display_name}")
171
+ continue
172
+
173
+ # Place selected skills
174
+ for choice in selected:
175
+ skill_entry = mf.skills[choice.name]
176
+ success = _place_skill_for_agent(
177
+ skill_entry, agent, napoln_home, home, scope, project_root
178
+ )
179
+ if success:
180
+ output.success(f"Enabled '{choice.name}' for {agent.display_name}")
181
+ # Update manifest
182
+ from napoln.core.manifest import AgentPlacement
183
+ skill_entry.agents[agent.id] = AgentPlacement(
184
+ path=str(agent.skill_path(home, choice.name, scope, project_root)),
185
+ link_mode="clone", # Will be updated by place_skill
186
+ scope=scope,
187
+ )
188
+
189
+ # Write manifest
190
+ manifest.write_manifest(mf, manifest_path)
191
+
192
+ return 0
193
+ ```
194
+
195
+ - [ ] **Step 2: Commit**
196
+
197
+ ```bash
198
+ git add src/napoln/commands/enable.py
199
+ git commit -m "feat: add napoln enable command"
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Task 2: Add enable Command to CLI
205
+
206
+ **Files:**
207
+ - Modify: `src/napoln/cli.py`
208
+
209
+ - [ ] **Step 1: Add enable command to cli.py**
210
+
211
+ Add after the `setup` command definition (around line 200):
212
+
213
+ ```python
214
+ # ─── enable ──────────────────────────────────────────────────────────────────
215
+
216
+
217
+ @app.command()
218
+ def enable(
219
+ agent: Annotated[
220
+ Optional[str],
221
+ typer.Argument(help="Agent to enable skills for (e.g., hermes, claude-code)."),
222
+ ] = None,
223
+ project: Annotated[
224
+ bool, typer.Option("--project", "-p", help="Enable skills in project scope.")
225
+ ] = False,
226
+ ) -> None:
227
+ """Extend installed skills to additional agents."""
228
+ from napoln.commands.enable import run_enable
229
+
230
+ agent_ids = [agent] if agent else None
231
+ scope = "project" if project else "global"
232
+ project_root = Path.cwd() if project else None
233
+
234
+ exit_code = run_enable(
235
+ agent_ids=agent_ids,
236
+ scope=scope,
237
+ project_root=project_root,
238
+ )
239
+ raise typer.Exit(code=exit_code)
240
+ ```
241
+
242
+ - [ ] **Step 2: Commit**
243
+
244
+ ```bash
245
+ git add src/napoln/cli.py
246
+ git commit -m "feat: add enable command to CLI"
247
+ ```
248
+
249
+ ---
250
+
251
+ ## Task 3: Write Unit Tests
252
+
253
+ **Files:**
254
+ - Create: `tests/unit/test_enable.py`
255
+
256
+ - [ ] **Step 1: Write unit tests**
257
+
258
+ ```python
259
+ """Tests for napoln.commands.enable."""
260
+
261
+ import pytest
262
+ from pathlib import Path
263
+
264
+ from napoln.commands.enable import _get_skills_to_enable, run_enable
265
+ from napoln.core import manifest as manifest_mod
266
+
267
+
268
+ class TestGetSkillsToEnable:
269
+ """Filter skills not yet placed for an agent."""
270
+
271
+ def test_no_skills(self):
272
+ """Empty manifest returns empty list."""
273
+ mf = manifest_mod.Manifest()
274
+ result = _get_skills_to_enable(mf, "hermes")
275
+ assert result == []
276
+
277
+ def test_all_enabled(self):
278
+ """Skill already placed for agent is filtered out."""
279
+ mf = manifest_mod.Manifest()
280
+ mf.skills["test-skill"] = manifest_mod.SkillEntry(
281
+ source="owner/repo",
282
+ version="1.0.0",
283
+ store_hash="abc123",
284
+ installed="2024-01-01T00:00:00Z",
285
+ updated="2024-01-01T00:00:00Z",
286
+ agents={"hermes": manifest_mod.AgentPlacement(
287
+ path="/home/.hermes/skills/test-skill",
288
+ link_mode="clone",
289
+ scope="global",
290
+ )},
291
+ )
292
+ result = _get_skills_to_enable(mf, "hermes")
293
+ assert result == []
294
+
295
+ def test_some_enabled(self):
296
+ """Skills not placed for agent are returned."""
297
+ mf = manifest_mod.Manifest()
298
+ mf.skills["skill-a"] = manifest_mod.SkillEntry(
299
+ source="owner/repo",
300
+ version="1.0.0",
301
+ store_hash="abc123",
302
+ installed="2024-01-01T00:00:00Z",
303
+ updated="2024-01-01T00:00:00Z",
304
+ agents={"claude-code": manifest_mod.AgentPlacement(
305
+ path="/home/.claude/skills/skill-a",
306
+ link_mode="clone",
307
+ scope="global",
308
+ )},
309
+ )
310
+ mf.skills["skill-b"] = manifest_mod.SkillEntry(
311
+ source="other/repo",
312
+ version="2.0.0",
313
+ store_hash="def456",
314
+ installed="2024-01-01T00:00:00Z",
315
+ updated="2024-01-01T00:00:00Z",
316
+ agents={}, # Not placed for anyone
317
+ )
318
+ result = _get_skills_to_enable(mf, "hermes")
319
+ assert len(result) == 2
320
+ names = {e.source for e in result}
321
+ assert "owner/repo" in names
322
+ assert "other/repo" in names
323
+
324
+
325
+ class TestRunEnable:
326
+ """Integration tests for run_enable."""
327
+
328
+ def test_unknown_agent(self, tmp_path, monkeypatch):
329
+ """Unknown agent ID returns error."""
330
+ # Mock environment
331
+ monkeypatch.setenv("HOME", str(tmp_path))
332
+ # Mock napoln home
333
+ nap_home = tmp_path / ".napoln"
334
+ nap_home.mkdir()
335
+ monkeypatch.setattr(
336
+ "napoln.commands.enable.get_napoln_home",
337
+ lambda: nap_home,
338
+ )
339
+
340
+ exit_code = run_enable(agent_ids=["nonexistent-agent"])
341
+ assert exit_code == 1
342
+
343
+ def test_no_skills_installed(self, tmp_path, monkeypatch):
344
+ """Empty manifest returns success."""
345
+ monkeypatch.setenv("HOME", str(tmp_path))
346
+ nap_home = tmp_path / ".napoln"
347
+ nap_home.mkdir()
348
+ monkeypatch.setattr(
349
+ "napoln.commands.enable.get_napoln_home",
350
+ lambda: nap_home,
351
+ )
352
+
353
+ exit_code = run_enable(agent_ids=["hermes"])
354
+ assert exit_code == 0
355
+ ```
356
+
357
+ - [ ] **Step 2: Run tests**
358
+
359
+ Run: `pytest tests/unit/test_enable.py -v`
360
+ Expected: Tests pass
361
+
362
+ - [ ] **Step 3: Commit**
363
+
364
+ ```bash
365
+ git add tests/unit/test_enable.py
366
+ git commit -m "test: add unit tests for enable command"
367
+ ```
368
+
369
+ ---
370
+
371
+ ## Task 4: Run Full Test Suite
372
+
373
+ - [ ] **Step 1: Run full check**
374
+
375
+ Run: `just check`
376
+ Expected: All checks pass, all tests pass
377
+
378
+ - [ ] **Step 2: Final commit if needed**
379
+
380
+ ```bash
381
+ git push
382
+ ```
383
+
384
+ ---
385
+
386
+ ## Summary
387
+
388
+ | Task | Description |
389
+ |------|-------------|
390
+ | 1 | Create `enable.py` command module |
391
+ | 2 | Add enable command to CLI |
392
+ | 3 | Write unit tests |
393
+ | 4 | Run full test suite |
394
+
395
+ ---
396
+
397
+ ## Spec Coverage Check
398
+
399
+ - [x] `napoln enable <agent>` - implemented in Task 1-2
400
+ - [x] `napoln enable` (no agent) - pick_agents integration in run_enable
401
+ - [x] `--project` flag - scope parameter implemented
402
+ - [x] Skip already-placed skills - `_get_skills_to_enable` filters them
403
+ - [x] Interactive picker - uses `pick_skills`
404
+ - [x] Update manifest - manifest updated after placement
405
+
406
+ ## Type Consistency Check
407
+
408
+ - `run_enable(agent_ids, scope, project_root)` matches CLI call signature
409
+ - `AgentConfig.id` used for manifest agent tracking
410
+ - `manifest.AgentPlacement` used for manifest updates
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "napoln"
3
- version = "0.2.9"
3
+ version = "0.2.11"
4
4
  description = "A package manager for agent skills"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1,3 +1,3 @@
1
1
  """napoln — A package manager for agent skills."""
2
2
 
3
- __version__ = "0.2.9"
3
+ __version__ = "0.2.11"
@@ -225,6 +225,34 @@ def install(
225
225
  raise typer.Exit(code=exit_code)
226
226
 
227
227
 
228
+ # ─── enable ──────────────────────────────────────────────────────────────────
229
+
230
+
231
+ @app.command()
232
+ def enable(
233
+ agent: Annotated[
234
+ Optional[str],
235
+ typer.Argument(help="Agent to enable skills for (e.g., hermes, claude-code)."),
236
+ ] = None,
237
+ project: Annotated[
238
+ bool, typer.Option("--project", "-p", help="Enable skills in project scope.")
239
+ ] = False,
240
+ ) -> None:
241
+ """Extend installed skills to additional agents."""
242
+ from napoln.commands.enable import run_enable
243
+
244
+ agent_ids = [agent] if agent else None
245
+ scope = "project" if project else "global"
246
+ project_root = Path.cwd() if project else None
247
+
248
+ exit_code = run_enable(
249
+ agent_ids=agent_ids,
250
+ scope=scope,
251
+ project_root=project_root,
252
+ )
253
+ raise typer.Exit(code=exit_code)
254
+
255
+
228
256
  # ─── init ─────────────────────────────────────────────────────────────────────
229
257
 
230
258