The Go build of the noskills CLI (M4-T2, decision-25). It runs the agent hooks,
the spec lifecycle (TASK-258), the state commands and sync adapters (TASK-259),
sessions, the user identity and diagrams (TASK-259.1), the spec state commands
and the output formats (TASK-258.1) and run (TASK-260) itself, and hands
watch, manager and web to the TypeScript noskills CLI until M5 ports them
(TASK-266).
A hook starts the binary for every guarded tool call. The Go build answers a
PreToolUse call in about 4 ms on an Apple M-series laptop
(BenchmarkHookStartup), where the TypeScript hook takes about 125 ms under
Node and more through npx, which can also wait on the npm registry.
make build # bin/noskills, with the version from VERSION
bin/noskills --help
go test -run '^$' -bench HookStartup ./cmd/noskills/noskills invoke-hook <event> is the port of commands/invoke-hook.ts, on
pkg/ajan/noskillsfx:
pre-tool-userefuses changes to the noskills section of.eser/manifest.ymland to.eser/.state/bin/, runs the git guard on shell commands, and gates file edits by the phase of the spec or session. It reads the payloads of Claude Code, Codex, Copilot CLI, Kiro and the OpenCode plugin and answers each in its own form; a denial exits with code 2.stoprecords an iteration in EXECUTING, unlessnoskills runholds the turn, and prints the restart notice atmaxIterationsBeforeRestart.post-file-write,post-bashandpost-ask-user-questionwritefiles-changed.jsonl,noskills-calls.jsonland the ask token.session-startwrites the git wrapper and prints the instruction the Go compiler gives for the current phase.git-exec <git arguments>is the check behind the git wrapper; a refusal exits with code 3.
An event the binary does not know answers nothing and exits 0, as the TypeScript
dispatcher does. The golden harness in pkg/ajan/noskillsfx/golden replays the
recordings of the TypeScript CLI against this binary, and
pkg/ajan/noskillsfx/hook_parity_test.go replays the answers of the TypeScript
predicates for a corpus of commands.
These commands run in Go, on the lifecycle functions of pkg/ajan/noskillsfx
that noskills-server and the FFI bridge call too. Their JSON is the TypeScript
CLI's, byte for byte, and they leave the same files:
init: detects the project, asks for concerns and coding tools on a terminal (--concerns=,--tools=,--non-interactiveand--agentskip the prompts), and writes.eser/, the noskills section of.eser/manifest.ymland the concern files, then syncs the files of the chosen coding tools (see below).--non-interactiveskips the questions in the human mode too.spec new,spec list, andspec <name>withnext,approve,doneandfollowup;spec <name>alone prints its status.spec --helpprints the subcommands.next,status,approveanddone, with--spec=<name>.nexttakes--answer=,--agentand--human. The discovery base questions are asked together and the follow-ups one at a time (TASK-166). Thesplitanswer of a refinement splits the spec asspec <name> splitdoes.next --validateand a manifestvalidateentry run in Go too: at the end of discovery and at the spec proposal the second agent runs on the aifx provider the entry names (claude-code, anthropic, openai, gemini, vertexai, ollama, opencode or kiro), in an empty temporary directory, and its result is stored in.eser/.state/progresses/validations/<spec>.jsonand repeated while the input stays the same;--validateruns it again. An unusable entry or an unknown agent gives a skipped validation with the TypeScript messages.
The spec state commands (TASK-258.1) run in Go as well, at the top level with
--spec=<name> or as spec <name> <command>:
block "reason",reset,cancel,wontfix "reason"andreopen.cancelandwontfixkeep COMPLETED in the spec's own state file, returnstate.jsonto IDLE, set the status ofspec.mdandprogress.jsonand append aphase-changeevent to.eser/.state/events/events.jsonl.resetworks from EXECUTING, BLOCKED and COMPLETED, and clears the spec's state but not its files.spec <name> review [--question=<n> --answer="text"]andspec <name> delegate <questionId> <userName>, with theirdelegation-answeredanddelegation-createdevents;approverefuses while a delegation is pending.spec <name> split [--into <name> "description"]...,revisit "reason",ac,taskandnote(add "text"orlist), andplan-export, which writes.claude/plan.md.spec <name> section [list]prints the sections the completeness gate checks, andsection <id> fill "text"orsection <id> na "reason"resolves one in DISCOVERY or DISCOVERY_REFINEMENT (TASK-325): the text goes intospec.mdand the placeholder in the spec's state file, and instate.jsonwhen it names the spec. An N/A reason needs 20 characters, as the gate does.validate <spec>prints the completeness report and exits 1 while sections or decisions are open;freeprints the idle-mode note.
-o json (the default), -o markdown and -o text work for every command that
takes them: next and ledger print through the renderers of
output/formatter.ts, and status and spec list print their status lines. A
legacy .eser/ layout (.eser/.state/state.json, .eser/.sessions/,
.eser/.events/) moves into .eser/.state/{progresses,sessions,events}/ with a
notice on stderr, and init writes the commented .eser/.gitignore.
Where Go and TypeScript differ:
- An error the TypeScript CLI throws without catching (an answer under 20
characters, a premise answer that is not JSON, an approval the completeness
gate refuses) prints its stack trace and exits 1 there; the binary prints
noskills: <message>on stderr and exits 1. - A spec name with a path separator is refused instead of writing outside
.eser/specs/. initkeeps the other sections of.eser/manifest.ymlas they are and rewrites only the noskills section; the TypeScript CLI re-serializes the whole file.freeandvalidatename the command the manifest sets; the TypeScript commands always name the defaultnpx eser@latest noskills.- A legacy layout moves at the start of every lifecycle and spec state command
but
free,validate,spec listandspec --help, and whileinitscaffolds.eser/. The TypeScript CLI moves it on the first read ofstate.json, which some commands never make, and the TypeScript hooks move it too; the Go hooks do not. - The validator reads the spec document inside the project root, so a state whose spec path leaves it gets a skipped validation; a provider error reads "returned an error" and a model that cannot be created reads "call failed", with aifx's messages. noskills-server and the FFI bridge do not run the validator.
The golden scenarios lifecycle, lifecycle_concerns, spec_new,
init_tools, init_bare, spec_states, spec_execution, spec_split_answer,
legacy_layout and next_validation in pkg/ajan/noskillsfx/golden replay
recordings of the TypeScript CLI against the binary with
NOSKILLS_NO_FORWARD=1; cmd/noskills/next_validation_test.go runs a reviewed
validation against a fake aifx provider.
noskills run [--spec=<name>] [--unattended] [--max-iterations=N] [--max-turns=N]
is the port of commands/run.ts. It starts from SPEC_APPROVED (moving the spec
to EXECUTING) or EXECUTING, and each iteration reads state.json again: it
stops with 0 on COMPLETED, asks for a resolution on BLOCKED (--unattended
appends the reason to blocked.log and exits 1), and otherwise runs one agent
turn. The turn goes through the aifx claude-code provider, which starts the
claude CLI over ACP (pkg/ajan/acpfx and its shim) in the project directory,
with the prompt the Go compiler builds for a headless turn on stdin. The loop
records the iteration when the turn returns and claims the turn first
(execution.driver and driverPid), so the Stop hook inside the agent does not
record it again. While allowGit is false the git wrapper is first on the
agent's PATH, and autoCommit: true commits after each turn with the real git.
After --max-iterations (50) iterations it exits 2.
The agent's text and the names of the tools it calls stream to stdout as they arrive, indented four spaces, with control characters removed. Ctrl-C cancels the turn: the agent process is killed, the turn is not recorded, the claim is released, PATH is restored, and the command exits 130.
Where Go and TypeScript differ:
- The TypeScript loop prints nothing of the agent's turn, and Ctrl-C ends it without releasing the claim; the Stop hook ignores a claim whose process is gone.
- The claim, the start of execution, a BLOCKED resolution and each recorded
iteration are written to the spec's own state file as well as
state.json. The TypeScript loop writes onlystate.json, which the agent's nextspec <name> nextorblockoverwrites from the spec's file, losing the claim and the recorded count. - A turn is recorded only while the spec is still EXECUTING, as the Stop hook does; the TypeScript loop also records a turn that blocked or finished the spec.
- A spec the agent finished with
spec <name> doneends the loop with "Spec completed!" and 0.doneleavesstate.jsonIDLE, and the TypeScript loop stops there with "Unexpected phase: IDLE" and 1. - Exit code 2 means the loop ran out of iterations. The TypeScript loop also returns 2 when its last allowed iteration stopped for another reason.
- The BLOCKED resolution is a one-line prompt, and
run --helpprints the usage instead of starting the loop.
cmd/noskills/run_test.go runs the loop against a fake aifx provider factory,
and run_binary_test.go runs the built binary against a fake claude on PATH,
SIGINT included. With NOSKILLS_RUN_PARITY=1 and node on PATH, it also runs the
TypeScript CLI on the same fixture and compares the output and the files. The
prompt is compared with the TypeScript one in
pkg/ajan/noskillsfx/lifecycle_run_test.go.
The sync adapters of pkg/@eserstack/noskills/sync are ported to
pkg/ajan/noskillsfx (sync_*.go) and write the same bytes: CLAUDE.md, the
Claude Code hooks and agents; .cursorrules, .windsurfrules and
.github/copilot-instructions.md; the Kiro steering files, hooks, agents, spec
copies and MCP config; the AGENTS.md section, the OpenCode plugin, agents,
skills and MCP config; the Codex hooks, agents and MCP table; the Copilot CLI
hooks, agents and MCP config. They keep the user's own content in the files they
share (the marked sections, other hooks, other MCP servers, other TOML tables).
initandsync(which says it was merged into init and runs it) sync the tools themselves; nothing runs the TypeScript CLI any more.purgemoves each category (concerns, specs, rules, the manifest's noskills section, the agent integration) into.eser/.state/purge-history/<entry>/, keeps the newest 5 entries, and with--no-historydeletes instead. Without--forceit asks per category; in agent mode it needs--force.purge restore [entry_id|latest] [category ...] [--overwrite]lists the history, or restores the chosen categories (TASK-167): content that exists is left alone unless--overwriteis given, and the agent integration comes back through the sync. In a terminal it asks which entry and categories.ledger <spec>andspec <name> ledgerprint the decision ledger and summary (--format=measurement-draftfor the measurement draft).learn(list,remove <n>,promote <n>) andspec <name> learn "text"(--rule,--type=,--severity=).rule add | list | promote,concern add | remove | list [--json].pack list | install | uninstall | inspect | search, with the built-in packs embedded fromdefaults/packsand remote packs fromraw.githubusercontent.com;searchreads thepackRegistryURL of the manifest.
The built-in concerns and packs are embedded with go:embed from
pkg/ajan/noskillsfx/defaults; tests keep them equal, byte for byte, to
pkg/@eserstack/noskills/defaults. pkg/ajan/noskillsfx/golden compares every
adapter's files with the TypeScript sync's for fixture projects
(sync_adapters_test.go) and replays the state_commands, purge_selective,
init_active_spec, purge_restore and sync recordings.
Where Go and TypeScript differ here:
learn listprints each learning's icon and[type]; the TypeScript command prints[object Object]for both.rule,concern,packandledgername the command the manifest sets in their messages; the TypeScript commands always name the defaultnpx eser@latest noskills.purgemoves the noskills section of.eser/manifest.ymlas text and leaves the rest of the file as written; the TypeScript CLI prints the whole file again through its YAML library. A manifest the YAML reader refuses gets that reader's message.- A remote pack whose name, rule, concern id or folder rule would write outside
.eser/rules/,.eser/concerns/or the project is refused (throughos.Rootfor the folder rules), and each fetched file is read up to 1 MiB.pack uninstallremoves only files inside those folders. pack searchrefuses, when it dials, a registry host whose address is internal, so a host name that resolves to one is refused too.ledgerwith a spec name that holds a path separator reads nothing.- A
.claude/settings.jsonoropencode.jsonthat holds JSONnull, or a manifest without atoolslist, counts as empty; the TypeScript CLI throws. - Failure messages that quote the file system read as Go's, not Node's.
These run in Go, on pkg/ajan/noskillsfx (session.go, identity.go,
diagrams.go):
session start --spec=<name> | --free | --autowrites.eser/.state/sessions/<id>.jsonwith the TypeScript record:specandphasearenullin free mode, and--autobinds the one active spec or starts a free session. The three flags exclude each other, and--spec=needs a name.pidis 0, for no owning process:session startexits as soon as it prints the export lines, so its own pid would name a dead process.session list,session end [--id=](orNOSKILLS_SESSION; exit 1 when there is no such session) andsession gc(idle for more than two hours) work on those files. A session whoselastActiveAtis not a date lists asunknownand counts as stale.nextwithNOSKILLS_SESSIONset rewrites the session's phase andlastActiveAtand keeps every other field,pidandstartedAtincluded.config set-user --name= --email= | --from-git,config get-userandconfig clear-usermanageuser.jsonin$XDG_CONFIG_HOME/eser/noskills, or~/.config/eser/noskillsfromHOME(orUSERPROFILE) when the variable is unset or empty; with none of them set, writing or removing it fails.user.jsonis written with mode 0600 in a 0700 directory. Every answer, transition, approval and spec creation is attributed through the sameResolveUserWith:user.json, then git'suser.nameanduser.email, then "Unknown User".diagrams scan | list | check | verify <file> [--line=N]keep the registry in.eser/diagrams.json: the mermaid blocks and box drawings of every markdown file outside dot folders andnode_modules, and the.pumlfiles at the top level.scanneeds an initialized project. A box drawing is one entry, and a file path such assrc/login.tsis not also taken as the modulesrc/login. A diagram that names a file inexecution.modifiedFilesis stale, once however many of its files changed, andnextin COMPLETED reports it withstaleDiagramsBlocking.
The golden scenarios sessions, user_identity and diagrams replay
recordings of the TypeScript CLI; the harness replaces the random session ids
with numbered placeholders and gives each run its own HOME, so no test reads
or writes the real ~/.config.
Where Go and TypeScript differ here:
- A registry or session that cannot be written prints
noskills: <message>and exits 1; the TypeScript CLI throws. - The git identity lookup gives up after 10 seconds.
- The diagram scan reads through
os.Rootand lists directories in name order: a symlinked file or folder is not followed, as the TypeScript scan does not follow it either, and nothing outside the project can be read. A registry that is not a JSON list reads as empty.
watch (the read-only live dashboard, -o json or -o markdown), manager
(mgr) and web stay in the TypeScript CLI until M5 (TASK-266). They, and any
other first word, including flags before a command, go to the TypeScript CLI
with their arguments as given, found in this order:
NOSKILLS_TS_CLI, a command line split on whitespace, such asnode /path/to/pkg/@eserstack/noskills/main.ts;NOSKILLS_TS_BUNDLE, the entry point of the TypeScript CLI that the npmnoskillslauncher sets (dist/main.jsof its dependency@eserstack/noskills), run with thenodeon PATH;npx --yes noskills@<version>.
The npm noskills package is the launcher of this binary (TASK-261), so step 3
runs the binary again, with NOSKILLS_TS_BUNDLE set this time. The npx run gets
NOSKILLS_VIA_NPX=1, and a binary that finds it set does not take step 3 again,
so a launcher that sets no entry point cannot start a loop. A noskills in
ESER_PLUGIN_PATH is not looked at: the eser npm launcher points that variable
at the noskills launcher, which runs this binary too.
NOSKILLS_NO_FORWARD=1 turns this off, so a test can show that a command ran in
Go.
The forwarded CLI gets NOSKILLS_CLI_PREFIX set to the command that runs this
binary: noskills when that name on PATH is this file, its absolute path
otherwise. noskills init, which runs in Go, writes the same command into the
manifest, so every hook and the git wrapper it generates call the Go binary
instead of npx eser@latest noskills. A project initialized with the npx
command switches when noskills init runs again through the binary. A
NOSKILLS_CLI_PREFIX you set yourself stays as it is.
Hooks written by v4.5.x call npx eser@latest noskills invoke-hook .... The
eser launcher of M3-T11 (TASK-254) forwards them to a noskills on PATH or in
ESER_PLUGIN_PATH, and npx noskills runs the npm launcher of this binary, so
they reach this binary either way.
Every channel installs this binary (TASK-261):
install.shandinstall.ps1(-Product noskills), Homebrew (brew install eser/tap/noskills) and the release archivesnoskills-v<version>-<triple>, whicheser codebase dist compilebuilds and which installed v4.5.x noskills binaries self-update to;- Nix:
nix build .#noskillsbuilds it from source withbuildGoModule(vendorHashis kept byeser codebase dist nix-vendor-hash); - npm:
npm i -g noskillsornpx noskillsinstalls the launcher, which runs the binary of the optional dependency@eserstack/noskills-<platform>for darwin-arm64, darwin-x64, linux-arm64, linux-x64 or win32-x64, and fails with the list of those on another platform. A binary installed without its execute bits gets them from the launcher before it runs; when the install is read-only, the launcher names the binary and thechmod +xcommand to run.
cmd/noskills/install_dry_run_test.go installs it with install.sh, install.ps1
and the Homebrew formula from a local release.
- noskills: the TypeScript CLI and how its hooks work
- ajan/noskillsfx: the Go port the hooks run on
- ajan/clifx: the command tree and help