Document Accessibility Wizard reference: Behavioral Rules
In the kit: .github/skills/document-accessibility-wizard/references/behavioural-rules.md.
-
This file as plain text, at
https://letitglow.app/ahg/kit/raw/.github/skills/document-accessibility-wizard/references/behavioural-rules.md - Everything in the kit
Copy it into ChatGPT or another assistant
Read the plain text first
Document Accessibility Wizard reference: Behavioral Rules
Part of the document-accessibility-wizard skill. Read this only when the task reaches these sections.
Behavioral Rules
- Use AskUserQuestion at every phase transition. Present structured choices. Never dump open-ended questions.
- Never scan without confirmation. Always show the file inventory and get user approval before scanning.
- Delegate, don't duplicate. Use sub-agent rule sets - never invent your own accessibility rules.
- Pass full context on every handoff. Sub-agents should never need to re-ask for information you already have.
- Handle mixed types gracefully. A folder with Word, Excel, PowerPoint, and PDF files should route to all four sub-agents seamlessly.
- Report progress during batch scans. For large batches, show status after each file.
- Group patterns, don't just list. Cross-document analysis is your unique value - individual file scanning is what sub-agents do.
- Respect configuration. If
.a11y-office-config.json,.a11y-pdf-config.jsonor.a11y-epub-config.jsonexist, honor their rules unless the user overrides. - Handle errors gracefully. If a file can't be opened (corrupted, encrypted, password-protected), report it and continue with the remaining files.
- Be encouraging. Report what passed, not just what failed. If a folder has 80% clean files, say so.
- Recommend configuration for repeat scanning. If the user doesn't have config files, suggest creating them for CI/CD integration.
- Never modify documents directly. Report issues and provide remediation guidance. The user decides what to fix.
- Include confidence levels in all findings. Every finding must have a high/medium/low confidence rating from the sub-agent.
- Always compute severity scores. Every document in the report must have a 0-100 accessibility score and letter grade.
- Detect and report templates. When scanning batches, check for shared templates and flag template-level issues.
- Track remediation on re-scans. When comparing against a baseline, classify every finding as fixed, new, persistent, or regressed.
- Offer CI/CD guidance proactively. After any audit, offer the Phase 6 CI/CD integration guide if no config files exist.
Phase 6: CI/CD Integration Guide
When the user requests CI/CD integration or when no scan configuration files exist, offer to generate a CI/CD integration guide.
Ask: "Would you like a CI/CD integration guide for automated document accessibility scanning?" Options:
- Yes - GitHub Actions - generate a GitHub Actions workflow
- Yes - Azure DevOps - generate an Azure Pipelines YAML
- Yes - Generic CI - generate a generic script-based approach
- No thanks - skip CI/CD setup
GitHub Actions Integration
Generate a .github/workflows/document-accessibility.yml workflow:
name: Document Accessibility Audit
on:
push:
paths:
- '**/*.docx'
- '**/*.xlsx'
- '**/*.pptx'
- '**/*.pdf'
pull_request:
paths:
- '**/*.docx'
- '**/*.xlsx'
- '**/*.pptx'
- '**/*.pdf'
schedule:
- cron: '0 6 * * 1' # Weekly on Monday at 6 AM
jobs:
accessibility-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Find changed documents
id: changed
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
CHANGED=$(git diff --name-only ${{ github.event.pull_request.base.sha }} HEAD -- '*.docx' '*.xlsx' '*.pptx' '*.pdf')
else
CHANGED=$(git diff --name-only HEAD~1 HEAD -- '*.docx' '*.xlsx' '*.pptx' '*.pdf')
fi
echo "files=$(echo "$CHANGED" | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
- name: Run accessibility audit
if: steps.changed.outputs.files != ''
run: |
echo "Scanning: ${{ steps.changed.outputs.files }}"
- name: Upload audit report
if: always()
uses: actions/upload-artifact@v7
with:
name: accessibility-audit-report
path: DOCUMENT-ACCESSIBILITY-AUDIT.mdAzure DevOps Integration
Generate an azure-pipelines-a11y.yml:
trigger:
paths:
include:
- '**/*.docx'
- '**/*.xlsx'
- '**/*.pptx'
- '**/*.pdf'
schedules:
- cron: '0 6 * * 1'
displayName: Weekly Accessibility Audit
branches:
include:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
fetchDepth: 0
- script: |
CHANGED=$(git diff --name-only HEAD~1 HEAD -- '*.docx' '*.xlsx' '*.pptx' '*.pdf')
echo "##vso[task.setvariable variable=changedFiles]$CHANGED"
displayName: Find Changed Documents
- script: |
echo "Scanning: $(changedFiles)"
displayName: Run Accessibility Audit
condition: ne(variables['changedFiles'], '')
- publish: DOCUMENT-ACCESSIBILITY-AUDIT.md
artifact: accessibility-audit-report
displayName: Publish Audit ReportGeneric CI Integration
Provide a shell script scripts/audit-documents.sh:
#!/bin/bash
set -euo pipefail
# Document Accessibility Audit CI Script
# Usage: ./scripts/audit-documents.sh [folder] [profile]
FOLDER="${1:-.}"
PROFILE="${2:-moderate}"
OUTPUT="DOCUMENT-ACCESSIBILITY-AUDIT.md"
echo "Document Accessibility Audit"
echo "Folder: $FOLDER"
echo "Profile: $PROFILE"
FILES=$(find "$FOLDER" -type f \( -name '*.docx' -o -name '*.xlsx' -o -name '*.pptx' -o -name '*.pdf' \) \
! -name '~[$]*' ! -name '*.tmp' ! -name '*.bak' \
! -path '*/.git/*' ! -path '*/node_modules/*')
COUNT=$(echo "$FILES" | grep -c . || true)
echo "Found $COUNT documents to scan"
if [ "$COUNT" -eq 0 ]; then
echo "No documents found. Exiting."
exit 0
fi
echo "$FILES" | while read -r file; do
echo "Scanning: $file"
done
echo "Audit complete. Report: $OUTPUT"Configuration File Templates
Offer to create starter configuration files for the selected CI pipeline and scan profile.