Skip to content

feat: integrate /code-review command into /complete-task pipeline - #29

Merged
NTCoding merged 3 commits into
mainfrom
integrate-code-review-into-complete-task
Jan 4, 2026
Merged

NTCoding merged 3 commits into
mainfrom
integrate-code-review-into-complete-task

Conversation

@NTCoding

@NTCoding NTCoding commented Jan 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Add /code-review command that runs semantic code review on changed TypeScript/TSX files, integrated into the /complete-task pipeline between the verify gate and task-check steps. Updates CLAUDE.md and task-workflow.md documentation to reflect the new workflow.

Changes

  • Created .claude/commands/code-review.md defining the /code-review command
  • Updated .claude/commands/complete-task.md to integrate /code-review into the pipeline
  • Updated CLAUDE.md to document code review workflow
  • Updated .claude/settings.json to disable automatic code review in favor of explicit command-based invocation
  • Updated docs/workflow/task-workflow.md to explain that /complete-task runs the complete autonomous pipeline

How it works

The /code-review command:

  1. Gets changed files between main and current branch
  2. Filters to .ts and .tsx files only
  3. Returns PASS if no TypeScript files changed
  4. Runs automatic code review via the automatic-code-review agent
  5. Returns FAIL with findings if issues detected

The /complete-task command runs the full autonomous pipeline:

  1. Verify gate (lint, typecheck, test)
  2. /code-review (semantic code review)
  3. Task-check (verification that work is complete)
  4. PR submission (commit, push, create/update PR)

The automatic-code-review plugin is disabled in settings.json because the /code-review and /complete-task commands now invoke it explicitly as part of their workflow, rather than running automatically on session stop.

Summary by CodeRabbit

Release Notes

  • Documentation

    • Added comprehensive code review workflow documentation with evaluation framework and structured output formats.
    • Expanded task completion workflow documentation with detailed pipeline stages, error handling paths, and clear step-by-step guidance.
    • Updated task workflow references to use /complete-task command structure.
  • Configuration

    • Disabled automatic code review feature.

✏️ Tip: You can customize this high-level summary in your review settings.

NTCoding and others added 2 commits January 4, 2026 18:22
Add /code-review command that runs semantic code review on changed files,
integrated into the /complete-task pipeline between verify gate and
task-check steps. Updates documentation to reflect new workflow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jan 4, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds a new semantic code-review command and detailed multi-stage complete-task workflow (verify gate → /code-review → task-check → submit PR), disables automatic code review in settings, and updates documentation paths and descriptions.

Changes

Cohort / File(s) Summary
Code Review Documentation
​.claude/commands/code-review.md
New file specifying a semantic code-review command: filters *.ts/*.tsx, PASS/FAIL output format, evaluation framework with valid skip reasons and default-fix rules.
Task Completion Workflow
​.claude/commands/complete-task.md
Replaces concise task instructions with a detailed 4‑stage sub-agent workflow (Verify gate → /code-review → Task-check → Submit PR), YAML subagent example, explicit PASS/FAIL handling, and loop/skip markers.
Settings Configuration
​.claude/settings.json
Disabled automaticCodeReview.enabled (true → false); fileExtensions and rulesFile unchanged.
Main Documentation
CLAUDE.md, docs/workflow/task-workflow.md
Updated path to .claude/automatic-code-review/rules.md, reworded automatic-code-review description to reference the /code-review and /complete-task agents, and changed Re-check PR guidance to use /complete-task.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User
  participant CompleteTask as /complete-task
  participant VerifyGate
  participant CodeReview as /code-review
  participant TaskCheck
  participant SubmitPR
  participant GitRemote as Git/PR

  User->>CompleteTask: invoke pipeline
  CompleteTask->>VerifyGate: run verify gate
  alt verify FAIL
    VerifyGate->>User: FAIL (stop)
  else verify PASS
    VerifyGate->>CodeReview: run code review (skip if disabled)
    alt code review FAIL
      CodeReview->>User: FAIL with findings
    else code review PASS or skipped
      CodeReview->>TaskCheck: run task-check
      alt task-check FAIL
        TaskCheck->>User: FAIL (marker created)
      else task-check PASS
        TaskCheck->>SubmitPR: submit PR (commit/push)
        alt submit FAIL
          SubmitPR->>User: FAIL (retry)
        else submit SUCCESS
          SubmitPR->>GitRemote: create/update PR
          GitRemote->>User: PR_READY (success)
        end
      end
    end
  end
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰✨
I hopped through docs and rules today,
Stitched sub-agents in a tidy way,
No auto-check—I'll peek and guide,
Four stages marching, side by side,
A rabbit cheers: "Pipeline, hooray!" 🥕

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: integrating the /code-review command into the /complete-task pipeline, which is the primary objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21692ef and c3c1b30.

📒 Files selected for processing (1)
  • docs/workflow/task-workflow.md
🧰 Additional context used
📓 Path-based instructions (2)
**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

All code documentation must follow conventions defined in docs/conventions/ (software-design.md, testing.md, standard-patterns.md, codebase-structure.md)

Files:

  • docs/workflow/task-workflow.md
**

📄 CodeRabbit inference engine (CLAUDE.md)

**: Never commit secrets, API keys, credentials, or sensitive data; use environment variables for sensitive configuration and do not log sensitive data
All cross-project imports must use package names (e.g., import { X } from '@living-architecture/[pkg-name]'), not relative paths

Files:

  • docs/workflow/task-workflow.md
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/workflow/code-review.md:0-0
Timestamp: 2026-01-03T11:38:30.208Z
Learning: After addressing issues from code review, complete the task by following @/docs/workflow/task-workflow.md → Completing Tasks
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/workflow/code-review.md:0-0
Timestamp: 2026-01-03T11:38:30.207Z
Learning: Applies to docs/workflow/**/*.{js,jsx,ts,tsx,!**/*.test.*,!**/*.spec.*} : Verify all production code files align with architecture boundaries and layering requirements as defined in @/docs/architecture/overview.md and @/docs/conventions/codebase-structure.md
📚 Learning: 2026-01-03T11:38:30.208Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/workflow/code-review.md:0-0
Timestamp: 2026-01-03T11:38:30.208Z
Learning: After addressing issues from code review, complete the task by following @/docs/workflow/task-workflow.md → Completing Tasks

Applied to files:

  • docs/workflow/task-workflow.md
📚 Learning: 2026-01-04T10:41:46.938Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T10:41:46.938Z
Learning: Follow the task workflow defined in docs/workflow/task-workflow.md from start to finish for all work; do not make changes without following these steps exactly

Applied to files:

  • docs/workflow/task-workflow.md
📚 Learning: 2026-01-04T10:41:46.938Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T10:41:46.938Z
Learning: Read docs/project/project-overview.md and check docs/project/PRD/active/*.md for current PRD context before starting work

Applied to files:

  • docs/workflow/task-workflow.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
docs/workflow/task-workflow.md (1)

18-18: Updates accurately reflect the new /complete-task pipeline integration.

The changes correctly update the workflow documentation to reflect the new /complete-task command and its role in running the complete autonomous pipeline (verify gate → /code-review → task-check → PR submission). The descriptions are clear and aligned with the actual implementations in .claude/commands/complete-task.md and .claude/commands/code-review.md. Cross-file consistency verified.


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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jan 4, 2026 •

Copy link
Copy Markdown

Deploying living-architecture with  Cloudflare Pages  Cloudflare Pages

Latest commit: c3c1b30
Status: ✅  Deploy successful!
Preview URL: https://68b98b6a.living-architecture.pages.dev
Branch Preview URL: https://integrate-code-review-into-c.living-architecture.pages.dev

View logs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
.claude/commands/code-review.md (1)

36-51: Consider clarifying when the evaluation framework applies.

The evaluation framework is comprehensive and provides good guidance. However, it's not entirely clear whether:

  1. The agent should apply this evaluation itself when deciding whether to fix issues
  2. The user should use this framework to evaluate the agent's findings
  3. Both

Consider adding a brief statement clarifying who is expected to apply this framework (agent, user, or both) and at what stage of the workflow.

.claude/commands/complete-task.md (2)

40-40: Clarify loop control tracking mechanism.

The workflow references "third successive attempt" in multiple steps but doesn't specify how attempts are tracked. Is this:

  1. Tracked automatically by the sub-agent?
  2. Tracked via marker files or environment variables?
  3. Expected to be tracked manually by the agent executing this workflow?

Consider documenting the tracking mechanism or clarifying that the agent should maintain attempt counts in its context during execution.

Also applies to: 51-51, 62-62, 73-73


54-63: Consider marker file cleanup strategy.

The workflow creates marker files in /tmp/task-check-done-<branch>.marker to skip redundant task-checks. However, there's no mention of cleanup:

  1. When should these markers be removed (e.g., after successful PR submission)?
  2. Should they persist across sessions?
  3. How should stale markers be handled if a branch is recreated?

Consider adding a cleanup step or documenting the marker lifecycle.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22c5a02 and 21692ef.

📒 Files selected for processing (4)
  • .claude/commands/code-review.md
  • .claude/commands/complete-task.md
  • .claude/settings.json
  • CLAUDE.md
🧰 Additional context used
📓 Path-based instructions (2)
**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

All code documentation must follow conventions defined in docs/conventions/ (software-design.md, testing.md, standard-patterns.md, codebase-structure.md)

Files:

  • CLAUDE.md
**

📄 CodeRabbit inference engine (CLAUDE.md)

**: Never commit secrets, API keys, credentials, or sensitive data; use environment variables for sensitive configuration and do not log sensitive data
All cross-project imports must use package names (e.g., import { X } from '@living-architecture/[pkg-name]'), not relative paths

Files:

  • CLAUDE.md
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/workflow/code-review.md:0-0
Timestamp: 2026-01-03T11:38:30.208Z
Learning: After addressing issues from code review, complete the task by following @/docs/workflow/task-workflow.md → Completing Tasks
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/workflow/code-review.md:0-0
Timestamp: 2026-01-03T11:38:30.207Z
Learning: Applies to docs/workflow/**/*.{js,jsx,ts,tsx,!**/*.test.*,!**/*.spec.*} : Check all production code files comply with software design conventions in @/docs/conventions/software-design.md and standard patterns in @/docs/conventions/standard-patterns.md
📚 Learning: 2026-01-03T11:38:30.207Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/workflow/code-review.md:0-0
Timestamp: 2026-01-03T11:38:30.207Z
Learning: Applies to docs/workflow/**/*.{test,spec}.{js,jsx,ts,tsx} : Review usage of `/* v8 ignore next -- preserve */` in test files - only allow when code is unreachable and required for compiler satisfaction; otherwise suggest extracting code or writing tests to mock behavior

Applied to files:

  • .claude/settings.json
  • .claude/commands/code-review.md
📚 Learning: 2026-01-04T10:41:46.938Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T10:41:46.938Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Maintain 100% test coverage as mandatory and enforced

Applied to files:

  • .claude/settings.json
📚 Learning: 2026-01-03T11:38:30.207Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/workflow/code-review.md:0-0
Timestamp: 2026-01-03T11:38:30.207Z
Learning: Applies to docs/workflow/**/*.{js,jsx,ts,tsx,!**/*.test.*,!**/*.spec.*} : Check production code against anti-patterns defined in @/docs/conventions/anti-patterns.md - hard failure unless documented exception exists

Applied to files:

  • .claude/settings.json
  • CLAUDE.md
  • .claude/commands/code-review.md
📚 Learning: 2026-01-04T10:41:46.938Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T10:41:46.938Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Avoid anti-patterns documented in docs/conventions/anti-patterns.md

Applied to files:

  • .claude/settings.json
  • CLAUDE.md
📚 Learning: 2026-01-03T11:38:30.208Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/workflow/code-review.md:0-0
Timestamp: 2026-01-03T11:38:30.208Z
Learning: After addressing issues from code review, complete the task by following @/docs/workflow/task-workflow.md → Completing Tasks

Applied to files:

  • .claude/commands/complete-task.md
  • CLAUDE.md
📚 Learning: 2026-01-04T10:41:46.938Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T10:41:46.938Z
Learning: Follow the task workflow defined in docs/workflow/task-workflow.md from start to finish for all work; do not make changes without following these steps exactly

Applied to files:

  • .claude/commands/complete-task.md
📚 Learning: 2026-01-02T11:58:27.001Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-cli/CLAUDE.md:0-0
Timestamp: 2026-01-02T11:58:27.001Z
Learning: When modifying CLI commands in the riviere-cli tool, update the corresponding workflow prompts in docs/workflow/ directory (step-1 through step-6) to keep the extraction workflow in sync

Applied to files:

  • .claude/commands/complete-task.md
📚 Learning: 2026-01-02T11:58:34.018Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-02T11:58:34.018Z
Learning: Read and follow all instructions in CLAUDE.md

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-04T10:41:46.938Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T10:41:46.938Z
Learning: Applies to **/*.md : All code documentation must follow conventions defined in docs/conventions/ (software-design.md, testing.md, standard-patterns.md, codebase-structure.md)

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-03T11:38:30.207Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/workflow/code-review.md:0-0
Timestamp: 2026-01-03T11:38:30.207Z
Learning: Applies to docs/workflow/**/*.{js,jsx,ts,tsx,!**/*.test.*,!**/*.spec.*} : Check all production code files comply with software design conventions in @/docs/conventions/software-design.md and standard patterns in @/docs/conventions/standard-patterns.md

Applied to files:

  • CLAUDE.md
  • .claude/commands/code-review.md
📚 Learning: 2026-01-04T10:41:46.938Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T10:41:46.938Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always follow software design principles defined in docs/conventions/software-design.md (including object calisthenics, fail-fast patterns, and dependency inversion)

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-04T10:41:46.938Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T10:41:46.938Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use standard implementation patterns defined in docs/conventions/standard-patterns.md

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-03T11:38:30.207Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/workflow/code-review.md:0-0
Timestamp: 2026-01-03T11:38:30.207Z
Learning: Applies to docs/workflow/**/*.{js,jsx,ts,tsx,!**/*.test.*,!**/*.spec.*} : Verify all production code files align with architecture boundaries and layering requirements as defined in @/docs/architecture/overview.md and @/docs/conventions/codebase-structure.md

Applied to files:

  • CLAUDE.md
  • .claude/commands/code-review.md
📚 Learning: 2026-01-04T10:41:46.938Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T10:41:46.938Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Test files must follow naming, assertions, and edge case checklist conventions defined in docs/conventions/testing.md

Applied to files:

  • CLAUDE.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (7)
CLAUDE.md (2)

112-112: LGTM: Path correction.

The path reference is now correct with the leading dot (.claude/ instead of ./claude/), which properly matches the actual directory structure.


137-137: LGTM: Accurate description of the code review workflow.

The updated description correctly reflects that the automatic-code-review plugin is now used explicitly via the /code-review and /complete-task commands rather than automatically on session stop.

.claude/commands/code-review.md (2)

1-52: LGTM: Well-structured code review workflow.

The command definition is clear and comprehensive. The PASS/FAIL output format provides good structure, and the evaluation framework with "highest quality code" heuristic is a solid foundation for decision-making.


13-14: Verify handling of uncommitted changes.

The command git diff --name-only main...HEAD only captures committed changes between branches. If there are uncommitted changes in the working directory, they won't be reviewed.

Consider whether the workflow should also handle uncommitted changes, or if the expectation is that all changes must be committed before running /code-review. If the latter, this should be documented in the Usage section.

#!/bin/bash
# Check if there are any usage instructions or guards for uncommitted changes in the complete-task workflow

rg -n "commit|uncommitted|working.directory|staged" .claude/commands/ -A 2 -B 2
.claude/commands/complete-task.md (3)

3-16: LGTM: Clear workflow visualization.

The ASCII diagram effectively illustrates the sub-agent pipeline with explicit failure paths, making it easy to understand the control flow at a glance.


18-23: LGTM: Good escape hatch for code review feedback.

The --feedback-rejected flag provides a useful mechanism to skip code review when the developer has evaluated and rejected the findings. This respects developer judgment while maintaining the default-review behavior.


68-68: No action required. The ./scripts/submit-pr.sh script exists and is executable in the repository.

Likely an incorrect or invalid review comment.

Comment thread .claude/settings.json
…ine command

Update task-workflow.md to clarify that /complete-task is the unified command
for both initial completion and re-checking PRs. Removes references to manual
submit-pr.sh usage and explains that the complete task command runs the full
autonomous pipeline (verify, review, task-check, and PR submission).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Jan 4, 2026

Copy link
Copy Markdown

@NTCoding
NTCoding merged commit 33efddc into main Jan 4, 2026
10 checks passed
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