materials-simulation-skills
Agent Skills for computational materials science -- numerical stability, solvers, meshing, convergence, and simulation workflows.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/HeshamFS/materials-simulation-skills with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/HeshamFS/materials-simulation-skills'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/heshamfs--materials-simulation-skills)HTML
<a href="/listings/heshamfs--materials-simulation-skills"><img src="/api/listings/heshamfs--materials-simulation-skills/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
The repo follows the open standard, so the ecosystem installers work out of the box:
npx skills add HeshamFS/materials-simulation-skills # any agent → ~/.agents/skills/ gh skill install HeshamFS/materials-simulation-skills --pin v1.0.0 # version-pinned
Or install a curated **bundle** into a specific agent with the bundled `mss` CLI:
mss bundles # list bundles mss install --agent claude --bundle verification-and-validation
Claude Code users can also `/plugin marketplace add HeshamFS/materials-simulation-skills`. Full per-agent guide → **[docs/INSTALL.md](docs/INSTALL.md)**.
---
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 161 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- {
- "$schema": "https://json.schemastore.org/claude-code-marketplace.json",
- "name": "materials-simulation-skills",
- "description": "Validated, agent-agnostic Agent Skills for computational materials science and numerical simulation.",
- "owner": {
- "name": "Hesham Salama",
- "url": "https://github.com/HeshamFS"
- },
- "metadata": {
- "version": "1.0.0"
- },
- "plugins": [
- {
- "name": "core-numerical",
- "description": "All core numerical skills.",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/core-numerical/convergence-study",
- "./skills/core-numerical/differentiation-schemes",
- "./skills/core-numerical/linear-solvers",
- "./skills/core-numerical/mesh-generation",
- "./skills/core-numerical/nonlinear-solvers",
- "./skills/core-numerical/numerical-integration",
- "./skills/core-numerical/numerical-stability",
- "./skills/core-numerical/time-stepping"
- ]
- },
- {
- "name": "data-management",
- "description": "All data management skills.",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/data-management/fair-simulation-packager"
- ]
- },
- {
- "name": "hpc-deployment",
- "description": "All hpc deployment skills.",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/hpc-deployment/hpc-runtime-doctor",
- "./skills/hpc-deployment/slurm-job-script-generator"
- ]
- },
- {
- "name": "meta",
- "description": "All meta skills.",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/meta/skill-evaluator"
- ]
- },
- {
- "name": "ontology",
- "description": "All ontology skills.",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/ontology/ontology-explorer",
- "./skills/ontology/ontology-mapper",
- "./skills/ontology/ontology-validator"
- ]
- },
- {
- "name": "robustness",
- "description": "All robustness skills.",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/robustness/simulation-failure-triage"
- ]
- },
- {
- "name": "simulation-workflow",
- "description": "All simulation workflow skills.",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/simulation-workflow/md-analysis-planner",
- "./skills/simulation-workflow/parameter-optimization",
- "./skills/simulation-workflow/performance-profiling",
- "./skills/simulation-workflow/post-processing",
- "./skills/simulation-workflow/simulation-orchestrator",
- "./skills/simulation-workflow/simulation-validator",
- "./skills/simulation-workflow/workflow-engine-mapper"
- ]
- },
- {
- "name": "verification-validation",
- "description": "All verification validation skills.",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/verification-validation/benchmark-and-mms-planner"
- ]
- },
- {
- "name": "reproducible-campaigns",
- "description": "Plan, run, diagnose, and FAIR-package multi-run simulation campaigns across HPC.",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/simulation-workflow/parameter-optimization",
- "./skills/simulation-workflow/simulation-orchestrator",
- "./skills/simulation-workflow/performance-profiling",
- "./skills/hpc-deployment/slurm-job-script-generator",
- "./skills/hpc-deployment/hpc-runtime-doctor",
- "./skills/robustness/simulation-failure-triage",
- "./skills/data-management/fair-simulation-packager",
- "./skills/simulation-workflow/workflow-engine-mapper"
- ]
- },
- {
- "name": "verification-and-validation",
- "description": "Prove a result is trustworthy: stability, convergence, manufactured solutions, and pre/post-flight validation.",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/core-numerical/numerical-stability",
- "./skills/core-numerical/convergence-study",
- "./skills/verification-validation/benchmark-and-mms-planner",
- "./skills/simulation-workflow/simulation-validator"
- ]
- },
- {
- "name": "full",
- "description": "Every materials-simulation domain skill.",
- "source": "./",
- "strict": false,
- "skills": [
- "./skills/verification-validation/benchmark-and-mms-planner",
- "./skills/core-numerical/convergence-study",
- "./skills/core-numerical/differentiation-schemes",
- "./skills/data-management/fair-simulation-packager",
- "./skills/hpc-deployment/hpc-runtime-doctor",
- "./skills/core-numerical/linear-solvers",
- "./skills/simulation-workflow/md-analysis-planner",
- "./skills/core-numerical/mesh-generation",
- "./skills/core-numerical/nonlinear-solvers",
- "./skills/core-numerical/numerical-integration",
- "./skills/core-numerical/numerical-stability",
- "./skills/ontology/ontology-explorer",
- "./skills/ontology/ontology-mapper",
- "./skills/ontology/ontology-validator",
- "./skills/simulation-workflow/parameter-optimization",
- "./skills/simulation-workflow/performance-profiling",
- "./skills/simulation-workflow/post-processing",
- "./skills/robustness/simulation-failure-triage",
- "./skills/simulation-workflow/simulation-orchestrator",
- "./skills/simulation-workflow/simulation-validator",
- "./skills/hpc-deployment/slurm-job-script-generator",
- "./skills/core-numerical/time-stepping",
- "./skills/simulation-workflow/workflow-engine-mapper"
- ]
- }
- ]
- }
README.md · README · 175 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- # Materials Simulation Skills
- [](https://github.com/HeshamFS/materials-simulation-skills/actions/workflows/ci.yml)
- [](https://pypi.org/project/materials-simulation-skills/)
- [](LICENSE)
- [](https://www.python.org/)
- [](https://agentskills.io)
- **Give your AI coding agent real expertise in numerical methods, simulation best practices, and computational materials science, so it stops guessing.**
- ```text
- You: Check if dt=0.001 is stable for my advection problem with v=2.0 m/s and dx=0.01.
- Agent: I'll use the numerical-stability skill to check this.
- [runs cfl_checker.py --dx 0.01 --dt 0.001 --velocity 2.0 --json]
- CFL number = 0.2 (limit: 1.0) -- stable.
- Recommended max dt = 0.005 with safety factor 1.0.
- ```
- **24 skills** cover numerical methods, simulation workflows, HPC deployment, verification and validation, FAIR data, robustness, and materials ontologies. They follow the open [Agent Skills standard](https://agentskills.io) and work in **20+ tools**, including Claude Code, Codex, Cursor, Antigravity and GitHub Copilot.
- ---
- ## How it works
- ```mermaid
- flowchart LR
- A["You ask a<br/>simulation question"] --> B["The agent picks<br/>the matching skill"]
- B --> C["The skill's script runs<br/>with your numbers"]
- C --> D["The agent explains<br/>the checked result"]
- ```
- A skill is a folder of instructions plus small, tested scripts. Your agent finds it on its own and loads it only when a question needs it, so there is nothing to wire up and no prompt to write.
- ---
- ## Quick start
- ### 1. Install
- ```bash
- npx skills add HeshamFS/materials-simulation-skills
- ```
- <details>
- <summary>Other ways to install</summary>
- **Pinned to a release**
- ```bash
- gh skill install HeshamFS/materials-simulation-skills --pin v1.0.0
- ```
- **As a Claude Code plugin**
- ```text
- /plugin marketplace add HeshamFS/materials-simulation-skills
- ```
- **A curated bundle into one agent, with the `mss` CLI**
- ```bash
- pip install materials-simulation-skills
- mss bundles # list bundles
- mss install --agent claude --bundle verification-and-validation
- ```
- The per-agent guide is in **[docs/INSTALL.md](docs/INSTALL.md)**.
- </details>
- ### 2. Ask your agent
- Describe the task in your own words. The agent picks the skill:
- ```text
- Is dt=0.001 stable for advection with v=2.0 m/s and dx=0.01?
- ```
- ```text
- My GMRES solve stalls. Which preconditioner should I try?
- ```
- You can also name a skill:
- ```text
- Use convergence-study to check if my mesh is in the asymptotic range:
- h = 0.4, 0.2, 0.1 gave stress = 98.5, 99.6, 99.9 MPa.
- ```
- ### 3. Check the result
- The agent runs the skill's script with your numbers and explains the output, as in the example at the top. Every script also runs by hand, so you can check any answer yourself:
- ```bash
- pip install materials-simulation-skills
- mss list # list skills
- mss run numerical-stability cfl_checker -- --dx 0.01 --dt 0.001 --velocity 2.0 --json
- ```
- ---
- ## What's inside
- **24 skills** in 8 categories. The full catalog is in **[docs/SKILLS.md](docs/SKILLS.md)**, and in machine-readable form in [`skills_index.json`](skills_index.json).
- | Category | Skills | Focus |
- |---|---|---|
- | Core Numerical | 8 | stability, time-stepping, meshing, convergence, integration, differentiation, linear/nonlinear solvers |
- | Simulation Workflow | 7 | validation, DOE/optimization, orchestration, post-processing, profiling, workflow mapping, MD analysis |
- | Ontology | 3 | CMSO/ASMO exploration, mapping, validation |
- | HPC Deployment | 2 | SLURM script generation, runtime diagnosis |
- | Verification & Validation | 1 | manufactured solutions, benchmarks, pass/fail reports |
- | Data Management | 1 | FAIR reproducibility packaging |
- | Robustness | 1 | cross-code failure triage and retry ladders |
- | Meta | 1 | `skill-evaluator`: evaluate any skill across any agent CLI |
- ---
- ## How it's tested
- - **Scripts are tested.** Unit, integration, analytic-oracle and negative-control tests run in CI on Python 3.10 to 3.12 across Linux, macOS and Windows.
- - **Documented numbers are checked.** Every eval case runs its script and asserts the exact output, so the docs cannot drift from the code. Latest run ([2026-10-20](docs/evaluations/2026-10-20.md)): 115 cases, 131 checks, 725 assertions passed.
- - **Rules cite their source**, such as ASME V&V20, the SchedMD `sbatch` spec and CMSO IRIs.
- - **Not yet shown:** that a live agent gives better scientific answers with these skills than without them. The harness to measure it exists, and the work is tracked in [#13](https://github.com/HeshamFS/materials-simulation-skills/issues/13).
- Read **[validation scope and remaining limits](docs/VALIDATION_SCOPE.md)** before treating a passing check as evidence about a physical simulation. Method and harness: [evaluation methodology](docs/EVALUATION_METHODOLOGY.md) · [eval harness](docs/EVAL_HARNESS.md).
- ---
- ## Contributing
- Contributions are welcome: a new skill, a fix, docs, or just an idea.
- - **Looking for something to pick up?** See the [roadmap issues](https://github.com/HeshamFS/materials-simulation-skills/issues?q=is%3Aissue+is%3Aopen+label%3Aroadmap) and the [good first issues](https://github.com/HeshamFS/materials-simulation-skills/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
- - **Have an idea or a skill to propose?** Open an [issue](https://github.com/HeshamFS/materials-simulation-skills/issues/new/choose). Early ideas are useful even without code.
- - **Want to build a skill?** **[CONTRIBUTING.md](CONTRIBUTING.md)** has a step-by-step guide with script and test templates. A skill ships a tested script plus an eval case with a deterministic `script_check`, and passes `mss validate` and `mss eval`.
- - **Where it's headed:** **[ROADMAP.md](ROADMAP.md)**.
- To work on the repository itself:
- ```bash
- git clone https://github.com/HeshamFS/materials-simulation-skills.git
- cd materials-simulation-skills && pip install -e ".[dev]"
- mss eval # run the deterministic eval gate
- python -m pytest tests/ # full test suite
- ```
- ---
- ## Documentation
- | Doc | What's in it |
- |---|---|
- | [docs/SKILLS.md](docs/SKILLS.md) | Full skill catalog, how skills work, repo layout |
- | [docs/INSTALL.md](docs/INSTALL.md) | Install for every supported agent |
- | [docs/EVALUATION_METHODOLOGY.md](docs/EVALUATION_METHODOLOGY.md) | How skills are evaluated, with results |
- | [docs/EVAL_HARNESS.md](docs/EVAL_HARNESS.md) | The three-layer evaluation harness |
- | [docs/PROTOCOL.md](docs/PROTOCOL.md) | The Materials Simulation Skill Protocol |
- | [docs/SECURITY.md](docs/SECURITY.md) | Safeguards and security tiers |
- | [CONTRIBUTING.md](CONTRIBUTING.md) · [ROADMAP.md](ROADMAP.md) | Contributing guide · direction |
- ---
- ## License
- [Apache 2.0](LICENSE)
- ## Acknowledgements
- - [Agent Skills standard](https://agentskills.io): open specification for portable agent capabilities
- - [Anthropic](https://anthropic.com): original developer of the Agent Skills format
- - [agentskills/agentskills](https://github.com/agentskills/agentskills): reference implementation and validation library
skills/meta/skill-evaluator/scripts/agent_adapters.py · Bundled script · 404 lines · 5 findings marked
- #!/usr/bin/env python3
- """Pluggable per-CLI adapters for driving coding agents in headless mode.
- The skill-evaluator harness is *agent-agnostic*: the same Agent Skill is portable
- across many coding-agent CLIs, so the evaluator that exercises a skill must be too.
- This module encodes, for each supported CLI, exactly how to (a) run one prompt
- non-interactively, (b) request structured output, (c) auto-approve tool use so the
- run does not hang on a permission prompt, and (d) where to drop a skill so the CLI
- discovers it (and how to run a clean no-skill baseline).
- Every fact here was researched official-docs-first and independently cross-checked
- (June 2026). See ``references/adapters.md`` for sources, confidence, and caveats.
- CLIs and their flags evolve; each adapter carries a ``confidence`` and the harness
- supports ``--dry-run`` so you can print and verify the exact command before running.
- This file is data + pure helpers + a small CLI (``--list`` / ``--show`` / ``--build``),
- with no third-party dependencies, so the skill stays self-contained and portable.
- """
- from __future__ import annotations
- import argparse
- import json
- import shlex
- import sys
- from typing import Any
- # ---------------------------------------------------------------------------
- # Adapter registry. Each entry is pure data so it serializes to JSON for
- # inspection; build_argv() turns it into a concrete command.
- #
- # invocation spec fields:
- # subcommands tokens between the binary and the flags (e.g. codex `exec`)
- # prompt_flag flag that carries the prompt, or None for a trailing positional
- # json_flags flags that request machine-readable output ([] = plain text)
- # model_flag flag to select the model (model value supplied at call time)
- # bypass_flags flags that auto-approve tool use in headless mode (CRITICAL:
- # without these the run blocks on an interactive approval prompt)
- # workdir_flag flag to point the agent at a working directory, or None
- # workdir_via_cwd if True, the runner sets the process cwd instead of a flag
- # extra_flags flags always added (quiet/no-color/skip-checks/etc.)
- # baseline_extra flags added ONLY for the no-skill baseline run
- # result_kind how to read the agent's answer from stdout:
- # "json:<dotted.path>" parse one JSON doc, take that field
- # "jsonl-last" parse JSONL, take last assistant text
- # "raw" stdout is the answer (plain text)
- # ---------------------------------------------------------------------------
- ADAPTERS: dict[str, dict[str, Any]] = {
- "claude-code": {
- "display_name": "Claude Code",
- "binary": "claude",
- "auth_env": ["ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"],
- "skills_project_subdir": ".claude/skills",
- "skills_personal_dir": "~/.claude/skills",
- "install": "curl -fsSL https://claude.ai/install.sh | bash (or: npm i -g @anthropic-ai/claude-code)",
- "default_model": None,
- "confidence": "high",
- "invocation": {
- "subcommands": [],
- "prompt_flag": "-p",
- "json_flags": ["--output-format", "json"],
- "model_flag": "--model",
- "bypass_flags": ["--dangerously-skip-permissions"],
- "workdir_flag": "--add-dir",
- "workdir_via_cwd": False,
- "extra_flags": [],
- "baseline_extra": ["--bare"], # --bare disables skill/CLAUDE.md/MCP auto-discovery
- "result_kind": "json:result",
- },
- "notes": "Baseline uses --bare to guarantee NO skills are auto-discovered. "
- "--bare needs ANTHROPIC_API_KEY (it ignores CLAUDE_CODE_OAUTH_TOKEN).",
- },
- "openai-codex": {
- "display_name": "OpenAI Codex CLI",
- "binary": "codex",
- "auth_env": ["OPENAI_API_KEY"],
- "skills_project_subdir": ".agents/skills",
- "skills_personal_dir": "~/.agents/skills",
- "install": "npm i -g @openai/codex (note the @openai scope)",
- "default_model": None,
- "confidence": "high",
- "invocation": {
- "subcommands": ["exec"],
- "prompt_flag": None, # prompt is the trailing positional
- "json_flags": ["--json"],
- "model_flag": "-m",
- "bypass_flags": ["--dangerously-bypass-approvals-and-sandbox"],
- "workdir_flag": "-C",
- "workdir_via_cwd": False,
- "extra_flags": ["--skip-git-repo-check"],
- "baseline_extra": [],
- "result_kind": "jsonl-last",
- },
- "notes": "`codex exec --json` streams JSONL events; the final agent message is "
- "the last event with assistant text. Workdir flag is -C/--cd (not --add-dir).",
- },
- "antigravity": {
- "display_name": "Google Antigravity CLI",
- "binary": "agy",
- "auth_env": ["ANTIGRAVITY_API_KEY"],
- "skills_project_subdir": ".agents/skills",
- "skills_personal_dir": "~/.agents/skills",
- "install": "curl -fsSL https://antigravity.google/cli/install.sh | bash (then: agy install)",
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 103 on GitHub
- "default_model": None,
- "confidence": "medium",
- "invocation": {
- "subcommands": [],
- "prompt_flag": "-p",
- "json_flags": [], # `agy -p` prints plain text; JSON via `agy run --output json`
- "model_flag": "--model",
- "bypass_flags": ["--dangerously-skip-permissions"],
- "workdir_flag": "--add-dir",
- "workdir_via_cwd": False,
- "extra_flags": ["--no-color"],
- "baseline_extra": [],
- "result_kind": "raw",
- },
- "notes": "Replaced the retired Gemini CLI on 2026-06-18. Skills use the .agents/ "
- "convention. For structured output the CI form is "
- "`agy run --prompt-file F --yes --no-color --output json`. Verify flags with "
- "`agy --help` for your version (medium confidence; CLI is new).",
- },
- "cursor-cli": {
- "display_name": "Cursor CLI",
- "binary": "cursor-agent",
- "auth_env": ["CURSOR_API_KEY"],
- "skills_project_subdir": ".cursor/skills",
- "skills_personal_dir": "~/.cursor/skills",
- "install": "curl https://cursor.com/install -fsS | bash",
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 129 on GitHub
- "default_model": None,
- "confidence": "high",
- "invocation": {
- "subcommands": [],
- "prompt_flag": "-p",
- "json_flags": ["--output-format", "json"],
- "model_flag": "--model",
- "bypass_flags": ["--force"],
- "workdir_flag": None,
- "workdir_via_cwd": True,
- "extra_flags": [],
- "baseline_extra": [],
- "result_kind": "json:result",
- },
- "notes": "Also auto-discovers .claude/skills and .agents/skills (compat). Runs in cwd.",
- },
- "github-copilot-cli": {
- "display_name": "GitHub Copilot CLI",
- "binary": "copilot",
- "auth_env": ["COPILOT_GITHUB_TOKEN", "GH_TOKEN", "GITHUB_TOKEN"],
- "skills_project_subdir": ".github/skills",
- "skills_personal_dir": "~/.copilot/skills",
- "install": "npm i -g @github/copilot (requires Node 22+)",
- "default_model": None,
- "confidence": "high",
- "invocation": {
- "subcommands": [],
- "prompt_flag": "-p",
- "json_flags": ["--output-format", "json"],
- "model_flag": "--model",
- "bypass_flags": ["--allow-all-tools"],
- "workdir_flag": "--add-dir",
- "workdir_via_cwd": False,
- "extra_flags": ["--no-ask-user", "--silent"],
- "baseline_extra": [],
- "result_kind": "jsonl-last",
- },
- "notes": "The new standalone agentic `copilot` (NOT `gh copilot`). --output-format json "
- "emits JSONL (one object per line). Also discovers .claude/skills, .agents/skills.",
- },
- "amp": {
- "display_name": "Sourcegraph Amp CLI",
- "binary": "amp",
- "auth_env": ["AMP_API_KEY"],
- "skills_project_subdir": ".agents/skills",
- "skills_personal_dir": "~/.config/agents/skills",
- "install": "curl -fsSL https://ampcode.com/install.sh | bash",
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 176 on GitHub
- "default_model": None,
- "confidence": "high",
- "invocation": {
- "subcommands": [],
- "prompt_flag": "-x",
- "json_flags": [], # one-shot -x prints text; --stream-json for events
- "model_flag": None,
- "bypass_flags": ["--dangerously-allow-all"],
- "workdir_flag": None,
- "workdir_via_cwd": True,
- "extra_flags": [],
- "baseline_extra": [],
- "result_kind": "raw",
- },
- "notes": "`amp -x \"<prompt>\"` is the execute/scripting mode. No model flag on the CLI. "
- "Discovers .agents/skills and .claude/skills.",
- },
- "opencode": {
- "display_name": "opencode",
- "binary": "opencode",
- "auth_env": ["ANTHROPIC_API_KEY", "OPENAI_API_KEY"],
- "skills_project_subdir": ".opencode/skills",
- "skills_personal_dir": "~/.config/opencode/skills",
- "install": "curl -fsSL https://opencode.ai/install | bash (the sst/opencode at opencode.ai)",
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 200 on GitHub
- "default_model": None,
- "confidence": "high",
- "invocation": {
- "subcommands": ["run"],
- "prompt_flag": None, # trailing positional
- "json_flags": ["--format", "json"],
- "model_flag": "-m",
- "bypass_flags": ["--dangerously-skip-permissions"],
- "workdir_flag": None,
- "workdir_via_cwd": True,
- "extra_flags": [],
- "baseline_extra": [],
- "result_kind": "raw",
- },
- "notes": "Model is provider/model, e.g. anthropic/claude-sonnet-4. --format json emits a "
- "stream of JSON events. Discovers .opencode/skills, .claude/skills, .agents/skills.",
- },
- "grok-cli": {
- "display_name": "Grok CLI (xAI, official)",
- "binary": "grok",
- "auth_env": ["XAI_API_KEY"],
- "skills_project_subdir": ".grok/skills",
- "skills_personal_dir": "~/.grok/skills",
- "install": "curl -fsSL https://x.ai/cli/install.sh | bash",
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 224 on GitHub
- "default_model": None,
- "confidence": "medium",
- "invocation": {
- "subcommands": [],
- "prompt_flag": "-p",
- "json_flags": ["--output-format", "json"],
- "model_flag": "--model",
- "bypass_flags": ["--always-approve"],
- "workdir_flag": "--cwd",
- "workdir_via_cwd": False,
- "extra_flags": ["--no-auto-update"],
- "baseline_extra": [],
- "result_kind": "raw",
- },
- "notes": "The OFFICIAL xAI CLI (docs.x.ai/build). A community CLI (superagent-ai/grok-cli, "
- "npm 'grok-dev') uses the SAME binary name `grok` but different flags — verify which "
- "you have. Also reads .claude/skills and ~/.claude/skills.",
- },
- }
- # Aliases so users can name a CLI loosely.
- ALIASES = {
- "claude": "claude-code", "claude-code": "claude-code",
- "codex": "openai-codex", "openai-codex": "openai-codex", "openai": "openai-codex",
- "agy": "antigravity", "antigravity": "antigravity", "antigravity-cli": "antigravity",
- "gemini": "antigravity", "gemini-cli": "antigravity", # Gemini CLI retired -> Antigravity
- "cursor": "cursor-cli", "cursor-agent": "cursor-cli", "cursor-cli": "cursor-cli",
- "copilot": "github-copilot-cli", "github-copilot": "github-copilot-cli",
- "github-copilot-cli": "github-copilot-cli", "gh-copilot": "github-copilot-cli",
- "amp": "amp", "sourcegraph-amp": "amp",
- "opencode": "opencode",
- "grok": "grok-cli", "grok-cli": "grok-cli", "xai": "grok-cli",
- }
- def resolve(cli: str) -> str:
- """Resolve a CLI name/alias to a canonical adapter id."""
- key = cli.strip().lower()
- if key in ALIASES:
- return ALIASES[key]
- raise KeyError(
- f"Unknown coding-agent CLI: {cli!r}. Known: {', '.join(sorted(ADAPTERS))}"
- )
- def get(cli: str) -> dict[str, Any]:
- return ADAPTERS[resolve(cli)]
- def build_argv(
- cli: str,
- prompt: str,
- workdir: str | None = None,
- model: str | None = None,
- with_skill: bool = True,
- ) -> list[str]:
- """Construct the concrete argv for one non-interactive run.
- The returned list is ready for subprocess (no shell). When the adapter uses
- ``workdir_via_cwd`` the workdir is NOT in argv — the runner must set cwd.
- """
- a = get(cli)
- inv = a["invocation"]
- argv: list[str] = [a["binary"], *inv["subcommands"]]
- argv += list(inv["json_flags"])
- if model and inv["model_flag"]:
- argv += [inv["model_flag"], model]
- argv += list(inv["bypass_flags"])
- if workdir and inv["workdir_flag"]:
- argv += [inv["workdir_flag"], workdir]
- argv += list(inv["extra_flags"])
- if not with_skill:
- argv += list(inv["baseline_extra"])
- if inv["prompt_flag"]:
- argv += [inv["prompt_flag"], prompt]
- else:
- argv += [prompt]
- return argv
- def command_string(argv: list[str]) -> str:
- """Shell-quoted, copy-pasteable command string (for display / dry-run)."""
- return " ".join(shlex.quote(tok) for tok in argv)
- def runs_in_cwd(cli: str) -> bool:
- return bool(get(cli)["invocation"]["workdir_via_cwd"])
- # --------------------------------------------------------------------------- CLI
- def _cmd_list(args: argparse.Namespace) -> int:
- rows = [
- {
- "id": cid,
- "display_name": a["display_name"],
- "binary": a["binary"],
- "skills_project_subdir": a["skills_project_subdir"],
- "auth_env": a["auth_env"],
- "confidence": a["confidence"],
- }
- for cid, a in ADAPTERS.items()
- ]
- if args.json:
- print(json.dumps({"adapters": rows}, indent=2))
- else:
- for r in rows:
- print(f"{r['id']:20s} {r['binary']:14s} skills={r['skills_project_subdir']:16s} "
- f"auth={r['auth_env'][0]:22s} conf={r['confidence']}")
- return 0
- def _cmd_show(args: argparse.Namespace) -> int:
- try:
- a = get(args.cli)
- except KeyError as exc:
- print(str(exc), file=sys.stderr)
- return 2
- if args.json:
- print(json.dumps({"id": resolve(args.cli), **a}, indent=2))
- else:
- print(json.dumps({"id": resolve(args.cli), **a}, indent=2))
- return 0
- def _cmd_build(args: argparse.Namespace) -> int:
- """Print the exact argv/command for a run (dry-run helper)."""
- try:
- argv = build_argv(
- args.cli, args.prompt, workdir=args.workdir, model=args.model,
- with_skill=not args.baseline,
- )
- except KeyError as exc:
- print(str(exc), file=sys.stderr)
- return 2
- payload = {
- "cli": resolve(args.cli),
- "argv": argv,
- "command": command_string(argv),
- "runs_in_cwd": runs_in_cwd(args.cli),
- "with_skill": not args.baseline,
- }
- if args.json:
- print(json.dumps(payload, indent=2))
- else:
- print(payload["command"])
- return 0
- def build_parser() -> argparse.ArgumentParser:
- p = argparse.ArgumentParser(description="Inspect and build coding-agent CLI adapter commands")
- sub = p.add_subparsers(dest="command", required=True)
- lp = sub.add_parser("list", help="List supported CLIs")
- lp.add_argument("--json", action="store_true")
- lp.set_defaults(func=_cmd_list)
- sp = sub.add_parser("show", help="Show one adapter's full spec")
- sp.add_argument("cli")
- sp.add_argument("--json", action="store_true")
- sp.set_defaults(func=_cmd_show)
- bp = sub.add_parser("build", help="Build the exact run command for a CLI (dry-run)")
- bp.add_argument("cli")
- bp.add_argument("--prompt", required=True)
- bp.add_argument("--workdir", default=None)
- bp.add_argument("--model", default=None)
- bp.add_argument("--baseline", action="store_true", help="Build the no-skill baseline command")
- bp.add_argument("--json", action="store_true")
- bp.set_defaults(func=_cmd_build)
- return p
- def main(argv: list[str] | None = None) -> int:
- args = build_parser().parse_args(argv)
- return args.func(args)
- if __name__ == "__main__":
- raise SystemExit(main())
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.