Overview/Features
What is in the framework
Each capability below names the module that implements it, where a
single module owns the behaviour, and the table or dataset that pins it.
Counts come from the repository at version 0.1.0. The skill, agent,
rule, command and eval-case counts are re-checked by
scripts/validate-repo.py; the test count is reported by the
suite itself, so read it from a test run.
Classification
Every request is read before anything else happens. The classifier returns an intent, a complexity band, a priority, an output shape, a workflow tier, and the evidence behind each decision.
$ zyrompts classify "refactor the payment module into services"
{
"intent": "refactor",
"complexity": "moderate",
"workflow": "planned",
"flags": ["ambiguous"],
"ambiguities": ["no acceptance criteria stated for a non-trivial change"],
"signals": [
{ "dimension": "complexity", "value": "security-sensitive surface",
"confidence": 0.6, "evidence": "cue 'payment'" },
{ "dimension": "complexity", "value": "terse but wide scope",
"confidence": 0.7, "evidence": "6 words, wide-scope cue retained" }
]
}
Two rules exist because the first version of the classifier got them wrong. A terse request with wide scope is terse, not trivial. A code-changing request with no concrete target is underspecified, not a one-line edit. Both are pinned by the classification suite.
| Request | Intent | Complexity | Tier |
|---|---|---|---|
hi | unknown | trivial | DIRECT |
fix TypeError in src/components/Map.tsx | fix | trivial | DIRECT |
fix the bug | fix | trivial | LIGHT |
refactor the payment module into services | refactor | moderate | PLANNED |
migrate the monolith to microservices | build | large | FULL |
Workflow lifecycle
Thirteen phases, in order. Each has a gate, and a phase that fails its gate blocks the workflow rather than letting it advance.
INTAKE -> CLARIFY -> RESEARCH -> SPECIFY -> PLAN -> CRITIQUE -> APPROVE
-> IMPLEMENT -> REVIEW -> FIX -> VERIFY -> ARCHIVE -> DONE
Four tiers select a prefix of that chain. The tier is a floor, never a ceiling: the classifier raises it on evidence and never lowers a heavier one that the evidence supports.
| Tier | Phases | Count | Selected when |
|---|---|---|---|
DIRECT | INTAKE, DONE | 2 | trivial ask, or a question about code |
LIGHT | INTAKE, IMPLEMENT, VERIFY, DONE | 4 | small, contained change |
PLANNED | adds CLARIFY, SPECIFY, PLAN, CRITIQUE, APPROVE, REVIEW | 10 | moderate build or refactor |
FULL | all thirteen | 13 | large, wide, or architectural |
Revision loops are bounded. A critique that keeps failing cannot spin:
the loop stops at its cap and hands back to a human. A block records
resume_at, so the state file says exactly where work
stopped.
Policy and permissions
The engine answers one question per tool call: given this tool, these arguments and this autonomy level, is the call allowed, denied, or does it need confirmation?
| Level | Read tools | Safe mutations | File writes |
|---|---|---|---|
read-only | allow | ask | deny |
ask (default) | allow | ask | ask |
auto | allow | allow | allow |
yolo | allow | allow | allow |
Read-only denies writes outright rather than asking, because asking implies yes is a valid answer, and one approval would negotiate the level away. Unknown tools are treated as mutating: fail closed.
$ zyrompts policy "rm -rf /" --autonomy yolo
{
"decision": "deny",
"reason": "hard denial 'root-delete': 'rm -rf /' is never allowed",
"rule": "hard-deny:root-delete"
}
$ zyrompts policy "ls -la" --autonomy yolo
{
"decision": "allow",
"reason": "read-only command",
"rule": "readonly-command"
}
Nine hard-deny rules, a protected-path table, workspace containment and a secret redactor run before any autonomy band is consulted. The security page lists them in full.
Hook engine
One dispatcher serves every event. A capability is a JSON file, not a script, so adding a nudge needs no Python change.
| Event | Rules | What they do |
|---|---|---|
UserPromptSubmit | intake, research-first, scope-discipline, output-readability, decision-routing | classify the request, then nudge on evidence, scope, format and routing |
PreToolUse | bash-safety, background-exec, write-scope | inject the policy verdict and the path boundary before a tool runs |
SessionStart | decorum, memory-recall | load the behaviour policy and prior project state |
Stop | verify-completion | check a completion claim against evidence in the transcript |
SubagentStart | subagent-routing, agent-boundary | route work to a role and enforce the independence boundary |
A rule is validated against a capability matrix before it runs. A bad regex, an unknown event or a handler that is not on the allowlist is a load-time skip with a note, never a crash. The dispatcher exits 0 on every path, because a hook that crashes blocks the user's prompt.
{
"id": "research-first",
"event": "UserPromptSubmit",
"priority": 10,
"criteria": { "match": ["\\b(best practice|state of the art)\\b"] },
"action": {
"type": "inject_context",
"text": ["Check the primary source before asserting. Cite the URL and date."]
}
}
Skill library
Seventeen canonical skills. Each carries purpose, activation
conditions, inputs and outputs, procedure, required tools, examples,
failure handling, evaluation cases, version and machine-readable
dependencies. zyrompts validate fails on an unknown
dependency or a cycle.
| Skill | Use it when | Depends on |
|---|---|---|
prompt-improver | a request is underspecified and would need a correction round-trip | none |
prompt-engineering | writing or adapting a prompt for a specific model family | none |
brainstorm | a goal exists but no approach is decided | optional: clarify |
clarify | a real fork, a contradiction, or a missing requirement | none |
research | the answer depends on facts you do not have | none |
specify | a non-trivial feature has no written definition of done | clarify |
plan | before any non-trivial change | specify |
critique | a plan exists and has not been attacked yet | plan |
cycle | draft, critique and merge in one bounded pass | plan, critique |
execute | a plan is approved | plan, critique |
tdd | a test suite exists and the change has observable behavior | execute |
debugging | something fails and the cause is not known | none |
refactor | behavior must stay identical while structure changes | optional: tdd |
code-review | a diff needs an independent read | execute |
security-review | code handles untrusted input, auth, secrets, files or the network | code-review |
verify | before claiming a change works | execute, code-review |
archive | work ends, pauses, or is handed over | verify |
Agent roles
Thirteen roles declared as data: capability tier, tools, whether the role is read-only, its attempt cap, what it produces, and whose output it may review. The orchestrator uses that data to schedule work.
| Role | Tier | Writes | May review | Produces |
|---|---|---|---|---|
researcher | fast | no | - | research report with sources |
prompt-engineer | standard | no | - | improved prompt with before/after score |
planner | frontier | no | - | plan.md |
architect | frontier | no | - | decision with alternatives |
critic | frontier | no | planner, architect | critique with graded findings |
developer | standard | yes | - | code changes with test evidence |
debugger | standard | no | - | root cause with reproduction |
tester | standard | yes | developer | test suite and run output |
code-reviewer | frontier | no | developer, tester | findings ranked by severity |
security-reviewer | frontier | no | developer | security findings with severity and fix |
documentation | fast | yes | - | docs update |
performance | standard | no | - | measurement and proposal |
verifier | frontier | no | developer, tester, code-reviewer | acceptance matrix with evidence |
The registry routes by capability class, not by product name. A role asks for a frontier, standard or fast model; which model fills that slot is the operator's decision.
Platform adapters
An adapter is a pure function from the skill list to a set of files. No
clock, no network, no environment. That is what makes
generate-adapters.py --check meaningful in CI.
| Platform | Per-skill file | Manifest | Hook engine |
|---|---|---|---|
| Claude Code | skills/<name>/SKILL.md | plugin.json, hooks.json | yes |
| Gemini | .gemini/skills/zy-<slug>/SKILL.md | skills.json | no |
| Copilot | .github/skills/zy-<slug>/SKILL.md | plugin.json | no |
| Codex | AGENTS.md index | - | no |
| OpenCode | .opencode/agent/zy-<slug>.md | - | no |
The zy- prefix applies where a platform namespace is flat
and a bare execute would collide with a built-in skill.
The architecture page covers
what each renderer drops and why.
Prompt engineering
A deterministic score from 0 to 100, attributed point by point across seven components: task clarity, target context, output format, constraints, success criteria, scope boundaries and examples. The rewrite uses the score to prove it improved the prompt.
$ zyrompts score "fix the bug"
{
"total": 20,
"max_total": 100,
"grade": "F",
"components": {
"task_clarity": 20, "target_context": 0, "output_format": 0,
"constraints": 0, "success_criteria": 0, "scope_boundaries": 0,
"examples": 0
},
"missing": [
"name the file, symbol, error, or source the task applies to",
"specify the output format and length",
"state what must and must not happen",
"add a checkable success criterion (done when ...)",
"bound the scope: which files or modules may change"
],
"not_applicable": []
}
The frameworks (RTF, CO-STAR, RISEN, CRISPE, few-shot) are data, not prose, so the right one can be selected from the classification rather than from taste. Model guidance routes on capability class, so it does not rot when a version number changes.
Independent review
Deterministic critique of plans, specifications and diffs. A finding is reported only after a refutation attempt, and carries a confidence grade: CONFIRMED when the check proves it, UNVERIFIED when it does not.
# Plan
## Chapter 1 - Middleware
Add rate limiting to src/middleware/rate.ts.
# Review: plan
Verdict: BLOCK
Findings: 3 surviving, 0 refuted (3 CONFIRMED, 0 UNVERIFIED)
## Chapter 1 missing Affected files
Severity: medium
Confidence: CONFIRMED
'Chapter 1 - Middleware' does not state its affected files.
Evidence: heading 'Chapter 1 - Middleware' has no 'Affected files' section
Suggestion: Add a 'Affected files:' block naming the files and how success is proven.
## Chapter 1 missing Verification
Severity: medium
Confidence: CONFIRMED
'Chapter 1 - Middleware' does not state its verification.
Evidence: heading 'Chapter 1 - Middleware' has no 'Verification' section
Suggestion: Add a 'Verification:' block naming the files and how success is proven.
## Chapter 1 references a missing file
Severity: high
Confidence: CONFIRMED
'Chapter 1 - Middleware' names src/middleware/rate.ts, which does not exist.
Evidence: path 'src/middleware/rate.ts' not found in the working tree
Suggestion: Confirm the path or mark it as a file to be created.
Structural headings such as Context, Rollback and Open questions are not graded as chapters. That distinction is a real defect the templates found when the plan template failed its own critique.
Eval harness
Four suites, 101 labelled cases. Each case states the intended behavior, so a change that helps one suite and hurts another shows up as a number instead of an argument.
| Suite | Cases | Measures |
|---|---|---|
classification | 25 | intent, complexity and tier against labelled requests |
injection | 18 | instruction-like text detection and the resulting tier drop |
policy | 46 | decision and rule id for commands, paths and autonomy levels |
prompt_score | 12 | score bands and the components each prompt is missing |
One failing case does not stop the suite. Datasets accept
# comments, so a case can explain why it exists next to
the expectation.
State and telemetry
Project state is one JSON document under
.zyrompts/state/project.json, written atomically with a
temporary file and a rename, so a crash mid-write cannot corrupt the
only copy. Every mutation appends to an event log, which makes history
auditable after the fact.
The state file carries a schema version. Loading a newer version raises rather than silently dropping fields the running code does not understand.
Telemetry records cost, duration and tool calls as JSONL. It is local only: nothing phones home, and a crashed run still leaves a usable log.
Command line
Thirteen commands. Each is scriptable without a model, and each sets an exit code, so any of them can be a CI gate.
| Command | What it does | Exit code |
|---|---|---|
classify | intent, complexity, tier and signals for a prompt | 0 |
score | prompt quality 0-100 with missing components | 0 |
improve | rewrite a prompt; gaps become questions | 0 |
policy | evaluate a tool call at a given autonomy | 1 on deny |
plan-critique | deterministic critique of a plan file | 1 on block |
diff-review | deterministic critique of a diff | 1 on block |
adapters | generate or check the five platform trees | 1 on drift |
validate | rules, skills, dependencies, manifests | 1 on problems |
eval | run the four eval suites | 1 on failure |
health | environment and rule health as JSON | 1 if unhealthy |
decorum | print the policy, or check a reply against it | 1 on problems |
models | prompting guidance for a model family | 0 |
redact | strip credentials from text or stdin | 0 |
Run with no subcommand for a health check. Full usage is in the README.
See how the layers fit
The architecture page maps every module to its invariant and shows the data flow end to end.