agentleFS
TenureAITenureAI/PhD-Zero/.agents/skills/project-context/SKILL.md

project-context

Skill52 starsChanged 8 months agoMITView on GitHub

Initialize and maintain per-project runtime context (env, secrets, snapshots). Prefer invoking via research-workflow. TRIGGER when: new run needs env setup, preflight before experiment/eval, runtime fields missing (paths, API keys, GPU config, proxy), run snapshot needed, or shared-memory needs project config. DO NOT TRIGGER when: pure research (use deep-research), plan-only (use research-plan), or env already fully resolved.

33 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use code-review.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    does not store heavy experiment artifacts (checkpoints, dataset caches, large logs)

    line 18
  2. Distinctive:

    Use this skill when any of these are needed:

    line 23
  3. Very specific:

    If multiple projects share one orchestration repo, isolate by project_slug.

    line 44
  4. Distinctive:

    Do not ask for all fields at once.

    line 49
  5. Very specific:

    if execution target is remote, consume reuse decision from run-governor first.

    line 54
  6. Distinctive:

    ask only for missing required fields for the current task

    line 55
  7. Very specific:

    when shared-memory retrieval/export is needed, ask the user where the local shared-memory repo should live if memory.shared_repo.path is …

    line 58
  8. Distinctive:

    If new missing fields appear later, run preflight again and collect only deltas.

    line 60
  9. Distinctive:

    never place secret content in stage reports or commit messages

    line 67

“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “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

Project Context

Mission

Provide a reusable, private-by-default context layer for each project so environment information is collected once, reused across runs, and safely isolated from git history.

Scope boundary:

  1. manages runtime context and secrets only
  2. does not store heavy experiment artifacts (checkpoints, dataset caches, large logs)
  3. stores per-project shared-memory source configuration, but not shared-memory records

Trigger

Use this skill when any of these are needed:

  1. first-time project environment bootstrap
  2. preflight checks before experiment/report/eval execution
  3. missing runtime fields during task execution
  4. per-run context snapshot for reproducibility
  5. first use of shared-memory retrieval or export for a project

Private Directory Contract

Store all local runtime state under project root:

  • <project-root>/.project_local/<project_slug>/context.json
  • <project-root>/.project_local/<project_slug>/secrets.json
  • <project-root>/.project_local/<project_slug>/runs/<run_id>/runtime_snapshot.json

Rules:

  1. .project_local/ must be in .gitignore.
  2. context.json is non-sensitive.
  3. secrets.json is sensitive and must never be logged verbatim.
  4. If multiple projects share one orchestration repo, isolate by project_slug.
  5. Initialize .gitignore if missing and append .project_local/ if absent.

Incremental Collection Policy

Do not ask for all fields at once.

  1. infer task type (report|sft|rl|eval|generic)
  2. load existing context.json + secrets.json
  3. auto-detect non-sensitive environment values where possible
  4. if execution target is remote, consume reuse decision from run-governor first; ask only if decision is missing
  5. ask only for missing required fields for the current task
  6. during execution, allow blocker-only delta prompts (e.g. missing API URL/key)
  7. persist immediately for reuse
  8. when shared-memory retrieval/export is needed, ask the user where the local shared-memory repo should live if memory.shared_repo.path is missing

If new missing fields appear later, run preflight again and collect only deltas.

Security Policy

  1. set <project-root>/.project_local and subdirectories to 0700
  2. set secrets.json to 0600
  3. redact sensitive keys in all CLI output (***)
  4. never place secret content in stage reports or commit messages

Run Integration

Recommended order in research execution:

  1. run-governor collects and confirms mode + local|remote target
  2. run-governor initializes run_id
  3. project-context preflight resolves runtime context and consumes remote reuse decision
  4. experiment-execution runs with resolved context
  5. project-context snapshot writes run-scoped frozen context
  6. shared-memory retrieval/export reuses memory.shared_repo.* from context.json

Script

Use helper script:

  • scripts/project_context.py

Examples:

python3 .agents/skills/project-context/scripts/project_context.py preflight \
  --project-root . \
  --project-slug my-sft-project \
  --task-type sft \
  --run-id 20260303_130000-my-sft-project
python3 .agents/skills/project-context/scripts/project_context.py preflight \
  --project-root . \
  --project-slug my-sft-project \
  --task-type generic \
  --require memory.shared_repo.path
python3 .agents/skills/project-context/scripts/project_context.py show \
  --project-root . \
  --project-slug my-sft-project
python3 .agents/skills/project-context/scripts/project_context.py migrate-layout \
  --project-root . \
  --clean-empty

Required Output for Operations

For each operation, emit:

  1. Project: root and slug
  2. Action: preflight/show/snapshot
  3. State: loaded + newly collected fields
  4. Paths: local/context/secrets/snapshot/runtime/shared-memory paths
  5. Missing: unresolved required fields (if any)

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.