agentleFS
conectlensconectlens/lenserfight/.agents/skills/cli-developer/SKILL.md

cli-developer

Skill18 starsChanged 6 months agoMITView on GitHub

Review, modify, and improve the LenserFight CLI at apps/cli/. Covers citty commands, API client integration, output formatting, TUI, and configuration.

15 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default (lf with no subcommand) → opens the first-party TUI dashboard (tui/dashboard.ts)

    line 73
  2. Very specific:

    Never use fetch/axios directly — use callRpc / handleError from utils/api.ts

    line 77
  3. Distinctive:

    Never add NestJS, Prisma, or backend dependencies

    line 78
  4. Distinctive:

    Keep dependency footprint minimal (citty, consola, dotenv)

    line 79

“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Work on the LenserFight CLI (lf).

Scope

  • Source: apps/cli/src/**
  • Commands: apps/cli/src/commands/*.ts
  • Utilities: apps/cli/src/utils/ (api, output, auth, auth-recovery, ansi, error-reporter, profiles, supabase-client, automation-objects, battle-stream-broadcaster, local-battle-engine, local-battle-paths, local-battle-storage)
  • Libraries: apps/cli/src/lib/ (exec-context, safety, telemetry, redact, onboarding, combine-seeds, command-inventory)
  • TUI: apps/cli/src/tui/ (dashboard.ts + tui/ink/ — first-party dashboard, default lf behavior; runtime-telemetry — shared with lf top)
  • Adapters: apps/cli/src/adapters/

CLI Structure

  • src/main.ts — entry point, uses defineCommand + runMain from citty; binary name is lenserfight / lf
  • Each command file exports a defineCommand(...) default and is lazy-imported in main.ts
  • src/utils/api.ts — callRpc + handleError; all Supabase RPC calls go through here
  • src/utils/output.ts — printTable, printJson, truncate; uses consola for logging
  • src/utils/auth.ts + src/utils/supabase-client.ts — auth and Supabase client
  • src/utils/ansi.ts — ANSI helper A and symbols sym
  • src/lib/exec-context.ts — setExecContext / getExecContext for --local / --debug flags
  • src/lib/safety/ — assertSafe for input validation
  • src/lib/telemetry.ts — telemetry adapter

Command pattern

import { defineCommand } from 'citty';
import consola from 'consola';
import { callRpc, handleError } from '../utils/api';
import { printTable, printJson } from '../utils/output';

const subCommand = defineCommand({
  meta: { name: 'list', description: 'List items.' },
  args: {
    json: { type: 'boolean', default: false, description: 'Output as JSON' },
  },
  async run({ args }) {
    try {
      const data = await callRpc('fn_example', {});
      if (args.json) printJson(data);
      else printTable(['ID', 'Name'], data.map((r) => [r.id, r.name]));
    } catch (err) {
      handleError(err);
    }
  },
});

export default defineCommand({
  meta: { name: 'example', description: 'Example group.' },
  subCommands: { list: subCommand },
});

Registration in main.ts

const main = defineCommand({
  subCommands: {
    example: () => import('./commands/example').then((m) => m.default),
  },
});

Global flags

  • --local → sets LF_LOCAL=1 (parsed early via parseGlobalFlagsEarly before citty)
  • --debug → sets LF_DEBUG=1
  • Default (lf with no subcommand) → opens the first-party TUI dashboard (tui/dashboard.ts)

Constraints

  • Never use fetch/axios directly — use callRpc / handleError from utils/api.ts
  • Never add NestJS, Prisma, or backend dependencies
  • Keep dependency footprint minimal (citty, consola, dotenv)
  • Output via printTable / printJson / consola.* — never raw console.log
  • Build: pnpm nx build cli | Test: pnpm nx test cli

References

  • citty patterns and integration details: REFERENCE.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.