
Three Spring Boot microservices, a Next.js frontend, four AI agents in tmux β and a prompt injection in a downloaded tooling file that one of the agents recognized and refused on its own. An honest account of building an Instagram auto-poster from scratch, including the bugs you never read about in success stories.
The paragraph that wasn't mine
I actually just wanted to try out a tool for multi-agent development. swarmforge, the four-pack branch of Uncle Bob's project, orchestrates four Claude Code instances in tmux: a specifier writes Gherkin acceptance criteria, a coder implements TDD-style, a refactorer cleans up, an architect verifies and merges. For the first service, the scheduler-service, I pulled the setup archive directly from the official repo via curl. Routine, nothing you think twice about.
Then the coder agent came back with a question I wasn't expecting. The file swarmforge/constitution.prompt contained an embedded block that looked like a genuine Claude Code system reminder β with an attribution manipulation and a request to fire off a SendUserFile call to a foreign session URL. In plain terms: an attempt to send data from my session to a place I didn't know.
The agent didn't execute it. It recognized it for what it was β a prompt injection hidden in a downloaded community file β and actively asked how to proceed. My answer: keep going, ignore the injected block, treat it as untrusted data, not as an instruction.
During the three following service setups, the block never showed up again. Presumably it was a one-off, local artifact and not a systematic attack on the repo. Still: I hadn't read the file before pulling it into the project. An open-source tool isn't proof of trustworthiness just because it carries a well-known name in the repo path.
Guardrails that actually hold
The agent recognized the injection itself, refused it, and asked for guidance β exactly the behavior you hope for from a safety net, but rarely see in action.
Why not just use Buffer
The starting question was simple: is there already an automated, AI-assisted Instagram workflow, or do I build one myself with the stack I use anyway? My tech stack at Zelkulon UG is Spring Boot, Java, Next.js, Kotlin, Railway and Netlify, plus a Claude Code multi-agent setup I'd already tried out on a client project (Printzone).
Buffer, Later, Metricool, Make.com or n8n would have solved the problem in an afternoon. I looked at them, and dismissed them. Not because the tools are bad, but because I wouldn't have learned anything from them that I could resell into client projects, and because I'd have tied an additional tool ecosystem to my leg that doesn't fit my existing stack.
That's the honest version of the decision: not an efficiency argument, but a bet on learning value. Whether the bet paid off comes at the end of this piece β spoiler: partially.
Three services, but no shared parent POM
The architecture consisted of three Spring Boot microservices: scheduler-service as the owner of post data with Postgres and later the orchestration logic, content-service as a stateless wrapper around the Claude API for caption generation, and publishing-service, also stateless, for the two-step flow of the Instagram Graph API.
The first real architecture question came before a single line of code existed: does this need a shared Maven multi-module parent POM? From a pure code-organization standpoint: sounds sensible, saves boilerplate. But the services live in three separate git repos and are deployed separately on Railway. A parent POM assumes physical proximity in the same build tree β a monorepo I didn't have.
So: each service gets its own standard POM with spring-boot-starter-parent, version parity maintained manually, shared DTOs deliberately duplicated instead of extracted into a shared library. YAGNI, quite deliberately. A shared library for three services that are deployed separately anyway is a coupling point I didn't want to take on.
Architecture follows deployment, not code
A decision like parent POM or not must not hinge on code organization β it has to match the actual deployment model, otherwise you build structure for a repo that doesn't even exist.
Four agents, one tmux window, one kickoff prompt
The workflow with SwarmForge ran the same way for every service: check swarmforge.conf (the backend was partly preset to codex instead of claude, I had to switch that), start ./swarm, four tmux sessions come up, kickoff prompt to the specifier with service scope, endpoints, and explicitly also what is NOT in scope. The specifier writes .feature files in Gherkin, which I review and approve or reject in the web dashboard.
After that, the coder implements TDD-style against the acceptance criteria, the refactorer cleans up and closes coverage gaps, the architect does the final verification and merges into main. For role isolation, each role runs in its own git worktree and its own branch β a clean idea that had a few friction points in practice.
Claude Code asks once per new working directory, Is this a project you trust? β with four worktrees, that's four times. The browser popup for this was sometimes unreliable, keyboard input didn't register. Attaching directly to the respective session via tmux was more reliable.
tmux -S /tmp/swarmforge-hdi10/<socket-id>.sock attach-session -t <rolle>
# Bei "sessions should be nested with care":
# switch-client statt attach-session verwendenA second friction point: SwarmForge tries to install its own mutation-testing tools for every new service type. For Java, that exists; for TypeScript, often not (no ready-made adapter for mutate4java or similar). My approach to that: don't try to solve it. Choose skip, mark it as a known gap, keep going with the available toolset. Perfectionism about tooling infrastructure is the surest way to turn an afternoon project into a week-long task.
A merge without conflicts that swallowed the implementation
With the publishing-service, the SwarmForge pipeline apparently ran all the way through β specifier, coder, refactorer, architect, all green. After the final merge of the architect branch into main, I looked at the working tree and found almost nothing. No controllers, no clients, no tests. Only Application.java was still there.
The diagnosis (via a separate Claude CLI session, because I was initially at a loss myself) revealed: the architect branch had branched off from an older base commit β before the specifier commits that contained the feature files. It had never seen the work of the coder and refactorer. The merge therefore went through without a single conflict, because from Git's perspective there was simply nothing contradictory. It didn't overwrite the implementation β it never knew about it.
The fix was unspectacular: git reset back to the state before the broken merge, then a clean merge with the right branch (swarmforge-refactorer). What stuck afterward is the lesson: after every SwarmForge run I now sanity-check with git log --oneline --all -20 and roughly count the expected files.
git log --oneline --all -20
find src/main -name "*.java" | wc -lGreen doesn't mean complete
A merge without conflicts is not proof that two branches were actually combined β it can just as well mean they never met.
All three traffic lights are green, and the cars still collide
This was the biggest and longest-lived bug in the whole project, and it had nothing to do with AI agents or merge strategies, but with the oldest disease of distributed systems: mismatched field names between sender and receiver. Each of the three services was tested in isolation and passed green. Combined, nothing worked.
The scheduler-service sent {"captionPrompt": "..."} to the content-service, which expected {"prompt": "..."} instead β result: 400 with prompt must not be empty. That was still the easy case, because the error was loud.
// scheduler-service schickte:
{ "captionPrompt": "..." }
// content-service erwartete:
{ "prompt": "..." }
// -> 400 Bad Request: prompt must not be emptyThe second case was trickier because it wasn't loud. The content-service returned {"caption": "...", "hashtags": [...]}, but the client in the scheduler-service deserialized onto a field called generatedCaption. The call came back with 200 OK, the field was simply null. No error, no exception, just an empty caption that caused confusion somewhere later in the flow.
Why this went undetected for so long: each service was tested individually against curl and dummy data β that checks whether a service is correct on its own, not whether two services share a compatible contract. The bug only became visible when the @Scheduled job in the scheduler-service actually wired all three services together for the first time. The fix each time was to grep the producer service for the actual DTO and adjust the consumer client β plus a strict test that checks the actually sent and received JSON body, not just the status code.
A whitespace character I'd copied to Railway myself
After CORS was configured across all three backend services β ALLOWED_ORIGIN as an env var, WebMvcConfigurer bean β preflight requests from the Netlify frontend still failed with 403 Invalid CORS request. The origin value in the Railway dashboard looked exactly right. I checked it three times.
Root cause: Spring's CorsConfiguration#checkOrigin() compares strings exactly, without trimming. The value had an invisible trailing whitespace β presumably from copy-pasting into the Railway UI field. Two of the three services were affected, the third wasn't, because it had been running unchanged for a while and the env var there had never been re-entered.
@Value("${allowed.origin}")
private String allowedOrigin;
// Fix: beim Setzen der CORS-Konfiguration
config.setAllowedOrigins(List.of(allowedOrigin.strip()));For string comparisons that 'look correct but don't work' β API keys, origins, tokens β I now check for invisible characters first, not last. Copy-pasting from UI fields is an underrated source of errors, precisely because you trust your own eyes the most in that moment.
Also learned along the way: a plain service restart on Railway doesn't always reliably pick up newly set env vars. A redeploy is the approach that actually works.
The Facebook page I ultimately didn't need
My planning long assumed something I took for established fact: the Instagram Graph API absolutely requires a linked Facebook page. That used to be true. It no longer is in 2026. Instagram API with Instagram Login β host graph.instagram.com instead of graph.facebook.com β works completely without a Facebook page, as long as the account is switched to 'Professional/Business'.
That rendered an entire planned block of work obsolete that I'd already scheduled. Before I noticed that, though, I had a completely different problem to deal with: my personal Facebook account was deactivated by Meta over 'account integrity', more than 180 days old, no way to verify it anymore, cause never clarified. The workaround was a different, longer-standing personal profile β a brand-new account used immediately for API purposes apparently is itself a red flag in Meta's automated systems.
The setup order that ultimately worked: switch the Instagram account to Professional/Business, create an app on developers.facebook.com (any FB account works as the developer login), select the use case 'Manage messaging and content on Instagram', no business portfolio needed, under app roles invite the actual Instagram account as an Instagram tester (not a Facebook test user, which creates fake accounts), confirm the invitation in the Instagram app, generate an access token.
curl "https://graph.instagram.com/v21.0/me?fields=id,username&access_token=<TOKEN>"
# Wichtig: die numerische "id" als IG_USER_ID verwenden,
# NICHT "username" - sonst 404 beim media-CallResearch before building, not after
API landscapes change faster than your own knowledge of them β a ten-minute search BEFORE architecture planning would have saved me an entire planned block of effort.
What remained in the end
The first fully automated end-to-end post β scheduler triggers content generation, content service calls Claude for the caption, publishing service posts to Instagram via the Graph API β actually went through. No human pressed a button in the last step. That was the moment I'd started the whole thing for, and it worked.
After that came two more rounds of frontend redesign. From three raw forms to something that looks like a product, then a second round to streamline it. What was interesting was my own confusion after the first round: even I wasn't immediately sure whether I had to fill out all three panels in sequence or whether one was enough. Good visual design doesn't solve that problem on its own if the different roles of the UI elements aren't communicated explicitly.
What I deliberately didn't build: rate limiting (Instagram allows 100 posts per 24 hours, currently unchecked), retry logic for failed posts, and the app is still running in self-test mode β for productive ongoing operation, the Meta app review is still missing. These aren't forgotten items, they're deliberately deferred ones.
Did building it myself pay off? Partially. The field-mismatch bugs and the CORS whitespace could never have happened to me with a finished tool, because there simply wouldn't be three self-built services that need to talk to each other. That's the price of control. What I got in return is a pattern for multi-service orchestration with AI agents that I can now actually reuse for client projects β and a much healthier distrust of green tests, clean merges, and copy-pasted fields in cloud dashboards. For a single Instagram channel, Buffer would have been faster and cheaper. For what I actually wanted to learn, it wasn't.