Skip to content

Add Claude Code slash commands: pre-ci, feedback, audit-docs#8608

Open
polmichel wants to merge 8 commits intodevelopfrom
pmi-20260324-claude-commands
Open

Add Claude Code slash commands: pre-ci, feedback, audit-docs#8608
polmichel wants to merge 8 commits intodevelopfrom
pmi-20260324-claude-commands

Conversation

@polmichel
Copy link
Contributor

@polmichel polmichel commented Mar 16, 2026

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 checks

Runs all locally-executable CI checks with a summary table. Catches issues before pushing. Adapted from infrahub-sdk-python.

4 phases:

  1. Auto-fix formatting (sequential): Python (ruff), docs (markdown), frontend (biome --write)
  2. Fast checks (parallel): Python lint, lockfile sync, frontend GraphQL types regeneration (codegen:graphql)
  3. Slow checks (parallel): Backend lint (ty/mypy), Betterer (TS regression gate), docs lint, generated file validation, GraphQL + JSON schema validation
  4. Unit tests: backend.test-unit

--fast flag: 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 feedback

Analyzes 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 audit

Scans changes and cross-references all 5 documentation layers (knowledge docs, user docs, specs, changelog, cross-refs), reporting gaps with severity. Three input modes:

  • Branch/range: audit all changes in a commit range or branch
  • Subject: audit docs for a freeform topic (e.g., "webhooks", "IPAM")
  • Doc paths: audit specific existing documentation files for completeness and accuracy against the current codebase

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.

polmichel and others added 4 commits March 14, 2026 15:33
…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>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 16, 2026

Walkthrough

Three new Markdown files are added under dev/commands/: audit-docs.md (Documentation Audit workflow covering scope gathering, mapping changes across five documentation layers, an audit report format, and fix-application options), feedback.md (session feedback and documentation-gap analysis workflow with report templates and fix-application options), and pre-ci.md (reproducible local pre-CI checklist with ordered commands for formatting, linting, type/schema checks, lockfile validation, and unit tests). These are documentation-only additions, do not modify executable code or public entity declarations, and total +308 lines changed.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding three Claude Code slash commands to the dev/commands/ directory.
Description check ✅ Passed The description covers Why, What changed, and How to review/test, addressing the template's core sections appropriately for this documentation-focused change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@polmichel polmichel requested review from a team and ogenstad March 16, 2026 07:40
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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 mypy

Then 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

📥 Commits

Reviewing files that changed from the base of the PR and between c9469aa and b654c9b.

📒 Files selected for processing (3)
  • dev/commands/audit-docs.md
  • dev/commands/feedback.md
  • dev/commands/pre-ci.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b654c9b and 5f245a2.

📒 Files selected for processing (1)
  • dev/commands/pre-ci.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@polmichel polmichel marked this pull request as draft March 16, 2026 11:08
@polmichel polmichel marked this pull request as ready for review March 18, 2026 13:30
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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.lint runs 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: lint runs 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.lint actually runs ruff, ty, and mypy. While Phase 2 already runs main.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

📥 Commits

Reviewing files that changed from the base of the PR and between 6f633a1 and 61b7cd5.

📒 Files selected for processing (1)
  • dev/commands/pre-ci.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant