agentleFS
jie-mengjie-meng/mythril-agent-skills/AGENTS.md

mythril-agent-skills

AGENTS.md8 starsChanged 2 months agoApache-2.0View on GitHub

mythril-agent-skills is a pip-installable package of reusable skills for AI coding assistants (Github Copilot, Claude Code, Cursor, Codex, Gemini CLI, Qwen CLI, Opencode, Cline, Grok CLI, OpenClaw, OpenSquilla, Hermes). Each skill is a self-contained directory with a SKILL.md that defines its metadata, triggering description, and instructions. Tech Stack: - Primary Language: Python 3.10+ - Package Format: pyproject.toml (setuptools) - Configuration: YAML (frontmatter in SKILL.md) - Documentation: Markdown - CLI: Python (curses-based interactive installer and cleanup tool) Installed via pip install…

  • Reads credentials
  • Installs packages
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

35 rules. About 0 are common, 12 are distinctive, and 23 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 23

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All CLI scripts use Python curses for interactive multi-select UIs.

    line 57
  2. Very specific:

    If a local skill has the same name as a builtin skill, it is highlighted in magenta with an (overrides builtin) note.

    line 76
  3. Very specific:

    All config directories are relative to the user home directory (~ on macOS/Linux, %USERPROFILE% on Windows).

    line 142
  4. Very specific:

    All plugins use strict: false — no plugin.json needed.

    line 179
  5. Distinctive:

    All plugins share a single unified version — the same semver string as the pip package.

    line 196
  6. Very specific:

    Use python3 scripts/bump-version.py <version> to update all three files (pyproject.toml, __init__.py, marketplace.json) at once — it also …

    line 198
  7. Very specific:

    When adding a new skill directory under mythril_agent_skills/skills/<name>/:

    line 202
  8. Very specific:

    Create the plugin wrapper: mkdir -p plugins/<name>/skills && ln -s ../../../mythril_agent_skills/skills/<name> plugins/<name>/skills/<name>

    line 204
  9. Very specific:

    Add a new plugin entry in .claude-plugin/marketplace.json

    line 205
  10. Distinctive:

    Avoid vague descriptions — specificity improves triggering accuracy

    line 274
  11. Very specific:

    No external dependencies → CLI tool dependency (git) → Platform CLI dependency (gh) → API token dependency

    line 316
  12. Distinctive:

    When adding a new skill, place it in the appropriate category.

    line 325
  13. Very specific:

    Design principle: Only git-repo-reader writes to the shared cache (clone, pull, sync).

    line 353
  14. Very specific:

    IMPORTANT: Do NOT use temp roots such as $TMPDIR, /tmp, or %TEMP% for skill cache.

    line 359
  15. Distinctive:

    All approaches resolve to one stable per-user location per platform:

    line 404
  16. Distinctive:

    Default rule for ALL downloads: if the user did not explicitly provide a destination path, save into the unified cache path above (never …

    line 414
  17. Very specific:

    Verify that bundled shared assets (e.g.

    line 441
  18. Very specific:

    If you added a new asset or a new consumer, update specs() in scripts/sync-shared-assets.py.

    line 491
  19. Very specific:

    Run python3 scripts/sync-shared-assets.py to materialize bundled copies.

    line 492
  20. Distinctive:

    Commit BOTH the canonical source and the bundled copies in the same commit (they are inseparable).

    line 493
  21. Distinctive:

    NEVER hand-edit a bundled copy directly — your changes will be lost on the next sync, and the drift test will fail the build in the …

    line 495
  22. Very specific:

    Use dict[str, str], list[str], str | None (Python 3.10+)

    line 579
  23. Very specific:

    Paths: use pathlib.Path, not os.path or raw strings

    line 582
  24. Very specific:

    Always quote variables: "$VAR"

    line 596
  25. Distinctive:

    Start at H1, don't skip heading levels

    line 601
  26. Distinctive:

    Keep README.md content in English only

    line 604
  27. Distinctive:

    Keep commits atomic: one logical change per commit

    line 619
  28. Very specific:

    Never commit .claude/, .copilot/, or local build artifacts

    line 620
  29. Very specific:

    Use pathlib.Path for all file operations

    line 628
  30. Distinctive:

    Write type hints on all functions

    line 629
  31. Very specific:

    Check file existence before reading: if not path.exists():

    line 630
  32. Very specific:

    Use context managers: with open(...) as f:

    line 631
  33. Very specific:

    Use bare except: or silently swallow exceptions

    line 634
  34. Distinctive:

    Delete or modify eval/test files to force passing validation

    line 637
  35. Very specific:

    When you need to understand the codebase, check if graphify-out/graph.json exists before reading source files directly.

    line 650

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md — Development Guidelines for mythril-agent-skills Repository

Project Overview

mythril-agent-skills is a pip-installable package of reusable skills for AI coding assistants (Github Copilot, Claude Code, Cursor, Codex, Gemini CLI, Qwen CLI, Opencode, Cline, Grok CLI, OpenClaw, OpenSquilla, Hermes). Each skill is a self-contained directory with a SKILL.md that defines its metadata, triggering description, and instructions.

Tech Stack:

  • Primary Language: Python 3.10+
  • Package Format: pyproject.toml (setuptools)
  • Configuration: YAML (frontmatter in SKILL.md)
  • Documentation: Markdown
  • CLI: Python (curses-based interactive installer and cleanup tool)

Package Structure

mythril-agent-skills/
├── .claude-plugin/              # Claude Code plugin marketplace
│   └── marketplace.json         # Plugin catalog for /plugin install
├── .workbuddy-plugin/           # WorkBuddy AI / CodeBuddy Code marketplace
│   └── marketplace.json         # Generated from .claude-plugin/
├── mythril_agent_skills/        # Python package (also the all-in-one plugin)
│   ├── __init__.py
│   ├── cli/                     # CLI entry points
│   │   ├── skills_setup.py      # Interactive installer
│   │   ├── skills_cleanup.py    # Interactive remover
│   │   └── skills_check.py      # Dependency checker & configurator
│   └── skills/                  # Bundled skill definitions
├── plugins/                     # Per-skill plugin wrappers (symlinks into skills/)
│   ├── figma/skills/figma       # → mythril_agent_skills/skills/figma
│   ├── jira/skills/jira         # → mythril_agent_skills/skills/jira
│   └── .../                     # One wrapper per skill
├── tests/                       # Unit tests
│   ├── conftest.py              # Shared fixtures (sys.path setup)
│   └── skills/                  # One test file per skill
├── scripts/                     # Backward-compatible wrappers (for dev use)
│   ├── sync-upstream.py         # Fork upstream sync tool
│   └── init-fork.py             # One-time fork initializer (detach + git re-init)
├── .sync-upstream.json           # Upstream sync config (for forks)
├── pyproject.toml               # Package configuration
└── ...

CLI Commands

Installed via pip install mythril-agent-skills (or pip install -e . for development):

CommandEntry pointDescription
skills-setupmythril_agent_skills.cli.skills_setup:mainInteractive installer
skills-cleanupmythril_agent_skills.cli.skills_cleanup:mainInteractive remover
skills-checkmythril_agent_skills.cli.skills_check:mainDependency checker
skills-clean-cachemythril_agent_skills.cli.skills_clean_cache:mainCache directory cleaner

All CLI scripts use Python curses for interactive multi-select UIs. They support macOS, Linux, and Windows (auto-install windows-curses on Windows if needed).

Setup: skills-setup

Syncs selected skills from the installed package to your AI assistant's user-level configuration directory. Also discovers local skills in the current working directory.

skills-setup              # Interactive: select tools, then skills
skills-setup .cursor      # Direct target: skip tool selection

Interactive mode launches two multi-select screens:

  1. Select AI tools — choose which tools to install skills to
  2. Select skills — choose which skills to install

The skill selection screen is divided into two sections:

  • Builtin Skills — skills bundled with the mythril-agent-skills package
  • Local Skills — skills discovered in the current working directory (immediate non-hidden subdirectories containing a SKILL.md file)

If a local skill has the same name as a builtin skill, it is highlighted in magenta with an (overrides builtin) note. When both are selected, builtin skills are installed first and the local version is installed last, so the local version takes precedence.

skills-check only runs for builtin skills after installation. Local skills are excluded — their dependency management is the user's responsibility.

Controls: Up/Down move, Space toggle, a all/none, Enter confirm, q quit.

Cleanup: skills-cleanup

Scans AI tool config directories for installed skills and lets you selectively remove them.

skills-cleanup

Launches two screens:

  1. Select AI tools — choose which tool directories to scan (defaults to all detected)
  2. Select skills to remove — tree view showing each tool and its installed skills (defaults to none selected)

Check: skills-check

Checks and configures external dependencies (CLI tools, API tokens) for selected skills.

skills-check gh-operations jira figma

Features:

  • Auto-installs missing CLI tools (e.g. gh) with user confirmation
  • Prompts for missing API keys and saves them to the shell config file
  • Verifies authentication status

Clean Cache: skills-clean-cache

Removes cached files created by skills at runtime. The cache contains two categories: temp files (images, exports — ephemeral) and repo cache (shared git clones — long-lived, reusable). The interactive mode lets users choose to clean one or both categories.

skills-clean-cache          # Interactive: list cache contents, choose what to delete
skills-clean-cache --force  # Delete everything without confirmation
skills-clean-cache --repos  # Interactive: select repos to delete

Backward-compatible wrappers

The scripts/ directory contains thin wrappers for running without pip install:

python3 scripts/skills-setup.py
python3 scripts/skills-cleanup.py
python3 scripts/skills-check.py gh-operations jira figma
python3 scripts/skills-clean-cache.py

Fork upstream sync

For users who fork this repository to maintain private skills, a sync script keeps the fork up to date with upstream:

python3 scripts/sync-upstream.py              # Interactive sync
python3 scripts/sync-upstream.py --dry-run     # Preview only
python3 scripts/sync-upstream.py --force        # No confirmation

Configuration is in .sync-upstream.json (repo root). The exclude_skills list prevents specific skills from being overwritten during sync. See docs/FORK-SYNC.md for details.

Supported tools

All config directories are relative to the user home directory (~ on macOS/Linux, %USERPROFILE% on Windows).

#ToolConfig directorySkills path
1Copilot CLI / VS Code~/.copilot/~/.copilot/skills/
2Claude Code~/.claude/~/.claude/skills/
3Cursor~/.cursor/~/.cursor/skills/
4Codex~/.codex/~/.codex/skills/
5Gemini CLI~/.gemini/~/.gemini/skills/
6Qwen CLI~/.qwen/~/.qwen/skills/
7Opencode~/.config/opencode/~/.config/opencode/skills/
8Grok CLI~/.grok/~/.grok/skills/
9OpenClaw~/.openclaw/~/.openclaw/skills/
10OpenSquilla~/.opensquilla/~/.opensquilla/skills/
11Hermes~/.hermes/~/.hermes/skills/
12CodeBuddy~/.codebuddy/~/.codebuddy/skills/
13WorkBuddy AI~/.workbuddy-ai/~/.workbuddy-ai/skills/
14Cline~/.cline/~/.cline/skills/
15Pi / DeepSeek Harness~/.agents/~/.agents/skills/

~/.agents/skills/ is the cross-tool shared Agent Skills convention directory (agentskills.io) — read by DeepSeek Harness (dsh), DeepSeek Deep Code, Pi, OpenClaw, Cline, Kimi Code CLI, Warp, Zed, and others. Skills installed there are visible to every compliant tool.

WorkBuddy AI: the desktop app injects CODEBUDDY_CONFIG_DIR=~/.workbuddy-ai when it launches its bundled CodeBuddy engine, so the user-level skills directory resolves to ~/.workbuddy-ai/skills/ (project-level skills live in <project>/.workbuddy-ai/skills/). The same config directory also holds settings.json (hooks) and plugins/.


Claude Code Plugin Marketplace

This repository doubles as a Claude Code plugin marketplace. The catalog at .claude-plugin/marketplace.json exposes all bundled skills as a single installable plugin. WorkBuddy AI and CodeBuddy Code read the same catalog format from .workbuddy-plugin/marketplace.json.

Architecture

  • All-in-one plugin (all-skills): source ./mythril_agent_skills — Claude Code auto-discovers all skills from skills/*/SKILL.md
  • Per-skill plugins (figma, jira, etc.): source ./plugins/<name> — each is a thin wrapper with a symlink skills/<name> → ../../../mythril_agent_skills/skills/<name>
  • All plugins use strict: false — no plugin.json needed; marketplace entry is the full definition

Derived catalogs (WorkBuddy AI / CodeBuddy Code)

Claude Code scans .claude-plugin/; WorkBuddy AI and CodeBuddy Code scan .workbuddy-plugin/ / .codebuddy-plugin/. To avoid maintaining a second catalog by hand, .workbuddy-plugin/marketplace.json is generated:

  • scripts/sync-marketplaces.py copies the canonical catalog verbatim and drops the Claude-only $schema key
  • scripts/sync-marketplaces.py --check verifies it has not drifted (exit 1 on drift)
  • tests/test_marketplace_sync.py fails CI on drift
  • scripts/bump-version.py and scripts/publish.py run the sync/check automatically

Never hand-edit .workbuddy-plugin/marketplace.json — edit .claude-plugin/marketplace.json (the canonical source) and run the sync script.

Versioning

All plugins share a single unified version — the same semver string as the pip package. Per-skill plugins are symlink wrappers with no independent code, so independent versions would have no meaning.

Use python3 scripts/bump-version.py <version> to update all three files (pyproject.toml, __init__.py, marketplace.json) at once — it also regenerates the derived .workbuddy-plugin/ catalog. The publish script (scripts/publish.py) checks all three sources for consistency, plus derived-catalog drift, before uploading.

Adding a new skill to the marketplace

When adding a new skill directory under mythril_agent_skills/skills/<name>/:

  1. Create the plugin wrapper: mkdir -p plugins/<name>/skills && ln -s ../../../mythril_agent_skills/skills/<name> plugins/<name>/skills/<name>
  2. Add a new plugin entry in .claude-plugin/marketplace.json
  3. The all-skills plugin picks it up automatically (no change needed)

User installation

/plugin marketplace add jie-meng/mythril-agent-skills
/plugin install all-skills@mythril-agent-skills          # all skills
/plugin install figma@mythril-agent-skills               # single skill

WorkBuddy AI / CodeBuddy Code use the same commands — point them at the same repository (or a local clone); they pick up .workbuddy-plugin/marketplace.json automatically. Run /reload-plugins after installing.


Skill File Structure

Each skill is a directory under mythril_agent_skills/skills/:

mythril_agent_skills/skills/skill-name/
├── SKILL.md              # Required: metadata + instructions
├── README.md             # Optional: overview for humans
├── scripts/              # Optional: helper Python/Bash scripts
├── references/           # Optional: documentation, guides, schemas
├── agents/               # Optional: prompt/instruction files for evaluations
└── assets/               # Optional: templates, icons, HTML/CSS resources

Writing a High-Quality SKILL.md

SKILL.md must begin with YAML frontmatter:

---
name: skill-name
description: |
  Multi-line description explaining when to use this skill.
  Include trigger keywords and use cases.
  Be specific — mention concrete contexts and phrases that should activate the skill.
license: Apache-2.0
---

# Skill Name

Detailed instructions, examples, and workflows...

Required fields:

  • name: Skill identifier (matches directory name)
  • description: When and why to trigger — this is the AI's activation signal. Be precise and "pushy": list specific contexts, keywords, and phrases.

Optional fields:

  • license: Skill license (e.g., Apache-2.0, MIT). Defaults to Apache-2.0 if not specified.
  • allowed-tools: List of tools the skill may use
  • compatibility: Tool/platform requirements

Character limit:

  • The description field MUST be at most 1024 characters. Multiple AI tools enforce this limit at load time — skills with longer descriptions will fail to load silently. Always verify length after editing a description:
    python3 scripts/validate-skill-descriptions.py

Tips for a good description:

  • State explicitly when to invoke the skill (trigger conditions)
  • List example user phrases that should activate it
  • Mention what the skill does, not just what it is
  • Avoid vague descriptions — specificity improves triggering accuracy

Security Rules for Skills Using API Tokens or Credentials

Skills that require API tokens, passwords, or other credentials (e.g. ATLASSIAN_API_TOKEN, FIGMA_ACCESS_TOKEN, GH_TOKEN) MUST include a "Security — MANDATORY rules for AI agents" section in their SKILL.md with these rules:

  1. NEVER echo, print, or log the value of any environment variable — even for debugging. Commands like echo $TOKEN, printenv TOKEN, env | grep TOKEN are strictly forbidden.
  2. NEVER pass credential values as inline CLI arguments or env-var overrides (e.g. TOKEN=xxx python3 script.py). Scripts MUST read credentials from the environment internally via os.environ. The AI agent simply runs the script — no manual credential handling.
  3. NEVER read environment variable values using shell commands or programmatic access. The AI agent should not inspect, verify, or access token values in any way.
  4. When debugging auth errors, rely solely on the script's error messages (401, 403, etc.). Do NOT attempt to verify tokens by reading or printing them.
  5. NEVER extract credentials from OS credential stores or config files. The following are strictly forbidden — even for debugging or troubleshooting auth failures:
    • macOS Keychain: security find-internet-password, security find-generic-password, security dump-keychain
    • Linux secret stores: secret-tool, kwallet-query, GNOME Keyring CLI tools
    • Windows Credential Manager: cmdkey /list, rundll32 keymgr.dll
    • Git credential helpers: git credential fill, cat ~/.git-credentials, cat ~/.netrc
    • GitHub CLI config: reading or printing contents of ~/.config/gh/hosts.yml or any gh auth config file
    • Any other command or file read that outputs a password, token, or secret value
  6. NEVER use extracted credential values in commands. Even if a credential value is somehow visible (e.g. from a previous session's output), do NOT copy and use it in curl -H "Authorization: token <value>", API calls, or any other command. Tools like gh and bundled scripts handle authentication internally — the AI agent must never manually construct authenticated requests using raw credential values.

These rules prevent accidental credential exposure in terminal output, chat logs, and conversation transcripts.

For skills_check.py: Token values MUST be masked (show only last 4 chars). Email addresses MUST be partially masked (e.g. j***@example.com). Base URLs may be shown in full.

Skill Ordering Convention

Skills appear in multiple listings: the README "Available Skills" table, the skills-check interactive UI and execution order, and the CHECKABLE_SKILLS list in code. All MUST follow the same ordering convention.

Category order (groups, top to bottom):

#CategoryDescriptionExample skills
1MetaTools for creating/managing skills themselvesskill-creator
2Code ReviewCode review workflows (local and remote)code-review-staged, branch-diff-review, github-code-review-pr
3Git & GitHubGit operations and GitHub platform integrationgit-repo-reader, gh-operations
4API IntegrationsThird-party API clients requiring credentialsjira, confluence, figma, glean, glm-vision-fallback
5Data ProcessingPython-based file processing toolsexcel, pdf
6Media ProcessingStandalone CLI tools for media filesimagemagick, ffmpeg
7ContentContent creation and writing toolsblog-writer
8Project PlanningEstimation, scoping, and planning toolsstory-point-estimate
9Fullstack WorkspaceMulti-repo workspace scaffolding, lifecycle, and cross-repo implementationfullstack-init, fullstack-explore, fullstack-brief, fullstack-propose, fullstack-apply, fullstack-archive, fullstack-docs-migration

Within each category, order by dependency complexity — no deps first, then CLI deps, then API credential deps:

  • No external dependencies → CLI tool dependency (git) → Platform CLI dependency (gh) → API token dependency

For skills-check: The execution order follows a different principle — dependency layers (check foundational tools before things that depend on them):

  1. Foundation CLI (git) — almost everything depends on it
  2. Platform CLI (gh) — builds on git
  3. API credentials (Atlassian, Figma) — need tokens configured
  4. Python packages (openpyxl, pypdf, pdfplumber) — pip-installable
  5. Standalone media tools (ImageMagick, FFmpeg) — independent binaries

When adding a new skill, place it in the appropriate category. If it doesn't fit any existing category, add a new category row and insert it at a logical position in the table.


Temporary Files & Cache Convention

See docs/CACHE.md for the full cache usage guide and examples.

Skills that need to download files, clone repos, or create temp artifacts at runtime MUST use the unified per-user cache directory:

<user-cache-root>/mythril-skills-cache/<skill-name>/

Shared git repo cache

The git-repo-reader skill manages a shared repo cache at mythril-skills-cache/git-repo-cache/ via its scripts/repo_manager.py. Other skills (e.g., github-code-review-pr) can read this cache to reuse already-cloned repos without re-downloading.

# git-repo-reader: clone or reuse a cached repo
python3 scripts/repo_manager.py clone "<repo-url>"

# github-code-review-pr: check if repo is already cached (read-only lookup)
python3 scripts/repo_cache_lookup.py "<repo-url>"

Cached repos live under mythril-skills-cache/git-repo-cache/repos/<host>/<owner>/<repo>/. They are long-lived — do NOT delete them after use. The skills-clean-cache command lets users selectively clean repo cache vs ephemeral temp files.

Design principle: Only git-repo-reader writes to the shared cache (clone, pull, sync). Other skills that benefit from cached repos bundle a lightweight read-only lookup script (repo_cache_lookup.py) that checks the same mapping file. This keeps each skill self-contained while enabling cross-skill cache reuse.

Cross-platform cache directory creation

Skills run on macOS, Linux, and Windows. Use the appropriate syntax for the user's platform.

IMPORTANT: Do NOT use temp roots such as $TMPDIR, /tmp, or %TEMP% for skill cache. Different tools may set different temp environments, causing non-unique cache paths. Always use per-user OS cache roots below.

Bash (macOS / Linux):

if [[ "$(uname -s)" == "Darwin" ]]; then
  CACHE_ROOT="$HOME/Library/Caches/mythril-skills-cache"
else
  CACHE_ROOT="${XDG_CACHE_HOME:-$HOME/.cache}/mythril-skills-cache"
fi
CACHE_DIR="$CACHE_ROOT/<skill-name>"
mkdir -p "$CACHE_DIR"
RUN_DIR=$(mktemp -d "$CACHE_DIR/XXXXXXXX")

PowerShell (Windows):

$CACHE_ROOT = Join-Path ([Environment]::GetFolderPath("LocalApplicationData")) "mythril-skills-cache"
$CACHE_DIR = Join-Path $CACHE_ROOT "<skill-name>"
New-Item -ItemType Directory -Force -Path $CACHE_DIR | Out-Null
$RUN_DIR = Join-Path $CACHE_DIR ([System.IO.Path]::GetRandomFileName())
New-Item -ItemType Directory -Force -Path $RUN_DIR | Out-Null

Python:

from pathlib import Path
import os
import platform

home = Path.home()
if platform.system() == "Darwin":
    cache_root = home / "Library" / "Caches" / "mythril-skills-cache"
elif platform.system() == "Windows":
    local_app_data = os.environ.get("LOCALAPPDATA")
    base = Path(local_app_data) if local_app_data else home / "AppData" / "Local"
    cache_root = base / "mythril-skills-cache"
else:
    xdg_cache_home = os.environ.get("XDG_CACHE_HOME")
    base = Path(xdg_cache_home) if xdg_cache_home else home / ".cache"
    cache_root = base / "mythril-skills-cache"

cache_dir = cache_root / "<skill-name>"
cache_dir.mkdir(parents=True, exist_ok=True)

All approaches resolve to one stable per-user location per platform:

  • macOS: /Users/<user>/Library/Caches/mythril-skills-cache/...
  • Linux: /home/<user>/.cache/mythril-skills-cache/... (or $XDG_CACHE_HOME/mythril-skills-cache/...)
  • Windows: C:\Users\<user>\AppData\Local\mythril-skills-cache\...

Cache directory rules

  • Each skill gets its own subdirectory named after the skill (e.g., github-code-review-pr/, figma/)
  • Git repo clones go into the shared git-repo-cache/ subdirectory, managed by git-repo-reader's repo_manager.py.
  • Within the subdirectory, create random dirs freely — e.g., mktemp -d "$CACHE_DIR/XXXXXXXX"
  • Default rule for ALL downloads: if the user did not explicitly provide a destination path, save into the unified cache path above (never ad-hoc locations)
  • If user explicitly provides a destination path, follow it; otherwise always use the unified cache path
  • Skills do NOT need to worry about cleanup — the skills-clean-cache command handles it
  • Never create temp files directly in /tmp/ or other ad-hoc locations

Automatic access to cache files

Files under the unified cache directory are skill-managed temporary artifacts (downloaded images, cloned repos, exported assets). The AI agent MUST read, write, and delete these files automatically without asking the user for confirmation. These files were created by the skill itself during the current or a previous session — they are inherently trusted and ephemeral. This applies regardless of whether the cache path falls inside or outside the current workspace directory.

This convention ensures skills-clean-cache can find and remove all skill-generated temp data in one pass.


Validation

Validate a skill's SKILL.md structure before committing:

python3 mythril_agent_skills/skills/skill-creator/scripts/quick_validate.py <skill-path>

Validate description length across all skills (must not exceed 1024 characters):

python3 scripts/validate-skill-descriptions.py

Verify that bundled shared assets (e.g. mermaid_lint.py, MERMAID-RULES.md) match the canonical source — see "Shared assets across skills" below:

python3 scripts/sync-shared-assets.py --check

Shared assets across skills

Each skill is installed individually into per-tool directories (e.g. ~/.claude/skills/<skill>/, ~/.cursor/skills/<skill>/, ~/.claude/plugins/.../<skill>/). When users select only one skill — via skills-setup, /plugin install <one-skill>, or by manually dropping a skill directory into their AI tool's skills/ folder — that skill must remain fully self-contained. Its scripts/ and references/ files must work without reaching outside the skill directory.

This rules out the "import from a sibling skill" or "import from a top-level package" patterns: at the user's machine there is no sibling, and mythril_agent_skills/shared/ is not part of any install path.

Design rule: single source, bundled copies

Some assets are inherently shared across multiple skills (e.g. mermaid rules + linter are needed by user-journey, fullstack-apply, and fullstack-propose; the graphify check is needed by all fullstack lifecycle skills). For those, the repo uses one canonical source plus byte-identical bundled copies inside each consumer skill:

LayerPathEdited byTravels with install?
Canonical source (single source of truth)mythril_agent_skills/shared/<asset-group>/Humans / AI authoring the assetNO — repo-internal only
Bundled copy (one per consuming skill)mythril_agent_skills/skills/<consumer-skill>/{scripts,references}/<asset>NEVER hand-edited — regenerated from canonicalYES — copied with the skill directory

shared/ is the only place a shared asset is authored. The bundled copies under each skill are derived artifacts kept in lockstep by scripts/sync-shared-assets.py. The shared/ directory exists only inside this repository — it is excluded from every user-facing install path:

  • skills-setup (and /plugin install) copy mythril_agent_skills/skills/<skill>/ only — shared/ is not under any skill, so it is never copied.
  • The Claude plugin marketplace (.claude-plugin/marketplace.json) maps each plugin source to a path under mythril_agent_skills/skills/... or plugins/... — never to shared/.
  • pip install mythril-agent-skills does ship shared/ (it's part of the Python package), but no runtime code imports from it — it exists only so repo maintainers can run sync-shared-assets.py from an editable install if they want.

Cross-skill import rule

Skill scripts MUST import the bundled copy that sits beside them, never reach across skills or up to shared/:

# In mythril_agent_skills/skills/user-journey/scripts/init_workspace.py
SCRIPT_DIR = Path(__file__).resolve().parent
sys.path.insert(0, str(SCRIPT_DIR))
from mermaid_lint import escape_label_for_mermaid  # ← bundled copy in same dir
# In SKILL.md
python3 SKILL_PATH/scripts/mermaid_lint.py "<workspace>/JOURNEY.md"

SKILL_PATH always resolves to the skill's own installed directory, so this works the same way under ~/.claude/skills/user-journey/, ~/.cursor/skills/user-journey/, or ~/.claude/plugins/.../user-journey/.

Workflow: adding or updating a shared asset

  1. Edit the canonical file under mythril_agent_skills/shared/.
  2. If you added a new asset or a new consumer, update specs() in scripts/sync-shared-assets.py.
  3. Run python3 scripts/sync-shared-assets.py to materialize bundled copies.
  4. Commit BOTH the canonical source and the bundled copies in the same commit (they are inseparable). The drift test will fail CI if they get out of step.

NEVER hand-edit a bundled copy directly — your changes will be lost on the next sync, and the drift test will fail the build in the meantime.

CI guard

  • tests/test_shared_assets_sync.py (always runs in pytest) compares every bundled copy to its canonical source byte-by-byte. If anyone hand-edits a bundled copy, the test fails with a "run sync-shared-assets.py" message.
  • python3 scripts/sync-shared-assets.py --check is a standalone CI-friendly mode that prints PASS/FAIL without modifying any files.

Currently shared

AssetCanonicalConsumed by
mermaid_lint.pyshared/mermaid/mermaid_lint.pyfullstack-apply, fullstack-propose, fullstack-brief, user-journey
MERMAID-RULES.mdshared/mermaid/MERMAID-RULES.mdfullstack-apply, fullstack-propose, fullstack-brief, user-journey
graphify_check.pyshared/graphify/graphify_check.pyfullstack-init, fullstack-explore, fullstack-propose, fullstack-apply, fullstack-archive, fullstack-brief
compute_waves.pyshared/waves/compute_waves.pyfullstack-propose, fullstack-apply
plan_lint.pyshared/plan/plan_lint.pyfullstack-propose, fullstack-apply

Note this is a different pattern from the git-repo-reader shared cache (above): the cache is runtime shared state on the user's machine, while shared assets are build-time duplicated files inside the repo. Both keep installed skills fully self-contained.


Testing

Unit tests live in tests/skills/, one file per skill. They cover pure/deterministic functions in skill scripts/ directories — URL parsing, formatters, validators, template rendering, gate logic, etc.

Running tests

pip install -e ".[test]"   # first time only
pytest                     # run all
pytest -vv                 # verbose
pytest tests/skills/test_figma.py          # single skill
pytest -k "parse_url"                      # filter by keyword

Rules for skill scripts and tests

  1. Every skill that has a scripts/ directory MUST have a corresponding test file at tests/skills/test_<skill_name>.py (hyphens → underscores).
  2. Test pure functions only — functions that take data in and return data out, with no network calls, subprocess invocations, or filesystem side effects. Typical candidates:
    • URL/input parsing (parse_repo_url, parse_issue_input, parse_figma_url)
    • Data formatting (format_issue_markdown, rgba_to_hex, _strip_html)
    • Validation logic (validate_skill, gate_no_speculation, detect_verdict)
    • Template/report rendering (render_english, generate_markdown)
    • Key normalization (normalize_key, normalized_identity)
  3. Functions that call external tools (network, subprocess, gh, git, API clients) are NOT unit-tested. They are validated by integration usage.
  4. Use tmp_path for filesystem tests — when testing functions that read/write files (e.g., validate_skill, load_map/save_map), create temp directories via pytest's tmp_path fixture. Never touch real skill directories.
  5. Import via module name directly — conftest.py adds all skill scripts/ directories to sys.path at session start. Import like from jira_api import format_adf_to_text, not via relative paths.
  6. When adding a new script to an existing skill, add tests for its pure functions to the skill's existing test file.
  7. When creating a new skill with scripts, create the test file as part of the same commit.
  8. IDE type-checker paths are configured in pyproject.toml under [tool.pyright] extraPaths. When adding a new skill with scripts, add its scripts/ path to this list.

Test file structure convention

"""Tests for <skill-name> skill scripts."""

import pytest

class TestFunctionName:
    """Tests for module.function_name."""

    @pytest.fixture(autouse=True)
    def _import(self):
        from module_name import function_name
        self.func = function_name

    def test_normal_case(self):
        assert self.func("input") == "expected"

    def test_edge_case(self):
        with pytest.raises(ValueError):
            self.func("bad input")

Code Style Guidelines

Python

  • File naming: snake_case: run_eval.py, utils.py
  • Shebang + docstring on all scripts: #!/usr/bin/env python3
  • Imports: stdlib → third-party → local
  • Type hints: required on all function signatures
    • Use dict[str, str], list[str], str | None (Python 3.10+)
  • Docstrings: concise triple-quote on all public functions
  • Error handling: raise informative errors with context; no bare except:
  • Paths: use pathlib.Path, not os.path or raw strings
  • Line length: 88 chars (Black standard)
def parse_skill_md(skill_path: Path) -> tuple[str, str, str]:
    """Parse a SKILL.md file, returning (name, description, full_content)."""
    if not (skill_path / "SKILL.md").exists():
        raise FileNotFoundError(f"SKILL.md not found at {skill_path}")

Bash

  • Shebang #!/bin/bash and comment header
  • UPPER_CASE constants, lower_case variables
  • Always quote variables: "$VAR"
  • Explicit error checks or set -e

Markdown

  • Start at H1, don't skip heading levels
  • Fenced code blocks with language tags
  • Relative links for internal references
  • Keep README.md content in English only

Naming Conventions

  • Skill directories: lowercase, hyphenated: skill-creator, code-review-staged
  • Scripts: lowercase, descriptive: run_eval.py, quick_validate.py
  • Output directories: outputs/ under skill root

Git Commit Guidelines

  • Format: [skill-name] Brief description or [scripts] Brief description
  • Keep commits atomic: one logical change per commit
  • Never commit .claude/, .copilot/, or local build artifacts

Common Patterns & Anti-Patterns

DO:

  • Validate input early, raise informative errors
  • Use pathlib.Path for all file operations
  • Write type hints on all functions
  • Check file existence before reading: if not path.exists():
  • Use context managers: with open(...) as f:

DON'T:

  • Use bare except: or silently swallow exceptions
  • Hardcode absolute paths — use relative paths or CLI args
  • Mix string paths and Path objects in the same function
  • Delete or modify eval/test files to force passing validation

Graphify Knowledge Graph

This repository uses graphify to build a navigable knowledge graph. The graph is stored in graphify-out/ at the project root.

Permissions: AI agents MUST have read/write access to graphify-out/ and all its contents (graph.json, GRAPH_REPORT.md, graph.html, .graphify_python, cost.json, and any intermediate files). This is required for:

  • Querying the graph (graphify query "...") reads graphify-out/graph.json
  • Building or rebuilding the graph reads/writes detection files, chunk files, and extraction caches in graphify-out/
  • Generating HTML/JSON output writes to graphify-out/

When you need to understand the codebase, check if graphify-out/graph.json exists before reading source files directly. If it exists, run graphify query "<question>" first — the graph is faster and more comprehensive than ad-hoc file grepping.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.