agentleFS
finograficfinografic/ai-agent-config/.agents/skills/scaffold-cli-help/SKILL.md

scaffold-cli-help

Skill0 starsChanged 3 months agoMITView on GitHub

Define or update root CLI help for @finografic CLI projects using HelpConfig in src/cli.help.ts and renderHelp from core/render-help. Use when adding commands, changing help layout, or aligning help with the normalized pattern.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

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

    Keep this skill procedural.

    line 22
  2. Very specific:

    Do not import help types from src/types/ or utils/.

    line 40
  3. Very specific:

    Wire src/cli.ts: import renderHelp from core/render-help and cliHelp from ./cli.help.js (use .js extension if the project uses …

    line 55
  4. Very specific:

    Add a row to commands.list (keep descriptions one line).

    line 63
  5. Distinctive:

    Add Examples entries where users will copy-paste real invocations.

    line 64
  6. Very specific:

    Update any command-specific help files (src/help/*.help.ts) if this repo splits per-command help — root skill covers root HelpConfig only.

    line 65
  7. Very specific:

    Do not duplicate renderHelp logic in application code.

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Scaffold / maintain CLI help (cli.help.ts)

This skill applies the typed root help pattern used across @finografic CLI tools (genx, gli, and scaffolds from genx).

Read first (repo — canonical for this repository)

  • .agents/instructions/project/cli-help-patterns.instructions.md — rules, file locations, HelpConfig shape, examples/footer conventions.

Deeper spec (canonical — in this repo)

  • docs/spec/CLI_CORE.md — full core/render-help API (HelpConfig, renderHelp, section shapes), export table, and examples.

Optional context: A temporary bulk-task folder in a monorepo (e.g. ___REFACTORING___) may hold REPORT_CLI_NORMALIZATION.md with migration history. That path is not canonical; use it when you have it for background, not as the spec.

Keep this skill procedural; link to docs/spec/CLI_CORE.md for authoritative types and tables.

Prerequisites

  • src/core/render-help/ exists (shared module; do not rewrite the renderer unless intentionally changing core/ across all CLI repos).
  • tsconfig.json includes "core/*": ["./src/core/*"] (or equivalent).
  • You know the CLI binary name (e.g. genx) and the commands to list.

Procedure

  1. Open or create src/cli.help.ts at the repository root of src/ (never nested under commands/ for root help).
  2. Import types from the barrel only:

    import type { HelpConfig } from 'core/render-help';

    Do not import help types from src/types/ or utils/.

  3. Export a single named config cliHelp (not default export):

    export const cliHelp: HelpConfig = {
      main: { bin: '…', args: '<command> [options]' },
      // commands, examples, footer — see instruction file
    };
  4. Follow section conventions (details in the instruction file):
    • examples: label = human description, description = exact command line.
    • footer: label may use <placeholder> tokens; description optional dim line.
  5. Wire src/cli.ts: import renderHelp from core/render-help and cliHelp from ./cli.help.js (use .js extension if the project uses verbatimModuleSyntax). Call renderHelp(cliHelp) only from the CLI entry / help branch — not inside cli.help.ts.
  6. Optional shared defaults: genx uses defaultHelpOptions from config/help.config for minWidth / alignment — follow existing project pattern if present.
  7. Verify: pnpm typecheck and run the binary with --help or no args to confirm layout.

When adding a new command

  • Add a row to commands.list (keep descriptions one line).
  • Add Examples entries where users will copy-paste real invocations.
  • Update any command-specific help files (src/help/*.help.ts) if this repo splits per-command help — root skill covers root HelpConfig only.

Design constraints

  • Root help stays declarative data (HelpConfig); rendering is centralized in core/render-help.
  • Do not duplicate renderHelp logic in application code.

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.