Skip to content
Back to search

codexqa

codexqa: 11 local-first Agent Skills for Cursor, Claude Code, Codex & OpenClaw — change impact analysis, AI code review, defect scan, testcase generation, browser replay & RCA.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

Its scripts were only partly scanned.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/openqa-cn/codexqa with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/openqa-cn/codexqa'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/openqa-cn--codexqa/badge.svg)](/listings/openqa-cn--codexqa)

HTML

<a href="/listings/openqa-cn--codexqa"><img src="/api/listings/openqa-cn--codexqa/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

**1. Install** (router only is enough; it can fetch a worker on demand):

npx skills add openqa-cn/codexqa --skill codexqa-skill-router

Pick Cursor, Claude Code, Codex, or OpenClaw when prompted. No npm login.

**2. Run** — new Agent session, then paste:

I am not sure which skill to use. Route this: review this repo against origin/main
and produce an openable HTML report I can send to a reviewer.

Or name a worker: `Use codexqa-defect-analyzer on this branch. Requirement: a refund must not exceed the remaining refundable balance.`

**3. See a report** — the Agent writes HTML/Markdown on disk. Compare with the screenshots above.

**Install a specific skill · code-graph CLI**

npx skills add openqa-cn/codexqa --skill codexqa-defect-analyzer
npx skills add openqa-cn/codexqa --skill codexqa-code-reviewer
npx skills add openqa-cn/codexqa --skill codexqa-code-wiki
npx skills add openqa-cn/codexqa --skill codexqa-code-analyzer
npx skills add openqa-cn/codexqa --skill codexqa-change-analysis
npx skills add openqa-cn/codexqa --skill codexqa-rootcause-analyzer
npx skills add openqa-cn/codexqa --skill codexqa-requirement-analyzer
npx skills add openqa-cn/codexqa --skill codexqa-testcase-generator
npx skills add openqa-cn/codexqa --skill codexqa-testdata-generator
npx skills add openqa-cn/codexqa --skill codexqa-jev-browser

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 445 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <div align="center">
  2. <a id="readme-en"></a>
  3. # CodexQA
  4. **Shipping fast is table stakes. CodexQA runs fully local, installs ready to use, and tells you if the code is good.**
  5. CodexQA is an open-source Agent Skills pack for Cursor, Claude Code, Codex, and OpenClaw. It provides 10 local-first verification skills and 1 auto-router to verify code quality, trace change blast radius, detect logic defects, audit PRD requirements, generate manual test cases, construct test data, replay browser UI workflows, and diagnose root causes before merging AI-generated code.
  6. After AI coding, the hard part is **verifying quality before you merge**: bugs in what just landed, blast radius on old features, complete test cases, the change knowledge graph (which APIs, methods, and call chains moved), whether architecture broke, security risk, requirement fit, test data you can actually run, and whether a browser flow shows the evidence it claims. **CodexQA** is built for that **test-and-verify stage** — 10 specialized Agent Skills + 1 router, 360° coverage, so you not only write fast, you **see fast whether it is good**, and the development loop actually closes.
  7. Cursor · Claude Code · Codex · OpenClaw. Fully local. Install and use — no account, no gateway, no QA-platform move.
  8. <p>
  9. <strong>10+1</strong> skills &nbsp;·&nbsp;
  10. <strong>0</strong> accounts &nbsp;·&nbsp;
  11. <strong>7/7</strong> blind recall &nbsp;·&nbsp;
  12. <strong>0</strong> decoy FPs &nbsp;·&nbsp;
  13. <strong>10</strong> languages
  14. </p>
  15. <sub>Recorded JS blind eval on <a href="examples/inventory-service/README.md">inventory-service</a>: 7 planted semantic defects, 4 decoys. Recall 7/7, precision 7/7, 0 trap FPs — Composer, 2026-09-08, <em>one run, not a multi-model benchmark</em>. Semgrep seeds: 102 rules / 10 languages.</sub>
  16. GitHub is the skill source; product site: [openqa.cn](https://openqa.cn/?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=hero).
  17. [![CI](https://github.com/openqa-cn/codexqa/actions/workflows/repo-check.yml/badge.svg)](https://github.com/openqa-cn/codexqa/actions/workflows/repo-check.yml)
  18. [![Docs](https://img.shields.io/badge/docs-openqa.cn-111827)](https://openqa.cn/?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=badge-docs)
  19. [![Release](https://img.shields.io/github/v/tag/openqa-cn/codexqa?label=release)](https://github.com/openqa-cn/codexqa/releases)
  20. [![Last commit](https://img.shields.io/github/last-commit/openqa-cn/codexqa)](https://github.com/openqa-cn/codexqa/commits)
  21. [![Commit activity](https://img.shields.io/github/commit-activity/m/openqa-cn/codexqa)](https://github.com/openqa-cn/codexqa/graphs/commit-activity)
  22. [![Stars](https://img.shields.io/github/stars/openqa-cn/codexqa?style=flat)](https://github.com/openqa-cn/codexqa/stargazers)
  23. [![License](https://img.shields.io/github/license/openqa-cn/codexqa)](LICENSE)
  24. **English | [简体中文](#readme-zh)**
  25. <a href="https://openqa.cn/?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=nav-docs"><strong>Documentation</strong></a> ·
  26. <a href="#quick-start"><strong>Quick Start</strong></a> ·
  27. <a href="#overview-of-all-skills"><strong>Skills overview</strong></a> ·
  28. <a href="docs/GETTING_STARTED.md"><strong>Install notes</strong></a> ·
  29. <a href="CHANGELOG.md"><strong>Changelog</strong></a>
  30. </div>
  31. <a id="what-the-output-looks-like"></a>
  32. <a id="overview-of-all-test-and-verify-skills"></a>
  33. ## Overview of all skills
  34. <table>
  35. <tr>
  36. <td width="50%" valign="top">
  37. <p><strong><a href="skills/codexqa-defect-analyzer/README.md">codexqa-defect-analyzer</a></strong></p>
  38. <p><strong>Verifies</strong> — whether the code you just wrote or merged hides bugs or security issues a quick glance would miss.</p>
  39. <p><strong>Does</strong> — merges SAST / lint / secrets with one Agent semantic pass into a P0–P3 HTML report: location, evidence, suggestion.</p>
  40. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/defect-report.html"><img src="docs/assets/previews/defect-report.png" alt="codexqa-defect-analyzer HTML scan report"></a></p>
  41. </td>
  42. <td width="50%" valign="top">
  43. <p><strong><a href="skills/codexqa-code-reviewer/README.md">codexqa-code-reviewer</a></strong></p>
  44. <p><strong>Verifies</strong> — whether this change is merge-ready, and whether it silently hits old behavior. A git diff alone rarely shows call chains or test gaps.</p>
  45. <p><strong>Does</strong> — collects a CodexQA evidence pack (callers, blast radius, test edges), then writes a bilingual <code>REVIEW-REPORT.html</code> you can send to a reviewer.</p>
  46. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/review-report.html"><img src="docs/assets/previews/review-report.png" alt="codexqa-code-reviewer bilingual REVIEW-REPORT.html"></a></p>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td width="50%" valign="top">
  51. <p><strong><a href="skills/codexqa-code-wiki/README.md">codexqa-code-wiki</a></strong></p>
  52. <p><strong>Verifies</strong> — how the repo is actually layered, which module is the hub, and where a newcomer (or an Agent) should start reading. Without a map, “did we break the architecture?” is a guess.</p>
  53. <p><strong>Does</strong> — builds a local architecture knowledge graph — communities, real dependencies, reading paths — as openable HTML, not a chat summary.</p>
  54. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/code-wiki-en.html"><img src="docs/assets/previews/code-wiki-en.png" alt="codexqa-code-wiki architecture wiki HTML report"></a></p>
  55. </td>
  56. <td width="50%" valign="top">
  57. <p><strong><a href="skills/codexqa-code-analyzer/README.md">codexqa-code-analyzer</a></strong></p>
  58. <p><strong>Verifies</strong> — which APIs, methods, and call chains this change actually hits; what to regression-test; which paths still have no tests.</p>
  59. <p><strong>Does</strong> — queries a local symbol graph for callers, entries, and untested edges. Not a full-text search guess.</p>
  60. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/code-analyzer.html"><img src="docs/assets/previews/code-analyzer.png" alt="codexqa-code-analyzer change-impact graph"></a></p>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td width="50%" valign="top">
  65. <p><strong><a href="skills/codexqa-rootcause-analyzer/README.md">codexqa-rootcause-analyzer</a></strong></p>
  66. <p><strong>Verifies</strong> — after mapping a stack or log back onto the repo, where the failure really starts. The throw site is often not the root cause.</p>
  67. <p><strong>Does</strong> — writes a gated English RCA: trigger vs root cause vs confidence, plus one fix-and-verify suggestion.</p>
  68. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/rootcause.html"><img src="docs/assets/previews/rootcause.png" alt="codexqa-rootcause-analyzer English RCA report"></a></p>
  69. </td>
  70. <td width="50%" valign="top">
  71. <p><strong><a href="skills/codexqa-requirement-analyzer/README.md">codexqa-requirement-analyzer</a></strong></p>
  72. <p><strong>Verifies</strong> — whether the requirement is testable, complete, and internally consistent — before anyone writes code. Gaps and conflicts often live in the PRD.</p>
  73. <p><strong>Does</strong> — one P0/P1 gap-and-conflict register from a PRD (or a multi-source pack). High-priority items come with executable verification steps.</p>
  74. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/ra-register.html"><img src="docs/assets/previews/ra-register.png" alt="codexqa-requirement-analyzer gap register"></a></p>
  75. </td>
  76. </tr>
  77. <tr>
  78. <td width="50%" valign="top">
  79. <p><strong><a href="skills/codexqa-testcase-generator/README.md">codexqa-testcase-generator</a></strong></p>
  80. <p><strong>Verifies</strong> — what a complete test pass should cover for Web / server / APP, without inventing business facts when the PRD is silent.</p>
  81. <p><strong>Does</strong> — local Markdown plan + cases (unknowns stay TBD) plus an aggregated HTML you can open. No test-management platform.</p>
  82. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/testcase-report.html"><img src="docs/assets/previews/testcase-report.png" alt="codexqa-testcase-generator aggregated HTML case report"></a></p>
  83. </td>
  84. <td width="50%" valign="top">
  85. <p><strong><a href="skills/codexqa-testdata-generator/README.md">codexqa-testdata-generator</a></strong></p>
  86. <p><strong>Verifies</strong> — whether the preconditions in a case can actually be built on a real backend. A copied fake ID will not pass a real API.</p>
  87. <p><strong>Does</strong> — constructs data against the backend and writes the returned business IDs back into case preconditions. Success means the backend issued an ID.</p>
  88. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/testdata-writeback.html"><img src="docs/assets/previews/testdata-writeback.png" alt="codexqa-testdata-generator write-back of backend IDs"></a></p>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td width="50%" valign="top">
  93. <p><strong><a href="skills/codexqa-jev-browser/README.md">codexqa-jev-browser</a></strong> · <a href="https://github.com/openqa-cn/jev-browser">Jev Browser repo</a></p>
  94. <p><strong>Verifies</strong> — whether a browser flow reaches the visible evidence named in the goal. A model's DONE is not a pass.</p>
  95. <p><strong>Does</strong> — drives Playwright Chromium from a page index (role, name, allowed operations). Replays YAML, Markdown, or API cases, or generates a case from a goal. Each run writes <code>reports/&lt;run-id&gt;/report.html</code> with the marked screenshot and the step result.</p>
  96. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/jev-report.html"><img src="docs/assets/previews/jev-report.png" alt="codexqa-jev-browser HTML execution report"></a></p>
  97. </td>
  98. <td width="50%" valign="top">
  99. <p><strong><a href="skills/codexqa-change-analysis/README.md">codexqa-change-analysis</a></strong></p>
  100. <p><strong>Verifies</strong> — for one diff, which methods were added or changed, which APIs or pages can trigger them, and which of those paths no existing test covers.</p>
  101. <p><strong>Does</strong> — writes one self-contained HTML change-impact report (entries, change list, test plan, coverage verdict, sensitive paths) and adds runnable test files for the uncovered points. Existing test files are not edited.</p>
  102. </td>
  103. </tr>
  104. </table>
  105. <a id="evidence-and-limitations"></a>
  106. <a id="quick-start"></a>
  107. ## Quick start
  108. **1. Install** (router only is enough; it can fetch a worker on demand):
  109. ```bash
  110. npx skills add openqa-cn/codexqa --skill codexqa-skill-router
  111. ```
  112. Pick Cursor, Claude Code, Codex, or OpenClaw when prompted. No npm login.
  113. **2. Run** — new Agent session, then paste:
  114. ```text
  115. I am not sure which skill to use. Route this: review this repo against origin/main
  116. and produce an openable HTML report I can send to a reviewer.
  117. ```
  118. Or name a worker: `Use codexqa-defect-analyzer on this branch. Requirement: a refund must not exceed the remaining refundable balance.`
  119. **3. See a report** — the Agent writes HTML/Markdown on disk. Compare with the screenshots above.
  120. **Install a specific skill · code-graph CLI**
  121. ```bash
  122. npx skills add openqa-cn/codexqa --skill codexqa-defect-analyzer
  123. npx skills add openqa-cn/codexqa --skill codexqa-code-reviewer
  124. npx skills add openqa-cn/codexqa --skill codexqa-code-wiki
  125. npx skills add openqa-cn/codexqa --skill codexqa-code-analyzer
  126. npx skills add openqa-cn/codexqa --skill codexqa-change-analysis
  127. npx skills add openqa-cn/codexqa --skill codexqa-rootcause-analyzer
  128. npx skills add openqa-cn/codexqa --skill codexqa-requirement-analyzer
  129. npx skills add openqa-cn/codexqa --skill codexqa-testcase-generator
  130. npx skills add openqa-cn/codexqa --skill codexqa-testdata-generator
  131. npx skills add openqa-cn/codexqa --skill codexqa-jev-browser
  132. ```
  133. ## Capabilities
  134. Each skill is one step in the test-and-verify loop. The table says **when to use it** and **what checkable result** you leave with — an openable artifact, not a chat summary.
  135. | | Skill | When to use it, and what verification result you get |
  136. | --- | --- | --- |
  137. | 🧭 | <a href="skills/codexqa-skill-router/README.md">codexqa-skill-router</a> | **When** you are not sure whether you need a defect scan, impact map, cases, or test data — or the worker is not installed yet.<br>**You get** the matching skill, installed on demand if missing, then a handoff. Verification starts by picking the right tool; you do not memorize ten entry points. |
  138. | 📋 | <a href="skills/codexqa-requirement-analyzer/README.md">codexqa-requirement-analyzer</a> | **When** a PRD, story pack, or mixed materials land, before anyone writes code: is it testable, complete, internally consistent?<br>**You get** one assignable P0/P1 gap-and-conflict register. High-priority rows include preconditions, stimulus, expected result, and evidence — the requirement-layer blockers that would make later testing fail. |
  139. | 🧪 | <a href="skills/codexqa-testcase-generator/README.md">codexqa-testcase-generator</a> | **When** you need a test plan and executable cases for Web / server / APP before submit, or extra regression after a change.<br>**You get** local Markdown plan + cases + aggregated HTML: which scenarios, which priority. Unknowns stay TBD; silent PRD gaps are not invented as fake cases. |
  140. | 🗃️ | <a href="skills/codexqa-testdata-generator/README.md">codexqa-testdata-generator</a> | **When** cases exist but will not run: missing accounts, catalog rows, orders. A copied fake ID will not pass a real API.<br>**You get** data constructed against the backend, with returned business IDs written into case preconditions. Success means the backend issued an ID, not that a number appeared in chat. |
  141. | 🌐 | <a href="skills/codexqa-jev-browser/README.md">codexqa-jev-browser</a> · <a href="https://github.com/openqa-cn/jev-browser">repo</a> | **When** you have a UI case, or only a goal, and need to see whether the page actually shows the expected evidence.<br>**You get** a local HTML report: each step, the control that was used, and a marked screenshot. Replay does not call a decision model. The browser is Playwright Chromium. |
  142. | 🗺️ | <a href="skills/codexqa-code-wiki/README.md">codexqa-code-wiki</a> | **When** a newcomer or an Agent enters the repo, or you are reviewing whether a change broke the architecture.<br>**You get** an architecture knowledge-graph HTML: module communities, real dependencies, the hub, a reading path. You are checking layering and where to start — not another README. |
  143. | 📈 | <a href="skills/codexqa-code-analyzer/README.md">codexqa-code-analyzer</a> | **When** you review a PR, set regression scope, or ask “who does this change hit?” A git diff will not show call chains.<br>**You get** blast radius from a local symbol graph: which APIs / methods / call chains moved, which entries fire, which edges have no tests. That list is what you regression-test. |
  144. | 🔀 | <a href="skills/codexqa-change-analysis/README.md">codexqa-change-analysis</a> | **When** one branch or PR is ready and you need to hand a reviewer the full impact of that diff, and close the test gaps it opened.<br>**You get** one HTML change-impact report — added / changed / deleted methods, the entries that reach them, a test plan with existing cases recalled, a coverage verdict, sensitive paths — plus new runnable test files for what was not covered, run and counted in the report. |
  145. | 🧯 | <a href="skills/codexqa-rootcause-analyzer/README.md">codexqa-rootcause-analyzer</a> | **When** a production or local exception, stack, or log still does not tell you which layer actually failed.<br>**You get** a gated English RCA: trigger vs root cause vs confidence, plus one fix-and-verify suggestion. The throw site is not treated as the root cause. |
  146. | 🛡️ | <a href="skills/codexqa-defect-analyzer/README.md">codexqa-defect-analyzer</a> | **When** you scan a branch before merge, or paste newly written code and ask about bugs, secrets, or dangerous patterns.<br>**You get** a P0–P3 HTML scan: SAST / lint / secrets merged and de-duplicated with Agent semantic findings — location, evidence, suggestion. This is defect and security risk, not a CR opinion. |
  147. | ⚖️ | <a href="skills/codexqa-code-reviewer/README.md">codexqa-code-reviewer</a> | **When** you need something a reviewer can open, not a raw git diff, before a merge gate.<br>**You get** a bilingual `REVIEW-REPORT.html` from a CodexQA evidence pack (call chains, blast radius, test edges): merge risk, gaps, and what still needs tests. Use it as the CR attachment. |
  148. Narrow contracts, stop conditions, local files. The Agent you already use is the runtime.
  149. ## Who it's for
  150. | | Who | Typical job: tools, skills, and what you take away |
  151. | --- | --- | --- |
  152. | 🏢 | **Enterprise** | **Tools** The Cursor / Claude Code / Codex / OpenClaw you already run. One `npx skills add` puts verification next to the coding agent — no account, no gateway, no move of QA onto another SaaS.<br>**Skills** [codexqa-skill-router](skills/codexqa-skill-router/README.md) to route; PRs through [codexqa-code-analyzer](skills/codexqa-code-analyzer/README.md) + [codexqa-change-analysis](skills/codexqa-change-analysis/README.md) + [codexqa-defect-analyzer](skills/codexqa-defect-analyzer/README.md) + [codexqa-code-reviewer](skills/codexqa-code-reviewer/README.md); pre-submit through [codexqa-requirement-analyzer](skills/codexqa-requirement-analyzer/README.md) → [codexqa-testcase-generator](skills/codexqa-testcase-generator/README.md) → [codexqa-testdata-generator](skills/codexqa-testdata-generator/README.md), then UI replay with [codexqa-jev-browser](skills/codexqa-jev-browser/README.md); architecture with [codexqa-code-wiki](skills/codexqa-code-wiki/README.md); incidents with [codexqa-rootcause-analyzer](skills/codexqa-rootcause-analyzer/README.md).<br>**You get** blast radius (APIs / methods / call chains, regression list, test gaps), P0–P3 defect-and-security HTML, a bilingual `REVIEW-REPORT.html` for reviewers, a requirement gap register, Web/server/APP cases, real backend IDs in preconditions, an architecture knowledge graph, and a gated RCA. Files stay local; findings still need a human. |
  153. | 👤 | **Individual** | **Tools** Your own Cursor or Codex session. Install [codexqa-skill-router](skills/codexqa-skill-router/README.md); workers can be fetched when you need them.<br>**Skills** Before you merge your PR: [codexqa-defect-analyzer](skills/codexqa-defect-analyzer/README.md) for bugs and secrets, [codexqa-code-analyzer](skills/codexqa-code-analyzer/README.md) for who is hit, [codexqa-code-reviewer](skills/codexqa-code-reviewer/README.md) for an openable review page. Unfamiliar repo → [codexqa-code-wiki](skills/codexqa-code-wiki/README.md); your own PRD/cases → the generators.<br>**You get** HTML you can open: whether there are obvious defects, whether the blast radius is clear, whether the review is sendable. No extra test platform. |
  154. | 🎓 | **Education** | **Tools** Any Agent Skills IDE plus the in-repo [inventory-service](examples/inventory-service/README.md) fixture (7 semantic defects, 4 decoys, a reproducible answer key).<br>**Skills** [codexqa-defect-analyzer](skills/codexqa-defect-analyzer/README.md) to teach what a graded scan report looks like; [codexqa-code-wiki](skills/codexqa-code-wiki/README.md) / [codexqa-code-analyzer](skills/codexqa-code-analyzer/README.md) for hubs and change call chains; [codexqa-requirement-analyzer](skills/codexqa-requirement-analyzer/README.md) and [codexqa-testcase-generator](skills/codexqa-testcase-generator/README.md) for “can this requirement be tested, and where do cases come from?”<br>**You get** openable reports plus an answer key — “checkable output,” not a chat comment. Recorded recall numbers live on the fixture README; they are one run, not a multi-model board. |
  155. | 🤖 | **AI development** | **Tools** The Agent runtime you already ship (Cursor · Claude Code · Codex · OpenClaw) plus this Agent Skills pack — not a mega-prompt.<br>**Skills** [codexqa-skill-router](skills/codexqa-skill-router/README.md) as the entry; the ten workers behind a narrow handoff: requirement gaps, cases, test data, browser UI replay, architecture graph, blast radius, change-impact report, RCA, defect scan, graph-evidence review.<br>**You get** Markdown / HTML on disk (register, cases, scan page, `REVIEW-REPORT.html`, RCA), with stop conditions. When you wire verification into an Agent product, you ship skills, not an uncheckable conversation. |
  156. Not a hosted test cloud. Not a replacement for your test suite, SAST license, or maintainer judgment.
  157. ## Star this repo
  158. If a local skill pack like this is what you wanted instead of another QA platform, <a href="https://github.com/openqa-cn/codexqa" target="_blank" rel="noopener noreferrer">⭐ Star</a> opens this repository at the top — then click **Star** in the top-right. See [who starred](https://github.com/openqa-cn/codexqa/stargazers). Issues and reproductions help more than stars when something is wrong.
  159. ## Changelog
  160. [![Release](https://img.shields.io/github/v/tag/openqa-cn/codexqa?label=latest)](https://github.com/openqa-cn/codexqa/releases)
  161. [![Last commit](https://img.shields.io/github/last-commit/openqa-cn/codexqa)](https://github.com/openqa-cn/codexqa/commits)
  162. [![Commit activity](https://img.shields.io/github/commit-activity/m/openqa-cn/codexqa)](https://github.com/openqa-cn/codexqa/graphs/commit-activity)
  163. **0.3.0** — `codexqa-*` skill names; architecture wiki; Agent LLM Detection / judgment; canonical docs at [openqa.cn](https://openqa.cn/?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=changelog).
  164. **0.2.0** — first five published skills, sample reports, inventory-service 7/7 blind eval (one model, one run).
  165. Full history: [CHANGELOG.md](CHANGELOG.md) · [Releases](https://github.com/openqa-cn/codexqa/releases) (each release body links to openqa.cn).
  166. ## Product and docs
  167. | I want to… | Go here |
  168. | --- | --- |
  169. | Use the product site | [openqa.cn](https://openqa.cn/?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=docs-home) |
  170. | Browse skills | [Skill Hub](https://openqa.cn/skills?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=docs-skills) |
  171. | See the commercial product | [openqa.cn/agent](https://openqa.cn/agent?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=docs-product) |
  172. | Install without guessing | [Getting started](docs/GETTING_STARTED.md) · [Support matrix](docs/SUPPORT_MATRIX.md) |
  173. | Know how a conclusion is reached | [How it works](docs/HOW_IT_WORKS.md) |
  174. | Reproduce the blind eval | [inventory-service](examples/inventory-service/README.md) · [Methodology](benchmarks/README.md) |
  175. | Report a bug | [Issues](https://github.com/openqa-cn/codexqa/issues) · [Security](SECURITY.md) |
  176. | Send a PR | [Contributing](CONTRIBUTING.md) · Apache-2.0 |
  177. ---
  178. <a id="readme-zh"></a>
  179. <div align="center">
  180. <h1 id="codexqa-zh">CodexQA</h1>
  181. **写得快已经不够。CodexQA 完全本地执行、开箱安装即用,立刻知道写得好不好。**
  182. CodexQA 是面向 Cursor、Claude Code、Codex 与 OpenClaw 的开源 Agent Skills 本地优先质量验证技能包,提供 10 个专业验证 Skill 和 1 个自动调度路由器,在合并 AI 生成代码前提供影响面分析、代码审查、缺陷扫描、用例生成、造数、浏览器回放与根因诊断。
  183. AI Coding 之后,最大的痛点是**快速验证代码质量**:刚写的代码有没有 bug、会不会打到老功能、完整测试用例怎么建、变更知识图谱打了哪些接口 / 方法 / 调用链、架构有没有被破坏、有没有安全风险、是否满足业务需求、对应测试数据怎么尽快造出来、浏览器流程有没有走到说好的可见证据。**CodexQA 聚焦代码测试验证阶段**,用 10 个专业验证 Skill + 1 个路由器做 360° 覆盖,让你不但写得快,更能快速感知写得好不好,把开发闭环从「写完」走到「验完」。
  184. Cursor · Claude Code · Codex · OpenClaw。完全本地执行,开箱安装即用;不用账号、不用网关、不用迁 QA 平台。
  185. <p>
  186. <strong>10+1</strong> 个 skill &nbsp;·&nbsp;
  187. <strong>0</strong> 个账号 &nbsp;·&nbsp;
  188. <strong>7/7</strong> 盲测召回 &nbsp;·&nbsp;
  189. <strong>0</strong> 次诱饵误报 &nbsp;·&nbsp;
  190. <strong>10</strong> 种语言
  191. </p>
  192. <sub>可复现数字来自 <a href="examples/inventory-service/README.md">inventory-service</a>:7 个语义缺陷 + 4 个诱饵。召回 7/7、精确率 7/7、陷阱误报 0 — Composer,2026-09-08,<em>一次记录运行,不是多模型 benchmark</em>。Semgrep 种子规则 102 条 / 10 种语言。</sub>
  193. GitHub 是 skill 源码;产品站点:[openqa.cn](https://openqa.cn/?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=hero-zh)。
  194. [![CI](https://github.com/openqa-cn/codexqa/actions/workflows/repo-check.yml/badge.svg)](https://github.com/openqa-cn/codexqa/actions/workflows/repo-check.yml)
  195. [![Docs](https://img.shields.io/badge/docs-openqa.cn-111827)](https://openqa.cn/?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=badge-docs)
  196. [![Release](https://img.shields.io/github/v/tag/openqa-cn/codexqa?label=release)](https://github.com/openqa-cn/codexqa/releases)
  197. [![Last commit](https://img.shields.io/github/last-commit/openqa-cn/codexqa)](https://github.com/openqa-cn/codexqa/commits)
  198. [![Commit activity](https://img.shields.io/github/commit-activity/m/openqa-cn/codexqa)](https://github.com/openqa-cn/codexqa/graphs/commit-activity)
  199. [![Stars](https://img.shields.io/github/stars/openqa-cn/codexqa?style=flat)](https://github.com/openqa-cn/codexqa/stargazers)
  200. [![License](https://img.shields.io/github/license/openqa-cn/codexqa)](LICENSE)
  201. **[English](https://github.com/openqa-cn/codexqa#readme-en) | 简体中文**
  202. <a href="https://openqa.cn/?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=nav-docs-zh"><strong>产品站点</strong></a> ·
  203. <a href="#快速开始"><strong>快速开始</strong></a> ·
  204. <a href="#所有技能SKILL概览"><strong>技能概览</strong></a> ·
  205. <a href="docs/GETTING_STARTED.zh-CN.md"><strong>安装说明</strong></a> ·
  206. <a href="CHANGELOG.md"><strong>更新日志</strong></a>
  207. </div>
  208. <a id="产物长什么样"></a>
  209. <a id="测试验证所有技能概览"></a>
  210. <a id="所有技能SKILL概览"></a>
  211. <h2 id="所有技能SKILL概览">所有技能SKILL概览</h2>
  212. <table>
  213. <tr>
  214. <td width="50%" valign="top">
  215. <p><strong><a href="skills/codexqa-defect-analyzer/README.zh-CN.md">codexqa-defect-analyzer</a></strong></p>
  216. <p><strong>验证什么</strong> — 刚写完或刚合进来的代码,有没有 bug、有没有把密钥和危险写法带进来。人眼扫一遍不够。</p>
  217. <p><strong>核心能力</strong> — 规则扫描(SAST / lint / 密钥)和 Agent 语义检测合并去重,按 P0–P3 出 HTML:位置、证据、建议一次看完。</p>
  218. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/defect-report.html"><img src="docs/assets/previews/defect-report.png" alt="codexqa-defect-analyzer HTML 扫描报告"></a></p>
  219. </td>
  220. <td width="50%" valign="top">
  221. <p><strong><a href="skills/codexqa-code-reviewer/README.zh-CN.md">codexqa-code-reviewer</a></strong></p>
  222. <p><strong>验证什么</strong> — 这次改动能不能过评审、会不会误伤老功能。只看 git diff 往往看不到调用链和测试缺口。</p>
  223. <p><strong>核心能力</strong> — 先用符号图收齐影响面和测试边,再按证据包做双语评审,落成可发给评审人的 <code>REVIEW-REPORT.html</code>。</p>
  224. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/review-report.html"><img src="docs/assets/previews/review-report.png" alt="codexqa-code-reviewer 双语 REVIEW-REPORT.html"></a></p>
  225. </td>
  226. </tr>
  227. <tr>
  228. <td width="50%" valign="top">
  229. <p><strong><a href="skills/codexqa-code-wiki/README.zh-CN.md">codexqa-code-wiki</a></strong></p>
  230. <p><strong>验证什么</strong> — 仓库怎么分层、枢纽在哪、新人 / Agent 该从哪读起。没有地图时,「架构有没有被改坏」只能靠猜。</p>
  231. <p><strong>核心能力</strong> — 本地建架构知识图谱:模块社区、真实依赖、阅读路径,写成可打开的 HTML,不是聊天里一段口头介绍。</p>
  232. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/code-wiki.html"><img src="docs/assets/previews/code-wiki.png" alt="codexqa-code-wiki 架构 Wiki HTML 报告"></a></p>
  233. </td>
  234. <td width="50%" valign="top">
  235. <p><strong><a href="skills/codexqa-code-analyzer/README.zh-CN.md">codexqa-code-analyzer</a></strong></p>
  236. <p><strong>验证什么</strong> — 改了这几行,会打到哪些接口、方法、调用链;回归该测哪、哪些路径还没测试。</p>
  237. <p><strong>核心能力</strong> — 对着本地符号图回答变更影响面:调用方、入口、未覆盖边。不是全文搜索猜一猜。</p>
  238. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/code-analyzer.html"><img src="docs/assets/previews/code-analyzer.png" alt="codexqa-code-analyzer 变更影响图"></a></p>
  239. </td>
  240. </tr>
  241. <tr>
  242. <td width="50%" valign="top">
  243. <p><strong><a href="skills/codexqa-rootcause-analyzer/README.zh-CN.md">codexqa-rootcause-analyzer</a></strong></p>
  244. <p><strong>验证什么</strong> — 堆栈和日志对上仓库之后,异常到底卡在哪一层。抛错的那一行,经常不是根因。</p>
  245. <p><strong>核心能力</strong> — 对照调用链产出带门禁的英文 RCA:触发点、根因、置信度分开写,并给出可验证的修复方向。</p>
  246. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/rootcause.html"><img src="docs/assets/previews/rootcause.png" alt="codexqa-rootcause-analyzer 英文 RCA 报告"></a></p>
  247. </td>
  248. <td width="50%" valign="top">
  249. <p><strong><a href="skills/codexqa-requirement-analyzer/README.zh-CN.md">codexqa-requirement-analyzer</a></strong></p>
  250. <p><strong>验证什么</strong> — 需求本身写清楚了没有、能不能测、有没有缺口和互相打架的地方。代码还没写,坑可能已经在 PRD 里。</p>
  251. <p><strong>核心能力</strong> — 从 PRD(或一包材料)整理出一份带 P0/P1 的缺口 / 冲突登记表;高优先级条目带可执行验证步骤。</p>
  252. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/ra-register.html"><img src="docs/assets/previews/ra-register.png" alt="codexqa-requirement-analyzer 缺口登记表"></a></p>
  253. </td>
  254. </tr>
  255. <tr>
  256. <td width="50%" valign="top">
  257. <p><strong><a href="skills/codexqa-testcase-generator/README.zh-CN.md">codexqa-testcase-generator</a></strong></p>
  258. <p><strong>验证什么</strong> — 完整测试该覆盖哪些场景;Web / 服务端 / APP 的用例从哪来。需求没写清时,会不会被模型编出来。</p>
  259. <p><strong>核心能力</strong> — 按需求在本地写出测试方案和用例,未知标 TBD;再聚合成可打开的 HTML。不连用例平台。</p>
  260. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/testcase-report.html"><img src="docs/assets/previews/testcase-report.png" alt="codexqa-testcase-generator 聚合 HTML 用例报告"></a></p>
  261. </td>
  262. <td width="50%" valign="top">
  263. <p><strong><a href="skills/codexqa-testdata-generator/README.zh-CN.md">codexqa-testdata-generator</a></strong></p>
  264. <p><strong>验证什么</strong> — 用例写好了,前置数据是不是真能在后端造出来。复制一个假 ID,过不了真实接口。</p>
  265. <p><strong>核心能力</strong> — 对着真实后端构造数据,把返回的业务 ID 回写进用例前置条件。成功以后端给了 ID 为准。</p>
  266. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/testdata-writeback.html"><img src="docs/assets/previews/testdata-writeback.png" alt="codexqa-testdata-generator 后端 ID 回写"></a></p>
  267. </td>
  268. </tr>
  269. <tr>
  270. <td width="50%" valign="top">
  271. <p><strong><a href="skills/codexqa-jev-browser/README.zh-CN.md">codexqa-jev-browser</a></strong> · <a href="https://github.com/openqa-cn/jev-browser">Jev Browser 仓库</a></p>
  272. <p><strong>验证什么</strong> — 浏览器流程有没有走到目标里写明的可见证据。模型返回 DONE 不算通过。</p>
  273. <p><strong>核心能力</strong> — 用页面索引(角色、名称、允许的操作)驱动 Playwright Chromium。回放 YAML / Markdown / API 用例,或按目标生成用例。每次运行写出 <code>reports/&lt;run-id&gt;/report.html</code>,里面有带标记的截图和步骤结果。</p>
  274. <p align="center"><a href="https://htmlpreview.github.io/?https://github.com/openqa-cn/codexqa/blob/main/docs/assets/previews/jev-report.html"><img src="docs/assets/previews/jev-report.png" alt="codexqa-jev-browser HTML 执行报告"></a></p>
  275. </td>
  276. <td width="50%" valign="top">
  277. <p><strong><a href="skills/codexqa-change-analysis/README.zh-CN.md">codexqa-change-analysis</a></strong></p>
  278. <p><strong>验证什么</strong> — 针对一次 diff:新增、修改了哪些方法,哪些接口或页面会触发它们,其中哪些路径现有测试没覆盖。</p>
  279. <p><strong>核心能力</strong> — 写一份自包含的 HTML 变更影响报告(入口、变更清单、测试方案、覆盖判定、敏感路径),并为未覆盖的点新增可运行的测试文件,不改已有测试文件。报告正文为英文。</p>
  280. </td>
  281. </tr>
  282. </table>
  283. <a id="证据与边界"></a>
  284. <a id="evidence-and-limitations"></a>
  285. <a id="快速开始"></a>
  286. <h2 id="快速开始">快速开始</h2>
  287. **1. 安装**(只装路由即可,它能按需拉取干活 skill):
  288. ```bash
  289. npx skills add openqa-cn/codexqa --skill codexqa-skill-router
  290. ```
  291. 按提示选 Cursor、Claude Code、Codex 或 OpenClaw。不用登录 npm。
  292. **2. 运行** — 新建 Agent 会话,粘贴:
  293. ```text
  294. 我不确定该用哪个 skill。请路由:对照 origin/main 审查这个仓库,
  295. 产出一份可以发给评审人的 HTML 报告。
  296. ```
  297. 也可以点名:`用 codexqa-defect-analyzer 审这个分支。需求:退款不得超过剩余可退余额。`
  298. **3. 看报告** — Agent 把 HTML/Markdown 写到磁盘。对照上面的截图。
  299. **按需安装某一个 skill · 代码图 CLI**
  300. ```bash
  301. npx skills add openqa-cn/codexqa --skill codexqa-defect-analyzer
  302. npx skills add openqa-cn/codexqa --skill codexqa-code-reviewer
  303. npx skills add openqa-cn/codexqa --skill codexqa-code-wiki
  304. npx skills add openqa-cn/codexqa --skill codexqa-code-analyzer
  305. npx skills add openqa-cn/codexqa --skill codexqa-change-analysis
  306. npx skills add openqa-cn/codexqa --skill codexqa-rootcause-analyzer
  307. npx skills add openqa-cn/codexqa --skill codexqa-requirement-analyzer
  308. npx skills add openqa-cn/codexqa --skill codexqa-testcase-generator
  309. npx skills add openqa-cn/codexqa --skill codexqa-testdata-generator
  310. npx skills add openqa-cn/codexqa --skill codexqa-jev-browser
  311. ```
  312. <h2 id="核心能力">核心能力</h2>
  313. 每个 skill 对应测试验证闭环里的一环。下表写清**什么时候用**,以及跑完之后你能拿到哪些**可打开、可核对**的结果——不是聊天里一段口头结论。
  314. | | Skill | 什么时候用,以及验证环节你拿到什么 |
  315. | --- | --- | --- |
  316. | 🧭 | <a href="skills/codexqa-skill-router/README.zh-CN.md">codexqa-skill-router</a> | **什么时候用** 不确定该走缺陷扫描、影响面、用例还是造数;或者干活 skill 还没装。<br>**验证结果** 按你的话匹配到对应 skill,没有就按需装上再交接。你不用自己记十套入口,验证工作从「选对工具」开始。 |
  317. | 📋 | <a href="skills/codexqa-requirement-analyzer/README.zh-CN.md">codexqa-requirement-analyzer</a> | **什么时候用** 需求评审、提测前对 PRD / 故事 / 一包材料做完整性检查。代码还没写,先看需求能不能测、有没有打架。<br>**验证结果** 一份可指派的缺口与冲突登记表(P0/P1)。高优先级条目带前置、操作、期望和证据,标出需求层哪些地方会让后续测试做不下去。 |
  318. | 🧪 | <a href="skills/codexqa-testcase-generator/README.zh-CN.md">codexqa-testcase-generator</a> | **什么时候用** 提测、补回归,或要把 Web / 服务端 / APP 从需求落到可执行用例。<br>**验证结果** 本地测试方案 + 用例 + 聚合 HTML:覆盖哪些场景、优先级怎么排。需求没写清的标 TBD,不会把空缺编成假用例。 |
  319. | 🗃️ | <a href="skills/codexqa-testdata-generator/README.zh-CN.md">codexqa-testdata-generator</a> | **什么时候用** 用例写好了但跑不起来,缺账号、商品、订单等前置数据;复制一个假 ID 过不了真实接口。<br>**验证结果** 对着后端造数,把返回的业务 ID 回写进用例前置条件。你拿到的是能真正打接口的物料,成功以后端给了 ID 为准。 |
  320. | 🌐 | <a href="skills/codexqa-jev-browser/README.zh-CN.md">codexqa-jev-browser</a> · <a href="https://github.com/openqa-cn/jev-browser">仓库</a> | **什么时候用** 已经有界面用例,或只有一句目标,要核对页面上是不是真出现了预期证据。<br>**验证结果** 本地 HTML 报告:每一步、用过的控件、带标记的截图。回放不再调用决策模型。浏览器是 Playwright Chromium。 |
  321. | 🗺️ | <a href="skills/codexqa-code-wiki/README.zh-CN.md">codexqa-code-wiki</a> | **什么时候用** 新人上手、Agent 进仓、架构评审,或怀疑这次改动把分层改乱了。<br>**验证结果** 架构知识图谱 HTML:模块社区、真实依赖、枢纽、阅读路径。核对的是系统怎么分层、该从哪读、架构有没有被拆散,不是又一份 README。 |
  322. | 📈 | <a href="skills/codexqa-code-analyzer/README.zh-CN.md">codexqa-code-analyzer</a> | **什么时候用** 评 PR、定回归范围、问「改这几行会打到谁」。只看 git diff 看不到调用链。<br>**验证结果** 变更影响面:命中哪些接口 / 方法 / 调用链、请求从哪进、哪些边还没测试。用来圈回归名单,而不是全文搜索猜。 |
  323. | 🔀 | <a href="skills/codexqa-change-analysis/README.zh-CN.md">codexqa-change-analysis</a> | **什么时候用** 一个分支或 PR 改完了,要把这次 diff 的完整影响交给评审人,并把它打开的测试缺口补上。<br>**验证结果** 一份 HTML 变更影响报告:新增 / 修改 / 删除的方法、能走到它们的入口、召回了已有用例的测试方案、覆盖判定和敏感路径;没覆盖的点会新增可运行的测试文件,跑过之后把结果数写进报告。 |
  324. | 🧯 | <a href="skills/codexqa-rootcause-analyzer/README.zh-CN.md">codexqa-rootcause-analyzer</a> | **什么时候用** 线上或本地异常,堆栈和日志对回仓库后,仍说不清到底卡在哪一层。<br>**验证结果** 带门禁的英文 RCA:触发点、根因、置信度分开写,并给一条可验证的修复方向。避免把抛错的那一行当成根因。 |
  325. | 🛡️ | <a href="skills/codexqa-defect-analyzer/README.zh-CN.md">codexqa-defect-analyzer</a> | **什么时候用** 合码前扫分支,或贴一段刚写的代码,问有没有 bug、密钥、危险写法。<br>**验证结果** P0–P3 HTML 扫描报告。规则扫描(SAST / lint / 密钥)和 Agent 语义检测合并去重:位置、证据、建议。关注缺陷和安全风险,不是评审意见书。 |
  326. | ⚖️ | <a href="skills/codexqa-code-reviewer/README.zh-CN.md">codexqa-code-reviewer</a> | **什么时候用** 要发给评审人、过合并门禁,不能只丢一份 git diff。<br>**验证结果** 双语 `REVIEW-REPORT.html`。基于符号图证据包(调用链、影响面、测试边)给出能否合、风险点和测试缺口,适合当 CR 附件。 |
  327. 输入契约窄、有停点、产物落本地。运行时就是你已经在用的 Agent。
  328. <h2 id="适用场景">适用场景</h2>
  329. | | 谁 | 典型用法:用什么、走哪些 skill、拿到什么 |
  330. | --- | --- | --- |
  331. | 🏢 | **企业** | **用什么** 现有的 Cursor / Claude Code / Codex / OpenClaw。一次 `npx skills add` 把验证接到 Coding Agent 旁边,不用账号、不用网关、不必把 QA 迁到另一套 SaaS。<br>**常用 skill** [codexqa-skill-router](skills/codexqa-skill-router/README.zh-CN.md) 按话路由;合 PR 走 [codexqa-code-analyzer](skills/codexqa-code-analyzer/README.zh-CN.md) + [codexqa-change-analysis](skills/codexqa-change-analysis/README.zh-CN.md) + [codexqa-defect-analyzer](skills/codexqa-defect-analyzer/README.zh-CN.md) + [codexqa-code-reviewer](skills/codexqa-code-reviewer/README.zh-CN.md);提测走 [codexqa-requirement-analyzer](skills/codexqa-requirement-analyzer/README.zh-CN.md) → [codexqa-testcase-generator](skills/codexqa-testcase-generator/README.zh-CN.md) → [codexqa-testdata-generator](skills/codexqa-testdata-generator/README.zh-CN.md),界面回放用 [codexqa-jev-browser](skills/codexqa-jev-browser/README.zh-CN.md);架构评审用 [codexqa-code-wiki](skills/codexqa-code-wiki/README.zh-CN.md);线上异常用 [codexqa-rootcause-analyzer](skills/codexqa-rootcause-analyzer/README.zh-CN.md)。<br>**拿到什么** 变更影响面(接口 / 方法 / 调用链、回归名单、测试缺口)、P0–P3 缺陷与安全扫描 HTML、可发给评审人的双语 `REVIEW-REPORT.html`、需求缺口登记表、Web/服务端/APP 用例、后端真实 ID 前置数据、架构知识图谱、带门禁的 RCA。产物落本地,发现项仍需人工确认。 |
  332. | 👤 | **个人** | **用什么** 自己的 Cursor 或 Codex 会话。装 [codexqa-skill-router](skills/codexqa-skill-router/README.zh-CN.md) 即可,需要时再拉干活 skill。<br>**常用 skill** 合自己的 PR 前:[codexqa-defect-analyzer](skills/codexqa-defect-analyzer/README.zh-CN.md) 扫 bug 和密钥,[codexqa-code-analyzer](skills/codexqa-code-analyzer/README.zh-CN.md) 看会打到谁,[codexqa-code-reviewer](skills/codexqa-code-reviewer/README.zh-CN.md) 出一份能打开的评审页。进陌生仓库用 [codexqa-code-wiki](skills/codexqa-code-wiki/README.zh-CN.md);自己写需求/用例再用生成器和造数。<br>**拿到什么** 打开就能看的 HTML:有没有明显缺陷、影响面清不清楚、评审意见能不能发出去。不用再上一套测试平台。 |
  333. | 🎓 | **教育** | **用什么** 任意支持 Agent Skills 的 IDE,加上仓库里的 [inventory-service](examples/inventory-service/README.md) 样例(7 个语义缺陷、4 个诱饵,答案键可复现)。<br>**常用 skill** 用 [codexqa-defect-analyzer](skills/codexqa-defect-analyzer/README.zh-CN.md) 教「扫描报告长什么样、发现项怎么分级」;用 [codexqa-code-wiki](skills/codexqa-code-wiki/README.zh-CN.md) / [codexqa-code-analyzer](skills/codexqa-code-analyzer/README.zh-CN.md) 对照模块枢纽和变更调用链;用 [codexqa-requirement-analyzer](skills/codexqa-requirement-analyzer/README.zh-CN.md) 与 [codexqa-testcase-generator](skills/codexqa-testcase-generator/README.zh-CN.md) 教需求能不能测、用例从哪来。<br>**拿到什么** 可打开的报告和学生可以对照的答案键,讲的是「可核查产物」而不是聊天里一段评语。一次记录运行的召回数字见样例 README,不是多模型榜。 |
  334. | 🤖 | **AI 开发** | **用什么** 你已经在跑的 Agent 运行时(Cursor · Claude Code · Codex · OpenClaw)+ Agent Skills 包,不是再写一个超级 prompt。<br>**常用 skill** [codexqa-skill-router](skills/codexqa-skill-router/README.zh-CN.md) 做入口,其余十个干活 skill 按契约交接:需求缺口、用例、造数、浏览器界面回放、架构图谱、影响面、变更影响报告、RCA、缺陷扫描、图证据评审。<br>**拿到什么** 磁盘上的 Markdown / HTML(登记表、用例、扫描页、`REVIEW-REPORT.html`、RCA),输入窄、有停点。把验证环节接进 Agent 产品时,交的是 skill 而不是一段不可复核的对话。 |
  335. 不是托管测试云。也不替代你的测试套件、SAST 授权或维护者判断。
  336. <h2 id="Star 这个仓库">Star 这个仓库</h2>
  337. 如果你要的就是这种本地 skill 包、而不是再上一套 QA 平台,点 <a href="https://github.com/openqa-cn/codexqa" target="_blank" rel="noopener noreferrer">⭐ Star</a> 会打开仓库页头,再点右上角 **Star**,能让后来的人更容易搜到。查看谁加过星:[openqa-cn/codexqa](https://github.com/openqa-cn/codexqa/stargazers)。出了问题,Issue 和最小复现比星更有用。
  338. <h2 id="更新日志">更新日志</h2>
  339. [![Release](https://img.shields.io/github/v/tag/openqa-cn/codexqa?label=latest)](https://github.com/openqa-cn/codexqa/releases)
  340. [![Last commit](https://img.shields.io/github/last-commit/openqa-cn/codexqa)](https://github.com/openqa-cn/codexqa/commits)
  341. [![Commit activity](https://img.shields.io/github/commit-activity/m/openqa-cn/codexqa)](https://github.com/openqa-cn/codexqa/graphs/commit-activity)
  342. **0.3.0** — `codexqa-*` 命名;架构 Wiki;Agent LLM Detection / judgment;文档主站 [openqa.cn](https://openqa.cn/?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=changelog-zh)。
  343. **0.2.0** — 首批五个已发布 skill、样例报告、inventory-service 7/7 盲测(一个模型、一次运行)。
  344. 全文:[CHANGELOG.md](CHANGELOG.md) · [Releases](https://github.com/openqa-cn/codexqa/releases)(Release 正文都带 openqa.cn)。
  345. <h2 id="产品与文档">产品与文档</h2>
  346. | 我想… | 去这里 |
  347. | --- | --- |
  348. | 打开产品站 | [openqa.cn](https://openqa.cn/?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=docs-home-zh) |
  349. | 浏览 skills | [Skill Hub](https://openqa.cn/skills?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=docs-skills-zh) |
  350. | 看商业产品 | [openqa.cn/agent](https://openqa.cn/agent?utm_source=github&utm_medium=readme&utm_campaign=oss-seo&utm_content=docs-product-zh) |
  351. | 按步骤安装 | [安装入门](docs/GETTING_STARTED.zh-CN.md) · [支持矩阵](docs/SUPPORT_MATRIX.zh-CN.md) |
  352. | 理解结论怎么来的 | [工作原理](docs/HOW_IT_WORKS.zh-CN.md) |
  353. | 复现盲测 | [inventory-service](examples/inventory-service/README.md) · [评估方法](benchmarks/README.md) |
  354. | 报缺陷 | [Issues](https://github.com/openqa-cn/codexqa/issues) · [安全](SECURITY.md) |
  355. | 提 PR | [贡献指南](CONTRIBUTING.md) · Apache-2.0 |
skills/codexqa-defect-analyzer/scripts/ensure_tools.py · Bundled script · 473 lines · 1 finding marked
  1. #!/usr/bin/env python3
  2. """
  3. Ensure out-of-the-box scan tools are installed BEFORE collect/scan.
  4. Policy (install → repair → degrade-and-continue):
  5. 1. Auto-install missing tools.
  6. 2. On failure: apply scripted repairs (PATH, pip/brew fallbacks) and retry.
  7. 3. If still missing: emit USER-VISIBLE warning with failed tools + reasons;
  8. DO NOT abort the scan — continue with whichever tools are ready.
  9. 4. Agent SOP (SKILL.md): before giving up, attempt further fixes from the
  10. failure log, then re-run ensure_tools; only then notify the user.
  11. No SonarQube / CodeQL (server tokens / SARIF env).
  12. """
  13. import argparse, os, shutil, subprocess, sys, time
  14. sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
  15. from lib import load_config, python_executable, skill_dir
  16. class ToolingError(RuntimeError):
  17. """Raised only when --strict and tools still missing after repairs."""
  18. pass
  19. # tool → install flags / repair hints for agent
  20. TOOL_HINTS = {
  21. 'semgrep': [
  22. 'brew install semgrep',
  23. 'python3 -m pip install --user --break-system-packages "semgrep>=1.80"',
  24. 'export PATH="$HOME/.local/bin:$HOME/Library/Python/*/bin:$PATH"',
  25. ],
  26. 'gitleaks': [
  27. 'brew install gitleaks',
  28. 'go install github.com/gitleaks/gitleaks/v8@latest && export PATH="$HOME/go/bin:$PATH"',
  29. ],
  30. 'osv-scanner': [
  31. 'brew install osv-scanner',
  32. 'go install github.com/google/osv-scanner/cmd/osv-scanner@latest && export PATH="$HOME/go/bin:$PATH"',
  33. ],
  34. 'bandit': [
  35. 'python3 -m pip install --user --break-system-packages bandit',
  36. 'export PATH="$HOME/Library/Python/*/bin:$HOME/.local/bin:$PATH"',
  37. ],
  38. 'gosec': [
  39. 'brew install gosec',
  40. 'go install github.com/securego/gosec/v2/cmd/gosec@latest',
  41. ],
  42. 'ruff': [
  43. 'brew install ruff',
  44. 'python3 -m pip install --user --break-system-packages ruff',
  45. ],
  46. 'eslint': [
  47. 'npm install -g eslint',
  48. 'export PATH="$(npm prefix -g)/bin:$PATH"',
  49. ],
  50. 'golangci-lint': [
  51. 'brew install golangci-lint',
  52. 'curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$HOME/.local/bin"',
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 59 on GitHub
  53. ],
  54. }
  55. FLAG_FOR_TOOL = {
  56. 'semgrep': '--core',
  57. 'gitleaks': '--core',
  58. 'osv-scanner': '--core',
  59. 'bandit': '--bandit',
  60. 'gosec': '--gosec',
  61. 'ruff': '--lint-py',
  62. 'eslint': '--lint-js',
  63. 'golangci-lint': '--lint-go',
  64. }
  65. def _which(*names):
  66. for n in names:
  67. p = shutil.which(n)
  68. if p:
  69. return p
  70. home = os.path.expanduser('~')
  71. extras = [
  72. os.path.join(home, '.local', 'bin'),
  73. os.path.join(home, 'go', 'bin'),
  74. '/opt/homebrew/bin',
  75. '/usr/local/bin',
  76. ]
  77. lib_py = os.path.join(home, 'Library', 'Python')
  78. if os.path.isdir(lib_py):
  79. for ver in sorted(os.listdir(lib_py), reverse=True):
  80. extras.append(os.path.join(lib_py, ver, 'bin'))
  81. try:
  82. prefix = subprocess.check_output(['npm', 'prefix', '-g'], text=True).strip()
  83. extras.append(os.path.join(prefix, 'bin'))
  84. except Exception:
  85. pass
  86. for d in extras:
  87. for n in names:
  88. cand = os.path.join(d, n)
  89. if os.path.isfile(cand) and os.access(cand, os.X_OK):
  90. os.environ['PATH'] = d + os.pathsep + os.environ.get('PATH', '')
  91. return cand
  92. return None
  93. def refresh_path():
  94. home = os.path.expanduser('~')
  95. extras = [
  96. os.path.join(home, '.local', 'bin'),
  97. os.path.join(home, 'go', 'bin'),
  98. '/opt/homebrew/bin',
  99. '/usr/local/bin',
  100. ]
  101. lib_py = os.path.join(home, 'Library', 'Python')
  102. if os.path.isdir(lib_py):
  103. for ver in sorted(os.listdir(lib_py), reverse=True):
  104. extras.append(os.path.join(lib_py, ver, 'bin'))
  105. try:
  106. prefix = subprocess.check_output(['npm', 'prefix', '-g'], text=True).strip()
  107. extras.append(os.path.join(prefix, 'bin'))
  108. except Exception:
  109. pass
  110. for d in extras:
  111. if os.path.isdir(d) and d not in os.environ.get('PATH', ''):
  112. os.environ['PATH'] = d + os.pathsep + os.environ.get('PATH', '')
  113. def detect_lang_needs(repo, files=None):
  114. need = {'py': False, 'js': False, 'go': False, 'java': False}
  115. paths = list(files or [])
  116. if not paths:
  117. for root, dirs, names in os.walk(repo):
  118. dirs[:] = [d for d in dirs if d not in
  119. ('.git', 'node_modules', 'vendor', 'dist', 'build', '__pycache__')]
  120. for n in names:
  121. ext = os.path.splitext(n)[1].lower()
  122. if ext == '.py':
  123. need['py'] = True
  124. elif ext in ('.js', '.ts', '.jsx', '.tsx'):
  125. need['js'] = True
  126. elif ext == '.go':
  127. need['go'] = True
  128. elif ext == '.java':
  129. need['java'] = True
  130. if all(need.values()):
  131. break
  132. else:
  133. for p in paths:
  134. if p.endswith('.py'):
  135. need['py'] = True
  136. elif p.endswith(('.js', '.ts', '.jsx', '.tsx')):
  137. need['js'] = True
  138. elif p.endswith('.go'):
  139. need['go'] = True
  140. elif p.endswith('.java'):
  141. need['java'] = True
  142. return need
  143. def _install_script():
  144. return os.path.join(skill_dir(), 'scripts', 'install_sast_tools.sh')
  145. def run_install(flags, timeout=1800):
  146. """Run install script; return (ok, log_text). Never raises for install failure."""
  147. script = _install_script()
  148. if not os.path.isfile(script):
  149. return False, 'missing install script: %s' % script
  150. if not os.access(script, os.X_OK):
  151. try:
  152. os.chmod(script, 0o755)
  153. except OSError as e:
  154. return False, 'cannot chmod install script: %s' % e
  155. cmd = ['bash', script] + list(flags)
  156. print('ensure_tools: running %s' % ' '.join(cmd), file=sys.stderr)
  157. try:
  158. r = subprocess.run(cmd, text=True, capture_output=True, timeout=timeout)
  159. except subprocess.TimeoutExpired:
  160. return False, 'install timed out after %ss' % timeout
  161. log = ((r.stdout or '') + '\n' + (r.stderr or '')).strip()
  162. if log:
  163. # keep agent/user able to read failure cause
  164. sys.stderr.write(log[-8000:] + ('\n' if not log.endswith('\n') else ''))
  165. return r.returncode == 0, log
  166. def _diagnose(log, missing):
  167. """Map install log + missing tools → repair actions the agent/script can try."""
  168. log_l = (log or '').lower()
  169. actions = []
  170. if 'externally-managed-environment' in log_l or 'pep 668' in log_l:
  171. actions.append({
  172. 'id': 'pep668',
  173. 'reason': 'PEP 668 blocked system pip',
  174. 'fix': 'use pip --user --break-system-packages or brew/pipx',
  175. })
  176. if 'bad interpreter' in log_l and 'pipx' in log_l:
  177. actions.append({
  178. 'id': 'pipx_broken',
  179. 'reason': 'pipx interpreter broken',
  180. 'fix': 'skip pipx; brew reinstall pipx OR use pip --user',
  181. })
  182. if 'another `brew update` process' in log_l or 'brew update' in log_l and 'already running' in log_l:
  183. actions.append({
  184. 'id': 'brew_lock',
  185. 'reason': 'Homebrew lock contention',
  186. 'fix': 'wait and retry; or kill stale brew process',
  187. })
  188. if 'permission denied' in log_l or 'eacces' in log_l:
  189. actions.append({
  190. 'id': 'permission',
  191. 'reason': 'permission denied during install',
  192. 'fix': 'fix ownership on ~/.local or use brew --user prefix',
  193. })
  194. if 'network' in log_l or 'timed out' in log_l or 'could not resolve' in log_l:
  195. actions.append({
  196. 'id': 'network',
  197. 'reason': 'network failure fetching packages',
  198. 'fix': 'retry; check proxy/mirror; use brew bottle cache',
  199. })
  200. for t in missing:
  201. actions.append({
  202. 'id': 'hint:%s' % t,
  203. 'reason': '%s still missing' % t,
  204. 'fix': '; '.join(TOOL_HINTS.get(t, ['re-run install_sast_tools.sh'])),
  205. })
  206. return actions
  207. def _scripted_repair(actions, missing):
  208. """
  209. Apply automated fixes we can do without user interaction.
  210. Returns list of applied repair ids.
  211. """
  212. applied = []
  213. ids = {a['id'] for a in actions}
  214. # Always refresh PATH (common: pip --user installed but not on PATH)
  215. refresh_path()
  216. applied.append('path_refresh')
  217. if 'brew_lock' in ids:
  218. time.sleep(8)
  219. applied.append('brew_lock_wait')
  220. # Direct per-tool fallbacks when still missing
  221. for tool in list(missing):
  222. if _which(tool):
  223. continue
  224. if tool in ('semgrep', 'bandit', 'ruff'):
  225. pkg = 'semgrep>=1.80' if tool == 'semgrep' else tool
  226. print('ensure_tools: repair — pip install %s' % pkg, file=sys.stderr)
  227. subprocess.run(
  228. [python_executable(), '-m', 'pip', 'install', '--user',
  229. '--break-system-packages', pkg],
  230. capture_output=True, text=True, timeout=600)
  231. refresh_path()
  232. applied.append('pip:%s' % tool)
  233. elif tool == 'eslint':
  234. print('ensure_tools: repair — npm install -g eslint', file=sys.stderr)
  235. subprocess.run(['npm', 'install', '-g', 'eslint'],
  236. capture_output=True, text=True, timeout=600)
  237. refresh_path()
  238. applied.append('npm:eslint')
  239. elif tool in ('gitleaks', 'osv-scanner', 'gosec', 'golangci-lint', 'ruff', 'semgrep'):
  240. if shutil.which('brew'):
  241. print('ensure_tools: repair — brew install %s' % tool, file=sys.stderr)
  242. subprocess.run(['brew', 'install', tool],
  243. capture_output=True, text=True, timeout=900)
  244. refresh_path()
  245. applied.append('brew:%s' % tool)
  246. return applied
  247. def _missing_core(adapters):
  248. miss = []
  249. if adapters.get('semgrep', True) and not _which('semgrep'):
  250. miss.append('semgrep')
  251. if adapters.get('secrets', True) and not _which('gitleaks'):
  252. if not (_which('trufflehog') or _which('detect-secrets')):
  253. miss.append('gitleaks')
  254. # SCA: OSV HTTP API always works without a binary; osv-scanner is optional enhancement.
  255. return miss
  256. def _missing_lang(adapters, lang):
  257. miss = []
  258. if adapters.get('bandit', True) and lang.get('py') and not _which('bandit'):
  259. miss.append('bandit')
  260. if adapters.get('gosec', True) and lang.get('go') and not _which('gosec'):
  261. miss.append('gosec')
  262. if adapters.get('lint', True):
  263. if lang.get('py') and not _which('ruff'):
  264. miss.append('ruff')
  265. if lang.get('js') and not _which('eslint'):
  266. miss.append('eslint')
  267. if lang.get('go') and not _which('golangci-lint'):
  268. miss.append('golangci-lint')
  269. return miss
  270. def _flags_for(adapters, lang, only_tools=None):
  271. flags = ['--core']
  272. want = set(only_tools) if only_tools else None
  273. if adapters.get('bandit', True) and lang['py'] and (want is None or 'bandit' in want):
  274. flags.append('--bandit')
  275. if adapters.get('gosec', True) and lang['go'] and (want is None or 'gosec' in want):
  276. flags.append('--gosec')
  277. if adapters.get('lint', True):
  278. if lang['py'] and (want is None or 'ruff' in want):
  279. flags.append('--lint-py')
  280. if lang['js'] and (want is None or 'eslint' in want):
  281. flags.append('--lint-js')
  282. if lang['go'] and (want is None or 'golangci-lint' in want):
  283. flags.append('--lint-go')
  284. return flags
  285. def format_user_warning(missing, diagnostics, repair_attempts):
  286. lines = [
  287. '',
  288. '=' * 60,
  289. 'WARNING: 以下扫描工具安装失败,将跳过这些适配器并继续后续扫描',
  290. '=' * 60,
  291. ]
  292. for t in missing:
  293. lines.append(' ✗ %s' % t)
  294. for h in TOOL_HINTS.get(t, []):
  295. lines.append(' 建议: %s' % h)
  296. if diagnostics:
  297. lines.append('失败原因摘要:')
  298. seen = set()
  299. for d in diagnostics:
  300. key = d.get('reason') or d.get('id')
  301. if key in seen:
  302. continue
  303. seen.add(key)
  304. lines.append(' - %s → %s' % (d.get('reason'), d.get('fix')))
  305. lines.append('已自动修复尝试: %d 次' % repair_attempts)
  306. lines.append('Agent: 请根据上述原因再试修复;若仍失败,告知用户后继续扫描。')
  307. lines.append('=' * 60)
  308. lines.append('')
  309. return '\n'.join(lines)
  310. def ensure_scan_tools(repo='.', cfg=None, files=None, full=False, auto_install=None,
  311. strict=None, max_repair=None):
  312. """
  313. Install + verify OOTB tools with repair loop.
  314. Returns status dict:
  315. ready, missing, degraded, diagnostics, repair_log, lang_need, binaries…
  316. Default: never abort scan (degraded continue). Set tooling.require_for_scan
  317. or strict=True to raise ToolingError when still missing after repairs.
  318. """
  319. del full
  320. cfg = cfg or load_config()
  321. tooling = cfg.get('tooling') or {}
  322. adapters = cfg.get('sast_adapters') or {}
  323. if auto_install is None:
  324. auto_install = tooling.get('auto_install', True)
  325. if strict is None:
  326. # Default False: warn + continue. True only if explicitly configured.
  327. strict = bool(tooling.get('require_for_scan', False))
  328. if max_repair is None:
  329. max_repair = int(tooling.get('repair_max_attempts', 3))
  330. refresh_path()
  331. lang = detect_lang_needs(repo, files=files)
  332. flags = _flags_for(adapters, lang)
  333. miss = _missing_core(adapters) + _missing_lang(adapters, lang)
  334. install_logs = []
  335. diagnostics = []
  336. repair_log = []
  337. attempts = 0
  338. while miss and auto_install and attempts < max_repair:
  339. attempts += 1
  340. print('ensure_tools: attempt %d/%d — missing %s'
  341. % (attempts, max_repair, ', '.join(miss)), file=sys.stderr)
  342. ok, log = run_install(flags)
  343. install_logs.append(log)
  344. refresh_path()
  345. miss = _missing_core(adapters) + _missing_lang(adapters, lang)
  346. if not miss:
  347. break
  348. diags = _diagnose(log, miss)
  349. diagnostics.extend(diags)
  350. applied = _scripted_repair(diags, miss)
  351. repair_log.append({'attempt': attempts, 'install_ok': ok, 'applied': applied,
  352. 'still_missing': list(miss)})
  353. refresh_path()
  354. miss = _missing_core(adapters) + _missing_lang(adapters, lang)
  355. if miss and attempts < max_repair:
  356. # targeted re-install for remaining tools only
  357. flags = _flags_for(adapters, lang, only_tools=miss)
  358. ready = []
  359. for name in ('semgrep', 'gitleaks', 'osv-scanner', 'bandit', 'gosec', 'ruff',
  360. 'eslint', 'golangci-lint'):
  361. if _which(name):
  362. ready.append(name)
  363. if adapters.get('sca', True):
  364. ready.append('osv-api')
  365. status = {
  366. 'semgrep': _which('semgrep'),
  367. 'gitleaks': _which('gitleaks'),
  368. 'osv_api': True if adapters.get('sca', True) else False,
  369. 'osv_scanner': _which('osv-scanner'),
  370. 'bandit': _which('bandit'),
  371. 'gosec': _which('gosec'),
  372. 'ruff': _which('ruff'),
  373. 'eslint': _which('eslint'),
  374. 'golangci-lint': _which('golangci-lint'),
  375. 'lang_need': lang,
  376. 'auto_install': auto_install,
  377. 'ready': ready,
  378. 'missing': list(miss),
  379. 'degraded': bool(miss),
  380. 'diagnostics': diagnostics[-20:],
  381. 'repair_log': repair_log,
  382. 'repair_attempts': attempts,
  383. 'continue_on_failure': not strict,
  384. }
  385. if miss:
  386. warn = format_user_warning(miss, diagnostics, attempts)
  387. sys.stderr.write(warn)
  388. # Machine-readable marker for agents
  389. print('ENSURE_TOOLS_DEGRADED missing=%s' % ','.join(miss), file=sys.stderr)
  390. if strict:
  391. raise ToolingError(
  392. 'FATAL (--strict): tools still missing after %d repair attempts: %s\n%s'
  393. % (attempts, ', '.join(miss), warn))
  394. print('ensure_tools: continuing with partial stack: %s'
  395. % (', '.join(ready) or '(none)'), file=sys.stderr)
  396. else:
  397. print('ensure_tools: OK — OOTB stack ready (%s)' % ', '.join(ready),
  398. file=sys.stderr)
  399. return status
  400. def main():
  401. ap = argparse.ArgumentParser(
  402. description='Install & verify OOTB scan tools (repair then degrade-and-continue)')
  403. ap.add_argument('--repo', default='.')
  404. ap.add_argument('--full', action='store_true')
  405. ap.add_argument('--no-install', action='store_true')
  406. ap.add_argument('--strict', action='store_true',
  407. help='Exit 4 if tools still missing after repairs (default: warn+continue)')
  408. ap.add_argument('--files', nargs='*', default=None)
  409. ap.add_argument('--max-repair', type=int, default=None)
  410. args = ap.parse_args()
  411. try:
  412. st = ensure_scan_tools(
  413. repo=args.repo, cfg=load_config(), files=args.files, full=args.full,
  414. auto_install=not args.no_install, strict=args.strict,
  415. max_repair=args.max_repair)
  416. except ToolingError as e:
  417. print(str(e), file=sys.stderr)
  418. sys.exit(4)
  419. if st.get('degraded'):
  420. print('ensure_tools: degraded — missing: %s' % ', '.join(st['missing']))
  421. sys.exit(0) # continue-friendly; agents check ENSURE_TOOLS_DEGRADED
  422. print('ensure_tools: ready')
  423. if __name__ == '__main__':
  424. main()

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.