Architecture And Naming Specification
July 3, 2026 · View on GitHub
Purpose
This document freezes the executable architecture for the greenfield Quark skill system. New skills must satisfy the layer criteria below before they are added.
Design Anchors
- User intent is expressed as a goal, not as a specific skill name.
- Routing happens before execution.
- High-cost or high-risk actions require a visible confirmation step.
- Artifacts are first-class contracts between skills.
- Governance is part of the product, not a later add-on.
Layer Admission Rules
L0 Foundation
Use l0-foundation only when the capability is about environment sensing or safety checks.
Allowed responsibilities:
- detect platform, Python, GPU, Quark version, and workspace shape
- validate paths, model references, and required files
- inspect upstream references before downstream planning starts
Not allowed:
- choosing a PTQ scheme
- generating workflow artifacts beyond raw environment facts
- orchestrating multi-step user flows
L1 Atomic
Use l1-atomic only when the skill performs one stable action with a single primary output.
Required characteristics:
- single responsibility
- explicit input checklist
- explicit primary artifact
- bounded recovery guidance
- reusable from a workflow without rewriting its prompt
Examples:
quark-install(shared)quark-torch-routerquark-torch-installquark-torch-model-intakequark-torch-quant-planquark-torch-exportquark-torch-debugquark-onnx-routerquark-onnx-installquark-onnx-model-intakequark-onnx-quant-planquark-onnx-debugquark-onnx-result-validator
L2 Workflows
Use l2-workflows only when the skill coordinates multiple atomic skills and manages checkpoints.
Required characteristics:
- consumes and passes standard artifacts
- defines ordering and branching rules
- exposes confirm checkpoints before risky execution
- can summarize a manual runbook if execution is skipped
Examples:
quark-torch-llm-ptq-workflowquark-onnx-ptq-workflow
L3 Recipes
Use l3-recipes when the skill targets a specific deployment context (customer model family, downstream runtime, hardware profile) by composing one or more L2 workflows with context-specific configuration. Recipes are concrete applications, not new techniques.
Required characteristics:
- targets a named context (a specific model family, customer, or deployment target)
- composes existing L2 workflows; does not duplicate atomic logic
- carries the context-specific configuration that L2 workflows leave open
- documents the deployment scenario it is built for
Examples:
quark-onnx-autosearch-pro(ONNX AutoSearchPro recipe — composes the ONNX PTQ workflow with Optuna-driven hyperparameter search and built-in presets such asADVANCED_SEARCH,XINT8_SEARCH,A8W8_SEARCH,A16W8_SEARCH)quark-torch-llm-ptq-eval(Torch LLM PTQ lifecycle recipe — composes thequark-torch-ptqworkflow withquark-torch-result-validator(mandatory) andquark-torch-llm-eval(opt-in) for a quantize → validate → evaluate run)- (Deployment-targeted Torch recipe slot still open — e.g.
quark-torch-inferencemax-ptq-recipe)
Meta (orthogonal to L0-L3)
Use meta only when the capability protects correctness or freshness of the skill system. This layer is orthogonal to the L0-L2 stack — it operates on skills as artifacts, not in the user-facing data flow.
Required characteristics:
- targets skill quality, drift, or evaluation
- may inspect multiple skills or upstream references
- must produce a governance artifact or report
- should not be the first skill a normal product user sees
Examples:
quark-torch-skill-sync— broad audit ofquark/torch/source vs. each torch skill'ssource_knowledge; classifies drift as mechanical / semantic / breaking and is the only torch meta skill allowed to apply fixesquark-torch-doc-drift-check— read-only fact-checker that verifies user-facing torch guidance (CLI flags, scheme list, model templates, install matrix) still matchesdocs/source/andexamples/torch/quark-torch-eval-runner— manual four-category smoke test (routing, planning, artifact, recovery) for the torch skill familyquark-onnx-skill-sync— ONNX-side mirror ofquark-torch-skill-sync; auditsquark/onnx/,examples/onnx/,tutorials/onnx/,docs/source/onnx/, andtools/ci/install_onnxruntime.shagainst ONNX skill assumptions (presets, calibration methods, custom-op registry, AutoSearchPro presets, QConfig surface). Only ONNX meta skill allowed to apply fixes.quark-onnx-doc-drift-check— ONNX-side mirror ofquark-torch-doc-drift-check; read-only fact-check of user-facing ONNX guidance (preset names, calibration methods, custom-op names, ORT install matrix, AutoSearchPro presets, contract fields). Hands off toquark-onnx-skill-syncfor any fix.quark-onnx-eval-runner— ONNX-side mirror ofquark-torch-eval-runner; runs the same four-category protocol against the ONNX skill family and adds a cross-backend isolation guard (ONNX prompts must never route toquark-torch-*).
The torch and onnx meta skills are governed independently — each set targets only the upstream paths and skills of its own backend. Cross-cut findings (e.g. a shared/contracts/ schema change) are surfaced but never applied across backends from a single meta skill.
Naming Rules
- Use lowercase kebab-case for skill identifiers.
- Prefix all skills with
quark-. - Backend-specific skills carry a backend infix:
quark-<backend>-<verb>(e.g.quark-torch-ptq,quark-onnx-ptq). Backend-agnostic shared skills use the bare formquark-<verb>(e.g.quark-install,quark-env-preflight). - Prefer verbs or action-bearing nouns after the prefix / backend infix:
quark-install,quark-torch-debug. - Reserve
*-workflowsuffix for L2 orchestrators only. - Reserve
*-recipesuffix for L3 recipes that target a specific deployment context. - Reserve
*-sync,*-eval-*, and*-drift-*style names formetagovernance skills. - Keep names aligned to user goals, not implementation details.
Directory Rules
Each skill lives in its own directory, grouped first by layer and then by backend scope:
.claude/skills-impl/<layer>/<scope>/<skill-name>/
↑
shared | torch | onnx
└── SKILL.md
<scope> applies to every layer including meta/ — drift checks, sync, and smoke-tests target backend-specific upstream source and CLI flags, so they must be partitioned by backend just like atomic skills. Only truly backend-agnostic skills (e.g. quark-install which installs the amd-quark package itself, format/template tooling) live under shared/.
The skill name's backend infix must match the parent <scope>/ directory:
<scope>/torch/quark-torch-*/<scope>/onnx/quark-onnx-*/<scope>/shared/quark-*/(no infix)
Optional adjacent files are allowed for examples, checklists, and helper notes, but cross-skill shared conventions and contract schemas live under .claude/skills-impl/shared/.
Release Gate For MVP
The MVP is considered ready only when:
- The
Torch + LLM PTQpath can route, intake, plan, and hand off a run manifest. - The
ONNX + CNN PTQpath can route, intake, plan, and hand off a run manifest, withquark-onnx-result-validatoravailable for post-quantization inspection ofmodel.onnx(+ optionalmodel.onnx_data). - All five standard artifacts have canonical definitions and examples (shared across both backends; ONNX-specific artifacts such as the ONNX
quant_plan.jsonandrun_manifest.yamlreuse the same schemas). - The four evaluation classes each have at least one runnable task definition per active backend (torch and onnx).
- Drift detection has a documented path from upstream change to affected skill for both
quark/torch/andquark/onnx/source trees, backed by parallel meta trios:quark-torch-skill-sync/quark-torch-doc-drift-check/quark-torch-eval-runneron the torch side, andquark-onnx-skill-sync/quark-onnx-doc-drift-check/quark-onnx-eval-runneron the onnx side.