coherence-cli 0.2.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 (70) hide show
  1. coherence_cli-0.2.0/.claude/skills/agent-config/SKILL.md +82 -0
  2. coherence_cli-0.2.0/.claude/skills/agent-config/data/backend-fingerprints.yaml +30 -0
  3. coherence_cli-0.2.0/.claude/skills/agent-config/scripts/show.sh +136 -0
  4. coherence_cli-0.2.0/.claude/skills/ask-colleague/SKILL.md +178 -0
  5. coherence_cli-0.2.0/.claude/skills/ask-colleague/prompts/explore.md +25 -0
  6. coherence_cli-0.2.0/.claude/skills/ask-colleague/prompts/review.md +36 -0
  7. coherence_cli-0.2.0/.claude/skills/ask-colleague/prompts/write.md +15 -0
  8. coherence_cli-0.2.0/.claude/skills/ask-colleague/scripts/ask-colleague.sh +509 -0
  9. coherence_cli-0.2.0/.claude/skills/assign-to-workforce/SKILL.md +242 -0
  10. coherence_cli-0.2.0/.claude/skills/assign-to-workforce/scripts/assign-to-workforce.sh +212 -0
  11. coherence_cli-0.2.0/.claude/skills/cicd/SKILL.md +208 -0
  12. coherence_cli-0.2.0/.claude/skills/cicd/scripts/_resolve-nick.sh +43 -0
  13. coherence_cli-0.2.0/.claude/skills/cicd/scripts/portability-lint.sh +57 -0
  14. coherence_cli-0.2.0/.claude/skills/cicd/scripts/pr-reply.sh +77 -0
  15. coherence_cli-0.2.0/.claude/skills/cicd/scripts/pr-status.sh +163 -0
  16. coherence_cli-0.2.0/.claude/skills/cicd/scripts/workflow.sh +157 -0
  17. coherence_cli-0.2.0/.claude/skills/communicate/SKILL.md +336 -0
  18. coherence_cli-0.2.0/.claude/skills/communicate/scripts/fetch-issues.sh +59 -0
  19. coherence_cli-0.2.0/.claude/skills/communicate/scripts/mesh-message.sh +74 -0
  20. coherence_cli-0.2.0/.claude/skills/communicate/scripts/post-comment.sh +65 -0
  21. coherence_cli-0.2.0/.claude/skills/communicate/scripts/post-issue.sh +71 -0
  22. coherence_cli-0.2.0/.claude/skills/communicate/scripts/templates/skill-new-brief.md +85 -0
  23. coherence_cli-0.2.0/.claude/skills/communicate/scripts/templates/skill-update-brief.md +101 -0
  24. coherence_cli-0.2.0/.claude/skills/doc-test-alignment/SKILL.md +56 -0
  25. coherence_cli-0.2.0/.claude/skills/doc-test-alignment/scripts/check.sh +24 -0
  26. coherence_cli-0.2.0/.claude/skills/pypi-maintainer/SKILL.md +76 -0
  27. coherence_cli-0.2.0/.claude/skills/pypi-maintainer/scripts/switch-source.sh +102 -0
  28. coherence_cli-0.2.0/.claude/skills/run-tests/SKILL.md +51 -0
  29. coherence_cli-0.2.0/.claude/skills/run-tests/scripts/test.sh +52 -0
  30. coherence_cli-0.2.0/.claude/skills/sonarclaude/SKILL.md +85 -0
  31. coherence_cli-0.2.0/.claude/skills/sonarclaude/scripts/sonar.sh +263 -0
  32. coherence_cli-0.2.0/.claude/skills/spec-to-plan/SKILL.md +230 -0
  33. coherence_cli-0.2.0/.claude/skills/spec-to-plan/scripts/spec-to-plan.sh +102 -0
  34. coherence_cli-0.2.0/.claude/skills/think/SKILL.md +201 -0
  35. coherence_cli-0.2.0/.claude/skills/think/scripts/think.sh +101 -0
  36. coherence_cli-0.2.0/.claude/skills/version-bump/SKILL.md +67 -0
  37. coherence_cli-0.2.0/.claude/skills/version-bump/scripts/bump.py +178 -0
  38. coherence_cli-0.2.0/.claude/skills.local.yaml.example +16 -0
  39. coherence_cli-0.2.0/.flake8 +7 -0
  40. coherence_cli-0.2.0/.github/workflows/publish.yml +88 -0
  41. coherence_cli-0.2.0/.github/workflows/tests.yml +131 -0
  42. coherence_cli-0.2.0/.gitignore +230 -0
  43. coherence_cli-0.2.0/.markdownlint-cli2.yaml +23 -0
  44. coherence_cli-0.2.0/CHANGELOG.md +122 -0
  45. coherence_cli-0.2.0/CLAUDE.md +28 -0
  46. coherence_cli-0.2.0/LICENSE +21 -0
  47. coherence_cli-0.2.0/PKG-INFO +75 -0
  48. coherence_cli-0.2.0/README.md +58 -0
  49. coherence_cli-0.2.0/coherence/__init__.py +13 -0
  50. coherence_cli-0.2.0/coherence/__main__.py +10 -0
  51. coherence_cli-0.2.0/coherence/cli/__init__.py +136 -0
  52. coherence_cli-0.2.0/coherence/cli/_commands/__init__.py +1 -0
  53. coherence_cli-0.2.0/coherence/cli/_commands/cli.py +43 -0
  54. coherence_cli-0.2.0/coherence/cli/_commands/doctor.py +122 -0
  55. coherence_cli-0.2.0/coherence/cli/_commands/explain.py +38 -0
  56. coherence_cli-0.2.0/coherence/cli/_commands/learn.py +88 -0
  57. coherence_cli-0.2.0/coherence/cli/_commands/overview.py +112 -0
  58. coherence_cli-0.2.0/coherence/cli/_commands/whoami.py +106 -0
  59. coherence_cli-0.2.0/coherence/cli/_errors.py +42 -0
  60. coherence_cli-0.2.0/coherence/cli/_output.py +53 -0
  61. coherence_cli-0.2.0/coherence/explain/__init__.py +24 -0
  62. coherence_cli-0.2.0/coherence/explain/catalog.py +129 -0
  63. coherence_cli-0.2.0/culture.yaml +3 -0
  64. coherence_cli-0.2.0/docs/skill-sources.md +122 -0
  65. coherence_cli-0.2.0/pyproject.toml +75 -0
  66. coherence_cli-0.2.0/sonar-project.properties +24 -0
  67. coherence_cli-0.2.0/tests/__init__.py +0 -0
  68. coherence_cli-0.2.0/tests/test_cli.py +115 -0
  69. coherence_cli-0.2.0/tests/test_cli_introspection.py +91 -0
  70. coherence_cli-0.2.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,178 @@
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, and `ask-colleague feedback` grades a finished
11
+ work item (the ROI loop). Reach for it REFLEXIVELY, the way you'd lean over to the
12
+ teammate at the next desk — not only when asked: before you present or open a PR
13
+ on a non-trivial committed diff, run `review` for a diverse second opinion; for a
14
+ fresh read of an unfamiliar area whose answer is independent of your current
15
+ context, run `explore`. Both are read-only — isolated in a throwaway git
16
+ worktree, zero side effects — so the reflex is always safe; the side-effecting
17
+ `write --apply` / `write --pr` still needs the user's go-ahead. Triggers when the
18
+ user says "ask colleague", "ask a colleague to review/explore/write this", "have
19
+ colleague take a look", "get a second opinion", "ask the other model", "rate that
20
+ work item" — and still on the legacy "outsource this". Colleague's output is a second
21
+ opinion to verify and own, never authority.
22
+ ---
23
+
24
+ # ask-colleague — lean on colleague as a different mind
25
+
26
+ `ask-colleague` drives the **`colleague`** CLI so a Claude agent can hand a scoped
27
+ task to a *different* backend (default: a local vLLM `Qwen3.6-27B` on
28
+ `:8001`). Colleague's model is **not** assumed to be stronger than you — its
29
+ value is **diversity**. A second, independent mind catches things the author's
30
+ mind glides past, which is why **review** is the headline verb. Treat it the way
31
+ you'd turn to the colleague at the next desk: a quick, low-ceremony ask, not a
32
+ heavyweight handoff.
33
+
34
+ This skill is the operator: a portable wrapper that resolves the CLI and turns
35
+ each verb into a `colleague work`, then prints the work item's result summary.
36
+
37
+ ## The reflex — when to ask colleague *unprompted*
38
+
39
+ Don't wait to be told. The two read-only verbs have **zero side
40
+ effects** (throwaway worktree, can't touch your tree), so reaching for them is
41
+ always safe — make it a habit on tasks that fit:
42
+
43
+ **GO** (reach out on your own — default to the read-only verbs):
44
+
45
+ - **`review` — the standing reflex.** You (or a subagent) just produced a
46
+ non-trivial *committed* diff and are about to present it or open a PR. Get a
47
+ diverse second opinion *first*. A different mind catches what the author's mind
48
+ glides past — that's the whole point. A real review on a local model takes tens
49
+ of seconds to a few minutes (it reads the diff + touched files), so **kick it
50
+ off in the background and keep working** rather than blocking on it; fold the
51
+ findings in when it lands.
52
+ - **`explore`** — you need to understand an unfamiliar area whose answer is
53
+ **independent of your current context**, and you could be doing something else
54
+ meanwhile. Fan it out, fold the findings back.
55
+ - A scoped, **verifiable** subtask where a fresh pass raises your confidence and
56
+ you can cheaply check the result.
57
+
58
+ **NO-GO** (just do it yourself):
59
+
60
+ - Work that needs *your* accumulated context, the user's intent, or cross-cutting
61
+ design judgment — a context-free second mind will drift, not help.
62
+ - Anything **outward-facing or destructive** without a user nod: `write --apply` /
63
+ `write --pr`, posting, deleting. The read-only verbs are the unprompted reflex;
64
+ side-effecting ones are not.
65
+ - Trivial work that's faster to just do (a one-line edit) — the work item + fold-back
66
+ costs more than the edit.
67
+ - Output you can't verify cheaply — if you can't check it, diversity is just noise.
68
+
69
+ **Guardrails (always):**
70
+
71
+ - **One-glance readiness.** `colleague whoami` names the live work engine +
72
+ model; if it reports `mock` or you're unsure the server is up, run `colleague
73
+ doctor --probe`. Don't burn time on a dead or no-op backend.
74
+ - **Second opinion, not authority.** colleague is a *different* mind, not a
75
+ stronger one. Weigh its findings, verify its claims, own the decision. Diversity
76
+ is the value; verification is the price.
77
+ - **Close the loop.** Occasionally `ask-colleague feedback last --rating N` so the
78
+ ROI of asking colleague for this *kind* of task is measurable — and you learn
79
+ when to stop.
80
+
81
+ ## How to run
82
+
83
+ The entry point is `scripts/ask-colleague.sh`. Invoke it from the repo you want
84
+ colleague to work on:
85
+
86
+ ```bash
87
+ bash .claude/skills/ask-colleague/scripts/ask-colleague.sh <verb> "<text>" [options]
88
+ ```
89
+
90
+ It resolves the CLI portably — an installed `colleague` on `PATH` (the normal
91
+ case), falling back to `uv run colleague` when inside the colleague checkout,
92
+ else an install hint.
93
+
94
+ ### Verbs
95
+
96
+ | Verb | What it does | Side effects |
97
+ |------|--------------|--------------|
98
+ | `explore "<question or area>"` | Read-only investigation of the repo; the model reads and reports findings. | **None** — runs in a throwaway worktree at HEAD. |
99
+ | `review "<what to focus on>" [--base main]` | A diverse second opinion on the **committed** diff (`<base>...HEAD`). | **None** — throwaway worktree; reviews committed changes only. |
100
+ | `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** by default (preview); a `colleague/<id>` work branch / PR only with `--apply` / `--pr`. |
101
+ | `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. |
102
+
103
+ ### Options
104
+
105
+ | Option | Meaning |
106
+ |--------|---------|
107
+ | `--repo PATH` | Target repo (default: `.`). |
108
+ | `--base BRANCH` | Base for the `review` diff (default: `main`). |
109
+ | `--engine NAME` | Backend plugin (default: `$COLLEAGUE_ENGINE` or `vllm-openai`). |
110
+ | `--model NAME` | Model (default: `$COLLEAGUE_MODEL` or `sakamakismile/Qwen3.6-27B-Text-NVFP4-MTP`). |
111
+ | `--base-url URL` | OpenAI base URL (default: `$COLLEAGUE_BASE_URL` or `http://localhost:8001/v1`). |
112
+ | `--max-steps N` | Loop step budget (default: 20). |
113
+ | `--apply` | (`write`) apply the change in place (work branch) instead of previewing. |
114
+ | `--allow-dirty` | (`write`) allow running on a dirty tree (only matters with `--apply` / `--pr`). |
115
+ | `--pr` | (`write`) push + open a PR instead of a local work branch (implies `--apply`). |
116
+ | `--rating N` | (`feedback`) record a 1–5 quality rating for the work item. |
117
+ | `--notes "..."` | (`feedback`) free-text notes stored with the rating. |
118
+ | `--by NAME` | (`feedback`) who is grading (default: colleague's resolved identity). |
119
+
120
+ The result printed to stdout is the work item's `TaskResult.summary` (plus
121
+ `changed_files` / work branch for `write`), parsed from `colleague work
122
+ --json`. Per-step progress streams to stderr while it runs.
123
+
124
+ ## When to reach for which verb
125
+
126
+ - **review** — the standing use. You wrote (or an agent wrote) a change and you
127
+ want a candid, independent pass over the *committed* diff before you trust it.
128
+ Treat the output as a second opinion to weigh, not a verdict.
129
+ - **explore** — you want a fresh, unbiased read of an unfamiliar area ("how does
130
+ X work here?") without anchoring on your own assumptions.
131
+ - **write** — a small, well-scoped implementation you're happy to delegate. It
132
+ **previews by default** (runs in a throwaway worktree and prints the would-be
133
+ diff without touching your tree); pass `--apply` to land it on a
134
+ `colleague/<id>` work branch you can inspect, merge, or discard, or `--pr` to
135
+ open a PR.
136
+ - **feedback** — *after* colleague finishes a work item, close the loop: record how
137
+ good it was. Every work item's artifact already carries always-on **stats** (elapsed
138
+ time, tokens read/generated, tools used, bytes written, reasoning-vs-answer
139
+ sizes); `feedback` adds a 1–5 quality grade. Stats say what it *cost*, feedback
140
+ says how *good* it was — together they let you compute the **ROI of asking
141
+ colleague** and decide whether to ask again (and which backend). Grade the most
142
+ recent work item with `ask-colleague feedback last --rating 4 --notes "…"`.
143
+
144
+ ## Hard rules (do not violate)
145
+
146
+ - **explore and review are read-only.** They run in a throwaway `git worktree`
147
+ at HEAD, so a stray write can't reach your working tree or branch; the prompts
148
+ also tell the model not to modify anything. Don't route a change-making task
149
+ through them — use `write`.
150
+ - **`write` previews by default; applying refuses a dirty tree.** A preview runs
151
+ in an isolated worktree and never touches your tree, so it is safe even when
152
+ dirty. `--apply` / `--pr` (the in-place path) refuses a dirty tree unless you
153
+ pass `--allow-dirty` — this guards the dirty-tree hazard: committing
154
+ *uncommitted* edits onto the work branch and leaving you there. Commit or
155
+ stash first before applying. `--allow-dirty` is propagated to the runtime,
156
+ which since colleague#149 enforces the same guard directly (a bare
157
+ `colleague work`/`drive` also refuses uncommitted *tracked* changes).
158
+ - **Colleague's output is a second opinion, not authority.** The backend may be a
159
+ smaller/different model; weigh its findings, verify its claims, and own the
160
+ decision yourself.
161
+
162
+ ## Honest limits
163
+
164
+ - Read-only is enforced by **worktree isolation + prompt constraint**, not a
165
+ sandbox — the loop always exposes `write_file`/`run_command`, so the model can
166
+ still run arbitrary *read-only* commands.
167
+ - `review` covers **committed** changes only (`<base>...HEAD`). To review
168
+ uncommitted work, commit it first.
169
+ - The default backend is whatever single model is running locally; a multi-model
170
+ fleet (different model per verb) is separate infrastructure.
171
+
172
+ ## Provenance
173
+
174
+ This is a **first-party** colleague skill — colleague is its origin. It is
175
+ the inverse of the other skills under `.claude/skills/`, which
176
+ coherence-cli vendors *from* guildmaster. See `docs/skill-sources.md`.
177
+ The `cite, don't import` policy holds: downstream repos copy it, they don't
178
+ symlink or depend on it.
@@ -0,0 +1,25 @@
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
+
22
+ When you are done, call finish with a structured findings report:
23
+ 1. What it is / how it works (with file:line references).
24
+ 2. Notable details, edge cases, or surprises.
25
+ 3. Open questions or risks worth a closer look.
@@ -0,0 +1,36 @@
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 change under review is the committed diff on this branch versus its base
9
+ (`$BASE`). Start by running, read-only:
10
+
11
+ git diff $BASE...HEAD --stat
12
+ git diff $BASE...HEAD
13
+
14
+ then read the touched files for the context you need.
15
+
16
+ Rules:
17
+ - READ-ONLY. Do NOT modify, create, or delete any file. Only read and run
18
+ read-only commands.
19
+ - Review by READING, not by executing. Reason about correctness from the diff
20
+ and the source — do NOT try to import, build, install, or run the project to
21
+ "verify" behavior. The checkout may not be installed, and chasing that burns
22
+ your whole step budget for nothing.
23
+ - Every command runs from the repository ROOT in a fresh shell, so `cd` has no
24
+ lasting effect and only wastes a step — never `cd`; use repo-relative paths
25
+ (`colleague/config.py`, not `/repo/...`).
26
+ - Be terse and prioritized — lead with what actually matters. Don't pad.
27
+ - Call out real problems; if it's genuinely fine, say so and say why.
28
+ - You have a limited step budget. A review that never calls `finish` returns
29
+ NOTHING and wastes the entire drive — so the moment you have enough to write a
30
+ useful review (or you are within a few steps of the budget), STOP reading and
31
+ call `finish`. Err on the side of finishing early.
32
+
33
+ When you are done, call finish with a structured review:
34
+ 1. Correctness risks / likely bugs (with file:line).
35
+ 2. Design, clarity, or maintainability concerns.
36
+ 3. Concrete, actionable suggestions (ranked; most important first).
@@ -0,0 +1,15 @@
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
+
14
+ When you are done, call finish with a short summary of exactly what you changed
15
+ and why.