feat: add improve-architecture plugin#45
Conversation
Migrate medley's in-repo `improve` skill into a repo-agnostic skill plugin.
Scans an existing codebase for module-level friction (shallow modules, seam
leaks, locality gaps) via Ousterhout's deep-module lens, presents candidates as
a self-contained HTML report, and interviews the selected candidate before
handoff for planning.
- One skill with an internal action-router (deepening lens; open for more lenses)
- Namespaced /improve-architecture:improve-architecture
- No userConfig; durable candidate artifact defaults to ${CLAUDE_PLUGIN_DATA},
honoring a consumer work-artifact convention when present
- Medley rule/path couplings stripped; cross-skill refs degrade gracefully
- Ports evals as a local gate
…cripts in inline SVG - README license: replace ../../LICENSE link (breaks under plugin cache isolation) with inline MIT SPDX reference - html-report.md: forbid <script> elements inside inline SVG alongside the existing no-remote-fetch rules
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_2c7f8671-6efa-413d-9019-5e72ae0f3cfe) |
|
Claude finished @kyle-sexton's task in 3m 45s —— View job PR Review: feat/plugin-improve
SummaryClean addition. This is the marketplace's first skill-type plugin (all prior plugins are hooks/scripts), and the design is solid — vocabulary discipline, progressive-disclosure lens architecture, self-contained HTML output, and correct Security review: PASS — no hooks, no MCP servers, no code execution surface, no data egress, no credentials. Self-contained skill only. Issue 1 — Medium: Skill cross-references don't use
|
There was a problem hiding this comment.
Stale comment
Risk: medium. Cursor Bugbot did not complete successfully (check skipped; usage limit reached), so the required automated review signal is missing. Human review is needed before merge; no reviewers were assigned because the author is the only human collaborator on this repository.
Sent by Cursor Approval Agent: Pull Request Router and Approver
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1987d06ae0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…eedback Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_5d0c8ca8-c956-40fa-bcc5-4f8675b7a460) |
|
Claude finished @kyle-sexton's task in 3m 3s —— View job PR Review: feat/plugin-improve
Status of Prior FeedbackCodex P2 (HTML escaping) — Addressed ✅ The latest commit (
This directly addresses the injection vector Codex flagged. ✅ Previous Claude review Issue 1 (Medium) — Still Open The
Full vocabulary in [../research/deepening/vocabulary.md](../research/deepening/vocabulary.md)
Classify each candidate's dependencies per [../research/deepening/dependencies.md](../research/deepening/dependencies.md)
Full scaffold and diagram patterns in [../research/deepening/html-report.md](../research/deepening/html-report.md)
See [../research/deepening/interface-design.md](../research/deepening/interface-design.md)
Full process: `actions/deepening.md`Uses vocabulary from [vocabulary.md](vocabulary.md)Also:
Dependencies and their category (per [dependencies.md](dependencies.md))
Include both [vocabulary.md](vocabulary.md) terms...The risk profile remains: if the Claude Code runtime passes skill markdown text to the model without pre-resolving relative links, and the model attempts to use the Suggested fix for Full vocabulary in `${CLAUDE_PLUGIN_ROOT}/skills/improve-architecture/research/deepening/vocabulary.md`And in Full process: `${CLAUDE_PLUGIN_ROOT}/skills/improve-architecture/actions/deepening.md`Fresh Review FindingsEverything verified in the previous review holds. No regressions introduced by the merge commit. A few additional observations:
Eval coverage — Three cases cover the essential behavioral contract: empty-args routing, strong positive classification, and false-positive prevention on an already-deep module. ✅
SVG script prohibition — Security surface — No hooks, no MCP servers, no code execution path beyond the optional VerdictOne item remains before merge. The If the author has confirmed via testing or documentation that the Claude Code runtime pre-resolves relative links in skill markdown before passing them to the model, that would clear this — a comment here explaining the confirmed behavior would close the loop. Otherwise, the defensive |
There was a problem hiding this comment.
Stale comment
Risk: medium. Cursor Bugbot did not complete successfully (check skipped; usage limit reached), so the required automated review signal is missing. Human review is needed before merge; no reviewers were assigned because the author is the only human contributor on this repository.
Sent by Cursor Approval Agent: Pull Request Router and Approver
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f85806c003
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Include powershell-format in marketplace.json and README. Use mktemp for secure, unpredictable HTML report paths on shared hosts. Co-authored-by: Cursor <cursoragent@cursor.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_5cc560a0-ca6e-4a2e-90a6-ea86a4d3bc90) |
PR Review: feat/plugin-improve
Status of Prior FeedbackCodex P2 (HTML escaping) — Addressed ✅
Codex P2 (temp file security) — Addressed ✅
Prior Claude review — Medium issue on This was raised twice by previous reviews, but fresh docs confirm it was never a real issue. The official Skills documentation explicitly shows supporting-file references using relative paths: ## Additional resources
- For complete API details, see [reference.md](reference.md)
- For usage examples, see [examples.md](examples.md)This is exactly the pattern the PR uses. More importantly, Fresh Review FindingsInformational: If a future lens adds bash injection (
The Skill frontmatter is complete and correct ✅
Progressive disclosure is correctly structured ✅ Research files ( Evals coverage is well-scoped ✅ Three cases cover the behavioral contract: default routing (eval 1), positive-case Strong classification (eval 2), and false-positive prevention on a genuinely deep module (eval 3). The expectations are specific enough to be meaningful as regression guards.
Security surface remains clean ✅ No hooks, no MCP servers, no code execution beyond the optional Verification Checklist
VerdictReady to merge. All prior feedback has been addressed. The outstanding "medium" concern from two previous reviews is resolved by current documentation — the relative-path approach is the documented and correct pattern; |
There was a problem hiding this comment.
Stale comment
Risk: medium. Cursor Bugbot did not complete successfully (check skipped), so the required automated review signal is missing. Human review is needed before merge; no reviewers were assigned because the author is the only human contributor on this repository.
Sent by Cursor Approval Agent: Pull Request Router and Approver
Resolve marketplace.json and README to include actionlint alongside powershell-format and improve-architecture. Co-authored-by: Cursor <cursoragent@cursor.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_fc56bbb8-c842-402e-a060-b486e7991150) |
|
Claude finished @kyle-sexton's task in 2m 59s —— View job PR Review: feat/plugin-improve
What triggered this reviewThe latest push ( Status of prior feedback
Fresh review of the current stateSchema, Entry includes Frontmatter is complete: Three phases with hard gates.
Opens with escaping requirement. Scaffold uses inline
Vocabulary: source-attributed, "Rejected framings" section prevents common misapplications. Dependencies: four categories with clear testing strategies and seam-discipline rules. Interface design: "Design It Twice" with parallel subagents, well-scoped prompts per agent. All cross-references are relative paths — the documented and correct pattern for skill supporting files. ✅ Three cases cover the behavioral contract: empty-args routing, strong positive classification (shallow wrapper chain), and false-positive prevention (already-deep module). Expectations are specific enough to serve as regression guards. Merge regression checkThe merge commit ( Security reviewNo hooks, no MCP servers, no code execution surface beyond the optional VerdictReady to merge. All prior feedback is addressed. The merge commit introduced no regressions. Fresh review of all improve-architecture files confirms correctness, security, and alignment with the CLAUDE.md playbook. No open issues. |
There was a problem hiding this comment.
Stale comment
Risk: medium. Cursor Bugbot did not complete successfully (check skipped), so the required automated review signal is missing. Human review is needed before merge; no reviewers were assigned because the author is the only human contributor on this repository.
Sent by Cursor Approval Agent: Pull Request Router and Approver
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3299420887
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Set disable-model-invocation so broad prompts cannot auto-trigger HTML report generation, glossary edits, or other side-effecting phases. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_83426a3a-62e9-40d3-99c3-06201a059180) |
|
Claude finished @kyle-sexton's task in 1m 56s —— View job PR Review: feat/plugin-improve
What triggered this reviewThe latest commit -disable-model-invocation: false
+disable-model-invocation: trueThis directly addresses the Codex P2 from the prior review pass. Status of all prior feedback
Fresh correctness and security review
Pre-computed context bash injections — All carry
Evals — Three cases in Security surface — No hooks, no MCP servers, no code execution beyond optional CLAUDE.md alignment — Repo-agnostic (no hardcoded paths), no VerdictReady to merge. All Codex P2 findings and all prior Claude review issues are now addressed. The single-line change in this commit ( |
There was a problem hiding this comment.
Stale comment
Risk: medium. Cursor Bugbot did not complete successfully (check skipped), so the required automated review signal is missing. Human review is needed before merge; no reviewers were assigned because the author is the only human contributor on this repository.
Sent by Cursor Approval Agent: Pull Request Router and Approver
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7f6218d6a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Cursor <cursoragent@cursor.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_e5237b9d-a565-4f6c-a4c2-8d1eb27099c6) |
|
Claude finished @kyle-sexton's task in 1m 49s —— View job PR Review: feat/plugin-improve
What triggered this reviewThe latest commit -- deepening: <one sentence — the proposed deep interface>
+- deepening: <one sentence — the shallow-module friction signal, not an interface proposal>This directly addresses the last open Codex P2 finding. Status of all prior feedback
Assessment of the fixThe change is precise and well-targeted. The
No collateral changes required. Verification checklist — current state
VerdictReady to merge. All Codex P2 findings across all review passes have been addressed. The latest commit closes the last open concern cleanly — the |
There was a problem hiding this comment.
Stale comment
Risk: medium. Cursor Bugbot did not complete successfully (check skipped; usage limit reached), so the required automated review signal is missing. Human review is needed before merge; no reviewers were assigned because the author is the only human contributor on this repository.
Sent by Cursor Approval Agent: Pull Request Router and Approver
# Conflicts: # .claude-plugin/marketplace.json # README.md
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_9b145612-455d-45ec-aca4-bc122ad7bf6d) |
|
Claude finished @kyle-sexton's task in 1m 27s —— View job PR Review: feat/plugin-improve
What triggered this reviewThe latest commit Merge regression checkThe conflict resolution in { "name": "improve-architecture", "source": "./plugins/improve-architecture",
"category": "architecture",
"tags": ["architecture", "refactoring", "deep-modules", "ousterhout", "module-design", "testability", "skill"] }
Status of all prior feedback
Verification checklist — current state
VerdictReady to merge. The latest merge from |
There was a problem hiding this comment.
Risk: medium. Cursor Bugbot did not complete successfully (check skipped; usage limit reached), so the required automated review signal is missing. Human review is needed before merge; no reviewers were assigned because the author is the only human contributor on this repository.
Sent by Cursor Approval Agent: Pull Request Router and Approver
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10903a5634
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ## <candidate title> | ||
|
|
||
| - status: proposed | selected | agreed-shape | rejected | ||
| - files: <comma-separated paths> |
There was a problem hiding this comment.
Quote paths in the durable handoff
When the scanned repo contains a path with a comma or newline (valid Git filenames), this machine-readable handoff can be parsed as extra paths or even extra Markdown fields/candidates by the later planning step, because paths are emitted as one raw comma-separated scalar. The HTML report now has escaping rules, but this durable artifact is the one subsequent automation consumes; require a structured representation such as a JSON/YAML array, or explicit escaping/quoting of every codebase-derived scalar before writing it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10903a5634
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| Use the project's domain glossary vocabulary for the domain, and [../research/deepening/vocabulary.md](../research/deepening/vocabulary.md) vocabulary for architecture. | ||
|
|
||
| **Durable candidate artifact.** Alongside the HTML (the human-readable companion, ephemeral in the temp dir), write a machine-readable candidate list that survives the session. Default location: `${CLAUDE_PLUGIN_DATA}/deepening-candidates-<timestamp>.md`. If the consuming project maintains its own per-task work-artifact convention (e.g. a tracked slice/working directory documented in its `CLAUDE.md` or rules), honor that instead and write the file there. Tell the user the path. This file — not the HTML — is the durable handoff a planning step consumes. One entry per candidate: |
There was a problem hiding this comment.
Keep candidate artifacts scoped to the project
When this plugin is used in more than one repository, this default writes every repo’s architecture candidate list into the same plugin-level data directory; the Claude Code reference says ${CLAUDE_PLUGIN_DATA} resolves to ~/.claude/plugins/data/{id}/, so it is keyed by plugin rather than by project (https://code.claude.com/docs/en/plugins-reference#environment-variables). These artifacts contain repo paths and design notes, so a later planning handoff or cleanup in another project can see or stale-use unrelated candidates; put them under a ${CLAUDE_PROJECT_DIR}-derived slug, or require a project-local convention before writing.
Useful? React with 👍 / 👎.
## What
A new `comment-residue` skill in the **code-tidying** plugin: a
read-only classifier that flags **out-of-context residue** in code
comments and presents Tier 1/2 findings for author-applied deletion.
Mirrors `declutter`'s architecture (`detect.sh` + sourceable shape
library + self-contained `detect.test.sh`), but scans code files and
detects only on the **comment portion** of a line.
**Residue shapes:** `history-narration` ("used to… now…"),
`plan-reference` ("Task 2 replaces the old…", "in this PR"),
`conversational-antecedent` ("per your request") — all Tier 1;
`ticket-pr-residue` ("see PR #45", "JIRA-123") — Tier 2. `TODO(#issue)`
is the sanctioned back-reference and is never flagged.
Bumps code-tidying `0.2.0 → 0.3.0`; documents the skill in the manifest
+ README catalog.
## Why
Agents leak the producing conversation/plan/history into comments — text
that only makes sense inside the chat thread that wrote it. No existing
skill targets this: `declutter` is markdown-only, `compress` excludes
code comments, and `tidy`'s Beck-#15 handles generic restatement, not
the out-of-context residue class. This is the clean-up-afterward
companion to the source-side comment rule (a separate dotfiles-repo
change).
## Design notes
- **Comment-scoped detection** — residue-shaped words in identifiers or
string literals (`previously = load_cache()`, `# encode as UTF-8 /
SHA-256`) are **not** flagged; only the comment text is classified. This
keeps false positives low; anything uncertain lands in Tier 2 (review),
and the skill is read-only so the author confirms every deletion.
- **Placement** — filed under `code-tidying` (subject = code) per the
plan. It's a read-only *classifier* like `declutter` (which lives in
`docs-hygiene`), so a mode-based argument for `docs-hygiene` exists;
flagging for reviewer preference.
## Security review (plugin-acceptance)
Touches **only surface 1** — a read-only, advisory `detect.sh` (spawns
git/find/awk, never mutates, no network, no MCP server, no
`userConfig`/secrets, reads only files under the invoking repo via
`${CLAUDE_PLUGIN_ROOT}` / `git rev-parse`). No surface 2/5/6 trust
decision required.
## Test plan
- [x] `detect.test.sh` — 19/19 (shapes, tiers, opt-out, markdown-skip,
dir + paths-file, and the false-positive guards: code identifier,
`UTF-8`/`SHA-256`, sanctioned `TODO(#123)`)
- [x] shellcheck clean
- [x] shfmt clean (editorconfig-aware)
- [x] markdownlint-cli2 clean (repo config)
- [x] `claude plugin validate --strict .` passed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Read-only local bash/git scanning with no mutations, secrets, or
network; CI change is a targeted hygiene exclude for test/detector
content.
>
> **Overview**
> Adds **`/code-tidying:comment-residue`**, a read-only skill that
audits **code** comments for four residue shapes (history narration,
plan/session refs, conversational antecedents, ticket/PR back-refs) and
reports **Tier 1/2** findings with treatment guidance—authors apply
deletions; no edits from the skill.
>
> Implementation follows the `declutter`-style split: **`detect.sh`**
(targets, git default, deterministic output),
**`lib/comment-shapes.sh`** (comment-only extraction with string-aware
leaders, shape regexes, sanctioned `TODO(#issue)`,
`comment-residue-ignore`), plus **`detect.test.sh`**, eval fixtures, and
**`evals.json`**. **code-tidying** bumps to **0.3.0**; README and
manifest copy describe comment hygiene alongside `tidy` /
`batch-simplify`.
>
> CI **comment-hygiene** now **excludes** `comment-residue` **scripts**
and **evals** so intentional TODO/PR-shaped test corpus and detector
patterns do not trip the repo ban policy.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
43f7bfa. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>


Migrates the improve skill into a repo-agnostic plugin (named improve-architecture — bare improve was ambiguous). Ousterhout-method architecture-improvement scanning; one skill with an internal deepening lens (progressive disclosure for future lenses). Self-contained HTML report (no remote fetch; inline SVG only). No userConfig. Clean-tier wave Phase 2.
Note
Low Risk
Adds documentation, skill playbooks, and catalog entries only; no executable hooks or changes to existing plugin behavior.
Overview
Adds
improve-architectureto the marketplace and root catalog as a read-only skill that proactively scans existing code for module-level friction (default deepening lens: shallow modules, seam leaks, locality).The skill is wired as explore → HTML report → interview → planning handoff:
SKILL.mdroutes empty args todeepening, loadsactions/deepening.mdplus progressiveresearch/deepening/*, and documents how future lenses extend via newactions/+research/without changing existing contracts. Phase 2 mandates a self-contained temp HTML report (inline CSS/SVG, HTML-escape repo-derived text, no remote assets) and a durable candidate markdown artifact (default${CLAUDE_PLUGIN_DATA}, or the consumer’s work-artifact path). Phase 3 recordsagreed-shapefor downstream planning and optional glossary/ADR side effects.Ships plugin manifest, README, and
evals/evals.jsonexpectations for routing, shallow-cluster classification, and not over-flagging already-deep modules. NouserConfigand no changes to existing plugins’ runtime behavior.Reviewed by Cursor Bugbot for commit 10903a5. Bugbot is set up for automated code reviews on this repo. Configure here.