Skip to content

Commit 169d11e

Browse files
authored
Merge pull request #513 from netwrix/dev
vale linter prepush, updated skills
2 parents ff97bb2 + fd10f15 commit 169d11e

33 files changed

Lines changed: 751 additions & 366 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
message: "Do not use negative assumptions about what users can or cannot do."
1+
message: "Don't make negative assumptions about what users can or cannot do."
22
level: warning
33
reason: "This rule should trigger when the user or agent writes something that assumes a user cannot do something without the product."

.claude/skills/doc-pr-fix/SKILL.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: doc-pr-fix
3-
description: "Autonomous fixer for documentation PRs. Triggered by @claude comments on PRs targeting dev. Reads the writer's request and the existing doc-pr review, then applies fixes, runs Vale and Dale until clean, and commits. Use this skill whenever a writer tags @claude on a documentation PR — not for interactive help (use doc-help for that), but for autonomous, single-shot fixes in CI."
3+
description: "Autonomous fixer for documentation PRs. Triggered by @claude comments on PRs targeting dev. Reads the writer's request, the doc-pr review comment, and the Vale linting comment, then applies fixes and commits. Use this skill whenever a writer tags @claude on a documentation PR — not for interactive help (use doc-help for that), but for autonomous, single-shot fixes in CI."
44
argument-hint: "[pr-number] [writer-comment]"
55
---
66

@@ -20,8 +20,9 @@ You receive:
2020

2121
Parse the writer's comment to determine what they want. Common patterns:
2222

23-
- **Fix all issues** — apply every fix from the doc-pr review comment
24-
- **Fix only Vale/Dale issues** — apply only linting fixes
23+
- **Fix all issues** — apply every fix from the doc-pr review comment and the Vale linting comment
24+
- **Fix only Vale issues** — apply only fixes from the Vale linting comment
25+
- **Fix only Dale issues** — apply only Dale linting fixes
2526
- **Fix a specific issue** — apply one targeted fix
2627
- **Improve flow/clarity/structure** — editorial rewrite of specific content
2728
- **Explain something** — answer a question about a flagged issue (respond in a PR comment, don't edit files)
@@ -35,14 +36,21 @@ Parse the writer's comment to determine what they want. Common patterns:
3536
```bash
3637
gh api repos/{owner}/{repo}/issues/$PR_NUMBER/comments --jq '.[] | select(.body | contains("Documentation PR Review")) | .body' | tail -1
3738
```
38-
This tells you what Vale, Dale, and the editorial review already flagged.
39+
This tells you what Dale and the editorial review flagged.
40+
4. If the writer asks to fix Vale issues (or "all issues"), also find the Vale linting comment:
41+
```bash
42+
gh api repos/{owner}/{repo}/issues/$PR_NUMBER/comments --jq '.[] | select(.user.login == "github-actions[bot]" and (.body | contains("## Vale Linting"))) | .body' | tail -1
43+
```
44+
This gives you the Vale results table with file paths, line numbers, and rule violations.
3945

4046
## Step 3: Apply fixes
4147

4248
Work through the requested fixes methodically:
4349

44-
- For **linting fixes** (Vale/Dale): fix each flagged issue in order, file by file
45-
- For **editorial fixes**: apply the suggested changes from the review, or if the writer asked for something broader ("improve the flow"), read the full document and apply edits that address the request while following Netwrix style
50+
- For **Vale fixes**: read `docs/CLAUDE.md` for Vale guidance (especially the two rules requiring extra care), then fix each flagged issue in order, file by file
51+
- For **Dale fixes**: fix each flagged issue in order, file by file
52+
- For **editorial fixes from the review**: apply the suggested changes from the review comment
53+
- For **broader editorial requests** ("improve the flow", "make this clearer", "help with structure"): invoke `/doc-help` with the file path and the writer's request. Doc-help will analyze the document using its structured editing framework (structure, clarity, voice, surface). Since this is running in CI without an interactive writer, apply all of doc-help's suggestions autonomously rather than waiting for feedback
4654
- For **explanations**: post a PR comment explaining the issue and how to fix it, then stop — don't edit files
4755

4856
When editing:
@@ -52,15 +60,7 @@ When editing:
5260

5361
## Step 4: Verify
5462

55-
After all edits, run Vale on every file you changed:
56-
57-
```bash
58-
vale <file>
59-
```
60-
61-
Fix any new Vale errors. Re-run until zero errors remain.
62-
63-
Do NOT run Dale or any other skills during verification — just Vale.
63+
Review your edits to ensure they don't introduce new issues. Do NOT run Dale or any other skills during verification.
6464

6565
## Step 5: Commit and push
6666

@@ -86,15 +86,15 @@ Post a PR comment summarizing what you did:
8686
- `path/to/file.md`: <what was fixed>
8787
- `path/to/other.md`: <what was fixed>
8888

89-
Vale and Dale checks pass on all edited files.
89+
Dale checks pass on all edited files.
9090
```
9191

9292
If you were asked to explain something rather than fix it, your comment IS the deliverable — no summary needed.
9393

9494
## Behavioral Notes
9595

9696
- **Fix what's clear, ask about what isn't.** If a request has both obvious parts and ambiguous parts, apply the obvious fixes, commit and push those, then post a comment that summarizes what you did AND asks clarifying questions about the rest. The writer can reply with another `@claude` comment to continue.
97-
- **Never fix issues the writer didn't ask about.** If they said "fix the Vale issues," don't also rewrite sentences for clarity.
97+
- **Never fix issues the writer didn't ask about.** If they said "fix the Dale issues," don't also rewrite sentences for clarity.
9898
- **If a fix would substantially change the author's meaning**, skip it and explain why in your summary comment. Ask the writer how they'd like to handle it.
9999
- **If the entire request is unclear**, don't edit anything — post a comment asking for clarification. It's better to ask one good question than to guess wrong and push unwanted changes.
100100
- **Each `@claude` comment is a fresh invocation.** You won't remember previous runs, so always re-read the PR diff and review comment for context.

.claude/skills/doc-pr/SKILL.md

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
22
name: doc-pr
3-
description: "Orchestrate a full documentation review for pull requests targeting dev. Runs Vale linting, Dale linting, and editorial review on changed markdown files, then posts a structured comment to the PR. Use this skill whenever a PR involves markdown files in docs/ and targets the dev branch — triggered automatically by the doc-pr GitHub Actions workflow on PR open, sync, or when invoked manually via /doc-pr."
3+
description: "Orchestrate a documentation review for pull requests targeting dev. Runs Dale linting and editorial review on changed markdown files, then posts a structured comment to the PR. Vale linting runs separately via the vale-linter workflow (inline review comments + summary PR comment). Use this skill whenever a PR involves markdown files in docs/ and targets the dev branch — triggered automatically by the doc-pr GitHub Actions workflow on PR open, sync, or when invoked manually via /doc-pr."
44
argument-hint: "[changed-files-csv] [pr-number]"
55
---
66

77
# Doc PR Review
88

9-
You orchestrate a three-stage documentation review pipeline for pull requests. Your job is to run each stage, collect the results, and post a single comprehensive review comment to the PR.
9+
You orchestrate a two-stage documentation review pipeline for pull requests. Your job is to run each stage, collect the results, and post a single comprehensive review comment to the PR.
10+
11+
Vale linting runs separately (via the vale-linter workflow) and posts inline review comments plus a summary PR comment. Do not run Vale or include Vale results in your review.
1012

1113
Read `docs/CLAUDE.md` before starting — it contains the writing standards and Vale guidance you need for the editorial review stage.
1214

@@ -24,17 +26,7 @@ If the environment variables are empty, check for positional arguments (`$1` = f
2426

2527
Split the comma-separated file list into individual file paths for processing.
2628

27-
## Stage 1: Vale Linting
28-
29-
Run Vale on each changed file and capture the output.
30-
31-
```bash
32-
vale --output=line <file>
33-
```
34-
35-
Collect all Vale output. If Vale finds no issues for a file, note that file as clean. If Vale is not installed, report that Vale was unavailable and skip to Stage 2.
36-
37-
## Stage 2: Dale Linting
29+
## Stage 1: Dale Linting
3830

3931
For each changed file, invoke the Dale linter skill:
4032

@@ -44,7 +36,7 @@ For each changed file, invoke the Dale linter skill:
4436

4537
Dale returns a table of rule violations or a clean report. Collect all Dale output.
4638

47-
## Stage 3: Editorial Review
39+
## Stage 2: Editorial Review
4840

4941
This stage applies the doc-help editing analysis to the PR changes — but non-interactively. You are producing a written review, not having a conversation.
5042

@@ -70,7 +62,7 @@ Only report issues on lines that were added or modified in this PR. Do not flag
7062

7163
## Output — MANDATORY: Post as PR Comment
7264

73-
After completing all three stages, you MUST write the review to a file and post it as a PR comment. This is the most important step — the review is useless if it is not posted.
65+
After completing both stages, you MUST write the review to a file and post it as a PR comment. This is the most important step — the review is useless if it is not posted.
7466

7567
**Step 1: Write the review to a temporary file.**
7668

@@ -79,16 +71,6 @@ Write the full review body to `/tmp/doc-pr-review.md` using the Write tool. Foll
7971
```markdown
8072
## Documentation PR Review
8173

82-
### Vale Linting
83-
84-
**path/to/file.md**
85-
86-
| Line | Rule | Message | Offending Text |
87-
|------|------|---------|----------------|
88-
| N | `RuleName` | description of the issue | `offending text` |
89-
90-
(Repeat for each file. Write "No issues found." if clean.)
91-
9274
### Dale Linting
9375

9476
**path/to/file.md**
@@ -111,7 +93,7 @@ Write the full review body to `/tmp/doc-pr-review.md` using the Write tool. Foll
11193

11294
### Summary
11395

114-
N Vale issues, N Dale issues, N editorial suggestions across N files.
96+
N Dale issues, N editorial suggestions across N files. Vale issues are posted in a separate comment by the vale-linter workflow.
11597

11698
---
11799

@@ -120,7 +102,7 @@ N Vale issues, N Dale issues, N editorial suggestions across N files.
120102
Comment `@claude` on this PR followed by your instructions to get help:
121103

122104
- `@claude fix all issues` — fix all Vale, Dale, and editorial issues
123-
- `@claude fix only the Vale issues` — fix just the linting problems
105+
- `@claude fix only the Vale issues` — fix just the Vale issues
124106
- `@claude help improve the flow of this document` — get writing assistance
125107
- `@claude explain the voice issues` — understand why something was flagged
126108

@@ -140,6 +122,6 @@ If the `gh pr comment` command fails, report the error. Do NOT end your turn wit
140122
## Behavioral Notes
141123

142124
- Be thorough but not pedantic — focus on issues that genuinely affect reader comprehension or violate Netwrix standards
143-
- When Vale and your editorial review flag the same issue, include it only in the Vale section (Vale is more specific)
144-
- If a file has zero issues across all three stages, still list it with "No issues found." so the reviewer knows it was checked
125+
- Do not flag issues that Vale or Dale already catch — focus on what linters miss
126+
- If a file has zero issues across both stages, still list it with "No issues found." so the reviewer knows it was checked
145127
- Never modify the files — this is a read-only review

0 commit comments

Comments
 (0)