Skip to content

Commit 990016b

Browse files
openshift-cherrypick-robotclaudethemr0c
authored
[release-1.9-post-cqa] [RHIDP-12950]: Rewrite CQA scripts from bash to Node.js ESM (#1997)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Fabrice Flore-Thébault <ffloreth@redhat.com>
1 parent e8e491d commit 990016b

132 files changed

Lines changed: 10935 additions & 7446 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/CLAUDE.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@
22

33
## CQA Compliance
44

5-
When editing `.adoc` files, ALWAYS run the relevant CQA scripts to validate and fix changes before considering the task done. Run all 19 checks at once with `build/scripts/cqa.sh`, or run individual scripts. All share a common interface via `build/scripts/cqa-lib.sh`:
5+
When editing `.adoc` files, ALWAYS run the relevant CQA checks to validate and fix changes before considering the task done:
66

77
```bash
88
# Report issues for a title
9-
./build/scripts/cqa.sh titles/<title>/master.adoc
9+
node build/scripts/cqa/index.js titles/<title>/master.adoc
1010

1111
# Auto-fix issues
12-
./build/scripts/cqa.sh --fix titles/<title>/master.adoc
12+
node build/scripts/cqa/index.js --fix titles/<title>/master.adoc
1313

14-
# Run across all titles
15-
./build/scripts/cqa.sh --all
16-
17-
# Auto-fix across all titles
18-
./build/scripts/cqa.sh --fix --all
14+
# Run a single check
15+
node build/scripts/cqa/index.js --check NN titles/<title>/master.adoc
1916
```
2017

2118
Output markers: `[AUTOFIX]` (auto-fixable), `[FIXED]` (applied), `[MANUAL]` (needs human), `[-> CQA-NN AUTOFIX]` / `[-> CQA-NN MANUAL]` (delegated).
2219

23-
For full CQA workflow, load `.claude/skills/cqa-main-workflow.md`. Individual skill files are in `.claude/skills/cqa-*.md`.
20+
The `project-cqa` plugin (`.claude/plugins/project-cqa/`) provides skills for the full CQA workflow and individual checks. The CQA spec is at `.claude/plugins/project-cqa/resources/cqa-spec.md`.
2421

2522
## Pull Requests
2623

@@ -35,7 +32,7 @@ When creating PRs, follow `.github/pull_request_template.md`:
3532

3633
| Workflow | Trigger | Purpose |
3734
|---|---|---|
38-
| `content-quality-assessment.yml` | PR (`.adoc`, `build/scripts/`) | Runs `cqa.sh --all` on entire repo. Posts checklist as PR comment, uploads SARIF to Code Scanning. Scripts sourced from `main` branch (not base) for backport compatibility. |
35+
| `content-quality-assessment.yml` | PR (`.adoc`, `build/scripts/`) | Runs `node build/scripts/cqa/index.js --all` on entire repo. Posts checklist as PR comment. Scripts sourced from `main` branch (not base) for backport compatibility. |
3936
| `build-asciidoc.yml` | Push to main/release | Builds AsciiDoc docs and deploys to GitHub Pages. Cleans up merged PR preview branches. |
4037
| `pr.yml` | PR | Builds HTML preview, deploys to `gh-pages`, posts preview URL as PR comment. |
4138
| `style-guide.yml` | PR | Runs Vale linter on `assemblies/` for style guide compliance. |

.claude/MEMORY.md

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,19 @@
22

33
This file contains persistent knowledge about working with the RHDH documentation repository for Claude Code.
44

5-
## CQA 2.1 Compliance Process
5+
## CQA 2.1 Compliance
66

7-
**ALWAYS use the checklist for CQA work:**
7+
The `project-cqa` plugin (`.claude/plugins/project-cqa/`) provides:
8+
- **Skills:** `cqa-main-workflow` orchestrates all 19 checks; individual `cqa-NN-*` skills for each check
9+
- **Spec:** `resources/cqa-spec.md` is the single source of truth for all check logic
10+
- **Resources:** Style guides, templates, and reference materials
811

9-
1. **FIRST:** Load the workflow files
10-
```
11-
Read .claude/skills/cqa-main-workflow.md, .claude/cqa-checklist.md, .claude/MEMORY.md
12-
```
13-
- The main workflow orchestrates all 17 CQA requirements in optimal order
14-
- The checklist follows the same 5-phase structure
15-
- **Idempotency requirement:** Re-execute each requirement until no changes, then re-run entire workflow until stable
12+
**Script interface:**
13+
```bash
14+
node build/scripts/cqa/index.js [--fix] [--check NN] titles/<title>/master.adoc
15+
```
1616

17-
2. **VERIFY required information** - If any are missing, ASK the user:
18-
- JIRA ticket number (e.g., RHIDP-12345)
19-
- Title name or path to master.adoc file
20-
21-
3. **THEN:** Use the master workflow as the guide
22-
- Create a TodoWrite following the sequence in cqa-main-workflow.md
23-
- Read individual CQA skills (.claude/skills/cqa-##-*.md) for detailed assessment
24-
- Run each step sequentially; respect the sequence order
25-
26-
4. **NEVER claim completion unless:**
27-
- ALL checkbox items are marked with a checkmark
28-
- Idempotency verified (re-running workflow produces no changes)
29-
- TodoWrite shows all tasks complete
30-
31-
### Reference Materials
32-
33-
Updated using `./build/scripts/update-cqa-resources.sh` (weekly minimum, daily maximum).
34-
See `.claude/skills/update-all-resources.md` for details.
35-
36-
- **SSG:** `.claude/resources/red-hat-ssg.md` — grammar, style, formatting (CQA 8, 9, 10, 12, 16)
37-
- **Peer Review:** `.claude/resources/red-hat-peer-review.md` — titles, grammar, editorial quality (CQA 10, 12)
38-
- **Modular Docs:** `.claude/resources/red-hat-modular-docs.md` — content types, module templates (CQA 2-6, 10, 13)
39-
- **Vale:** `.vale-dita-only.ini` (CQA 1), `.vale.ini` (CQA 12). Sync with `vale sync`. `attributes.adoc` excluded from Vale.
40-
41-
### Best Practices
42-
43-
1. **Scripts first, manual second:** Run all automated scripts before manual fixes
44-
2. **One step at a time:** Don't batch steps, even if they seem related
45-
3. **Verify after fixes:** Re-run scripts after manual changes to confirm alignment
46-
4. **Git mv for renames:** Always use git mv to preserve history
47-
5. **Idempotency:** Re-run each CQA requirement until no changes, then re-run full workflow until stable
48-
49-
### Pull Request Guidelines
50-
51-
**Never use `#` notation for CQA numbers** in PR descriptions (e.g., write "CQA 1" not "CQA-1"). GitHub auto-links `#number` to unrelated issues/PRs.
52-
53-
PR description format is in `.claude/cqa-checklist.md`.
17+
**Never use `#` notation for CQA numbers** in PR descriptions — GitHub auto-links `#number`.
5418

5519
## Repository Structure
5620

0 commit comments

Comments
 (0)