ardanlabs/service is a Go starter kit for building scalable web services designed to run in Kubernetes. It provides an organized starting structure based on domain-driven and data-oriented architecture, Go practices, and a small dependency set. The catalogue skills and instruction help coding agents work with services built from this starter kit.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add ardanlabs/service --skill branching-logic-flowgit clone --depth 1 https://github.com/ardanlabs/serviceWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ardanlabs/service/branching-logic-flow)<a href="https://agentmods.dev/skills/ardanlabs/service/branching-logic-flow"><img src="https://agentmods.dev/badge/skills/ardanlabs/service/branching-logic-flow/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ardanlabs/service/branching-logic-flow"><img src="https://agentmods.dev/badge/skills/ardanlabs/service/branching-logic-flow.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00039 | $0.00617 |
| Opus 5.5 | $0.00016 | $0.00247 |
| Sonnet 5.5 | $0.00008 | $0.00123 |
| Haiku 4.5 | $0.00004 | $0.00062 |
Grade A, and why
branching-logic-flow scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Branching Logic Flow
For shallow branching (1-3 cases), prefer defaulting or naked switches over if/else chains. This reduces nesting, avoids duplication, and lowers the cognitive load.
When to Apply
- Writing new conditional logic with 1-3 branches
- Refactoring nested if/else blocks
- Type assertions on
any/map[string]any - Any branching where each branch assigns to the same variable
Rule 1: Default first, override later
Initialize the variable with its default value, then override only in the special case.
❌ Avoid:
var result map[string]any
if outer, ok := input["outer"].(map[string]any); ok {
if inner, ok := outer["inner"].(map[string]any); ok {
result = make(map[string]any, len(inner))
maps.Copy(result, inner)
} else {
result = make(map[string]any)
}
} else {
result = make(map[string]any)
}
✅ Prefer:
result := make(map[string]any)
if outer, ok := input["outer"].(map[string]any); ok {
if inner, ok := outer["inner"].(map[string]any); ok {
result = make(map[string]any, len(inner))
maps.Copy(result, inner)
}
}
Rule 2: Naked switch over if/else if/else ladders
❌ Avoid:
if a > b {
result = a
} else if a == b {
result = a + b
} else {
result = b
}
✅ Prefer:
switch {
case a > b:
result = a
case a == b:
result = a + b
default:
result = b
}
For simple two-way numeric comparisons, prefer the min/max built-ins (Go 1.21+):
result := max(a, b)
When NOT to Apply
- Default initialization is heavyweight (DB call, large allocation, external API)
- The "default" case is exceptional and should fail fast with an error
- Conditions are deeply nested (>3 levels) — extract to a separate function instead
- Defaulting could mask a bug that should be surfaced explicitly
Related Modern Go Patterns
- Use
maps.Copy(dst, src)instead of manual copy loops (destination must be non-nil) - Use
cmp.Or(a, b, "default")to pick the first non-zero value across fallbacks - Always use the two-value form
v, ok := x.(T)for type assertions
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 97 lines · 39 tokens per session scan A 9d5254da20d7
branching-logic-flow is a skill published in the GitHub repository ardanlabs/service (4,138 stars, last pushed 17d ago), licensed Apache-2.0. It adds 39 tokens to every session and 617 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
branching-logic-flow compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| branching-logic-flowardanlabs/service | Skill | 4.1k | 17d ago | Apache-2.0 | A | 39 | Claude Code, Codex |
| golang-testingaffaan-m/ECC | Skill | 315k | yesterday | MIT | A | 37 | Claude Code, Kiro |
| golang-patternsaffaan-m/ECC | Skill | 315k | yesterday | MIT | A | 45 | Claude Code, Kiro |
| golang-testingsamber/cc-skills-golang | Skill | 4.0k | 2d ago | MIT | A | 115 | Claude Code |
| golang-samber-oopssamber/cc-skills-golang | Skill | 4.0k | 2d ago | MIT | A | 74 | Claude Code |
| golang-uber-fxsamber/cc-skills-golang | Skill | 4.0k | 2d ago | MIT | A | 122 | Claude Code |
| ax-go-agent-optimizeax-llm/ax | Skill | 3.0k | yesterday | Apache-2.0 | A | 51 | Claude Code, Codex |