feat(rules): always_on rulebook flag + Scribe-first prompt
Adds rulebooks.always_on (migration 0058) and a new list_always_on_rules MCP tool so a session-start eager pull can fetch standing rules without needing an active-project notion. Updates _INSTRUCTIONS so Claude calls the new tool at session start and codifies engineering rules in Scribe rather than CLAUDE.md / auto-memory. Seeds FabledSword family rulebook to always_on=true on migrate, matching its design role as the cross-project standards rulebook. Frontend: badge in RulebookListPane for always-on rulebooks; toggle in RulebookDetailPane header bound to a new toggleAlwaysOn store action. This is S1+S2 of the rules-consolidation plan (Scribe task #508). S3 (project-scoped rules) and S4 (enter_project handshake) follow. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -54,13 +54,19 @@ export const useRulebooksStore = defineStore("rulebooks", () => {
|
||||
return rb;
|
||||
}
|
||||
|
||||
async function updateRulebook(id: number, data: Partial<Pick<Rulebook, "title" | "description">>) {
|
||||
async function updateRulebook(id: number, data: Partial<Pick<Rulebook, "title" | "description" | "always_on">>) {
|
||||
const rb = await api.updateRulebook(id, data);
|
||||
const idx = rulebooks.value.findIndex((r) => r.id === id);
|
||||
if (idx >= 0) rulebooks.value[idx] = rb;
|
||||
return rb;
|
||||
}
|
||||
|
||||
async function toggleAlwaysOn(id: number) {
|
||||
const current = rulebooks.value.find((r) => r.id === id);
|
||||
if (!current) return;
|
||||
return updateRulebook(id, { always_on: !current.always_on });
|
||||
}
|
||||
|
||||
async function deleteRulebook(id: number) {
|
||||
await api.deleteRulebook(id);
|
||||
rulebooks.value = rulebooks.value.filter((r) => r.id !== id);
|
||||
@@ -121,7 +127,7 @@ export const useRulebooksStore = defineStore("rulebooks", () => {
|
||||
return {
|
||||
rulebooks, topicsByRulebook, rulesByTopic, currentRule, loading,
|
||||
fetchRulebooks, fetchTopics, fetchRules, fetchRule,
|
||||
createRulebook, updateRulebook, deleteRulebook,
|
||||
createRulebook, updateRulebook, toggleAlwaysOn, deleteRulebook,
|
||||
createTopic, updateTopic, deleteTopic,
|
||||
createRule, updateRule, deleteRule,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user