Skip to content

feat: rule tree refactor, anti-slop blocks, framework content, regist… - #19

Open
joxyle-jhon wants to merge 1 commit into
mainfrom
feat/rule-tree-refactor
Open

feat: rule tree refactor, anti-slop blocks, framework content, regist…#19
joxyle-jhon wants to merge 1 commit into
mainfrom
feat/rule-tree-refactor

Conversation

@joxyle-jhon

Copy link
Copy Markdown
Owner

…ry fix

  • core/types.ts: add RuleBlock, BlockInclusion, ResolvedBlock, ResolvedRuleTree
  • core/resolver.ts: 4-step pipeline — expand ancestors, deduplicate by canonical key (pack priority), build parent-child tree, topological sort
  • core/registry.ts: add getAllBlocks() + readBlock(block); fix double-blocks/ path bug that caused all block reads to return empty string
  • core/generator.ts: wire resolver pipeline; composeBlocks takes ResolvedRuleTree
  • cli/src/types.ts, resolver.ts, registry.ts, generator.ts: mirror all above changes for the Node.js CLI context

Pack configs — migrate string[] blocks to typed RuleBlock[]:

  • packs/frontend/pack.config.ts: all blocks typed with id/tags/inclusion
  • packs/backend/pack.config.ts: all blocks typed
  • packs/fullstack/pack.config.ts: full union of frontend+backend blocks via canonical cross-pack id references (no content duplication); all 11 framework options; all optional blocks from both packs

Framework content — replace stub bullet lists with real rule content:

  • packs/frontend/blocks/frameworks/nextjs.md: folder structure, RSC vs CC, Server Actions, data fetching, caching, Route Handlers
  • packs/frontend/blocks/frameworks/nuxt.md: useFetch/useAsyncData, Nitro routes, useState vs Pinia, NuxtImg/NuxtLink, middleware
  • packs/frontend/blocks/frameworks/sveltekit.md: server vs universal load, form actions + use:enhance, Svelte 5 runes, hooks, route protection
  • packs/frontend/blocks/frameworks/angular.md: standalone components, OnPush, signals, RxJS bridge, lazy routes, @defer, NgOptimizedImage
  • packs/frontend/blocks/frameworks/vanilla.md: new file — DOM helpers, class component pattern, store, event delegation, Web Components

New blocks:

  • packs/frontend/blocks/anti-slop.md: what slop looks like, mandatory checks, spacing/typography/color/component discipline
  • packs/frontend/blocks/anti-slop-tooling.md: child of anti-slop — GSAP, Motion.dev, Rive, Lenis, shadcn/ui, Radix UI, Magic UI, Aceternity, Smooth UI, Raylight, Unlumen, Tasteskill.dev, Three.js/R3F; each entry has problem/when-to-reach/when-to-skip/minimal-usage/do-not structure
  • cli/src/resolver.ts: new file (mirrors core/resolver.ts, Node-compatible)

UI fix:

  • src/components/Generator.tsx: fix optional blocks panel — was reading deprecated pack.optionalBlocks (always undefined); now reads pack.blocks.filter(b => b.inclusion === 'optional') correctly

AGY skill structure:

  • .agent/skills/frontend-rules/SKILL.md: moved to AGY-compliant path with required YAML frontmatter

Tests:

  • cli/tests/cli.test.ts: 10 new regression tests — Jaccard similarity checks (flags if two framework outputs share >75% word tokens) + keyword presence tests per framework

…ry fix

- core/types.ts: add RuleBlock, BlockInclusion, ResolvedBlock, ResolvedRuleTree
- core/resolver.ts: 4-step pipeline — expand ancestors, deduplicate by canonical
  key (pack priority), build parent-child tree, topological sort
- core/registry.ts: add getAllBlocks() + readBlock(block); fix double-blocks/
  path bug that caused all block reads to return empty string
- core/generator.ts: wire resolver pipeline; composeBlocks takes ResolvedRuleTree
- cli/src/types.ts, resolver.ts, registry.ts, generator.ts: mirror all above
  changes for the Node.js CLI context

Pack configs — migrate string[] blocks to typed RuleBlock[]:
- packs/frontend/pack.config.ts: all blocks typed with id/tags/inclusion
- packs/backend/pack.config.ts: all blocks typed
- packs/fullstack/pack.config.ts: full union of frontend+backend blocks via
  canonical cross-pack id references (no content duplication); all 11 framework
  options; all optional blocks from both packs

Framework content — replace stub bullet lists with real rule content:
- packs/frontend/blocks/frameworks/nextjs.md: folder structure, RSC vs CC,
  Server Actions, data fetching, caching, Route Handlers
- packs/frontend/blocks/frameworks/nuxt.md: useFetch/useAsyncData, Nitro
  routes, useState vs Pinia, NuxtImg/NuxtLink, middleware
- packs/frontend/blocks/frameworks/sveltekit.md: server vs universal load,
  form actions + use:enhance, Svelte 5 runes, hooks, route protection
- packs/frontend/blocks/frameworks/angular.md: standalone components, OnPush,
  signals, RxJS bridge, lazy routes, @defer, NgOptimizedImage
- packs/frontend/blocks/frameworks/vanilla.md: new file — DOM helpers, class
  component pattern, store, event delegation, Web Components

New blocks:
- packs/frontend/blocks/anti-slop.md: what slop looks like, mandatory checks,
  spacing/typography/color/component discipline
- packs/frontend/blocks/anti-slop-tooling.md: child of anti-slop — GSAP,
  Motion.dev, Rive, Lenis, shadcn/ui, Radix UI, Magic UI, Aceternity,
  Smooth UI, Raylight, Unlumen, Tasteskill.dev, Three.js/R3F; each entry
  has problem/when-to-reach/when-to-skip/minimal-usage/do-not structure
- cli/src/resolver.ts: new file (mirrors core/resolver.ts, Node-compatible)

UI fix:
- src/components/Generator.tsx: fix optional blocks panel — was reading
  deprecated pack.optionalBlocks (always undefined); now reads
  pack.blocks.filter(b => b.inclusion === 'optional') correctly

AGY skill structure:
- .agent/skills/frontend-rules/SKILL.md: moved to AGY-compliant path with
  required YAML frontmatter

Tests:
- cli/tests/cli.test.ts: 10 new regression tests — Jaccard similarity checks
  (flags if two framework outputs share >75% word tokens) + keyword presence
  tests per framework
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant