microduck-cli 0.7.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 (79) hide show
  1. microduck_cli-0.7.0/.claude/skills/agent-config/SKILL.md +82 -0
  2. microduck_cli-0.7.0/.claude/skills/agent-config/data/backend-fingerprints.yaml +30 -0
  3. microduck_cli-0.7.0/.claude/skills/agent-config/scripts/show.sh +136 -0
  4. microduck_cli-0.7.0/.claude/skills/ask-colleague/SKILL.md +237 -0
  5. microduck_cli-0.7.0/.claude/skills/ask-colleague/prompts/explore.md +35 -0
  6. microduck_cli-0.7.0/.claude/skills/ask-colleague/prompts/review.md +37 -0
  7. microduck_cli-0.7.0/.claude/skills/ask-colleague/prompts/write.md +21 -0
  8. microduck_cli-0.7.0/.claude/skills/ask-colleague/scripts/ask-colleague.sh +941 -0
  9. microduck_cli-0.7.0/.claude/skills/assign-to-workforce/SKILL.md +242 -0
  10. microduck_cli-0.7.0/.claude/skills/assign-to-workforce/scripts/assign-to-workforce.sh +212 -0
  11. microduck_cli-0.7.0/.claude/skills/challenge/SKILL.md +290 -0
  12. microduck_cli-0.7.0/.claude/skills/cicd/SKILL.md +208 -0
  13. microduck_cli-0.7.0/.claude/skills/cicd/scripts/_resolve-nick.sh +43 -0
  14. microduck_cli-0.7.0/.claude/skills/cicd/scripts/portability-lint.sh +57 -0
  15. microduck_cli-0.7.0/.claude/skills/cicd/scripts/pr-reply.sh +77 -0
  16. microduck_cli-0.7.0/.claude/skills/cicd/scripts/pr-status.sh +163 -0
  17. microduck_cli-0.7.0/.claude/skills/cicd/scripts/workflow.sh +157 -0
  18. microduck_cli-0.7.0/.claude/skills/communicate/SKILL.md +336 -0
  19. microduck_cli-0.7.0/.claude/skills/communicate/scripts/fetch-issues.sh +59 -0
  20. microduck_cli-0.7.0/.claude/skills/communicate/scripts/mesh-message.sh +74 -0
  21. microduck_cli-0.7.0/.claude/skills/communicate/scripts/post-comment.sh +65 -0
  22. microduck_cli-0.7.0/.claude/skills/communicate/scripts/post-issue.sh +71 -0
  23. microduck_cli-0.7.0/.claude/skills/communicate/scripts/templates/skill-new-brief.md +85 -0
  24. microduck_cli-0.7.0/.claude/skills/communicate/scripts/templates/skill-update-brief.md +101 -0
  25. microduck_cli-0.7.0/.claude/skills/deviate/SKILL.md +176 -0
  26. microduck_cli-0.7.0/.claude/skills/doc-test-alignment/SKILL.md +56 -0
  27. microduck_cli-0.7.0/.claude/skills/doc-test-alignment/scripts/check.sh +24 -0
  28. microduck_cli-0.7.0/.claude/skills/pypi-maintainer/SKILL.md +76 -0
  29. microduck_cli-0.7.0/.claude/skills/pypi-maintainer/scripts/switch-source.sh +102 -0
  30. microduck_cli-0.7.0/.claude/skills/recall/SKILL.md +181 -0
  31. microduck_cli-0.7.0/.claude/skills/recall/scripts/recall.sh +163 -0
  32. microduck_cli-0.7.0/.claude/skills/remember/SKILL.md +118 -0
  33. microduck_cli-0.7.0/.claude/skills/remember/scripts/remember.sh +164 -0
  34. microduck_cli-0.7.0/.claude/skills/run-tests/SKILL.md +51 -0
  35. microduck_cli-0.7.0/.claude/skills/run-tests/scripts/test.sh +52 -0
  36. microduck_cli-0.7.0/.claude/skills/scope/SKILL.md +167 -0
  37. microduck_cli-0.7.0/.claude/skills/sonarclaude/SKILL.md +85 -0
  38. microduck_cli-0.7.0/.claude/skills/sonarclaude/scripts/sonar.sh +263 -0
  39. microduck_cli-0.7.0/.claude/skills/spec-to-plan/SKILL.md +230 -0
  40. microduck_cli-0.7.0/.claude/skills/spec-to-plan/scripts/spec-to-plan.sh +102 -0
  41. microduck_cli-0.7.0/.claude/skills/summarize-delivery/SKILL.md +440 -0
  42. microduck_cli-0.7.0/.claude/skills/think/SKILL.md +201 -0
  43. microduck_cli-0.7.0/.claude/skills/think/scripts/think.sh +101 -0
  44. microduck_cli-0.7.0/.claude/skills/version-bump/SKILL.md +67 -0
  45. microduck_cli-0.7.0/.claude/skills/version-bump/scripts/bump.py +178 -0
  46. microduck_cli-0.7.0/.claude/skills.local.yaml.example +16 -0
  47. microduck_cli-0.7.0/.flake8 +7 -0
  48. microduck_cli-0.7.0/.github/workflows/publish.yml +88 -0
  49. microduck_cli-0.7.0/.github/workflows/tests.yml +131 -0
  50. microduck_cli-0.7.0/.gitignore +230 -0
  51. microduck_cli-0.7.0/.markdownlint-cli2.yaml +23 -0
  52. microduck_cli-0.7.0/AGENTS.colleague.md +11 -0
  53. microduck_cli-0.7.0/CHANGELOG.md +313 -0
  54. microduck_cli-0.7.0/CLAUDE.md +28 -0
  55. microduck_cli-0.7.0/LICENSE +201 -0
  56. microduck_cli-0.7.0/PKG-INFO +76 -0
  57. microduck_cli-0.7.0/README.md +59 -0
  58. microduck_cli-0.7.0/culture.yaml +4 -0
  59. microduck_cli-0.7.0/docs/skill-sources.md +191 -0
  60. microduck_cli-0.7.0/microduck_cli/__init__.py +13 -0
  61. microduck_cli-0.7.0/microduck_cli/__main__.py +10 -0
  62. microduck_cli-0.7.0/microduck_cli/cli/__init__.py +136 -0
  63. microduck_cli-0.7.0/microduck_cli/cli/_commands/__init__.py +1 -0
  64. microduck_cli-0.7.0/microduck_cli/cli/_commands/cli.py +43 -0
  65. microduck_cli-0.7.0/microduck_cli/cli/_commands/doctor.py +124 -0
  66. microduck_cli-0.7.0/microduck_cli/cli/_commands/explain.py +38 -0
  67. microduck_cli-0.7.0/microduck_cli/cli/_commands/learn.py +88 -0
  68. microduck_cli-0.7.0/microduck_cli/cli/_commands/overview.py +112 -0
  69. microduck_cli-0.7.0/microduck_cli/cli/_commands/whoami.py +106 -0
  70. microduck_cli-0.7.0/microduck_cli/cli/_errors.py +42 -0
  71. microduck_cli-0.7.0/microduck_cli/cli/_output.py +53 -0
  72. microduck_cli-0.7.0/microduck_cli/explain/__init__.py +24 -0
  73. microduck_cli-0.7.0/microduck_cli/explain/catalog.py +130 -0
  74. microduck_cli-0.7.0/pyproject.toml +75 -0
  75. microduck_cli-0.7.0/sonar-project.properties +24 -0
  76. microduck_cli-0.7.0/tests/__init__.py +0 -0
  77. microduck_cli-0.7.0/tests/test_cli.py +115 -0
  78. microduck_cli-0.7.0/tests/test_cli_introspection.py +106 -0
  79. microduck_cli-0.7.0/uv.lock +478 -0
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: agent-config
3
+ description: >
4
+ Show a Culture agent's full configuration in one read-only view: its
5
+ system-prompt file (CLAUDE.md / AGENTS.md / GEMINI.md), the parallel
6
+ culture.yaml, and the agent's local .claude/skills index. Use when an
7
+ operator says "show agent <name>", "what does <agent> look like", or before
8
+ teaching/onboarding an agent and you need to see its current kit + config.
9
+ Backs the `guild show` verb. Vendored from steward (cite-don't-import);
10
+ inventory only — it reports, it does not judge alignment or drift.
11
+ type: command
12
+ ---
13
+
14
+ # agent-config — surface a Culture agent's config in one view
15
+
16
+ guildmaster is the mesh's skills supplier and owns the **inventory** surfaces:
17
+ "what kit + config does this agent have?" This skill answers exactly that for a
18
+ single agent, showing the three artifacts that together define it:
19
+
20
+ 1. **System-prompt file** (`CLAUDE.md` / `AGENTS.md` / `GEMINI.md`) — the
21
+ prompt-side guidance for the agent's backend. The script detects which file
22
+ is present from a backend-fingerprint registry.
23
+ 2. **`culture.yaml`** — the runtime-side config (`agents:` list with `suffix`,
24
+ `backend`, `model`, `system_prompt`, `channels`, `tags`, `acp_command`,
25
+ `extras`). Lives parallel to the prompt file at the project root.
26
+ 3. **`.claude/skills/*/SKILL.md`** — the per-project skills the agent can
27
+ invoke, one line each (name + truncated description).
28
+
29
+ This is the **inventory half** of the steward → guildmaster split
30
+ ([issue #12](https://github.com/agentculture/guildmaster/issues/12)): it reports
31
+ the config, it does **not** interpret drift or judge alignment. The relationship
32
+ graph and the "is this agent aligned?" judgment stay with `steward overview` /
33
+ `steward doctor`.
34
+
35
+ ## When to use
36
+
37
+ - Before `guild teach` / `guild onboard` — see an agent's current kit + config.
38
+ - When an operator asks "show me agent `<name>`" or "what does `<agent>` run".
39
+ - Read it, don't guess — before answering a question about what an agent does.
40
+
41
+ ## How to run
42
+
43
+ One script, two ways to call it (or just run `guild show`, which wraps it):
44
+
45
+ ```bash
46
+ # Path mode — point at any directory with a prompt file + culture.yaml
47
+ .claude/skills/agent-config/scripts/show.sh ../culture
48
+
49
+ # Suffix mode — resolve a registered agent suffix via the Culture server's
50
+ # manifest (location set by culture_server_yaml in skills.local.yaml)
51
+ .claude/skills/agent-config/scripts/show.sh daria
52
+ ```
53
+
54
+ Output is three sections: the detected system-prompt file, `culture.yaml` (or
55
+ `(missing)`), and a one-line summary per local skill (name + description,
56
+ truncated to 120 chars).
57
+
58
+ ## What to look at in `culture.yaml`
59
+
60
+ | Field | Why it matters |
61
+ |-------|----------------|
62
+ | `suffix` | Identifies the agent on the mesh. |
63
+ | `backend` | One of `claude` / `codex` / `copilot` / `acp`. The all-backends rule means a feature in one must land in all four. |
64
+ | `model` | Drift here changes behavior silently. |
65
+ | `system_prompt` | Should not contradict the prompt file. |
66
+ | `channels` | Where the agent listens. |
67
+ | `tags`, `extras`, `acp_command` | Backend-specific. |
68
+
69
+ ## Notes
70
+
71
+ - **Read-only.** The script never edits agent files. It reports; it does not
72
+ flag or fix drift — that judgment is steward's lane.
73
+ - **Backend-aware.** Prompt-file detection comes from
74
+ `data/backend-fingerprints.yaml` (the `prompt:` mapping), falling back to the
75
+ built-in `(CLAUDE.md AGENTS.md GEMINI.md)` list if the registry is absent.
76
+ - **Per-machine config.** Suffix mode reads `culture_server_yaml` from
77
+ `.claude/skills.local.yaml` (git-ignored), falling back to
78
+ `.claude/skills.local.yaml.example`.
79
+ - **Vendored from steward** (`agent-config`). guildmaster owns this copy and may
80
+ diverge; re-sync from steward's canonical copy when it changes. Divergences:
81
+ the SKILL.md is reframed for guildmaster's inventory role and adds
82
+ `type: command` for the culture backend's skill loader.
@@ -0,0 +1,30 @@
1
+ # Canonical backend fingerprint registry. Vendored from steward's agent-config
2
+ # skill (cite-don't-import); guildmaster owns this copy. Read by the agent-config
3
+ # show.sh (bash), which `guild show` shells out to. Upstream steward also reads
4
+ # it from a Python detector; guildmaster has no parallel detector, so only the
5
+ # `backends:` prompt mapping below is load-bearing here. Keep that mapping in
6
+ # sync with upstream when re-syncing.
7
+ #
8
+ # `prompt` — the backend's system-prompt filename at the repo root.
9
+ # `steering` — files/dirs distinctive enough to attribute to this backend.
10
+ # `shared_steering` — files/dirs that belong to NO specific backend. A repo
11
+ # declared as any backend may have these without triggering a
12
+ # mismatch. `.agents` is a generic Culture agent-config
13
+ # convention. `.claude/settings.json` and
14
+ # `.claude/settings.local.json` are generic Claude Code
15
+ # (editor/CLI) workspace config files — they appear in any
16
+ # repo that uses Claude Code as the development tool,
17
+ # regardless of the agent backend, so they must never be used
18
+ # to infer the backend or flag a mismatch. The claude backend
19
+ # is identified solely by its `CLAUDE.md` prompt file.
20
+ # `.github/copilot-instructions.md` is generic GitHub Copilot
21
+ # editor/IDE config — any repo may have it regardless of the
22
+ # declared agent backend, so it must not trigger a mismatch.
23
+ backends:
24
+ claude: { prompt: CLAUDE.md, steering: [] }
25
+ codex: { prompt: AGENTS.md, steering: [".codex"] }
26
+ acp: { prompt: AGENTS.md, steering: [".kiro"] }
27
+ copilot: { prompt: AGENTS.md, steering: [] }
28
+ gemini: { prompt: GEMINI.md, steering: [".gemini"] }
29
+ shared_steering: [".agents", ".claude/settings.json", ".claude/settings.local.json", ".github/copilot-instructions.md"]
30
+ prompt_fallback: AGENTS.md
@@ -0,0 +1,136 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ # Show a Culture agent's full configuration in one view:
4
+ # the detected system-prompt file (CLAUDE.md / AGENTS.md / GEMINI.md), the
5
+ # parallel culture.yaml, and the .claude/skills/ index.
6
+ #
7
+ # Usage: show.sh <path-or-agent-suffix>
8
+ #
9
+ # Path mode: show.sh ../culture
10
+ # Suffix mode: show.sh daria (resolved via culture_server_yaml in skills.local.yaml)
11
+ #
12
+ # Exit codes:
13
+ # 0 success
14
+ # 1 environment error (missing manifest, missing PyYAML for suffix mode)
15
+ # 2 user error (no target given, unknown suffix, target path doesn't exist)
16
+
17
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
18
+ SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
19
+ REPO_ROOT="$(cd "$SKILL_DIR/../../.." && pwd)"
20
+
21
+ CFG="$REPO_ROOT/.claude/skills.local.yaml"
22
+ [ -f "$CFG" ] || CFG="$REPO_ROOT/.claude/skills.local.yaml.example"
23
+
24
+ # Read a top-level YAML scalar from CFG. Schema is intentionally tiny:
25
+ # key: value (with optional surrounding quotes / trailing comment)
26
+ # No PyYAML dependency.
27
+ read_cfg() {
28
+ awk -v key="$1" '
29
+ $0 ~ ("^" key ":[[:space:]]*") {
30
+ sub("^" key ":[[:space:]]*", "")
31
+ sub(/[[:space:]]*#.*$/, "")
32
+ sub(/^[[:space:]]+/, ""); sub(/[[:space:]]+$/, "")
33
+ sub(/^["\047]/, ""); sub(/["\047]$/, "")
34
+ print
35
+ exit
36
+ }
37
+ ' "$CFG"
38
+ }
39
+
40
+ target="${1:-}"
41
+ if [ -z "$target" ]; then
42
+ echo "Usage: $(basename "$0") <path-or-agent-suffix>" >&2
43
+ exit 2
44
+ fi
45
+
46
+ if [ -d "$target" ]; then
47
+ DIR="$target"
48
+ else
49
+ SERVER_YAML_RAW="$(read_cfg culture_server_yaml)"
50
+ SERVER_YAML="${SERVER_YAML_RAW/#\~/$HOME}"
51
+ if [ ! -f "$SERVER_YAML" ]; then
52
+ echo "no server manifest at $SERVER_YAML — set culture_server_yaml in $CFG" >&2
53
+ echo "or pass an explicit path instead of suffix '$target'" >&2
54
+ exit 1
55
+ fi
56
+ # Suffix mode parses Culture's server manifest, whose schema is dictated by
57
+ # Culture (not by us) and includes nested mappings — too rich for awk.
58
+ # We use python+PyYAML here, with a friendly install hint if it's missing.
59
+ if ! python3 -c 'import yaml' 2>/dev/null; then
60
+ echo "suffix mode needs Python + PyYAML to parse $SERVER_YAML" >&2
61
+ echo " install: pip install --user pyyaml (or: uv pip install pyyaml)" >&2
62
+ echo " or pass an explicit path instead of suffix '$target'" >&2
63
+ exit 1
64
+ fi
65
+ # Use a dedicated exit code (2) for "unknown suffix" so the steward CLI
66
+ # wrapper can distinguish user errors (typo'd suffix) from env errors
67
+ # (missing manifest / PyYAML).
68
+ if ! DIR=$(python3 - "$SERVER_YAML" "$target" <<'PY'
69
+ import sys, yaml, pathlib
70
+ manifest_path, suffix = sys.argv[1], sys.argv[2]
71
+ m = yaml.safe_load(pathlib.Path(manifest_path).read_text()) or {}
72
+ agents = m.get('agents', {})
73
+ entry = agents.get(suffix)
74
+ if entry is None:
75
+ print(f"no agent registered with suffix {suffix!r} in {manifest_path}", file=sys.stderr)
76
+ sys.exit(2)
77
+ print(entry['directory'] if isinstance(entry, dict) else entry)
78
+ PY
79
+ ); then
80
+ exit 2
81
+ fi
82
+ fi
83
+
84
+ DIR="${DIR/#\~/$HOME}"
85
+
86
+ # Recognized prompt filenames come from the shared registry (single source
87
+ # of truth with the Python detector). Fall back to the built-in list if the
88
+ # registry isn't present (e.g. skill vendored without the data file).
89
+ REGISTRY="$SKILL_DIR/data/backend-fingerprints.yaml"
90
+ prompt_files=()
91
+ if [ -f "$REGISTRY" ]; then
92
+ while IFS= read -r pf; do
93
+ [ -n "$pf" ] && prompt_files+=("$pf")
94
+ done < <(grep -oE 'prompt:[[:space:]]*[^,}[:space:]]+' "$REGISTRY" | awk '{print $NF}' | sort -u)
95
+ fi
96
+ [ ${#prompt_files[@]} -eq 0 ] && prompt_files=(CLAUDE.md AGENTS.md GEMINI.md)
97
+
98
+ shown=0
99
+ for pf in "${prompt_files[@]}"; do
100
+ if [ -f "$DIR/$pf" ]; then
101
+ echo "=== $DIR/$pf ==="
102
+ cat "$DIR/$pf"
103
+ echo
104
+ shown=1
105
+ fi
106
+ done
107
+ if [ "$shown" -eq 0 ]; then
108
+ echo "=== $DIR (system prompt) ==="
109
+ echo "(no recognized prompt file: ${prompt_files[*]})"
110
+ echo
111
+ fi
112
+ echo "=== $DIR/culture.yaml ==="
113
+ if [ -f "$DIR/culture.yaml" ]; then cat "$DIR/culture.yaml"; else echo "(missing)"; fi
114
+ echo
115
+ echo "=== $DIR/.claude/skills/ ==="
116
+ found=0
117
+ for s in "$DIR"/.claude/skills/*/SKILL.md; do
118
+ [ -f "$s" ] || continue
119
+ found=1
120
+ name=$(awk '/^name:/{print $2; exit}' "$s")
121
+ desc=$(awk '
122
+ /^description:/ {
123
+ sub(/^description:[[:space:]]*/, "")
124
+ buf = $0
125
+ flag = 1
126
+ next
127
+ }
128
+ flag && /^[a-z_-]+:/ { flag = 0 }
129
+ flag { buf = buf " " $0 }
130
+ END { gsub(/^[[:space:]]+|[[:space:]]+$/, "", buf); print buf }
131
+ ' "$s")
132
+ printf " %-30s %s\n" "$name" "${desc:0:120}"
133
+ done
134
+ if [ "$found" -eq 0 ]; then
135
+ echo " (no skills)"
136
+ fi
@@ -0,0 +1,237 @@
1
+ ---
2
+ name: ask-colleague
3
+ type: command
4
+ description: >
5
+ Ask colleague — a *different* backend/model than you (e.g. a local vLLM Qwen) —
6
+ to take a scoped repo task off your plate, then fold its answer back. The point
7
+ isn't a stronger model; it's a second, independent mind, and that diversity is
8
+ the value: `ask-colleague review` gets a candid second opinion on a diff,
9
+ `ask-colleague explore` gets a fresh read of an area, `ask-colleague write`
10
+ hands off a small implementation, `ask-colleague feedback` grades a finished
11
+ work item (the ROI loop), and `ask-colleague clean` reaps stale/corrupt
12
+ `colleague/*` branches a crashed run left behind (which can break `git fetch`).
13
+ Pilot a running work item with `monitor`/`guide`/`stop`.
14
+ Reach for it REFLEXIVELY, the way you'd lean over to the
15
+ teammate at the next desk — not only when asked: before you present or open a PR
16
+ on a non-trivial committed diff, run `review` for a diverse second opinion; for a
17
+ fresh read of an unfamiliar area whose answer is independent of your current
18
+ context, run `explore`. Both are read-only — isolated in a throwaway git
19
+ worktree, zero side effects to your tree/branch — so the reflex is always safe; the
20
+ side-effecting `write --apply` / `write --pr` still needs the user's go-ahead. Triggers when the
21
+ user says "ask colleague", "ask a colleague to review/explore/write this", "have
22
+ colleague take a look", "get a second opinion", "ask the other model", "rate that
23
+ work item", "clean up a crashed colleague run" — and still on the legacy "outsource this".
24
+ Colleague's output is a second opinion to verify and own, never authority.
25
+ ---
26
+
27
+ # ask-colleague — lean on colleague as a different mind
28
+
29
+ `ask-colleague` drives the **`colleague`** CLI so a Claude agent can hand a scoped
30
+ task to a *different* backend (default: a local vLLM `Qwen3.8-27B` on
31
+ `:8001`). Colleague's model is **not** assumed to be stronger than you — its
32
+ value is **diversity**. A second, independent mind catches things the author's
33
+ mind glides past, which is why **review** is the headline verb. Treat it the way
34
+ you'd turn to the colleague at the next desk: a quick, low-ceremony ask, not a
35
+ heavyweight handoff.
36
+
37
+ This skill is the operator: a portable wrapper that resolves the CLI and turns
38
+ each verb into a `colleague work`, then prints the work item's result summary.
39
+
40
+ ## The reflex — when to ask colleague *unprompted*
41
+
42
+ Don't wait to be told. The two read-only verbs have **zero side
43
+ effects** (throwaway worktree, can't touch your tree), so reaching for them is
44
+ always safe — make it a habit on tasks that fit:
45
+
46
+ **GO** (reach out on your own — default to the read-only verbs):
47
+
48
+ - **`review` — the standing reflex.** You (or a subagent) just produced a
49
+ non-trivial *committed* diff and are about to present it or open a PR. Get a
50
+ diverse second opinion *first*. A different mind catches what the author's mind
51
+ glides past — that's the whole point. A real review on a local model takes tens
52
+ of seconds to a few minutes (it reads the diff + touched files), so **kick it
53
+ off in the background and keep working** rather than blocking on it; fold the
54
+ findings in when it lands.
55
+ - **`explore`** — you need to understand an unfamiliar area whose answer is
56
+ **independent of your current context**, and you could be doing something else
57
+ meanwhile. Fan it out, fold the findings back.
58
+ - A scoped, **verifiable** subtask where a fresh pass raises your confidence and
59
+ you can cheaply check the result.
60
+
61
+ **NO-GO** (just do it yourself):
62
+
63
+ - Work that needs *your* accumulated context, the user's intent, or cross-cutting
64
+ design judgment — a context-free second mind will drift, not help.
65
+ - Anything **outward-facing or destructive** without a user nod: `write --apply` /
66
+ `write --pr`, posting, deleting. The read-only verbs are the unprompted reflex;
67
+ side-effecting ones are not.
68
+ - Trivial work that's faster to just do (a one-line edit) — the work item + fold-back
69
+ costs more than the edit.
70
+ - Output you can't verify cheaply — if you can't check it, diversity is just noise.
71
+
72
+ **Guardrails (always):**
73
+
74
+ - **One-glance readiness.** `colleague whoami` names the live work engine +
75
+ model; if it reports `mock` or you're unsure the server is up, run `colleague
76
+ doctor --probe`. Don't burn time on a dead or no-op backend.
77
+ - **Second opinion, not authority.** colleague is a *different* mind, not a
78
+ stronger one. Weigh its findings, verify its claims, own the decision. Diversity
79
+ is the value; verification is the price.
80
+ - **Close the loop.** Occasionally `ask-colleague feedback last --rating N` so the
81
+ ROI of asking colleague for this *kind* of task is measurable — and you learn
82
+ when to stop.
83
+
84
+ ## How to run
85
+
86
+ The entry point is `scripts/ask-colleague.sh`. Invoke it from the repo you want
87
+ colleague to work on:
88
+
89
+ ```bash
90
+ bash .claude/skills/ask-colleague/scripts/ask-colleague.sh <verb> "<text>" [options]
91
+ ```
92
+
93
+ It resolves the CLI portably — an installed `colleague` on `PATH` (the normal
94
+ case), falling back to `uv run colleague` when inside the colleague checkout,
95
+ else an install hint.
96
+
97
+ ### Verbs
98
+
99
+ | Verb | What it does | Side effects |
100
+ |------|--------------|--------------|
101
+ | `explore "<question or area>"` | Read-only investigation of the repo; the model reads and reports findings. | **None** to your working tree / branch — runs in a throwaway worktree at HEAD; writes only a gradable run artifact under the gitignored `.colleague/` bookkeeping dir. |
102
+ | `review "<what to focus on>" [--base main]` | A diverse second opinion on the **committed** diff (`<base>...HEAD`). | **None** to your working tree / branch — throwaway worktree, committed changes only; writes only a gradable run artifact under the gitignored `.colleague/` bookkeeping dir. |
103
+ | `write "<task>" [--apply\|--pr]` | Implement a change. **Previews by default** (throwaway worktree, prints the would-be diff); `--apply` lands a work branch in place; `--pr` pushes + opens a PR. | **None** to your working tree / branch by default (preview); a `colleague/<id>` work branch / PR only with `--apply` / `--pr`. |
104
+ | `plan "<task>"` | Colleague **PLANS** a complex task: it proposes a spec, then a split plan, then fans the waves out to a subagent-colleague workforce (`colleague plan run … --yes`). The *inverse of `/think`* — same arc, but colleague is the planning mind, not Claude. Needs a live backend. | Runs `colleague plan` in `--repo` (not a throwaway worktree): the workforce stage spawns isolated subagent worktrees and can land branches — treat like `write --apply` (gets a user nod). |
105
+ | `feedback <id\|last> [--rating N]` | **Grade a finished work item** (the ROI loop). With `--rating N` (1–5, plus `--notes`) it records feedback; without, it shows the work item's existing feedback. `last` resolves the most recent work item in `--repo`. | Writes `.colleague/<id>.feedback.json` only when `--rating` is given; read-only otherwise. |
106
+ | `resume <task-id\|last> [--detach]` | **Resume a cut run** — a timed-out / SIGTERM'd / budget-exhausted work item picked back up from its persisted artifact (`colleague work --continue`, lineage on `TaskResult.continued_from`). `last` resolves the most recent work item in `--repo`. `--detach` runs it under `setsid`/`nohup` and returns at once (not `--background`, which drops the continue id — colleague#418). | Continues the ORIGINAL run's `colleague/<id>` work branch; never touches your tree / branch. |
107
+ | `clean [--dry-run]` | **Reap what a crashed run left behind** (#162): stale/corrupt `colleague/*` branches + orphaned 0-byte `.colleague/` artifacts that can wedge `git fetch`. Scoped strictly to `colleague/*` (never touches an unrelated branch); conservative with `.git/objects` (reports 0-byte loose objects + suggests `git prune`, never deletes them). A thin pass-through to `colleague clean`. | Deletes corrupt `colleague/<id>` refs + 0-byte `.colleague/` artifacts in `--repo`; `--dry-run` changes nothing. |
108
+
109
+ ### Options
110
+
111
+ | Option | Meaning |
112
+ |--------|---------|
113
+ | `--repo PATH` | Target repo (default: `.`). |
114
+ | `--base BRANCH` | Base for the `review` diff (default: `main`). |
115
+ | `--engine NAME` | Backend plugin (default: `$COLLEAGUE_ENGINE` or `vllm-openai`). |
116
+ | `--model NAME` | Model (default: `$COLLEAGUE_MODEL` or `unsloth/Qwen3.8-27B-NVFP4`). |
117
+ | `--base-url URL` | OpenAI base URL (default: `$COLLEAGUE_BASE_URL` or `http://localhost:8001/v1`). |
118
+ | `--role NAME` | Typed subagent role for the run (`explorer`, `reviewer`, `validator`, `planner`, `writer`). Since #416 a top-level `--role explorer` runs at thinking effort **`low`** (off selectable via `--effort off`); other top-level roles keep the acting seat's effort. |
119
+ | `--effort RUNG` | **Thinking effort for the acting seat** (#416): `off` \| `low` \| `medium` \| `high` \| `xhigh` \| `default`. Unset = colleague's own table (acting seat `medium`). `off` sends `enable_thinking:false` — the measured win for small, well-specified briefs (same brief: off 24 s / xhigh 88 s / medium 129 s, all correct — `docs/evidence/2026-08-22-per-seat-thinking-effort-416-results.md`); `xhigh` for open-ended judgement; `default` = the kill-switch (send nothing, the pre-#416 wire). Exported as `COLLEAGUE_CORTEX_REASONING_EFFORT` + `COLLEAGUE_WORKER_REASONING_EFFORT`; validated before the run. |
120
+ | `--seat-effort S=R[,S=R]` | Per-seat override for the other seats (`cortex`, `worker`, `deepthink`, `senses`, `evaluator`, `design`) — e.g. `--seat-effort senses=off,deepthink=xhigh`. Exported as `COLLEAGUE_<SEAT>_REASONING_EFFORT`. Children keep their role table (writer/planner medium, reviewer/validator low, explorer off) unless the parent overrides per delegation. |
121
+ | `--detach` | (`resume`) run detached and return at once; pilot with `monitor` / `guide` / `stop` once the log names the new flight id. |
122
+ | `--max-steps N` | Loop step budget (default: 20). `explore`/`review` select colleague's own native **`explore`**/**`review`** mode profile (`colleague/profiles.py`, applied via `colleague work --mode`) instead of a wrapper-side override — today that profile defaults to 30, since read-only mapping fans out across more files. An explicit `--max-steps N` always overrides the profile's default, in either direction. If the resolved `colleague` predates `--mode` (a stale install on `PATH`), the wrapper falls back to the old caller-side `--max-steps 30` + reserved-steps behavior so it keeps working. |
123
+ | `--apply` | (`write`) apply the change in place (work branch) instead of previewing. |
124
+ | `--allow-dirty` | (`write`) allow running on a dirty tree (only matters with `--apply` / `--pr`). |
125
+ | `--pr` | (`write`) push + open a PR instead of a local work branch (implies `--apply`). |
126
+ | `--rating N` | (`feedback`) record a 1–5 quality rating for the work item. |
127
+ | `--notes "..."` | (`feedback`) free-text notes stored with the rating. |
128
+ | `--by NAME` | (`feedback`) who is grading (default: colleague's resolved identity). |
129
+ | `--dry-run` | (`clean`) report what would be reaped without changing anything. |
130
+ | `--json` | (any verb) machine-readable output: stdout carries **only** the result JSON, every diagnostic/digest line goes to stderr. |
131
+
132
+ The result printed to stdout is the work item's `TaskResult.summary` (plus
133
+ `changed_files` / work branch for `write`), parsed from `colleague work
134
+ --json`. Per-step progress streams to stderr while it runs. Pass `--json` to get
135
+ the raw `TaskResult` on stdout instead of the human digest (the drive verbs emit
136
+ the normalized `TaskResult`; `feedback` / `clean` forward `--json` to colleague),
137
+ keeping stdout valid JSON for a machine consumer while diagnostics stay on stderr.
138
+
139
+ ## When to reach for which verb
140
+
141
+ - **review** — the standing use. You wrote (or an agent wrote) a change and you
142
+ want a candid, independent pass over the *committed* diff before you trust it.
143
+ Treat the output as a second opinion to weigh, not a verdict.
144
+ - **explore** — you want a fresh, unbiased read of an unfamiliar area ("how does
145
+ X work here?") without anchoring on your own assumptions.
146
+ - **write** — a small, well-scoped implementation you're happy to delegate. It
147
+ **previews by default** (runs in a throwaway worktree and prints the would-be
148
+ diff without touching your tree); pass `--apply` to land it on a
149
+ `colleague/<id>` work branch you can inspect, merge, or discard, or `--pr` to
150
+ open a PR.
151
+ - **feedback** — *after* colleague finishes a work item, close the loop: record how
152
+ good it was. Every work item's artifact already carries always-on **stats** (elapsed
153
+ time, tokens read/generated, tools used, bytes written, reasoning-vs-answer
154
+ sizes); `feedback` adds a 1–5 quality grade. Stats say what it *cost*, feedback
155
+ says how *good* it was — together they let you compute the **ROI of asking
156
+ colleague** and decide whether to ask again (and which backend). Grade the most
157
+ recent work item with `ask-colleague feedback last --rating 4 --notes "…"`.
158
+ - **clean** — recovery, not routine. A crashed / interrupted `write --apply` can
159
+ leave a dangling `colleague/<id>` branch pointing at half-written (0-byte)
160
+ objects that **breaks `git fetch` / `git pull`**. Run `ask-colleague clean`
161
+ (or `colleague clean`) to reap it — start with `--dry-run` to see what it would
162
+ remove. It only ever touches `colleague/*` refs and `.colleague/` artifacts.
163
+
164
+ ## Thinking effort and resuming (#416)
165
+
166
+ Colleague resolves a **per-seat thinking effort** where each seat is built,
167
+ never per turn — the acting seat defaults to `medium`, deepthink `xhigh`,
168
+ senses/Talker `off`, children by role (writer/planner `medium`,
169
+ reviewer/validator `low`, explorer `off`). The wrapper exposes the operator
170
+ overrides as `--effort` (acting seat) and `--seat-effort` (any seat); a typo
171
+ fails fast. Rule of thumb from the measurements: **`--effort off` for small,
172
+ well-specified briefs** (5× faster, same result), **leave the default for
173
+ ordinary work**, **`--effort xhigh` for open-ended judgement** (review of a
174
+ subtle diff, a plan). Effort does not rescue a module-sized brief — split the
175
+ request instead (#415).
176
+
177
+ A run cut by a timeout, SIGTERM or an exhausted budget is **resumable**:
178
+ `ask-colleague resume <task-id|last>` continues it from its artifact on the same
179
+ work branch; `--detach` keeps your shell free. Prefer resume over re-dispatch —
180
+ the continuation carries the prior steps and lineage.
181
+
182
+ ## Piloting a flight
183
+
184
+ Dispatch a drive with `--watch` (on `explore`, `review`, or `write`) to make the
185
+ work item watchable. While it runs you can:
186
+
187
+ - **`ask-colleague monitor <task-id>`** — watch the flight's live feed
188
+ - **`ask-colleague guide <task-id> "<message>"`** — send mid-flight guidance
189
+ - **`ask-colleague stop <task-id>`** — cooperatively ask the flight to stop
190
+
191
+ Control is applied at the running loop's next turn boundary, so guidance and
192
+ stop requests take effect on the next iteration rather than interrupting mid-step.
193
+
194
+ ## Hard rules (do not violate)
195
+
196
+ - **explore and review are read-only.** They run in a throwaway `git worktree`
197
+ at HEAD, so a stray write can't reach your working tree or branch; the prompts
198
+ also tell the model not to modify anything. Don't route a change-making task
199
+ through them — use `write`.
200
+ - **`write` previews by default; applying refuses a dirty tree.** A preview runs
201
+ in an isolated worktree and never touches your tree, so it is safe even when
202
+ dirty. `--apply` / `--pr` (the in-place path) refuses a dirty tree unless you
203
+ pass `--allow-dirty` — this guards the dirty-tree hazard: committing
204
+ *uncommitted* edits onto the work branch and leaving you there. Commit or
205
+ stash first before applying. `--allow-dirty` is propagated to the runtime,
206
+ which since colleague#149 enforces the same guard directly (a bare
207
+ `colleague work`/`drive` also refuses uncommitted *tracked* changes).
208
+ - **Colleague's output is a second opinion, not authority.** The backend may be a
209
+ smaller/different model; weigh its findings, verify its claims, and own the
210
+ decision yourself.
211
+
212
+ ## Honest limits
213
+
214
+ - Read-only is enforced by **worktree isolation + prompt constraint**, not a
215
+ sandbox — the loop always exposes `write_file`/`run_command`, so the model can
216
+ still run arbitrary *read-only* commands.
217
+ - `review` covers **committed** changes only (`<base>...HEAD`). To review
218
+ uncommitted work, commit it first.
219
+ - The default backend is whatever single model is running locally; a multi-model
220
+ fleet (different model per verb) is separate infrastructure.
221
+ - **Every verb writes bookkeeping under `.colleague/`** (run artifacts for
222
+ explore/review/write; feedback records; the `last_work` pointer) — none of it
223
+ in your tracked tree, but in a repo that does **not** already gitignore
224
+ `.colleague/` it shows up as untracked files. **Add `.colleague/` to your
225
+ `.gitignore`** (keep `!/.colleague/commands/` if you commit command templates).
226
+ - **A crashed run can wedge `git fetch`.** A `write --apply` interrupted
227
+ mid-commit can leave a dangling `colleague/<id>` branch + 0-byte artifacts;
228
+ `ask-colleague clean` recovers it. A SIGKILL/OOM *during* the commit can still
229
+ corrupt git objects (git/filesystem durability, not the skill's to guarantee)
230
+ — which is exactly what `clean` is for.
231
+
232
+ ## Provenance
233
+
234
+ This is a **first-party** colleague skill — colleague is its origin. See
235
+ `docs/skill-sources.md` for the consumer's per-repo skill ledger. The `cite,
236
+ don't import` policy holds: downstream repos copy it, they don't symlink or
237
+ depend on it.
@@ -0,0 +1,35 @@
1
+ You are a second, independent mind brought in for a fresh read of this repository.
2
+ You are NOT the original author — your value is a different perspective, not authority.
3
+
4
+ Investigate the following and report what you find:
5
+
6
+ $ARGUMENTS
7
+
8
+ Rules:
9
+ - This is READ-ONLY. Use read_file, list_dir, and read-only run_command only
10
+ (e.g. `git log`, `git grep`, `ls`, `rg`). Do NOT create, modify, or delete any
11
+ file, and do NOT run any command that changes state.
12
+ - Be concrete: cite file paths and line numbers; quote the key code you rely on.
13
+ - Surface what's surprising, risky, or unclear — not just a tidy summary.
14
+ - Search efficiently: don't repeat near-identical searches — once a search
15
+ points you at the relevant file, READ it instead of re-grepping for synonyms.
16
+ - You have a limited step budget, and a report that never calls `finish` returns
17
+ NOTHING — wasting the whole drive. The moment you have enough to write a useful
18
+ report (or you are within a few steps of the budget), STOP reading and call
19
+ `finish`. Err on the side of finishing early — a focused finding beats endless
20
+ reading.
21
+ - For a WIDE codebase map (many folders/modules), do NOT read every file in series
22
+ — that exhausts the step budget. Partition the surface by folder and delegate the
23
+ per-folder sub-surveys to the `subagents` tool (one child per folder/subtree, each
24
+ returning its findings), then synthesize their results into your report.
25
+ - NARRATE PROGRESS: with EVERY tool call, write one short line of plain text
26
+ first — what you just learned and what you are checking next. That line rides
27
+ the run's flight feed, so the operator can see where you are instead of a
28
+ silent turn. A long think with nothing written looks like a stall. If you are
29
+ within ~3 steps of the budget, STOP and write the answer-so-far (partial is
30
+ fine, mark it partial) rather than reading one more file.
31
+
32
+ When you are done, call finish with a structured findings report:
33
+ 1. What it is / how it works (with file:line references).
34
+ 2. Notable details, edge cases, or surprises.
35
+ 3. Open questions or risks worth a closer look.
@@ -0,0 +1,37 @@
1
+ You are an independent reviewer — a different mind from whoever wrote this change.
2
+ Your job is a candid second opinion, not a rubber stamp.
3
+
4
+ Focus the review on:
5
+
6
+ $ARGUMENTS
7
+
8
+ The diff for this change is ALREADY PROVIDED below the instructions (filtered +
9
+ capped). Read specific files only if you need more context.
10
+
11
+ Rules:
12
+ - READ-ONLY. Do NOT modify, create, or delete any file. Only read and run
13
+ read-only commands.
14
+ - Review by READING, not by executing. Reason about correctness from the diff
15
+ and the source — do NOT try to import, build, install, or run the project to
16
+ "verify" behavior. The checkout may not be installed, and chasing that burns
17
+ your whole step budget for nothing.
18
+ - Every command runs from the repository ROOT in a fresh shell, so `cd` has no
19
+ lasting effect and only wastes a step — never `cd`; use repo-relative paths
20
+ (`colleague/config.py`, not `/repo/...`).
21
+ - Be terse and prioritized — lead with what actually matters. Don't pad.
22
+ - Call out real problems; if it's genuinely fine, say so and say why.
23
+ - You have a limited step budget. A review that never calls `finish` returns
24
+ NOTHING and wastes the entire drive — so the moment you have enough to write a
25
+ useful review (or you are within a few steps of the budget), STOP reading and
26
+ call `finish`. Err on the side of finishing early.
27
+ - NARRATE PROGRESS: with EVERY tool call, write one short line of plain text
28
+ first — what you just learned and what you are checking next. That line rides
29
+ the run's flight feed, so the operator can see where you are instead of a
30
+ silent turn. A long think with nothing written looks like a stall. If you are
31
+ within ~3 steps of the budget, STOP and write the answer-so-far (partial is
32
+ fine, mark it partial) rather than reading one more file.
33
+
34
+ When you are done, call finish with a structured review:
35
+ 1. Correctness risks / likely bugs (with file:line).
36
+ 2. Design, clarity, or maintainability concerns.
37
+ 3. Concrete, actionable suggestions (ranked; most important first).
@@ -0,0 +1,21 @@
1
+ $ARGUMENTS
2
+
3
+ Implement the task above in this repository.
4
+
5
+ Rules:
6
+ - Make the SMALLEST change that correctly satisfies the task.
7
+ - Follow the repository's existing patterns, style, and conventions — read the
8
+ neighbouring files first so your change reads like the surrounding code.
9
+ - Keep edits lint-clean: respect the project's maximum line length and end every
10
+ text file with exactly one trailing newline.
11
+ - You may read, create, modify files, and run commands as needed.
12
+ - Don't widen the scope: do exactly what was asked, nothing more.
13
+ - NARRATE PROGRESS: with EVERY tool call, write one short line of plain text
14
+ first — what you just learned and what you are checking next. That line rides
15
+ the run's flight feed, so the operator can see where you are instead of a
16
+ silent turn. A long think with nothing written looks like a stall. If you are
17
+ within ~3 steps of the budget, STOP and write the answer-so-far (partial is
18
+ fine, mark it partial) rather than reading one more file.
19
+
20
+ When you are done, call finish with a short summary of exactly what you changed
21
+ and why.