mcpField
D
document-scanning

document-scanning

github.com/community-access文档处理429229 次安装今天更新
代码仓库

关于 document-scanning

为 Word、Excel、PowerPoint 和 PDF 文档扫描提供文件发现、变更检测及配置指南,适用于处理文档无障碍检查的团队。还说明排除规则、扫描配置文件和传递给子 Agent 的上下文格式。

主要功能

  1. 01支持四种文档格式
  2. 02提供 PowerShell 与 Bash 文件发现命令
  3. 03通过 Git 或时间戳检测变更
  4. 04排除临时文件及指定目录
  5. 05按格式设置扫描规则
  6. 06定义扫描配置文件与 Agent 上下文

适用场景

  1. 01在目录中查找待扫描文档
  2. 02只检查近期变更的文档
  3. 03跳过锁定文件和缓存目录
  4. 04将文件信息与规则传给子 Agent

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/community-access/accessibility-agents --skill document-scanning

安装后在 Claude Code 中输入/document-scanning确认已加载。

详细介绍

文档扫描

支持的文件类型

扩展名类型子 Agent
.docxWord 文档word-accessibility
.xlsxExcel 工作簿excel-accessibility
.pptxPowerPoint 演示文稿powerpoint-accessibility
.pdfPDF 文档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.jsonWord、Excel、PowerPoint 规则启用/禁用设置
.a11y-pdf-config.jsonPDF 扫描规则启用/禁用设置
扫描配置
配置规则严重级别使用场景
严格全部错误、警告、提示面向公众、法律要求的文档
适中全部错误、警告大多数组织
最低全部仅错误对大型文档库进行分诊

上下文传递格式

委派给子 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