napoln 0.2.5__tar.gz → 0.2.7__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 (77) hide show
  1. napoln-0.2.7/.release-please-manifest.json +3 -0
  2. {napoln-0.2.5 → napoln-0.2.7}/CHANGELOG.md +18 -0
  3. {napoln-0.2.5 → napoln-0.2.7}/PKG-INFO +33 -2
  4. {napoln-0.2.5 → napoln-0.2.7}/README.md +32 -1
  5. napoln-0.2.7/napoln-demo.gif +0 -0
  6. {napoln-0.2.5 → napoln-0.2.7}/pyproject.toml +1 -1
  7. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/__init__.py +1 -1
  8. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/cli.py +11 -3
  9. napoln-0.2.7/src/napoln/commands/remove.py +152 -0
  10. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/core/resolver.py +42 -0
  11. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/skills/napoln-manage/SKILL.md +16 -2
  12. {napoln-0.2.5 → napoln-0.2.7}/tests/integration/test_cli.py +98 -0
  13. {napoln-0.2.5 → napoln-0.2.7}/tests/unit/test_resolver.py +57 -0
  14. {napoln-0.2.5 → napoln-0.2.7}/uv.lock +1 -1
  15. napoln-0.2.5/.release-please-manifest.json +0 -3
  16. napoln-0.2.5/src/napoln/commands/remove.py +0 -72
  17. {napoln-0.2.5 → napoln-0.2.7}/.github/workflows/ci.yml +0 -0
  18. {napoln-0.2.5 → napoln-0.2.7}/.github/workflows/pr-title.yml +0 -0
  19. {napoln-0.2.5 → napoln-0.2.7}/.github/workflows/release-please.yml +0 -0
  20. {napoln-0.2.5 → napoln-0.2.7}/.github/workflows/release.yml +0 -0
  21. {napoln-0.2.5 → napoln-0.2.7}/.gitignore +0 -0
  22. {napoln-0.2.5 → napoln-0.2.7}/AGENTS.md +0 -0
  23. {napoln-0.2.5 → napoln-0.2.7}/ARCHITECTURE.md +0 -0
  24. {napoln-0.2.5 → napoln-0.2.7}/CONTRIBUTING.md +0 -0
  25. {napoln-0.2.5 → napoln-0.2.7}/LICENSE +0 -0
  26. {napoln-0.2.5 → napoln-0.2.7}/justfile +0 -0
  27. {napoln-0.2.5 → napoln-0.2.7}/release-please-config.json +0 -0
  28. {napoln-0.2.5 → napoln-0.2.7}/skills-lock.json +0 -0
  29. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/commands/__init__.py +0 -0
  30. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/commands/add.py +0 -0
  31. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/commands/config.py +0 -0
  32. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/commands/init.py +0 -0
  33. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/commands/install.py +0 -0
  34. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/commands/list_cmd.py +0 -0
  35. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/commands/setup.py +0 -0
  36. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/commands/upgrade.py +0 -0
  37. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/core/__init__.py +0 -0
  38. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/core/agents.py +0 -0
  39. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/core/hasher.py +0 -0
  40. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/core/linker.py +0 -0
  41. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/core/manifest.py +0 -0
  42. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/core/merger.py +0 -0
  43. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/core/store.py +0 -0
  44. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/core/validator.py +0 -0
  45. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/errors.py +0 -0
  46. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/output.py +0 -0
  47. {napoln-0.2.5 → napoln-0.2.7}/src/napoln/prompts.py +0 -0
  48. {napoln-0.2.5 → napoln-0.2.7}/tests/__init__.py +0 -0
  49. {napoln-0.2.5 → napoln-0.2.7}/tests/conftest.py +0 -0
  50. {napoln-0.2.5 → napoln-0.2.7}/tests/features/config.feature +0 -0
  51. {napoln-0.2.5 → napoln-0.2.7}/tests/features/first_run.feature +0 -0
  52. {napoln-0.2.5 → napoln-0.2.7}/tests/features/init.feature +0 -0
  53. {napoln-0.2.5 → napoln-0.2.7}/tests/features/install.feature +0 -0
  54. {napoln-0.2.5 → napoln-0.2.7}/tests/features/list.feature +0 -0
  55. {napoln-0.2.5 → napoln-0.2.7}/tests/features/setup.feature +0 -0
  56. {napoln-0.2.5 → napoln-0.2.7}/tests/features/upgrade.feature +0 -0
  57. {napoln-0.2.5 → napoln-0.2.7}/tests/fixtures/invalid-skill/SKILL.md +0 -0
  58. {napoln-0.2.5 → napoln-0.2.7}/tests/fixtures/multi-skill-repo/README.md +0 -0
  59. {napoln-0.2.5 → napoln-0.2.7}/tests/fixtures/multi-skill-repo/skills/skill-a/SKILL.md +0 -0
  60. {napoln-0.2.5 → napoln-0.2.7}/tests/fixtures/multi-skill-repo/skills/skill-b/SKILL.md +0 -0
  61. {napoln-0.2.5 → napoln-0.2.7}/tests/fixtures/valid-skill/SKILL.md +0 -0
  62. {napoln-0.2.5 → napoln-0.2.7}/tests/steps/__init__.py +0 -0
  63. {napoln-0.2.5 → napoln-0.2.7}/tests/steps/conftest.py +0 -0
  64. {napoln-0.2.5 → napoln-0.2.7}/tests/steps/test_config.py +0 -0
  65. {napoln-0.2.5 → napoln-0.2.7}/tests/steps/test_first_run.py +0 -0
  66. {napoln-0.2.5 → napoln-0.2.7}/tests/steps/test_init.py +0 -0
  67. {napoln-0.2.5 → napoln-0.2.7}/tests/steps/test_install.py +0 -0
  68. {napoln-0.2.5 → napoln-0.2.7}/tests/steps/test_list.py +0 -0
  69. {napoln-0.2.5 → napoln-0.2.7}/tests/steps/test_setup.py +0 -0
  70. {napoln-0.2.5 → napoln-0.2.7}/tests/steps/test_upgrade.py +0 -0
  71. {napoln-0.2.5 → napoln-0.2.7}/tests/unit/test_agents.py +0 -0
  72. {napoln-0.2.5 → napoln-0.2.7}/tests/unit/test_hasher.py +0 -0
  73. {napoln-0.2.5 → napoln-0.2.7}/tests/unit/test_linker.py +0 -0
  74. {napoln-0.2.5 → napoln-0.2.7}/tests/unit/test_manifest.py +0 -0
  75. {napoln-0.2.5 → napoln-0.2.7}/tests/unit/test_merger.py +0 -0
  76. {napoln-0.2.5 → napoln-0.2.7}/tests/unit/test_store.py +0 -0
  77. {napoln-0.2.5 → napoln-0.2.7}/tests/unit/test_validator.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.2.7"
3
+ }
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.7](https://github.com/raiderrobert/napoln/compare/v0.2.6...v0.2.7) (2026-04-17)
4
+
5
+
6
+ ### Features
7
+
8
+ * **remove:** accept multiple names and --from-source ([#31](https://github.com/raiderrobert/napoln/issues/31)) ([e075639](https://github.com/raiderrobert/napoln/commit/e075639b4e04cb14a6674ab503ae70d190fc13ef))
9
+
10
+ ## [0.2.6](https://github.com/raiderrobert/napoln/compare/v0.2.5...v0.2.6) (2026-04-16)
11
+
12
+
13
+ ### Documentation
14
+
15
+ * add asciinema demo to README ([94876fa](https://github.com/raiderrobert/napoln/commit/94876fa2ec25f5c043d00b24f37c743418cc56bf))
16
+ * add GIF demo of agent installing skills ([7c3d6cb](https://github.com/raiderrobert/napoln/commit/7c3d6cbde2857353fe5a7ce647cc2fddbd348ab8))
17
+ * move demo GIF to top of README ([33eb773](https://github.com/raiderrobert/napoln/commit/33eb773d0d1aa21392ee1b0efd0ec578901a5217))
18
+ * restructure README like uv ([8adc744](https://github.com/raiderrobert/napoln/commit/8adc7449a6bf8b37081ef2b02887cfc246355405))
19
+ * reorg ([67423c9](https://github.com/raiderrobert/napoln/commit/67423c96317c64576a508d36ed22b073ccf1b70e))
20
+
3
21
  ## [0.2.5](https://github.com/raiderrobert/napoln/compare/v0.2.4...v0.2.5) (2026-04-16)
4
22
 
5
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: napoln
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: A package manager for agent skills
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -32,6 +32,8 @@ A package manager for [agent skills](https://agentskills.io/specification). Inst
32
32
  - **Zero-copy placement.** Reflink (copy-on-write) on APFS and btrfs. Full copy fallback elsewhere.
33
33
  - **Self-describing.** A bundled skill teaches your agents how to use napoln.
34
34
 
35
+ ![napoln demo](napoln-demo.gif)
36
+
35
37
  ## Install
36
38
 
37
39
  Requires Python 3.11+. napoln is published on [PyPI](https://pypi.org/project/napoln/).
@@ -50,6 +52,16 @@ pipx install napoln # alternative
50
52
  pip install napoln # plain pip
51
53
  ```
52
54
 
55
+ ## First Run
56
+
57
+ On first run, napoln installs its bundled management skill so your agents
58
+ know how to use it. After that, your agents can find and install new
59
+ capabilities without prompting you for CLI commands.
60
+
61
+ Agents prefer `uvx napoln` so they never hit PATH issues. The bundled
62
+ skill is automatically installed alongside your first skill, so it works
63
+ out of the box.
64
+
53
65
  ## Quick Start
54
66
 
55
67
  ```bash
@@ -90,11 +102,30 @@ napoln upgrade code-review
90
102
  # ✓ Merged 'code-review' at ~/.claude/skills/code-review (2 files updated)
91
103
  ```
92
104
 
105
+ Remove one or more skills at once:
106
+
107
+ ```bash
108
+ napoln remove design-audit design-frontend design-preflight
109
+ ```
110
+
111
+ Remove all skills from a specific repository:
112
+
113
+ ```bash
114
+ napoln remove --from-source raiderrobert/flow
115
+ ```
116
+
117
+ Combine explicit names with `--from-source` filter:
118
+
119
+ ```bash
120
+ napoln remove --from-source raiderrobert/flow design-audit
121
+ ```
122
+
93
123
  ## Commands
94
124
 
95
125
  ```
96
126
  napoln add <source> Install skills from a git repo or local path
97
- napoln remove <name> Remove an installed skill
127
+ napoln remove <name>... Remove one or more skills
128
+ napoln remove --from-source Remove all skills from a specific repository
98
129
  napoln upgrade [<name>] Upgrade one or all skills
99
130
  napoln list Show installed skills and where they are placed
100
131
  napoln install Restore skill placements from manifests
@@ -11,6 +11,8 @@ A package manager for [agent skills](https://agentskills.io/specification). Inst
11
11
  - **Zero-copy placement.** Reflink (copy-on-write) on APFS and btrfs. Full copy fallback elsewhere.
12
12
  - **Self-describing.** A bundled skill teaches your agents how to use napoln.
13
13
 
14
+ ![napoln demo](napoln-demo.gif)
15
+
14
16
  ## Install
15
17
 
16
18
  Requires Python 3.11+. napoln is published on [PyPI](https://pypi.org/project/napoln/).
@@ -29,6 +31,16 @@ pipx install napoln # alternative
29
31
  pip install napoln # plain pip
30
32
  ```
31
33
 
34
+ ## First Run
35
+
36
+ On first run, napoln installs its bundled management skill so your agents
37
+ know how to use it. After that, your agents can find and install new
38
+ capabilities without prompting you for CLI commands.
39
+
40
+ Agents prefer `uvx napoln` so they never hit PATH issues. The bundled
41
+ skill is automatically installed alongside your first skill, so it works
42
+ out of the box.
43
+
32
44
  ## Quick Start
33
45
 
34
46
  ```bash
@@ -69,11 +81,30 @@ napoln upgrade code-review
69
81
  # ✓ Merged 'code-review' at ~/.claude/skills/code-review (2 files updated)
70
82
  ```
71
83
 
84
+ Remove one or more skills at once:
85
+
86
+ ```bash
87
+ napoln remove design-audit design-frontend design-preflight
88
+ ```
89
+
90
+ Remove all skills from a specific repository:
91
+
92
+ ```bash
93
+ napoln remove --from-source raiderrobert/flow
94
+ ```
95
+
96
+ Combine explicit names with `--from-source` filter:
97
+
98
+ ```bash
99
+ napoln remove --from-source raiderrobert/flow design-audit
100
+ ```
101
+
72
102
  ## Commands
73
103
 
74
104
  ```
75
105
  napoln add <source> Install skills from a git repo or local path
76
- napoln remove <name> Remove an installed skill
106
+ napoln remove <name>... Remove one or more skills
107
+ napoln remove --from-source Remove all skills from a specific repository
77
108
  napoln upgrade [<name>] Upgrade one or all skills
78
109
  napoln list Show installed skills and where they are placed
79
110
  napoln install Restore skill placements from manifests
Binary file
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "napoln"
3
- version = "0.2.5"
3
+ version = "0.2.7"
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.5"
3
+ __version__ = "0.2.7"
@@ -98,7 +98,14 @@ def add(
98
98
 
99
99
  @app.command()
100
100
  def remove(
101
- name: Annotated[str, typer.Argument(help="Skill name to remove.")],
101
+ name: Annotated[list[str], typer.Argument(help="Skill name(s) to remove.")] = [],
102
+ from_source: Annotated[
103
+ Optional[str],
104
+ typer.Option(
105
+ "--from-source",
106
+ help="Remove all skills from this repository (e.g., raiderrobert/flow or https://github.com/owner/repo).",
107
+ ),
108
+ ] = None,
102
109
  project: Annotated[
103
110
  bool, typer.Option("--project", "-p", help="Remove from project scope.")
104
111
  ] = False,
@@ -107,7 +114,7 @@ def remove(
107
114
  ] = None,
108
115
  dry_run: Annotated[bool, typer.Option("--dry-run", help="Show what would happen.")] = False,
109
116
  ) -> None:
110
- """Remove an installed skill."""
117
+ """Remove one or more installed skills."""
111
118
  from napoln.commands.remove import run_remove
112
119
 
113
120
  agent_ids = [a.strip() for a in agents.split(",")] if agents else None
@@ -115,7 +122,8 @@ def remove(
115
122
  project_root = Path.cwd() if project else None
116
123
 
117
124
  exit_code = run_remove(
118
- name=name,
125
+ names=name,
126
+ from_source=from_source,
119
127
  agent_ids=agent_ids,
120
128
  scope=scope,
121
129
  project_root=project_root,
@@ -0,0 +1,152 @@
1
+ """napoln remove — Remove an installed skill."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import shutil
6
+ from pathlib import Path
7
+
8
+ from napoln import output
9
+ from napoln.core import manifest
10
+ from napoln.core.resolver import normalize_source_for_match
11
+
12
+
13
+ def _get_napoln_home() -> Path:
14
+ import os
15
+
16
+ return Path(os.environ.get("NAPOLN_HOME", Path.home() / ".napoln"))
17
+
18
+
19
+ def _resolve_from_source(
20
+ from_source: str,
21
+ mf: manifest.Manifest,
22
+ ) -> list[str]:
23
+ """Resolve --from-source to matching skill names.
24
+
25
+ Args:
26
+ from_source: Source identifier (shorthand or URL).
27
+ mf: Current manifest.
28
+
29
+ Returns:
30
+ List of skill names that match the source.
31
+ """
32
+ normalized = normalize_source_for_match(from_source)
33
+ matching_names: list[str] = []
34
+
35
+ for name, entry in mf.skills.items():
36
+ entry_source = normalize_source_for_match(entry.source)
37
+ if entry_source == normalized:
38
+ matching_names.append(name)
39
+
40
+ return matching_names
41
+
42
+
43
+ def run_remove(
44
+ names: list[str],
45
+ from_source: str | None = None,
46
+ agent_ids: list[str] | None = None,
47
+ scope: str = "global",
48
+ project_root: Path | None = None,
49
+ dry_run: bool = False,
50
+ ) -> int:
51
+ """Execute the remove command.
52
+
53
+ Args:
54
+ names: Skill names to remove.
55
+ from_source: If set, remove all skills from this repository.
56
+ agent_ids: If specified, only remove these agent placements.
57
+ scope: "global" or "project".
58
+ project_root: Project root for project scope.
59
+ dry_run: Show what would happen without applying.
60
+
61
+ Returns:
62
+ Exit code (0=success, 1=error).
63
+ """
64
+ napoln_home = _get_napoln_home()
65
+ manifest_path = manifest.get_manifest_path(napoln_home, scope, project_root)
66
+ mf = manifest.read_manifest(manifest_path)
67
+
68
+ # Resolve --from-source to names and merge with explicit names
69
+ from_source_names = []
70
+ if from_source:
71
+ from_source_names = _resolve_from_source(from_source, mf)
72
+ if not from_source_names:
73
+ output.info(f"No skills found from '{from_source}'.")
74
+ # Merge with explicit names, avoid duplicates
75
+ existing = set(from_source_names)
76
+ for name in names:
77
+ if name not in existing:
78
+ from_source_names.append(name)
79
+ names = from_source_names
80
+
81
+ if not names:
82
+ output.info("No skills specified.")
83
+ return 0
84
+
85
+ if dry_run:
86
+ output.dry_run_header()
87
+
88
+ exit_code = 0
89
+
90
+ for name in names:
91
+ result = _remove_single(
92
+ name=name,
93
+ mf=mf,
94
+ manifest_path=manifest_path,
95
+ agent_ids=agent_ids,
96
+ dry_run=dry_run,
97
+ )
98
+ if result != 0:
99
+ exit_code = 1
100
+
101
+ if not dry_run:
102
+ # Write manifest once after all removals
103
+ manifest.write_manifest(mf, manifest_path)
104
+
105
+ return exit_code
106
+
107
+
108
+ def _remove_single(
109
+ name: str,
110
+ mf: manifest.Manifest,
111
+ manifest_path: Path,
112
+ agent_ids: list[str] | None,
113
+ dry_run: bool,
114
+ ) -> int:
115
+ """Remove a single skill from manifest and filesystem.
116
+
117
+ Returns:
118
+ 0 on success, 1 on error.
119
+ """
120
+ if name not in mf.skills:
121
+ output.info(f"'{name}' is not installed.")
122
+ return 0
123
+
124
+ entry = mf.skills[name]
125
+
126
+ # Determine which agents to remove
127
+ agents_to_remove = agent_ids if agent_ids else list(entry.agents.keys())
128
+
129
+ for agent_id in agents_to_remove:
130
+ if agent_id not in entry.agents:
131
+ continue
132
+
133
+ placement = entry.agents[agent_id]
134
+ placement_path = Path(placement.path).expanduser()
135
+
136
+ if dry_run:
137
+ output.would(f"remove placement {placement_path}")
138
+ else:
139
+ if placement_path.exists():
140
+ shutil.rmtree(placement_path)
141
+ output.success(f"Removed placement: {placement_path}")
142
+ else:
143
+ output.dim(f" Placement already gone: {placement_path}")
144
+
145
+ if dry_run:
146
+ return 0
147
+
148
+ # Update manifest - remove skill or just the agent placements
149
+ mf = manifest.remove_skill_from_manifest(mf, name, agent_ids)
150
+ output.success(f"Removed '{name}'")
151
+
152
+ return 0
@@ -543,3 +543,45 @@ def discover_skill_choices(repo_dir: Path) -> list[tuple[str, str, Path]]:
543
543
  desc = _extract_description(skill_dir)
544
544
  results.append((name, desc, skill_dir))
545
545
  return results
546
+
547
+
548
+ def normalize_source_for_match(source: str) -> str:
549
+ """Normalize a source identifier for matching against manifest entries.
550
+
551
+ - Strips https://github.com/ prefix and .git suffix from full URLs
552
+ - Converts GitHub shorthand (owner/repo) to normalized form
553
+ - Returns local paths unchanged
554
+
555
+ Args:
556
+ source: Source identifier (URL, shorthand, or local path).
557
+
558
+ Returns:
559
+ Normalized source identifier for matching.
560
+ """
561
+ # Strip .git suffix
562
+ if source.endswith(".git"):
563
+ source = source[:-4]
564
+
565
+ # Strip URL scheme
566
+ if source.startswith("https://"):
567
+ source = source[8:]
568
+ elif source.startswith("http://"):
569
+ source = source[7:]
570
+ elif source.startswith("git@"):
571
+ # git@github.com:owner/repo -> github.com/owner/repo
572
+ source = source[4:].replace(":", "/")
573
+
574
+ # Check if already normalized (has host with domain, e.g. github.com/owner/repo)
575
+ # vs shorthand (owner/repo) which needs normalization
576
+ if "/" in source:
577
+ first_segment = source.split("/")[0]
578
+ # If first segment has a dot, it's likely a host (already normalized)
579
+ if "." in first_segment:
580
+ return source
581
+
582
+ # GitHub shorthand: owner/repo -> github.com/owner/repo
583
+ parsed = parse_source(source)
584
+ if parsed.source_type == "git" and parsed.host:
585
+ return f"{parsed.host}/{parsed.owner}/{parsed.repo}"
586
+
587
+ return source
@@ -24,7 +24,7 @@ runs. Use `uvx` to invoke it without relying on PATH:
24
24
  uvx napoln add owner/repo # add (preferred — no PATH dependency)
25
25
  uvx napoln list # list
26
26
  uvx napoln upgrade # upgrade
27
- uvx napoln remove <name> # remove
27
+ uvx napoln remove <name>... # remove (or --from-source)
28
28
  uvx napoln install # sync from manifests
29
29
  uvx napoln init my-skill # scaffold a new skill
30
30
  uvx napoln config doctor # verify integrity
@@ -69,8 +69,22 @@ upstream also changed the same lines):
69
69
 
70
70
  ## Remove a Skill
71
71
 
72
+ Remove one or more skills:
73
+
74
+ ```bash
75
+ uvx napoln remove design-audit design-frontend design-preflight
76
+ ```
77
+
78
+ Remove all skills from a specific repository:
79
+
80
+ ```bash
81
+ uvx napoln remove --from-source raiderrobert/flow
82
+ ```
83
+
84
+ Combine explicit names with `--from-source` filter:
85
+
72
86
  ```bash
73
- uvx napoln remove <name>
87
+ uvx napoln remove --from-source raiderrobert/flow design-audit
74
88
  ```
75
89
 
76
90
  ## Scaffold a New Skill
@@ -5,6 +5,7 @@ from __future__ import annotations
5
5
  import json
6
6
 
7
7
  import pytest
8
+ import tomli_w
8
9
  from typer.testing import CliRunner
9
10
 
10
11
  from napoln.cli import app
@@ -186,6 +187,103 @@ class TestRemoveCommand:
186
187
  # Skill should still be placed
187
188
  assert (home / ".claude" / "skills" / "test-skill" / "SKILL.md").exists()
188
189
 
190
+ def test_remove_multiple_names(self, runner, isolated_env, tmp_path):
191
+ """Remove multiple skills at once."""
192
+ home, napoln_home, env = isolated_env
193
+
194
+ # Add first skill
195
+ skill1 = tmp_path / "skill-one"
196
+ skill1.mkdir()
197
+ (skill1 / "SKILL.md").write_text(
198
+ "---\nname: skill-one\ndescription: First skill.\n"
199
+ 'metadata:\n version: "1.0.0"\n---\n\n# Skill One\n'
200
+ )
201
+ runner.invoke(app, ["add", str(skill1)], env=env)
202
+
203
+ # Add second skill
204
+ skill2 = tmp_path / "skill-two"
205
+ skill2.mkdir()
206
+ (skill2 / "SKILL.md").write_text(
207
+ "---\nname: skill-two\ndescription: Second skill.\n"
208
+ 'metadata:\n version: "1.0.0"\n---\n\n# Skill Two\n'
209
+ )
210
+ runner.invoke(app, ["add", str(skill2)], env=env)
211
+
212
+ # Remove both
213
+ result = runner.invoke(app, ["remove", "skill-one", "skill-two"], env=env)
214
+ assert result.exit_code == 0
215
+
216
+ # Both placements should be gone
217
+ assert not (home / ".claude" / "skills" / "skill-one").exists()
218
+ assert not (home / ".claude" / "skills" / "skill-two").exists()
219
+
220
+ def test_remove_from_source_no_matches(self, runner, isolated_env):
221
+ """--from-source with no matching skills should exit 0 with info."""
222
+ _, napoln_home, env = isolated_env
223
+ napoln_home.mkdir(parents=True, exist_ok=True)
224
+
225
+ import tomli_w
226
+
227
+ (napoln_home / "manifest.toml").write_text(
228
+ tomli_w.dumps({"napoln": {"schema": 1}, "skills": {}})
229
+ )
230
+
231
+ result = runner.invoke(app, ["remove", "--from-source", "nonexistent/repo"], env=env)
232
+ assert result.exit_code == 0
233
+ assert "No skills found" in result.output
234
+
235
+ def test_remove_from_source_matches(self, runner, isolated_env, tmp_path):
236
+ """--from-source should match against manifest's stored source URL."""
237
+ home, napoln_home, env = isolated_env
238
+
239
+ skill = tmp_path / "design-audit"
240
+ skill.mkdir()
241
+ (skill / "SKILL.md").write_text(
242
+ "---\nname: design-audit\ndescription: Audit skill.\n"
243
+ 'metadata:\n version: "1.0.0"\n---\n\n# Design Audit\n'
244
+ )
245
+ runner.invoke(app, ["add", str(skill)], env=env)
246
+
247
+ # Manually update manifest source to a GitHub URL
248
+ import tomllib
249
+
250
+ manifest_path = napoln_home / "manifest.toml"
251
+ data = tomllib.loads(manifest_path.read_text())
252
+ if "skills" in data and "design-audit" in data["skills"]:
253
+ data["skills"]["design-audit"]["source"] = "https://github.com/raiderrobert/flow"
254
+ manifest_path.write_text(tomli_w.dumps(data))
255
+
256
+ # Remove using shorthand that should match
257
+ result = runner.invoke(app, ["remove", "--from-source", "raiderrobert/flow"], env=env)
258
+ assert result.exit_code == 0
259
+ assert not (home / ".claude" / "skills" / "design-audit").exists()
260
+
261
+ def test_remove_combined_names_and_from_source(self, runner, isolated_env, tmp_path):
262
+ """--from-source can be combined with explicit names."""
263
+ home, napoln_home, env = isolated_env
264
+
265
+ skill_a = tmp_path / "skill-a"
266
+ skill_a.mkdir()
267
+ (skill_a / "SKILL.md").write_text(
268
+ "---\nname: skill-a\ndescription: Skill A.\n"
269
+ 'metadata:\n version: "1.0.0"\n---\n\n# Skill A\n'
270
+ )
271
+ runner.invoke(app, ["add", str(skill_a)], env=env)
272
+
273
+ skill_b = tmp_path / "skill-b"
274
+ skill_b.mkdir()
275
+ (skill_b / "SKILL.md").write_text(
276
+ "---\nname: skill-b\ndescription: Skill B.\n"
277
+ 'metadata:\n version: "1.0.0"\n---\n\n# Skill B\n'
278
+ )
279
+ runner.invoke(app, ["add", str(skill_b)], env=env)
280
+
281
+ # Remove skill-a explicitly and skill-b via from-source
282
+ runner.invoke(app, ["remove", "skill-a", "--from-source", "raiderrobert/other"], env=env)
283
+ # skill-a should be removed, skill-b stays (no match)
284
+ assert not (home / ".claude" / "skills" / "skill-a").exists()
285
+ assert (home / ".claude" / "skills" / "skill-b").exists()
286
+
189
287
 
190
288
  class TestListCommand:
191
289
  def test_list_empty(self, runner, isolated_env):
@@ -87,6 +87,63 @@ class TestParseSource:
87
87
  assert parsed.repo == "repo"
88
88
 
89
89
 
90
+ class TestNormalizeSourceForMatch:
91
+ """Source normalization for --from-source matching."""
92
+
93
+ def test_full_github_url(self):
94
+ """Full URLs are normalized by stripping scheme."""
95
+ from napoln.core.resolver import normalize_source_for_match
96
+
97
+ assert (
98
+ normalize_source_for_match("https://github.com/raiderrobert/flow")
99
+ == "github.com/raiderrobert/flow"
100
+ )
101
+
102
+ def test_github_url_with_git_suffix(self):
103
+ """URLs with .git suffix are normalized."""
104
+ from napoln.core.resolver import normalize_source_for_match
105
+
106
+ assert (
107
+ normalize_source_for_match("https://github.com/raiderrobert/flow.git")
108
+ == "github.com/raiderrobert/flow"
109
+ )
110
+
111
+ def test_git_shorthand(self):
112
+ """GitHub shorthand is normalized to full host/path form."""
113
+ from napoln.core.resolver import normalize_source_for_match
114
+
115
+ assert normalize_source_for_match("raiderrobert/flow") == "github.com/raiderrobert/flow"
116
+
117
+ def test_already_normalized(self):
118
+ """Already normalized sources pass through unchanged."""
119
+ from napoln.core.resolver import normalize_source_for_match
120
+
121
+ assert (
122
+ normalize_source_for_match("github.com/raiderrobert/flow")
123
+ == "github.com/raiderrobert/flow"
124
+ )
125
+
126
+ def test_local_path_unchanged(self):
127
+ """Local paths are not normalized."""
128
+ from napoln.core.resolver import normalize_source_for_match
129
+
130
+ assert normalize_source_for_match("/path/to/skill") == "/path/to/skill"
131
+
132
+ def test_http_url_stripped(self):
133
+ """HTTP URLs are normalized."""
134
+ from napoln.core.resolver import normalize_source_for_match
135
+
136
+ assert normalize_source_for_match("http://github.com/owner/repo") == "github.com/owner/repo"
137
+
138
+ def test_git_ssh_url(self):
139
+ """Git SSH URLs (git@host:owner/repo) are normalized."""
140
+ from napoln.core.resolver import normalize_source_for_match
141
+
142
+ assert (
143
+ normalize_source_for_match("git@github.com:owner/repo.git") == "github.com/owner/repo"
144
+ )
145
+
146
+
90
147
  class TestResolveLocal:
91
148
  """Local source resolution."""
92
149
 
@@ -400,7 +400,7 @@ wheels = [
400
400
 
401
401
  [[package]]
402
402
  name = "napoln"
403
- version = "0.2.4"
403
+ version = "0.2.5"
404
404
  source = { editable = "." }
405
405
  dependencies = [
406
406
  { name = "httpx" },
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.2.5"
3
- }
@@ -1,72 +0,0 @@
1
- """napoln remove — Remove an installed skill."""
2
-
3
- from __future__ import annotations
4
-
5
- import shutil
6
- from pathlib import Path
7
-
8
- from napoln import output
9
- from napoln.core import manifest
10
-
11
-
12
- def _get_napoln_home() -> Path:
13
- import os
14
-
15
- return Path(os.environ.get("NAPOLN_HOME", Path.home() / ".napoln"))
16
-
17
-
18
- def run_remove(
19
- name: str,
20
- agent_ids: list[str] | None = None,
21
- scope: str = "global",
22
- project_root: Path | None = None,
23
- dry_run: bool = False,
24
- ) -> int:
25
- """Execute the remove command.
26
-
27
- Returns:
28
- Exit code (0=success, 1=error).
29
- """
30
- napoln_home = _get_napoln_home()
31
- manifest_path = manifest.get_manifest_path(napoln_home, scope, project_root)
32
- mf = manifest.read_manifest(manifest_path)
33
-
34
- if name not in mf.skills:
35
- output.info(f"'{name}' is not installed.")
36
- return 0
37
-
38
- entry = mf.skills[name]
39
-
40
- if dry_run:
41
- output.dry_run_header()
42
-
43
- # Determine which agents to remove
44
- agents_to_remove = agent_ids if agent_ids else list(entry.agents.keys())
45
-
46
- for agent_id in agents_to_remove:
47
- if agent_id not in entry.agents:
48
- continue
49
-
50
- placement = entry.agents[agent_id]
51
- placement_path = Path(placement.path).expanduser()
52
-
53
- if dry_run:
54
- output.would(f"remove placement {placement_path}")
55
- else:
56
- if placement_path.exists():
57
- shutil.rmtree(placement_path)
58
- output.success(f"Removed placement: {placement_path}")
59
- else:
60
- output.dim(f" Placement already gone: {placement_path}")
61
-
62
- if dry_run:
63
- output.would("update manifest")
64
- output.dry_run_footer()
65
- return 0
66
-
67
- # Update manifest
68
- mf = manifest.remove_skill_from_manifest(mf, name, agent_ids)
69
- manifest.write_manifest(mf, manifest_path)
70
- output.success(f"Removed '{name}'")
71
-
72
- return 0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes