agentleFS
finograficfinografic/ai-skills/skills/scaffold-core-module/SKILL.md

scaffold-core-module

Skill0 starsChanged 3 months agoMITView on GitHub

Add or modify a portable module under src/core/ in @finografic CLI projects — folder layout, barrel exports, TypeScript rules, and cross-repo propagation. Use when introducing new shared infrastructure or syncing core with gli/genx.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. finografic/ai-agent-config★ 0100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

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

    Use docs/spec/CLI_CORE.md when designing a new module or documenting exports.

    line 22
  2. Very specific:

    No imports from repo aliases (utils/*, config/*, commands/*, types/*).

    line 27
  3. Very specific:

    No side effects on import (beyond const init).

    line 28
  4. Very specific:

    Add {module-name}.types.ts and tests if needed per docs/spec/CLI_CORE.md.

    line 39
  5. Very specific:

    tsconfig: ensure "core/*": ["./src/core/*"] exists under compilerOptions.paths.

    line 54
  6. Very specific:

    Update docs/spec/CLI_CORE.md in genx (Current Modules / new section).

    line 64
  7. Distinctive:

    Consider a genx template or feature so new scaffolds include the module if applicable.

    line 66
  8. Very specific:

    Do not pull app-layer code into core/ to “fix” a single repo.

    line 71
  9. Distinctive:

    Before considering a module “done”:

    line 79

≈ “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 a src/core/ module

This skill applies the portable infrastructure layer pattern: code in src/core/ is treated like a shared library, kept in sync across @finografic CLI repos by convention.

Read first (repo — canonical for this repository)

  • .agents/instructions/project/core-module-patterns.instructions.md — folder layout, rules, imports, picocolors, header comment, current module table.

Deeper spec (canonical — in this repo)

  • docs/spec/CLI_CORE.md — full CLI Core Module Spec: what core/ is, TypeScript rules, consuming from app code, Adding a New core/ Module checklist, and Current Modules (core/flow/, core/render-help/).

Optional context: A monorepo may use a temporary bulk-task folder (e.g. ___REFACTORING___) for staging reports during large migrations. That folder is not canonical. If REPORT_CLI_NORMALIZATION.md (or similar) exists there, it can add historical “why we moved” notes — use it when present; do not treat it as the source of truth for the spec.

Use docs/spec/CLI_CORE.md when designing a new module or documenting exports; keep this skill as the procedure, not a duplicate of the spec.

Prerequisites

  • The module is useful in more than one @finografic CLI project (not app-specific logic).
  • No imports from repo aliases (utils/*, config/*, commands/*, types/*).
  • No side effects on import (beyond const init).
  • Single clear responsibility.

Procedure — new module

  1. Choose a kebab-case folder name under src/core/{module-name}/.
  2. Create files (minimum pattern):

    • {module-name}.utils.ts — implementation (or types-only module if appropriate).
    • index.ts — barrel only public API; named re-exports, no default exports.

    Add {module-name}.types.ts and tests if needed per docs/spec/CLI_CORE.md.

  3. Implementation file header (required on *.utils.ts):

    // ⚠️ AVOID EDITING THIS FILE DIRECTLY — changes must be propagated to all @finografic CLI repos
  4. TypeScript rules (core-only):
    • Top-level functions: function keyword, not const arrow for exported module-level functions.
    • Explicit return types on exports (and internal helpers where practical).
    • Named exports only through the barrel.
    • Relative imports inside the module use .js extensions in import paths where the project uses that rule.
    • Picocolors: import pc from 'picocolors' — never utils/picocolors from core/.
  5. tsconfig: ensure "core/*": ["./src/core/*"] exists under compilerOptions.paths.
  6. App code imports only from barrels:

    import { createFlowContext } from 'core/flow';
    import type { HelpConfig } from 'core/render-help';
  7. Cross-repo workflow (required for real core/ changes):
    • Update docs/spec/CLI_CORE.md in genx (Current Modules / new section).
    • Propagate the same files (or a reviewed diff) to every @finografic CLI repo that ships that module.
    • Consider a genx template or feature so new scaffolds include the module if applicable.

Procedure — edit existing module

  • Assume changes may need identical patches in genx, gli, and any other consumer.
  • Do not pull app-layer code into core/ to “fix” a single repo.

Related skills

  • scaffold-cli-help — consumer of core/render-help; use when only changing cli.help.ts and not adding a new core package.

Checklist (copy from docs/spec/CLI_CORE.md)

Before considering a module “done”:

  • Useful across multiple CLI projects
  • No repo-specific alias imports
  • No import side effects
  • Single responsibility
  • Barrel index.ts present
  • ⚠️ header on implementation files
  • core/* path alias in tsconfig.json
  • Documented in docs/spec/CLI_CORE.md (genx)
  • Propagated to other repos as needed

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.