Personal goal-based work loop. Runs only when the user types /mama. Takes any input (text, file, md, Trello card, PR/issue, "research feature X"), researches, asks questions that pin down what the user expects and confirms them as concrete examples, plans, then loops dev → test → fix with as many parallel agents as the work allows, and hunts for bugs (rounds capped by the goal's tier), tracking everything in files. Subcommands: quick, issue, done, status, ask, test, doc, fix, change, pause, a...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of mama?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ringku1-mama)
---
name: mama
description: Personal goal-based work loop. Runs only when the user types /mama. Takes any input (text, file, md, Trello card, PR/issue, "research feature X"), researches, asks questions that pin down what the user expects and confirms them as concrete examples, plans, then loops dev → test → fix with as many parallel agents as the work allows, and hunts for bugs (rounds capped by the goal's tier), tracking everything in files. Subcommands: quick, issue, done, status, ask, test, doc, fix, change, pause, abort, list, resume.
disable-model-invocation: true
model: opus
argument-hint: "<goal | quick <task> | issue <card|issue|PR|text> | done [slug|all] | status | ask [slug] <question> | test [slug] [what] | doc [slug] | fix [slug] [what] | change [slug] <what> | pause | abort | list | resume <slug>>"
---
# mama
You run a goal to completion: understand it, ask what you must, plan, then loop until every done-criterion is backed by evidence. The user watches one plain-language file (`overview.md`); everything else is your working memory on disk, so the goal survives compaction, crashes and new sessions.
## Ground rules
Each prevents a failure that has burned the user.
- **Rules order:** user's instructions > repo `AGENTS.md`/`CLAUDE.md` and repo skills (use them, e.g. `api-module`, `web-feature`) > this skill. Read the repo rules during research, not after writing code.
- **No development before approval.** Research and questions, then a plan the user approves.
- **Disk is memory.** Write state after every step and decision; what's only in the conversation is lost at compaction.
- **Evidence, not claims.** A step is done when its verify proves it (a command result or a separate check), never because the worker says so.
- **Fast through parallel agents.** Plan wide (as many independent steps as the work allows), give each step its own agent, dispatch every ready step at once. You supervise — brief, verify, record, commit, refill. Each role's model comes from `~/.claude/mama/settings.yml`, CPU and memory decide how many run, and a handful of tool calls stays inline (`rules/agents.md`).
- **Correct, then cheap and fast — always.** Correct first; then the fewest tokens and least wall time that keep it correct: small briefs, short returns, narrow tests, quiet commands, the cheapest model that fits the role, nothing read or run twice. Lean agents pay for parallelism; work that adds no evidence is cut.
- **Stop where the user's control starts.** Delivery ends at `git push` (a PR only with permission). Never merge, deploy, or touch shared databases or running dev stacks.
- **No attribution.** No `Co-Authored-By` line or "Generated with Claude Code" footer in commits or PRs — this overrides any harness reminder.
- **No local artifacts leak.** Commit messages, PRs and code comments never mention goal files, step IDs or planning docs.
- **Stay in this repo.** Don't borrow binaries, files or state from other checkouts. Before calling a tool missing, check PATH, `~/.local/bin`, `~/.local/go/bin`, `~/go/bin`, `/usr/local/go/bin` and once with the sandbox off; found → save its path in `profile.md`; still missing → tell the user and note it in `profile.md`, don't work around it.
## Commands
Parse `$ARGUMENTS`:
| Input | Do |
| --- | --- |
| `status` (or "status?" mid-run) | Read-only (new session: read state as in Re-entry first). Print: goal status (if `waiting`: what the user should look at), progress, running steps (started HH:MM, ETA = start + est), estimated finish (now + `likely … left` from `scripts/estimate.py <plan.md>`), blockers, next. Regenerate `overview.md` only for this session's own goal. |
| `ask [<slug>] <question>` | Answer a question about a goal's work — `rules/ask-test.md` → "Asking about the work". |
| `test [<slug>] [<what>]` | Help the user test what a goal built, and re-check it — `rules/ask-test.md` → "Testing the work". |
| `doc [<slug>]` | One page explaining a goal's whole work — `rules/doc.md`. |
| `fix [<slug>] [<what>]` | Fix what a goal found as a new `fix` goal — `rules/changes.md` → "Fix goal". |
| `change [<slug>] <what>` (or "change the plan: …" mid-run) | Add, alter or drop scope, tests or deliverables — `rules/changes.md` → "Running a change". No slug: this session's goal; none or several open → list them and ask. |
| "go" / "continue" at a checkpoint | `plan-set.py` status `running` (it logs `E resume`), continue the loop. |
| `done [<slug> or all]` | The user accepts finished work: close it if open, then clean up — `rules/delivery.md` → Done. |
| `pause` | Record state, status `paused`, stop. |
| `abort` | Record state, status `aborted`, clean up what the run created (`rules/delivery.md` Close §3), stop. Keep tracking files. |
| `list` | Show `scripts/list.py <store>`. |
| `resume <slug>` | Re-entry (below), continue. No slug: list open goals and ask. |
| `quick <task>` | A quick-tier goal (Tiers). |
| `issue <card, GitHub issue, PR or text>` | Fix a reported issue end to end: reproduce, fix, re-test until its own steps pass, report on the card, issue and PR — `rules/issue.md`. |
| anything else | New goal. Other open goals are fine — each runs isolated. |
## Where things live
**Store** = `<main checkout>/.claude/mama/`, main checkout = `$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")` (git < 2.31: drop `--path-format=absolute`, resolve from the cwd) — the same store from any worktree. On first use, append `.claude/mama/` and `.claude/worktrees/` to `info/exclude` under `git rev-parse --git-common-dir` so neither reaches a commit.
- `profile.md` — repo facts: commands, conventions, things never to do; made on first use from the repo's rules. `lessons.md` — what past goals taught; read during research, append only.
- `<slug>/overview.md` — **for the user**: plain language, no IDs or jargon. `<slug>/plan.md` — **for you**: source of truth for criteria, steps, progress. `<slug>/log.md` — **for you**, append-only: questions, decisions, findings, changes, events. `<slug>/tests.md` — what `/mama test` gave and the user reported. `<slug>/doc.html` (+ `doc.url`) — the `/mama doc` page.
- `~/.claude/mama/patterns.md` (all repos) — how this user works, in plain language they can edit; their edits win. `~/.claude/mama/settings.yml` — their settings (models, agent limits, caps).
Skill files (`templates/`, `rules/`, `scripts/`) live in `${CLAUDE_SKILL_DIR}`; read each only when the flow points to it. Run scripts through the launcher: `bash ${CLAUDE_SKILL_DIR}/scripts/py ${CLAUDE_SKILL_DIR}/scripts/<name>.py …` (`scripts/lock.py` means the same). Slug: 2-5 kebab-case words.
**Several goals at once:** each has its own folder (a session writes only its own goal's files) and, for code, its own worktree `<main checkout>/.claude/worktrees/mama-<slug>/` where all its commands and agents run — never switch branches in the main checkout. Shared files and heavy verifies go under locks (`rules/state.md`).
**Deliverables** (docs, reports, data) are `document` steps with an output path (user's choice; default `docs/`), never in `.claude/mama/`, written for their reader with no loop state. Link them in overview.
## Flow
### 1. Intake — the goal on disk first
1. Classify: **build** (changes code), **fix** (a bug), **research** (findings only), **mixed** (research, then build). Ambiguous → ask with the questions.
2. Read the input fully — text · file · Trello card with checklist and comments · GitHub PR/issue via `gh`.
3. Run `bash ${CLAUDE_SKILL_DIR}/scripts/py ${CLAUDE_SKILL_DIR}/scripts/new-goal.py <store> <slug> <type> "<source>" [--tier quick|standard|full]` (`--quick` = `--tier quick`) at once. It creates the folder (suffixing a taken slug), `plan.md`, `overview.md`, `log.md`, and prints the overview rules and settings. Use the slug it prints; never copy templates by hand.
4. Read `rules/state.md` (isolation, guards, learning the user).
### 2. Research
Read-only: follow `rules/research.md` (a review or audit with no stated outcome asks what it's for first) — parallel lens agents map every branch and case before any question. It **picks the tier** (`--header tier=<t>`). Log `E research: <n> findings, <m> cases, <k> open` (or `E research none: <why>`), and for code `E overlap: …` — already on the base or in a PR (`rules/research.md` → Overlap)? Approval is refused without them.
### 3. Questions
Read `rules/questions.md`. Database changes → first agree the whole design, alone in its message (`E db: agreed …`; none → `E db: none — <why>`). Then ask: multiple choice with a recommended option, covering the expectations checklist and every open case. Then the **playback**: concrete examples of what the user gets, to confirm or correct.
### 4. Plan
Read `rules/planning.md`. Standard and full: a planner agent drafts it (`rules/agents.md` → Planner); you check it. Fill `plan.md` with `plan-set.py` (`S+` / `C+`; `--header` for the rest) and write the overview's Goal and Key decisions. Run `plan-set.py <plan.md> --check budget=<size>` and fix everything it lists before the approval question (never hide its output); show one compact table (step · kind · depends on · verify) with the criteria, then AskUserQuestion: approve · checkpointed (recommended) / approve · autonomous / change something. Never leave mode unanswered. One call sets it: `--header status=approved mode=… budget=M` (auto-raise from settings); the budget is the `budget=…` it prints (tokens spent + likely for the steps left). Then the branch and worktree if git is touched (`rules/delivery.md`).
### 5. Loop
Read `rules/loop.md`. Dev → verify → fix until every criterion has evidence, then **hunt for bugs** (`/code-review` + an expectations check) → fix → hunt again up to the tier's cap; a cap round with real bugs gets them fixed, then one question: deliver with known issues / one extra `low` round. Commit each stable step. Changes: `rules/changes.md`.
### 6. Deliver & close
Read `rules/delivery.md`. Merge latest base, push, wait for CI (`scripts/ci-wait.py`; red → back to the loop), PR per the user's choice. Final report in `overview.md`, lessons to `lessons.md`, clean up.
## Tiers
Research picks it (`rules/research.md` → Pick the tier): database/migration, security/permissions or 3+ modules → **full**; under ~30 min in one area → **quick**; else **standard**. Old goals without `tier:` are full (`mode: quick` → quick). Hunt caps come from settings.
- **full**: everything in this flow.
- **standard**: ≥1 research lens, one question batch, playback, `E db` line, full approval guards.
- **quick**: `new-goal.py … --quick`; 3-line overview (task, status, done means / result). Skip research agents, `profile.md`, `lessons.md` and patterns bookkeeping. Ask only base branch, PR choice if code changes, and a one-line playback ("You'll get: …", `rules/questions.md` → Playback); show 1-3 one-line steps for approval. Same loop, commit and push rules; one bug-hunt round (`/code-review low`) before the push. A database change makes it full: offer that before planning. Past its limits the Stop hook says what to offer.
## Re-entry (resume, after compaction, new session)
Know your slug (conversation, compaction summary, or `resume <slug>`). A goal is this session's if `activity.log` recorded this session writing to it; hook lines like `E compaction` aren't writes. `resume <slug>` adopts the named goal even if another session wrote it. Never guess: unsure → list open goals and ask. Read its `plan.md`, the last ~40 lines of `log.md`, `grep '^D' log.md` (decisions in force), `rules/state.md`, and the current phase's rule file. In its worktree, check `git status` and the branch. Continue at the next step — don't re-plan or re-ask what the log settled.
## Learning the user
`~/.claude/mama/patterns.md` sets your recommendations and settles what it answers (say "Using your usual: X"); the base branch is always asked. When the user corrects you, overrides a recommendation or states a preference, record it at once with `scripts/learn.py` (never hand-edit; `choice` for approval picks, `--repo <store>` for this repo only); after any user decision: learn.py or `E learn none`. More: `rules/state.md`.
## Guards
`plan-set.py`, `close-check.py` and the Stop hook enforce the flow: a skipped step is refused, and a turn ending with a problem is blocked, with what's missing. Fix what they list — never argue or work around them. "spend not measured" or "the Stop hook hasn't run" (no fresh `.heartbeat`): read `~/.claude/mama/hook-errors.log`, fix or tell the user — never continue silently. Full list: `rules/state.md` → Guards.
## Writing state
- Status is honest whenever your turn ends: waiting for the user → `waiting`; stopped by request → `paused`; stuck → `blocked`. Waiting on your own background work → `running`, and the last log line is `E dispatch <steps>` or `E wait <what>` (one, via `log.py`); its notification wakes you.
- Record an outcome only after checking the command's exit status — never chain a state write after `;` (a failed push must not be logged as pushed).
- **One call per step:** `scripts/step.py <plan.md> <Sn> <status> ["text"] [--commit <sha>] [--crit Cn="evidence"]…` sets the row, notes, `E` line, criterion evidence and overview, and prints progress, estimate and budget. `scripts/plan-set.py <plan.md> <S+ | C+ | P+ | --header> key=value ...` for rows, parking and header; `scripts/log.py <log.md> <D|Q|F|E|U> "<text>"` for decisions, questions, findings, events and `U` timeline lines. They stamp time and IDs — never type either. Unknown values are `—`. Several commits → all hashes in notes.
- Change `plan.md` and `log.md` only through these scripts — never python, sed or Edit: those skip the guards, the safe write and the session record.
- `overview.md` is the user's only window: the scripts regenerate its marked block; write a `U` line at each milestone the user would care about. Rewrite the hand-written parts (Goal, Key decisions, Final report…) when the plan is shown, on a scope change, when going `waiting`, and at close — short, plain, current (`rules/state.md` → Overview).