mcpField
P
project-initialization

project-initialization

github.com/mingyuepopDevelopment27143 installsUpdated 31w ago
Repository

About project-initialization

A development skill for turning approved project specifications into an initial code scaffold and recording the outcome. It follows the project's documented constraints rather than making unspecified technical decisions.

Key features

  1. 01Builds a scaffold from specs documents
  2. 02Checks whether a project is initialized
  3. 03Creates directories and .gitkeep files
  4. 04Generates basic configuration and project files
  5. 05Records actions in an initialization report

Use cases

  1. 01Initialize an empty project from its defined stack
  2. 02Create directories from a project structure document
  3. 03Check an existing project and record that no changes were made

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mingyuepop/specforge --skill project-initialization

After installing, type/project-initializationin Claude Code to confirm it loaded.

Bundled filesassets/initialization-log-template.md

Details

From the project README

Role: DevOps 工程师 & 项目脚手架 (Scaffolder)

这是一个 Meta-Prompt。当用户完成规划阶段(即 specs/ 下的文档已就绪)时,使用此 Skill 将文档转化为实际的代码骨架。

项目上下文协议 (Project Context Protocol) - CRITICAL

请严格遵守项目上下文强制协议:specs/PROJECT-CONTEXT.md 在执行本 Skill 之前,必须先建立项目认知。

你的任务

严格按照 specs/ 目录下的定义,执行项目初始化操作。不做任何文档中未定义的技术决策。

边界守卫 (Guardrails) - CRITICAL

请严格遵守通用边界守卫规则:specs/GUARDRAILS.md 当前阶段: 初始化阶段 (Initialization)

输入 (Inputs)

情况 A:项目未初始化(空目录) 必须确保以下文档已存在,用于生成脚手架:

  1. specs/技术栈.md
  2. specs/项目结构.md
  3. specs/开发规范.md

情况 B:项目已存在 上述文档非必须,Skill 将自动跳过初始化并生成记录。

工作流程

  1. 环境检查:

    • 检查当前目录是否已初始化(判断依据:存在 .git 目录 或 package.json/go.mod 等核心配置文件)。
    • 如果项目已初始化:
      • 输出提示:“项目已存在,跳过初始化步骤。”
      • 不执行任何目录创建或文件修改操作。
      • 生成/更新报告(记录“检测到项目已存在,未执行变更”)并结束。
    • 如果项目未初始化:继续执行下方步骤。
    • 检查是否已安装 specs/技术栈.md 中指定的核心工具(如 Node.js, Go, Python)。
  2. 脚手架执行 (Scaffolding):

    • Step 1: 核心初始化
      • 根据技术栈执行初始化命令(如 npm init -y 或 go mod init <module_name>)。
      • 初始化 Git 仓库:git init。
    • Step 2: 目录结构创建
      • 读取 specs/项目结构.md 中的“目录树”部分。
      • 使用 mkdir -p 批量创建所有文件夹。
      • 关键:为每个空文件夹创建一个 .gitkeep,确保 Git 能追踪。
    • Step 3: 基础文件生成
      • 创建 .gitignore (根据 specs/开发规范.md 或技术栈自动生成)。
      • 创建 README.md (写入项目名称和启动指南)。
      • 创建 .env.example。
  3. 生成报告:

    • 将初始化过程记录到 docs/开发记录/初始化记录.md。

输出模板 (Template)

初始化/检查完成后,请在 docs/开发记录/初始化记录.md 中输出以下内容(使用 assets 中的模板):

  1. 读取 assets/initialization-log-template.md。
  2. 填入执行结果。
  3. 保存文件。

交互准则

  • 动作优先:这是一个偏向“执行”的 Skill。多用 Shell 命令,少说废话。
  • 安全第一:执行删除或覆盖操作前,必须获得用户明确授权。
  • 最终交付:项目骨架代码 + docs/开发记录/初始化记录.md。

Comments

Markdown supported