Add Claude Code slash commands: pre-ci, feedback, audit-docs#8608
Add Claude Code slash commands: pre-ci, feedback, audit-docs#8608
Conversation
…docs Add three new developer slash commands: - /pre-ci: runs all locally-executable CI checks sequentially - /feedback: analyzes a session to identify documentation gaps - /audit-docs: audits documentation completeness for a feature branch Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The command can now take a topic like "webhooks" or "IPAM" and audit documentation coverage for that subject across the codebase, not just for a specific commit range. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WalkthroughThree new Markdown files are added under 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
dev/commands/pre-ci.md (1)
51-57: Renumber steps for consistency.Step "3b" should be "4", and subsequent steps should be renumbered 5-9 to maintain sequential numbering throughout the checklist.
📝 Proposed fix for step numbering
-### 3b. Type-check with mypy +### 4. Type-check with mypyThen update the remaining steps:
- "4. Lint documentation" → "5. Lint documentation"
- "5. Check lockfile is in sync" → "6. Check lockfile is in sync"
- "6. Validate generated files" → "7. Validate generated files"
- "7. Validate GraphQL and JSON schemas" → "8. Validate GraphQL and JSON schemas"
- "8. Run backend unit tests" → "9. Run backend unit tests"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@dev/commands/pre-ci.md` around lines 51 - 57, Rename the header "### 3b. Type-check with mypy" to "### 4. Type-check with mypy" and then increment the numbering of the subsequent numbered steps as described: change "4. Lint documentation" → "5. Lint documentation", "5. Check lockfile is in sync" → "6. Check lockfile is in sync", "6. Validate generated files" → "7. Validate generated files", "7. Validate GraphQL and JSON schemas" → "8. Validate GraphQL and JSON schemas", and "8. Run backend unit tests" → "9. Run backend unit tests" so the checklist is sequential; update these exact headings in dev/commands/pre-ci.md.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@dev/commands/pre-ci.md`:
- Around line 51-57: Rename the header "### 3b. Type-check with mypy" to "### 4.
Type-check with mypy" and then increment the numbering of the subsequent
numbered steps as described: change "4. Lint documentation" → "5. Lint
documentation", "5. Check lockfile is in sync" → "6. Check lockfile is in sync",
"6. Validate generated files" → "7. Validate generated files", "7. Validate
GraphQL and JSON schemas" → "8. Validate GraphQL and JSON schemas", and "8. Run
backend unit tests" → "9. Run backend unit tests" so the checklist is
sequential; update these exact headings in dev/commands/pre-ci.md.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8bcddc38-2f45-4516-81e7-fb8690e444b1
📒 Files selected for processing (3)
dev/commands/audit-docs.mddev/commands/feedback.mddev/commands/pre-ci.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@dev/commands/pre-ci.md`:
- Around line 93-100: Update the step text to accurately reflect what the task
does: change the description of backend.validate-generated to say it validates
generated schema files only (referencing the backend task validate_generated in
tasks/backend.py), e.g., "Ensures generated schema files are up to date." If you
prefer the original wording, instead modify the task validate_generated to also
check/generate protocol files; otherwise keep the docs focused on schemas and
keep the existing remediation instruction to run `uv run invoke
backend.generate`.
- Around line 4-11: Update the allowed-tools list to permit the full remediation
command referenced in the docs: add an entry that allows running the actual lock
sync (e.g., include "Bash(uv lock:*)" or "Bash(uv lock*)" alongside the existing
"Bash(uv lock --check:*)") so the documented `uv lock` command can execute when
lockfile sync is needed; modify the allowed-tools block and ensure the new entry
mirrors the existing pattern for other commands.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 529fbc03-af41-43b6-825a-ff15a5accbe5
📒 Files selected for processing (1)
dev/commands/pre-ci.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (4)
dev/commands/pre-ci.md (4)
42-42: Optional: Capitalize "Markdown" (proper noun).Static analysis suggests capitalizing "markdown" to "Markdown" as it's a proper noun referring to the formatting language.
Style fix
-Auto-fixes markdown formatting issues. +Auto-fixes Markdown formatting issues.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@dev/commands/pre-ci.md` at line 42, Update the lowercase word "markdown" to the capitalized form "Markdown" in the relevant documentation string so the term is treated as a proper noun; search for occurrences of the literal "markdown" (e.g., the sentence in dev/commands/pre-ci.md) and replace them with "Markdown" while preserving surrounding punctuation and formatting.
70-70: Clarify error reporting for backend.lint failures.The guidance says "If ruff reports issues, they were not auto-fixable," but
backend.lintruns three tools sequentially: ruff (linter), ty (type checker), and mypy (type checker). Failures could come from any of these tools, not just ruff.📝 Suggested clarification
-1. `uv run invoke backend.lint` — Run separately from main.lint to avoid `uv run invoke lint` which includes a `yamllint -s .` step that fails on vendored packages in `.venv`. If ruff reports issues, they were not auto-fixable — report them to the user. +1. `uv run invoke backend.lint` — Run separately from main.lint to avoid `uv run invoke lint` which includes a `yamllint -s .` step that fails on vendored packages in `.venv`. If this fails, report the specific tool errors (ruff/ty/mypy) to the user. Note: ruff issues at this stage were not auto-fixable.Based on learnings:
tasks/backend.py: lintruns ruff, ty, and mypy sequentially.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@dev/commands/pre-ci.md` at line 70, The sentence in dev/commands/pre-ci.md is misleading because backend.lint (tasks/backend.py: lint) runs ruff, ty, and mypy sequentially; update the sentence to clarify that if any of these three tools (ruff, ty, or mypy) report issues they were not auto-fixable and should be reported to the user, and mention the three tool names explicitly so failures aren’t attributed to ruff alone.
22-22: Consider clarifying what --fast skips.The description says "Skips backend lint (ty/mypy)" but
backend.lintactually runs ruff, ty, and mypy. While Phase 2 already runsmain.lint(which likely covers ruff), the parenthetical list could be more complete.Optional rewording for clarity
-- `--fast` — Run only formatting and fast lint checks (~20s). Skips backend lint (ty/mypy), Betterer, docs lint, generated file validation, schema validation, and unit tests. +- `--fast` — Run only formatting and fast lint checks (~20s). Skips backend lint (ruff/ty/mypy), Betterer, docs lint, generated file validation, schema validation, and unit tests.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@dev/commands/pre-ci.md` at line 22, The documentation for the --fast flag is ambiguous about what it skips; update the sentence mentioning "Skips backend lint (ty/mypy)" to list the actual checks run by backend.lint (ruff, ty, mypy) and clarify overlap with main.lint so readers understand which linters are skipped versus still executed; reference the `--fast` flag and the task names `backend.lint` and `main.lint` when editing the description to explicitly state that --fast skips backend.lint (ruff, ty, mypy) while Phase 2 still runs main.lint (ruff), and preserve the rest of the skipped items in the original sentence.
107-109: Optional: Vary sentence openings for readability.Three successive sentences begin with "If" at lines 107-109. Consider varying the structure for better flow.
Example rewording
If `--fast` was used, show skipped checks as "skipped". -If everything passed (or was skipped), tell the user they're ready to push. -If anything failed, list the specific failures and suggest fixes. +When all checks pass (or were skipped), indicate the branch is ready to push. +For any failures, list them specifically and suggest remediation steps.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@dev/commands/pre-ci.md` around lines 107 - 109, Rephrase the three consecutive sentences that all begin with "If" so they vary sentence openings for readability: change the first to "When `--fast` is used, show skipped checks as 'skipped'.", the second to something like "When everything passed or was skipped, tell the user they're ready to push.", and the third to "If any checks failed, list the specific failures and suggest fixes." Locate and edit the three consecutive sentences that currently start with "If" (the block describing fast/skipped/passed/failed outcomes) and replace them with these varied openings while preserving the original meanings.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@dev/commands/pre-ci.md`:
- Line 42: Update the lowercase word "markdown" to the capitalized form
"Markdown" in the relevant documentation string so the term is treated as a
proper noun; search for occurrences of the literal "markdown" (e.g., the
sentence in dev/commands/pre-ci.md) and replace them with "Markdown" while
preserving surrounding punctuation and formatting.
- Line 70: The sentence in dev/commands/pre-ci.md is misleading because
backend.lint (tasks/backend.py: lint) runs ruff, ty, and mypy sequentially;
update the sentence to clarify that if any of these three tools (ruff, ty, or
mypy) report issues they were not auto-fixable and should be reported to the
user, and mention the three tool names explicitly so failures aren’t attributed
to ruff alone.
- Line 22: The documentation for the --fast flag is ambiguous about what it
skips; update the sentence mentioning "Skips backend lint (ty/mypy)" to list the
actual checks run by backend.lint (ruff, ty, mypy) and clarify overlap with
main.lint so readers understand which linters are skipped versus still executed;
reference the `--fast` flag and the task names `backend.lint` and `main.lint`
when editing the description to explicitly state that --fast skips backend.lint
(ruff, ty, mypy) while Phase 2 still runs main.lint (ruff), and preserve the
rest of the skipped items in the original sentence.
- Around line 107-109: Rephrase the three consecutive sentences that all begin
with "If" so they vary sentence openings for readability: change the first to
"When `--fast` is used, show skipped checks as 'skipped'.", the second to
something like "When everything passed or was skipped, tell the user they're
ready to push.", and the third to "If any checks failed, list the specific
failures and suggest fixes." Locate and edit the three consecutive sentences
that currently start with "If" (the block describing fast/skipped/passed/failed
outcomes) and replace them with these varied openings while preserving the
original meanings.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c4e08fe6-d96b-4f4a-b1ce-9e6f262076f2
📒 Files selected for processing (1)
dev/commands/pre-ci.md
Why
We have useful Claude Code workflows (running CI checks locally, session feedback, doc auditing) that developers repeat manually. Codifying them as slash commands makes them discoverable and consistent.
What changed
/pre-ci— Local CI checksRuns all locally-executable CI checks with a summary table. Catches issues before pushing. Adapted from
infrahub-sdk-python.4 phases:
ruff), docs (markdown), frontend (biome --write)codegen:graphql)backend.test-unit--fastflag: Runs only phases 1–2. Skips backend lint, Betterer, docs lint, generated file validation, schema validation, and unit tests.Summary by CodeRabbit
- Documentation
- Added internal developer workflow guides for documentation audits, session feedback analysis, and pre-CI validation checklists to standardize processes.
table shows skipped checks./feedback— Session feedbackAnalyzes a conversation to identify documentation gaps, wrong assumptions, and undocumented patterns, then proposes fixes to the knowledge base. Adapted from
infrahub-sdk-python./audit-docs— Documentation auditScans changes and cross-references all 5 documentation layers (knowledge docs, user docs, specs, changelog, cross-refs), reporting gaps with severity. Three input modes:
All three files live in
dev/commands/following the existing command format.How to review
Three standalone markdown files in
dev/commands/.How to test
Verify the commands match expectations, each can be invoked via
/pre-ci,/feedback,/audit-docs.