mit einem Klick
find-duplication
// Find code duplication in the codebase. Supports branch-scoped or full sweep. Use when the user asks to find duplicated code or repeated patterns before a PR.
// Find code duplication in the codebase. Supports branch-scoped or full sweep. Use when the user asks to find duplicated code or repeated patterns before a PR.
| name | find-duplication |
| description | Find code duplication in the codebase. Supports branch-scoped or full sweep. Use when the user asks to find duplicated code or repeated patterns before a PR. |
| disable-model-invocation | true |
Detect duplicated or near-duplicate code and suggest consolidation candidates.
src/lightspeed_agentic/. Skip test duplication unless asked.main.src/lightspeed_agentic/.Branch mode:
git diff --name-only origin/main -- 'src/lightspeed_agentic/' | grep '\.py$'
Full mode target: src/lightspeed_agentic/.
uv run pylint --disable=all --enable=duplicate-code --min-similarity-lines=6 <target>
Filter false positives: import blocks, Pydantic boilerplate, one-liners.
Look for similar signatures, repeated error handling, copy-pasted blocks:
rg "<distinctive pattern>" src/lightspeed_agentic/ --type py -l
| Category | Action |
|---|---|
| Extract — identical logic in 3+ places | Shared helper |
| Parameterize — same structure, different values | Common function |
| Acceptable — different domains | Note only |
| Test-only | Fixtures (if user asked) |
Files, line ranges, description, classification, suggested helper location. Summary: counts and rough savings.
Update Python dependencies with uv, regenerate lock and Konflux requirements files, then verify lint, types, and tests. Fix breakage from API changes in bumped packages. Use when the user says "deps update", "bump dependencies", or "update deps".
Find functions with high cyclomatic complexity, length, or parameter count. Use when the user asks for complexity hotspots or refactor candidates.
Find unused functions, classes, imports, and unreachable code paths. Use when the user asks for dead code or cleanup candidates.
Investigate CI job failures on a GitHub pull request (checks, Prow, or GitHub Actions). Use when the user pastes a PR URL and asks about CI failures or red checks.
Step-by-step workflow for committing staged changes and opening a pull request for lightspeed-agentic-sandbox.
Performs a strict clean rebase of a feature branch onto main with minimal conflict resolution and full validation. Use when the user asks to rebase carefully and run tests + verify until green.