Skip to content

Commit 4c07bd7

Browse files
authored
feat: add Vale, link-check, zizmor pre-commit and CI jobs, /ship skill (#12)
## Summary - Add `.vale.ini` and `.markdown-link-check.json` configuration files - Add link-checker and prose-lint (Vale) CI jobs to `quality-checks.yml` - Add Vale and zizmor pre-commit hooks to `.pre-commit-config.yaml` - Bump pre-commit hook versions to match other repos - Add `/ship` skill for end-to-end PR lifecycle management - Update `CLAUDE.md` with new tooling documentation ## Test plan - [ ] Pre-commit hooks pass locally (`pre-commit run --all-files`) - [ ] CI quality checks pass (including new link-checker and Vale jobs) - [ ] `/ship` skill SKILL.md is well-formed and references correct repo <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added automated link validation to catch broken documentation links. * Introduced prose quality checks to improve documentation clarity and consistency. * Established new workflow for streamlined pull request management with built-in documentation updates. * **Chores** * Updated development dependencies and tools. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 83a8534 commit 4c07bd7

File tree

7 files changed

+245
-9
lines changed

7 files changed

+245
-9
lines changed

.claude/skills/ship/SKILL.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
name: ship
3+
description: Update docs, commit, create PR, monitor CI and reviews, address feedback, merge
4+
user-invocable: true
5+
argument-hint: "[optional PR number to resume monitoring]"
6+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent
7+
---
8+
9+
# Ship — Commit, Monitor, Fix, Merge
10+
11+
End-to-end workflow: update documentation, commit, create PR, monitor CI
12+
and code reviews, address feedback, and merge when everything passes.
13+
14+
If `$ARGUMENTS` contains a PR number, skip to the monitoring phase for
15+
that PR.
16+
17+
## Phase 1 — Update Documentation
18+
19+
Before committing, review all staged and unstaged changes to understand
20+
what was modified, then update:
21+
22+
1. **CLAUDE.md** — If any CI/CD pipelines, hooks, skills, conventions,
23+
or project structure changed, update the relevant sections.
24+
2. **README.md** — If scripts, settings, architecture, or tooling
25+
changed, update the relevant sections.
26+
3. **docs/adr/** — If a significant architectural decision was made
27+
(new pattern, new tool, structural change), create or update an ADR.
28+
4. **MEMORY.md** — Update project memory at
29+
`$HOME/.claude/projects/-Users-gamaware-Documents-Repos-personal-github-org-settings/memory/MEMORY.md`
30+
if there are new gotchas, patterns, or preferences learned.
31+
32+
Only update files where changes are actually needed. Do not update docs
33+
for trivial changes.
34+
35+
## Phase 2 — Commit and Push
36+
37+
1. Stage all changes (including doc updates from Phase 1).
38+
2. Write a conventional commit message summarizing all changes.
39+
3. Push to the current feature branch.
40+
4. Create a PR if one does not exist yet. Use the commit message as
41+
the PR title. Include a summary and test plan in the body.
42+
43+
## Phase 3 — Monitor CI
44+
45+
Poll CI status using `gh pr checks <number>` every 30 seconds until
46+
all checks complete (pass, fail, or skip). Report the final status.
47+
48+
If any check fails:
49+
50+
1. Read the failure logs with `gh run view <id> --log-failed`.
51+
2. Diagnose and fix the issue.
52+
3. Commit and push the fix.
53+
4. Return to monitoring.
54+
55+
## Phase 4 — Monitor Code Reviews
56+
57+
Check for review comments from CodeRabbit and Copilot:
58+
59+
```bash
60+
gh api repos/{owner}/{repo}/pulls/{number}/comments
61+
gh api repos/{owner}/{repo}/issues/{number}/comments
62+
```
63+
64+
If CodeRabbit is rate-limited, wait for the timeout period then trigger
65+
with `gh pr comment <number> --body "@coderabbitai review"`.
66+
67+
For each review comment:
68+
69+
1. Read the comment carefully.
70+
2. Check if the comment is stale (already fixed in a later commit) by
71+
reading the current file state. Dismiss stale comments.
72+
3. If the comment is valid, fix the issue, commit, and push.
73+
4. After fixing, re-monitor CI (return to Phase 3).
74+
75+
After all fixes are pushed and the incremental review passes, resolve
76+
stale CodeRabbit threads in bulk:
77+
78+
```bash
79+
gh pr comment <number> --body "@coderabbitai resolve"
80+
```
81+
82+
For Copilot threads, resolve them via the GraphQL API:
83+
84+
```bash
85+
gh api graphql -f query='{
86+
repository(owner: "gamaware", name: "github-org-settings") {
87+
pullRequest(number: <NUMBER>) {
88+
reviewThreads(first: 100) { nodes { id isResolved } }
89+
}
90+
}
91+
}'
92+
```
93+
94+
Then for each unresolved thread ID:
95+
96+
```bash
97+
gh api graphql -f query='mutation {
98+
resolveReviewThread(input: {threadId: "<ID>"}) {
99+
thread { isResolved }
100+
}
101+
}'
102+
```
103+
104+
## Phase 5 — Merge
105+
106+
Once ALL of the following are true:
107+
108+
- All CI checks pass
109+
- CodeRabbit review has no unaddressed comments
110+
- Copilot review has no unaddressed comments
111+
112+
Then merge:
113+
114+
```bash
115+
gh pr merge <number> --squash --admin --delete-branch
116+
```
117+
118+
Pull main locally after merge:
119+
120+
```bash
121+
git checkout main && git pull
122+
```
123+
124+
Report the merge commit and confirm the branch was deleted.
125+
126+
## Rules
127+
128+
- Never suppress lint violations — fix them.
129+
- No AI attribution in commits.
130+
- Conventional commit messages required.
131+
- CodeRabbit may hit hourly rate limits — wait and retry.
132+
- Copilot comments may be stale after fix commits — verify current file state.
133+
- CodeRabbit auto-reviews incrementally on every push (up to 5 commits,
134+
then pauses). Use `@coderabbitai review` to resume after pause.
135+
- CodeRabbit does NOT auto-resolve its threads — use `@coderabbitai resolve`
136+
after fixes are confirmed.
137+
- Use `--admin` to bypass branch protection for merge.

.github/workflows/quality-checks.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,43 @@ jobs:
129129
130130
- name: Run zizmor
131131
run: zizmor --config zizmor.yml .github/workflows/
132+
133+
link-checker:
134+
name: Check Links
135+
runs-on: ubuntu-latest
136+
steps:
137+
- name: Checkout
138+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
139+
with:
140+
persist-credentials: false
141+
142+
- name: Check markdown links
143+
uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368 # v1
144+
with:
145+
config-file: '.markdown-link-check.json'
146+
use-quiet-mode: 'yes'
147+
continue-on-error: true
148+
149+
prose-lint:
150+
name: Prose Linting (Vale)
151+
runs-on: ubuntu-latest
152+
steps:
153+
- name: Checkout
154+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
155+
with:
156+
persist-credentials: false
157+
158+
- name: Install Vale
159+
env:
160+
VALE_VERSION: "3.13.1"
161+
run: |
162+
tmpdir="$(mktemp -d)"
163+
wget -q "https://github.com/errata-ai/vale/releases/download/v${VALE_VERSION}/vale_${VALE_VERSION}_Linux_64-bit.tar.gz"
164+
tar xzf "vale_${VALE_VERSION}_Linux_64-bit.tar.gz" -C "$tmpdir" vale
165+
sudo mv "$tmpdir/vale" /usr/local/bin/vale
166+
167+
- name: Run Vale
168+
run: |
169+
vale sync
170+
find . -name '*.md' -not -path './styles/*' -not -path './.git/*' \
171+
-exec vale {} +

.markdown-link-check.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"ignorePatterns": [
3+
{
4+
"pattern": "^http://localhost"
5+
},
6+
{
7+
"pattern": "^http://127.0.0.1"
8+
},
9+
{
10+
"pattern": "^http://192.168"
11+
},
12+
{
13+
"pattern": "^http://10\\."
14+
},
15+
{
16+
"pattern": "^http://172\\.(1[6-9]|2[0-9]|3[0-1])\\."
17+
}
18+
],
19+
"timeout": "20s",
20+
"retryOn429": true,
21+
"retryCount": 3,
22+
"aliveStatusCodes": [200, 206, 301, 302, 307, 308, 403, 405, 429]
23+
}

.pre-commit-config.yaml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
# General
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v5.0.0
4+
rev: v6.0.0
55
hooks:
66
- id: trailing-whitespace
77
- id: end-of-file-fixer
@@ -44,20 +44,38 @@ repos:
4444

4545
# Markdown
4646
- repo: https://github.com/igorshubovych/markdownlint-cli
47-
rev: v0.44.0
47+
rev: v0.47.0
4848
hooks:
4949
- id: markdownlint
5050
args: ["--fix"]
5151

52+
# Prose
53+
- repo: local
54+
hooks:
55+
- id: vale
56+
name: vale
57+
entry: bash -c 'vale sync --no-progress 2>/dev/null; vale "$@"' --
58+
language: system
59+
types: [markdown]
60+
5261
# GitHub Actions
5362
- repo: https://github.com/rhysd/actionlint
54-
rev: v1.7.7
63+
rev: v1.7.11
5564
hooks:
5665
- id: actionlint
5766

67+
- repo: local
68+
hooks:
69+
- id: zizmor
70+
name: zizmor
71+
entry: zizmor --config zizmor.yml .github/workflows/
72+
language: system
73+
files: ^\.github/workflows/.*\.ya?ml$
74+
pass_filenames: false
75+
5876
# Conventional Commits
5977
- repo: https://github.com/compilerla/conventional-pre-commit
60-
rev: v4.1.0
78+
rev: v4.4.0
6179
hooks:
6280
- id: conventional-pre-commit
6381
stages: [commit-msg]

.vale.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
StylesPath = styles
2+
MinAlertLevel = warning
3+
4+
Packages = write-good, proselint
5+
6+
[*.md]
7+
BasedOnStyles = write-good, proselint
8+
9+
# write-good tuning — too noisy for technical writing
10+
write-good.TooWordy = NO
11+
write-good.So = NO
12+
proselint.Very = NO
13+
proselint.Cliches = NO
14+
proselint.Typography = NO

CLAUDE.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ a baseline, apply corrections, and report drift via GitHub Issues.
3131

3232
## Pre-commit Hooks
3333

34-
General, secrets, shell, markdown, GitHub Actions, and conventional
35-
commit hooks — see `.pre-commit-config.yaml` for the full list.
34+
General, secrets, shell, markdown, prose (Vale), GitHub Actions
35+
(actionlint, zizmor), and conventional commit hooks — see
36+
`.pre-commit-config.yaml` for the full list.
3637

3738
## Claude Code Hooks
3839

@@ -65,7 +66,8 @@ commit hooks — see `.pre-commit-config.yaml` for the full list.
6566

6667
- `sync-settings.yml` — weekly settings sync + GitHub Issue reports
6768
- `quality-checks.yml` — markdown, YAML, shell, structure, JSON
68-
schema validation
69+
schema validation, link checking, zizmor (Actions security),
70+
Vale (prose linting)
6971
- `security.yml` — Semgrep SAST + Trivy SCA (via composite action)
7072
- `update-pre-commit-hooks.yml` — weekly auto-update via PR (via
7173
composite action)
@@ -83,6 +85,8 @@ commit hooks — see `.pre-commit-config.yaml` for the full list.
8385
- `/audit` — run a dry-run settings check across all repos
8486
- `/add-repo-override` — add a per-repo exception to overrides.json
8587
- `/exclude-repo` — exclude a repository from governance
88+
- `/ship [PR-number]` — end-to-end PR lifecycle: update docs, commit,
89+
create PR, monitor CI, address reviews (CodeRabbit + Copilot), merge
8690

8791
## Code Review
8892

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ Add repo names to the `excluded` array in `config/overrides.json`:
289289
- **CodeRabbit**: auto-review on PRs via `.coderabbit.yaml`
290290

291291
> **Note:** CodeRabbit must be enabled manually per repository through
292-
> the [CodeRabbit dashboard](https://app.coderabbit.ai). There is no
293-
> API to automate this. After installing the GitHub App, select "All
292+
> the [CodeRabbit dashboard](https://app.coderabbit.ai). No API exists
293+
> to automate this step. After installing the GitHub App, select "All
294294
> repositories" to cover new repos automatically, or add repos
295295
> individually through the dashboard.
296296

0 commit comments

Comments
 (0)