gezhi-project-setup
Skill41 starsChanged 4 months agoMITView on GitHub
Use when connecting an existing project to gezhi for a non-expert user. Find the finished thing, create a reliable rebuild command, write gezhi.toml, validate the setup, and run the first safe checks.
- Reads credentials
- Installs packages
In this repository5 other files it gives its agents.
- .codex/AGENTS.mdAGENTS.md
- llms.txtllms.txt
- gezhiSkill
- gezhiSkill
- gezhi-template-authorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
47 rules. About 0 are common, 26 are distinctive, and 21 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈26
Distinctive · estimate
This author's own choices. Worth a look.
21
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 9
Use this skill when a user wants an agent to make an existing project runnable under gezhi, especially when the user can judge the finished …
- Distinctive: line 26
Do not send the user back to read this skill.
- Distinctive: line 48
Do not use this skill for generic task planning, ordinary code review, or a project that has no inspectable thing.
- Distinctive: line 54
Prefer live project evidence over README claims.
- Very specific: line 55
Do not edit raw data, generated outputs, build products, .git/, or .gezhi/ unless the user explicitly asked for that exact operation.
- Distinctive: line 57
Ask the user only when the finished thing cannot be inferred safely.
- Distinctive: line 58
Keep the producer deterministic, idempotent, and easy to rerun.
- Distinctive: line 61
Treat every tok pass as source changes only.
- Distinctive: line 63
If a command fails, preserve the exact failing command and the relevant output in your final report.
- Very specific: line 66
Do not edit unrelated README/docs/tests/source while setting up gezhi unless that file is directly required for the producer or goal config.
- Distinctive: line 73
Start with a cheap command check:
- Very specific: line 79
If gezhi is missing, verify Python 3.11+ and install from GitHub:
- Very specific: line 87
If tik.provider = "api" will be used, install the OpenAI extra:
- Very specific: line 93
If you are inside a checked-out gezhi repository, prefer the local checkout:
- Distinctive: line 99
Verify the command again:
- Distinctive: line 149
If multiple candidates exist, prefer the one mentioned by the user, the one documented as final, or the one downstream of the broadest …
- Very specific: line 152
Do not choose a stale output just because it already exists.
- Distinctive: line 157
If the project does not yet have a final artifact, use the closest inspectable product-shaped target, such as a runnable demo, generated …
- Distinctive: line 167
Use an existing build command when it is already stable:
- Very specific: line 176
When the existing build path is unclear or multi-step, create a wrapper such as scripts/goal_producer.sh or scripts/build_goal_artifact.py.
- Distinctive: line 185
Run the minimal commands needed to rebuild the artifact.
- Distinctive: line 186
Verify the configured artifact exists at the end.
- Distinctive: line 189
Keep command output short but useful for debugging.
- Distinctive: line 190
Avoid network calls unless the project already requires them.
- Distinctive: line 191
Do not mutate raw data or commit files.
- Very specific: line 225
Before writing gezhi.toml, run the producer once if it is safe.
- Very specific: line 233
Use oracle when a deterministic script can decide:
- Very specific: line 241
Use checklist when a project script runs a checklist-style review and should appear as a distinct tik provider:
- Very specific: line 250
Use codex_file when a local Codex artifact review is appropriate and the artifact is a file:
- Very specific: line 261
Use claude_code_file when a local Claude Code artifact review is appropriate and the artifact is a file.
- Very specific: line 271
Use api when OpenAI-compatible Responses API file upload is intended and a Packy/OpenAI-compatible key is available through …
- Very specific: line 283
If this API tik review needs a local skill, set skill = "skill-name" under [tik].
- Very specific: line 312
Use claude_code_goal for the same pass through Claude Code.
- Very specific: line 322
Use codex_app_server when the Codex tok pass should go through codex app-server --stdio and a real app-server thread goal instead of codex …
- Distinctive: line 343
Do not include language that asks a human to approve, clarify, or decide during the runtime loop.
- Very specific: line 347
Use runtime_write_dirs for build outputs, logs, and generated artifacts that commands may refresh.
- Very specific: line 352
Start from gezhi init when no config exists, or edit the existing gezhi.toml carefully.
- Distinctive: line 403
If the user explicitly wants unattended long-horizon work, add perpetual mode with a capability lease.
- Distinctive: line 431
Run these checks from the target project:
- Distinctive: line 438
If using Codex tok:
- Very specific: line 462
If using tik.provider = "oracle" or tik.provider = "checklist", the default doctor run checks the configured command.
- Distinctive: line 474
Run the producer directly once and prove the artifact exists:
- Very specific: line 481
If the producer command is not a wrapper, run that exact configured command and then run test -s on [artifact].path.
- Distinctive: line 484
Run a dry prompt render before the first real heartbeat:
- Distinctive: line 490
Only run a real heartbeat when setup checks pass:
- Distinctive: line 509
Use these rules when setup does not pass on the first attempt:
- Distinctive: line 569
If any required check failed, the final response starts with the blocker and gives the smallest next command to fix it.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
gezhi Project Setup
Use this skill when a user wants an agent to make an existing project runnable
under gezhi, especially when the user can judge the finished thing but does
not want to configure the build loop by hand.
Role in the One-Prompt Flow
llms.txt is the public entrypoint and router. This skill is the execution
runbook. When an agent arrives from llms.txt, inherit the user-facing contract
from that file, then use this skill for the concrete setup decisions:
- inspect the project;
- choose the canonical artifact;
- synthesize or select the producer;
- write
gezhi.toml; - validate the setup;
- report the exact next command.
Do not send the user back to read this skill. The skill is for the agent to execute on the user's behalf.
The deliverable is not just a gezhi.toml. The deliverable is a repeatable
thing loop:
stable rebuild -> finished thing -> review -> bounded source workFor a non-expert user, success means they can run one command after setup and understand what artifact to inspect. Do not leave them with a partial config that only works if they already know the build system.
When to Use
- A user asks to "set up gezhi" for a project.
- A user provides a repository and a desired output such as a PDF, site, workbook, report, model metric, or slide deck.
- A user wants an agent to create the rebuild command and
gezhi.toml. - A user has a finished thing they can inspect but does not know the build system.
Do not use this skill for generic task planning, ordinary code review, or a project that has no inspectable thing.
Operating Rules
- Address the user by name if the host profile supplies one.
- Prefer live project evidence over README claims.
- Do not edit raw data, generated outputs, build products,
.git/, or.gezhi/unless the user explicitly asked for that exact operation. - Ask the user only when the finished thing cannot be inferred safely.
- Keep the producer deterministic, idempotent, and easy to rerun.
- Completion belongs to the rebuilt thing and tik verdict, not to the tok agent's explanation.
- Treat every tok pass as source changes only. Tok must not declare the thing-level goal complete.
- If a command fails, preserve the exact failing command and the relevant output in your final report. Do not describe a setup as ready when validation did not pass.
- Do not edit unrelated README/docs/tests/source while setting up gezhi unless that file is directly required for the producer or goal config.
Workflow
0. Verify gezhi and Required Tools
Start with a cheap command check:
gezhi -hIf gezhi is missing, verify Python 3.11+ and install from GitHub:
python3 --version
python3 -m pip install --upgrade pip
python3 -m pip install "gezhi @ git+https://github.com/SiyaoZheng/GEZHI.git"If tik.provider = "api" will be used, install the OpenAI extra:
python3 -m pip install "gezhi[openai] @ git+https://github.com/SiyaoZheng/GEZHI.git"If you are inside a checked-out gezhi repository, prefer the local checkout:
python3 -m pip install -e '.[openai]'Verify the command again:
gezhi -hFor a normal non-expert setup, do not disable the no-mistakes gate just to make
the first real heartbeat easier. If no-mistakes is missing, either install it
using the project installation docs or report it as the blocker before any real
heartbeat.
1. Inspect the Project
Collect evidence before editing:
pwd
git status --short --branch
rg --files \
-g '!node_modules/**' \
-g '!.git/**' \
-g '!*.jsonl' \
-g '!*.sqlite*' \
| sed -n '1,160p'Look for:
- existing artifacts:
output/,outputs/,dist/,build/,reports/,paper.pdf,slides.pdf,index.html,.xlsx,.parquet, metrics files; - build entrypoints:
Makefile,justfile,package.json,pyproject.toml,requirements.txt,renv.lock,environment.yml,Dockerfile,.github/workflows/,README,scripts/,notebooks/; - source surfaces:
src/,writing/,analysis/,notebooks/,app/,pages/,content/,slides/,tex/; - generated surfaces that tok must not edit.
2. Choose the Canonical Artifact
Pick exactly one artifact path for [artifact].path.
Good artifacts are product-shaped and user-inspectable:
- publication PDF:
outputs/writing/full_paper.pdf; - slide deck:
dist/slides.pdfordist/deck.html; - static site:
dist/index.html; - data report:
reports/final.xlsxorreports/summary.html; - benchmark:
outputs/eval/metrics.json; - package smoke report:
build/goal-smoke.txt.
If multiple candidates exist, prefer the one mentioned by the user, the one documented as final, or the one downstream of the broadest build command.
Do not choose a stale output just because it already exists. The artifact must
be reproducible by [producer].command. If several plausible artifacts remain,
ask one short question that lists the candidates and then proceed from the
answer.
If the project does not yet have a final artifact, use the closest inspectable product-shaped target, such as a runnable demo, generated HTML report, metrics JSON, or a smoke report file. Avoid abstract goals like "improve the codebase" because they cannot be checked by tik.
3. Synthesize the Producer
The producer is the command gezhi will run on every heartbeat. It must
rebuild the finished thing from source.
Use an existing build command when it is already stable:
make allmake papernpm run buildpython3 scripts/orchestrator.py --fullquarto renderRscript scripts/build.R
When the existing build path is unclear or multi-step, create a wrapper such as
scripts/goal_producer.sh or scripts/build_goal_artifact.py. Prefer a shell
wrapper for simple command composition and a Python wrapper only when structured
checks or path handling matter.
Producer wrapper requirements:
set -euo pipefailfor shell wrappers.- Resolve paths from the project root.
- Run the minimal commands needed to rebuild the artifact.
- Verify the configured artifact exists at the end.
- Print artifact path, size, modification time, and sha256 when available.
- Exit non-zero if the artifact is missing or empty.
- Keep command output short but useful for debugging.
- Avoid network calls unless the project already requires them.
- Do not mutate raw data or commit files.
Example scripts/goal_producer.sh:
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
make all
artifact="output/full_paper.pdf"
test -s "$artifact"
if command -v shasum >/dev/null 2>&1; then
shasum -a 256 "$artifact"
fi
ls -lh "$artifact"Make it executable:
chmod +x scripts/goal_producer.shThen set:
[producer]
command = "scripts/goal_producer.sh"Before writing gezhi.toml, run the producer once if it is safe. If it fails,
fix the producer path or report the exact blocker instead of continuing with an
untested command.
4. Configure Tik
Choose the smallest evaluator that can reject bad artifacts.
Use oracle when a deterministic script can decide:
[tik]
provider = "oracle"
command = "python3 scripts/tik.py"Use checklist when a project script runs a checklist-style review and should
appear as a distinct tik provider:
[tik]
provider = "checklist"
command = "python3 scripts/checklist_review.py"Use codex_file when a local Codex artifact review is appropriate and the
artifact is a file:
[tik]
provider = "codex_file"
timeout_seconds = 1800
max_file_size_bytes = 25000000
max_output_tokens = 4096Use claude_code_file when a local Claude Code artifact review is appropriate
and the artifact is a file; it needs the claude CLI on PATH:
[tik]
provider = "claude_code_file"
timeout_seconds = 1800
max_file_size_bytes = 25000000Use api when OpenAI-compatible Responses API file upload is intended and a
Packy/OpenAI-compatible key is available through PACKYAPI_API_KEY,
PACKYCODE_CODEX_KEY, OPENAI_API_KEY, or ~/.config/gezhi/api.env.
This defaults to PackyAPI claude-fable-5:
[tik]
provider = "api"
timeout_seconds = 1800
store = falseIf this API tik review needs a local skill, set skill = "skill-name" under
[tik]; do not put /skill-name as the first prompt line for api.
Tik prompts must review the artifact, not the source diff. They must end with a JSON verdict that includes at least:
{
"artifact_ready": false
}For non-expert setup, prefer deterministic checks when they clearly catch missing, empty, malformed, or stale artifacts. Use model review only for quality judgments that a script cannot express.
5. Configure Tok
Tok's successful changes must show up under source write_dirs. Keep that
audited source scope narrow and exclude generated output:
[tok]
provider = "codex_goal"
sandbox = "workspace-write"
write_dirs = ["src", "writing"]
codex_features = ["goals"]Use claude_code_goal for the same pass through Claude Code; it needs the
claude CLI on PATH and ignores codex_features:
[tok]
provider = "claude_code_goal"
sandbox = "workspace-write"
write_dirs = ["src", "writing"]Use codex_app_server when the Codex tok pass should go through
codex app-server --stdio and a real app-server thread goal instead of
codex exec:
[tok]
provider = "codex_app_server"
sandbox = "workspace-write"
write_dirs = ["src", "writing"]Tok prompt template should say:
- what standard the artifact must meet;
- that the artifact is produced by
{producer_command}; - that
{tik_review_path}is the standard to meet; - that tok must make source changes so the next rebuilt artifact answers the tik review's blocking objections;
- which source directories count as the audited source-change scope;
- which outputs, data, logs, and generated files are off limits.
Do not include language that asks a human to approve, clarify, or decide during the runtime loop.
Set run_cwd = "." when the tok pass may need to run project-level commands.
Use runtime_write_dirs for build outputs, logs, and generated artifacts that
commands may refresh. Do not put those generated directories in write_dirs.
6. Write gezhi.toml
Start from gezhi init when no config exists, or edit the existing
gezhi.toml carefully.
Minimum shape:
name = "artifact-goal"
state_dir = ".gezhi"
runs_dir = ".gezhi/runs"
[artifact]
path = "output/artifact.pdf"
copy_as = "artifact.pdf"
[producer]
command = "scripts/goal_producer.sh"
[tik]
provider = "codex_file"
timeout_seconds = 1800
max_file_size_bytes = 25000000
max_output_tokens = 4096
[tik.verdict]
ready_field = "artifact_ready"
required_fields = ["artifact_ready"]
[tok]
provider = "codex_goal"
sandbox = "workspace-write"
write_dirs = ["src"]
run_cwd = "."
runtime_write_dirs = ["output", "build", "logs"]
codex_features = ["goals"]
[no_mistakes]
enabled = true
binary = "no-mistakes"
mode = "lightspeed"
[safety]
generated_dirs = ["output", "build", "dist"]
max_blocker_repeats = 3Also include [tik.prompt] and [tok.prompt] sections. Use only placeholders
documented in docs/config-schema.md, and keep runtime prompts closed-system:
they may refer to the artifact, producer, tik ledger, source boundaries, and
operational impossibilities, but not to asking a person for approval or
clarification during the loop.
If the user explicitly wants unattended long-horizon work, add perpetual mode with a capability lease. Keep the substantive goal fixed, keep the lease narrow, and include only the source and generated artifact paths that the loop is allowed to mutate:
[perpetual]
enabled = true
substantive_goal = "Resolve the fixed substantive objections in the artifact."
[lease]
version = "artifact-lease-v1"
allow_shell = true
allow_network = false
[[lease.rules]]
effect = "allow"
operations = ["create", "modify", "delete", "rename"]
paths = ["src/**", "writing/**"]
[[lease.rules]]
effect = "allow"
operations = ["create", "modify"]
paths = ["output/artifact.pdf"]7. Validate Before Running
Run these checks from the target project:
gezhi validate
gezhi doctorIf using Codex tok:
gezhi doctor --smoke-codex-goalIf using tok.provider = "codex_app_server":
gezhi doctor --smoke-codex-app-serverIf using tik.provider = "codex_file":
gezhi doctor --smoke-codex-goal --smoke-codex-file-tikIf using tik.provider = "claude_code_file":
gezhi doctor --smoke-claude-code-file-tikIf using tik.provider = "oracle" or tik.provider = "checklist", the default
doctor run checks the configured command.
If using tok.provider = "claude_code_goal":
gezhi doctor --smoke-claude-code-goalCombine the smoke flags that match the configured providers; the all-Claude
stack is --smoke-claude-code-goal --smoke-claude-code-file-tik.
Run the producer directly once and prove the artifact exists:
scripts/goal_producer.sh
test -s path/to/artifactIf the producer command is not a wrapper, run that exact configured command and
then run test -s on [artifact].path.
Run a dry prompt render before the first real heartbeat:
gezhi run --dry-runOnly run a real heartbeat when setup checks pass:
gezhi run --max-minutes 600
gezhi stateFor unattended progress, install the system-level heartbeat instead of leaving
a foreground loop running. Omit --every-minutes unless the project needs a
fixed timer; gezhi defaults to a 5-minute wake-up for perpetual goals and a
30-minute wake-up for legacy goals:
gezhi heartbeat install --max-minutes 600
gezhi heartbeat status8. Recovery Rules
Use these rules when setup does not pass on the first attempt:
gezhi validatefails: fix the config shape, placeholders, write scopes, or forbidden runtime prompt language before any other check.gezhi doctorfails on a missing command: install the missing tool only when that is clearly in scope; otherwise report the exact missing command.- producer fails: repair the producer command or wrapper first; do not proceed to tik/tok.
- artifact missing or empty: fix the producer or artifact path; do not lower the standard.
- Provider smoke checks fail: report the exact smoke check failure and leave the next command as a setup repair command, not a heartbeat.
- no-mistakes missing: install it or report it; do not silently set
[no_mistakes].enabled = falsefor a normal user setup.
Common Recipes
Research PDF
- Artifact:
output/full_paper.pdf. - Producer:
make allorpython3 scripts/orchestrator.py --full. - Tik:
codex_fileorclaude_code_filewith a journal-review prompt, or deterministic PDF checks. - Tok write dirs:
writing,src,tables,figuresif these are source. - Generated dirs:
output,build,cache.
Static Web App
- Artifact:
dist/index.htmlplus any build manifest. - Producer:
npm run build. - Tik: oracle smoke test if Playwright tests exist; otherwise
codex_fileorclaude_code_fileon a generated report file. - Tok write dirs:
src,app,components,pages,publiconly when source assets live there. - Generated dirs:
dist,build,.next,coverage.
Data Report
- Artifact:
reports/final.html,reports/final.pdf, orreports/final.xlsx. - Producer: project script that rebuilds report from committed inputs.
- Tik: deterministic schema and reconciliation checks where possible.
- Tok write dirs: analysis scripts and report source.
- Generated dirs: report outputs and caches.
Definition of Done
- The finished thing is named and exists after the producer runs.
- The producer is a stable command or wrapper checked into the project.
gezhi.tomlpoints at the producer and artifact.tok.write_dirsare narrow source directories and the runtime can audit source changes there.safety.generated_dirsprotects build outputs.gezhi validatepasses.gezhi doctorreports the configured static setup as ready or the remaining blocker is documented with exact output.- Optional provider smoke checks pass when their providers are configured.
- The final response to the user names the artifact, producer command,
verifier used, writable scopes, and exact next command. If unattended progress
is appropriate, the next command should be
gezhi heartbeat install ...; otherwise it should be one manualgezhi run .... - If any required check failed, the final response starts with the blocker and gives the smallest next command to fix it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

