Skip to content

Commit 9e25efe

Browse files
committed
feat(commands): add /scaffold command for project initialization
1 parent 7ee21a1 commit 9e25efe

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

.gemini/commands/scaffold.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
description = "Scaffold a new project using modern standard practices and tooling (e.g., Python/uv, JS/npm, Rust, Go, C#)."
2+
3+
prompt = """
4+
You are an expert system architect and project scaffolder. Your goal is to initialize a new project from scratch, using modern, standard tooling for the chosen tech stack.
5+
6+
### Phase 1: Requirement Gathering
7+
1. Ask the user a series of structured questions (using `ask_user`) to determine their preferences:
8+
- Primary programming language and framework (e.g., Python/FastAPI, TypeScript/React, Rust/Axum).
9+
- Tooling preferences (e.g., `uv` vs `poetry` for Python, `pnpm` vs `npm` for JS).
10+
- Repository architecture (e.g., single app, monorepo with multiple services/packages).
11+
- Any specific linting, formatting, or testing frameworks they want to enforce.
12+
13+
### Phase 2: Planning
14+
1. Based on the answers, create a highly detailed, step-by-step scaffolding plan in a temporary file (e.g., `plans/scaffold.md`).
15+
2. The plan MUST prioritize using native scaffolding tools (e.g., `uv init`, `npm create`, `cargo new`, `go mod init`, `dotnet new`) over manual file creation.
16+
3. The plan MUST include the installation of necessary dependencies (e.g., `pytest`, `ruff`, `eslint`, `prettier`).
17+
4. The plan MUST include the creation or updating of a `makefile` in the project root. The `makefile` must define `test`, `lint`, and `build` (if applicable) targets. Crucially, the default `make` command (the `all` or first target) MUST run the minimal `lint` + `test` combination to ensure compatibility with the `.gemini/hooks/check_make.py` hook.
18+
5. Present the plan to the user for review and await explicit approval.
19+
20+
### Phase 3: Execution
21+
1. Once the user approves the plan, execute it step-by-step using `run_shell_command`.
22+
2. **IMPORTANT:** Use non-interactive flags for all scaffolding tools (e.g., `-y`, `--yes`, `--force`) to prevent commands from hanging.
23+
3. After the tools finish, write or append to the `makefile` using the `write_file` tool.
24+
4. Run `make` to verify that the default target successfully executes the linters and tests.
25+
5. Provide a final summary of the scaffolded project.
26+
"""

.gemini/hooks/welcome.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def main():
4040
git_status,
4141
" ",
4242
"🛠️ Available Commands:",
43+
"- `/scaffold`: Scaffold a new project.",
4344
"- `/task`: Manage tasks, create, update, or work.",
4445
"- `/commit`: Prepare and commit changes.",
4546
"- `/maintainance`: Project maintenance tasks.",

journal/2026-02-28.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
- Consolidated `/task/*` commands (`create`, `work`, `report`, `update`) into a single `/task` command in `.gemini/commands/task.toml`.
2+
- Added a new `/scaffold` command to initialize new projects with modern standard practices and tooling.

0 commit comments

Comments
 (0)