Quark workspace validate

From amd/Quark · View interactive version

Quark workspace validate is an AI agent skill from the GitHub repository amd/Quark. Validate workspace shape, model paths, output directories, and repo structure before downstream Quark skills proceed. Use this skill whenever a skill needs confirmed file paths, when the user provides a model path or output directory, when you need to distinguish a local model from a HuggingFace ID,

How to use this skill

Skill file

quark-workspace-validate

Purpose

Validate that file paths, model references, and output locations actually exist and are accessible before a downstream skill depends on them. This prevents silent failures where a PTQ run starts, spends time loading a model, and then crashes because the output directory does not exist or the model path has a typo.

Inputs

Outputs: workspace_context.json

Records validated model paths, output directory, and repo locations.

Schema: CODE0

{
  "model_path": "/models/Qwen3-8B",
  "model_source": "local",
  "trust_remote_code_required": false,
  "output_dir": "./output/qwen3-8b-fp8",
  "output_dir_exists": false,
  "output_dir_parent_writable": true,
  "disk_space_gb_free": 250,
  "quark_script_path": null
}

workspace_context.json is for path facts only. Unresolved questions (e.g., ambiguous local-vs-HuggingFace reference) belong in session_context.json (owned by quark-torch-router).

What to Validate

Model Path

A model reference can be one of three things:

  1. Local directory — contains config.json, *.safetensors or *.bin files (e.g., /models/Llama-2-7b-hf/)
  2. HuggingFace ID — format org/model-name (e.g., Qwen/Qwen3-8B)
  3. Ambiguous — could be either (e.g., ./qwen3-8b might be a local dir or a typo)

For local paths, check:

For HuggingFace IDs, note:

Output Directory

Quark Repository (if applicable)

Validation Commands

# Check model directory
ls -la /path/to/model/config.json 2>/dev/null
ls /path/to/model/*.safetensors 2>/dev/null

# Check output directory parent
test -d /path/to/output/.. && echo "parent exists"
test -w /path/to/output/.. && echo "parent writable"

# Check disk space (rough)
df -h /path/to/output/..

Rules

Interaction Flow

  1. Collect: Gather the paths the downstream skill needs — model path, output directory, any referenced config files.
  2. Validate: Run existence and permission checks. Present results as a checklist with pass/fail for each item.
  3. Clarify: For ambiguous references, ask the user. For missing paths, report the exact issue.
  4. Emit: Write confirmed facts to workspace_context.json. Hand any unresolved items back to quark-torch-router so they land in session_context.json's open_questions.

Recovery

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.