Skip to content

Commit 8ac8dde

Browse files
committed
feat(skills): document copilot workaround in --target=all output
Installing 3 skills to 4 target(s): - claude: /Users/gilbertwong/.claude/skills - codex: /Users/gilbertwong/.codex/skills - cursor: /Users/gilbertwong/.cursor/skills - pi: /Users/gilbertwong/.pi/agent/skills Installed: 0 Skipped: 12 (use --force to overwrite) Errors: 0 is documented to install 'to every known per-user target' (pi, claude, cursor, codex) but NOT copilot, because copilot is per-repo, not per-user (writes to <repo>/.github/ado-cli/, not ~/.copilot/...). Users who expected copilot in --target=all were confused. Now the output prints a one-liner when --target=all is used and copilot isn't in the target list, telling them how to install to copilot: Note: copilot installs per-repo (to <repo>/.github/ado-cli/). Run from inside your repo: ado skills install --target copilot Also updated the --target option's docstring to make copilot's per-repo nature more obvious in 'ado skills install --help'. + 1 new test (18 total skills tests, was 17). mix ci: 8/8 steps green. 314 tests pass.
1 parent b677684 commit 8ac8dde

3 files changed

Lines changed: 48 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Changed
1111

12+
- **`ado skills install --target=all` now prints a hint about copilot**:
13+
copilot is per-repo, not per-user, so it can't be included in
14+
`--target=all`. The output now notes this and tells the user
15+
how to install to copilot (`cd <repo> && ado skills install
16+
--target copilot`). Help text also clarifies copilot's
17+
per-repo nature.
1218
- **Code style cleanups addressing `mix ex_dna` and `mix reach`**
1319
warnings. Includes:
1420
* Extracted `confirm_delete/2` and `print_id_name_type_table/1`

lib/ado_cli/cli/skills.ex

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,17 @@ defmodule AdoCli.CLI.Skills do
103103
"Where to install: 'pi' (~/.pi/agent/skills/), " <>
104104
"'claude' (~/.claude/skills/), 'cursor' (~/.cursor/skills/), " <>
105105
"'codex' (~/.codex/skills/), " <>
106-
"'copilot' (requires --repo, writes to <repo>/.github/ado-cli/), " <>
107-
"or a custom absolute path. " <>
108-
"Default: 'all' (installs to every known per-user target)."
106+
"'copilot' (per-repo, requires --repo or cwd to be a git repo; " <>
107+
"writes to <repo>/.github/ado-cli/). " <>
108+
"Default: 'all' (installs to every per-user target above; " <>
109+
"copilot is NOT included because it needs a repo)."
109110
],
110111
repo: [
111112
type: :string,
112113
doc:
113-
"Path to a local git repository. Required when --target=copilot; " <>
114-
"default: current working directory. Ignored for other targets."
114+
"Path to a local git repository. Used by --target=copilot " <>
115+
"(writes to <repo>/.github/ado-cli/); default: current " <>
116+
"working directory. Ignored for other targets."
115117
],
116118
skill: [
117119
type: :string,
@@ -441,6 +443,17 @@ defmodule AdoCli.CLI.Skills do
441443
writeln(" - #{name}: #{path}")
442444
end)
443445

446+
# Copilot is intentionally not in --target=all because it
447+
# installs per-repository (to <repo>/.github/ado-cli/), not
448+
# per-user. When --target=all is the default and the user
449+
# didn't explicitly ask for copilot, print a one-liner
450+
# telling them how to install to it.
451+
if Enum.all?(target_dirs, fn {name, _} -> name != "copilot" end) do
452+
writeln("")
453+
writeln(" Note: copilot installs per-repo (to <repo>/.github/ado-cli/).")
454+
writeln(" Run from inside your repo: ado skills install --target copilot")
455+
end
456+
444457
writeln("")
445458

446459
summarize_install_results(results)

test/ado_cli/cli/skills_test.exs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,30 @@ name: ado-cli")
309309
target_names = decoded["result"]["targets"] |> Enum.map(& &1["name"]) |> Enum.sort()
310310
assert target_names == ["claude", "codex", "cursor", "pi"]
311311
end
312+
313+
test "--target=all output mentions copilot workaround (it's per-repo, not in 'all')", %{
314+
repo_dir: _repo_dir
315+
} do
316+
Skills.install_skills(%{
317+
options: %{target: "all", force: false, json: false, skill: nil},
318+
arguments: %{}
319+
})
320+
321+
# Drain the writeln/info messages until we find the one that
322+
# mentions copilot. The print order is: blank line, header,
323+
# target list, copilot hint, blank line, summary.
324+
hint = drain_info_until(fn m -> m =~ "ado skills install" end)
325+
assert hint =~ "copilot"
326+
end
327+
end
328+
329+
# Recursively pull :cli_mate_shell :info messages off the test
330+
# process mailbox and return the first one that matches the
331+
# given predicate. Asserts (and thus fails the test) if the
332+
# mailbox is exhausted before a match.
333+
defp drain_info_until(predicate) do
334+
assert_receive {:cli_mate_shell, :info, msg}, 1000
335+
if predicate.(msg), do: msg, else: drain_info_until(predicate)
312336
end
313337

314338
describe "install_skills/1 with --target codex" do

0 commit comments

Comments
 (0)