Files
simplify-code/sgconfig.yml
T
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

41 lines
2.0 KiB
YAML

# ast-grep project configuration for the simplify-code skill.
# Docs: https://ast-grep.github.io/reference/sgconfig.html
#
# `ast-grep scan -c <this file> --json <paths>` loads every rule under ruleDirs.
# Rules are grouped per language; each carries a `severity`, a detection `rule:`,
# and — for mechanical simplifications — a `fix:` (Track A autofix).
ruleDirs:
- rules
# ---------------------------------------------------------------------------
# OPT-IN: Svelte / SvelteKit structural rules on .svelte files.
#
# ast-grep has no built-in Svelte grammar. To run structural rules on .svelte
# files you must register tree-sitter-svelte as a custom language AND inject the
# JS/TS grammar into <script> blocks. This needs a compiled grammar library
# (.so/.dylib/.dll), so it is NOT bundled — it is opt-in. See references/SVELTE.md
# for the one-time build steps. Once built, uncomment the blocks below AND enable the
# template rules (mv rules/svelte/template.yml.example rules/svelte/template.yml); then
# the existing TypeScript/JavaScript rule packs automatically apply to the code inside
# <script> blocks via injection, and rules/svelte/ adds template-level rules.
#
# customLanguages:
# svelte:
# libraryPath: ./grammars/svelte.so # build per references/SVELTE.md
# extensions: [svelte]
# expandoChar: _ # $ -> _ so $state/$props parse cleanly
#
# languageInjections:
# - hostLanguage: svelte
# rule: { pattern: '<script lang="ts">$CONTENT</script>' }
# injected: typescript
# - hostLanguage: svelte
# rule: { pattern: "<script>$CONTENT</script>" }
# injected: javascript
# ---------------------------------------------------------------------------
#
# Without the grammar, Svelte is still supported: detection falls back to the
# project's own Svelte tooling (svelte-check, eslint-plugin-svelte, svelte
# compiler warnings) as enrichment, and semantic refactors go to the model with
# the SvelteKit guardrails in references/SVELTE.md.