$npx -y skills add AlpacaLabsLLC/skills-for-architects --skill master-scheduleSilent setup check. Verifies master-schedule.json exists and the sheet is accessible. If not, copies the template sheet to the user's account and writes master-schedule.json. Called automatically by other skills before reading or writing product data.
| 1 | # /master-schedule — Sheet Setup Check |
| 2 | |
| 3 | **Called automatically by all product skills before reading or writing.** Can also be run manually to reconnect or reset. |
| 4 | |
| 5 | Template sheet ID: `1mWnExnSWTKJv0vbu1mDnrQFmv_Iz_fNklIeuBYfMB5k` |
| 6 | |
| 7 | --- |
| 8 | |
| 9 | ## Step 1: Check for master-schedule.json |
| 10 | |
| 11 | ```bash |
| 12 | cat ./master-schedule.json 2>/dev/null |
| 13 | ``` |
| 14 | |
| 15 | **Legacy config:** if `master-schedule.json` is missing but `./canoa.json` exists (written by plugin versions ≤ 1.0.0), migrate it — `mv ./canoa.json ./master-schedule.json` — and continue as found. |
| 16 | |
| 17 | ### Found and valid → Step 2 (verify access) |
| 18 | ### Not found → Step 3 (auto-setup) |
| 19 | |
| 20 | --- |
| 21 | |
| 22 | ## Step 2: Verify Sheet Access |
| 23 | |
| 24 | Call `mcp__google-sheets__list_sheets` with the `master_sheet_id` from `master-schedule.json`. |
| 25 | |
| 26 | - **Success** → sheet is accessible. Return silently — the calling skill continues. |
| 27 | - **404 / error** → sheet was deleted or moved. Proceed to Step 3 to set up a new one. |
| 28 | |
| 29 | --- |
| 30 | |
| 31 | ## Step 3: Auto-Setup |
| 32 | |
| 33 | No config found or sheet inaccessible. Set up automatically without asking the user. |
| 34 | |
| 35 | ### 3a: Copy the template |
| 36 | |
| 37 | Attempt to copy the template sheet using the Google Drive API (`files.copy`). If a Drive MCP tool is available, use it: |
| 38 | |
| 39 | ``` |
| 40 | drive.files.copy |
| 41 | fileId: "1mWnExnSWTKJv0vbu1mDnrQFmv_Iz_fNklIeuBYfMB5k" |
| 42 | title: "Product Library — {today's date}" |
| 43 | ``` |
| 44 | |
| 45 | **If no Drive copy tool is available**, fall back to creating a new spreadsheet and writing the header row: |
| 46 | |
| 47 | 1. Call `mcp__google-sheets__create_spreadsheet` with title `"Product Library — {today's date}"` |
| 48 | 2. Write the 33-column header row to `Sheet1!A1:AG1` using the CSV header from `../../schema/product-schema.md` |
| 49 | |
| 50 | Note in `master-schedule.json` whether this was a template copy or a fresh sheet (`"setup": "copy"` or `"setup": "fresh"`). |
| 51 | |
| 52 | ### 3b: Identify the Products tab |
| 53 | |
| 54 | Look for a tab named `Products`. If not found (e.g. fresh sheet named `Sheet1`), use whatever tab exists and record its name in `master-schedule.json`. |
| 55 | |
| 56 | ### 3c: Write master-schedule.json |
| 57 | |
| 58 | ```json |
| 59 | { |
| 60 | "master_sheet_id": "{new sheet ID}", |
| 61 | "sheet_title": "Product Library — {date}", |
| 62 | "sheet_url": "https://docs.google.com/spreadsheets/d/{id}", |
| 63 | "products_tab": "Products", |
| 64 | "project_name": "", |
| 65 | "setup": "copy", |
| 66 | "created_at": "{ISO timestamp}" |
| 67 | } |
| 68 | ``` |
| 69 | |
| 70 | ### 3d: Notify the user |
| 71 | |
| 72 | ``` |
| 73 | ✓ Product library created and connected. |
| 74 | docs.google.com/spreadsheets/d/{id} |
| 75 | |
| 76 | You may want to rename this sheet and set a project name. |
| 77 | Run /master-schedule to update. |
| 78 | ``` |
| 79 | |
| 80 | Then return — the calling skill continues. |
| 81 | |
| 82 | --- |
| 83 | |
| 84 | ## Manual Run |
| 85 | |
| 86 | When invoked directly (`/master-schedule`), run the same flow but also: |
| 87 | |
| 88 | - If `master-schedule.json` exists and the sheet is accessible, show current status: |
| 89 | |
| 90 | ``` |
| 91 | Product library connected. |
| 92 | |
| 93 | Project: {project_name or "(unnamed)"} |
| 94 | Sheet: {sheet_title} |
| 95 | URL: docs.google.com/spreadsheets/d/{id} |
| 96 | Tab: {products_tab} |
| 97 | |
| 98 | Options: |
| 99 | 1. Update project name |
| 100 | 2. Connect a different sheet (paste URL) |
| 101 | 3. Reset (create a new copy of the template) |
| 102 | ``` |
| 103 | |
| 104 | - If user chooses (2), ask for URL, validate, update `master-schedule.json`. |
| 105 | - If user chooses (3), run Step 3 again. |
| 106 | |
| 107 | --- |
| 108 | |
| 109 | ## MCP Connection Errors |
| 110 | |
| 111 | If any MCP call fails with "tool not found" or auth error, stop and report: |
| 112 | |
| 113 | ``` |
| 114 | Google Sheets MCP is not connected or not authenticated. |
| 115 | |
| 116 | To connect it, add to your user-level MCP settings (mcp_settings.json in your Claude config directory): |
| 117 | |
| 118 | { |
| 119 | "mcpServers": { |
| 120 | "google-sheets": { |
| 121 | "command": "npx", |
| 122 | "args": ["-y", "@modelcontextprotocol/server-google-sheets"], |
| 123 | "env": { |
| 124 | "GOOGLE_SERVICE_ACCOUNT_KEY": "<path-to-service-account-json>" |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | Then restart Claude Code and try again. |
| 131 | Need help creating a service account? Ask for instructions. |
| 132 | ``` |
| 133 | |
| 134 | --- |
| 135 | |
| 136 | ## Edge Cases |
| 137 | |
| 138 | | Situation | Handling | |
| 139 | |-----------|----------| |
| 140 | | `master-schedule.json` exists, sheet accessible | Return silently | |
| 141 | | `master-schedule.json` exists, sheet deleted | Auto-create new copy, update `master-schedule.json` | |
| 142 | | `master-schedule.json` missing | Auto-create new copy, write `master-schedule.json` | |
| 143 | | Drive copy tool not available | Fall back to fresh sheet + header row | |
| 144 | | MCP not connected | Stop, show setup instructions | |