Skip to content

feat: Ferrum AI — rule-based effect generation, style analysis - #12

Merged
Roy-Wanyoike merged 1 commit into
mainfrom
feat/ferrum-ai-scaffolding
Sep 1, 2026
Merged

feat: Ferrum AI — rule-based effect generation, style analysis#12
Roy-Wanyoike merged 1 commit into
mainfrom
feat/ferrum-ai-scaffolding

Conversation

@Roy-Wanyoike

Copy link
Copy Markdown
Owner

Summary

Implements the Ferrum AI foundation (Research → functional core). Fully rule-based — zero API calls, no external dependencies.

Modules

Module Description
effect-generator Prompt-to-effect matching with 60+ keywords, weighted scoring against 542 effects
style-analyzer WCAG 2.1 contrast checker, performance anti-pattern detection, improvement suggestions
prompt-templates 6 built-in templates (hero, dashboard, nav, form, loading, transitions)
description-generator 20 CSS feature detectors, markdown docs, CSS→category classification

Key Design

  • Rule-based — no LLM API needed, works offline
  • Weighted scoring: category (0.4) + CSS overlap (0.35) + name (0.25)
  • Suffix stripping for verb forms (bouncing→bounce)
  • WCAG 2.1 relative luminance contrast formula
  • 19 weighted rules for CSS→category classification

Tests

  • 74 unit tests covering all modules

Files Added

  • src/lib/ferrum-ai/ — 6 source files
  • __tests__/ferrum-ai.test.ts — 74 tests

Closes roadmap item: Ferrum AI Research → Alpha ✅

…ates

Implements the Ferrum AI scaffolding (Research → foundation):

Effect Generator (effect-generator.ts):
- Rule-based prompt-to-effect matching (60+ keywords)
- Weighted scoring: category (0.4) + CSS overlap (0.35) + name (0.25)
- Suffix stripping for verb forms (bouncing→bounce)
- Returns top 10 suggestions from 542 effects

Style Analyzer (style-analyzer.ts):
- WCAG 2.1 contrast checker (relative luminance formula)
- Performance anti-pattern detection (blur > 50px, backdrop-filter, etc.)
- Actionable improvement suggestions

Prompt Templates (prompt-templates.ts):
- 6 built-in templates (hero, dashboard, nav, form, loading, transitions)
- Template filling and task-to-template matching

Description Generator (description-generator.ts):
- 20 CSS feature detectors for human-readable descriptions
- Markdown documentation generation
- CSS→category classification (19 weighted rules)

74 unit tests covering all modules.
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ferrum-engine Error Error Aug 31, 2026 7:02pm

@Roy-Wanyoike
Roy-Wanyoike merged commit e06c615 into main Sep 1, 2026
5 of 9 checks passed
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