Skip to content

matthewwong525/WongStack / .agents/plugins/browser

browser

Verified

The person's own browser, for errands.

scripts/lib/cli.mjs

View on GitHub
// The browser module's copy of memory's cli.mjs, so the module imports nothing outside its folders.
// `--help` exits 0; a usage error or unknown flag exits 2. cli-conventions.test.mjs keeps the two equal.
import { realpathSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { parseArgs } from 'node:util';

/** True when the module at `url` is the script node was started with, even through a symlink. */
export function isMain(url) {
  try {
    return Boolean(process.argv[1]) && realpathSync(process.argv[1]) === realpathSync(fileURLToPath(url));
  } catch {
    return false;
  }
}

/** Print a usage error and exit 2. */
export function usageError(usage, message) {
  console.error(message ? `${message}\n${usage}` : usage);
  process.exit(2);
}

/** Strict `parseArgs` with `--help`. Returns `{ values, positionals }`. */
export function parseCli({ usage, options = {}, allowPositionals = false, args = process.argv.slice(2) }) {
  let parsed;
  try {
    parsed = parseArgs({ args, options: { ...options, help: { type: 'boolean' } }, allowPositionals, strict: true });
  } catch (error) {
    usageError(usage, error.message);
  }
  if (parsed.values.help) {
    console.log(usage);
    process.exit(0);
  }
  return parsed;
}
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall