Skip to content
Agentmart
Submit a tool

env-preflight

Session environment sanity check — verifies cwd is the repo root, git auth is live, DB env vars are present, and reports active sandbox constraints.

Skill by TheophilusChinomona

IndexedMIT
Write a review

Chalk Labs

Need help deploying env-preflight?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/theophiluschinomona-env-preflight

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Session environment sanity check — verifies cwd is the repo root, git auth is live, DB env vars are present, and reports active sandbox constraints. Use when starting a session, when credentials may have expired, or when the environment feels stale.

Use cases: security

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/env-preflight

What's inside

Skill name
env-preflight
Description
Session environment sanity check — verifies cwd is the repo root, git auth is live, DB env vars are present, and reports active sandbox constraints. Use when starting a session, when credentials may have expired, or when the environment feels stale.
License
MIT
Instructions
111 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Env Preflight Skill

## Purpose
Catch environment problems before they waste a turn: wrong working directory,
expired git credentials, missing DB env vars, or sandbox blocks that will
silently fail later.

## Activation
- Automatically via the SessionStart hook (silent when all checks pass)
- Explicitly: when the session feels stale, credentials may have expired, or after a long pause

---

## Phase 1: Working Directory Check

```bash
git rev-parse --show-toplevel 2>/dev/null
pwd
```

**Pass:** `pwd` output equals `git rev-parse --show-toplevel`.

**Fail — inside subdirectory:**
```bash
cd "$(git rev-parse --show-toplevel)"
```
Report: "Corrected cwd from [was] to [now]."

**Fail — not a git repo:** Report the current directory and stop.
Never continue into deeper subdirectories without surfacing this.

---

## Phase 2: Git Auth Check

```bash
git remote -v 2>/dev/null | head -3
git ls-remote --exit-code origin HEAD 2>&1 | head -3
```

- Exit 0 → auth OK, note the remote URL silently.
- Non-zero → report the error. Do NOT attempt to fix credentials.
  Tell the user exactly which command failed and what the output was.

---

## Phase 3: DB Env Var Check

Detect any DB-related env vars and verify they are set (not empty):

```bash
# Generic detection — check common patterns
for VAR in DATABASE_URL DB_URL CONNECTION_STRING DB_HOST DB_SERVER \
           POSTGRES_URL MYSQL_URL MONGO_URL REDIS_URL \
           ConnectionStrings__DefaultConnection; do
  VAL="${!VAR:-}"
  if [ -n "$VAL" ]; then
    # Mask credentials: show scheme + host only, redact password
    MASKED=$(echo "$VAL" | sed 's|//[^:]*:[^@]*@|//***:***@|g')
    echo "DB_ENV: $VAR=$MASKED"
  fi
done

# .NET-style: check appsettings for ConnectionStrings presence (do not read values)
if ls *.csproj 2>/dev/null | head -1 | grep -q .; then
  grep -l "ConnectionStrings" appsettings*.json 2>/dev/null | head -3
fi
```

**Pass:** At least one DB var is set — report names and masked values.
**No vars found:** Note "No DB env vars detected" (not a failure — project may not use one).
**Never print raw connection strings** — always mask.

---

## Phase 4: Sandbox Report

```bash
echo "SANDBOX: $CLAUDE_SANDBOX_ENABLED"
echo "USER: $(whoami)"
echo "SHELL: $SHELL"
# Report which write targets are sandboxed by checking a canary write
TMPDIR_OK=$(mktemp 2>/dev/null && echo "ok" || echo "blocked")
echo "TMP_WRITE: $TMPDIR_OK"
```

If `CLAUDE_SANDBOX_ENABLED=true`: briefly note which common operations
(rm, git push --force, installs) typically need `dangerouslyDisableSandbox`.
One line each — do not over-explain.

---

## Output Format

Report only failures and notable findings. If everything passes, output:
```
[env-preflight] OK — cwd: /path/to/repo | git: connected | db: <VAR names or none> | sandbox: <on/off>
```

If anything fails, output each issue on its own line prefixed with `[env-preflight] WARN:` or `[env-preflight] FAIL:`.

---

## Anti-Patterns

1. Do NOT fix git auth — report and stop.
2. Do NOT print raw connection strings.
3. Do NOT run this after every prompt — SessionStart only (or explicit user request).
4. Do NOT block the session on warnings — only hard FAIL (e.g., no git repo at all) should stop work.

From TheophilusChinomona/idev, MIT.

More from TheophilusChinomona/idev

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Jul 29, 2026 (3 months ago)
Last release
Jun 25, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from TheophilusChinomona

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get env-preflight running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying env-preflight?

CallGet help
Cite this page

env-preflight skill. Agent Mart. https://agentmart.dev/skills/theophiluschinomona-env-preflight (last updated 2026-10-24)