关于 document-scanning
为 Word、Excel、PowerPoint 和 PDF 文档扫描提供文件发现、变更检测及配置指南,适用于处理文档无障碍检查的团队。还说明排除规则、扫描配置文件和传递给子 Agent 的上下文格式。
主要功能
- 01支持四种文档格式
- 02提供 PowerShell 与 Bash 文件发现命令
- 03通过 Git 或时间戳检测变更
- 04排除临时文件及指定目录
- 05按格式设置扫描规则
- 06定义扫描配置文件与 Agent 上下文
适用场景
- 01在目录中查找待扫描文档
- 02只检查近期变更的文档
- 03跳过锁定文件和缓存目录
- 04将文件信息与规则传给子 Agent
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ community-access/ accessibility-agents --skill document-scanning安装后在 Claude Code 中输入/document-scanning确认已加载。
详细介绍
文档扫描
支持的文件类型
| 扩展名 | 类型 | 子 Agent |
|---|---|---|
| .docx | Word 文档 | word-accessibility |
| .xlsx | Excel 工作簿 | excel-accessibility |
| .pptx | PowerPoint 演示文稿 | powerpoint-accessibility |
| PDF 文档 | pdf-accessibility |
文件发现命令
PowerShell(Windows)
# Non-recursive scan
Get-ChildItem -Path "<folder>" -File -Include *.docx,*.xlsx,*.pptx,*.pdf
# Recursive scan
Get-ChildItem -Path "<folder>" -File -Include *.docx,*.xlsx,*.pptx,*.pdf -Recurse |
Where-Object { $_.Name -notlike '~$*' -and $_.Name -notlike '*.tmp' -and $_.Name -notlike '*.bak' } |
Where-Object { $_.FullName -notmatch '[\\/](\.git|node_modules|__pycache__|\.vscode)[\\/]' }
Bash(macOS)
# Non-recursive scan
find "<folder>" -maxdepth 1 -type f \( -name "*.docx" -o -name "*.xlsx" -o -name "*.pptx" -o -name "*.pdf" \) ! -name "~\$*"
# Recursive scan
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/*" ! -path "*/__pycache__/*" ! -path "*/.vscode/*"
差异检测
基于 Git
# Files changed since last commit
git diff --name-only HEAD~1 HEAD -- '*.docx' '*.xlsx' '*.pptx' '*.pdf'
# Files changed since a specific tag
git diff --name-only <tag> HEAD -- '*.docx' '*.xlsx' '*.pptx' '*.pdf'
# Files changed in the last N days
git log --since="N days ago" --name-only --diff-filter=ACMR --pretty="" -- '*.docx' '*.xlsx' '*.pptx' '*.pdf' | sort -u
基于时间戳(PowerShell)
# Files modified since a specific date
Get-ChildItem -Path "<folder>" -File -Include *.docx,*.xlsx,*.pptx,*.pdf -Recurse |
Where-Object { $_.LastWriteTime -gt [datetime]"2025-01-01" }
跳过的文件
扫描时始终排除以下模式:
~$*- Office 锁定/临时文件(在文档打开时创建)*.tmp- 临时文件*.bak- 备份文件.git/、node_modules/、.vscode/、__pycache__/目录中的文件
扫描配置文件
| 文件 | 用途 |
|---|---|
.a11y-office-config.json | Word、Excel、PowerPoint 规则启用/禁用设置 |
.a11y-pdf-config.json | PDF 扫描规则启用/禁用设置 |
扫描配置
| 配置 | 规则 | 严重级别 | 使用场景 |
|---|---|---|---|
| 严格 | 全部 | 错误、警告、提示 | 面向公众、法律要求的文档 |
| 适中 | 全部 | 错误、警告 | 大多数组织 |
| 最低 | 全部 | 仅错误 | 对大型文档库进行分诊 |
上下文传递格式
委派给子 Agent 时,始终提供以下上下文块:
## Document Scan Context
- **File:** [full path]
- **Scan Profile:** [strict | moderate | minimal]
- **Severity Filter:** [error, warning, tip]
- **Disabled Rules:** [list or "none"]
- **User Notes:** [any specifics]
- **Part of Batch:** [yes/no - if yes, indicate X of Y]
评论
支持 Markdown