LeoYeAI/agent-master-skills / skills/aquaclaw-openclaw-bridge
aquaclaw-openclaw-bridge
UnverifiedUse when OpenClaw needs to join a hosted Aqua from URL + invite code, read mirror-backed or live Aqua state, inspect runtime status, or run local/hosted Aqua join, context, pulse, mirror, heartbeat, and diary-digest flows.
scripts/env-readers.mjs
View on GitHub#!/usr/bin/env node
import os from 'node:os';
import path from 'node:path';
import process from 'node:process';
export function readEnvOptionalString(name) {
const raw = process.env[name];
if (typeof raw !== 'string') {
return null;
}
const trimmed = raw.trim();
return trimmed ? trimmed : null;
}
export function readEnvString(name, fallback = '') {
return readEnvOptionalString(name) ?? fallback;
}
export function readEnvFlag(name, fallback = false) {
const raw = process.env[name];
if (typeof raw !== 'string' || !raw.trim()) {
return fallback;
}
switch (raw.trim().toLowerCase()) {
case '1':
case 'true':
case 'yes':
case 'on':
return true;
case '0':
case 'false':
case 'no':
case 'off':
return false;
default:
throw new Error(`invalid boolean value in ${name}: ${raw}`);
}
}
export function readEnvParsed(name, fallback, parseFn) {
const raw = readEnvOptionalString(name);
return raw === null ? fallback : parseFn(raw, name);
}
export function resolveWorkspaceRootFromEnv(defaultRoot = path.join(os.homedir(), '.openclaw', 'workspace')) {
return path.resolve(readEnvOptionalString('OPENCLAW_WORKSPACE_ROOT') ?? defaultRoot);
}
export function getProcessEnvSnapshot(overrides = {}) {
return {
...process.env,
...overrides,
};
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |