microsoft/knowledge-sync
Sync ADO work items and ICM incidents to the persistent knowledge log. Invoked automatically by /review, /workitem, and /pac-cli-update when knowledge is stale.
npx skills add https://github.com/microsoft/powerplatform-build-tools --skill knowledge-sync
Reads ADO work items and ICM incidents for the PPBT area, extracts patterns and fixes,
and appends them to a persistent knowledge log. Each run only fetches items newer than
the last sync — knowledge accumulates over time rather than being overwritten.
Invoke as: /knowledge-sync
Also invoked automatically (inline) by /review, /workitem, and /pac-cli-update
when the knowledge base is more than 7 days old. No manual scheduling needed.
All persistent knowledge lives in two files in the memory directory:
memory/ado-knowledge.md — append-only log of every work item and incident processed,grouped by run date. Never overwrite — only append new entries.
memory/MEMORY.md — the live distilled summary: hard rules, patterns, and skill inventory.Update this with confirmed facts extracted from ado-knowledge.md.
The sync tracks progress via a ## Last sync header in ado-knowledge.md. Each run reads
that date, queries only items changed after that date, appends new findings, then updates
the header. On the very first run (no ado-knowledge.md exists), query the past 90 days as
the bootstrap window.
# Check if knowledge log exists and find last sync date
cat memory/ado-knowledge.md 2>/dev/null | grep "## Last sync" | tail -1
@since in WIQL queries below@Today - 90 as @since (first-run bootstrap)az devops configure \
--defaults organization=https://dev.azure.com/dynamicscrm project=OneCRM 2>&1
az devops configure --list 2>&1
If az login is needed (browser flow — no username/password):
az login --use-device-code
# Active items (all — re-read on every sync to catch state changes)
az boards query --wiql "
SELECT [System.Id], [System.Title], [System.State], [System.WorkItemType],
[System.Tags], [Microsoft.VSTS.Common.Priority], [System.ChangedDate]
FROM WorkItems
WHERE [System.AreaPath] UNDER 'OneCRM\Client\UnifiedClient\AppLifeCycle\PPBT Extensions'
AND [System.State] NOT IN ('Closed', 'Resolved', 'Done')
ORDER BY [Microsoft.VSTS.Common.Priority] ASC, [System.ChangedDate] DESC
" --output json 2>&1
# Items resolved/closed since last sync (only NEW ones)
az boards query --wiql "
SELECT [System.Id], [System.Title], [System.State], [System.WorkItemType],
[System.Tags], [Microsoft.VSTS.Common.Resolution], [System.ChangedDate]
FROM WorkItems
WHERE [System.AreaPath] UNDER 'OneCRM\Client\UnifiedClient\AppLifeCycle\PPBT Extensions'
AND [System.State] IN ('Closed', 'Resolved', 'Done')
AND [System.ChangedDate] > '<last-sync-date>'
ORDER BY [System.ChangedDate] DESC
" --output json 2>&1
For each returned item, fetch full detail (description, repro steps, resolution, comments).
Cap at 30 full-detail fetches per run — summarise the rest by title + state only:
az boards work-item show --id <id> --output json 2>&1
# Check if icm CLI is available
icm --version 2>&1 || echo "icm CLI not available — falling back to ADO cross-references"
# If available
icm query \
--owning-service "Power Platform Build Tools" \
--status "Active,Resolved" \
--modified-after "<last-sync-date>" \
--top 50 \
--output json 2>&1
# Fallback: find IcM references in ADO work items
az boards query --wiql "
SELECT [System.Id], [System.Title], [System.Description], [System.ChangedDate]
FROM WorkItems
WHERE [System.AreaPath] UNDER 'OneCRM\Client\UnifiedClient\AppLifeCycle\PPBT Extensions'
AND [System.Description] CONTAINS 'IcM'
AND [System.ChangedDate] > '<last-sync-date>'
ORDER BY [System.ChangedDate] DESC
" --output json 2>&1
For each new item, assign one or more categories:
| Category | Where it goes |
| -------- | ------------- |
| Recurring bug / root cause | ado-knowledge.md log + skills/architecture/SKILL.md debug runbook |
| Known workaround | ado-knowledge.md log + skills/architecture/SKILL.md debug runbook |
| Architecture decision | ado-knowledge.md log + skills/architecture/SKILL.md layer notes |
| Dependency conflict / vuln pattern | ado-knowledge.md log + skills/fix-dependencies/SKILL.md hard rules |
| Task contract change (input name, GUID) | ado-knowledge.md log + skills/create-pr/SKILL.md review checklist |
| ICM mitigation / guidance | ado-knowledge.md log + skills/architecture/SKILL.md debug runbook |
Only add facts explicitly stated in resolutions or ICM mitigations — no speculation.
memory/ado-knowledge.mdAppend a new dated section. Never delete or overwrite previous sections.
## Sync <YYYY-MM-DD>
**Last sync:** <YYYY-MM-DD>
### Active items (<N> total)
- <ID>: <title> [<priority>] [<type>]
- ...
### Newly resolved since last sync (<N> items)
#### <ID> — <title>
- **Type:** Bug / Task / Feature
- **Resolution:** <verbatim resolution text>
- **Root cause:** <extracted from description>
- **Fix:** <what was changed>
- **Category:** <from classification above>
### ICM incidents
- <IcM-ID>: <title> — <mitigation summary>
### Patterns extracted this run
- <any new hard rule, workaround, or architecture fact>
Update only files where new facts apply. Skip files with no relevant new findings.
skills/architecture/SKILL.mdskills/fix-dependencies/SKILL.mdskills/create-pr/SKILL.mdskills/workitem/SKILL.mdmemory/MEMORY.mdAfter all appends and skill updates are complete, update the ## Last sync line at the top of ado-knowledge.md:
# The sync date is updated by the append in Step 6 — confirm it is correct
grep "## Last sync" memory/ado-knowledge.md | tail -1
Print:
<last-sync-date> → <today>Take microsoft/knowledge-sync from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.