Creating a Serverless System: Streamline Your Workflow

Creating a Serverless System: Streamline Your Workflow

• By Rich Martinez

​This week, I didn't just refactor my code. I refactored my entire workflow.

I started with a standard Astro static site. It was fast, but publishing was a pain. Every typo fix required a full build and deploy.

I ended up with a “Zero-Touch" Serverless System where content publishes instantly, and an AI Agent handles my documentation automatically.

Here is the complete story of how I got there.

Part 1: The "Zero-Touch" Publishing System

The Problem: The Build Bottleneck
Static Site Generation (SSG) is great for performance, but terrible for agility. Content is locked in the code. To change content, you have to rebuild the code.

The Solution: Server-Side Rendering (SSR) + Cloudflare R2
I flipped the model. Instead of baking content *into* the site, I made the site a "viewer" for content stored externally.

1. StoryChief sends a webhook when I publish.
2. Cloudflare Worker catches it and saves the post to R2 Storage (cheaper S3).
3. Astro (SSR) fetches that content at runtime when you visit the page.

The Result: I hit publish, and it's live. No builds. No waiting.

Part 2: The "Zero-Touch" Documentation System


The Problem: The Documentation Gap
After building this cool system, I realized I had to document it. I dreaded updating the `CHANGELOG.md` and writing the wiki. It's the "vegetables" of coding—good for you, but not fun.

The Solution: Agentic Workflows
I asked myself: If my AI assistant knows exactly what we just built, why am I explaining it to the changelog?

I created a workflow file at `.agent/workflows/wrap.md`. It's a set of instructions for my AI agent:

```markdown
# Wrap Up Workflow
1. Analyze git diffs.
2. Update CHANGELOG.md.
3. Sync documentation files.
4. Draft a blog post.
```

Now, when I finish coding, I just type:
> /wrap

And the agent does the rest. It wrote the changelog entry for this update. It updated the architecture diagrams. It even wrote the first draft of *this* blog post.

Key Takeaways

1. Separate Content from Code: If you're rebuilding your site to fix a typo, you're doing it wrong. Use SSR and external storage.
2. Automate the Boring Stuff: Don't just use AI to write code. Use it to maintain the *legacy* of that code (docs, logs, summaries).
3. Treat Documentation as Code: Structure your docs so an agent can easily read and update them.

This journey proved that "Serverless" isn't just about infrastructure—it's about removing friction. Friction in publishing, and friction in documenting.