docs(skill): use mureo_state_* MCP tools for STATE.json mutations on Code (#341)#344
Merged
Merged
Conversation
…Code (#341) The `_mureo-shared` "Tool Selection" table told Claude Code agents to upsert campaign snapshots / append action_log entries to STATE.json via the raw `Edit` tool. But the v2 schema the dashboard reads is non-trivial — a `platforms[<platform>]` section with a required `account_id` — and a platform/campaign missing it is silently dropped, so the workspace renders empty / "not yet bootstrapped" even after campaigns were written. The MCP tools (`mureo_state_upsert_campaign` / `mureo_state_action_log_append`) encode that schema atomically and are available on Code too. Separately, `mureo_state_upsert_campaign` (and the metrics/report setters) stamp the top-level `last_synced_at` that drives the dashboard's freshness — and that field was entirely absent from the SKILL.md STATE.json Schema docs. Changes (mirrored to both skills/ and mureo/_data/skills/): - `_mureo-shared/SKILL.md`: table "Append action_log entry" / "Upsert campaign snapshot" Code column `Edit` -> the `mureo_state_*` MCP tool; a note that STATE.json mutations prefer the MCP tool on every host, with direct `Write` on Code reserved for the bulk-snapshot flows (sync-state / daily-check) where the agent must replicate the full schema incl. a fresh `last_synced_at`; and `last_synced_at` added as a required top-level field (bullet + JSON example). - `daily-check/SKILL.md` step 11: a `last_synced_at` reminder for the Code `Write` path (sync-state already has step 9). Wording verified against the implementation (code-reviewed): `platforms` / `account_id` incompleteness — not `last_synced_at` — is what renders a workspace empty/inactive; `last_synced_at` only drives the "Synced N ago" freshness; and `mureo_state_action_log_append` does NOT re-stamp it (only the campaign/metrics/report writers do). Closes #341 Claude-Session: https://claude.ai/code/session_011rAu94b1o1xWYZhARk1VmL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
skills/_mureo-shared/SKILL.md's "Tool Selection" table told Claude Codeagents to upsert campaign snapshots / append action_log entries to STATE.json
via the raw
Edittool. But the v2 schema the dashboard reads is non-trivial —a
platforms[<platform>]section with a requiredaccount_id— and aplatform/campaign missing it is silently dropped, so the workspace renders
empty / "not yet bootstrapped" even after campaigns were written
(
mureo/context/state.py:386,mureo/_data/web/dashboard.js:2155). Themureo_state_*MCP tools encode that schema atomically and are available onCode too. Separately,
mureo_state_upsert_campaign(and the metrics/reportsetters) stamp the top-level
last_synced_atthat drives the dashboard's"Synced N ago" freshness — and that field was entirely absent from the
SKILL.md STATE.json Schema docs.
Changes (mirrored to both
skills/andmureo/_data/skills/)_mureo-shared/SKILL.mdEdit→ themureo_state_*MCP tool (matches the issue's suggested diff).Writeon Code is reserved for the bulk-snapshot flows(
sync-state/daily-check), where the agent must replicate the fullschema incl. a fresh
last_synced_at.last_synced_atas a required top-level field (bullet + JSONexample) — the missing piece behind the reported failure.
daily-check/SKILL.mdstep 11: alast_synced_atreminder for the CodeWritepath (sync-statealready had step 9).Verification
earlier draft, now corrected and re-verified against the implementation:
platforms/account_idincompleteness — notlast_synced_at— iswhat renders a workspace empty/inactive (
dashboard.js:2155gates onplatforms.length === 0);last_synced_atonly drives the freshness label.mureo_state_action_log_appenddoes not re-stamplast_synced_at(
state.py:463preserves it); only the campaign/metrics/report writers do.tests/test_plugin_manifests.pypasses (skills/ ↔mureo/_data/skills/ byte-identical); skill suite green (247 passed).
Closes #341
https://claude.ai/code/session_011rAu94b1o1xWYZhARk1VmL