[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E5D2EMJVS9RTXG241ETM19":3,"skill-same:01M7E5D2EMJVS9RTXG241ETM19":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M7E5D2EMJVS9RTXG241ETM19","speckit-ext-backlog-sync",null,"Spec-kit workflow command: speckit-ext-backlog-sync","stefanwalther\u002Fghn","stefanwalther","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F669728?v=4","01M7E59BWN972ZZWN6SJ3RBZS8","Stefan Walther","01M7E59BX6XCFE72NWR5BN5M78",1,"MIT","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-backlog-sync\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: speckit-ext-backlog-sync\ndescription: 'Spec-kit workflow command: speckit-ext-backlog-sync'\ncompatibility: Requires spec-kit project structure with .specify\u002F directory\nmetadata:\n  author: github-spec-kit\n  source: ext:commands\u002Fspeckit.ext.backlog-sync.md\n---\n\n## User Input\n\n```text\n$ARGUMENTS\n```\n\n## Outline\n\nPush unsynced backlog items from `specs\u002FBACKLOG.md` to Notion database. Keeps capture fast (local-only), syncs later on demand.\n\n**Core Principle**: One-way sync (Local → Notion), hash-based deduplication.\n\n### Execution Steps\n\n#### Phase 1: Load Credentials\n\n> **⚠️ SPECIFIC CREDENTIAL PATH**: Use ONLY `op:\u002F\u002Fapi-keys\u002Fspec-kit-extensions_db-coding-projects`. Do NOT search 1Password for other Notion-related items.\n\n1. **Check for Notion Credentials**\n\nCredentials are loaded from (checked in order):\n1. 1Password CLI (`op`) - recommended, no credentials on disk\n2. Environment variables - fallback for CI\u002Fautomation\n\n**Step 1a: Check for 1Password CLI**\n\nUse Bash tool:\n```bash\ncommand -v op >\u002Fdev\u002Fnull 2>&1 && echo \"OP_AVAILABLE=true\" || echo \"OP_AVAILABLE=false\"\n```\n\n**If OP_AVAILABLE=true**: Try to load from 1Password:\n\n```bash\nop read \"op:\u002F\u002Fapi-keys\u002Fspec-kit-extensions_db-coding-projects\u002Fcredential\" 2>\u002Fdev\u002Fnull && echo \"---SEPARATOR---\" && op read \"op:\u002F\u002Fapi-keys\u002Fspec-kit-extensions_db-coding-projects\u002Fdatabase_id\" 2>\u002Fdev\u002Fnull\n```\n\nIf both values returned (separated by `---SEPARATOR---`): Store as `NOTION_API_KEY` and `NOTION_DATABASE_ID`. Report `Credentials loaded from 1Password`. Continue to Phase 2.\n\nIf 1Password read fails (not signed in, item not found, etc.): Fall through to env var check.\n\n**Step 1b: Check Environment Variables**\n\nUse Bash tool:\n```bash\nif [ -n \"$NOTION_API_KEY\" ] && [ -n \"$NOTION_DATABASE_ID\" ]; then\n  echo \"ENV_AVAILABLE=true\"\nelse\n  echo \"ENV_AVAILABLE=false\"\nfi\n```\n\n**If ENV_AVAILABLE=true**: Use environment variables. Report `Credentials loaded from environment variables`. Continue to Phase 2.\n\n**If no credentials found**: Report error and exit:\n```\nError: Notion credentials not found.\n\nSetup (choose one):\n\nOption 1 - 1Password (recommended):\n  1. Create item in 1Password:\n     Vault: api-keys\n     Item name: spec-kit-extensions_db-coding-projects\n     Fields:\n       credential: secret_xxx...\n       database_id: 2c9ed9baa88a8065a5b2dde024c0a4fe\n\n  2. Sign in to 1Password CLI:\n     eval $(op signin)\n\nOption 2 - Environment variables (for CI):\n  export NOTION_API_KEY=\"secret_xxx...\"\n  export NOTION_DATABASE_ID=\"abc123...\"\n\nTo get credential values:\n1. API Key: https:\u002F\u002Fwww.notion.so\u002Fmy-integrations → New integration → Copy secret\n2. Database ID: Open database in Notion → Copy ID from URL\n\nThen re-run \u002Fspeckit.ext.backlog-sync\n```\n\n#### Phase 2: Validate API Connection\n\n2. **Test Notion API Access**\n\nVerify credentials work and database is accessible by querying the database metadata.\n\nUse Bash tool (with the credentials from Phase 1):\n\n```bash\ncurl -s -w \"\\n%{http_code}\" -X GET \"https:\u002F\u002Fapi.notion.com\u002Fv1\u002Fdatabases\u002F{NOTION_DATABASE_ID}\" \\\n  -H \"Authorization: Bearer {NOTION_API_KEY}\" \\\n  -H \"Notion-Version: 2022-06-28\"\n```\n\nParse the last line for HTTP status code.\n\n- **200**: Success - API connection verified\n  - Extract database title from response for confirmation\n  - Report: `API connection verified. Database: {title}`\n\n- **401 Unauthorized**:\n  - Report error and **exit**:\n    ```\n    Error: Authentication failed (401 Unauthorized).\n\n    Your API key is invalid or expired.\n    1. Go to https:\u002F\u002Fwww.notion.so\u002Fmy-integrations\n    2. Check your integration is active\n    3. Copy a fresh API key\n    4. Update in 1Password or environment variable\n    ```\n\n- **403 Forbidden**:\n  - Report error and **exit**:\n    ```\n    Error: Access denied (403 Forbidden).\n\n    The database is not shared with your integration.\n    1. Open the database in Notion\n    2. Click \"...\" menu → \"Connections\"\n    3. Add your integration (look for the integration name you created)\n    4. Re-run \u002Fspeckit.ext.backlog-sync\n    ```\n\n- **404 Not Found**:\n  - Report error and **exit**:\n    ```\n    Error: Database not found (404).\n\n    Check NOTION_DATABASE_ID is correct.\n    Current value: {NOTION_DATABASE_ID}\n\n    To find the correct ID:\n    1. Open the database in Notion\n    2. Copy the ID from the URL (the part after the workspace name)\n    ```\n\n- **Other errors**: Report and exit with the status code and response body.\n\n#### Phase 3: Parse Arguments\n\n3. **Check for Flags**\n\nParse `$ARGUMENTS` for flags:\n\n- **`--dry-run`**: Set `DRY_RUN=true` - preview only, no API calls\n- **`--all`**: Set `FORCE_ALL=true` - sync all items regardless of state\n\nIf neither flag is present, proceed with normal sync (unsynced items only).\n\nReport mode:\n```\nMode: [Normal sync | Dry run (preview only) | Force re-sync all]\n```\n\n#### Phase 4: Extract Project Key\n\n4. **Get Repository Name from Git Remote**\n\nUse Bash tool to extract project key:\n\n```bash\ngit remote get-url origin 2>\u002Fdev\u002Fnull || echo \"NO_REMOTE\"\n```\n\n**If \"NO_REMOTE\"**: Report error and exit:\n```\nError: No git remote configured. Cannot determine Project Key.\n\nFix: Add a git remote:\n  git remote add origin git@github.com:owner\u002Frepo.git\n```\n\n**Parse the URL** to extract just the repository name:\n- From `git@github.com:stefanwalther\u002Fspec-kit-extensions.git` → `spec-kit-extensions`\n- From `https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fspec-kit-extensions.git` → `spec-kit-extensions`\n- From `https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fspec-kit-extensions` → `spec-kit-extensions`\n\nUse Bash tool:\n```bash\ngit remote get-url origin | sed 's\u002F.*\\\u002F\u002F\u002F' | sed 's\u002F\\.git$\u002F\u002F'\n```\n\nStore as `PROJECT_KEY`.\n\nReport:\n```\nProject Key: {PROJECT_KEY}\n```\n\n#### Phase 5: Read Backlog\n\n5. **Read Backlog File**\n\nUse Glob tool to check for `specs\u002FBACKLOG.md`.\n\n**If missing**: Report and exit:\n```\nNo backlog file found at specs\u002FBACKLOG.md.\nRun \u002Fspeckit.ext.backlog --init-only to create it.\nNothing to sync.\n```\n\nUse Read tool to read `specs\u002FBACKLOG.md`.\n\n6. **Parse Backlog Items**\n\nExtract all unchecked items matching pattern `- [ ]` (exclude `- [x]` checked items).\n\nFor each item, extract the description text after `- [ ] `.\n\nCount total items found.\n\n**If 0 items**: Report and exit:\n```\nNo items in backlog. Nothing to sync.\n```\n\nReport:\n```\nFound {N} items in backlog.\n```\n\n#### Phase 6: Sync State Management\n\n7. **Read Sync State**\n\nUse Glob tool to check for `specs\u002F.backlog-sync-state.json`.\n\n**If exists**: Use Read tool to read it and parse JSON.\n\n**If missing or invalid JSON**: Initialize empty state:\n```json\n{\n  \"version\": 1,\n  \"project_key\": \"{PROJECT_KEY}\",\n  \"synced_items\": {}\n}\n```\n\n8. **Compute Hashes and Identify Unsynced Items**\n\nFor each backlog item, compute a simple hash (MD5 of description text).\n\nUse Bash tool to compute hash:\n```bash\necho -n \"item description here\" | md5\n```\n\nCompare hash against `synced_items` in state file.\n\n**If `--all` flag**: Mark all items as \"to sync\" regardless of hash.\n\n**If hash exists in state**: Mark as \"already synced\" (skip).\n\n**If hash not in state**: Mark as \"to sync\".\n\nReport:\n```\nItems to sync: {count}\nItems already synced: {count}\n```\n\n**If 0 items to sync** (and not `--all`): Report and exit:\n```\nAll items already synced. Nothing new to sync.\n```\n\n#### Phase 7: Preview (Dry Run) or Sync\n\n9. **Handle Dry Run Mode**\n\n**If `--dry-run` flag is set**:\n\nDisplay preview:\n```\nDRY RUN - Preview of items to sync:\n\n1. {description_1}\n2. {description_2}\n...\n\nWould create {N} pages in Notion database.\nNo changes made.\n```\n\n**Exit without making API calls or updating state.**\n\n10. **Sync Items to Notion**\n\nFor each item marked \"to sync\":\n\na. **Build Request Body**:\n\n```json\n{\n  \"parent\": { \"database_id\": \"{NOTION_DATABASE_ID}\" },\n  \"properties\": {\n    \"Item name\": {\n      \"title\": [{ \"text\": { \"content\": \"{description}\" } }]\n    },\n    \"Project Key\": {\n      \"select\": { \"name\": \"{PROJECT_KEY}\" }\n    },\n    \"Status\": {\n      \"status\": { \"name\": \"Backlog\" }\n    },\n    \"Priority\": {\n      \"select\": { \"name\": \"1 ~ Medium\" }\n    },\n    \"Notes\": {\n      \"rich_text\": [{ \"text\": { \"content\": \"{description} (from specs\u002FBACKLOG.md)\" } }]\n    },\n    \"AI Tools Used\": {\n      \"multi_select\": [{ \"name\": \"Claude Code\" }]\n    }\n  }\n}\n```\n\nNote: \"Item name\" is the title field in the Notion database. \"Project Key\" identifies the repository. \"Status\" uses the status type (not select).\n\nb. **Make API Call**:\n\nUse Bash tool to call Notion API:\n\n```bash\ncurl -s -w \"\\n%{http_code}\" -X POST 'https:\u002F\u002Fapi.notion.com\u002Fv1\u002Fpages' \\\n  -H \"Authorization: Bearer $NOTION_API_KEY\" \\\n  -H \"Notion-Version: 2022-06-28\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{request_body_json}'\n```\n\nc. **Handle Response**:\n\nParse the last line for HTTP status code.\n\n- **200\u002F201**: Success\n  - Extract `id` from response JSON\n  - Store in state: `synced_items[{hash}] = { description, synced_at, notion_page_id }`\n  - Report: `+ Synced: {description}`\n\n- **400 Bad Request**:\n  - Report: `x Failed: {description} - Bad request (check field names)`\n  - Continue to next item\n\n- **401 Unauthorized**:\n  - Report error and **stop sync**:\n    ```\n    Error: Authentication failed (401 Unauthorized).\n\n    Your NOTION_API_KEY may be invalid or expired.\n    1. Go to https:\u002F\u002Fwww.notion.so\u002Fmy-integrations\n    2. Check your integration is active\n    3. Copy a fresh API key\n    4. Update NOTION_API_KEY environment variable\n    ```\n\n- **403 Forbidden**:\n  - Report error and **stop sync**:\n    ```\n    Error: Access denied (403 Forbidden).\n\n    The database is not shared with your integration.\n    1. Open the database in Notion\n    2. Click \"...\" menu → \"Connections\"\n    3. Add your integration\n    4. Re-run \u002Fspeckit.ext.backlog-sync\n    ```\n\n- **404 Not Found**:\n  - Report error and **stop sync**:\n    ```\n    Error: Database not found (404).\n\n    Check NOTION_DATABASE_ID is correct:\n    Current value: {NOTION_DATABASE_ID}\n    ```\n\n- **429 Rate Limited**:\n  - Wait 1 second, retry up to 3 times\n  - If still failing after retries, report and continue:\n    ```\n    ! Rate limited: {description} - will retry on next sync\n    ```\n\n- **5xx Server Error**:\n  - Wait 2 seconds, retry once\n  - If still failing, report and continue:\n    ```\n    ! Server error: {description} - will retry on next sync\n    ```\n\n#### Phase 8: Update State File\n\n11. **Save Sync State**\n\nAfter processing all items, write updated state to `specs\u002F.backlog-sync-state.json`.\n\nUse Write tool to save:\n```json\n{\n  \"version\": 1,\n  \"project_key\": \"{PROJECT_KEY}\",\n  \"synced_items\": {\n    \"{hash1}\": {\n      \"description\": \"First item\",\n      \"synced_at\": \"2026-01-17T10:30:00Z\",\n      \"notion_page_id\": \"abc123\"\n    },\n    \"{hash2}\": {\n      ...\n    }\n  }\n}\n```\n\n#### Phase 9: Summary Report\n\n12. **Display Summary**\n\n```\nBacklog Sync Complete\n---------------------\nProject Key: {PROJECT_KEY}\nItems synced: {count}\nItems skipped (already synced): {count}\nErrors: {count}\n\nRun \u002Fspeckit.ext.backlog-sync --dry-run to preview future syncs.\n```\n\n## Usage\n\n```bash\n\u002Fspeckit.ext.backlog-sync           # Sync unsynced items\n\u002Fspeckit.ext.backlog-sync --dry-run # Preview without syncing\n\u002Fspeckit.ext.backlog-sync --all     # Force re-sync all items\n```\n\n## Notes\n\n**One-way sync**: This extension only pushes from local to Notion. Changes in Notion are not synced back.\n\n**Duplicate prevention**: Items are tracked by content hash. Same item text = same hash = skipped on subsequent syncs.\n\n**Project Key**: Derived from git remote, identifies which repository items came from in the Notion database.\n\n**State file**: `specs\u002F.backlog-sync-state.json` tracks what's been synced. Delete this file to force re-sync of all items (or use `--all` flag).","## User Input\n\n```text\n$ARGUMENTS\n```\n\n## Outline\n\nPush unsynced backlog items from `specs\u002FBACKLOG.md` to Notion database. Keeps capture fast (local-only), syncs later on demand.\n\n**Core Principle**: One-way sync (Local → Notion), hash-based deduplication.\n\n### Execution Steps\n\n#### Phase 1: Load Credentials\n\n> **⚠️ SPECIFIC CREDENTIAL PATH**: Use ONLY `op:\u002F\u002Fapi-keys\u002Fspec-kit-extensions_db-coding-projects`. Do NOT search 1Password for other Notion-related items.\n\n1. **Check for Notion Credentials**\n\nCredentials are loaded from (checked in order):\n1. 1Password CLI (`op`) - recommended, no credentials on disk\n2. Environment variables - fallback for CI\u002Fautomation\n\n**Step 1a: Check for 1Password CLI**\n\nUse Bash tool:\n```bash\ncommand -v op >\u002Fdev\u002Fnull 2>&1 && echo \"OP_AVAILABLE=true\" || echo \"OP_AVAILABLE=false\"\n```\n\n**If OP_AVAILABLE=true**: Try to load from 1Password:\n\n```bash\nop read \"op:\u002F\u002Fapi-keys\u002Fspec-kit-extensions_db-coding-projects\u002Fcredential\" 2>\u002Fdev\u002Fnull && echo \"---SEPARATOR---\" && op read \"op:\u002F\u002Fapi-keys\u002Fspec-kit-extensions_db-coding-projects\u002Fdatabase_id\" 2>\u002Fdev\u002Fnull\n```\n\nIf both values returned (separated by `---SEPARATOR---`): Store as `NOTION_API_KEY` and `NOTION_DATABASE_ID`. Report `Credentials loaded from 1Password`. Continue to Phase 2.\n\nIf 1Password read fails (not signed in, item not found, etc.): Fall through to env var check.\n\n**Step 1b: Check Environment Variables**\n\nUse Bash tool:\n```bash\nif [ -n \"$NOTION_API_KEY\" ] && [ -n \"$NOTION_DATABASE_ID\" ]; then\n  echo \"ENV_AVAILABLE=true\"\nelse\n  echo \"ENV_AVAILABLE=false\"\nfi\n```\n\n**If ENV_AVAILABLE=true**: Use environment variables. Report `Credentials loaded from environment variables`. Continue to Phase 2.\n\n**If no credentials found**: Report error and exit:\n```\nError: Notion credentials not found.\n\nSetup (choose one):\n\nOption 1 - 1Password (recommended):\n  1. Create item in 1Password:\n     Vault: api-keys\n     Item name: spec-kit-extensions_db-coding-projects\n     Fields:\n       credential: secret_xxx...\n       database_id: 2c9ed9baa88a8065a5b2dde024c0a4fe\n\n  2. Sign in to 1Password CLI:\n     eval $(op signin)\n\nOption 2 - Environment variables (for CI):\n  export NOTION_API_KEY=\"secret_xxx...\"\n  export NOTION_DATABASE_ID=\"abc123...\"\n\nTo get credential values:\n1. API Key: https:\u002F\u002Fwww.notion.so\u002Fmy-integrations → New integration → Copy secret\n2. Database ID: Open database in Notion → Copy ID from URL\n\nThen re-run \u002Fspeckit.ext.backlog-sync\n```\n\n#### Phase 2: Validate API Connection\n\n2. **Test Notion API Access**\n\nVerify credentials work and database is accessible by querying the database metadata.\n\nUse Bash tool (with the credentials from Phase 1):\n\n```bash\ncurl -s -w \"\\n%{http_code}\" -X GET \"https:\u002F\u002Fapi.notion.com\u002Fv1\u002Fdatabases\u002F{NOTION_DATABASE_ID}\" \\\n  -H \"Authorization: Bearer {NOTION_API_KEY}\" \\\n  -H \"Notion-Version: 2022-06-28\"\n```\n\nParse the last line for HTTP status code.\n\n- **200**: Success - API connection verified\n  - Extract database title from response for confirmation\n  - Report: `API connection verified. Database: {title}`\n\n- **401 Unauthorized**:\n  - Report error and **exit**:\n    ```\n    Error: Authentication failed (401 Unauthorized).\n\n    Your API key is invalid or expired.\n    1. Go to https:\u002F\u002Fwww.notion.so\u002Fmy-integrations\n    2. Check your integration is active\n    3. Copy a fresh API key\n    4. Update in 1Password or environment variable\n    ```\n\n- **403 Forbidden**:\n  - Report error and **exit**:\n    ```\n    Error: Access denied (403 Forbidden).\n\n    The database is not shared with your integration.\n    1. Open the database in Notion\n    2. Click \"...\" menu → \"Connections\"\n    3. Add your integration (look for the integration name you created)\n    4. Re-run \u002Fspeckit.ext.backlog-sync\n    ```\n\n- **404 Not Found**:\n  - Report error and **exit**:\n    ```\n    Error: Database not found (404).\n\n    Check NOTION_DATABASE_ID is correct.\n    Current value: {NOTION_DATABASE_ID}\n\n    To find the correct ID:\n    1. Open the database in Notion\n    2. Copy the ID from the URL (the part after the workspace name)\n    ```\n\n- **Other errors**: Report and exit with the status code and response body.\n\n#### Phase 3: Parse Arguments\n\n3. **Check for Flags**\n\nParse `$ARGUMENTS` for flags:\n\n- **`--dry-run`**: Set `DRY_RUN=true` - preview only, no API calls\n- **`--all`**: Set `FORCE_ALL=true` - sync all items regardless of state\n\nIf neither flag is present, proceed with normal sync (unsynced items only).\n\nReport mode:\n```\nMode: [Normal sync | Dry run (preview only) | Force re-sync all]\n```\n\n#### Phase 4: Extract Project Key\n\n4. **Get Repository Name from Git Remote**\n\nUse Bash tool to extract project key:\n\n```bash\ngit remote get-url origin 2>\u002Fdev\u002Fnull || echo \"NO_REMOTE\"\n```\n\n**If \"NO_REMOTE\"**: Report error and exit:\n```\nError: No git remote configured. Cannot determine Project Key.\n\nFix: Add a git remote:\n  git remote add origin git@github.com:owner\u002Frepo.git\n```\n\n**Parse the URL** to extract just the repository name:\n- From `git@github.com:stefanwalther\u002Fspec-kit-extensions.git` → `spec-kit-extensions`\n- From `https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fspec-kit-extensions.git` → `spec-kit-extensions`\n- From `https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fspec-kit-extensions` → `spec-kit-extensions`\n\nUse Bash tool:\n```bash\ngit remote get-url origin | sed 's\u002F.*\\\u002F\u002F\u002F' | sed 's\u002F\\.git$\u002F\u002F'\n```\n\nStore as `PROJECT_KEY`.\n\nReport:\n```\nProject Key: {PROJECT_KEY}\n```\n\n#### Phase 5: Read Backlog\n\n5. **Read Backlog File**\n\nUse Glob tool to check for `specs\u002FBACKLOG.md`.\n\n**If missing**: Report and exit:\n```\nNo backlog file found at specs\u002FBACKLOG.md.\nRun \u002Fspeckit.ext.backlog --init-only to create it.\nNothing to sync.\n```\n\nUse Read tool to read `specs\u002FBACKLOG.md`.\n\n6. **Parse Backlog Items**\n\nExtract all unchecked items matching pattern `- [ ]` (exclude `- [x]` checked items).\n\nFor each item, extract the description text after `- [ ] `.\n\nCount total items found.\n\n**If 0 items**: Report and exit:\n```\nNo items in backlog. Nothing to sync.\n```\n\nReport:\n```\nFound {N} items in backlog.\n```\n\n#### Phase 6: Sync State Management\n\n7. **Read Sync State**\n\nUse Glob tool to check for `specs\u002F.backlog-sync-state.json`.\n\n**If exists**: Use Read tool to read it and parse JSON.\n\n**If missing or invalid JSON**: Initialize empty state:\n```json\n{\n  \"version\": 1,\n  \"project_key\": \"{PROJECT_KEY}\",\n  \"synced_items\": {}\n}\n```\n\n8. **Compute Hashes and Identify Unsynced Items**\n\nFor each backlog item, compute a simple hash (MD5 of description text).\n\nUse Bash tool to compute hash:\n```bash\necho -n \"item description here\" | md5\n```\n\nCompare hash against `synced_items` in state file.\n\n**If `--all` flag**: Mark all items as \"to sync\" regardless of hash.\n\n**If hash exists in state**: Mark as \"already synced\" (skip).\n\n**If hash not in state**: Mark as \"to sync\".\n\nReport:\n```\nItems to sync: {count}\nItems already synced: {count}\n```\n\n**If 0 items to sync** (and not `--all`): Report and exit:\n```\nAll items already synced. Nothing new to sync.\n```\n\n#### Phase 7: Preview (Dry Run) or Sync\n\n9. **Handle Dry Run Mode**\n\n**If `--dry-run` flag is set**:\n\nDisplay preview:\n```\nDRY RUN - Preview of items to sync:\n\n1. {description_1}\n2. {description_2}\n...\n\nWould create {N} pages in Notion database.\nNo changes made.\n```\n\n**Exit without making API calls or updating state.**\n\n10. **Sync Items to Notion**\n\nFor each item marked \"to sync\":\n\na. **Build Request Body**:\n\n```json\n{\n  \"parent\": { \"database_id\": \"{NOTION_DATABASE_ID}\" },\n  \"properties\": {\n    \"Item name\": {\n      \"title\": [{ \"text\": { \"content\": \"{description}\" } }]\n    },\n    \"Project Key\": {\n      \"select\": { \"name\": \"{PROJECT_KEY}\" }\n    },\n    \"Status\": {\n      \"status\": { \"name\": \"Backlog\" }\n    },\n    \"Priority\": {\n      \"select\": { \"name\": \"1 ~ Medium\" }\n    },\n    \"Notes\": {\n      \"rich_text\": [{ \"text\": { \"content\": \"{description} (from specs\u002FBACKLOG.md)\" } }]\n    },\n    \"AI Tools Used\": {\n      \"multi_select\": [{ \"name\": \"Claude Code\" }]\n    }\n  }\n}\n```\n\nNote: \"Item name\" is the title field in the Notion database. \"Project Key\" identifies the repository. \"Status\" uses the status type (not select).\n\nb. **Make API Call**:\n\nUse Bash tool to call Notion API:\n\n```bash\ncurl -s -w \"\\n%{http_code}\" -X POST 'https:\u002F\u002Fapi.notion.com\u002Fv1\u002Fpages' \\\n  -H \"Authorization: Bearer $NOTION_API_KEY\" \\\n  -H \"Notion-Version: 2022-06-28\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{request_body_json}'\n```\n\nc. **Handle Response**:\n\nParse the last line for HTTP status code.\n\n- **200\u002F201**: Success\n  - Extract `id` from response JSON\n  - Store in state: `synced_items[{hash}] = { description, synced_at, notion_page_id }`\n  - Report: `+ Synced: {description}`\n\n- **400 Bad Request**:\n  - Report: `x Failed: {description} - Bad request (check field names)`\n  - Continue to next item\n\n- **401 Unauthorized**:\n  - Report error and **stop sync**:\n    ```\n    Error: Authentication failed (401 Unauthorized).\n\n    Your NOTION_API_KEY may be invalid or expired.\n    1. Go to https:\u002F\u002Fwww.notion.so\u002Fmy-integrations\n    2. Check your integration is active\n    3. Copy a fresh API key\n    4. Update NOTION_API_KEY environment variable\n    ```\n\n- **403 Forbidden**:\n  - Report error and **stop sync**:\n    ```\n    Error: Access denied (403 Forbidden).\n\n    The database is not shared with your integration.\n    1. Open the database in Notion\n    2. Click \"...\" menu → \"Connections\"\n    3. Add your integration\n    4. Re-run \u002Fspeckit.ext.backlog-sync\n    ```\n\n- **404 Not Found**:\n  - Report error and **stop sync**:\n    ```\n    Error: Database not found (404).\n\n    Check NOTION_DATABASE_ID is correct:\n    Current value: {NOTION_DATABASE_ID}\n    ```\n\n- **429 Rate Limited**:\n  - Wait 1 second, retry up to 3 times\n  - If still failing after retries, report and continue:\n    ```\n    ! Rate limited: {description} - will retry on next sync\n    ```\n\n- **5xx Server Error**:\n  - Wait 2 seconds, retry once\n  - If still failing, report and continue:\n    ```\n    ! Server error: {description} - will retry on next sync\n    ```\n\n#### Phase 8: Update State File\n\n11. **Save Sync State**\n\nAfter processing all items, write updated state to `specs\u002F.backlog-sync-state.json`.\n\nUse Write tool to save:\n```json\n{\n  \"version\": 1,\n  \"project_key\": \"{PROJECT_KEY}\",\n  \"synced_items\": {\n    \"{hash1}\": {\n      \"description\": \"First item\",\n      \"synced_at\": \"2026-01-17T10:30:00Z\",\n      \"notion_page_id\": \"abc123\"\n    },\n    \"{hash2}\": {\n      ...\n    }\n  }\n}\n```\n\n#### Phase 9: Summary Report\n\n12. **Display Summary**\n\n```\nBacklog Sync Complete\n---------------------\nProject Key: {PROJECT_KEY}\nItems synced: {count}\nItems skipped (already synced): {count}\nErrors: {count}\n\nRun \u002Fspeckit.ext.backlog-sync --dry-run to preview future syncs.\n```\n\n## Usage\n\n```bash\n\u002Fspeckit.ext.backlog-sync           # Sync unsynced items\n\u002Fspeckit.ext.backlog-sync --dry-run # Preview without syncing\n\u002Fspeckit.ext.backlog-sync --all     # Force re-sync all items\n```\n\n## Notes\n\n**One-way sync**: This extension only pushes from local to Notion. Changes in Notion are not synced back.\n\n**Duplicate prevention**: Items are tracked by content hash. Same item text = same hash = skipped on subsequent syncs.\n\n**Project Key**: Derived from git remote, identifies which repository items came from in the Notion database.\n\n**State file**: `specs\u002F.backlog-sync-state.json` tracks what's been synced. Delete this file to force re-sync of all items (or use `--all` flag).",{"name":5,"metadata":24,"description":7,"compatibility":27},{"author":25,"source":26},"github-spec-kit","ext:commands\u002Fspeckit.ext.backlog-sync.md","Requires spec-kit project structure with .specify\u002F directory","main","2045797696f3923d9e47519e2302e944260b2266",".specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-backlog-sync",0,"https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn","https:\u002F\u002Fgithub.com\u002Fstefanwalther","2026-11-15 06:19:35",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add stefanwalther\u002Fghn --skill speckit-ext-backlog-sync",{"tool":41,"command":42},"bunx","bunx skills add stefanwalther\u002Fghn --skill speckit-ext-backlog-sync",{"tool":44,"command":45},"pnpm","pnpm dlx skills add stefanwalther\u002Fghn --skill speckit-ext-backlog-sync","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-backlog-sync\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7E5EJAJD6R57EE4YSMDJWMP","speckit-ext-validate","Pre-merge validation and quality gate for feature completion","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-validate\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7E5EFW37C0QJ0VZZG7SAWHD","speckit-ext-update-workspace","Update workspace documentation after feature completion","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-update-workspace\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7E5EBDFYZPMJ1HM484EH8K8","speckit-ext-session-handover","Mid-implementation context handover with proactive monitoring and continuation prompts","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-session-handover\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7E5E92Y08ME10QRAW8T0ES9","speckit-ext-scope-change","Document scope changes and ad-hoc additions during feature implementation","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-scope-change\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7E5E3DJ0B3B0FHF0YQAE2JV","speckit-ext-pr","Create a pull request for spec-kit features with agent-based workflow and spec-kit context awareness","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-pr\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7E5E1B26HH69228R8MD54H5","speckit-ext-post-merge","Spec-kit workflow command: speckit-ext-post-merge","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-post-merge\u002FSKILL.md",[],[]]