Skip to content

AElfProject/aelf-skills

aelf-skills-hub

Verified

Discovery, download, and configuration hub for the entire aelf agent skill ecosystem. Use when the user wants to: (1) explore or list available aelf skills, (2) install/bootstrap aelf skills into Cursor, Claude Desktop, OpenClaw, Codex, or Claude Code, (3) route an aelf-related intent to the correct skill, (4) check health or audit installed skills, (5) onboard a new skill into the aelf ecosystem. Covers domains: Portkey CA wallet, Portkey EOA wallet, Awaken DEX, eForest NFT marketplace, AelfScan explorer, TomorrowDAO governance, aelf node interaction.

scripts/health-check.ts

View on GitHub
import path from 'node:path';
import { existsSync } from 'node:fs';
import type { SkillsCatalog } from './lib/types.ts';
import { readJsonFile, parseCsv, writeJsonFile } from './lib/utils.ts';
import { buildCatalog, writeCatalogArtifacts } from './lib/catalog.ts';
import { printHealthReport, runHealthCheck } from './lib/health.ts';
import { maybePrintUpdateReminder } from './lib/update-check.ts';

interface CliOptions {
  catalogPath: string;
  skillsRoot?: string;
  onlyIds: string[];
}

function parseArgs(): CliOptions {
  const args = process.argv.slice(2);
  let catalogPath = path.resolve(process.cwd(), 'skills-catalog.json');
  let skillsRoot: string | undefined;
  let only = '';

  for (let i = 0; i < args.length; i += 1) {
    const arg = args[i];
    if (arg === '--catalog' && args[i + 1]) {
      catalogPath = path.resolve(process.cwd(), args[i + 1]);
      i += 1;
      continue;
    }

    if (arg === '--skills-root' && args[i + 1]) {
      skillsRoot = path.resolve(process.cwd(), args[i + 1]);
      i += 1;
      continue;
    }

    if (arg === '--only' && args[i + 1]) {
      only = args[i + 1];
      i += 1;
      continue;
    }
  }

  return {
    catalogPath,
    skillsRoot,
    onlyIds: parseCsv(only),
  };
}

function ensureCatalog(catalogPath: string): void {
  if (existsSync(catalogPath)) return;
  console.log(`[INFO] ${catalogPath} not found. Generating from workspace.json ...`);
  const catalog = buildCatalog();
  const defaultCatalogPath = path.join(process.cwd(), 'skills-catalog.json');
  if (path.resolve(catalogPath) === path.resolve(defaultCatalogPath)) {
    writeCatalogArtifacts(catalog, { rootDir: process.cwd() });
    return;
  }

  writeJsonFile(catalogPath, catalog);
}

async function main(): Promise<void> {
  try {
    await maybePrintUpdateReminder();

    const options = parseArgs();
    ensureCatalog(options.catalogPath);

    const inputCatalog = readJsonFile<SkillsCatalog>(options.catalogPath);

    // When --skills-root is not provided, health-check uses local-path mode generated from workspace.json,
    // so public catalogs can safely omit sourcePath.
    let checkCatalog = inputCatalog;
    let onlyIds = options.onlyIds;

    if (!options.skillsRoot) {
      const hasSourcePath = inputCatalog.skills.every(skill => Boolean(skill.sourcePath));
      if (!hasSourcePath) {
        checkCatalog = buildCatalog({ includeLocalPaths: true });
        if (onlyIds.length === 0) {
          onlyIds = inputCatalog.skills.map(skill => skill.id);
        }
      }
    }

    const report = runHealthCheck(checkCatalog, {
      skillsRoot: options.skillsRoot,
      onlyIds,
    });

    printHealthReport(report);

    if (report.summary.fail > 0) {
      process.exitCode = 1;
    }
  } catch (error) {
    const message = error instanceof Error ? error.message : String(error);
    console.error(message.startsWith('[FAIL]') ? message : `[FAIL] ${message}`);
    process.exitCode = 1;
  }
}

void main();
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall