Build the solution-go service agent: scaffold a solution backend, not a generic Go service #1
Description
Moved from codefly-dev/cli#1217, which was filed in the wrong repo — this agent is its own repo, like every other service agent (service-go, service-go-grpc, service-nextjs, service-python, …), not part of the CLI.
What this is
codefly add solution (codefly-dev/cli#1216, merged as 7c5518f5) writes the five YAML documents a solution is installed from. It writes no solution code: --agent go dispatches to the generic Go service agent, which scaffolds a plain main.go and go.mod that know nothing about solution-runtime-go, consumes.go, the CODEFLY__API_CONSUMES projection, the Work Context plumbing or ./Page. Every line of that is hand-written in all nine solutions today, at 1.5–2 hours per solution.
This agent closes that half.
It is a SERVICE agent — no new protocol
Service agents already have a protocol: services.Add drives the agent’s own Create flow. No core change and no new wire protocol. This is explicitly NOT cli#1215’s option (b), which wanted a codefly:solution executor — that is not needed and should not be built.
codefly add solution --agent solution-go --package-id <owner>/<name> works the day this publishes; the CLI then flips its --agent default from go.
The shape to copy: codefly-dev/service-go-grpc
agent.codefly.yaml publisher: codefly.dev / kind: codefly:service / name: solution-go
version, source{directory: ., agent: codefly.dev/go:<v>}, release{owner: workflow, workflow: releaser.yml}
main.go the agent binary
builder.go Create + build (Create lives here, via the embedded templates)
runtime.go run
templates/factory/ what Create writes into the service directory (code/, proto/, openapi/, flake.nix, GETTING_STARTED)
templates/builder/ Dockerfile.tmpl, dockerignore.tmpl
templates/deployment/ kustomize base + overlays
templates/agent/ README.md.tmpl
.goreleaser.yaml release
Module path github.com/codefly-dev/service-solution-go. Note service-go-grpc’s agent.codefly.yaml sets source.agent: codefly.dev/go:0.0.74 — the agent is itself built by the go agent.
What Create must produce
In the backend service directory: the solution-runtime-go dependency at the pin obin-ai/core-solutions’ scripts/check_consumed_apis.py requires (read that script for the exact floor — it checks a release >= 0.0.12 or a pseudo-version at/after the native-mint timestamp), consumes.go generated from the sibling solution.codefly.yaml’s api.consumes, the /health readiness handler the endpoint declares, and the ./Page / fe-remote npm package add solution deliberately does not write.
What Create must NOT produce
- Any
service-dependenciesnaming a consumed module. A solution reaches every module through the authority’s hop, which checks the call; a direct edge renders into a mesh allow rule past that check andscripts/check_solution_mesh.pyrefuses it. cli#1216 writes the only dependencies a solution backend has — the authority interface plusauthority/hopaskind: external— do not add to them. module-identity, the endpoints, or any of the five documents. cli#1216 owns those and will conflict.
The recipe already exists
templates/solution on obin-ai/core-solutions’ scaffold/new-solution branch, whose scripts/new-solution.sh says it "is shaped so it can become that agent’s recipe rather than being thrown away." Carry over its four rules: one canonical template, consumption declared once with a drift check, no installation UUID in source, and green on every gate at generation.
The reference solution
obin-ai/core-solutions solutions/wiki on origin/main — it has been running longest; solutions/proposals confirms it. Read wiki/services/backend/. Do NOT model on lastlogin-go: it is the demo.
Verification bar
A solution scaffolded end to end with codefly add solution <name> --agent solution-go --package-id <owner>/<name> must build and pass core-solutions’ own gates: check-boundaries.sh, check-consumed-apis.sh, check-solution-mesh.sh. Note check-consumed-apis’ runtime-pin check only becomes live once a services/backend/go.mod exists — which this agent creates.
Out of scope
A solution-python twin: same shape, different language, exactly as go/python are today.
🤖 Generated with Claude Code
Activity
antoinetoussaint-byte commentedon Oct 28, 2026
lazybox has finished working on this.
claude(Opus 5) held it from 2026-10-28 20:13 UTC until 2026-10-30 19:54 UTC. Theworkinglabel has been removed; this comment is the record.claim detail
feat: the solution-go service agent — scaffold a solution backend, no…