Add app agents list and prompt, and document prompts for the seed agents

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-29 16:20:23 +02:00
1 parent 4e3c3f130e
commit 2534803df3
3 files changed
+106 -6

No files matched your search

+27
View File
@@ -897,6 +897,33 @@ def test_a_starter_agent_may_list_prompts_or_give_an_intent(
AgentSeed.model_validate({"name": "Bad", "prompts": [{"name": "A"}, {"name": "a"}]})
def test_the_cli_adds_replaces_removes_and_lists_prompts(
tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None:
import yaml
from app import cli
db = tmp_path / "roledesk.db"
path = tmp_path / "config.yaml"
path.write_text(yaml.safe_dump({"database": str(db)}))
agent = Store(db).save_agent("Wolf", "Head of data")
def app(*argv: str) -> int:
return cli.main(["-c", str(path), "agents", *argv])
assert app("prompt", "Wolf", "FDE", "Forward deployed lead") == 0
assert app("prompt", "Wolf", "wolf", "Head of AI") == 0 # replaced in place
assert app("prompt", "Wolf", "Research") == 0 # no text yet
assert Store(db).agent(agent.id).prompts == [ # type: ignore[union-attr]
Prompt(name="wolf", text="Head of AI"), Prompt(name="FDE", text="Forward deployed lead"),
Prompt(name="Research")]
assert app("prompt", "Wolf", "fde", "--remove") == 0
assert app("prompt", "Wolf", "Nothing", "--remove") == 1
assert app("prompt", "Nobody", "X", "y") == 1
capsys.readouterr()
assert app("list") == 0
assert capsys.readouterr().out == "Wolf\n wolf: Head of AI\n Research: \n"
def test_the_shipped_starter_searches_validate() -> None:
from app import config as config_mod