Architecture

How the parts fit. Short version: one main Claude Code session talks to you and hands real work to subagents. Everything the system knows lives in files, not in chat.

                you (terminal, or Telegram on a VPS)
                               |
                               v
   +---------------------------------------------------------+
   |  main session ("dispatcher")                            |
   |  reads CLAUDE.md + MEMORY.md, keeps its context small,   |
   |  spawns subagents, relays short results                 |
   +---------------------------------------------------------+
        |               |                 |              |
        v               v                 v              v
   prompt-architect  idea-validator   orchestrator    other agents
   (rough ask ->     (score an idea)  (one loop       (aso, release,
    brief)                             iteration)      copywriter...)
                                          |
                          +---------------+---------------+
                          v               v               v
                    specialists      loop-guard.sh     git commit
                    (1-2 reviewers   gate via          (only on
                     per item)       gradle-slot        green)
        |
        v
   files: app repo (PLAN.md, .loop/, PROGRESS_*.md, READINESS.md, AiGuidelines/)
          $ARMY_HOME/factory (ideas, prompts, rules, learnings, skills)
          $ARMY_HOME/concepts (recipes)       ~/.army (config, claims, logs)

   guard hook (PreToolUse) sits under every tool call above.

The dispatcher pattern

The session you talk to is the expensive one. It runs on your strongest model and, on a VPS, stays alive for days. So it does very little itself:

  • it reads CLAUDE.md and MEMORY.md;
  • it turns vague asks into a brief through prompt-architect;
  • it spawns a fresh subagent for each piece of research, each stage and each loop iteration, several at once when they are independent;
  • it relays a few lines back to you.

Build logs, review bodies and long files stay in files. They never travel back into the main chat. That is what lets a long run fit inside a usage window.

Plugins

The kit ships three Claude Code plugins in kit/plugins/:

Plugin Holds
army-core the guard hook, the 10 app reviewers and the copywriter, and 7 product skills (stitch-prototype, store-screenshots, app-seo-site, app-domain-cutover, safe-push-main, store-rejection-intake, concepts)
army-factory the 5 factory agents (orchestrator, prompt-architect, idea-validator, systems-retro, aso-specialist) and 8 factory skills (kickoff, intakes, rule capture, prompt library, skill-smith, agent-sync, kit export)
army-pro 6 skills for always-on boxes and release work (bot-restart, box-overload-triage, full-audit-run, mac-e2e-handoff, play-internal-release, voice-mode)

Agent text has {{ NAME }} placeholders (your projects folder, app id prefix and so on). Claude Code cannot expand variables inside agent files, so kappmaker-army agents sync renders them with your config into ~/.claude/agents/ and into the loop template. Those rendered copies are what Claude Code uses.

A second layer of skills comes with each app: the KAppMaker template carries project skills such as new-app, build-features, new-screen, run-the-app, design-paywall and run-quality-gates. The index is <app>/.claude/skills/README.md.

Factory folders

Everything under $ARMY_HOME/factory/:

Folder What
ideas/ SCORING.md rubric, _IDEA_TEMPLATE.md, BACKLOG.md, one file per idea, research/ for notes from other AIs
keywords/ raw keyword exports, niche summaries, bank/ (built by kappmaker-army keyword build)
prompts/ stage prompts, Stitch prompts, master/ (3 master prompts + checklists), proven/ (prompts that worked)
standards/ APP_RULES.md: rules every app follows (starter set, edit freely). kappmaker-army rule add appends
checklists/ APP_FACTORY.md (stages 0 to 10 for each app), READINESS_TEMPLATE.md
learnings/ LESSONS.md, FAILURES.md, PROPOSALS.md
skills/ your own skills, made with skill-smith (kappmaker-army skill new)
routines/ run-routine.sh, nightly health, weekly idea scout and retro
portfolio/ PORTFOLIO.md, written by the nightly health routine
handoffs/ notes a worker leaves before a restart

The loop

Each app gets a loop scaffold from kapp-loop-install: scripts/start-loop.sh, stop-loop.sh, loop-guard.sh, playbooks in AiGuidelines/loop/, and a Stop hook in .claude/settings.json. It does nothing until you start it. When it runs, a fresh orchestrator does one item per pass, specialists review, the gate decides. See LOOP.md.

Memory, lessons and proposals

File Who writes When
MEMORY.md (workspace) the agent, only on your "remember X" / "forget X" your preferences and decisions. Memory wins over CLAUDE.md defaults
APP_RULES.md owner-rule-capture skill, kappmaker-army rule add you state a rule for every app ("never show a price on the paywall button")
learnings/LESSONS.md any session, kappmaker-army log lesson "<text>" one line per thing learned the hard way
learnings/FAILURES.md kappmaker-army log failure "<text>" incidents
learnings/PROPOSALS.md systems-retro numbered changes to the system. Nothing changes until you reply "approve N"
~/.claude/session-history-<worker>.md Stop hook after each turn a restarted session reads it only when it lacks context
.loop/STATE.md, .loop/decisions.md orchestrator loop working memory, per app

The idea is that every app leaves the system a little better: a new rule, a lesson, a proven prompt, a recipe.

Concepts and recipes

$ARMY_HOME/concepts/ is a feature library. Each recipe is one file with the code, the wiring, the config and the steps to port it into a KAppMaker app. The kit ships 16 (paywall, credit ladder, referral deep links, reminders, account deletion, localization, store screenshot pipeline and more). When you finish a reusable feature, the agent records it as a new concept.

concepts find paywall       # search
concepts index              # rebuild INDEX.md after a change
concepts stale              # list concepts whose source moved on

Agents run concepts find before building any feature, and read one concept file, not other projects.

Workers, claims and the build slot

On a VPS you can run several always-on workers. Each is one Claude Code session with its own Telegram bot and boot folder. They share the projects folder, so three small tools keep them apart:

  • Claims. kappmaker-claim take <worker> <project> records who is on what. It never blocks. If someone else had it, the worker tells you and asks. kappmaker-claim list (or kappmaker-army claim list) shows the board; a claim with no heartbeat for 24 hours shows as STALE.
  • gradle-slot. Every Gradle build runs as gradle-slot ./gradlew <task>. One build per machine, capped heap, and it waits for a calm box first. "waiting for build slot" means another worker is building. Wait.
  • shared-write. Writes to shared folders (factory, concepts) go through shared-write -m "<msg>" <repo-dir> -- <command>: a lock plus a commit named after the worker.

kappmaker-army status shows load, the build slot, claims, and each app's branch and loop state in one screen.

Project board

kappmaker-army board serve runs a read-only web page on 127.0.0.1 with each app's PROGRESS_*.md checklist, recent commits, claims and what each worker is doing. kappmaker-army board link puts it behind a one-time Cloudflare quick tunnel link. Details: docs/cli/BOARD.md.

Docs for the App Army kit. The Claude Code plugin has its own page.