Skip to content
Development
Command

/sync-init

Set up automated sync for a new project folder: email monitoring (Outlook), file change detection, and auto-update of all documents (PRD, presentations, etc.) every 2 hours via cron. Run this in any project folder to get the same automation as other projects.

From plugin
coco
79642 skills53 agents42 commands3 hooks
$ npx -y skills add coco-research/coco --agent claude-code

Command definition

sync-init.md
description: "Set up automated sync for a new project folder: email monitoring (Outlook), file change detection, and auto-update of all documents (PRD, presentations, etc.) every 2 hours via cron. Run this in any project folder to get the same automation as other projects."
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash
  - Glob
  - Grep
  - Agent
  - Skill
  - AskUserQuestion

/pmstudio-sync-init — Set Up Automated Sync for a New Project Folder

Run it inside any project folder to set up automated sync. Execute the init process (Steps 1–6 below) directly — there is no separate `project-sync` skill; this command performs the setup and drives `~/.claude/scripts/project-sync-orchestrator.sh`. This sets up:

1. **Email extraction** — Searches Outlook via AppleScript (Legacy Outlook, primary) for project-specific emails by keywords, stakeholders, and subject patterns. Falls back to MIME cache + HxStore binary extraction if AppleScript fails (New Outlook). 2. **File monitoring** — Detects new meeting notes, research docs, source files in watched directories 3. **Sync report** — Generates `.sync-report.md` listing what changed and which docs need updating 4. **Auto-update** — Claude CLI (`claude -p`, Sonnet, $2 budget cap) reads new content and updates all structured documents (PRD, presentations, architecture, roadmap, etc.) 5. **Persistent cron job** — Runs every 2 hours in background, persists across terminal closes and reboots

The 4-Step Pipeline (every 2 hours)

Step 1: Email Search (AppleScript → Outlook inbox/sent)
  ↓ new emails saved to project emails folder
Step 2: File Detection (scan watched dirs for new/modified files)
  ↓ changes detected
Step 3: Sync Report (.sync-report.md generated)
  ↓ lists changed files + which docs need updating
Step 4: Auto-Update (Claude CLI reads changes, updates all target docs)
  ↓ documents updated, sync report deleted

What it creates

| File | Location | Purpose | |------|----------|---------| | `.sync-watch.json` | Project root | Config: keywords, senders, watch dirs, target docs, auto-update budget | | `run-sync-<name>.sh` | `~/.claude/scripts/` | Wrapper script (avoids OneDrive `&` path issues in launchd XML) | | `com.claude.project-sync.<name>.plist` | `~/Library/LaunchAgents/` | launchd cron job (every 2 hours) | | State cache | `~/.claude/state/<project>/` | Timestamps, logs, cached config, auto-update logs |

`.sync-watch.json` Full Schema

{
  "project_name": "Project Name",
  "watch_dirs": ["emails", "docs", "Meeting-Notes"],
  "target_docs": {
    "tier1": [
      {
        "path": "docs/PRD.html",
        "name": "PRD",
        "update_from": ["emails", "Meeting-Notes"],
        "what": "New requirements, stakeholder feedback, decisions"
      }
    ],
    "tier2": [
      {
        "path": "docs/Presentation.html",
        "name": "Stakeholder Deck",
        "update_from": ["PRD"],
        "what": "Sync with PRD changes"
      }
    ]
  },
  "email_search": {
    "enabled": true,
    "keywords": ["project name", "jira-id", "product name"],
    "senders": ["stakeholder_name", "another_name"],
    "subject_patterns": ["RE: Known Thread Subject"],
    "dest_dir": "emails",
    "format": "txt"
  },
  "auto_update": {
    "enabled": true,
    "model": "sonnet",
    "max_budget_usd": 2.00
  },
  "ignore_patterns": [".*", "*.tmp", "~$*"],
  "file_types": [".md", ".html", ".docx", ".xlsx", ".pdf", ".eml", ".txt"]
}

Init Process

Step 1: Gather project info

Ask the user for (or infer from existing files like CLAUDE.local.md, existing emails, folder structure): 1. **Project name** 2. **Email search keywords** — project-specific terms (product names, Jira IDs, codenames) 3. **Key stakeholders/senders** — names to filter emails by 4. **Subject patterns** — known email thread subjects 5. **Watch directories** — folders to monitor (emails, meeting notes, research, etc.) 6. **Target documents** — tier1 (critical) and tier2 (secondary) docs to auto-update 7. **Email destination folder** — where to save discovered emails 8. **Email format** — `txt` (default) or `eml` 9. **Auto-update settings** — model (`sonnet` default), budget ($2.00 default)

Step 2: Create `.sync-watch.json` in project root

Step 3: Create wrapper script

Write `~/.claude/scripts/run-sync-<safe-name>.sh`:

#!/bin/bash
exec /bin/bash $HOME/.claude/scripts/project-sync-orchestrator.sh "/full/path/to/project"

**CRITICAL:** Use absolute paths (no `~`), quote the path (handles `&` in OneDrive paths).

Step 4: Create launchd plist

Write `~/Library/LaunchAgents/com.claude.project-sync.<safe-name>.plist` with:

  • ProgramArguments pointing to the wrapper script (NOT the project dir directly)
  • StartInterval: 7200 (2 hours)
  • RunAtLoad: true
  • HOME env var set explicitly
  • Log paths under `~/.claude/logs/`

Step 5: Activate & cache

mkdir -p ~/.claude/logs ~/.claude/state
launchctl load ~/Library/LaunchAgents/com.claude.project-sync.<safe-name>.plist

Then run manually once to cache config:

/bin/bash ~/.claude/scripts/run-sync-<safe-name>.sh

Step 6: Verify

`launchctl list | grep project-sync` — expect exit code 0.

Email Search Details

**Primary: AppleScript (Legacy Outlook)**

  • Full inbox + sent items access
  • Searches by sender name/address, subject keywords, subject patterns
  • Saves matching emails as `.txt` files with headers (Subject, From, Date)
  • Deduplicates by checking if message date already exists in file
  • Searches last 2000 messages per folder (messages are date-sorted, stops at timestamp)

**Fallback: MIME + HxStore (New Outlook)**

  • Parses `~/Library/Group Containers/UBF8T346G9.Office/Outlook/.../MimeFiles/` for clean email files
  • Scans `HxStore.hxd` binary for subject awareness (logged, not dumped)
  • Used automatically if AppleScript fails

Email Commands (also available)

These `/email-*` commands work alongside the sync cron:

| Command | What it does | |---------

Read more
@coco-research
Ships withcoco

495 personas across 13 departments, 229 skills[^installed] and 388 commands in the full catalog (coco 1.9.0, 2026-10-21). Agent skills, slash commands and subagents for Claude Code, Cursor, Codex and other AI coding agents.

796200 skills53 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
796
Star history of coco-research/coco on GitHub, a chart by star-history.com

Other commands on coco.

goal

goal

Command

Set, check, or complete the persistent project goal stored in .goal.md. Trigger as /coco-goal or /coco:goal.

@coco-research@coco-researchInstall Command
mermaid

mermaid

Command

Use when the user asks for a diagram or chart: flowchart, sequence, state, class, ER, or XY chart, as SVG, HTML, or terminal…

@coco-research@coco-researchInstall Command
read

read

Command

Show latest emails from a specific person. Usage: /email-read alice

@coco-research@coco-researchInstall Command
reply

reply

Command

Draft a reply to a specific email. Usage: /email-reply Project Phase 2 Contract Data

@coco-research@coco-researchInstall Command
save

save

Command

Save matching emails to a project folder for sync processing. Usage: /email-save alice to emails/

@coco-research@coco-researchInstall Command
search

search

Command

Search emails by subject keywords. Usage: /email-search github webhook

@coco-research@coco-researchInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command