agentleFS
oldwinteroldwinter/skills/add-just-doctor/SKILL.md

add-just-doctor

Skill11 starsChanged 14 days agoMITView on GitHub

Add and run a repository-level just doctor command that validates the canonical local environment file and its configured service dependencies. Use when asked to add, repair, or run a repository health-check or doctor command.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 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.

  • 2

    Very specific

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

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

    Create a repository-native just doctor command, execute it against the current local environment, and leave the command covered by focused …

    line 9
  2. Distinctive:

    Keep ordinary application settings outside the service inventory.

    line 28
  3. Distinctive:

    Use the repository's existing language, dependency manager, configuration loader, logging/output library, and module boundaries.

    line 57
  4. Distinctive:

    Add focused tests in the nearest repository test layer for:

    line 72
  5. Distinctive:

    Update the repository's setup or command documentation with the status meanings and exit behavior.

    line 83
  6. Very specific:

    Run just doctor from the repository root using the current local environment.

    line 89

≈ “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

Add Just Doctor

Create a repository-native just doctor command, execute it against the current local environment, and leave the command covered by focused tests. Treat the dependency inventory as the single source of truth.

1. Read The Repository Contract

Read the applicable agent instructions and setup docs, resolving repository file references from the repository root. Check ./Justfile and then ./justfile; if neither exists, create justfile at the repository root, because the just doctor recipe name is the contract. If the repository has no canonical local environment file, keep the command and emit SKIP rows with a one-line reason instead of failing. Inspect configuration modules, environment examples such as ./.env.example, and test conventions. When a filename varies by repository, start the search at the repository root and record the discovered path in ./relative/path form. Find the canonical local environment file and the repository's existing dotenv loader. In linked worktrees, follow the repository's documented rule for locating the primary worktree environment.

Completion criterion: identify the exact recipe file, runtime/config entrypoint, canonical local environment file, test layer, and validation commands before editing.

2. Build The Dependency Inventory

Trace environment lookups from runtime code, configuration schemas, ./.env.example-style contracts, Compose/Helm manifests, and existing provider clients. For every runtime dependency controlled by environment configuration, record:

  • service name and ownership: first-party, third-party, or infrastructure;
  • endpoint or connection-string variables and runtime defaults;
  • credential variable names and authentication placement;
  • enablement flags and the value that activates the integration;
  • protocol and the cheapest side-effect-free health probe;
  • whether configuration is required, optional, or disabled by default.

Keep ordinary application settings outside the service inventory. Reproduce runtime fallback behavior instead of inventing doctor-only endpoints or defaults.

Completion criterion: every enabled environment-backed service reachable from production configuration is represented, and every inventory entry maps back to runtime code or a documented configuration contract.

🔴 CHECKPOINT: before implementing, present the inventory summary (recipe file, environment file, services, probe per service) in at most 8 lines; continue after it is accepted or the user says to go ahead.

3. Define Environment Health

Make the command check the canonical local environment file before probing services.

  • PASS: configuration is present and the protocol-level health check succeeds.
  • WARN: the service responds, but a side-effect-free probe cannot prove business availability; include the bounded reason.
  • FAIL: the environment file is absent when the repository requires one, required or enabled configuration is missing or invalid, DNS/TCP/TLS/protocol connection fails, expected authentication is rejected, or the service reports an unhealthy or server-error state.
  • SKIP: an optional integration is explicitly disabled or not configured.

Exit 0 when no row is FAIL; exit nonzero when configuration or an enabled dependency fails. Keep timeouts short, concurrency bounded, and result ordering deterministic.

Completion criterion: status and exit-code behavior are explicit for missing environment, incomplete configuration, disabled integrations, reachable services, and unhealthy services.

4. Add The Secret-Recovery Hint

Print a concrete secret-sync hint (SOPS by default, or whatever secret store the repository documents) when the local environment file is absent or objectively behind the current configuration contract. Valid lag signals include missing required keys, missing keys for enabled integrations, a documented config revision or hash mismatch, or newer encrypted-source metadata discoverable without exposing secret values. Treat file modification time alone as a possible-lag warning rather than proof.

Resolve the store's repository name or path from repository docs, scripts, Git remotes, or sibling workspace conventions when available. Otherwise print a generic action: find the repository that owns this project's environment, then sync the latest approved local environment file. Keep synchronization a separate user-authorized action.

Completion criterion: missing and objectively stale fixtures both emit the secret-sync action, while a current environment and ordinary provider outage do not claim the file is stale.

5. Implement The Native Command

Use the repository's existing language, dependency manager, configuration loader, logging/output library, and module boundaries. Add a small typed inventory plus protocol probes rather than embedding shell checks in the recipe. The recipe should be a stable entrypoint:

doctor:
    <repository-native command>

Load secret values through the existing configuration mechanism and keep them in memory. Render only service name, ownership, status, environment variable names when useful, sanitized host:port, and a bounded reason class/status code. Strip URL userinfo, paths, query strings, headers, response bodies, credential values, and exception messages from output.

Prefer a documented /health, readiness, ping, or metadata endpoint. Otherwise use a side-effect-free HTTP request and classify an inconclusive application status as WARN. Use protocol-native checks for databases, queues, gRPC, caches, and similar infrastructure (for example pg_isready, redis-cli ping, a gRPC health check, or a bounded TCP connect). Never perform billable search/generation, mutate remote state, or send business data as a health probe.

Completion criterion: just doctor performs bounded checks for the full inventory and its stdout/stderr remain secret-free under success and failure.

6. Cover The Contract

Add focused tests in the nearest repository test layer for:

  • environment file present and absent;
  • required, optional, disabled, and malformed configuration;
  • at least one protocol success and failure;
  • authentication placement without credential disclosure;
  • endpoint and exception redaction;
  • deterministic summary and exit code;
  • secret-sync hint on missing/stale configuration and no false stale claim on provider outage;
  • the just doctor recipe contract.

Update the repository's setup or command documentation with the status meanings and exit behavior.

Completion criterion: focused tests, formatting, lint, and type checks pass using repository-native commands.

7. Execute The Doctor

Run just doctor from the repository root using the current local environment. A nonzero exit caused by accurately identified unavailable services is a valid doctor result, not a passing environment. Inspect the rendered table and confirm it contains no secrets or credential-bearing URLs.

Report the exact PASS/WARN/FAIL/SKIP counts, failed service names with sanitized reasons, whether the local environment file was found/current, and whether the secret-sync hint appeared. Separate command correctness from environment health.

Completion criterion: the command has been observed on the real local configuration, automated validations are green, and the handoff states both implementation status and current environment status.

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.