Initialize Project
Purpose
This skill automates the initial setup of a new project derived from this template. It leverages AI capabilities to directly modify project metadata and documentation by replacing placeholders, ensuring a clean start for a new repository.
Instructions
- •Gather Information: Ask the user for:
- •New project name (e.g.,
my-awesome-app) - •Project description
- •Author name
- •(Optional) GitHub repository URL
- •New project name (e.g.,
- •Update Project Metadata: Directly update the following files using the
WriteorStrReplacetools:- •
package.json: Updatename,description, andauthor. - •
packages/common/package.json: Update the package name to match the new scope (e.g.,@new-name/common). - •
.trunk/trunk.yaml: If there are template-specific references, update them.
- •
- •Update README Placeholders: Use the
StrReplacetool to replace the placeholders inREADME.mdwith the gathered information:- •
{PROJECT_NAME}-> New project name - •
{PROJECT_DESCRIPTION}-> Project description - •
{LICENSE}->ISC(or other preferred license)
- •
- •Install Dependencies: Run
pnpm installto update the lockfile with the new package names. - •Final Cleanup: Remove the initialization skill and its related files once bootstrapping is complete, if requested by the user.
Examples
Example 1: Initializing a new CLI tool
Input: User says "Initialize this project as 'json-fixer', a CLI tool to fix broken JSON files." Action:
- •Gather details from the user (Name: json-fixer, Description: A CLI tool to fix broken JSON files, Author: [Author Name]).
- •Update
package.jsonwith the new metadata. - •Use
StrReplaceonREADME.mdto swap{PROJECT_NAME},{PROJECT_DESCRIPTION}, and{LICENSE}with the actual values. - •Run
pnpm install.