claude-dev-env 8.2.0 → 8.3.0

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 (54) hide show
  1. package/.agents/agents/poteto-agent.md +6 -0
  2. package/.agents/agents/test_agent_frontmatter.py +9 -9
  3. package/.agents/agents/test_pr_description_writer_style.py +1 -1
  4. package/.agents/agents-archived/ARCHIVE-MANIFEST.md +15 -0
  5. package/.agents/{agents → agents-archived}/code-quality-agent.md +1 -1
  6. package/.agents/{agents → agents-archived}/session-advisor.md +1 -1
  7. package/.agents/skills/_shared/end-of-run-gotcha-recommendations.md +2 -2
  8. package/.agents/skills/grok-spawn/SKILL.md +9 -6
  9. package/.agents/skills/grok-spawn/reference/flag-profiles.md +12 -8
  10. package/.agents/skills/issue-tracker/SKILL.md +2 -2
  11. package/.agents/skills/orchestrator/SKILL.md +16 -15
  12. package/.agents/skills/orchestrator-refresh/SKILL.md +2 -0
  13. package/.agents/skills/pull-request/SKILL.md +14 -5
  14. package/.agents/skills/pull-request/reference/publication-tasks.md +1 -1
  15. package/.agents/skills/team-advisor/SKILL.md +4 -4
  16. package/bin/install.agents-home.test.mjs +44 -94
  17. package/bin/install.mjs +31 -24
  18. package/bin/install.test.mjs +21 -0
  19. package/bin/resolve-package-managed-directory.test.mjs +1 -1
  20. package/bin/subagent-model-policy.test.mjs +15 -8
  21. package/docs/subagent-model-routing.md +6 -5
  22. package/hooks/blocking/tdd_enforcer.py +2 -3
  23. package/hooks/blocking/test_bash_post_call_dispatcher.py +7 -24
  24. package/hooks/hooks_constants/bash_post_call_dispatcher_constants.py +0 -3
  25. package/hooks/hooks_constants/hosted_hook_runner.py +1 -1
  26. package/hooks/hooks_constants/msys_path_conversion_advisor_constants.py +3 -35
  27. package/hooks/hooks_constants/test_bash_post_call_dispatcher_constants.py +2 -10
  28. package/hooks/routing/subagent_model_routing.mjs +15 -0
  29. package/hooks/routing/subagent_model_routing.test.mjs +58 -25
  30. package/package.json +1 -1
  31. package/rules/git-workflow.md +3 -3
  32. package/rules/shell-invocation.md +0 -2
  33. package/rules/subagent-model-policy.json +5 -13
  34. package/rules/testing.md +0 -2
  35. package/scripts/dev_env_scripts_constants/grok_worker_constants.py +3 -3
  36. package/scripts/grok_headless_runner.py +19 -1
  37. package/scripts/grok_worker_preflight.py +67 -1
  38. package/scripts/resolve_advisor_model_route.mjs +2 -2
  39. package/scripts/subagent_model_policy.mjs +4 -1
  40. package/scripts/test_grok_headless_runner.py +35 -1
  41. package/scripts/test_grok_worker_preflight.py +73 -0
  42. package/scripts/tests/resolve_advisor_model_route.test.mjs +3 -3
  43. package/scripts/tests/test_rules.py +5 -5
  44. package/hooks/advisory/msys_path_conversion_advisor.py +0 -200
  45. package/hooks/advisory/test_msys_path_conversion_advisor.py +0 -223
  46. package/hooks/hooks_constants/test_failure_recorder_constants.py +0 -34
  47. package/hooks/observability/test_failure_recorder.py +0 -221
  48. package/hooks/observability/test_test_failure_recorder.py +0 -173
  49. /package/.agents/{agents → agents-archived}/clean-coder.md +0 -0
  50. /package/.agents/{agents → agents-archived}/git-commit-crafter.md +0 -0
  51. /package/.agents/{agents → agents-archived}/issue-tracker.md +0 -0
  52. /package/.agents/{agents → agents-archived}/plan-packet-validator.md +0 -0
  53. /package/.agents/{agents → agents-archived}/pr-description-writer.md +0 -0
  54. /package/.agents/{agents → agents-archived}/skill-writer-agent.md +0 -0
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: poteto-agent
3
+ description: Use the installed pstack poteto-mode agent for delegated work.
4
+ ---
5
+
6
+ Read the installed pstack `poteto-mode/SKILL.md` in full before any work. Follow its instructions for this task.
@@ -81,7 +81,7 @@ import yaml
81
81
  ACCEPTED_FRONTMATTER_KEYS = frozenset({"name", "description", "tools", "color"})
82
82
  CODE_QUALITY_AGENT_FILENAME = "code-quality-agent.md"
83
83
  CODE_QUALITY_READ_ONLY_TOOLS = ("Read", "Grep", "Glob")
84
- INSTRUCTION_ALIAS_FILENAMES = frozenset({"AGENTS.md", "CLAUDE.md"})
84
+ INSTRUCTION_ALIAS_FILENAMES = frozenset({"AGENTS.md", "CLAUDE.md", "ARCHIVE-MANIFEST.md"})
85
85
  FRONTMATTER_FENCE_LINE = "---"
86
86
  MATERIALIZER_MODULE_NAME = "codex_compat_materializer"
87
87
  MATERIALIZER_MODULE_PATH = (
@@ -124,7 +124,7 @@ def _agent_definition_candidate_paths() -> tuple[Path, ...]:
124
124
  Returns:
125
125
  Every agent-definition `*.md` path in this directory, sorted.
126
126
  """
127
- agents_directory = Path(__file__).parent
127
+ agents_directory = Path(__file__).parent.parent / "agents-archived"
128
128
  return tuple(
129
129
  each_markdown_file
130
130
  for each_markdown_file in sorted(agents_directory.glob("*.md"))
@@ -298,7 +298,7 @@ def test_agent_frontmatter_loads_as_a_yaml_mapping(
298
298
  )
299
299
  def named_agents_yaml_safe_load_as_mapping(agent_file_name: str) -> None:
300
300
  """P-107 regression: named agents remain real YAML mappings under safe_load."""
301
- agent_definition_path = Path(__file__).parent / agent_file_name
301
+ agent_definition_path = Path(__file__).parent.parent / "agents-archived" / agent_file_name
302
302
  assert agent_definition_path.is_file(), (
303
303
  f"{agent_file_name} missing from agents/ — P-107 surface gone"
304
304
  )
@@ -419,7 +419,7 @@ def test_agent_frontmatter_carries_no_model_key(
419
419
 
420
420
 
421
421
  def _clean_coder_body() -> str:
422
- return (Path(__file__).parent / "clean-coder.md").read_text(encoding="utf-8")
422
+ return (Path(__file__).parent.parent / "agents-archived" / "clean-coder.md").read_text(encoding="utf-8")
423
423
 
424
424
 
425
425
  SOURCE_LINK_PATTERN = re.compile(
@@ -602,7 +602,7 @@ EXPECTED_SOURCE_LINK_PAIRS = {
602
602
 
603
603
 
604
604
  def _assert_source_link_contract(agent_file_name: str, agent_text: str) -> None:
605
- agents_directory = Path(__file__).parent
605
+ agents_directory = Path(__file__).parent.parent / "agents-archived"
606
606
  repository_root = agents_directory.parents[3]
607
607
  actual_source_links = frozenset(SOURCE_LINK_PATTERN.findall(agent_text))
608
608
  expected_source_links = EXPECTED_SOURCE_LINK_PAIRS[agent_file_name]
@@ -624,7 +624,7 @@ def _assert_source_link_contract(agent_file_name: str, agent_text: str) -> None:
624
624
 
625
625
 
626
626
  def test_named_agents_document_installed_paths_and_source_fallbacks() -> None:
627
- agents_directory = Path(__file__).parent
627
+ agents_directory = Path(__file__).parent.parent / "agents-archived"
628
628
  for each_agent_file_name in (
629
629
  "clean-coder.md",
630
630
  "code-quality-agent.md",
@@ -687,7 +687,7 @@ def test_source_link_contract_rejects_directory_fallback() -> None:
687
687
 
688
688
 
689
689
  def test_named_agents_resolve_active_managed_root_and_agents_home() -> None:
690
- agents_directory = Path(__file__).parent
690
+ agents_directory = Path(__file__).parent.parent / "agents-archived"
691
691
  for each_agent_file_name in (
692
692
  "clean-coder.md",
693
693
  "code-quality-agent.md",
@@ -906,14 +906,14 @@ def test_clean_coder_policy_targets_exist_in_source_package() -> None:
906
906
 
907
907
 
908
908
  def test_code_quality_agent_allows_only_read_and_search_tools() -> None:
909
- agent_definition_path = Path(__file__).parent / CODE_QUALITY_AGENT_FILENAME
909
+ agent_definition_path = Path(__file__).parent.parent / "agents-archived" / CODE_QUALITY_AGENT_FILENAME
910
910
  parsed_frontmatter = yaml.safe_load(_frontmatter_block(agent_definition_path))
911
911
 
912
912
  assert parsed_frontmatter["tools"] == list(CODE_QUALITY_READ_ONLY_TOOLS)
913
913
 
914
914
 
915
915
  def test_code_quality_agent_contract_forbids_mutating_commands() -> None:
916
- agent_definition_path = Path(__file__).parent / CODE_QUALITY_AGENT_FILENAME
916
+ agent_definition_path = Path(__file__).parent.parent / "agents-archived" / CODE_QUALITY_AGENT_FILENAME
917
917
  body = agent_definition_path.read_text(encoding="utf-8")
918
918
  assert "Use only `Read`, `Grep`, and `Glob`." in body
919
919
  assert "Author zero edits." in body
@@ -4,7 +4,7 @@ from pathlib import Path
4
4
 
5
5
 
6
6
  AGENT_DIRECTORY = Path(__file__).parent
7
- AGENT_PATH = AGENT_DIRECTORY / "pr-description-writer.md"
7
+ AGENT_PATH = AGENT_DIRECTORY.parent / "agents-archived" / "pr-description-writer.md"
8
8
  VOICE_REFERENCE_PATH = AGENT_DIRECTORY / "reference" / "pr-description-illustrative-voice.md"
9
9
  VERIFICATION_REFERENCE_PATH = AGENT_DIRECTORY / "reference" / "pr-description-verification.md"
10
10
 
@@ -0,0 +1,15 @@
1
+ # Archived agent definitions
2
+
3
+ These definitions are archived outside the package's active agent tree. Restore
4
+ one with the `git mv` command in its row, then restore the named caller and test edits.
5
+
6
+ | File | Reason | Restore |
7
+ |---|---|---|
8
+ | `clean-coder.md` | Personal coding workflow now routes through `pstack:poteto-agent` with task instructions in each call. | `git mv packages/claude-dev-env/.agents/agents-archived/clean-coder.md packages/claude-dev-env/.agents/agents/` and restore active caller references plus agent contract tests. |
9
+ | `code-quality-agent.md` | Personal review workflow now routes through `pstack:poteto-agent` with review instructions in each call. | `git mv packages/claude-dev-env/.agents/agents-archived/code-quality-agent.md packages/claude-dev-env/.agents/agents/` and restore active caller references plus agent contract tests. |
10
+ | `git-commit-crafter.md` | Personal commit drafting workflow is archived with the other package-owned agents. | `git mv packages/claude-dev-env/.agents/agents-archived/git-commit-crafter.md packages/claude-dev-env/.agents/agents/` and restore the model policy entry. |
11
+ | `issue-tracker.md` | Personal issue handling workflow now routes through `pstack:poteto-agent` loading the issue-tracker skill. | `git mv packages/claude-dev-env/.agents/agents-archived/issue-tracker.md packages/claude-dev-env/.agents/agents/` and restore active issue routing plus installer and contract tests. |
12
+ | `plan-packet-validator.md` | Personal plan validation workflow is archived with the other package-owned agents. | `git mv packages/claude-dev-env/.agents/agents-archived/plan-packet-validator.md packages/claude-dev-env/.agents/agents/` and restore the model policy entry. |
13
+ | `pr-description-writer.md` | Personal PR drafting workflow now routes through `pstack:poteto-agent` with diff-specific writing instructions. | `git mv packages/claude-dev-env/.agents/agents-archived/pr-description-writer.md packages/claude-dev-env/.agents/agents/` and restore active PR routing plus installer and contract tests. |
14
+ | `session-advisor.md` | Personal advisor workflow now routes through `pstack:poteto-agent` with the advisor response contract in the prompt. | `git mv packages/claude-dev-env/.agents/agents-archived/session-advisor.md packages/claude-dev-env/.agents/agents/` and restore advisor routing, resolver, and contract tests. |
15
+ | `skill-writer-agent.md` | Personal skill authoring workflow is archived with the other package-owned agents. | `git mv packages/claude-dev-env/.agents/agents-archived/skill-writer-agent.md packages/claude-dev-env/.agents/agents/` and restore the model policy entry. |
@@ -189,7 +189,7 @@ The second pass produces either:
189
189
  - new Shape A findings citing file:line references absent from the first pass, or
190
190
  - explicit Shape B `adversarial_probes` entries for each re-examined category.
191
191
 
192
- A second pass that returns "first pass was complete, confidence high" is inadequate per the audit contract — confidence is replaced by either new findings or new adversarial evidence per category.
192
+ A second pass that returns "first pass was complete, confidence high" is inadequate per the audit contract. Confidence must yield new findings or new adversarial evidence per category.
193
193
 
194
194
  ## Merging Primary and Adversarial Findings
195
195
 
@@ -5,7 +5,7 @@ tools: SendMessage
5
5
  color: cyan
6
6
  ---
7
7
 
8
- You are a standing reviewer a Claude Code session consults across the life of a task — not only when it is stuck, but before it commits to a plan, once it believes the work is finished, before any commit is executed, and when it is weighing whether to change course. Your only tool is SendMessage, used to reply to the sender of each consult by name. Everything else you know arrives in the consultation message: what changed since the last consult, the live decision or question, and any file paths or excerpts the session chose to include.
8
+ You are a standing reviewer a Claude Code session consults across the life of a task. The session consults you before it commits to a plan, once it believes the work is finished, before any commit is executed, and when it weighs whether to change course. Your only tool is SendMessage, which replies to the sender of each consult by name. Everything else you know arrives in the consultation message: what changed since the last consult, the live decision or question, and any file paths or excerpts the session chose to include.
9
9
 
10
10
  Many different consumers may reach you over one shared transcript — a coordinating session and the executor subagents it spawns, not just the single session that spawned you. Three things follow from that:
11
11
 
@@ -29,7 +29,7 @@ Keep only items that **bit this run**:
29
29
 
30
30
  1. Show findings in chat; categorize as P0-P3.
31
31
  2. Then `AskUserQuestion`.
32
- 3. On confirm only, file via `issue-tracker`.
32
+ 3. On confirm only, ask `pstack:poteto-agent` to load `issue-tracker` and file the issue.
33
33
 
34
34
  ### Cold-reader frame
35
35
 
@@ -126,7 +126,7 @@ Only after the chat block.
126
126
 
127
127
  Detail and ASCII stay in chat.
128
128
 
129
- **On confirm:** file via `issue-tracker`.
129
+ **On confirm:** ask `pstack:poteto-agent` to load `issue-tracker` and file the issue.
130
130
 
131
131
  Cold-reader issue body.
132
132
 
@@ -16,7 +16,11 @@ the scripts and the brief templates; it holds no spawn logic of its own.
16
16
  - Workers never commit, push, or call `gh`. The calling session stages, verifies,
17
17
  commits, pushes, and posts to GitHub.
18
18
  - Grok has no `SendMessage` and no Claude Agent tool. Work that needs live
19
- teammate chat or Claude-only tools stays in this session or a Claude agent.
19
+ teammate chat stays in this session. Each Grok worker uses `poteto-agent`.
20
+ The runner resolves the user pstack plugin through the selected Claude
21
+ profile's `plugins/installed_plugins.json` and includes its poteto skill content and
22
+ its resolved path in the prompt. Each task states its role, permitted edits,
23
+ acceptance checks, and report contract.
20
24
  - Each worker gets its own `--leader-socket`. Sharing one socket across processes
21
25
  races and fails.
22
26
  - Preflight is a soft gate: a fallthrough reason means skip the fleet and use
@@ -39,7 +43,7 @@ Good fits:
39
43
  **Do not use** when the work needs:
40
44
 
41
45
  - Live `SendMessage` coordination between agents
42
- - Claude-only tools (Agent tool, warm session-advisor, Claude MCP surfaces the
46
+ - Claude-only tools (Agent tool, warm advisor, Claude MCP surfaces the
43
47
  grok CLI does not load the same way)
44
48
 
45
49
  For a single interactive Grok Build handoff paste, use `/grokify` instead.
@@ -125,7 +129,7 @@ Shape:
125
129
  "tool_profile": "readonly",
126
130
  "timeout_seconds": 600,
127
131
  "is_repo_only": true,
128
- "agent_name": null
132
+ "agent_name": "poteto-agent"
129
133
  }
130
134
  ]
131
135
  }
@@ -133,7 +137,7 @@ Shape:
133
137
 
134
138
  | Field | Meaning |
135
139
  |---|---|
136
- | `role` | Preflight role whose agent files must be installed (default `bugteam`) |
140
+ | `role` | Preflight role configuration to check (default `bugteam`) |
137
141
  | `should_ping` | When true, preflight runs the opt-in live ping |
138
142
  | `workers` | Non-empty list of worker objects |
139
143
  | `role_name` | Label on the summary report for this worker |
@@ -142,7 +146,7 @@ Shape:
142
146
  | `tool_profile` | `readonly` or `build` |
143
147
  | `timeout_seconds` | Per-worker timeout (default 600, ceiling 5400). A spec asking for more is refused |
144
148
  | `is_repo_only` | Readonly only: when true, also pass `--disable-web-search` |
145
- | `agent_name` | Optional `--agent` name, or `null` |
149
+ | `agent_name` | Use `poteto-agent`; prompts carry the worker role. |
146
150
 
147
151
  Workers run with no turn cap. The timeout is the only bound on a worker's
148
152
  length, and a worker that hits it is killed with its whole process tree and
@@ -235,4 +239,3 @@ Sibling skill: `/grokify` for a single paste-ready interactive Grok Build handof
235
239
  ## Worker advisors
236
240
 
237
241
  Each grok worker binds a unique Opus-high dvisor_session_id through the lead-supplied dvisor.launcher in the batch spec (committed default is a placeholder). Reports require the same handle\'s ENDORSE (or bounded CORRECTION/PLAN then ENDORSE); STOP or malformed signals end as advisor_blocked.
238
-
@@ -109,15 +109,19 @@ The batch launcher applies this; you do not sleep in the skill.
109
109
  When `agent_name` is set, the runner passes `--agent <name>`. Grok loads the
110
110
  named agent charter from the **user-level** Claude config home (`~/.claude/`):
111
111
 
112
- - `agents/` — agent definition files (for example `code-quality-agent.md`,
113
- `clean-coder.md`)
112
+ - `agents/` contains `poteto-agent.md`.
114
113
  - `skills/`, `rules/`, `hooks/` — the rest of the installed Claude config the
115
114
  grok CLI reads for that run
116
115
 
117
- Preflight role `bugteam` checks that `code-quality-agent.md` and
118
- `clean-coder.md` exist under `~/.claude/agents/` and that the
119
- `claude-dev-env` install manifest is present. Install or reinstall
120
- `claude-dev-env` before a fleet that relies on those agents.
116
+ Preflight checks the installed `poteto-agent.md`, the poteto skill,
117
+ and the `claude-dev-env` install manifest. `CLAUDE_CONFIG_DIR` selects the
118
+ configuration root when set. The runner includes the complete skill content
119
+ and its resolved source path in each `poteto-agent` prompt. The task brief
120
+ states the worker's duty and write permissions. The user pstack entry in
121
+ `plugins/installed_plugins.json` selects the skill source. Companion paths stay
122
+ relative to that source. Without a user pstack entry, the shared
123
+ `skills/poteto-mode/SKILL.md` path is supported. Invalid metadata or an unreadable
124
+ selected source fails the gate, even when a shared copy exists.
121
125
 
122
126
  Pass `agent_name: null` (or omit the field) when the worker should run without
123
127
  a named agent charter.
@@ -130,5 +134,5 @@ a named agent charter.
130
134
  |---|---|---|---|
131
135
  | Map call sites in-repo only | `readonly` | `true` | `null` or an audit agent |
132
136
  | Research that may need the web | `readonly` | `false` | `null` |
133
- | Closed edit + tests | `build` | ignored | often `clean-coder` |
134
- | Audit-style read under a charter | `readonly` | as needed | `code-quality-agent` |
137
+ | Closed edit + tests | `build` | ignored | often `poteto-agent` |
138
+ | Audit-style read under a charter | `readonly` | as needed | `poteto-agent` |
@@ -15,9 +15,9 @@ argument-hint: "[issue action - file | update | close | refresh-epic | full hand
15
15
 
16
16
  **dedup -> do the work -> markers only -> numbers + URLs**
17
17
 
18
- Run every step the ask needs in one go (file, label, attach, refresh, and so on). The `issue-tracker` agent is the primary handler for one action per turn; this skill is the session path when the agent is unavailable or the ask spans several steps.
18
+ Run every step the ask needs in one go (file, label, attach, refresh, and so on). `pstack:poteto-agent` is the primary handler for one action per turn when it loads this skill; this skill is the session path when the agent is unavailable or the ask spans several steps.
19
19
 
20
- Prefer the **same warm** `issue-tracker` agent for follow-ups on the same issue or a related issue on the same epic. Spawn a new agent only for an unrelated work-stream or when the warm agent is gone.
20
+ Prefer the **same warm** `pstack:poteto-agent` for follow-ups on the same issue or a related issue on the same epic. Spawn a new agent only for an unrelated work-stream or when the warm agent is gone.
21
21
 
22
22
  ## Voice
23
23
 
@@ -24,7 +24,7 @@ than a solo frontier agent held to the same verification rigor, with
24
24
  84-98% of the team's input tokens billed at the worker rate.
25
25
 
26
26
  Under this skill the session is the orchestrator. It spawns and resumes
27
- executor subagents — `clean-coder` and the like — and those executors do
27
+ executor subagents through `pstack:poteto-agent`, and those executors do
28
28
  every bit of the execution: the code edits, the build runs, the test
29
29
  runs. The orchestrating session drives the plan, keeps the run artifacts
30
30
  and the ledger current, and answers executor consults. Hard questions
@@ -190,7 +190,7 @@ Return: status, artifact paths, blockers — nothing else.
190
190
  unit that fits one sentence plus pointers, has one mechanical
191
191
  done-check, and needs no mid-run clarification. A task that does not
192
192
  fit gets split in the plan — never padded into a longer prompt.
193
- Explore fan-outs run tiny; a `clean-coder` assignment can carry a
193
+ Explore fan-outs run tiny; a `pstack:poteto-agent` assignment can carry a
194
194
  whole scoped feature.
195
195
  - **Focused tickets are the house convention.** One mechanical done-check
196
196
  per ticket; thick context lives in the assignment file, not the ticket
@@ -204,10 +204,9 @@ Return: status, artifact paths, blockers — nothing else.
204
204
  - **Resume with a thin next-slice ticket.** A warm agent already holds
205
205
  the assignment's thick context, so its next ticket names only the next
206
206
  slice of work and the done-check — it does not restate the assignment.
207
- - **Do not restate what the agent definition carries.** The routing
208
- table picks the definition, and `clean-coder` already holds the code
209
- discipline. The ticket adds the task, the pointers, and the consult
210
- block only.
207
+ - **Keep the task brief specific.** The `pstack:poteto-agent` definition
208
+ carries poteto-mode style. The ticket adds the task, the pointers, the
209
+ task-specific instructions, and the consult block.
211
210
  - **The consult block is pasted, assembled text.** Assemble it at ticket
212
211
  write time from the parts in
213
212
  [`reference/executor-consult-block.md`](reference/executor-consult-block.md)
@@ -215,16 +214,15 @@ Return: status, artifact paths, blockers — nothing else.
215
214
 
216
215
  ## Workflow Agent Routing
217
216
 
218
- Every delegated task runs through a workflow-backed agent invocation. Do
219
- not spawn a flat subagent directly when a workflow invocation or
220
- workflow resume is available.
217
+ Every delegated task uses `pstack:poteto-agent` with a task-specific prompt.
218
+ Resume an existing agent when its context matches the task.
221
219
 
222
220
  | Work | Agent type | Model |
223
221
  |---|---|---|
224
- | Feature, bug, and refactor coding | `clean-coder` | `sonnet` on a Claude host; the sonnet-equivalent id the worker-model resolver prints on a third-party host |
225
- | Review and verification | `code-quality-agent` | `sonnet` on a Claude host; the sonnet-equivalent id the worker-model resolver prints on a third-party host |
226
- | Script runs, GitHub posting, and backfill driving | `general-purpose` runner | `sonnet` on a Claude host; the sonnet-equivalent id the worker-model resolver prints on a third-party host |
227
- | PR descriptions | `pr-description-writer` | `haiku`, with file-list grounding check |
222
+ | Feature, bug, and refactor coding | `pstack:poteto-agent` | `sonnet` on a Claude host; the sonnet-equivalent id the worker-model resolver prints on a third-party host |
223
+ | Review and verification | `pstack:poteto-agent` | `sonnet` on a Claude host; the sonnet-equivalent id the worker-model resolver prints on a third-party host |
224
+ | Script runs, GitHub posting, and backfill driving | `pstack:poteto-agent` with an execution brief | `sonnet` on a Claude host; the sonnet-equivalent id the worker-model resolver prints on a third-party host |
225
+ | PR descriptions | `pstack:poteto-agent` | `haiku`, with file-list grounding check |
228
226
  | Fan-out searches and checklist verification reads | `Explore` | `haiku`; use `sonnet` when judgment-heavy |
229
227
 
230
228
  Every row that edits code, runs a build, or runs a test is a coding row.
@@ -234,8 +232,8 @@ the worker model; the per-spawn `model:` field does.
234
232
 
235
233
  Routing rules:
236
234
 
237
- - Each row spawns workflow-backed with a ticket; the routing row and the
238
- ticket together carry the agent type, model, task, and return
235
+ - Each row spawns `pstack:poteto-agent` with a ticket; the routing row and
236
+ the ticket together carry the agent type, model, task, and return
239
237
  contract. A coding task category is never served by a different tier
240
238
  as a cost call — the table is the contract.
241
239
  - **Fail closed on a Claude host.** When `sonnet` cannot be spawned, use
@@ -255,6 +253,9 @@ Routing rules:
255
253
  detection system, with no second one.
256
254
  - Resume a warm workflow agent before creating a new workflow run when
257
255
  the warm agent holds the relevant context.
256
+ - When a native subagent spawn is the advisor path, set
257
+ `flags: ["--advisor"]` with the Astra model. This is the explicit hook
258
+ bypass for advisor work. Do not add the flag to worker spawns.
258
259
  - Review and verification workflows apply the [review guide](../e-code-review/SKILL.md).
259
260
  - PR-description workflows include the changed-file list in the
260
261
  prompt and verify the final body against that file list before posting
@@ -79,6 +79,8 @@ reports and adds nothing further.
79
79
  Claude host, or the resolver-printed sonnet-equivalent id on a
80
80
  third-party host, and fails closed — see Workflow Agent Routing in
81
81
  [`skills/orchestrator/SKILL.md`](../orchestrator/SKILL.md#workflow-agent-routing).
82
+ Advisor spawns use `flags: ["--advisor"]` only when they intentionally
83
+ select Astra.
82
84
  - **Focused tickets.** One mechanical done-check per ticket; resume a
83
85
  warm agent with a thin next-slice ticket rather than a fresh cold
84
86
  spawn, and keep thick context in the assignment file.
@@ -38,8 +38,9 @@ Use this skill for one pull request action:
38
38
  - Submit a pull request review.
39
39
  - Recover one selected legacy author record before the action.
40
40
 
41
- Send issue create, edit, and comment work to `issue-tracker`. Send review and
42
- fix-loop work to `e-code-review`. Send commits to `source-command-commit`.
41
+ Send issue create, edit, and comment work to `pstack:poteto-agent` with the
42
+ `issue-tracker` skill and one action. Send review and fix-loop work to
43
+ `e-code-review`. Send commits to `source-command-commit`.
43
44
 
44
45
  Require one repository and one action target. Stop before author lookup or
45
46
  network work when the repository, pull request, action, author, or required
@@ -73,9 +74,9 @@ current process environment.
73
74
 
74
75
  | Skill | When | Produces | If missing |
75
76
  |---|---|---|---|
76
- | `pr-description-writer` | Create or a full body rewrite, when you want the body drafted for you | A reviewed title and body file | Write the title and body yourself |
77
+ | `pstack:poteto-agent` with `pull-request` instructions | Create or a full body rewrite, when you want the body drafted for you | A reviewed title and body file | Write the title and body yourself |
77
78
  | `privacy-hygiene` | Before any durable GitHub post | A clean body and repository privacy sweep | Stop before publication and report the missing gate |
78
- | `issue-tracker` | Issue create, edit, or comment requests | Issue state and issue URLs | Route the request there. |
79
+ | `pstack:poteto-agent` with `issue-tracker` | Issue create, edit, or comment requests | Issue state and issue URLs | Load the skill in this session. |
79
80
  | `e-code-review` | Review or review/fix loop requests | Structured findings or a clean review result | Route the request there. |
80
81
  | `source-command-commit` | Commit or push requests | A verified commit or pushed branch | Route the request there. |
81
82
 
@@ -98,10 +99,15 @@ request target. Create actions publish drafts. Record the target before any writ
98
99
  ### 2. Author the title and body
99
100
 
100
101
  For create and full body rewrite, write the title and a body file, or invoke
101
- the installed `pr-description-writer` to draft them from the diff. A comment or
102
+ `pstack:poteto-agent` with the diff-specific writing instructions to draft
103
+ them. A comment or
102
104
  review may use a supplied body file when it does not rewrite the pull request
103
105
  description.
104
106
 
107
+ Check each behavior claim against the final diff and verification evidence.
108
+ Preserve whether a rule is added, removed, or narrowed, and distinguish tests
109
+ added from tests run. Refresh these claims after a rebase or correction.
110
+
105
111
  ### 3. Run the local linter
106
112
 
107
113
  Resolve the active managed root (`CLAUDE_CONFIG_DIR` when set, `~/.claude`
@@ -153,6 +159,9 @@ Confirm the pull request URL and number, title, body, head SHA, and draft state.
153
159
  For comments and reviews, confirm the new remote entry. Report artifact URLs
154
160
  without exposing author values.
155
161
 
162
+ Confirm the published claims still describe the verified head and preserve the
163
+ scope of its evidence, including whether checks used saved artifacts or a new run.
164
+
156
165
  ## Exit handling
157
166
 
158
167
  Stop before network work when authoring, local validation, privacy, or author
@@ -6,7 +6,7 @@ reason when the task is conditional. This file is a task seed catalog, not a
6
6
  markdown progress board.
7
7
 
8
8
  1. Resolve one repository, action, and selected author. For create, resolve the source branch, base, and head. For other actions, resolve one existing pull request target. Create actions publish drafts.
9
- 2. Record the title and body file for create or full body rewrite, written by you or drafted by `pr-description-writer`. Mark `N/A` for comment or review bodies that do not rewrite the pull request description.
9
+ 2. Record the title and body file for create or full body rewrite, written by you or drafted by `pstack:poteto-agent` with a PR-writing brief. Mark `N/A` for comment or review bodies that do not rewrite the pull request description.
10
10
  3. Validate every title, body, artifact, and local path input. Reject inline body input.
11
11
  4. Resolve the active managed root and run `<managed-root>/scripts/durable_post_lint.py` for the matching action. Record exit code `0` before credential lookup or network work.
12
12
  5. Run `privacy-hygiene` before the GitHub post and record its clean result.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: team-advisor
3
3
  description: >-
4
- Bind one advisor, the built-in advisor tool or a warm session-advisor, and
4
+ Bind one advisor, the built-in advisor tool or a warm `pstack:poteto-agent`, and
5
5
  consult it before substantive work, completion, commits, or when stuck.
6
6
  Triggers:
7
7
  'team-advisor', 'team advisor', 'second opinion', 'consult the advisor',
@@ -18,14 +18,14 @@ One warm advisor at the strongest tier this session can reach. This session is t
18
18
  |---|---|
19
19
  | [`docs/references/advisor-tool.md`](../../docs/references/advisor-tool.md) | **Consult cadence and weight.** When to call, the hard rule before first write, and how to treat advice. Read this for every consult. |
20
20
  | [`~/.claude/_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md) | **Bind and lifecycle.** Session identity, host detect, model floor, warm-up, CLI fallback. Its read map routes each moment to a `reference/` detail file. |
21
- | [`agents/session-advisor.md`](../../agents/session-advisor.md) | **Reply contract.** ENDORSE / CORRECTION / PLAN / STOP. SendMessage only. |
21
+ | Installed `poteto-mode` skill | **Reply contract.** The advisor prompt carries ENDORSE / CORRECTION / PLAN / STOP. |
22
22
  | [`reference/advisor-docs-review.md`](reference/advisor-docs-review.md) | Anthropic advisor-tool source facts: measured effects, Sonnet steering, cost levers, failure modes. Background. Read it when tuning the bind, not on every consult. |
23
23
 
24
24
  ## Bind
25
25
 
26
26
  1. Name the session identity first (protocol **Host profiles**), then walk the model floor.
27
- 2. Claude: when `advisor` is in this session's tool list, the built-in advisor tool is the advisor. Spawn nothing and call `advisor()` at each consult point. Otherwise spawn Fable in-session at `ADVISOR_EFFORT` (default low). When Fable is out of usage, bind Astra at the same effort. Codex: Astra in-session. Third-party: headless Fable then Astra. When the host's walk fails, fail closed.
28
- 3. Name: `team-advisor-agent` on Claude (Agent spawn of `session-advisor`); a native Astra subagent on Codex; one CLI `session_id` on a third-party host via the protocol Claude-chain or Astra helper.
27
+ 2. Claude: when `advisor` is in this session's tool list, the built-in advisor tool is the advisor. Spawn nothing and call `advisor()` at each consult point. Otherwise spawn or resume `pstack:poteto-agent` at `ADVISOR_EFFORT` (default low) with the advisor response contract in the prompt. When the bound model is out of usage, use the configured fallback at the same effort. Codex: use the native advisor path. Third-party: use the headless advisor path. When the host's walk fails, fail closed.
28
+ 3. Name the warm instance `team-advisor-agent` and keep its advisor response contract in every first prompt. When a native Codex subagent spawn is the advisor path, pass `flags: ["--advisor"]` with Astra.
29
29
  4. Skip the multi-consumer "who you are" opener. This session is the sole consumer.
30
30
  5. When the bind or reply path fails, fail closed and report to the user. On a third-party host, only the bound advisor issues ENDORSE / CORRECTION / PLAN / STOP.
31
31
 
@@ -12,6 +12,7 @@ import {
12
12
  mkdirSync,
13
13
  mkdtempSync,
14
14
  readFileSync,
15
+ readdirSync,
15
16
  realpathSync,
16
17
  rmSync,
17
18
  writeFileSync,
@@ -34,38 +35,8 @@ const SHIPPED_SKILL_NAME = 'privacy-hygiene';
34
35
  const ELI5_SKILL_NAME = 'eli5';
35
36
  const E_CODE_REVIEW_SKILL_NAME = 'e-code-review';
36
37
  const REFERENCE_DIRECTORY_NAME = 'reference';
37
- const SHIPPED_AGENT_FILE_NAME = 'clean-coder.md';
38
- const SHIPPED_AGENT_FILE_NAMES = [
39
- SHIPPED_AGENT_FILE_NAME,
40
- 'code-quality-agent.md',
41
- 'pr-description-writer.md',
42
- ];
43
- const CLEAN_CODER_POLICY_REFERENCES = [
44
- [
45
- '<managed-root>/docs/CODE_RULES.md',
46
- 'packages/claude-dev-env/docs/CODE_RULES.md',
47
- ],
48
- [
49
- '<managed-root>/hooks/blocking/code_rules_enforcer.py',
50
- 'packages/claude-dev-env/hooks/blocking/code_rules_enforcer.py',
51
- ],
52
- [
53
- '<managed-root>/rules/code-standards.md',
54
- 'packages/claude-dev-env/rules/code-standards.md',
55
- ],
56
- [
57
- '<managed-root>/rules/windows-filesystem-safe.md',
58
- 'packages/claude-dev-env/rules/windows-filesystem-safe.md',
59
- ],
60
- [
61
- '<managed-root>/rules/gh-cli-conventions.md',
62
- 'packages/claude-dev-env/rules/gh-cli-conventions.md',
63
- ],
64
- [
65
- '<managed-root>/rules/plain-illustrative-docstrings.md',
66
- 'packages/claude-dev-env/rules/plain-illustrative-docstrings.md',
67
- ],
68
- ];
38
+ const SHIPPED_AGENT_FILE_NAME = 'AGENTS.md';
39
+ const RETIRED_AGENT_FILE_NAMES = ['clean-coder.md', 'code-quality-agent.md', 'pr-description-writer.md'];
69
40
  const PERSONAL_SKILL_NAME = 'my-notes';
70
41
  const PREFLIGHT_PROPOSAL_FILE_NAME = 'preflight-proposal.md';
71
42
 
@@ -116,37 +87,48 @@ function assertProposalContractInstallation(installationPaths) {
116
87
  assert.equal(readFileSync(installedContractPath, 'utf8'), readFileSync(sourceContractPath, 'utf8'));
117
88
  }
118
89
 
119
- /**
120
- * @param {string} agentFilePath
121
- * @param {string} layoutName
122
- * @param {string} managedRoot
123
- * @returns {string[]}
124
- */
125
- function cleanCoderPolicyReferenceProblems(agentFilePath, layoutName, managedRoot) {
126
- const agentBody = readFileSync(agentFilePath, 'utf8');
127
- const missingReferences = [];
128
- for (const [installedReference, sourceReference] of CLEAN_CODER_POLICY_REFERENCES) {
129
- const eachReference = layoutName === 'source'
130
- ? sourceReference
131
- : installedReference;
132
- const eachTargetPath = sourceReference.replace('packages/claude-dev-env/', '');
133
- if (!agentBody.includes(eachReference)) {
134
- missingReferences.push(eachReference + ' is absent');
135
- }
136
- const resolvedPath = layoutName === 'source'
137
- ? join(PACKAGE_DIRECTORY, eachTargetPath)
138
- : join(managedRoot, eachTargetPath);
139
- if (!existsSync(resolvedPath)) {
140
- missingReferences.push(layoutName + ': ' + resolvedPath);
141
- }
142
- }
143
- return missingReferences.map((reference) => layoutName + ': ' + reference);
144
- }
145
90
 
146
91
  test('CONTENT_DIRECTORIES omits agents because that tree installs to the agents home', () => {
147
92
  assert.equal(CONTENT_DIRECTORIES.includes(MANAGED_AGENTS_DIRECTORY_NAME), false);
148
93
  });
149
94
 
95
+ test('full install archives recorded retired agents and preserves third-party agents', () => {
96
+ const homeDirectory = mkdtempSync(join(tmpdir(), 'cdev-agent-retirement-'));
97
+ try {
98
+ runInstaller(homeDirectory, []);
99
+ const agentsDirectory = join(homeDirectory, '.agents', 'agents');
100
+ const retiredPath = join(agentsDirectory, 'clean-coder.md');
101
+ const pluginPath = join(agentsDirectory, 'poteto-agent.md');
102
+ const activePath = join(agentsDirectory, 'AGENTS.md');
103
+ const sourcePluginPath = join(PACKAGE_DIRECTORY, '.agents', 'agents', 'poteto-agent.md');
104
+ assert.equal(readFileSync(pluginPath, 'utf8'), readFileSync(sourcePluginPath, 'utf8'));
105
+ writeFileSync(retiredPath, 'recover this retired definition\n');
106
+ writeFileSync(pluginPath, 'preserve this plugin definition\n');
107
+ const manifestPath = join(homeDirectory, '.claude', '.claude-dev-env-manifest.json');
108
+ const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
109
+ manifest.files.push(retiredPath);
110
+ manifest.files.push(activePath);
111
+ writeFileSync(manifestPath, JSON.stringify(manifest));
112
+
113
+ runInstaller(homeDirectory, []);
114
+
115
+ assert.equal(existsSync(retiredPath), false);
116
+ assert.ok(existsSync(activePath));
117
+ const backupRoot = join(homeDirectory, '.claude', '.claude-dev-env-pruned');
118
+ const backupNames = readdirSync(backupRoot, { recursive: true });
119
+ const retiredBackup = backupNames.find(name => name.endsWith('clean-coder.md'));
120
+ assert.ok(retiredBackup);
121
+ assert.equal(readFileSync(join(backupRoot, retiredBackup), 'utf8'), 'recover this retired definition\n');
122
+ assert.equal(readFileSync(pluginPath, 'utf8'), 'preserve this plugin definition\n');
123
+ const updatedManifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
124
+ assert.equal(updatedManifest.files.includes(retiredPath), false);
125
+ runInstaller(homeDirectory, []);
126
+ assert.equal(readFileSync(pluginPath, 'utf8'), 'preserve this plugin definition\n');
127
+ } finally {
128
+ rmSync(homeDirectory, { recursive: true, force: true });
129
+ }
130
+ });
131
+
150
132
  test('a full install writes skills and agents under .agents and points .claude at them', () => {
151
133
  const homeDirectory = mkdtempSync(join(tmpdir(), 'cdev-agents-home-'));
152
134
  const claudeHome = join(homeDirectory, '.claude');
@@ -201,18 +183,6 @@ test('a full install writes skills and agents under .agents and points .claude a
201
183
  readFileSync(lookupAgentFile, 'utf8'),
202
184
  readFileSync(canonicalAgentFile, 'utf8'),
203
185
  );
204
- const sourceAgentFile = join(
205
- resolvePackageManagedDirectory(
206
- PACKAGE_DIRECTORY,
207
- MANAGED_AGENTS_DIRECTORY_NAME,
208
- ),
209
- SHIPPED_AGENT_FILE_NAME,
210
- );
211
- const brokenPolicyReferences = [
212
- ...cleanCoderPolicyReferenceProblems(sourceAgentFile, 'source', claudeHome),
213
- ...cleanCoderPolicyReferenceProblems(canonicalAgentFile, 'installed', claudeHome),
214
- ];
215
- assert.deepEqual(brokenPolicyReferences, [], 'Clean Coder has broken policy references');
216
186
  assert.equal(realpathSync(lookupAgentFile), realpathSync(canonicalAgentFile));
217
187
  assert.equal(
218
188
  lstatSync(skillsInstallDirectory).isSymbolicLink(),
@@ -229,7 +199,7 @@ test('a full install writes skills and agents under .agents and points .claude a
229
199
  }
230
200
  });
231
201
 
232
- test('real installs place the Clean Coder in each active agents home', () => {
202
+ test('installs omit retired agents in each active agents home', () => {
233
203
  const runRoot = mkdtempSync(join(tmpdir(), 'cdev-active-roots-'));
234
204
  const homeDirectory = join(runRoot, 'home');
235
205
  const configRoot = join(runRoot, 'config-profile');
@@ -283,7 +253,7 @@ test('real installs place the Clean Coder in each active agents home', () => {
283
253
  ...eachInstallCase.environment,
284
254
  },
285
255
  );
286
- for (const eachAgentFileName of SHIPPED_AGENT_FILE_NAMES) {
256
+ for (const eachAgentFileName of RETIRED_AGENT_FILE_NAMES) {
287
257
  const installedAgentPath = join(
288
258
  eachInstallCase.agentsHome,
289
259
  MANAGED_AGENTS_DIRECTORY_NAME,
@@ -291,30 +261,10 @@ test('real installs place the Clean Coder in each active agents home', () => {
291
261
  );
292
262
  assert.equal(
293
263
  existsSync(installedAgentPath),
294
- true,
295
- `${eachInstallCase.name}: agent is under the active agents home`,
264
+ false,
265
+ `${eachInstallCase.name}: retired agent is absent`,
296
266
  );
297
- const installedAgentText = readFileSync(installedAgentPath, 'utf8');
298
- assert.match(installedAgentText, /active managed root/i);
299
- assert.match(installedAgentText, /active agents home/i);
300
- assert.match(installedAgentText, /<managed-root>\//);
301
- assert.match(installedAgentText, /<agents-home>\//);
302
267
  }
303
- const installedCleanCoderPath = join(
304
- eachInstallCase.agentsHome,
305
- MANAGED_AGENTS_DIRECTORY_NAME,
306
- SHIPPED_AGENT_FILE_NAME,
307
- );
308
- const policyReferenceProblems = cleanCoderPolicyReferenceProblems(
309
- installedCleanCoderPath,
310
- 'installed',
311
- eachInstallCase.managedRoot,
312
- );
313
- assert.deepEqual(
314
- policyReferenceProblems,
315
- [],
316
- `${eachInstallCase.name}: Clean Coder has broken policy references`,
317
- );
318
268
  assert.equal(
319
269
  isDirectoryPointerTo(
320
270
  join(eachInstallCase.managedRoot, MANAGED_AGENTS_DIRECTORY_NAME),