Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/aidd-dev/CATALOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Auto-generated index of skills, agents, references and assets shipped by the `ai
| `actions` | [03-cleanup.md](skills/07-refactor/actions/03-cleanup.md) | - |
| `actions` | [04-architecture.md](skills/07-refactor/actions/04-architecture.md) | - |
| `-` | [README.md](skills/07-refactor/README.md) | - |
| `-` | [SKILL.md](skills/07-refactor/SKILL.md) | `Improve code without breaking behavior across four axes - cleanup (clean-code + tech debt), performance, security, architecture. Scans and fixes, or fixes the findings of an audit report pushed in by the caller. Use when the user wants to refactor, clean up, optimize, harden, or restructure code. Do NOT use for read-only diagnosis (use 04-audit), adding tests (use 06-test), or UI redesign (use the impeccable skill).` |
| `-` | [SKILL.md](skills/07-refactor/SKILL.md) | `Improve code without breaking behavior across four axes - cleanup (clean-code + tech debt), performance, security, architecture. Scans and fixes, or fixes the findings of an audit report pushed in by the caller. Use when the user wants to refactor, clean up, optimize, harden, restructure, or delete/remove code. Do NOT use for read-only diagnosis (use 04-audit), adding tests (use 06-test), or UI redesign (use the impeccable skill).` |

#### `skills/08-debug`

Expand Down
3 changes: 2 additions & 1 deletion plugins/aidd-dev/skills/07-refactor/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: 07-refactor
description: Improve code without breaking behavior across four axes - cleanup (clean-code + tech debt), performance, security, architecture. Scans and fixes, or fixes the findings of an audit report pushed in by the caller. Use when the user wants to refactor, clean up, optimize, harden, or restructure code. Do NOT use for read-only diagnosis (use 04-audit), adding tests (use 06-test), or UI redesign (use the impeccable skill).
description: Improve code without breaking behavior across four axes - cleanup (clean-code + tech debt), performance, security, architecture. Scans and fixes, or fixes the findings of an audit report pushed in by the caller. Use when the user wants to refactor, clean up, optimize, harden, restructure, or delete/remove code. Do NOT use for read-only diagnosis (use 04-audit), adding tests (use 06-test), or UI redesign (use the impeccable skill).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include drop in the skill trigger description

When a user says “drop X” without explicitly invoking this skill, the runtime only has the frontmatter description to decide whether to load 07-refactor, but this trigger text lists only delete/remove code while the new routing rule below handles drop this after the skill is already loaded. In that context the advertised “drop this” path can be unreachable or routed elsewhere; add drop to the description trigger wording if it is meant to be supported.

Useful? React with 👍 / 👎.

argument-hint: performance | security | cleanup | architecture
---

Expand All @@ -23,6 +23,7 @@ This skill is run-one-OR-run-all:

- The user named an axis ("optimize this", "harden", "clean up", "restructure") -> run that ONE action.
- Unscoped ("refactor this", "improve the code") -> ask ONE question: "all applicable axes, or a specific one (cleanup / performance / security / architecture)?" Then run the chosen one, or all applicable.
- The user asked to delete or remove code ("delete X", "remove this", "drop this") -> run the `cleanup` action directly; do not ask which axis.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid routing feature removals through cleanup

Routing every delete/remove/drop request straight to cleanup makes behavior-changing removals land in a skill that still mandates behavior preservation (public inputs and outputs stay identical here and no public API surface has changed in actions/03-cleanup.md). For requests like “remove the /foo endpoint” or “delete this exported component”, this either blocks the requested change during verification or asks cleanup to sweep callers/tests/docs while violating its own contract; narrow this route to dead/unused/private code deletions or hand functional removals to planning/implementation.

Useful? React with 👍 / 👎.

- Never silently default to action 01.

## Audit handoff (push, never pull)
Expand Down
2 changes: 1 addition & 1 deletion plugins/aidd-dev/skills/07-refactor/actions/03-cleanup.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ verification: <summary of test and type-check results confirming no behavioral r
- Replace magic numbers and inline strings with named constants.
- Remove dead, misleading, or out-of-date comments; add a brief comment only where intent is genuinely non-obvious.
3. **Apply tech-debt fixes** from the finding list:
- Delete dead code and unused exports.
- Delete dead code and unused exports, and sweep for the orphaned references a deletion leaves behind.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor the requested deletion target

For a direct request such as “delete the unused foo helper”, the new route sends control to cleanup, but this action still only deletes items that its standalone/audit finding list classifies as dead code or unused exports; it never turns the user-specified target into an input or required finding. If the scan misses the target or considers it still referenced, the skill can do unrelated cleanup while leaving the requested deletion untouched, so carry the requested symbol/file through the cleanup process before sweeping orphaned references.

Useful? React with 👍 / 👎.

- Reduce cyclomatic complexity by extracting early returns, guard clauses, and helper functions.
- Shorten oversized files and functions to a single responsibility.
- Flatten excessive nesting.
Expand Down