Skip to content

LedgerHQ/lumen / .claude/skills/consumer-impact

consumer-impact

Verified

Use when asked to test a Lumen change against consumer repos before releasing it: a breaking or architectural change, a lint-plugin upgrade, peer/prod dependency moves, build or packaging changes, or to check how consumers use a component, prop or variant. Runs the change (or a usage scan) across the production consumers in the adoption registry and outputs a shareable HTML report.

FileKindSize
SKILL.mdskill md4.8 KB
assets/report-template.htmlother7.8 KB
scripts/scan-manifests.mjsscript2.2 KB

scripts/scan-manifests.mjs

View on GitHub
#!/usr/bin/env node
// Print the dependencies matching a regex for every production consumer's Lumen
// workspace(s), read through the GitHub API (no clone). Output: TSV
// `repo<TAB>file<TAB>name=version ...`. Needs an authenticated `gh`.
//
// Usage: node scan-manifests.mjs '<dependency-name regex>'
import { execFileSync } from 'node:child_process';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';

const root = execFileSync('git', ['rev-parse', '--show-toplevel'], {
  encoding: 'utf8',
}).trim();
const registry = JSON.parse(
  readFileSync(
    join(root, 'internals/adoption-tool/data/consumers.json'),
    'utf8',
  ),
);
const match = new RegExp(process.argv[2] ?? '^@ledgerhq/lumen-');

/** @param {string} repo @param {string} path @returns {string | null} */
const readFile = (repo, path) => {
  try {
    const b64 = execFileSync(
      'gh',
      ['api', `repos/${repo}/contents/${path}`, '-q', '.content'],
      {
        encoding: 'utf8',
        stdio: ['ignore', 'pipe', 'ignore'],
      },
    );
    return Buffer.from(b64, 'base64').toString('utf8');
  } catch {
    return null;
  }
};

for (const entry of registry.filter((e) => e.status === 'production')) {
  const paths = new Set([
    entry.packageJsonPath,
    ...Object.values(entry.packageJsonPaths ?? {}).flat(),
  ]);
  for (const path of paths) {
    const raw = readFile(entry.repo, path);
    if (!raw) {
      console.log(`${entry.repo}\t${path}\tFETCH_FAILED`);
      continue;
    }
    const pkg = JSON.parse(raw);
    const deps = {
      ...pkg.peerDependencies,
      ...pkg.devDependencies,
      ...pkg.dependencies,
    };
    const hits = Object.entries(deps)
      .filter(([name]) => match.test(name))
      .map(([name, version]) => `${name}=${version}`);
    console.log(`${entry.repo}\t${path}\t${hits.join(' ')}`);
  }
  // pnpm catalogs pin the real versions; `catalog:` in package.json says nothing.
  if (/catalog/.test(entry.notes ?? '')) {
    const ws = readFile(entry.repo, 'pnpm-workspace.yaml') ?? '';
    const hits = ws
      .split('\n')
      .map((line) => line.trim())
      .filter((line) => match.test(line.split(':')[0].replace(/["']/g, '')));
    console.log(`${entry.repo}\tpnpm-workspace.yaml\t${hits.join(' ')}`);
  }
}
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall