Repository navigation
Advanced Scanning Patterns
Patterns for background execution, isolated scanning contexts, and monorepo configurations when working with large document libraries.
In monorepo setups, developers often open a subfolder (e.g., packages/frontend/) rather than the repository root. Previously, VS Code only discovered agent customizations from the open workspace folder, meaning shared team configurations at the repo root were invisible.
VS Code 1.112 introduces chat.useCustomizationsInParentRepositories, which discovers customizations from parent folders up to the .git repository root.
Enable it:
// .vscode/settings.json or user settings
{
"chat.useCustomizationsInParentRepositories": true
}When enabled, VS Code walks up the folder hierarchy from each workspace folder until it finds a .git folder. All customizations found along this path are loaded:
- Always-on instructions:
copilot-instructions.md,AGENTS.md,CLAUDE.md - File-based instructions:
*.instructions.md - Prompt files:
*.prompt.md - Custom agents:
*.agent.md - Agent skills: skill directories
- Hooks: hook configuration files
my-monorepo/ # repo root (has .git folder)
|-- .github/
| |-- copilot-instructions.md # Discovered
| |-- instructions/
| | `-- a11y.instructions.md # Discovered
| |-- prompts/
| | `-- audit-web-page.prompt.md # Discovered
| `-- agents/
| `-- accessibility-lead.agent.md # Discovered
|-- packages/
| `-- frontend/ # <- Opened as workspace folder
| |-- .github/
| | `-- prompts/
| | `-- local.prompt.md # Also discovered (local)
| `-- src/
If you open packages/frontend/ in VS Code with the setting enabled, you get:
- The frontend package's local customizations
- ALL parent repo customizations (instructions, agents, prompts, skills)
For parent discovery to work:
- Your workspace folder must NOT be a git repository root itself
- A parent folder must contain a
.gitfolder - The parent repository must be trusted (VS Code prompts for trust)
Accessibility Agents 7.x ships Agent Skills, not agent, prompt or instruction
files. For a monorepo, either install the plugin (Chat: Install Plugin From
Source, which needs chat.plugins.enabled), or put the skills where VS Code
discovers workspace skills at the repository root:
my-monorepo/
.agents/
skills/ # a copy of, or link to, this package's skills/
accessibility-lead/
aria-specialist/
...
packages/
frontend/ # each package inherits the root skills
admin-dashboard/
marketing-site/
.github/skills/ and .claude/skills/ work as well. Team members opening a
package folder inherit the root skills when parent-repository discovery is on.
- Document libraries with 50+ files where scanning takes several minutes
- Scheduled nightly or weekly audit runs
- CI/CD pipeline integration where scanning runs asynchronously
Claude Code spawns parallel subagents with the Agent tool (called Task before version 2.1.63). For background-style scanning:
Scan these 4 document types in parallel:
1. Task 1: Scan all .docx files in /docs/ -> return findings summary
2. Task 2: Scan all .xlsx files in /docs/ -> return findings summary
3. Task 3: Scan all .pptx files in /docs/ -> return findings summary
4. Task 4: Scan all .pdf files in /docs/ -> return findings summary
Wait for all tasks to complete, then merge results.
Limitations:
- Tasks share the same filesystem - no isolation between tasks
- Each task has its own context window but sees the same working directory
- Progress reporting happens only when tasks complete
The document-accessibility-wizard router dispatches its specialists
(word-accessibility, excel-accessibility, powerpoint-accessibility,
pdf-accessibility, document-inventory, cross-document-analyzer) by name.
Whether they run in parallel depends on the client; do not count on true
background execution.
Practical pattern for large scans:
- Use
document-inventoryto build the file list - Group files by type
- Process each type group as a batch
- Report progress after each group completes
For true background execution, use CI/CD pipelines:
# GitHub Actions - runs asynchronously on push
name: Document Accessibility Audit
on:
push:
paths: ['**/*.docx', '**/*.xlsx', '**/*.pptx', '**/*.pdf']
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: node .github/scripts/office-a11y-scan.mjs
- run: node .github/scripts/pdf-a11y-scan.mjs
- uses: actions/upload-artifact@v7
with:
name: audit-report
path: DOCUMENT-ACCESSIBILITY-AUDIT.mdThis runs the scan in the background. Results are available as build artifacts.
- Scanning documents in a branch without switching your working directory
- Running audits against a specific git tag or release
- Comparing documents across branches
Use git worktree to create isolated copies for scanning without affecting your main working directory:
# Create a worktree for the target branch
git worktree add ../audit-workspace release/v2.0
# Run scan against the worktree
cd ../audit-workspace
# (run scanning tools here)
# Clean up after scanning
cd ..
git worktree remove audit-workspaceFor non-git scenarios or when you need a clean scanning environment:
# PowerShell: Copy documents to temp for isolated scanning
$ScanDir = Join-Path $env:TEMP "a11y-scan-$(Get-Date -Format 'yyyyMMdd-HHmmss')"
New-Item -ItemType Directory -Path $ScanDir
Copy-Item -Path "docs\*.docx","docs\*.xlsx","docs\*.pptx","docs\*.pdf" -Destination $ScanDir
# Run scan in isolated directory
# (scan commands targeting $ScanDir)
# Clean up
Remove-Item -Recurse -Force $ScanDir# Bash: Copy documents to temp for isolated scanning
SCAN_DIR=$(mktemp -d)
cp docs/*.docx docs/*.xlsx docs/*.pptx docs/*.pdf "$SCAN_DIR/"
# Run scan in isolated directory
# (scan commands targeting $SCAN_DIR)
# Clean up
rm -rf "$SCAN_DIR"Compare document accessibility across branches:
# Scan current branch
node .github/scripts/office-a11y-scan.mjs --output AUDIT-current.md
# Create worktree for comparison branch
git worktree add ../compare-branch main
# Scan comparison branch
cd ../compare-branch
node .github/scripts/office-a11y-scan.mjs --output ../AUDIT-main.md
# Compare results
cd ..
# Ask the document wizard to compare the two reports, or diff them
git worktree remove compare-branchFor very large document libraries (500+ documents):
Tier 1 - Triage (minimal profile):
Scan all documents with errors only to identify the worst offenders.
Tier 2 - Priority (moderate profile): Re-scan the worst 20% with errors and warnings.
Tier 3 - Comprehensive (strict profile): Full scan of high-priority or public-facing documents.
Rather than scanning the entire library each time:
- Run a full baseline scan once
- On subsequent runs, use delta scanning (changed files only)
- Compare each delta scan against the baseline
- Run a full re-scan quarterly to catch configuration drift
For initial assessment of a large library:
- Select a proportional sample across document types and folders
- Scan 10-20 representative files
- Extrapolate issue rates to estimate total remediation effort
- Use the sample results to prioritize which folders to scan first
- Agents Overview
- Accessibility Lead
- Web Accessibility Wizard
- Document Accessibility Wizard
- Markdown Assistant
- Developer Hub
- GitHub Hub