11 Commits
Author SHA1 Message Date
Giancarmine SalucciandClaude Opus 4.8 cba4f44f45 feat(F5): frontend component-extraction detector (dumb/smart)
New Pass B detector (report-only). F5a: ast-grep extracts JSX/template elements and
SKELETON-CLUSTERS repeated markup (cpd misses renamed markup) → judge → "extract <Name>
(dumb/smart), props {…}, used in N places". F5b: god component → smart/dumb split.
Classifies dumb vs smart by counting state/effect/store/fetch signals (per-framework).

Framework-agnostic: JSX/TSX native in ast-grep; Vue/Svelte/Angular via opt-in grammars
(sgconfig.frontend.yml; Vue grammar build documented, Svelte already shipped, Angular beta);
LLM-judge fallback classifies without a grammar. Validated: card found ×3 across React
fixtures (cpd found 0), Vue template parsed, 33 repeated-markup clusters on the real
software-house Svelte dashboard.

Adds references/COMPONENTS.md, sgconfig.frontend.yml, fixtures/frontend/{react,vue},
SKILL.md F5 wiring, ANTIPATTERNS rows, ledger kind:"component" + props/component_kind.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 03:08:44 +02:00
Giancarmine SalucciandClaude Opus 4.8 81b33fff26 refactor: report-only skill — actionable findings, no apply/modes
The skill no longer modifies code. It emits exactly two artifacts under simplify/:
findings.json (machine-actionable ledger) + a ranked report. Every finding now REQUIRES
title/action/verify (locked in ledger.schema.json) so each is independently executable by
the calling agent. Removed: apply/report modes, Track A autofix execution, baseline gate,
verify-each-change loop, the include-tests switch (tests excluded by default). Reframed
SKILL.md, README, PATTERNS (deterministic/judgment), DETECTION, OPTIMIZATION (judge-only
model tiering), PORTABILITY, SVELTE, CONSOLIDATION accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 02:53:19 +02:00
Giancarmine SalucciandClaude Opus 4.8 fc7f825268 build: bundle cpd/scc/biome/ruff for all 5 platforms via Git LFS
Completes the self-contained, offline-from-clone engine set (ast-grep + cpd + scc +
biome + ruff) across linux x64/arm64, darwin x64/arm64, win32 x64. checksums.txt now
covers all 25 tool×platform binaries; manifest + first-run fetch kept ready in case we
switch to fetch-on-demand later.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 02:35:44 +02:00
Giancarmine SalucciandClaude Opus 4.8 4b80117933 feat: Pass B — consolidation & AI anti-pattern analysis (report-only)
Adds the cross-file analysis pass on top of v1's per-node simplification:
- F1 consolidation: duplicate enums/labels (ast-grep+LLM cluster), near-duplicate
  functions (cpd exact + ast-grep skeleton for renamed), untyped repeated DTOs.
- F2 reinventing-the-wheel: ast-grep signature index + judge.
- F3 lint enrichment: bundled Biome (JS/TS) + ruff (Python), read-only, mapped to ledger
  (defer to linters, don't reimplement).
- F4 metrics: scc + ast-grep-derived; flags god/long functions.

Engines bundled as standalone single binaries (manifest + checksums + LFS): ast-grep,
cpd, scc, biome, ruff. Qlty REJECTED at the non-intrusiveness gate (requires `qlty init`
writing .qlty/ into the target) → contingency cpd+scc. Pass B is report-only with a
mandatory model judge + AHA guardrails (validated on software-house: 5 enum clusters incl.
a latent bug, 7 near-dup fn clusters, biome 148 diags, scc flags dispatch.ts cx=698).

Docs: references/CONSOLIDATION.md, references/ANTIPATTERNS.md, docs/PLAN-v2-antipatterns.md;
SKILL.md Pass B section; ledger schema consolidation kind. linux-x64 binaries bundled;
other platforms via manifest fetch+verify.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 02:29:40 +02:00
Giancarmine SalucciandClaude Opus 4.8 c14d8bf411 feat(scope): exclude test files by default, add include-tests switch
Test files carry intentional literals/structure, so they were the dominant
remaining magic-number noise source on real projects. Step 1 now filters common
test globs (per-language) from the candidate set by default; the user can opt in
with "include tests / --include-tests". Recorded in ledger config.include_tests.
On software-house: 73/283 TS files are tests; findings 235 -> 180 by default.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 01:38:03 +02:00
Giancarmine SalucciandClaude Opus 4.8 8324dde1a2 fix(rules): make magic-number detection far less noisy
Real-world test on a 321-file TS/Svelte monorepo flagged 454 magic-number
findings, ~82% of them noise: literals already assigned to a named const/field
and numbers merely buried under a binary expression (e.g. a call arg inside a
string concat). Tighten all 5 languages to: (1) require the literal be a DIRECT
operand of a binary/comparison expression, and (2) exclude initializers of a
named binding (const/var/let/field). Cuts magic-number ~67% with no loss on
fixtures (each language still detects its genuine `x > 5000` case).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 01:32:33 +02:00
Giancarmine SalucciandClaude Opus 4.8 6fb2210bbe docs: align PATTERNS.md catalog keys with manifest pattern values
Multi-agent review found the ledger's suggested_pattern keys could miss the
catalog: add svelte-snippets/svelte-diagnostic sections, declare the Python
identity-compare/membership/truthiness keys explicitly, and note that
extract-method/remove-dead-code are detector-less (no manifest entry).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 01:22:05 +02:00
Giancarmine SalucciandClaude Opus 4.8 6c3997eb13 docs(svelte): fix stale rules/svelte path -> rules-svelte/
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 01:17:03 +02:00
Giancarmine SalucciandClaude Opus 4.8 54be304485 build: bundle ast-grep engine for all 5 platforms via Git LFS
Fresh clones are now fully self-contained / offline (no first-run fetch needed).
Binaries (linux x64/arm64, darwin x64/arm64, win32 x64) tracked via LFS; verified
against bin/checksums.txt. First-run release fetch kept as a no-lfs fallback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 01:14:58 +02:00
Giancarmine SalucciandClaude Opus 4.8 b293afe7cf feat(svelte): validated opt-in grammar path + all-platform engine checksums
- Build tree-sitter-svelte in one cc command (prebuilt parser.c, no tree-sitter CLI).
- sgconfig.svelte.yml: registers .svelte + injects JS/TS into <script> blocks so the
  existing TS/JS rule packs apply there; rules-svelte/ adds template rules (on:, slot).
  Proven on fixtures/svelte/Messy.svelte; default sgconfig.yml unaffected.
- Record sha256 for all 5 platform ast-grep binaries so first-run fetch is verifiable
  everywhere (binaries stay gitignored — no repo bloat).
- Retire non-working svelte .example stubs; runes migration stays model-driven.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 01:02:11 +02:00
Giancarmine SalucciandClaude Opus 4.8 3f6f642f6b feat: portable cross-runtime code-simplification skill
ast-grep-driven detection + ranking into a JSON ledger, two-track apply
(deterministic autofix + model span-edits), configurable report/apply modes.
Rule packs for JS/TS, Python, Go, Rust, Java; Svelte/SvelteKit support via
project tooling + opt-in grammar. Runtime-neutral SKILL.md (Agent Skills spec).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 00:54:40 +02:00