cross-platform

cross-platform is a cursor rule for coding agents from Project-VIC-International/Agentic-AI-Development-Course. It costs 2,221 tokens per session, scanned A, original, Apache-2.0.

A coding rule that requires software to run on Windows, Linux, and macOS, with file paths handled in an operating-system-safe way.

In plain words
What is it for?
Use it when building cross-platform tools, especially software used on mixed desktop, server, and lab systems.
Why use it?
It prevents code from working on one computer but failing on another because of different path formats or user folders.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/project-vic-international/agentic-ai-development-course/cross-platform
Clone the repo
git clone --depth 1 https://github.com/Project-VIC-International/Agentic-AI-Development-Course

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cross-platform

README.md
[![agentmods](https://agentmods.dev/badge/rules/project-vic-international/agentic-ai-development-course/cross-platform.svg)](https://agentmods.dev/rules/project-vic-international/agentic-ai-development-course/cross-platform)
Your own site
<a href="https://agentmods.dev/rules/project-vic-international/agentic-ai-development-course/cross-platform"><img src="https://agentmods.dev/badge/rules/project-vic-international/agentic-ai-development-course/cross-platform.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,221 This file is loaded in full into every session.
When invoked 2,221 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02221 $0.02221
Opus 5 $0.01111 $0.01111
Sonnet 5 $0.00444 $0.00444
Haiku 4.5 $0.00222 $0.00222

Measured 5d ago against content hash a047bb388035, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

cross-platform scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- Python: `subprocess.run([...])` with `shell=False`. **Never** use `shell=True` on user-supplied data.
part-2-lab/exercises/03-spec-driven-dev/example-cursor-rules/cross-platform.mdc · 135 lines

How it starts

The opening of the file, as written. The whole thing — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cross-Platform Compatibility

This tool MUST run on Windows 10/11, Linux (Ubuntu 22.04+, RHEL 8+), and macOS (12+). Law enforcement agencies and digital forensics labs use all three:

  • Windows dominates examiner workstations.
  • Linux is common on triage servers, processing farms, auto-ingest nodes, and air-gapped lab infrastructure.
  • macOS is used by a meaningful subset of examiners.

Code that works only on one OS is incomplete. A feature that is "done on Linux" but breaks on Windows is not done.

This rule applies regardless of language (Python, Rust, Go, JavaScript, etc.). Examples below are mostly Python because the course's reference stack is Python; the principles transfer directly.

Path Handling

  • ALWAYS use the standard library's path-handling facility — never concatenate paths with / or \ string literals.
    • Python: pathlib.Path (preferred) or os.path.join.
    • Rust: std::path::Path and std::path::PathBuf.
    • Go: path/filepath.
    • Node: path.join from the path module.
  • Use the platform's user-directory facility for config, data, and cache locations — do not hardcode /home/, ~/, C:\Users\, or /Users/.
    • Python: platformdirs (preferred) or appdirs.
    • Rust: the dirs or directories crate.
  • Normalize paths before comparison or persistence (Python: Path.resolve()).
  • Never assume case-sensitive file systems. Windows (NTFS) and macOS (APFS default) are case-insensitive; Linux is case-sensitive. Case folding for evidence file lookups MUST be explicit, not accidental.
  • Use the standard library's temp-file facility for scratch space — never hardcode /tmp/ or %TEMP%.
    • Python: tempfile.TemporaryDirectory, tempfile.NamedTemporaryFile.
    • Rust: tempfile::tempdir, tempfile::NamedTempFile.
  • Maximum path length on Windows is 260 characters by default — keep generated artifact paths short and document long-path support (\\?\ prefix or registry opt-in) in your deployment guide.

Read the full file on GitHub · 135 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 135 lines · 2,221 tokens per session scan A a047bb388035

Subscribe to this mod's changes

cross-platform is a cursor rule published in the GitHub repository Project-VIC-International/Agentic-AI-Development-Course (5 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 2,221 tokens to every session, about $0.0111 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.