惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
The GitHub Blog
The GitHub Blog
月光博客
月光博客
T
Tailwind CSS Blog
小众软件
小众软件
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
B
Blog RSS Feed
博客园 - 司徒正美
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 聂微东
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
博客园 - Franky
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
T
The Blog of Author Tim Ferriss
GbyAI
GbyAI
Apple Machine Learning Research
Apple Machine Learning Research

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders
Event sourcing with a little help from AI
speckx · 2026-05-05 · via Hacker News - Newest: "AI"

A while back I published a Laravel package to generate event-sourcing domains using Spatie’s library. You describe your model, run one artisan command, and get aggregates, events, projectors and all the accompanying boilerplate. It crossed 8,000 downloads on Packagist, which was a nice surprise.

The package works well for straightforward cases. Feed it a migration, get a domain. But event sourcing stops being straightforward pretty quickly. Real domains have invariants, side effects, read models, and decisions that a CLI flag can’t capture. The generator could scaffold the files; it couldn’t help you think through the design.

That’s the gap I wanted to close with the new version.

👉 claude-laravel-event-sourcing on GitHub

What it is

This isn’t a Composer package — it’s a Claude Code skill. You install it into your project’s .claude/skills/ directory and trigger it from Claude Code. Instead of wrapping an artisan command in AI, I redesigned the whole workflow around a conversation.

The skill works in two gates.

Gate 1 — Design. Claude asks you five focused questions about your domain: what the feature does, what state transitions are involved, what triggers commands, whether you need read models, and what side effects matter. From your answers it produces an Architecture Decision Record — a short document listing the aggregates, commands, events, projectors, and reactors it plans to build, plus anything explicitly out of scope. It then stops and waits. Nothing gets generated until you say you’re happy with the design.

Gate 2 — Implementation. Once you approve the ADR, Claude generates the full domain in a deliberate order: directory structure, then tests first (TDD), then commands and handlers, then the aggregate root, then events, projectors with migrations, reactors, and finally registration in the config. It runs the tests and reports the result.

If it hits an ambiguity during implementation that the ADR didn’t cover, it pauses and asks rather than making a silent assumption.

Why this matters

The artisan-based generator was useful precisely because it was mechanical. It did exactly what you told it. But the hard part of event sourcing isn’t writing the aggregate class — it’s deciding what the aggregate is, which events cross a boundary, and where a projector ends and a reactor begins.

The new skill treats those decisions as a conversation rather than a parameter. You still make the calls; Claude just makes sure you’ve made them before writing the code.

It’s also strict about scope. It won’t help you refactor an existing CRUD app into event sourcing, and it won’t work with anything other than spatie/laravel-event-sourcing v7. Keeping it narrow keeps the output reliable.

Installation

mkdir -p .claude/skills
git clone https://github.com/albertoarena/claude-laravel-event-sourcing.git /tmp/claude-les
cp -r /tmp/claude-les/skill/laravel-spatie-event-sourcing .claude/skills/
rm -rf /tmp/claude-les

For a global install available across all your projects:

cd ~/.claude/skills
git clone https://github.com/albertoarena/claude-laravel-event-sourcing.git

Requirements: Laravel 10+, PHP 8.2+, Spatie event sourcing v7, and Pest or PHPUnit.

A verification script checks your setup before the first run, so you won’t get halfway through a generation and discover a missing migration.

What gets generated

After approval, the skill produces a complete domain under app/Domain/<Context>/:

app/Domain/<Context>/
├── Aggregates/
├── Commands/
├── CommandHandlers/
├── Events/
├── Projectors/
├── Reactors/
└── ReadModels/

tests/Feature/<Context>/
database/migrations/

Everything compiles, the tests run green, and the domain is registered in your config. The original generator gave you a skeleton to fill in. This gives you something closer to a working first draft.

Closing thought

I’m still a fan of the artisan command for simple cases — it’s fast and predictable. But if you’re starting a new domain and you’re not completely sure where the boundaries sit, having a design conversation before the code appears is worth the extra five minutes.

The skill is at v0.1.0. If you try it and run into gaps, issues are open on GitHub.

Alberto Arena

Alberto Arena

Senior Software Engineer