Skip to content

armgit / Orkas

Public Imported from GitHub
0

Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.

Drop English-anchoring template from chat_skill_setup External dependencies; add audit-as-artifact prompt-md rule

wytbbef8ca38968
diff --git a/CLAUDE.md b/CLAUDE.md
index 94ec834c..fe5105a5 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -92,7 +92,9 @@ Exception: env-var names with the project prefix (`ORKAS_NODE` / `ORKAS_PC_DIR`)
2. **Does it conflict with or duplicate existing content?** Grep the same prompt md and its peers (`chat_*.md` share a domain; `chat_shared_rules.md` is injected into multiple roles — see the cross-prompt sync constraint above). Partial overlap → **merge** into one tighter rule, don't ship a parallel paragraph (parallel rules dilute each other; the model honours neither cleanly). Contradiction → **fix one to match the other**, don't ship both.
-**Why:** prompt text sits in the cached prefix and shapes every turn. We shipped "don't paste absolute paths" + "don't enumerate bash scratch" as two parallel paragraphs in `chat_shared_rules.md` and watched the model honour neither until the merge. Merge first, write second.
+3. **Show the audit (process enforcement)**: any response that submits a prompt-md edit MUST contain a visible per-clause audit — one row per newly added clause marked ✅ (necessary; which Keep category) or ❌ (cut; which redundancy reason from check 1). Without the audit in the response, treat the edit as incomplete. This binds checks 1 and 2 to a concrete moment so they aren't silently skipped.
+
+**Why:** prompt text sits in the cached prefix and shapes every turn. We shipped "don't paste absolute paths" + "don't enumerate bash scratch" as two parallel paragraphs in `chat_shared_rules.md` and watched the model honour neither until the merge. We also shipped this rule itself as advisory at first and watched the audit get skipped on every subsequent prompt-md edit until the audit-as-artifact step made skipping visible. Merge first, write second; show the audit.
**Prompt-md cache layout** (KV-cache prefix discipline): every `src/main/prompts/<name>.md` is split into two halves — **static rules first, then a single trailing `## Runtime injection` section that collects every `$variable` substitution** (with the most volatile field at the bottom of that section). Final assembled order = `<role>.md` static body → `chat_shared_rules.md` (when applicable) → `<role>.md` `## Runtime injection` → `buildLanguageDirective()`. The shared block is wedged in front of the runtime block by `bus.ts::concatSharedRules`; the language directive is appended last by `appendLanguageDirective`. **No `## Current xxx` / "current state" block at the top of the file** — anything the LLM itself rewrites mid-session (`<agent>` writeback / `<<<skill-file>>>` / `plan_set` / form submissions: `$name` / `$description*` / `$workflow` / `$skill_dir` / `$skill_files` / `$plan_state` / `$agents_index` / `$inputs_schema` / `$interactive`) goes only into the trailing runtime section. **Why:** putting volatile fields up front means the very next turn rewrites the cache prefix and we eat a full re-prefill; `chat_agent_setup.md` / `chat_agent_setup_cli.md` / `chat_skill_setup.md` shipped with a top-of-file `## Current agent` / `## Current skill` block, every edit turn invalidated the cache, and the fix was to consolidate those into the trailing `## Runtime injection` section. Same applies to any new prompt md added under `src/main/prompts/`. Path-constants that are fixed for the lifetime of a session (`$builtin_*_dir` / `$custom_*_dir` / `$working_dir`) are session-stable and may stay inline in the body; only fields that the LLM or bus mutate within a session are forbidden in the prefix.
diff --git a/src/main/prompts/chat_skill_setup.md b/src/main/prompts/chat_skill_setup.md
index ea648a2e..417febea 100644
--- a/src/main/prompts/chat_skill_setup.md
+++ b/src/main/prompts/chat_skill_setup.md
@@ -120,7 +120,7 @@ The body (after the frontmatter) follows this structure:
- **Executable** (has `scripts/*`): a bash command template (the unified invocation form in §6), parameter explanations, required prerequisites.
- **Guide** (only SKILL.md, no scripts): list 3–7 **actionable steps**, each describing "what to do" (e.g. "fetch the page body", "find related news from the last 7 days", "write the result to a file in the workspace") — **do not write specific tool names** — the main conversation LLM picks paths using whatever tools it has loaded.
3. **Return format**: the success / failure JSON shape (executable); or the output shape the main conversation LLM should give back to the user (guide).
-4. **External dependencies**: runtime (e.g. Python 3 / Node), CLIs, network services, API keys, login state, etc. One per line, describing "id — behavior when missing; how to obtain". **Do not use frontmatter fields**; this is a body section.
+4. **External dependencies**: runtime (e.g. Python 3 / Node), CLIs, network services, API keys, login state, etc. One per line: dependency name + what fails when it's missing + how to obtain. **Do not use frontmatter fields**; this is a body section.
5. **Limits / known issues**: timeouts, platform differences, login-state dependencies, etc.
6. **Full examples**: one or two of the most typical "input → invocation → output" snippets.