knitbrain: Command for Gemini CLI

.gemini/commands/goal.toml

goal is a command for Gemini CLI from PDgit12/knitbrain. It costs 0 tokens per session (355 once invoked), scanned A, original, MIT.

A command that works with you in the current session to carry a goal through a verification gate. It chooses a verification command from the request, a goal file, or npm test when available, and stops only on a real pass or a stated limit.

In plain words
What is it for?
It is for completing goal files or requested tasks, applying small fixes, running the chosen check, and repeating until the check passes or the limits are reached.
Why use it?
It keeps progress tied to an actual check instead of assuming that a change is complete because it looks correct.

Command for Gemini CLI

Written for Gemini CLI: installed under .gemini/. Also seen: mentions subagents.

This is PDgit12/knitbrain's own configuration. It tells Gemini CLI how to work on knitbrain itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything knitbrain configures →

Reuse

Borrowing it

Nothing to install: this file belongs to PDgit12/knitbrain. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/PDgit12/knitbrain/main/.gemini/commands/goal.toml
Clone the repo
git clone --depth 1 https://github.com/PDgit12/knitbrain

Made for: Gemini CLI.

Wrote 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.

agentmods badge for goal

README.md
[![agentmods](https://agentmods.dev/badge/commands/pdgit12/knitbrain/goal/github.svg)](https://agentmods.dev/commands/pdgit12/knitbrain/goal)
Your own site
<a href="https://agentmods.dev/commands/pdgit12/knitbrain/goal"><img src="https://agentmods.dev/badge/commands/pdgit12/knitbrain/goal/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.

agentmods 80×15 button for goal

Your own site · 80×15
<a href="https://agentmods.dev/commands/pdgit12/knitbrain/goal"><img src="https://agentmods.dev/badge/commands/pdgit12/knitbrain/goal.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 355 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00355
Opus 5.5 $0.00000 $0.00142
Sonnet 5.5 $0.00000 $0.00071
Haiku 4.5 $0.00000 $0.00036

Measured 14d ago against content hash f0682412b567, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

goal 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 14d 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.

.gemini/commands/goal.toml · 13 lines

What it actually says

description = "Drive a goal to a verify gate WITH YOU in this session (in-chat orchestration)" prompt = """ Drive the goal in the arguments to done WITH YOU in THIS session (single context). The verify gate is the truth, not your judgment.

  1. Treat the arguments as the goal (or a goal.md checkbox file if one is named).
  2. ORCHESTRATE FIRST — call the knitbrain_run tool with the goal and ADHERE to its verdict: adopt the returned SKILL (refine it, then knitbrain_skill_save); if it proposes agents, spawn them via your host's sub-agent mechanism and coordinate on knitbrain_team_post.
  3. Pick the verify command by precedence: an explicit --verify > the goal file's VERIFY: line > npm test when a package.json exists. If none is derivable, ASK the user for the gate — do NOT invent a command that passes.
  4. Read an optional --for <30m|1h> and convert it to deadline_ms.
  5. Drive the knitbrain_run_loop tool each cycle with { goal, verify_cmd, max_iters, deadline_ms }: make the smallest real fix, then call knitbrain_run_loop again with the SAME goal so iteration + the time budget carry across calls.
  6. NEVER fake met=true. Stop only at a real met=true, OR max_iters, OR the --for deadline, then report the honest final state (what passed, what is still open) and close the loop: knitbrain_record_learning + knitbrain_skill_outcome.

For a HANDS-OFF autonomous run (a FRESH agent per iteration, in the background), use /loop instead — it launches the external runner (knitbrain loop). """

Changes

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.

  1. 14d ago First seen · 13 lines · 0 tokens per session scan A f0682412b567

Subscribe to this mod's changes

goal is a command published in the GitHub repository PDgit12/knitbrain (6 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 355 tokens. 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-10-23.

Related

goal compared with commands from other repositories

goal next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
goalPDgit12/knitbrainCommand66d agoMITA0Gemini CLI
lians-integrateLians-ai/LiansCommand174d agoApache-2.0A17Claude Code
ijfw-auditFerroxLabs/ijfwCommand2144d agoMITA28Claude Code
ui-aqa-flow-test-report-analysisgriddynamics/rosettaCommand370todayApache-2.0A19Claude Code
api-aqa-flow-execution-and-report-analysisgriddynamics/rosettaCommand370todayApache-2.0A28Claude Code
constraintsvinvcn/addyosmani-agent-skills-zhCommand4617d agoMITA20Claude Code
playwright-executekatalon-labs/true-skillsCommand1017d agoMITA117GitHub Copilot