@everystack/mcp 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -23053,7 +23053,9 @@ function registerClaudeMdPrompt(server) {
23053
23053
  ' hand-written migrations, "pass your Drizzle schema") instead of the v3 Model flow',
23054
23054
  " (`defineModel` \u2192 `everystack db:generate`)? Suggest the current conventions.",
23055
23055
  "2. **Project drift** \u2014 do the Structure / Commands / package list match what is actually",
23056
- " installed now (new packages, a new tier, a new models/ dir)? Suggest updates.",
23056
+ " installed now (new packages, a new tier, a new models/ dir)? Suggest updates. Also",
23057
+ " check the operations manual: if docs/RUNBOOK.md is missing, or stale per",
23058
+ " `everystack runbook --check`, suggest the `runbook` prompt.",
23057
23059
  "3. **Contract-vs-gates drift** \u2014 is it missing any Non-negotiable the cheat gates enforce",
23058
23060
  " (data\u2192DB, generated migrations, declared authz, reuse @everystack/ui, secrets boundary)?",
23059
23061
  " Suggest adding it, so the human contract and the enforced rules agree.",
@@ -23078,6 +23080,73 @@ function registerClaudeMdPrompt(server) {
23078
23080
  );
23079
23081
  }
23080
23082
 
23083
+ // src/prompts/runbook.ts
23084
+ function registerRunbookPrompt(server) {
23085
+ server.prompt(
23086
+ "runbook",
23087
+ "Generate or refresh docs/RUNBOOK.md \u2014 the operations manual compiled from the app's detected reality (tier, Models, handlers). Runs `everystack runbook`, then fills empty slots with app narrative (confirm-first). Regenerate after the app grows or an everystack upgrade.",
23088
+ {
23089
+ projectPath: external_exports.string().optional().describe("Absolute path to the project root (where docs/RUNBOOK.md lives)")
23090
+ },
23091
+ async ({ projectPath }) => {
23092
+ const root = projectPath ?? ".";
23093
+ return {
23094
+ messages: [
23095
+ {
23096
+ role: "user",
23097
+ content: {
23098
+ type: "text",
23099
+ text: [
23100
+ `Generate or refresh docs/RUNBOOK.md for the project at ${root}.`,
23101
+ "",
23102
+ "## What this is",
23103
+ "",
23104
+ "docs/RUNBOOK.md is the per-app operations manual \u2014 how to configure, extend, deploy,",
23105
+ "monitor, and maintain THIS app. It is COMPILED, not authored: `everystack runbook`",
23106
+ "derives it from the app's detected reality (installed packages \u2192 tier, Models,",
23107
+ "handlers, crons) and regenerating after a change diffs in what's new. The division",
23108
+ "of labor: CLAUDE.md is the terse contract (rules); the runbook is procedures.",
23109
+ "",
23110
+ "## Step 1 \u2014 run the compiler",
23111
+ "",
23112
+ `- If ${root}/docs/RUNBOOK.md exists, run \`everystack runbook --diff\` first and show`,
23113
+ " the human which sections would change.",
23114
+ "- Then run `everystack runbook` to write it. If it reports hand-edited generated",
23115
+ " sections (a conflict), do NOT reach for --force \u2014 help the human move those words",
23116
+ " into a slot or the Notes section first, then regenerate. --force only with their",
23117
+ " explicit ok.",
23118
+ "",
23119
+ "## Step 2 \u2014 fill the EMPTY slots (and only the slots)",
23120
+ "",
23121
+ "The document has two kinds of content, mechanically marked:",
23122
+ "- `<!-- es:gen section=... -->` blocks belong to the compiler. NEVER write inside one \u2014",
23123
+ " your words would be overwritten on the next regeneration, and the hash check flags it.",
23124
+ "- `<!-- es:slot name=... -->` blocks are the human/agent seam and survive every",
23125
+ " regeneration. A slot still holding its `_(Fill in: ...)_` placeholder is empty.",
23126
+ "",
23127
+ "For each empty slot, draft content from what you know of the project:",
23128
+ "- `overview` \u2014 what the app is, who it serves, what an operator should know first.",
23129
+ "- `stage-notes` \u2014 deployed URLs per stage, channel-to-stage mapping, release cadence",
23130
+ " (read `.sst/outputs.json` or ask; do not guess URLs).",
23131
+ "- `notes` \u2014 anything project-specific that fits nowhere else. Leave it if nothing real.",
23132
+ "",
23133
+ "Show the human your draft slot content and let them approve before writing \u2014 the",
23134
+ "runbook is theirs; you assist, you do not own it.",
23135
+ "",
23136
+ "## Step 3 \u2014 verify",
23137
+ "",
23138
+ "Run `everystack runbook --check`: it must exit clean (slot edits never make it stale).",
23139
+ "Tell the human: regenerate any time with `everystack runbook`; CI can enforce currency",
23140
+ "with `--check`; after an everystack upgrade the diff reads as release notes for this app."
23141
+ ].join("\n")
23142
+ }
23143
+ }
23144
+ ]
23145
+ };
23146
+ }
23147
+ );
23148
+ }
23149
+
23081
23150
  // src/prompts/index.ts
23082
23151
  function registerPrompts(server) {
23083
23152
  registerNewAppPrompt(server);
@@ -23088,6 +23157,7 @@ function registerPrompts(server) {
23088
23157
  registerSecurePrompt(server);
23089
23158
  registerGovernanceSetupPrompt(server);
23090
23159
  registerClaudeMdPrompt(server);
23160
+ registerRunbookPrompt(server);
23091
23161
  }
23092
23162
 
23093
23163
  // src/governance/grounding.ts
@@ -23635,7 +23705,7 @@ async function runGovernanceCli(argv) {
23635
23705
  }
23636
23706
 
23637
23707
  // src/index.ts
23638
- var version2 = (true ? "0.3.0" : null) ?? "0.3.0-dev";
23708
+ var version2 = (true ? "0.3.1" : null) ?? "0.3.0-dev";
23639
23709
  var INSTRUCTIONS = [
23640
23710
  "You govern how any agent builds everystack \u2014 a self-hosted application stack for Expo apps on AWS.",
23641
23711
  "Your job is not only to advise but to keep the build on-script: the architecture the maintainer",
@@ -38,6 +38,7 @@ These are enforced (everystack cheat gates) and load-bearing. Do not work around
38
38
  - `db/` — generated Drizzle schema + migrations (do not edit by hand)
39
39
  - `lib/` — shared code (auth context, API client)
40
40
  - `sst.config.ts` — AWS infrastructure definition
41
+ - `docs/RUNBOOK.md` — how to operate this app; regenerate with `everystack runbook`
41
42
 
42
43
  ## Structure
43
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everystack/mcp",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Governance layer that governs how any agent builds everystack — grounding, cheat gates, and Model-aware tooling over MCP",
5
5
  "license": "AGPL-3.0-only",
6
6
  "author": "Scalable Technology, Inc. <licensing@scalable.technology>",
@@ -40,8 +40,8 @@
40
40
  "tsx": "4.21.0",
41
41
  "typescript": "5.9.3",
42
42
  "zod": "3.25.67",
43
- "@everystack/cli": "0.3.6",
44
- "@everystack/model": "0.3.3"
43
+ "@everystack/cli": "0.3.12",
44
+ "@everystack/model": "0.3.4"
45
45
  },
46
46
  "scripts": {
47
47
  "test": "jest",
@@ -64,7 +64,9 @@ export function registerClaudeMdPrompt(server: McpServer): void {
64
64
  ' hand-written migrations, "pass your Drizzle schema") instead of the v3 Model flow',
65
65
  ' (`defineModel` → `everystack db:generate`)? Suggest the current conventions.',
66
66
  '2. **Project drift** — do the Structure / Commands / package list match what is actually',
67
- ' installed now (new packages, a new tier, a new models/ dir)? Suggest updates.',
67
+ ' installed now (new packages, a new tier, a new models/ dir)? Suggest updates. Also',
68
+ ' check the operations manual: if docs/RUNBOOK.md is missing, or stale per',
69
+ ' `everystack runbook --check`, suggest the `runbook` prompt.',
68
70
  '3. **Contract-vs-gates drift** — is it missing any Non-negotiable the cheat gates enforce',
69
71
  ' (data→DB, generated migrations, declared authz, reuse @everystack/ui, secrets boundary)?',
70
72
  ' Suggest adding it, so the human contract and the enforced rules agree.',
@@ -7,6 +7,7 @@ import { registerDebugPrompt } from './debug.js';
7
7
  import { registerSecurePrompt } from './secure.js';
8
8
  import { registerGovernanceSetupPrompt } from './governance-setup.js';
9
9
  import { registerClaudeMdPrompt } from './claude-md.js';
10
+ import { registerRunbookPrompt } from './runbook.js';
10
11
 
11
12
  export function registerPrompts(server: McpServer): void {
12
13
  registerNewAppPrompt(server);
@@ -17,4 +18,5 @@ export function registerPrompts(server: McpServer): void {
17
18
  registerSecurePrompt(server);
18
19
  registerGovernanceSetupPrompt(server);
19
20
  registerClaudeMdPrompt(server);
21
+ registerRunbookPrompt(server);
20
22
  }
@@ -0,0 +1,77 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+
4
+ /**
5
+ * `runbook` — generate or refresh docs/RUNBOOK.md, the per-app operations manual.
6
+ *
7
+ * The compiler lives in the CLI (`everystack runbook` — db:generate for docs:
8
+ * detection → sections keyed by the app's reality → es:gen/es:slot merge). This
9
+ * prompt is the thin agent layer on top: run the compiler, then fill the EMPTY
10
+ * slots with app-specific narrative the compiler cannot know. Generated blocks
11
+ * belong to the compiler — the agent never writes inside them.
12
+ */
13
+ export function registerRunbookPrompt(server: McpServer): void {
14
+ server.prompt(
15
+ 'runbook',
16
+ 'Generate or refresh docs/RUNBOOK.md — the operations manual compiled from the app\'s detected reality (tier, Models, handlers). Runs `everystack runbook`, then fills empty slots with app narrative (confirm-first). Regenerate after the app grows or an everystack upgrade.',
17
+ {
18
+ projectPath: z.string().optional().describe('Absolute path to the project root (where docs/RUNBOOK.md lives)'),
19
+ },
20
+ async ({ projectPath }) => {
21
+ const root = projectPath ?? '.';
22
+ return {
23
+ messages: [
24
+ {
25
+ role: 'user' as const,
26
+ content: {
27
+ type: 'text' as const,
28
+ text: [
29
+ `Generate or refresh docs/RUNBOOK.md for the project at ${root}.`,
30
+ '',
31
+ '## What this is',
32
+ '',
33
+ 'docs/RUNBOOK.md is the per-app operations manual — how to configure, extend, deploy,',
34
+ 'monitor, and maintain THIS app. It is COMPILED, not authored: `everystack runbook`',
35
+ 'derives it from the app\'s detected reality (installed packages → tier, Models,',
36
+ 'handlers, crons) and regenerating after a change diffs in what\'s new. The division',
37
+ 'of labor: CLAUDE.md is the terse contract (rules); the runbook is procedures.',
38
+ '',
39
+ '## Step 1 — run the compiler',
40
+ '',
41
+ `- If ${root}/docs/RUNBOOK.md exists, run \`everystack runbook --diff\` first and show`,
42
+ ' the human which sections would change.',
43
+ '- Then run `everystack runbook` to write it. If it reports hand-edited generated',
44
+ ' sections (a conflict), do NOT reach for --force — help the human move those words',
45
+ ' into a slot or the Notes section first, then regenerate. --force only with their',
46
+ ' explicit ok.',
47
+ '',
48
+ '## Step 2 — fill the EMPTY slots (and only the slots)',
49
+ '',
50
+ 'The document has two kinds of content, mechanically marked:',
51
+ '- `<!-- es:gen section=... -->` blocks belong to the compiler. NEVER write inside one —',
52
+ ' your words would be overwritten on the next regeneration, and the hash check flags it.',
53
+ '- `<!-- es:slot name=... -->` blocks are the human/agent seam and survive every',
54
+ ' regeneration. A slot still holding its `_(Fill in: ...)_` placeholder is empty.',
55
+ '',
56
+ 'For each empty slot, draft content from what you know of the project:',
57
+ '- `overview` — what the app is, who it serves, what an operator should know first.',
58
+ '- `stage-notes` — deployed URLs per stage, channel-to-stage mapping, release cadence',
59
+ ' (read `.sst/outputs.json` or ask; do not guess URLs).',
60
+ '- `notes` — anything project-specific that fits nowhere else. Leave it if nothing real.',
61
+ '',
62
+ 'Show the human your draft slot content and let them approve before writing — the',
63
+ 'runbook is theirs; you assist, you do not own it.',
64
+ '',
65
+ '## Step 3 — verify',
66
+ '',
67
+ 'Run `everystack runbook --check`: it must exit clean (slot edits never make it stale).',
68
+ 'Tell the human: regenerate any time with `everystack runbook`; CI can enforce currency',
69
+ 'with `--check`; after an everystack upgrade the diff reads as release notes for this app.',
70
+ ].join('\n'),
71
+ },
72
+ },
73
+ ],
74
+ };
75
+ },
76
+ );
77
+ }
@@ -38,6 +38,7 @@ These are enforced (everystack cheat gates) and load-bearing. Do not work around
38
38
  - `db/` — generated Drizzle schema + migrations (do not edit by hand)
39
39
  - `lib/` — shared code (auth context, API client)
40
40
  - `sst.config.ts` — AWS infrastructure definition
41
+ - `docs/RUNBOOK.md` — how to operate this app; regenerate with `everystack runbook`
41
42
 
42
43
  ## Structure
43
44