shelfready 0.2.0 → 0.2.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/README.md CHANGED
@@ -4,7 +4,13 @@ Get an iOS app ready for the App Store shelf. ShelfReady reads your repo and kee
4
4
 
5
5
  It does not upload builds or fill in App Store Connect; use [`asc`](https://github.com/rudrankriyam/App-Store-Connect-CLI) or fastlane for that. ShelfReady covers the legal, privacy and web layer around them, with the EU steps most tools skip.
6
6
 
7
- Website and the full checklist: **[shelfready.dev](https://shelfready.dev)**
7
+ Try it in your app's repo, nothing to install:
8
+
9
+ ```sh
10
+ npx -y shelfready check
11
+ ```
12
+
13
+ Website, the full checklist and what common SDKs collect: **[shelfready.dev](https://shelfready.dev)**
8
14
 
9
15
  ## Quick start
10
16
 
@@ -31,19 +37,29 @@ shelf checklist --online # what's left before you submit
31
37
  | `shelf check` | Drift between `shelfready.yaml` and the repo, missing manifests, placeholder permission texts, unknown SDKs, trader details, in-app Impressum. `--ci` exits 1 on errors, `--online` checks the published pages, `--format github` annotates pull requests |
32
38
  | `shelf checklist` | The go-live checklist: automatic items from `check`, manual ones you tick with `--done <id>`; `--markdown` writes it as a file |
33
39
  | `shelf migrate` | Updates `shelfready.yaml` to the current schema, keeping your comments and style |
40
+ | `shelf agents` | Adds a short note to `AGENTS.md` (or `CLAUDE.md`) so coding agents in the repo run the checks before a release; `shelf init` offers it |
34
41
  | `shelf mcp` | Runs the MCP server on stdio, so Claude and other agents can use all of the above |
35
42
 
36
- ## Use with Claude
43
+ ## Use with your coding agent
37
44
 
38
- **Claude Code:** install the plugin. It adds a ShelfReady skill (the go-live workflow, what to ask you, how to fix each finding) and starts the MCP server for you.
45
+ ShelfReady includes an MCP server (`shelf mcp`) and a skill, so the agent you build your app with can run the whole go-live flow: scan the repo, ask you for the publisher details it can't know, write the pages and App Privacy answers, and work through the checklist.
39
46
 
47
+ **Claude Code** (terminal, VS Code, JetBrains, desktop): install the plugin, which adds the skill and starts the server.
48
+
49
+ ```sh
50
+ claude plugin marketplace add halfbatch-studio/shelfready
51
+ claude plugin install shelfready@shelfready
40
52
  ```
41
- /plugin install shelfready --marketplace halfbatch-studio/shelfready
42
- ```
43
53
 
44
- (Claude Code before 2.1.275: `/plugin marketplace add halfbatch-studio/shelfready`, then `/plugin install shelfready@shelfready`.) Then ask something like "get this app ready for the App Store".
54
+ Then ask: "get this app ready for the App Store".
55
+
56
+ **Codex CLI:**
57
+
58
+ ```sh
59
+ codex mcp add shelfready -- npx -y shelfready mcp
60
+ ```
45
61
 
46
- **Other MCP clients** (Claude Desktop, Cursor, …): add the server to the client's MCP config.
62
+ **Cursor, Claude Desktop, Windsurf and other MCP clients:** add this to the client's MCP config (for Cursor, `.cursor/mcp.json` in your app repo).
47
63
 
48
64
  ```json
49
65
  {
@@ -53,7 +69,9 @@ shelf checklist --online # what's left before you submit
53
69
  }
54
70
  ```
55
71
 
56
- Tools: `scan`, `init`, `check`, `checklist`, `tick`, `pages`, `app_privacy`, `sdk_info`, `migrate`. Each takes `path`, the app repo, and only ever writes inside it. The skill alone is in [`plugin/skills/shelfready`](plugin/skills/shelfready/SKILL.md) if you'd rather upload it to claude.ai.
72
+ Tools: `scan`, `init`, `check`, `checklist`, `tick`, `pages`, `app_privacy`, `sdk_info`, `migrate`. Each takes `path`, the app repo, and only ever writes inside it. The server is listed in the [MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.halfbatch-studio/shelfready`.
73
+
74
+ The skill, [`plugin/skills/shelfready/SKILL.md`](plugin/skills/shelfready/SKILL.md), follows the open Agent Skills format: copy the folder into any agent that reads skills, or upload it to claude.ai.
57
75
 
58
76
  ## GitHub Action
59
77
 
package/dist/cli.js CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { appendFileSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
3
- import { join, resolve } from "node:path";
2
+ import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
+ import { join, relative, resolve } from "node:path";
4
+ import { createInterface } from "node:readline/promises";
4
5
  import { createRequire } from "node:module";
5
6
  import { Command, Option } from "commander";
6
- import { appPrivacy, check, checklist, checklistMarkdown, checkOnline, CURRENT_VERSION, setTicks, factsToYAML, initFacts, legalView, migrateFile, pageFiles, readFacts, scan } from "./index.js";
7
+ import { addAgentsNote, agentsNoteFile, appPrivacy, check, checklist, checklistMarkdown, checklistSummary, checkOnline, CURRENT_VERSION, setTicks, factsToYAML, initFacts, legalView, migrateFile, pageFiles, readFacts, scan } from "./index.js";
7
8
  const program = new Command()
8
9
  .name("shelf")
9
10
  .description("Get an iOS app ready for the App Store shelf: legal pages, privacy truth, preflight.")
@@ -63,7 +64,9 @@ program
63
64
  .addOption(new Option("--voice <voice>", "how pages speak: I (solo) or we (team)").choices(["I", "we"]).default("we"))
64
65
  .option("--base-url <url>", "where the pages will live, e.g. https://example.com/myapp/")
65
66
  .option("--force", "overwrite an existing shelfready.yaml")
66
- .action((path, o) => {
67
+ .option("--agents-note", "add a ShelfReady note to AGENTS.md (or CLAUDE.md) without asking")
68
+ .option("--no-agents-note", "don't add the note and don't ask")
69
+ .action(async (path, o) => {
67
70
  const out = factsPath(path);
68
71
  if (existsSync(out) && !o.force) {
69
72
  console.error(`${out} exists. Use --force to overwrite.`);
@@ -81,7 +84,42 @@ program
81
84
  console.log(`Wrote ${out}`);
82
85
  for (const n of result.notes)
83
86
  console.log(n.replace("generate the pages", "run `shelf pages`"));
87
+ await offerAgentsNote(path, o.agentsNote);
84
88
  });
89
+ program
90
+ .command("agents")
91
+ .description("Add a short ShelfReady note to AGENTS.md (or CLAUDE.md), so coding agents in this repo run the checks before a release.")
92
+ .argument("[path]", "app repository", ".")
93
+ .action((path) => reportAgentsNote(addAgentsNote(path)));
94
+ /** A path to show: relative to where you are, unless that climbs out of it. */
95
+ const shown = (file) => {
96
+ const rel = relative(process.cwd(), file);
97
+ return rel && !rel.startsWith("..") ? rel : file;
98
+ };
99
+ function reportAgentsNote(r) {
100
+ const name = shown(r.file);
101
+ console.log(r.action === "present" ? `${name} already has the ShelfReady note.` : `${r.action === "created" ? "Created" : "Added the ShelfReady note to"} ${name}.`);
102
+ }
103
+ async function offerAgentsNote(path, choice) {
104
+ if (choice === false)
105
+ return;
106
+ const target = agentsNoteFile(path);
107
+ if (existsSync(target) && readFileSync(target, "utf8").includes("<!-- shelfready -->"))
108
+ return;
109
+ const file = shown(target);
110
+ if (choice === undefined) {
111
+ if (!process.stdin.isTTY || !process.stdout.isTTY) {
112
+ console.log(`Tip: \`shelf agents\` adds a note to ${file} so coding agents in this repo run \`shelf check\` before a release.`);
113
+ return;
114
+ }
115
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
116
+ const answer = await rl.question(`Add a ShelfReady note to ${file}, so coding agents (Claude Code, Codex, Cursor, Xcode) run the checks before a release? [Y/n] `);
117
+ rl.close();
118
+ if (/^n/i.test(answer.trim()))
119
+ return;
120
+ }
121
+ reportAgentsNote(addAgentsNote(path));
122
+ }
85
123
  program
86
124
  .command("pages")
87
125
  .description("Generate privacy policy, support page and Impressum (DE/AT) as Markdown; --swiftui adds LegalView.swift.")
@@ -196,7 +234,7 @@ program
196
234
  console.log(md);
197
235
  return;
198
236
  }
199
- const icon = { done: "✓", todo: "○", fail: "✗" };
237
+ const icon = { done: "✓", todo: "○", fail: "✗", unchecked: "?" };
200
238
  for (const group of [...new Set(rows.map((r) => r.group))]) {
201
239
  console.log(`\n${group}`);
202
240
  for (const r of rows.filter((x) => x.group === group)) {
@@ -206,8 +244,7 @@ program
206
244
  console.log(` ${r.how}`);
207
245
  }
208
246
  }
209
- const done = rows.filter((r) => r.status === "done").length;
210
- console.log(`\n${done} of ${rows.length} done.${rows.some((r) => !r.automatic && r.status !== "done") ? " Tick manual items with: shelf checklist --done <id>" : ""}`);
247
+ console.log(`\n${checklistSummary(rows)}${rows.some((r) => !r.automatic && r.status !== "done") ? " Tick manual items with: shelf checklist --done <id>" : ""}`);
211
248
  });
212
249
  program
213
250
  .command("migrate")
@@ -0,0 +1,10 @@
1
+ /** The note every coding agent in the repo reads (AGENTS.md, or CLAUDE.md when that's what the repo uses). */
2
+ export declare const AGENTS_NOTE = "<!-- shelfready -->\n## App Store release (ShelfReady)\n\nThe privacy policy, support page, Impressum and App Privacy answers are generated by [ShelfReady](https://shelfready.dev) from `shelfready.yaml`.\n\n- Before a release, or after adding an SDK, a permission or a privacy manifest: run `npx -y shelfready check` and fix what it reports.\n- Edit `shelfready.yaml`, never the generated pages; regenerate them with `npx -y shelfready pages`.\n- What's left before submitting: `npx -y shelfready checklist --online`.\n";
3
+ export interface AgentsNoteResult {
4
+ file: string;
5
+ action: "created" | "appended" | "present";
6
+ }
7
+ /** Which file gets the note: AGENTS.md if present, else CLAUDE.md if present, else a new AGENTS.md. */
8
+ export declare function agentsNoteFile(root: string): string;
9
+ /** Add the ShelfReady note once. Idempotent: does nothing if the note is already there. */
10
+ export declare function addAgentsNote(root: string): AgentsNoteResult;
@@ -0,0 +1,32 @@
1
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ const MARKER = "<!-- shelfready -->";
4
+ /** The note every coding agent in the repo reads (AGENTS.md, or CLAUDE.md when that's what the repo uses). */
5
+ export const AGENTS_NOTE = `${MARKER}
6
+ ## App Store release (ShelfReady)
7
+
8
+ The privacy policy, support page, Impressum and App Privacy answers are generated by [ShelfReady](https://shelfready.dev) from \`shelfready.yaml\`.
9
+
10
+ - Before a release, or after adding an SDK, a permission or a privacy manifest: run \`npx -y shelfready check\` and fix what it reports.
11
+ - Edit \`shelfready.yaml\`, never the generated pages; regenerate them with \`npx -y shelfready pages\`.
12
+ - What's left before submitting: \`npx -y shelfready checklist --online\`.
13
+ `;
14
+ /** Which file gets the note: AGENTS.md if present, else CLAUDE.md if present, else a new AGENTS.md. */
15
+ export function agentsNoteFile(root) {
16
+ const agents = join(root, "AGENTS.md");
17
+ const claude = join(root, "CLAUDE.md");
18
+ return existsSync(agents) || !existsSync(claude) ? agents : claude;
19
+ }
20
+ /** Add the ShelfReady note once. Idempotent: does nothing if the note is already there. */
21
+ export function addAgentsNote(root) {
22
+ const file = agentsNoteFile(root);
23
+ if (!existsSync(file)) {
24
+ writeFileSync(file, `# Agent notes\n\n${AGENTS_NOTE}`);
25
+ return { file, action: "created" };
26
+ }
27
+ const text = readFileSync(file, "utf8");
28
+ if (text.includes(MARKER) || text.includes("npx -y shelfready check"))
29
+ return { file, action: "present" };
30
+ writeFileSync(file, `${text.replace(/\s*$/, "")}\n\n${AGENTS_NOTE}`);
31
+ return { file, action: "appended" };
32
+ }
@@ -6,7 +6,8 @@ import type { ScanResult } from "./scan.js";
6
6
  * from `check` (and `check --online`); the rest are manual and ticked with `shelf checklist --done <id>`,
7
7
  * which stores the date in shelfready.yaml.
8
8
  */
9
- export type Status = "done" | "todo" | "fail";
9
+ /** `unchecked`: an automatic item that needs `--online` and wasn't verified this run. */
10
+ export type Status = "done" | "todo" | "fail" | "unchecked";
10
11
  export interface Context {
11
12
  facts: Facts;
12
13
  scan: ScanResult;
@@ -41,4 +42,6 @@ export declare function checklist(c: Context): ChecklistRow[];
41
42
  export declare function checklistMarkdown(rows: ChecklistRow[], appName: string): string;
42
43
  /** Tick or untick manual items in shelfready.yaml, keeping comments and style. Returns the new file text. */
43
44
  export declare function setTicks(path: string, ids: string[], done: boolean, date?: string): string;
45
+ /** "15 of 18 done." plus how many live-page items weren't checked. */
46
+ export declare function checklistSummary(rows: ChecklistRow[]): string;
44
47
  export {};
@@ -8,7 +8,7 @@ const de = (f) => needsImpressum(f);
8
8
  function onlineItem(page) {
9
9
  return (c) => {
10
10
  if (!c.online)
11
- return { status: "todo", detail: "run with --online to verify" };
11
+ return { status: "unchecked", detail: "not checked; run with --online" };
12
12
  const f = c.online.filter((x) => x.rule.startsWith(`online.${page}`));
13
13
  if (f.some((x) => x.level === "error"))
14
14
  return { status: "fail", detail: f.find((x) => x.level === "error").message };
@@ -134,7 +134,7 @@ export function checklist(c) {
134
134
  return ITEMS.filter((i) => !i.applies || i.applies(c.facts)).map((i) => {
135
135
  if (i.auto) {
136
136
  const r = i.auto(c);
137
- return { id: i.id, group: i.group, title: i.title, status: r.status, automatic: true, ...(r.detail ? { detail: r.detail } : {}), ...(r.status !== "done" ? { how: i.how(c) } : {}) };
137
+ return { id: i.id, group: i.group, title: i.title, status: r.status, automatic: true, ...(r.detail ? { detail: r.detail } : {}), ...(r.status !== "done" && r.status !== "unchecked" ? { how: i.how(c) } : {}) };
138
138
  }
139
139
  const date = ticks[i.id];
140
140
  return date
@@ -143,11 +143,11 @@ export function checklist(c) {
143
143
  });
144
144
  }
145
145
  export function checklistMarkdown(rows, appName) {
146
- const out = [`# ${appName} go-live checklist`, "", `_${rows.filter((r) => r.status === "done").length} of ${rows.length} done. Generated by \`shelf checklist --markdown\`._`, ""];
146
+ const out = [`# ${appName} go-live checklist`, "", `_${checklistSummary(rows)} Generated by \`shelf checklist --markdown\`._`, ""];
147
147
  for (const group of [...new Set(rows.map((r) => r.group))]) {
148
148
  out.push(`## ${group}`, "");
149
149
  for (const r of rows.filter((x) => x.group === group)) {
150
- const note = r.status === "done" ? (r.detail ? ` (${r.detail})` : "") : r.how ? `: ${r.how}` : "";
150
+ const note = r.status === "done" || r.status === "unchecked" ? (r.detail ? ` (${r.detail})` : "") : r.how ? `: ${r.how}` : "";
151
151
  out.push(`- [${r.status === "done" ? "x" : " "}] **${r.title}**${note}${r.automatic ? "" : ` \`${r.id}\``}`);
152
152
  }
153
153
  out.push("");
@@ -174,3 +174,9 @@ export function setTicks(path, ids, done, date = new Date().toISOString().slice(
174
174
  }
175
175
  return doc.toString({ lineWidth: 100, indentSeq: usesIndentedLists(text) });
176
176
  }
177
+ /** "15 of 18 done." plus how many live-page items weren't checked. */
178
+ export function checklistSummary(rows) {
179
+ const done = rows.filter((r) => r.status === "done").length;
180
+ const unchecked = rows.filter((r) => r.status === "unchecked").length;
181
+ return `${done} of ${rows.length} done.${unchecked ? ` ${unchecked} not checked: live pages are only verified with --online.` : ""}`;
182
+ }
package/dist/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from "./core/migrate.js";
8
8
  export * from "./core/online.js";
9
9
  export * from "./core/checklist.js";
10
10
  export * from "./core/knowledge.js";
11
+ export * from "./core/agents.js";
package/dist/index.js CHANGED
@@ -9,3 +9,4 @@ export * from "./core/migrate.js";
9
9
  export * from "./core/online.js";
10
10
  export * from "./core/checklist.js";
11
11
  export * from "./core/knowledge.js";
12
+ export * from "./core/agents.js";
package/dist/mcp.js CHANGED
@@ -5,7 +5,7 @@ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
5
5
  import { createRequire } from "node:module";
6
6
  import { dirname, isAbsolute, join, relative, resolve } from "node:path";
7
7
  import { createInterface } from "node:readline";
8
- import { appPrivacy, check, checklist, checkOnline, CURRENT_VERSION, factsToYAML, initFacts, knowledgeBase, legalView, lookup, migrateFile, pageFiles, readFacts, scan, sdkCollects, sdkTracks, setTicks, } from "./index.js";
8
+ import { addAgentsNote, appPrivacy, check, checklist, checklistSummary, checkOnline, CURRENT_VERSION, factsToYAML, initFacts, knowledgeBase, legalView, lookup, migrateFile, pageFiles, readFacts, scan, sdkCollects, sdkTracks, setTicks, } from "./index.js";
9
9
  const VERSION = createRequire(import.meta.url)("../package.json").version;
10
10
  const PROTOCOL_VERSIONS = ["2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"];
11
11
  const INSTRUCTIONS = `ShelfReady gets an iOS app ready for the App Store: privacy policy, support page, Impressum (DE/AT), App Privacy answers and a go-live checklist, all generated from one file, shelfready.yaml, in the app's repo.
@@ -96,6 +96,7 @@ export const TOOLS = [
96
96
  voice: { type: "string", enum: ["I", "we"], description: "How pages speak: I (solo developer) or we (team)." },
97
97
  baseUrl: str("Where the pages will live, e.g. https://example.com/myapp/"),
98
98
  force: bool("Overwrite an existing shelfready.yaml."),
99
+ agentsNote: bool("Also add a short ShelfReady note to AGENTS.md (or CLAUDE.md, if the repo uses that) so coding agents run the checks before a release. Ask the developer first."),
99
100
  },
100
101
  required: ["country", "email"],
101
102
  },
@@ -114,7 +115,13 @@ export const TOOLS = [
114
115
  }
115
116
  const yaml = factsToYAML(result.facts);
116
117
  writeFileSync(out, yaml);
117
- return { text: [`Wrote ${out}`, ...result.notes].join("\n"), data: { file: out, notes: result.notes, yaml } };
118
+ const lines = [`Wrote ${out}`, ...result.notes];
119
+ let agents;
120
+ if (a.agentsNote === true) {
121
+ agents = addAgentsNote(root);
122
+ lines.push(agents.action === "present" ? `${relative(root, agents.file)} already has the ShelfReady note.` : `${agents.action === "created" ? "Created" : "Added the ShelfReady note to"} ${relative(root, agents.file)}.`);
123
+ }
124
+ return { text: lines.join("\n"), data: { file: out, notes: result.notes, yaml, ...(agents ? { agentsNote: agents } : {}) } };
118
125
  },
119
126
  },
120
127
  {
@@ -138,10 +145,11 @@ export const TOOLS = [
138
145
  run: async (a) => {
139
146
  const r = await findingsFor(repo(a), a.online === true);
140
147
  const rows = checklist({ facts: r.facts, scan: r.scan, findings: check(r.facts, r.scan, { fileVersion: r.fileVersion }), ...(r.onlineFindings ? { online: r.onlineFindings } : {}) });
141
- const mark = { done: "✓", todo: "○", fail: "✗" };
148
+ const mark = { done: "✓", todo: "○", fail: "✗", unchecked: "?" };
142
149
  const lines = rows.map((x) => `${mark[x.status]} ${x.title}${x.detail ? ` (${x.detail})` : ""}${x.automatic ? "" : ` [${x.id}]`}${x.status !== "done" && x.how ? `\n ${x.how}` : ""}`);
143
150
  const done = rows.filter((x) => x.status === "done").length;
144
- return { text: `${lines.join("\n")}\n\n${done} of ${rows.length} done.`, data: { done, total: rows.length, items: rows } };
151
+ const unchecked = rows.filter((x) => x.status === "unchecked").length;
152
+ return { text: `${lines.join("\n")}\n\n${checklistSummary(rows).replace("--online", "online: true")}`, data: { done, unchecked, total: rows.length, items: rows } };
145
153
  },
146
154
  },
147
155
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shelfready",
3
- "version": "0.2.0",
4
- "description": "Get an iOS app ready for the App Store shelf: legal pages, privacy truth, preflight.",
3
+ "version": "0.2.1",
4
+ "description": "Get an iOS app ready for the App Store: legal pages, App Privacy answers, privacy manifests and a go-live checklist. CLI and MCP server for coding agents.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "shelf": "dist/cli.js",
@@ -58,6 +58,18 @@
58
58
  "gdpr",
59
59
  "app-privacy",
60
60
  "cli",
61
- "fastlane"
62
- ]
61
+ "fastlane",
62
+ "mcp",
63
+ "mcp-server",
64
+ "model-context-protocol",
65
+ "claude",
66
+ "claude-code",
67
+ "codex",
68
+ "cursor",
69
+ "ai-agents",
70
+ "swift",
71
+ "xcode",
72
+ "app-store-connect"
73
+ ],
74
+ "mcpName": "io.github.halfbatch-studio/shelfready"
63
75
  }