scripts — templates

Module: scripts-templates Cohesion: 0.80 Members: 0

scripts — templates

The scripts/templates module serves as a comprehensive library of reusable FCS (FCS Script) templates designed to automate common development tasks. These scripts cover areas such as documentation generation, code refactoring, workspace synchronization, testing, and general project utilities.

The module is structured to provide a central entry point (index.fcs) for discovering available templates, which are then organized into logical subdirectories.

Module Structure

The scripts/templates module is organized into the following subdirectories, each containing related scripts:

The index.fcs script provides a categorized list of all available templates, their descriptions, usage examples, and required/optional environment variables.

graph TD
    A[scripts/templates/index.fcs] --> B(Documentation)
    A --> C(Refactoring)
    A --> D(Testing)
    A --> E(Utilities)
    A --> F(Sync)

    B --> B1[add-tsdoc.fcs]
    B --> B2[changelog.fcs]
    B --> B3[generate-docs.fcs]

    C --> C1[cleanup-imports.fcs]
    C --> C2[extract-function.fcs]
    C --> C3[rename-symbol.fcs]

    D --> D1[coverage-report.fcs]
    D --> D2[generate-tests.fcs]
    D --> D3[run-tests.fcs]

    E --> E1[project-stats.fcs]

    F --> F1[sync-diff.fcs]
    F --> F2[sync-push.fcs]
    F --> F3[sync-restore.fcs]
    F --> F4[sync-status.fcs]
    F --> F5[workspace-snapshot.fcs]

Getting Started

To explore the available templates and their usage, run the index.fcs script:

/fcs run scripts/templates/index.fcs

This will print a detailed list of all templates, categorized by their purpose, along with instructions on how to run them and the environment variables they accept.

To run a specific template, use the /fcs run command followed by the script's path and any necessary environment variables:

FILE=src/utils/helper.ts /fcs run scripts/templates/documentation/add-tsdoc.fcs

Core Concepts and Utilities

Many scripts in this module leverage common FCS features and global objects: