From f5361604764d5237bb97d68b52c9a899bbd76da3 Mon Sep 17 00:00:00 2001 From: Marius van Niekerk Date: Sat, 28 Mar 2026 22:30:36 -0400 Subject: [PATCH 1/6] docs: add analysis types table to CLI commands page The commands page documented the analyze command flags but didn't list the available analysis types, which the README does. Add the full types table (test-fixtures, duplication, refactor, complexity, api-design, dead-code, architecture) and update the examples to lead with duplication. Closes https://github.com/AbanteAI/roborev/issues/589 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/content/docs/commands.mdx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/content/docs/commands.mdx b/src/content/docs/commands.mdx index 3c2343d..4f1983c 100644 --- a/src/content/docs/commands.mdx +++ b/src/content/docs/commands.mdx @@ -292,14 +292,29 @@ See: [GitHub Integration](/integrations/github/) ## Code Analysis ```bash -roborev analyze test-fixtures internal/*_test.go # Run built-in analysis -roborev analyze refactor --fix ./... # Analyze and auto-fix +roborev analyze duplication ./... # Find duplication +roborev analyze refactor --fix *.go # Suggest and apply refactors roborev analyze complexity --per-file src/*.go # One job per file +roborev analyze test-fixtures internal/*_test.go # Find test helper opportunities roborev analyze refactor --branch # Analyze changed files on branch roborev analyze refactor --branch=feature-xyz # Analyze a specific branch roborev analyze --list # List analysis types ``` +### Analysis Types + +| Type | Description | +|------|-------------| +| `test-fixtures` | Find test fixture and helper opportunities to reduce duplication | +| `duplication` | Find code duplication across files | +| `refactor` | Suggest refactoring opportunities | +| `complexity` | Analyze complexity and suggest simplifications | +| `api-design` | Review API consistency and design patterns | +| `dead-code` | Find unused exports and unreachable code | +| `architecture` | Review architectural patterns and structure | + +### Flags + | Flag | Description | |------|-------------| | `--agent ` | Use specific agent | From 2bf95f016a226dd676f1377a87e0236334c9960b Mon Sep 17 00:00:00 2001 From: Marius van Niekerk Date: Sat, 28 Mar 2026 22:33:37 -0400 Subject: [PATCH 2/6] docs: expand analysis types table with detailed descriptions Each type now has 1-2 sentences explaining what the agent looks for and what it reports, based on the actual prompt templates. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/content/docs/guides/assisted-refactoring.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/content/docs/guides/assisted-refactoring.mdx b/src/content/docs/guides/assisted-refactoring.mdx index 5ccb152..22a5c41 100644 --- a/src/content/docs/guides/assisted-refactoring.mdx +++ b/src/content/docs/guides/assisted-refactoring.mdx @@ -18,13 +18,13 @@ Seven built-in analysis types target common refactoring concerns: | Type | Description | |------|-------------| -| `test-fixtures` | Find test fixture and helper opportunities to reduce duplication | -| `duplication` | Find code duplication across files | -| `refactor` | Suggest refactoring opportunities | -| `complexity` | Analyze complexity and suggest simplifications | -| `api-design` | Review API consistency and design patterns | -| `dead-code` | Find unused exports and unreachable code | -| `architecture` | Review architectural patterns and structure | +| `duplication` | Finds exact and structural code duplication across files. Reports similarity percentages, consolidation opportunities with example code, and estimated line reduction. | +| `refactor` | Identifies code smells and anti-patterns: long functions, complex conditionals, poor naming, tight coupling, and missing or excessive abstractions. Suggests specific refactorings ranked by impact. | +| `complexity` | Flags cyclomatic complexity hotspots, deeply nested control flow, complex boolean expressions, and functions with too many parameters. Suggests concrete simplifications with trade-off notes. | +| `test-fixtures` | Scans test files for repeated data construction, common setup/teardown patterns, similar assertion sequences, and duplicated mocks. Proposes reusable helper functions and fixtures. | +| `api-design` | Reviews the public API surface for naming consistency, parameter ordering, return value patterns, and error handling. Flags confusing or ambiguous APIs and suggests improvements. | +| `dead-code` | Finds unused exports, unreachable code paths, stale commented-out code, and debug leftovers. Flags confidence level since some exports may have external callers. | +| `architecture` | Evaluates package organization, dependency flow, separation of concerns, coupling, and cohesion. Identifies circular dependencies, leaky abstractions, and layering violations. | List available types with `roborev analyze --list`, or preview a prompt template with `roborev analyze --show-prompt `. If you have shell completions enabled, `roborev analyze ` will suggest analysis types with descriptions. From 3a0b290cd388835ccf46e1b2d86e5c7651a5785e Mon Sep 17 00:00:00 2001 From: Marius van Niekerk Date: Sat, 28 Mar 2026 22:35:18 -0400 Subject: [PATCH 3/6] docs: shorten analysis type descriptions Co-Authored-By: Claude Opus 4.6 (1M context) --- src/content/docs/guides/assisted-refactoring.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/content/docs/guides/assisted-refactoring.mdx b/src/content/docs/guides/assisted-refactoring.mdx index 22a5c41..d43e064 100644 --- a/src/content/docs/guides/assisted-refactoring.mdx +++ b/src/content/docs/guides/assisted-refactoring.mdx @@ -18,13 +18,13 @@ Seven built-in analysis types target common refactoring concerns: | Type | Description | |------|-------------| -| `duplication` | Finds exact and structural code duplication across files. Reports similarity percentages, consolidation opportunities with example code, and estimated line reduction. | -| `refactor` | Identifies code smells and anti-patterns: long functions, complex conditionals, poor naming, tight coupling, and missing or excessive abstractions. Suggests specific refactorings ranked by impact. | -| `complexity` | Flags cyclomatic complexity hotspots, deeply nested control flow, complex boolean expressions, and functions with too many parameters. Suggests concrete simplifications with trade-off notes. | -| `test-fixtures` | Scans test files for repeated data construction, common setup/teardown patterns, similar assertion sequences, and duplicated mocks. Proposes reusable helper functions and fixtures. | -| `api-design` | Reviews the public API surface for naming consistency, parameter ordering, return value patterns, and error handling. Flags confusing or ambiguous APIs and suggests improvements. | -| `dead-code` | Finds unused exports, unreachable code paths, stale commented-out code, and debug leftovers. Flags confidence level since some exports may have external callers. | -| `architecture` | Evaluates package organization, dependency flow, separation of concerns, coupling, and cohesion. Identifies circular dependencies, leaky abstractions, and layering violations. | +| `duplication` | Finds exact and structural code duplication across files. Reports consolidation opportunities with estimated line reduction. | +| `refactor` | Identifies code smells like long functions, complex conditionals, poor naming, and tight coupling. Ranks suggestions by impact. | +| `complexity` | Flags cyclomatic complexity hotspots, deep nesting, and functions with too many parameters. Suggests simplifications. | +| `test-fixtures` | Finds repeated test setup, duplicated mocks, and similar assertion sequences. Proposes reusable helpers and fixtures. | +| `api-design` | Reviews public API surface for naming consistency, parameter ordering, and error handling patterns. | +| `dead-code` | Finds unused exports, unreachable code paths, and stale commented-out code. Flags confidence level per finding. | +| `architecture` | Evaluates package organization, dependency flow, and separation of concerns. Identifies circular dependencies and layering violations. | List available types with `roborev analyze --list`, or preview a prompt template with `roborev analyze --show-prompt `. If you have shell completions enabled, `roborev analyze ` will suggest analysis types with descriptions. From aa4af8fef4be7a7b8241378ee119b051b0b883a7 Mon Sep 17 00:00:00 2001 From: Marius van Niekerk Date: Sat, 28 Mar 2026 22:36:12 -0400 Subject: [PATCH 4/6] docs: remove duplicated analysis types table from commands page The guide page already has a more detailed version of this table. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/content/docs/commands.mdx | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/content/docs/commands.mdx b/src/content/docs/commands.mdx index 4f1983c..c34f24f 100644 --- a/src/content/docs/commands.mdx +++ b/src/content/docs/commands.mdx @@ -301,20 +301,6 @@ roborev analyze refactor --branch=feature-xyz # Analyze a specific branch roborev analyze --list # List analysis types ``` -### Analysis Types - -| Type | Description | -|------|-------------| -| `test-fixtures` | Find test fixture and helper opportunities to reduce duplication | -| `duplication` | Find code duplication across files | -| `refactor` | Suggest refactoring opportunities | -| `complexity` | Analyze complexity and suggest simplifications | -| `api-design` | Review API consistency and design patterns | -| `dead-code` | Find unused exports and unreachable code | -| `architecture` | Review architectural patterns and structure | - -### Flags - | Flag | Description | |------|-------------| | `--agent ` | Use specific agent | From 2aa6a0524f700a3eebb0e64967e05c279ea54139 Mon Sep 17 00:00:00 2001 From: Marius van Niekerk Date: Sat, 28 Mar 2026 22:37:47 -0400 Subject: [PATCH 5/6] docs: trim analysis type descriptions to one sentence each Co-Authored-By: Claude Opus 4.6 (1M context) --- src/content/docs/guides/assisted-refactoring.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/docs/guides/assisted-refactoring.mdx b/src/content/docs/guides/assisted-refactoring.mdx index d43e064..addcc7d 100644 --- a/src/content/docs/guides/assisted-refactoring.mdx +++ b/src/content/docs/guides/assisted-refactoring.mdx @@ -18,13 +18,13 @@ Seven built-in analysis types target common refactoring concerns: | Type | Description | |------|-------------| -| `duplication` | Finds exact and structural code duplication across files. Reports consolidation opportunities with estimated line reduction. | -| `refactor` | Identifies code smells like long functions, complex conditionals, poor naming, and tight coupling. Ranks suggestions by impact. | -| `complexity` | Flags cyclomatic complexity hotspots, deep nesting, and functions with too many parameters. Suggests simplifications. | -| `test-fixtures` | Finds repeated test setup, duplicated mocks, and similar assertion sequences. Proposes reusable helpers and fixtures. | +| `duplication` | Finds exact and structural code duplication across files and suggests consolidation opportunities. | +| `refactor` | Identifies code smells like long functions, complex conditionals, poor naming, and tight coupling. | +| `complexity` | Flags cyclomatic complexity hotspots, deep nesting, and functions with too many parameters. | +| `test-fixtures` | Finds repeated test setup, duplicated mocks, and similar assertion sequences across test files. | | `api-design` | Reviews public API surface for naming consistency, parameter ordering, and error handling patterns. | -| `dead-code` | Finds unused exports, unreachable code paths, and stale commented-out code. Flags confidence level per finding. | -| `architecture` | Evaluates package organization, dependency flow, and separation of concerns. Identifies circular dependencies and layering violations. | +| `dead-code` | Finds unused exports, unreachable code paths, and stale commented-out code. | +| `architecture` | Evaluates package organization, dependency flow, separation of concerns, and layering violations. | List available types with `roborev analyze --list`, or preview a prompt template with `roborev analyze --show-prompt `. If you have shell completions enabled, `roborev analyze ` will suggest analysis types with descriptions. From 60866a489663f3f8530883b5a56e15595b92e2aa Mon Sep 17 00:00:00 2001 From: Marius van Niekerk Date: Sat, 28 Mar 2026 23:17:38 -0400 Subject: [PATCH 6/6] docs: soften complexity description to match prompt-based nature Co-Authored-By: Claude Opus 4.6 (1M context) --- src/content/docs/guides/assisted-refactoring.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/guides/assisted-refactoring.mdx b/src/content/docs/guides/assisted-refactoring.mdx index addcc7d..fc0bb67 100644 --- a/src/content/docs/guides/assisted-refactoring.mdx +++ b/src/content/docs/guides/assisted-refactoring.mdx @@ -20,7 +20,7 @@ Seven built-in analysis types target common refactoring concerns: |------|-------------| | `duplication` | Finds exact and structural code duplication across files and suggests consolidation opportunities. | | `refactor` | Identifies code smells like long functions, complex conditionals, poor naming, and tight coupling. | -| `complexity` | Flags cyclomatic complexity hotspots, deep nesting, and functions with too many parameters. | +| `complexity` | Looks for complex functions, deep nesting, and large conditionals, then suggests simplifications. | | `test-fixtures` | Finds repeated test setup, duplicated mocks, and similar assertion sequences across test files. | | `api-design` | Reviews public API surface for naming consistency, parameter ordering, and error handling patterns. | | `dead-code` | Finds unused exports, unreachable code paths, and stale commented-out code. |