Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(prompt): make skill loading judgment-led (#2003)

Call White9c4c843a2fbd
diff --git a/core/prompts/skills-manual.md b/core/prompts/skills-manual.md
index 1d7997b66..f469e3345 100644
--- a/core/prompts/skills-manual.md
+++ b/core/prompts/skills-manual.md
@@ -1,4 +1,4 @@
## Skills
-If the user requests a Skill by exact name, ensure its content is in context: reuse an earlier successful load that remains in context; otherwise run `vibe skill load -- <name>` before proceeding.
+If the user requests a Skill by exact name, load it with `vibe skill load -- <name>` or reuse it if already loaded in this conversation.
Otherwise, do not guess skill names.
diff --git a/core/prompts/skills.md b/core/prompts/skills.md
index cff8488d9..119b0356d 100644
--- a/core/prompts/skills.md
+++ b/core/prompts/skills.md
@@ -1,6 +1,6 @@
## Skills
Skills provide specialized instructions and workflows for specific tasks.
-Before acting on a task covered by a listed Skill, ensure its content is in context: reuse an earlier successful load that remains in context; otherwise run `vibe skill load -- <name>`.
-If the user requests a Skill by exact name, apply this rule to that name.
+Consider whether any available Skills would help in the current situation. Load those you choose with `vibe skill load -- <name>`; reuse any already loaded in this conversation.
+If the user requests a Skill by exact name, use that Skill.
For non-explicit requests, only load Skill names listed here or returned by `vibe skill list`; do not guess names.
diff --git a/docs/plans/managed-skills.md b/docs/plans/managed-skills.md
index c5d530478..4c87f3721 100644
--- a/docs/plans/managed-skills.md
+++ b/docs/plans/managed-skills.md
@@ -182,8 +182,8 @@ When model-invocable Skills exist, Avibe injects this shape:
## Skills
Skills provide specialized instructions and workflows for specific tasks.
-Before acting on a task covered by a listed Skill, ensure its content is in context: reuse an earlier successful load that remains in context; otherwise run `vibe skill load -- <name>`.
-If the user requests a Skill by exact name, apply this rule to that name.
+Consider whether any available Skills would help in the current situation. Load those you choose with `vibe skill load -- <name>`; reuse any already loaded in this conversation.
+If the user requests a Skill by exact name, use that Skill.
For non-explicit requests, only load Skill names listed here or returned by `vibe skill list`; do not guess names.
Use `vibe skill list --page 2` only when more discovery is useful; ordinary tasks do not require scanning every page.
@@ -205,12 +205,18 @@ and retains only exact-name guidance:
```md
## Skills
-If the user requests a Skill by exact name, ensure its content is in context: reuse an earlier successful load that remains in context; otherwise run `vibe skill load -- <name>` before proceeding.
+If the user requests a Skill by exact name, load it with `vibe skill load -- <name>` or reuse it if already loaded in this conversation.
Otherwise, do not guess skill names.
```
When no Skills resolve, Avibe omits the block.
+Skill selection is judgment-led rather than a mandatory task-coverage match.
+Already-loaded Skills are reused within the conversation without a separate
+context-presence test. Explicit user requests, manual-only visibility, and
+name-discovery boundaries remain unchanged. This is shared prompt guidance,
+not a runtime load cache or a guarantee that Skill text survives compaction.
+
### 6.2 List command
```text
diff --git a/tests/test_managed_skills.py b/tests/test_managed_skills.py
index ba210a228..7ff6168c2 100644
--- a/tests/test_managed_skills.py
+++ b/tests/test_managed_skills.py
@@ -536,11 +536,14 @@ def test_catalog_paginates_stably_without_exposing_directories(tmp_path: Path) -
assert prompt.count("\n- skill-") == CATALOG_PAGE_SIZE
assert "`vibe skill list --page 2`" in prompt
assert "ordinary tasks do not require scanning every page" in prompt
- assert "Before acting on a task covered by a listed Skill" in prompt
assert (
- "reuse an earlier successful load that remains in context; otherwise run "
- "`vibe skill load -- <name>`"
+ "Consider whether any available Skills would help in the current situation. "
+ "Load those you choose with `vibe skill load -- <name>`; "
+ "reuse any already loaded in this conversation."
) in prompt
+ assert "If the user requests a Skill by exact name, use that Skill." in prompt
+ assert "Before acting on a task covered" not in prompt
+ assert "remains in context" not in prompt
assert "For non-explicit requests, only load Skill names listed here" in prompt
assert render_skill_list(skills, page=2) == "- skill-25: Description 25"
assert str(tmp_path) not in prompt
@@ -588,9 +591,12 @@ def test_manual_only_skill_is_loadable_but_not_advertised(tmp_path: Path) -> Non
manual_prompt = render_skill_catalog_prompt([manual])
assert "`vibe skill load -- <name>`" in manual_prompt
assert (
- "reuse an earlier successful load that remains in context; otherwise run "
- "`vibe skill load -- <name>`"
+ "If the user requests a Skill by exact name, load it with "
+ "`vibe skill load -- <name>` or reuse it if already loaded in this conversation."
) in manual_prompt
+ assert "Otherwise, do not guess skill names." in manual_prompt
+ assert "Consider whether" not in manual_prompt
+ assert "remains in context" not in manual_prompt
assert "- manual:" not in manual_prompt
assert "Run only when explicitly requested." not in manual_prompt
diff --git a/tests/test_prompt_render_export.py b/tests/test_prompt_render_export.py
index 985927e29..e04948811 100644
--- a/tests/test_prompt_render_export.py
+++ b/tests/test_prompt_render_export.py
@@ -91,9 +91,26 @@ def test_export_reconstructs_production_text_with_source_for_every_block(monkeyp
if skill_mode in {"single", "pages"}:
assert ids[ids.index("base-capabilities-body") + 1] == "skills-prompt"
assert production.count(prompt_text("skills-prompt")) == 1
+ assert (
+ "Consider whether any available Skills would help in the current situation. "
+ "Load those you choose with `vibe skill load -- <name>`; "
+ "reuse any already loaded in this conversation."
+ ) in production
+ assert "If the user requests a Skill by exact name, use that Skill." in production
assert "vibe skill load -- <name>" in production
assert ("vibe skill list --page 2" in production) == (skill_mode == "pages")
assert "- skill-00: Description skill-00" in production
+ elif skill_mode == "manual":
+ assert (
+ "If the user requests a Skill by exact name, load it with "
+ "`vibe skill load -- <name>` or reuse it if already loaded in this conversation."
+ ) in production
+ assert "Consider whether any available Skills" not in production
+ else:
+ assert "skills-prompt" not in ids
+ assert "skills-manual-prompt" not in ids
+ assert "Before acting on a task covered" not in production
+ assert "reuse an earlier successful load that remains in context" not in production
assert ("## Personal Memory" in production) == memory
assert ("preferences.md" in production) != memory
@@ -422,9 +439,9 @@ def test_cli_localizes_invalid_context_files(monkeypatch, tmp_path, capsys, lang
assert output.err == cli.i18n_t("debug.cli.error.promptExport", language, error=error) + "\n"
-def test_agent_tail_and_snapshot_cleanup_preserve_all_other_injection_bytes(monkeypatch):
+def test_skill_loading_guidance_preserves_all_other_injection_bytes(monkeypatch):
outputs = []
- changed = {"runtime-snapshot-open", "agent-instructions"}
+ changed = {"skills-prompt", "skills-manual-prompt"}
for backend, memory, history, skill_mode in itertools.product(
("claude", "codex", "opencode"), (False, True), ("off", "managed", "self-managed"), ("empty", "manual", "pages"),
):
@@ -432,6 +449,6 @@ def test_agent_tail_and_snapshot_cleanup_preserve_all_other_injection_bytes(monk
blocks = render_prompt_context(_inputs(backend, memory, history, skill_mode))["blocks"]
outputs.append("".join(block["text"] for block in blocks if block["id"] not in changed))
digest = hashlib.sha256(json.dumps(outputs, ensure_ascii=False).encode()).hexdigest()
- # Captured independently from 03e42c205f3da668c3ef8580d68d6cead2a00410,
- # omitting only the approved snapshot preamble and relocated Agent block.
- assert digest == "8a6403a158b7fba7d0164ae40ceac7d1945935e9612d79b5588de4ef9d1e0dfe"
+ # Captured before editing from 1e9ba96bc61b0e86027d4871553e68e8ed85c1ac,
+ # omitting only the two approved Skill-loading guidance blocks.
+ assert digest == "fd82657d51e3193f54f939a3f159e7c7034a40d0b44388399e34a4aa17b14ea6"