sync-environment-variables
Add missing environment variable defaults to settings.json or settings.local.json
What this skill does
# Sync Environment Variables
Add missing environment variable entries with explicit defaults to settings files.
## Arguments
| Argument | Description |
|----------|-------------|
| `--target project` | Update `.claude/settings.json` (default) |
| `--target local` | Update `.claude/settings.local.json` |
| `--dry-run` | Show changes without modifying files |
| `--include-undocumented` | Include changelog/discovered vars (not just official) |
## Phase 1: Discovery
Run environment variable discovery using the same process as `list-environment-variables`:
1. Invoke `docs-management` skill for official documentation
2. WebFetch CHANGELOG.md for additional variables
3. If `--include-undocumented`, spawn MCP research agents
Collect all discovered variables with their default values.
## Phase 2: Read Current Settings
Determine target file based on `--target` argument:
| Target | File Path |
|--------|-----------|
| `project` (default) | `.claude/settings.json` |
| `local` | `.claude/settings.local.json` |
Read the target file. If it doesn't exist:
- For `project`: Create new file with basic structure
- For `local`: Create new file (this is gitignored)
Parse the current `env` section (if present).
## Phase 3: Compare and Categorize
For each discovered environment variable, categorize:
| Category | Criteria | Action |
|----------|----------|--------|
| **MISSING** | Not in current settings, has known default | Add to settings |
| **EXISTS** | Already in current settings | Skip (preserve user value) |
| **USER-SPECIFIC** | No universal default (e.g., API keys) | Skip, report only |
| **CUSTOM** | `CLAUDE_HOOK_*` or repo-specific | Never touch |
### Variables to Add (with defaults)
These variables have known, safe defaults:
```json
{
"env": {
"DISABLE_AUTOUPDATER": "0",
"DISABLE_TELEMETRY": "0",
"CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR": "0",
"CLAUDE_CODE_SKIP_EXT_PROMPT": "0"
}
}
```
### Variables to NEVER Add Automatically
- `ANTHROPIC_API_KEY` - User-specific, no default
- `CLAUDE_CODE_USE_BEDROCK` - Provider choice, user decision
- `CLAUDE_CODE_USE_VERTEX` - Provider choice, user decision
- `AWS_*` - AWS credentials, user-specific
- `GOOGLE_*` - Google credentials, user-specific
- `HTTP_PROXY` / `HTTPS_PROXY` - Network-specific
- `CLAUDE_HOOK_*` - Repository-specific hook variables
## Phase 4: Preview Changes
Display what will be added:
```markdown
## Environment Variable Sync Preview
### Target: .claude/settings.json
### Variables to Add
| Variable | Default | Reason |
|----------|---------|--------|
| DISABLE_AUTOUPDATER | "0" | Official default, not in current settings |
| ... | ... | ... |
### Variables Skipped (Already Set)
| Variable | Current Value |
|----------|---------------|
| DISABLE_TELEMETRY | "1" |
| ... | ... |
### Variables Skipped (No Safe Default)
| Variable | Reason |
|----------|--------|
| ANTHROPIC_API_KEY | User-specific, no universal default |
| ... | ... |
```
## Phase 5: User Confirmation
Unless `--dry-run` is specified, ask for confirmation:
```yaml
AskUserQuestion:
question: "Apply these changes to settings?"
options:
- "Yes, apply changes"
- "No, abort"
- "Show me the full file preview first"
```
If `--dry-run`, stop here and report "Dry run complete. No changes made."
## Phase 6: Apply and Validate
1. **Read current file** (or create new if doesn't exist)
2. **Merge new env vars** into existing `env` section
3. **Preserve existing values** - never overwrite user-set values
4. **Alphabetical order** - sort env vars alphabetically
5. **Write updated file**
6. **Validate JSON** - ensure file is valid JSON after write
7. **Report success**
### File Structure
```json
{
"env": {
"CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR": "0",
"DISABLE_AUTOUPDATER": "0",
"DISABLE_TELEMETRY": "0"
}
}
```
If file has other sections (permissions, hooks, etc.), preserve them.
## Error Handling
| Error | Action |
|-------|--------|
| Target file not valid JSON | Report error, do not modify |
| Write permission denied | Report error with path |
| Discovery failed | Report partial results, ask to continue |
## Post-Sync Verification
After applying changes:
1. Read back the modified file
2. Validate JSON syntax
3. Confirm all intended changes were applied
4. Report any discrepancies
## Example Output
```markdown
## Sync Complete
**Target:** .claude/settings.json
### Added (3 variables)
- CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR = "0"
- DISABLE_AUTOUPDATER = "0"
- CLAUDE_CODE_SKIP_EXT_PROMPT = "0"
### Preserved (1 variable)
- DISABLE_TELEMETRY = "1" (user-set value kept)
### Skipped (2 variables)
- ANTHROPIC_API_KEY (no safe default)
- CLAUDE_CODE_USE_BEDROCK (provider choice)
**File validated:** JSON syntax OK
```
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.