用途:当需要对 Langflow 前端页面做无障碍扫描时使用该技能,它调用本地 Python 扫描器批量检测多个路由,只报告问题、不修改代码。测试编写、正式审计或 PR 级修复请分别参考 ibm-a11y-testing-guide、ibm-a11y-level1-audit、ibm-a11y-pr-remediation。
主要能力与用法:基本命令为 uv run python scripts/a11y/a11y_scan.py --url http://localhost:3000 --routes-file scripts/a11y/a11y_routes.json --route-group static --out /tmp/langflow-a11y-report.json --markdown /tmp/langflow-a11y-report.md --html /tmp/langflow-a11y-report.html --timeout-ms 45000。支持选项:--url(应用基址,常为 http://localhost:3000)、--routes-file(路由清单 JSON,优先 scripts/a11y/a11y_routes.json)、--route-group(默认 static)、--routes(逗号分隔路由)、--route(单路由,可重复)、--levels(问题级别,默认 violation)、--out(JSON 报告路径)、--markdown、--html(可选)、--timeout-ms(单路由超时)、--quiet-ms(网络静默窗口,默认 1000)、--states-file(显式弹窗/状态动作 JSON)、--headed(显示浏览器)。
路由选择:以 scripts/a11y/a11y_routes.json 为准,CI/本地常规批量为 static 组。动态路由(/flow/:id/、/flow/:id/view、/playground/:id/、/assets/knowledge-bases/:sourceId/chunks)需先从应用、API 响应或测试数据取得真实 ID 再替换占位符。
状态文件:JSON 数组,每项含 route 与 states;state 含 name、open、close。支持动作:click、clickText、clickRole、fill、press、waitFor、waitForHidden、waitForText、wait、scroll(to 为 top 或 bottom,或用 by 像素相对滚动,省略 selector 则滚动页面)。
报告与汇总:扫描器始终写 JSON,可另写 Markdown 与 HTML。汇总报告路径、生成的其他格式路径、总问题数、各路由问题数、各路由 API 请求数、请求失败数、主要规则 ID。可直接使用字段 totalIssues、results[].route、results[].state、results[].phase、results[].apiRequests、results[].requestFailures、results[].diagnostics、results[].issues[].ruleId。
限制:仅以扫描器输出为结论,不虚构路由名(需读 routes.tsx);不要自动点击任意按钮找弹窗,应使用显式状态动作;除非用户明确要求且数据安全,避免破坏性弹窗操作;某路由 API 请求为零时应说明扫描质量可能受限;本技能只报告、不编辑文件。