azure/update-guidelines
Ingest guideline changes from the azure-sdk repo into the knowledge base. Use for: update guidelines, ingest guidelines, sync guidelines, guideline changes, kb update, update KB, guideline ingestion, sync KB, guideline PR, guideline diff.
npx skills add https://github.com/Azure/azure-sdk-tools --skill update-guidelines
The avc db ingest-guidelines command detects changes in the azure-sdk repo's guideline markdown files and syncs them to Cosmos DB. It compares a base SHA against a target SHA to find changed files, parses them, and upserts/deletes guidelines, examples, and memories accordingly.
This skill supports three input scenarios for resolving the base and target SHAs:
main to the given datesIMPORTANT: Always run a dry-run first and confirm with the user before applying changes.
The user MUST specify which environment to update: staging or production. If not specified, ask the user — do NOT assume. This determines which Cosmos DB and App Configuration instance is modified.
Always pass --environment <env> to the CLI commands.
The user may optionally specify one or more languages to narrow the ingestion scope. If languages are specified, only guideline files for those languages (plus cross-language "general" guidelines) are processed.
Pass --language <lang1> <lang2> (or -l <lang1> <lang2>) to the CLI commands. Valid language names: python, java, dotnet, typescript, golang, cpp, rust, ios, android, clang. Case-insensitive aliases like C#, Go, Swift are also accepted.
If the user does not mention specific languages, omit the flag to process all languages.
The user provides a GitHub PR link (e.g. https://github.com/Azure/azure-sdk/pull/1234).
Parse the PR number from the URL.
Run this command to get the base and merge commit SHAs:
Invoke-RestMethod -Uri "https://api.github.com/repos/Azure/azure-sdk/pulls/<PR_NUMBER>" -Headers @{ "User-Agent" = "apiview-copilot" } | Select-Object -Property @{N='base_sha';E={$_.base.sha}}, @{N='merge_commit_sha';E={$_.merge_commit_sha}}, @{N='title';E={$_.title}}, @{N='state';E={$_.state}}, @{N='merged';E={$_.merged}} | Format-List
base.sha as the base SHAmerge_commit_sha as the target SHAmerged is false, warn the user that the PR is not merged and the merge commit SHA may changeShow the user:
Ask for confirmation before proceeding.
Then go to Phase 2: Dry Run.
The user provides two commit SHAs directly.
Confirm with the user:
Then go to Phase 2: Dry Run.
The user provides two dates (e.g. "April 1 to April 30", "March 15 and March 20").
For each date, find the closest commit on main of the Azure/azure-sdk repo.
Use the GitHub Commits API with the until parameter to find the most recent commit on or before the given date:
For the base date:
(Invoke-RestMethod -Uri "https://api.github.com/repos/Azure/azure-sdk/commits?sha=main&until=<BASE_DATE>T23:59:59Z&per_page=1" -Headers @{ "User-Agent" = "apiview-copilot" })[0] | Select-Object -Property @{N='sha';E={$_.sha}}, @{N='date';E={$_.commit.committer.date}}, @{N='message';E={$_.commit.message.Split("`n")[0]}} | Format-List
For the target date:
(Invoke-RestMethod -Uri "https://api.github.com/repos/Azure/azure-sdk/commits?sha=main&until=<TARGET_DATE>T23:59:59Z&per_page=1" -Headers @{ "User-Agent" = "apiview-copilot" })[0] | Select-Object -Property @{N='sha';E={$_.sha}}, @{N='date';E={$_.commit.committer.date}}, @{N='message';E={$_.commit.message.Split("`n")[0]}} | Format-List
Replace <BASE_DATE> and <TARGET_DATE> with ISO dates (e.g. 2025-04-15).
The resolved commit dates may not exactly match the user's requested dates. Always show the user what was resolved and ask for confirmation, especially if the commit date differs from the requested date by more than a day.
Show:
Ask: "These are the closest commits to your requested dates. Proceed with dry run?"
Then go to Phase 2: Dry Run.
Always run a dry-run first. Use a 300-second timeout (the command can be slow due to LLM enrichment).
python cli.py db ingest-guidelines --environment <ENV> --base-sha <BASE_SHA> --target-sha <TARGET_SHA> --details [--language <LANG1> <LANG2>]
Include --language flags only if the user specified languages to filter.
Read the terminal output. The command prints:
With --details, the JSON output includes before/after content for each change.
Summarize what the dry run found:
Ask: "Ready to apply these changes to {environment}?"
Only after the user confirms the dry-run results, run the actual ingestion:
python cli.py db ingest-guidelines --environment <ENV> --base-sha <BASE_SHA> --target-sha <TARGET_SHA> --apply [--language <LANG1> <LANG2>]
Use a 300-second timeout. Include the same --language flags used in the dry run.
After completion, report the final counts to the user.
--details only on dry runs to inspect changes; omit it on the real run to save time.--language to scope to specific languages when debugging or testing. The filter also includes cross-language ("general") guidelines automatically.Take azure/update-guidelines 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.