Skip to content
Proyectos

Acerca de

The canonical reference for Grok Build CLI /goal — run-until-done objectives, patterns, verifier skills, and goal-audit CLI.

IA y aprendizaje automático

Cómo se miden estas cifras

Crecimiento de estrellas medido

in 24h
0
in 7 days
0
in 15 days
+2
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

Goal Engineering

Goal Engineering — Run until verifiably done

Explore the Showcase

GitHub stars goal-audit dogfood goal-audit npm goal-init npm MIT Pages

Goal engineering is replacing one-shot prompts with verifiable, run-until-done objectives. You define what "done" means, Grok Build works across turns until the condition holds — and reports progress via /goal and update_goal.

This is the canonical public reference for Grok Build CLI's /goal feature. Reference updated 15 November 2026.

→ Interactive showcase + pattern picker
→ Canonical essay · Medium · Substack · → Golden path (10 min replay)
→ Companion: Loop Engineering (scheduled cadence) · Fleet Engineering (governed populations)

Loops discover work on a cadence. Goals finish bounded tasks. Companion: Loop Engineering v1.6.0. Stack cookbook → · llms.txt

The One-Line Definition

A goal is a single autonomous objective with a verifiable completion condition. Unlike a loop (which fires on a schedule), a goal persists across turns until Grok marks it complete, blocked, or you pause it.

Prompt  = one turn, one answer
Loop    = recurring discovery + triage on a cadence
Goal    = run until done (or blocked / paused)

Quick Start (2 minutes)

# Published on npm
npx @cobusgreyling/goal-audit . --suggest
npx @cobusgreyling/goal-init . --pattern tests-green --tool grok --lang python

@cobusgreyling/goal and @cobusgreyling/goal-cost are in tools/ and are not on npm.

In Grok Build:

/goal All tests pass — goal-verifier before completed: true

Manage the active goal:

/goal status    # check progress
/goal pause     # pause without clearing
/goal resume    # continue
/goal clear     # end goal mode

Replay a full session: examples/golden-path/SESSION.md

Contents

Why Goals Matter

Most agent work fails in the gap between "looks done" and actually done. Goals close that gap:

  1. Persistence — the objective survives compaction and new turns
  2. Progress telemetry — update_goal logs status without spamming the chat
  3. Explicit lifecycle — pause, resume, clear, blocked
  4. Verifiable completion — you define the stop condition up front

Goals pair naturally with loop engineering: loops discover work; goals finish it. See docs/stack-cookbook.md.

Try the stack: morning loop triage → pick top item → /goal until verifier passes:

# Loop side (discovery — Loop Engineering v1.6.0)
npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok
npx @cobusgreyling/loop-audit . --suggest

# Goal side (finish — this repo)
npx @cobusgreyling/goal-init . --pattern fix-bug --tool grok
npx @cobusgreyling/goal-audit . --suggest

Grok Build API

Surface Purpose
/goal <objective> Set a new autonomous goal
/goal status Show current goal state
/goal pause / resume Pause or continue
/goal clear Exit goal mode
update_goal tool Agent reports progress (message), completion (completed: true), or blockers (blocked_reason)

Full reference: docs/api-reference.md

Availability: /goal appears when the goal feature is enabled and update_goal is in the session toolset. No slash command? See examples/no-slash-command/GOAL-only.md.

The Four Primitives

Primitive Job in a Goal
Objective One sentence + verifiable done condition
Verifier Separate check — implementer must not grade its own homework
State GOAL.md or equivalent external memory
Budget Token/turn caps and kill switches

Detail: docs/primitives.md · Cross-tool matrix: docs/primitives-matrix.md

Anatomy of a Goal

flowchart LR
    A["/goal &lt;objective&gt;"] --> B[Scope + done condition]
    B --> C[(GOAL.md state)]
    C --> D[Implementer turns]
    D --> E[Verifier sub-agent / tests]
    E --> F{Done?}
    F -->|yes| G["update_goal(completed: true)"]
    F -->|blocked| H["update_goal(blocked_reason)"]
    F -->|no| D
    G --> I[/goal clear or new goal/]

Patterns

Pattern Starter When to use
Tests Green starters/tests-green CI red → green with verifier gates
Migrate Module starters/migrate-module API/module migration + import scan
Implement Feature starters/implement-feature Scoped feature + acceptance criteria
Fix Bug starters/fix-bug Repro → fix → regression test
Refactor Safely starters/refactor-safely Behavior-preserving refactor
Coverage Target starters/coverage-target Raise coverage to threshold

Unsure? Pattern Picker · When not to use goals: docs/when-not-to-use-goals.md

Getting Started (5 minutes)

npx @cobusgreyling/goal-init . --pattern tests-green --tool grok
npx @cobusgreyling/goal-audit . --suggest
bash scripts/before-after-demo.sh

In Grok Build:

/goal Read GOAL.md. Implement the scoped objective. Run tests after each meaningful change.
Use update_goal for progress. Do not mark completed until the verifier skill passes.

See starters/minimal-goal/ and docs/goal-design-checklist.md.

Goal vs Loop

Goal Loop
Trigger You set an objective Schedule (/loop) or automation
Duration Until done / blocked / cleared Recurring forever (or until cancelled)
Best for Finish a bounded task Discover + triage ongoing work
State file GOAL.md STATE.md, LOOP.md
Grok command /goal /loop + scheduler_*

When to combine: a daily loop triages; when it finds a fixable item, hand off to a goal for run-until-done execution. See docs/goal-vs-loop.md.

Operating & Safety

Tools

Tool Command npm
goal-audit npx @cobusgreyling/goal-audit . --json --min-level G2 published
goal-init npx @cobusgreyling/goal-init . --pattern tests-green --lang python published
goal (meta) wraps audit, init, and cost not published
goal-cost token estimate from tools/goal-cost not published

The in-repo meta CLI (tools/goal) maps:

Meta subcommand Maps to
doctor / audit goal-audit
init / scaffold goal-init
estimate / cost goal-cost

Scores Goal Readiness (G0–G3) from signals: GOAL.md, skills, verifier, tests, CI, budget, run log freshness.

CI Integration

Gate PRs on minimum readiness:

- uses: cobusgreyling/goal-engineering/.github/actions/goal-audit@main
  with:
    path: .
    min-level: G2

Or: npx @cobusgreyling/goal-audit . --json --min-level G2 (exit 2 if below threshold).

The Stack

Layer Unit Question
Context Engineering One inference What does the model see?
Harness Engineering One agent run How does a single run execute safely?
Goal Engineering One bounded objective How do we run until verifiably done?
Loop Engineering Autonomous system over time What keeps prompting on a cadence?
Fleet Engineering Agent populations How do many agents coordinate at scale?

Contributing

PRs that improve patterns, verifier skills, or CLI heuristics are welcome. See CONTRIBUTING.md, adopters, discussions, and stories/.

License

MIT — see LICENSE.


Made with Grok Build. This repo is the go-to reference for /goal — link here when you teach, blog, or ship goal-driven agent workflows.

Explorar proyectos relacionados

Cargando…