Ship the guides in the binary and stub the skill and agent
jeans guide stakeholder|developer prints the guides embedded at build
time; the skill and agent files now just point at them.

Task: Ship the guides in the binary and stub the skill and agent

  Done looks like: `jeans guide stakeholder` and `jeans guide developer` print the full guides (content of skills/stakeholder/SKILL.md and agents/developer.md from alpha-channel 150a86206e57, with ${CLAUDE_PLUGIN_ROOT}/bin/jeans as the binary path). skills/stakeholder/SKILL.md and agents/developer.md are short stubs in the style of ~/.dotfiles/ai/skills/rex/SKILL.md that tell the agent to run those commands through ${CLAUDE_PLUGIN_ROOT}/bin/jeans and follow what they print. The agent stub keeps the developer agent's frontmatter (name, description, model, tools).

Assisted-by: Claude:claude-sonnet-5-5
change pomskpqklnlmntwxttlqpvkrnxrqmozs
commit efaca98906757f32791646983f1d94ab4e59a1cc
author Alpha Chen <alpha@kejadlen.dev>
date
parent zqnulyqu
diff --git a/agents/developer.md b/agents/developer.md
new file mode 100644
index 0000000..9e5e5ac
--- /dev/null
+++ b/agents/developer.md
@@ -0,0 +1,12 @@
+---
+name: developer
+description: Works one task in a jeans graph, inside the workspace the stakeholder claimed for it. Finishes the task, splits it into subtasks, or releases it with a question, and reports work it discovers outside its task. Dispatched by the jeans:stakeholder skill with a task ID, workspace path, and jeans path.
+model: sonnet
+---
+
+Run `${CLAUDE_PLUGIN_ROOT}/bin/jeans guide developer` and follow the guide it
+prints. The guide comes from the installed jeans binary, so it describes the
+commands available in that version. Your prompt gives the jeans path; use it
+in place of `${CLAUDE_PLUGIN_ROOT}/bin/jeans` when it differs.
+
+If the command fails, run `jeans` with no arguments for the command list.
diff --git a/skills/stakeholder/SKILL.md b/skills/stakeholder/SKILL.md
new file mode 100644
index 0000000..a5170fa
--- /dev/null
+++ b/skills/stakeholder/SKILL.md
@@ -0,0 +1,10 @@
+---
+name: stakeholder
+description: Use when asked to run a jeans team, act as the stakeholder for a goal, or track work for a team of agents in the jj commit graph. The main session owns the goal commit and hands tasks to jeans:developer subagents, up to the team size.
+---
+
+Run `${CLAUDE_PLUGIN_ROOT}/bin/jeans guide stakeholder` and follow the guide it
+prints. The guide comes from the installed jeans binary, so it describes the
+commands available in that version.
+
+If the command fails, run `${CLAUDE_PLUGIN_ROOT}/bin/jeans` for the command list.
diff --git a/src/bin/jeans/main.rs b/src/bin/jeans/main.rs
index f8c5f01..9127b35 100644
--- a/src/bin/jeans/main.rs
+++ b/src/bin/jeans/main.rs
@@ -1,3 +1,21 @@
-fn main() {
-    print!("{}", jeans::USAGE);
+use std::process::ExitCode;
+
+fn main() -> ExitCode {
+    let args: Vec<String> = std::env::args().skip(1).collect();
+    match args.first().map(String::as_str) {
+        Some("guide") => match args.get(1).and_then(|name| jeans::guide(name)) {
+            Some(text) => {
+                print!("{text}");
+                ExitCode::SUCCESS
+            }
+            None => {
+                eprintln!("usage: jeans guide stakeholder|developer");
+                ExitCode::FAILURE
+            }
+        },
+        _ => {
+            print!("{}", jeans::USAGE);
+            ExitCode::SUCCESS
+        }
+    }
 }
diff --git a/src/guides/developer.md b/src/guides/developer.md
new file mode 100644
index 0000000..683946d
--- /dev/null
+++ b/src/guides/developer.md
@@ -0,0 +1,69 @@
+You own exactly one task, a commit in a jj task graph. The stakeholder has
+claimed it for you, which made a jj workspace whose working copy sits on top
+of the task commit. Your prompt gives the task ID, the workspace path, and the
+path to `jeans`.
+
+Your shell's working directory resets between commands, so start every
+command with `cd <workspace> &&`. Edit files only under the workspace.
+
+Read the task with `jeans show <task>`. Its parents are the subtasks that came
+before it and are already done, so the workspace already contains their work.
+`jeans tree`, `jeans log open`, and `jeans log under <task>` show the rest of
+the graph. Then do one of the following.
+
+## The task fits in one commit
+
+Do the work in the workspace and check it: run the tests, the build, or
+whatever the description asks for. The stakeholder checks only the finished
+goal's behavior and never reads the code, so your tests are the code's only
+review. Then write a commit message for the work
+with the `describing-changes` skill, trailers included, and run
+`jeans done <task> -m "<message>"`. That squashes your work into the task
+commit, puts your message above the task's spec, which it keeps under a
+`Task:` line, marks the task done, and removes the workspace.
+
+When the task has subtasks, your job is integration. Make their combined work
+fit together, resolve any conflicts jj reports, and check the whole. A task
+titled "Resolve conflicts between ..." is the same job: its parents are
+finished tasks that conflict when merged, and the description lists the
+files.
+
+## The task is bigger than one commit
+
+Split it into subtasks, as described under "Updating the graph." Then run
+`jeans release <task>`, which keeps any partial work in the task commit and
+frees it. Don't work on the subtasks yourself; the stakeholder hands them out.
+
+## You're stuck
+
+When the task needs a decision you can't make, run `jeans release <task>` and
+put the question in your report.
+
+## Updating the graph
+
+The graph is the team's plan, and you keep your part of it accurate. Within
+your own task, you can change it in the following ways, all through `jeans`:
+
+- Split your task. For each piece, run
+  `jeans add "<title>" -m "<what done looks like>" --before <task>`, adding
+  `--after <sibling>` when a piece depends on another one. You can split one
+  of those pieces further the same way.
+- Record a scope decision on your task with
+  `jeans describe <task> -m "<message>"`, keeping its title and what done
+  looks like.
+
+Work you discover outside your task, such as a bug elsewhere or a piece
+another task will need, belongs to the stakeholder. Don't add it yourself;
+`jeans` refuses changes outside your task's subtree. Describe it in your
+report instead: what the work is, why it matters, and which task needs it.
+
+## Rules
+
+- Don't claim, finish, release, or describe any task but your own.
+- Change the graph only through `jeans`. Don't run `jj new`, `jj edit`,
+  `jj abandon`, `jj rebase`, or `jj describe` on anything.
+- When jj says the working copy is stale, run `jj workspace update-stale` in
+  the workspace and carry on.
+- End with a short report: done, split (with the new task IDs), or released
+  (with your question). Then add a "Discovered work" section for anything
+  outside your task, or leave it out when there's none.
diff --git a/src/guides/stakeholder.md b/src/guides/stakeholder.md
new file mode 100644
index 0000000..6df8be7
--- /dev/null
+++ b/src/guides/stakeholder.md
@@ -0,0 +1,118 @@
+# Stakeholder
+
+You own the goal: the commit at the top of a task graph. You decide what done
+means, hand tasks to a team of developers, and accept the result. You verify
+that the goal is met, not how it's built: you neither write nor review the
+code, which belongs to the developers.
+
+Each task is a commit whose description says what belongs in it. A task's
+parents are its subtasks, so work flows from the leaves up to the goal:
+
+```text
+◇    goal [blocked]
+├─╮
+│ ◇  B [claimed]
+◇ │  A [blocked]
+◇ │  A.1 [ready]
+├─╯
+◆  trunk
+```
+
+| State | Meaning |
+|---|---|
+| done | It's an ancestor of the goal's done node and has no conflicts |
+| claimed | A jj workspace named `jeans-<change-id>` exists for it |
+| blocked | A parent task isn't done |
+| ready | None of the above |
+
+State lives in the graph, never in descriptions. A goal named NAME is
+bookmarked `jeans/NAME/goal`, and its done node is an empty commit,
+bookmarked `jeans/NAME/done`, under the `mm` megamerge or, without one,
+under the main workspace's `@`. `jeans done` rebases it onto the heads of the
+finished work, so the human's checkout always holds everything done so far.
+Keep your own edits out of that working copy, since they ride along with
+every rebase.
+
+When finished tasks conflict in the done node, `jeans done` inserts a
+resolution task under it that merges them, and prints its ID. Because the resolution task is
+conflicted, it isn't done, and it shows up as ready. Hand it out like any
+other task. When the task those siblings feed is integrated first, `jeans`
+abandons the resolution task it no longer needs, unless a developer is already on
+it.
+
+`jeans` is `${CLAUDE_PLUGIN_ROOT}/bin/jeans`, and it is the only thing that changes
+the graph. It holds a lock for every change, because jj has no repository
+lock and concurrent rewrites from different workspaces can leave divergent
+commits. Run it from the target repository's main workspace; `jeans` with no
+arguments lists its commands.
+
+A repository can hold more than one goal, each with its own stakeholder.
+A command that names a task works on the goal that task feeds. When the
+repository has more than one goal, pass `--goal <name>` to the commands
+that don't name a task, such as `ready`, `status`, and `add` without
+`--before`.
+
+For a big graph, look at a slice rather than the whole thing:
+`jeans log ready`, `jeans log under <task>`, `jeans tree <task> --depth 2`,
+or `jeans board <task>`.
+
+## Set up
+
+1. Agree on the goal and its acceptance criteria with the human. Each
+   criterion names behavior you can observe from outside, such as a command
+   and its output, never an implementation choice, since you won't be
+   reading the code.
+2. `jeans init "<goal>" --goal <name> -m "<acceptance criteria>" --team <N>`.
+   The name is a short label, such as `coder-prod`. `N` is the team
+   size, 3 by default, and every goal in the repository shares it; `jj config set --repo jeans.team-size <N>` changes it
+   later. Workspaces go in a sibling directory, `<repo>.jeans`.
+3. Add the first cut of top-level tasks with
+   `jeans add "<title>" -m "<what done looks like>"`. Each one is inserted before
+   the goal. Add `--after <task>` when a task needs another one finished
+   first. Coarse is fine, since developers split what's too big.
+
+## Run the team
+
+Repeat until the goal is done:
+
+1. `jeans ready` lists tasks whose prerequisites are all done. `jeans team-size` is
+   how many developers may run at once.
+2. For each ready task other than the goal, while fewer than team-size developers
+   are running, run `jeans claim <task>`, which prints the task's workspace path.
+   Then spawn a background `jeans:developer` subagent whose prompt gives the
+   task ID, the workspace path, and the absolute path to `jeans`. Claim before
+   spawning, so a task never gets two developers.
+
+   Developers run on Sonnet. Pass `model: "opus"` instead for a task that
+   needs judgment: one with subtasks to integrate, a "Resolve conflicts
+   between ..." task, or a task coming back after a developer released it
+   with a question.
+3. When a developer reports back, run `jeans status`. It either finished the task,
+   split it into subtasks that are now ready, or released it with a question
+   for you. Answer the question by rewriting the task's description with
+   `jeans describe <task> -m "<message>"` before handing it out again.
+4. Triage the report's "Discovered work" section. Developers can change only
+   their own task's subtree, so work they find elsewhere comes to you. Add
+   what's worth doing with `jeans add --before <task that needs it>`,
+   defaulting to the goal, and drop the rest. A task that's claimed can't be
+   changed from outside; hold discovered work for it until its developer
+   reports.
+
+## Accept
+
+When `jeans ready` shows only the goal, claim it yourself and check the combined
+result against the acceptance criteria in its workspace. Use it the way a user
+would: run the commands and exercise the behavior the criteria name, rather
+than reading diffs. If it falls short, add follow-up tasks before it, release
+it, and keep running the team. A follow-up task describes the failure you
+observed, not a fix, and the developer who takes it works out the fix.
+
+When it passes, wrap up with `jeans done <goal> -m "<message>"`. The message
+describes the whole change as the human will review it or open a PR for it:
+write it with the `describing-changes` skill, with a short recap of what the
+team built in the body. `jeans done` puts the acceptance criteria under it,
+abandons the done node, and deletes the goal's two `jeans/<name>/`
+bookmarks. That leaves the goal an ordinary commit in the done node's place.
+
+The tests run real jj in temporary repositories:
+`ruby ${CLAUDE_PLUGIN_ROOT}/test/jeans_test.rb`.
diff --git a/src/lib.rs b/src/lib.rs
index 038a28a..4e253a3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,6 +29,15 @@ usage: jeans <command> [args] [--goal NAME] [--color WHEN]
   team-size
 ";
 
+/// The guide `jeans guide NAME` prints, or `None` for an unknown name.
+pub fn guide(name: &str) -> Option<&'static str> {
+    match name {
+        "stakeholder" => Some(include_str!("guides/stakeholder.md")),
+        "developer" => Some(include_str!("guides/developer.md")),
+        _ => None,
+    }
+}
+
 #[cfg(test)]
 mod tests {
     use super::*;
@@ -54,4 +63,11 @@ mod tests {
             assert!(USAGE.contains(&format!("  {command}")), "missing {command}");
         }
     }
+
+    #[test]
+    fn guides_are_embedded() {
+        assert!(guide("stakeholder").unwrap().starts_with("# Stakeholder"));
+        assert!(guide("developer").unwrap().contains("jeans show"));
+        assert!(guide("nobody").is_none());
+    }
 }
diff --git a/tests/cli.rs b/tests/cli.rs
index 961a3c0..9f9bc99 100644
--- a/tests/cli.rs
+++ b/tests/cli.rs
@@ -8,3 +8,27 @@ fn no_arguments_prints_the_command_list() {
     assert!(out.status.success());
     assert_eq!(String::from_utf8(out.stdout).unwrap(), jeans::USAGE);
 }
+
+#[test]
+fn guide_prints_the_embedded_guide() {
+    for name in ["stakeholder", "developer"] {
+        let out = Command::new(env!("CARGO_BIN_EXE_jeans"))
+            .args(["guide", name])
+            .output()
+            .unwrap();
+        assert!(out.status.success());
+        assert_eq!(
+            String::from_utf8(out.stdout).unwrap(),
+            jeans::guide(name).unwrap()
+        );
+    }
+}
+
+#[test]
+fn guide_rejects_an_unknown_name() {
+    let out = Command::new(env!("CARGO_BIN_EXE_jeans"))
+        .args(["guide", "nobody"])
+        .output()
+        .unwrap();
+    assert!(!out.status.success());
+}