goalcraft
Turn a rough draft, vague ambition, or messy task brief into a powerful Codex /goal objective for long-running autonomous work. Use when the user asks to write, improve, format, sharpen, stress-test, or activate a Codex goal, thread goal, durable goal, or /goal prompt.
What this skill does
# Goalcraft
## Core Contract
Convert messy intent into a compact, activation-ready Codex `/goal` objective that keeps the agent moving until real completion evidence exists. The returned goal objective must be 4,000 characters or fewer, and the normal working target is 2,800 characters. Prefer drafting the goal text only. Do not call `create_goal`, `thread/goal/set`, or otherwise activate a goal unless the user explicitly asks to start or set it.
For current Codex `/goal` mechanics, read [references/codex-goal-contract.md](references/codex-goal-contract.md) when the exact runtime behavior matters.
## Workflow
1. Identify the rough objective, workspace, and expected end state.
- If the user supplied a draft, preserve their intent and tighten it.
- If a repo or files are mentioned, inspect them before finalizing the goal.
- If a critical success criterion is missing, ask the smallest necessary question; otherwise state assumptions.
2. Shape the goal around evidence, not effort. Use this list as input thinking, not as required output structure.
- Destination: what must be true at the end.
- Starting point: current context, repo, branch, artifact, issue, or known state.
- Core objective: the concrete work to complete.
- Scope: files, directories, systems, or task boundaries the agent should stay within.
- Deliverables: concrete artifacts such as code paths, tests, PRs, reports, screenshots, or logs.
- Must not regress: constraints, behavior to preserve, safety boundaries.
- Autonomy rules: when to continue, when to ask, what to verify directly.
- Checkpoint rhythm: how often to test, review, summarize progress, or pause.
- Verification gates: commands, inspections, screenshots, evals, or other proof loops.
- Done when: artifact-level acceptance criteria.
- Stop conditions: blockers, destructive actions, missing credentials, user approval boundaries.
- Success metric: the observable result that proves completion.
3. Keep the objective usable by Codex.
- Hard limit: the objective text after `/goal ` must be 4,000 characters or fewer.
- Normal target: draft to 2,800 characters or fewer.
- Strict fallback ceiling: do not return a normal goal above 3,400 characters.
- Treat 3,800 characters or more as a failed draft even if it is technically below the hard limit.
- Put useful but nonessential detail in companion notes outside the `/goal` payload.
- Make every requirement auditable against files, commands, PR state, logs, screenshots, or explicit user confirmation.
- Include exact commands only when they are already known from the repo or user.
- Avoid hidden flags in slash text. `/goal --tokens 50K ...` is literal objective text in the TUI, not parsed syntax.
- If a token budget is requested, present it separately from the objective text unless the target surface supports a separate budget field.
- For complex or ambiguous work, recommend a planning/interview pass before setting the goal.
- For very large work, include subagent/orchestration guidance only when the current Codex environment supports subagents and the work can be split into bounded, reviewable lanes.
4. Choose the output shape.
- Always start with compact shape: Destination, Context, Scope, Preserve, Verify, Done/stop.
- Do not use the full checklist as output structure unless the user explicitly asks for a verbose draft outside `/goal`.
- Do not force every planning concept into the `/goal`. Reason with the full checklist, then compress related items before output.
- Merge deliverables into Scope.
- Merge must-not-regress into Preserve.
- Merge autonomy and checkpoint rhythm into Done/stop.
- Keep examples and candidate lists outside the goal unless they are essential execution constraints.
- Section soft budgets: Destination 250, Context 350, Scope 700, Preserve 400, Verify 550, Done/stop 550 characters.
5. Validate length before returning.
- Put only the ready-to-paste `/goal ...` command in a temporary file or pipe it to this skill's bundled validator: resolve `scripts/validate_goal_length.js` relative to the directory containing this `SKILL.md`, then run it with `--target-chars 2800 --strict-target`.
- The validator belongs to Goalcraft, not to the user's working project. Do not search the user's repository for `scripts/validate_goal_length.js`.
- The script strips a leading `/goal ` and counts the actual objective Codex validates.
- If validation fails once, rewrite by cutting at least 25%: remove examples, collapse lists, merge fields, and move nonessential detail to companion notes.
- If validation fails twice, abandon the draft and switch to emergency shape: `/goal Complete [objective] in [scope]. Preserve [constraints]. Verify with [checks/evidence]. Stop for [risks]. Done when [criteria].`
- Do not keep making small incremental trims. More than two validation failures means the draft shape failed.
- Do not return a final goal until the validator passes.
- If the bundled script path is unavailable, use this deterministic fallback on the file containing the exact final `/goal ...` command:
```bash
node - "$GOAL_FILE" <<'JS'
const fs = require("node:fs");
let text = fs.readFileSync(process.argv[2], "utf8").trim();
if (text.startsWith("```")) {
let lines = text.split(/\r?\n/);
if (lines.length && lines[0].startsWith("```")) lines = lines.slice(1);
if (lines.length && lines[lines.length - 1].startsWith("```")) lines = lines.slice(0, -1);
text = lines.join("\n").trim();
}
if (text.startsWith("/goal") && /^[ \n\t]/.test(text.slice("/goal".length))) {
text = text.slice("/goal".length).trim();
}
const count = Array.from(text).length;
console.log(`objective_chars=${count}`);
if (count > 2800) process.exit(1);
JS
```
6. Decide output mode.
- Default: return a ready-to-paste `/goal ...` block plus a short assumptions list.
- If the user asks for review, critique the draft first and include a revised version.
- If the user explicitly asks to activate the goal, call the goal tool or app-server surface only after the objective is final and no existing active goal conflict is unresolved.
## Output Format
Return companion notes outside the goal when details should not spend objective characters. Use this shape by default:
```markdown
Assumptions:
- ...
Ready-to-paste goal:
/goal Destination: ...
Context: ...
Scope: ...
Preserve: ...
Verify: ...
Done/stop: ...
Objective length: N characters
Notes outside the goal:
- ...
```
Omit companion notes when they add no value. Do not put assumptions, rationale, candidate lists, or optional details inside the `/goal` unless they are execution-critical.
## Quality Bar
- The goal should be operationally sharp enough that another agent can continue after compaction or resume.
- The goal should make premature completion hard: "done" must require evidence, not intent, elapsed time, or passing unrelated checks.
- The goal should avoid over-prescribing implementation details unless those details are part of the actual requirement.
- The goal should preserve user boundaries: planning-only, no edits, no deploys, no commits, or approval requirements must be explicit when present.
- The final ready-to-paste goal must pass this skill's bundled `scripts/validate_goal_length.js --target-chars 2800 --strict-target` or the deterministic fallback above.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.