.claude/skills/verify-strategy-compliance/SKILL.md
Background knowledge for AI agents before editing any file that handles authentication tokens or spawn environment variables in the 1Code enterprise fork. Triggers when touching src/main/lib/trpc/routers/claude.ts, claude-code.ts, claude/env.ts, feature-flags.ts, or claude-token.ts. Reminds the agent to consult the frozen Envoy Gateway strategy doc (auth-strategy-envoy-gateway.md v2.1) sections that impose hard rules on credential handling.
npx skillsauth add jrmatherly/1dev verify-strategy-complianceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill is Claude-only. It activates when the agent is about to edit, write, or refactor any file in the 1Code enterprise fork that handles authentication tokens, spawn environment variables, or credential storage.
Any Edit, Write, or file-level refactor touching:
src/main/lib/trpc/routers/claude.ts (the Claude Agent SDK spawn site, lines ~1150 for buildClaudeEnv, ~1450 for env-var injection)src/main/lib/trpc/routers/claude-code.ts (the Claude Code binary/OAuth management router)src/main/lib/claude/env.ts (environment variable assembly for spawned Claude subprocesses)src/main/lib/feature-flags.ts (feature flag store; credentials must NOT land here per §4.9)src/main/lib/claude-token.ts (any token-level helper)src/main/lib/trpc/routers/ that handles ANTHROPIC_AUTH_TOKEN, CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL, ANTHROPIC_CUSTOM_HEADERS, ANTHROPIC_AUTH_TOKEN_FILEanthropicAccounts.oauthToken encryption pattern)Do NOT write code like:
finalEnv.ANTHROPIC_AUTH_TOKEN = authToken;
finalEnv.ANTHROPIC_CUSTOM_HEADERS = "Authorization: Bearer " + token;
Any same-UID process on the host can read the spawned subprocess environment via:
cat /proc/<pid>/environps -E <pid> or ps eww <pid>NtQueryInformationProcess with PROCESS_QUERY_INFORMATIONAttack surface includes every npm postinstall hook, VS Code extension host, MCP server subprocess, other dev-tool daemon running under the user's UID. Read docs/enterprise/auth-strategy.md §4.9 for the full threat model.
The mandated alternative is applyEnterpriseAuth() helper per strategy v2.1 §5.4:
0600 (owner read/write only)finalEnv.ANTHROPIC_AUTH_TOKEN_FILE = "/path/to/tmpfile" (NOT the token itself)fs.unlink() the tmpfileprocess.on('exit', ...))CRITICAL unknown: verify Claude CLI 2.1.96 (currently pinned) supports ANTHROPIC_AUTH_TOKEN_FILE BEFORE designing against it. Test with claude --version and inspect the CLI's env-var documentation. If unsupported, do not regress to env-var injection — document a blocker and stop.
feature_flag_overridesThe feature_flag_overrides.value column is plain text("value").notNull() with no encryption — see src/main/lib/db/schema/index.ts:140-148. Contrast with anthropicAccounts.oauthToken (line 108) and claudeCodeCredentials.oauthToken (line 99), both explicitly commented "Encrypted with safeStorage".
setFlag at src/main/lib/feature-flags.ts:153-184 only does JSON.stringify — no encryption hook. getAllFlagsWithSources() at line 208-253 returns all values for "admin/debug inspection" with no redaction.
Do NOT add credential-carrying flag keys. If a design requires storing a bearer token persistently, options are:
anthropicAccounts (already safeStorage-encrypted) with a discriminator columnlitellm_credentials) with safeStorage-encrypted columns mirroring anthropicAccountssetFlag via a sensitive: true marker in FLAG_DEFAULTS + hardcode getAllFlagsWithSources to redact sensitive valuesThis decision is deferred — ask the user before picking an option, do not decide unilaterally.
Any code that sends production traffic to LiteLLM via Envoy Gateway depends on cluster-side mitigations in the Talos repo:
CiliumNetworkPolicy restricting LiteLLM port 4000 to Envoy Gateway pods onlyHTTPRoute with RequestHeaderModifier stripping inbound x-user-* headersWithout these, any pod in the ai namespace can forge x-user-oid headers and impersonate any user (LiteLLM OSS cannot validate JWTs — the JWT-Auth feature is Enterprise-only). Verify these cluster-side mitigations are in place before shipping app-side code that routes through Envoy → LiteLLM.
See docs/enterprise/auth-strategy.md §3.1.
LiteLLM OSS edition does NOT support:
custom_auth + virtual keys combined — Enterprise-only since v1.72.2. Can use one OR the other in OSS, not both.forward_llm_provider_auth_headers: true and forward_client_headers_to_llm_api: true ARE OSS features, but shipping them requires a separate security review of log exposure (bearer tokens can land in SpendLogs / Langfuse / Datadog / any callback that captures headers).
Before writing any code for an auth-touching edit, the agent MUST answer:
docs/enterprise/auth-strategy.md §3.1, §4.9, §5.4, and §6?ANTHROPIC_AUTH_TOKEN=<bearer> directly in finalEnv?ANTHROPIC_CUSTOM_HEADERS=<...Bearer...> directly in finalEnv?ANTHROPIC_AUTH_TOKEN_FILE + tmpfile pattern?2.1.96 (pinned in package.json claude:download) supports ANTHROPIC_AUTH_TOKEN_FILE?feature_flag_overrides?sensitive: true marker AND verify getAllFlagsWithSources redacts it?customConfig/buildClaudeEnv({ customEnv }) substrate at claude.ts:1151-1158 instead of adding a second parallel injection block?If any answer is "no," stop and research the gap before writing production code.
docs/enterprise/auth-strategy.md — the frozen v2.1 strategy doc (do NOT edit, read-only reference)docs/enterprise/envoy-smoke-test.md — empirical Envoy Gateway smoke test (Outcome A PASS).full-review/envoy-gateway-review/05-final-report.md — prior comprehensive review with resolution statussrc/main/lib/trpc/routers/claude.ts:826-832 — existing customConfig Zod schemasrc/main/lib/trpc/routers/claude.ts:1151-1158 — existing buildClaudeEnv({ customEnv }) substratesrc/main/lib/trpc/routers/claude.ts:1429-1437 — existing hasExistingApiConfig precedence checksrc/main/lib/claude/env.ts — buildClaudeEnv implementation (this is where applyEnterpriseAuth() belongs)src/main/lib/db/schema/index.ts:99-127 — reference encryption pattern for anthropicAccounts/claudeCodeCredentialssrc/main/lib/feature-flags.ts:153-253 — setFlag + getAllFlagsWithSources (no encryption hook, use carefully)This skill was created in the session that produced the Gate #8 4-reviewer audit (2026-04-08). The audit found 6 Critical and 6 High findings against a Gate #8 plan that silently regressed strategy v2.1 §4.9, stored credentials in unencrypted feature flags, created a downgrade attack surface via silent misconfig fallback, and duplicated an existing env-var injection substrate — all because the plan author (Claude in a prior session) did not re-read the strategy doc's hard rules before designing. This skill codifies those rules as checkable background knowledge so the same mistake does not repeat.
tools
Background knowledge for safely bumping the pinned versions of Claude CLI binary, Codex CLI binary, Electron, Vite, Tailwind, or Shiki in this repo. Each pin is load-bearing for a different reason — this skill encodes the per-pin rationale and the regression test that must pass before the bump can land. Use proactively whenever editing package.json, scripts/download-claude-binary.mjs, scripts/download-codex-binary.mjs, or any file that mentions these versions. Claude-only (background knowledge, not user-invocable).
development
Use when reading or writing any file under src/renderer/ that calls remoteTrpc.* or fetch(${apiUrl}/...). Verifies the call site is documented in docs/enterprise/upstream-features.md and warns if a new upstream-backend dependency is being introduced without a corresponding F-entry. This skill enforces the enterprise-fork posture documented in CLAUDE.md.
development
End-of-task sync — update CLAUDE.md, rebuild code graph, sync Serena memories, check roadmap drift, and commit. Run after completing any significant work to ensure all drift surfaces are current.
documentation
View, add, or complete items on the centralized project roadmap at docs/operations/roadmap.md. Use when starting a session to see outstanding work, when deferring work to record it, or when completing work to update the tracker. Triggers on "roadmap", "outstanding work", "what's left", "defer", "follow-up".