agentleFS
atsushi-greenatsushi-green/ds-ai-coding-skills/.claude/skills/path-and-io/SKILL.md

path-and-io

Skill86 starsChanged 52 days agoMITView on GitHub

Use this when reading from or writing to local files — including constructing file paths with pathlib, creating directories, choosing output locations, and using path utilities from src/analysis_project/paths.py.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when reading from or writing to local files.

    line 8
  2. Very specific:

    Use pathlib.Path for all file path operations.

    line 12
  3. Distinctive:

    Prefer paths relative to repository root or configured directories.

    line 14
  4. Very specific:

    Use the path utilities in src/analysis_project/paths.py.

    line 15
  5. Very specific:

    Do not: write outputs into raw data directories (data/raw/, data/external/).

    line 16
  6. Very specific:

    Create parent directories explicitly when writing outputs: path.parent.mkdir(parents=True, exist_ok=True).

    line 17
  7. Distinctive:

    Use descriptive file names.

    line 18
  8. Distinctive:

    Avoid overwriting existing outputs unless explicitly requested.

    line 20

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill 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
SKILL.md

Skill: Path and I/O

Use this skill when reading from or writing to local files.

Rules

  • Use pathlib.Path for all file path operations.
  • Do not hard-code absolute local paths.
  • Prefer paths relative to repository root or configured directories.
  • Use the path utilities in src/analysis_project/paths.py.
  • Do not write outputs into raw data directories (data/raw/, data/external/).
  • Create parent directories explicitly when writing outputs: path.parent.mkdir(parents=True, exist_ok=True).
  • Use descriptive file names.
  • Include dates or run identifiers when outputs are time-dependent.
  • Avoid overwriting existing outputs unless explicitly requested.

Available Utilities

src/analysis_project/paths.py provides:

  • get_repo_root() — リポジトリルートの Path
  • data_dir() — data/ ディレクトリの Path
  • outputs_dir() — outputs/ ディレクトリの Path
  • ensure_parent_dir(path) — 親ディレクトリを作成してパスを返す

Examples

from analysis_project.paths import data_dir, outputs_dir, ensure_parent_dir

# 入力データの読み込み
input_path = data_dir() / "raw" / "titanic" / "train.csv"

# 出力パスを構成して書き込み
output_path = outputs_dir() / "tables" / "summary_2024q1.csv"
ensure_parent_dir(output_path)
df.write_csv(output_path)

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.