Nov 105 min read
# I Let Factory's
I Let Factory's Droid Build My Portfolio's Writing Page. Here's the Exact Workflow.
I've always wanted a better way to publish writing on my portfolio.
The old workflow was simple, but not in a good way. Every time I wanted to publish something, I had to open a component, duplicate a card, update the title and link, and make sure nothing else broke.
It worked, but it wasn't a workflow I wanted to keep using.
I wanted something more natural: write an article in Markdown, put it in a folder, and let the portfolio handle the rest.
A /writing page that automatically lists articles, sorts them by date, and gives every post its own readable page.
So I decided to build it with Factory's Droid CLI.
Here's how I approached it, from setting up the project instructions to reviewing the implementation and getting it ready for deployment.
1. Setting up Droid
I started by installing Factory's Droid CLI and opening it inside my portfolio project.
curl -fsSL https://app.factory.ai/cli | sh
cd my-portfolio
droid
On Windows, the installation command is:
irm https://app.factory.ai/cli/windows | iex
Once Droid was running, I wanted to make sure it understood the project before asking it to change anything.
2. Giving Droid context with AGENTS.md
One thing I've learned from working with coding agents is that the quality of the instructions matters.
Instead of explaining my conventions every time, I created an AGENTS.md file at the root of the repository.
It included the project structure, development commands, coding conventions, and boundaries for what Droid should and shouldn't change.
For example:
# Project Guidelines
## Build & Check
- Dev: npm run dev
- Build: npm run build
- Lint: npm run lint
## Conventions
- Use TypeScript strict mode.
- Avoid `any`.
- Prefer server components.
- Use Tailwind for styling.
- Keep content inside /content.
- Follow the existing design system.
## Don't
- Don't add dependencies without explaining why.
- Don't modify unrelated pages.
- Don't redesign existing components unless requested.
This gave Droid a shared understanding of how I wanted the project to work.
More importantly, it helped keep the scope focused.
3. Planning before implementation with Spec Mode
Before letting Droid write code, I switched to Specification Mode using Shift + Tab.
I wanted it to inspect the existing portfolio, understand the structure, and propose an implementation before making changes.
This was the prompt I used:
Add a Writing section to my portfolio. Articles should be Markdown files stored in
/content/postswith frontmatter containing title, date, summary, and tags.Build a
/writingindex page that lists all posts, sorted newest first, and a/writing/[slug]page that renders individual articles.Statically generate the article pages at build time. Follow the existing design system, typography, spacing, and responsive behavior. Prefer server components and keep content loading separate from UI components.
Inspect the existing project before proposing changes. Explain any new dependencies and provide acceptance criteria.
Droid explored the existing codebase and returned a specification covering the files it planned to create or modify, the dependencies, and the implementation approach.
I reviewed the plan before approving it.
That's one of the parts I find most useful about Spec Mode: I could catch architectural decisions before they became code.
4. Building the Markdown-powered writing system
After reviewing the specification, I approved the implementation.
The idea was to separate content from presentation.
Instead of adding every article manually to a React component, each article would live in its own Markdown file.
For example:
content/
posts/
building-with-ai.md
community-in-ethiopia.md
my-developer-journey.md
Each file could contain frontmatter:
---
title: "Building with AI"
date: "2026-11-12"
summary: "What I learned building with AI tools."
tags:
- AI
- Development
---
# Building with AI
Your article content goes here.
Droid implemented a content loader to read these files and extract their metadata.
Here's the core idea:
// lib/posts.ts
import fs from "fs";
import path from "path";
import matter from "gray-matter";
const POSTS_DIR = path.join(
process.cwd(),
"content/posts"
);
export type PostMeta = {
slug: string;
title: string;
date: string;
summary: string;
tags: string[];
};
export function getAllPosts(): PostMeta[] {
return fs
.readdirSync(POSTS_DIR)
.filter((file) => file.endsWith(".md"))
.map((file) => {
const { data } = matter(
fs.readFileSync(
path.join(POSTS_DIR, file),
"utf8"
)
);
return {
slug: file.replace(/\.md$/, ""),
title: data.title,
date: data.date,
summary: data.summary,
tags: data.tags ?? [],
};
})
.sort((a, b) =>
a.date < b.date ? 1 : -1
);
}
For individual articles, Next.js uses dynamic routes.
The generateStaticParams function tells Next.js which article pages to generate during the build:
// app/writing/[slug]/page.tsx
export function generateStaticParams() {
return getAllPosts().map((post) => ({
slug: post.slug,
}));
}
This means publishing a new article doesn't require manually creating another page.
Add a Markdown file, rebuild the project, and the new article can become part of the writing section.
5. Reviewing the implementation
I didn't want to treat generated code as finished code.
I reviewed the changes against the original requirements:
- Does the writing index show the newest articles first?
- Does every article have its own URL?
- Does the layout follow the existing portfolio design?
- Are the pages generated correctly?
- Does the project build successfully?
- Can I publish another article without editing a component?
The important part was checking the entire workflow, not just whether the page looked good in the browser.
6. The result: a simpler publishing workflow
The goal wasn't to build a complicated content management system.
It was to remove unnecessary work from something I do regularly.
Now the intended publishing workflow is:
- Create a new Markdown file.
- Add its title, date, summary, and tags.
- Write the article.
- Run the build and deploy.
No duplicating cards. No manually updating article links. No touching the writing page every time I publish.
What I learned
A few things stood out from this experiment.
Give the agent context before giving it tasks. AGENTS.md helped establish project conventions and boundaries before implementation started.
Plan before writing code. Spec Mode made it easier to review the architecture and scope before approving changes.
Review the output, not just the demo. A page rendering successfully doesn't mean the implementation is maintainable. I still needed to check the routes, content structure, styling, and build.
Automate the repetitive parts. The best outcome wasn't simply getting an AI agent to write code. It was making future publishing easier.
Try it yourself
If you're using Next.js for your portfolio, you can experiment with the same approach:
- Install Factory's Droid CLI.
- Create an AGENTS.md file with your project conventions.
- Switch to Spec Mode.
- Describe the Markdown-powered writing system you want.
- Review the specification before approving implementation.
- Test the result and deploy.
The interesting thing about coding agents isn't just how quickly they can generate code. It's how they can help you rethink the way you build and maintain your projects.
And sometimes, the most useful thing you can build is a workflow that makes the next thing easier.
