RFC: AI-powered features across ArtisanPack UI — artisanpack-ui/ai foundation and package-by-package roadmap #8
ViewFromTheBox
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context
With most of the heavy lifting now behind us across the ecosystem, I want to start a serious conversation about how we bring AI capabilities into ArtisanPack UI in a way that's coherent, opt-in, and respects developer autonomy.
This isn't about bolting on AI features for the sake of it. It's about identifying the places where AI genuinely accelerates what our packages already do well — and building a shared foundation so every package can offer those capabilities without each one reinventing the wheel.
I'm opening this as a discussion rather than an issue because I want input on the architecture, the scope, and the prioritization before we start implementing.
Strategic framing
A few principles I want us to anchor on before getting into specifics:
Proposed architecture:
artisanpack-ui/aiI'm proposing we add a new foundational package,
artisanpack-ui/ai, that sits alongsidecoreandhooksas a shared layer. Other packages depend on it optionally and check for its presence at boot.What this package owns:
cms-frameworkSettings module (CMS end-user use case), with the latter taking precedence when both are present.Laravel\Ai\Agentthat adds usage logging, caching hooks, and the feature-toggle check. Every AI feature in every package extends this.cms-frameworkadmin surface.What it deliberately does NOT own:
The package should end up being relatively small — probably 1500–2500 lines. Most of the value is in the integration pattern, not in the code volume.
The Agent pattern
Every AI capability in every package ships as a concrete Agent class extending our base. Here's roughly what it looks like:
Then in user code:
Why this pattern works for us:
BYOK configuration — two modes
Mode 1: Static (env-based) for developers building custom Laravel apps
ARTISANPACK_AI_PROVIDER=anthropic ARTISANPACK_AI_API_KEY=sk-ant-... ARTISANPACK_AI_DEFAULT_MODEL=claude-haiku-4-5 # Optional per-feature overrides ARTISANPACK_AI_SEO_MODEL=claude-haiku-4-5 ARTISANPACK_AI_ANALYTICS_MODEL=claude-opus-4-7Mode 2: Dynamic (database-based) for CMS end-users
When
cms-frameworkis installed, we expose an "AI Settings" admin page:Crypt, never displayed back as plaintext)Resolution priority: explicit runtime override → database settings → env vars → null (feature disabled).
Per-package AI opportunities
Below is a first pass at what each candidate package gets. This is meant to start the conversation — I expect we'll add and cut features here.
🟢 SEO
The clearest AI fit in the ecosystem. Agents I'd propose:
MetaTitleSuggestionAgent— generates SEO-optimized title variants for a given pageMetaDescriptionAgent— example aboveContentAnalysisAgent— analyzes content for keyword density, readability, semantic completeness, and returns a structured quality score with specific recommendationsSchemaGenerationAgent— given page content, suggests appropriate JSON-LD schema type and generates a starting structureHreflangSuggestionAgent— for multi-language sites, suggests where hreflang relationships are missing or inconsistentThe existing content analysis scoring in the SEO package becomes vastly more useful when paired with AI that can suggest how to fix issues, not just flag them.
🟢 Analytics
The dashboard package gets a lot more interesting with AI summarization:
InsightSummaryAgent— given a date range of analytics data, generates a plain-language summary of what's working, what's changed, and what's worth investigatingAnomalyExplanationAgent— when traffic spikes or drops, generates a hypothesis about what might have caused it (correlation with content changes, referrer changes, etc.)SegmentInsightAgent— analyzes a specific segment (referrer, page, time period) and surfaces non-obvious patternsThis is where I think AI delivers the most "I didn't know I needed this" value for non-technical CMS users.
🟢 Visual Editor
Since this is greenfield, we have the opportunity to design AI in from the start rather than retrofitting:
ContentBlockSuggestionAgent— "What block should come next?" based on what's been written so farLayoutSuggestionAgent— given a section's content, suggests appropriate layout patterns from the section libraryAltTextGenerationAgent— when an image is dropped into the editor, auto-suggests alt text (also useful for the Media Library, see below)ContentRewriteAgent— "make this shorter," "make this more formal," "rewrite for a 6th-grade reading level" — inline editor commandsHeadingHierarchyAgent— checks heading structure and suggests fixes (also feeds into Accessibility)Important constraint: AI suggestions in the visual editor should always be suggestions, never automatic mutations. The user accepts or rejects.
🟢 CMS Framework
The framework itself gains content authoring helpers that downstream packages can opt into:
PostTitleSuggestionAgent— generate title variants from draft contentExcerptGenerationAgent— generate excerpts from full contentTagSuggestionAgent— suggest tags from existing taxonomy based on contentCategorySuggestionAgent— same for categoriesSlugSuggestionAgent— generate SEO-friendly slugs from titlesThese also become useful API surface for
artisanpack-ui/visual-editorand any other content-creating package.🟢 Forms
A few high-value features here:
SpamDetectionAgent— analyzes form submissions and flags likely spam without relying solely on honeypots or rate limitingSubmissionSummaryAgent— for high-volume forms, generates a periodic summary of what people are submitting and any trendsResponseClassificationAgent— auto-categorizes incoming submissions (e.g., "support request," "sales inquiry," "feedback")SmartFieldValidationAgent— opt-in semantic validation ("does this address look real?") beyond regex🟢 Media Library
AltTextGenerationAgent— generates accessibility-friendly alt text from uploaded images (huge accessibility + SEO win)ImageTagSuggestionAgent— suggests tags for uploaded media for organizationImageDescriptionAgent— longer-form descriptions for image-heavy sites (galleries, portfolios)🟢 Accessibility
ContentAccessibilityAgent— analyzes content for accessibility issues beyond what static rules catch (ambiguous link text, vague headings, etc.)AriaSuggestionAgent— suggests appropriate ARIA attributes for custom componentsColorContrastExplanationAgent— explains why contrast fails and suggests specific fixes🟢 Security Analytics
ThreatTriageAgent— given a security event, generates a plain-language explanation of severity and recommended actionAnomalySummaryAgent— periodic digest of unusual security eventsIncidentResponseAgent— assists with response workflows by suggesting next steps based on event context🟡 Compliance / Privacy
These need more thought because of the regulatory implications, but candidates:
PrivacyPolicyDraftAgent— generates starter privacy policy text based on declared data processing activities (always with strong "have a lawyer review" disclaimers)DPIAAssistanceAgent— assists with Data Protection Impact Assessment draftingConsentTextSuggestionAgent— suggests clear, plain-language consent textThese are powerful but high-stakes. I'd want explicit human-review checkpoints baked into the UX.
🟡 Performance (in progress)
Once the package matures:
PerformanceInsightAgent— explains why a query is slow and suggests optimizationsOptimizationSuggestionAgent— looks at performance metrics and suggests where to focusPackages that probably DON'T need AI
To keep scope clear, I don't see AI value (right now) in:
Always open to being convinced otherwise.
Open questions for the community
Naming. Is
artisanpack-ui/aithe right name? Alternatives:intelligence,assist,ai-kit. I lean towardaifor clarity.Agent override pattern. What's the cleanest way for users to override agent prompts and behavior? Service container binding feels right, but should we also support a config-based override path for non-developer CMS users?
Streaming UX. For long outputs (content analysis, summaries), should we stream by default in the admin UI, or wait for completion? Streaming is better UX but adds complexity.
Caching strategy. SEO suggestions for the same content shouldn't hit the API twice. What's the right cache invalidation — content hash? Time-based? Both?
Cost guardrails in v1. I'm leaning toward NOT shipping spending caps in v1.0 to keep scope tight. Counter-arguments?
Ollama prioritization. Since laravel/ai ships Ollama support first-party, do we test against local models from launch and advertise local support, or treat it as a v1.1 polish?
Per-package vs cross-package agents. Some agents (alt text, content rewrite) could live in
aiitself rather than in individual packages, then be consumed everywhere. Where do we draw the line?Backward compatibility. This is the package that touches every other package. I want the v1.0 contract (Agent base class signature, feature registry, credential resolution) frozen hard. What am I likely to want to change in 6 months that I should design for now?
Rough sequencing
If we get alignment on the approach, here's how I'd sequence the work:
artisanpack-ui/aifoundation (1–2 weeks) — package skeleton, credential resolution, base Agent class, feature registry, basic admin Livewire components. No package integration yet.SEO end-to-end (1 week) — wire 2–3 agents into the SEO package as the validation case. Highest-value, lowest-risk.
Analytics agents (3–4 days) — insight summaries, anomaly explanations.
CMS Framework content agents (1 week) — title, excerpt, tag, slug suggestions usable from anywhere.
Media Library alt text (2–3 days) — the lowest-effort highest-impact feature in the entire ecosystem.
Forms (3–4 days) — spam detection and submission classification.
Visual Editor agents (parallel with editor build) — designed into the editor from the start.
Accessibility, Security Analytics, Compliance/Privacy — iteratively after the foundation proves out.
Tagging this for visibility
cc anyone interested in shaping AI strategy across the ecosystem.
I'd love feedback on:
Discussion is wide open. Nothing here is locked in.
Beta Was this translation helpful? Give feedback.
All reactions