From 22539df51c1b49df2807138a740429c9f858a1f5 Mon Sep 17 00:00:00 2001 From: Chase Huh Date: Thu, 3 Sep 2026 18:02:09 +0900 Subject: [PATCH] desk: always-on primer pointing every harness at ~/.cstack/src/AGENTS.md Cursor gets cstack-desk.mdc. Codex/Grok snippets and check-wiring now require the same first read. Wiring also scans ~/sumelabs. --- AGENTS.md | 4 +++ docs/FLOW.md | 1 + sume-desk/codex-agents-snippet.md | 3 ++- sume-desk/cursor-rules/user/cstack-desk.mdc | 27 +++++++++++++++++++ sume-desk/grok-agents-snippet.md | 4 ++- .../check-wiring.sh | 13 ++++++++- 6 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 sume-desk/cursor-rules/user/cstack-desk.mdc diff --git a/AGENTS.md b/AGENTS.md index 851b179..52bd9d2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,6 +20,10 @@ git clone git@github.com:chasehuh/cstack.git ~/.cstack/src ~/.cstack/src/install.sh --sume-com ~/sume/sume-com ``` +Cursor user-global always-apply primer: `~/.cursor/rules/cstack-desk.mdc` +(points at this file). Codex / Claude Code / Grok Build get the same +order via `~/.codex/AGENTS.md`, `~/.claude/CLAUDE.md`, `~/.grok/AGENTS.md`. + Then **read**, in this order: 1. `~/.agents/skills/sume-main-agent-orchestration/SKILL.md` (policy SoT) diff --git a/docs/FLOW.md b/docs/FLOW.md index 307178c..cadb7f9 100644 --- a/docs/FLOW.md +++ b/docs/FLOW.md @@ -39,6 +39,7 @@ duplicate the full SKILL into the `.mdc`. | File | Role | |---|---| +| `cstack-desk.mdc` | Pointer at `~/.cstack/src/AGENTS.md` (desk primer every agent reads first) | | `main-agent-orchestration.mdc` | Pointer at orchestration SKILL | | `sume-chase-work-loop.mdc` | Discuss → issue → Opus enqueue → Grok land | | `opus-background-terminal.mdc` | `claude-human-stream` recipe: prompt file, `cd` not `--cwd`, `block_until_ms: 0`, title = Job | diff --git a/sume-desk/codex-agents-snippet.md b/sume-desk/codex-agents-snippet.md index da4733b..a14b344 100644 --- a/sume-desk/codex-agents-snippet.md +++ b/sume-desk/codex-agents-snippet.md @@ -1,7 +1,8 @@ ## Sume Orchestration -When this harness is the Sume **main agent**, read and follow: +When this harness is the Sume **main agent**, read and follow, in order: +`~/.cstack/src/AGENTS.md` `~/.agents/skills/sume-main-agent-orchestration/SKILL.md` Ignore sections marked **Cursor-only** unless you are Cursor. Before any diff --git a/sume-desk/cursor-rules/user/cstack-desk.mdc b/sume-desk/cursor-rules/user/cstack-desk.mdc new file mode 100644 index 0000000..c92c13b --- /dev/null +++ b/sume-desk/cursor-rules/user/cstack-desk.mdc @@ -0,0 +1,27 @@ +--- +description: CStack desk primer — first file every agent on this machine reads +alwaysApply: true +--- + +# CStack desk (pointer) + +This machine’s installable SoT is **`chasehuh/cstack`**. + +Read this file first, then stop forking it into chat memory: + +`~/.cstack/src/AGENTS.md` + +Then the policy skill: + +`~/.agents/skills/sume-main-agent-orchestration/SKILL.md` + +Map of files → when: `~/.cstack/src/docs/FLOW.md` + +Refresh after `git pull` in `~/.cstack/src`: + +```bash +~/.cstack/src/install.sh --sume-com /Users/chasehuh/sumelabs/sume +``` + +Do not edit `~/.agents/skills/*` copies. Those are symlinks into +`~/.cstack/src/sume-desk/skills/`. diff --git a/sume-desk/grok-agents-snippet.md b/sume-desk/grok-agents-snippet.md index 8c7f577..8c89140 100644 --- a/sume-desk/grok-agents-snippet.md +++ b/sume-desk/grok-agents-snippet.md @@ -1,7 +1,9 @@ ## Sume Orchestration -When this harness is the Sume **main agent** or a Grok Build worker, read: +When this harness is the Sume **main agent** or a Grok Build worker, read +in order: +`~/.cstack/src/AGENTS.md` `~/.agents/skills/sume-main-agent-orchestration/SKILL.md` Before any `gt submit` / `gt merge` on `sume-com`, read diff --git a/sume-desk/skills/sume-main-agent-orchestration/check-wiring.sh b/sume-desk/skills/sume-main-agent-orchestration/check-wiring.sh index eeb5681..31e9932 100755 --- a/sume-desk/skills/sume-main-agent-orchestration/check-wiring.sh +++ b/sume-desk/skills/sume-main-agent-orchestration/check-wiring.sh @@ -139,8 +139,19 @@ check_pointer "$HOME/.cursor/rules/main-agent-orchestration.mdc" while IFS= read -r rule; do check_pointer "$rule" -done < <(find "$HOME/sume" "$HOME/chase" "$HOME/dooi" -maxdepth 4 \ +done < <(find "$HOME/sume" "$HOME/sumelabs" "$HOME/chase" "$HOME/dooi" -maxdepth 4 \ -path "*/.cursor/rules/main-agent-orchestration.mdc" \ -not -path "*/node_modules/*" -not -path "*worktree*" -not -path "*PURGE*" 2>/dev/null) +if [ -f "$HOME/.cursor/rules/cstack-desk.mdc" ]; then + if grep -q "$HOME/.cstack/src/AGENTS.md" "$HOME/.cursor/rules/cstack-desk.mdc" \ + || grep -q '~/.cstack/src/AGENTS.md' "$HOME/.cursor/rules/cstack-desk.mdc"; then + ok "cursor desk primer points at ~/.cstack/src/AGENTS.md" + else + bad "cursor desk primer missing AGENTS.md pointer: ~/.cursor/rules/cstack-desk.mdc" + fi +else + bad "cursor desk primer missing: ~/.cursor/rules/cstack-desk.mdc" +fi + exit $fail