# Quick Migration Companion

## Description

Assists with the Amazon Quick side of a laptop-to-laptop migration. Recreates scheduled agents, restores tool permissions, configures ACP agents (with Windows PATH workarounds), installs skills from authoritative sources, sets up the monthly Quick↔Kiro memory sync agent, and validates capability parity end-to-end. Designed as a companion to the Kiro master migration skill — Quick handles its own domain artifacts while Kiro orchestrates the overall migration.

## Trigger Phrases

- "migrate Quick to new laptop"
- "set up Quick on new machine"
- "Quick migration companion"
- "recreate my agents on this laptop"
- "restore Quick after migration"

## Depends On

- outlook_builtin
- slack_builtin
- quick_suite__amazon_onedrive

## Context

This skill addresses the Quick-specific artifacts that must be recreated during a laptop migration. It was born from a real migration where premature sign-off occurred because agents verified file PRESENCE rather than CONTENT QUALITY, and "cloud-synced" was taken on faith rather than tested by recall.

**Hardware note**: Do NOT assume FIDO2/USB behavior is identical across laptop models — even within the same HP EliteBook family, different chassis (e.g., 845 G11 vs 8 G1a) may differ. Always test authentication flows on the actual target hardware.

### Anti-Patterns This Skill Prevents
1. Verifying by file counts instead of capability parity
2. Assuming cloud-sync means content arrived intact (skills may sync as stubs)
3. Static exports treated as equivalent to ingested memory
4. Four-agent echo chamber sign-off without rigor on fuzzy questions
5. Declaring "complete" before end-to-end quality verification

### Key Facts
- Quick Desktop config lives at: `C:\Users\{user}\.quickwork\profiles\federate-prod\`
- Config files: `agents.json`, `acp_agents.json`, `mcp_config.json`, `tool_permissions.json`, `user_preferences.json`
- ACP agents on Windows require FULL PATH to binaries (Quick does not inherit Windows PATH)
- MEMORY_FILE_PATH env var does NOT propagate into WSL node processes — must inline into bash command
- OneDrive search API does not support hyphens — use ListChildren to browse folders
- Slack file_download: >50MB may silently fail; Kiro WSL MCP has hard 50MB cap
- OneDrive/Agent-Space upload cap is ~20 MB per file — split large files or use Slack as fallback
- Child tasks (start_task) do NOT inherit Agent-Space auth — upload files from the main conversation only
- Grasp-auth ≠ Federate-auth — they expire independently; one green does not guarantee the other

## Workflow Steps

### Step 1: Inventory Old Laptop (AGENTIC)
**Goal**: Collect the authoritative state from the old laptop before it's wiped.

Ask the user for one of:
- A. Access to old laptop Quick (can query directly via email/Slack coordination)
- B. A pre-exported migration bundle (ZIP on OneDrive/SharePoint)
- C. Manual export — guide them to copy these files from old laptop:
  - `~/.quickwork/profiles/federate-prod/agents.json`
  - `~/.quickwork/profiles/federate-prod/acp_agents.json`
  - `~/.quickwork/profiles/federate-prod/mcp_config.json`
  - `~/.quickwork/profiles/federate-prod/tool_permissions.json`
  - Skills folder: `~/.quickwork/quicksuite/skills/` (all SKILL.md files)
  - Memory export: run `recall_memories` on key topics and save output

**Output**: Migration bundle available locally or on OneDrive.

### Step 2: Restore Tool Permissions (DETERMINISTIC)
**Goal**: Set tool_permissions.json to match old laptop's allow/deny rules.

1. Read the old laptop's `tool_permissions.json`
2. Write to `C:\Users\{user}\.quickwork\profiles\federate-prod\tool_permissions.json`
3. Standard baseline for field sellers:
```json
{
  "global_default": "allow_always",
  "browser": {
    "auto_allow_domains": [
      "sharepoint.com",
      "force.com", 
      "salesforce.com",
      "a2z.com",
      "amazon.dev"
    ]
  }
}
```
4. Verify by reading back and confirming structure.

### Step 3: Recreate Scheduled Agents (AGENTIC)
**Goal**: Recreate all scheduled agents with correct prompts, schedules, triggers, and modes.

For each agent from the old laptop's `agents.json`:
1. Extract: name, prompt, schedule (cron), enabled status, mode (AUTO/PROMPT), triggers
2. Call `create_scheduled_agent` with matching parameters
3. For SFDC-write agents, ALWAYS set mode = PROMPT (safety constraint)
4. For agents with code triggers, recreate via `create_trigger`
5. Verify with `list_scheduled_agents` — confirm count matches

**Error handling**: If `create_scheduled_agent` fails mid-batch:
- Log which agents succeeded vs failed
- Check for name collisions (agent already exists from a prior partial run)
- Retry failed agents individually with verbose error inspection
- Common failures: invalid cron syntax, prompt too long, trigger code syntax error
- Never proceed to Step 4 with a partial agent set — all must be created

**SFDC-write agents that MUST be PROMPT mode:**
- csm-originated-tagger
- csm-opp-team-auditor
- monthly-tech-activity-logger

**Example agent set for AGS CSMs (recreate YOUR agents from your exported agents.json — schedules below are illustrative only):**
| Agent | Schedule | Mode | Notes |
|-------|----------|------|-------|
| account-channel-monitor | Daily 8 AM | AUTO | Slack channel activity |
| morning-briefing | Weekdays 7:30 AM | AUTO | Calendar + email summary |
| weekly-account-digest | Mondays 8 AM | AUTO | Account health rollup |
| csm-originated-tagger | Daily 9 AM | PROMPT | SFDC writes |
| csm-opp-team-auditor | Wednesdays 9 AM | PROMPT | SFDC writes |
| weekly-sift-recommendations | Fridays 2 PM | AUTO | SIFT insight scan |
| monthly-tech-activity-logger | 1st Monday 9 AM | PROMPT | SFDC writes, code trigger for date guard |
| reinvent-cdpp-response-check | Daily 10 AM | AUTO | Seasonal — disable when not needed |
| post-ai-dlc-followup | Tuesdays 9 AM | AUTO | Post-session engagement |
| monthly-memory-export | 1st Monday 9 AM | PROMPT | Quick↔Kiro sync pipeline |

### Step 4: Configure ACP Agents (DETERMINISTIC)
**Goal**: Set up ACP agent definitions with full binary paths (Windows PATH workaround).

1. Read old laptop's `acp_agents.json` for agent definitions
2. For each agent, resolve the binary to its FULL Windows path:
   - Kiro CLI: `C:\Users\{user}\AppData\Local\Programs\kiro\kiro.exe`
   - Copilot: `C:\Users\{user}\AppData\Roaming\npm\copilot.cmd`
   - Claude Code: `C:\Users\{user}\AppData\Local\Toolbox\bin\claude.exe`
3. Ensure `env` blocks include required keys (e.g., Kiro API key: `KIRO_API_KEY`)
4. Write to `C:\Users\{user}\.quickwork\profiles\federate-prod\acp_agents.json`
5. Test each agent with a simple ping via `send_message_to_acp_agent`

**Claude Code specifics**: The `claude.exe --acp` flag does NOT exist. The working ACP command is:
`npx -y @agentclientprotocol/claude-agent-acp` — set this as the command in acp_agents.json with the full path to npx (e.g., `C:\Users\{user}\AppData\Roaming\npm\npx.cmd`).

**Known issue**: If agents fail with WinError 2 or "no output", the binary path is wrong or PATH isn't set in env block.

### Step 5: Install Skills (AGENTIC)
**Goal**: Restore skills from authoritative source and verify content quality.

1. Locate authoritative skill source (OneDrive ZIP, SharePoint, or local export)
2. Download and extract skill files
3. For each SKILL.md, install using `save_skill`
4. **CRITICAL VERIFICATION**: For each installed skill, verify content quality:
   - Check file size is reasonable (not a stub — stubs are typically <500 bytes)
   - Read first 20 lines — should contain full Description, Trigger Phrases, Workflow Steps
   - Compare against known section count from old laptop
   - If a skill looks truncated, re-download from authoritative source

**Content loss indicators** (from real migration):
- File present but <1KB when original was >5KB
- Missing Workflow Steps section
- Description present but all other sections empty
- "Depends On" lists skills not installed on machine

### Step 6: Ingest Critical Memories (AGENTIC)
**Goal**: Restore the most important procedural and preference memories.

Memory cannot be bulk-transferred — it must be re-learned. Priority order:
1. **User preferences** (formatting, style, interaction patterns)
2. **Tool strategies** (workarounds, known bugs, optimal approaches)
3. **Anti-patterns** (what NOT to do — learned from failures)
4. **People/org facts** (identity resolutions, reporting chains)
5. **Skill iteration histories** (why decisions were made)

For each category:
- Ask old Quick (via coordination thread) to export key memories using `recall_memories`
- Format as structured blocks with category tags
- Use `save_to_memory` to trigger ingestion
- Verify with `recall_memories` on key topics — target 0.85+ relevance

### Step 7: Set Up Monthly Memory Sync Agent (DETERMINISTIC)
**Goal**: Create the Quick↔Kiro monthly sync pipeline.

1. Create scheduled agent `monthly-memory-export`:
   - Schedule: First Monday, 9 AM
   - Mode: PROMPT
   - Prompt: Export new/changed memories since last export, write to `C:\Users\{user}\Kiro\LaptopMigration\quick-memory-export-{date}.md`, ping Slack self-DM for approval
   - Code trigger: Date guard (`new Date().getDate() <= 7`)
2. Verify Kiro side has matching fileCreated hook (coordinate via email thread)
3. Test with a dry run (don't write file, just show what would export)

### Step 8: Validate Capability Parity (AGENTIC)
**Goal**: Prove the new laptop can DO everything the old one could — not just that files exist.

**Validation checklist:**
| Category | Test | Pass Criteria |
|----------|------|---------------|
| Agents | `list_scheduled_agents` | Count matches, all enabled |
| Agents | Trigger one non-SFDC agent | Executes without error |
| ACP | `send_message_to_acp_agent` to Kiro | Gets response |
| Skills | Load each skill, check sections | No stubs, full content |
| Memory | `recall_memories("user preferences")` | Returns 5+ relevant hits |
| Memory | `recall_memories("tool strategies")` | Returns known workarounds |
| Permissions | Attempt browser on sharepoint.com | Auto-allows without prompt |
| Sync | Check `Kiro/LaptopMigration/` folder | Export file exists |
| OneDrive | List migration bundle folder | Accessible |
| Slack | Send test to self-DM | Delivered |

**Fail criteria**: ANY test returning stubs, empty results, or errors = migration NOT complete.

Only declare complete when ALL tests pass with quality content, not just presence.

## Resources

- Config path: `C:\Users\{user}\.quickwork\profiles\federate-prod\`
- Skills path: `C:\Users\{user}\.quickwork\quicksuite\skills\`
- Sync folder: `C:\Users\{user}\Kiro\LaptopMigration\`
- Authoritative skills ZIP: OneDrive folder `01X4N6TQYHHU3QCNMGAJGY3SWXPS5YFMBT`
- Coordination channel: Email thread or Slack self-DM D098FCPHBLK

## Notes

- This skill is the Quick half of a dual-skill approach. The Kiro master skill handles: spec scanning, hooks, WSL dev environment, Kiro-specific memory graph, and overall orchestration.
- The two skills communicate via shared filesystem (`Kiro/LaptopMigration/`) and Outlook email thread.
- For distribution to peers: publish to Skills Files Library on SharePoint (per John's decision).
- Always verify by CAPABILITY PARITY, never by artifact presence alone.
