init-new-repository
БесплатноЗапускает вложенные скриптыНе проверенInitialize a new repository from rapid-go template by renaming all identifiers (Go modules, proto namespaces, Docker networks, .claude files) and selecting…
от abyssparanoia★ 20 звёзд на GitHubОб этом скилле
Initialize New Repository from rapid-go Template
This skill automates the process of creating a new repository from the rapid-go template by:
- Renaming all rapid-go specific identifiers to your new project name
- Selecting and configuring database backend (MySQL or PostgreSQL)
- Updating all configuration files and documentation
- Cleaning up generated code for regeneration
Prerequisites
Before running this skill, ensure you have:
Copied the rapid-go repository to your new project location
Decided on your project details:
- Go module path (e.g.,
github.com/mycompany/awesome-api) - Service name (e.g.,
awesome- used for proto namespace and Docker network) - Database choice (
mysqlorpostgresql) - Project title (optional - defaults to service name in uppercase)
- Go module path (e.g.,
Python 3.x installed - The initialization script requires Python 3
Workflow
Step 1: Prepare Project Information
Gather the following information:
| Parameter | Example | Purpose |
|---|---|---|
--go-module |
github.com/mycompany/awesome-api |
New Go module import path |
--service-name |
awesome |
Service identifier (proto namespace, Docker network) |
--database |
postgresql |
Database to use (mysql or postgresql) |
--project-title |
Awesome API |
Human-readable project name (optional) |
Derived values (automatically calculated):
- Buf organization: Extracted from
--go-module(e.g.,mycompanyfromgithub.com/mycompany/awesome-api) - Docker network:
{service-name}-network(e.g.,awesome-network)
Step 2: Run Initialization Script
Navigate to your copied repository and run:
python3 .claude/skills/init-new-repository/scripts/init_repository.py \
--go-module github.com/mycompany/awesome-api \
--service-name awesome \
--database postgresql
Dry-run mode (preview changes without applying):
python3 .claude/skills/init-new-repository/scripts/init_repository.py \
--go-module github.com/mycompany/awesome-api \
--service-name awesome \
--database postgresql \
--dry-run
What the script does:
1. Renames proto directories:
schema/proto/rapid/→schema/proto/{service-name}/
2. Performs text replacements across all files:
- Go imports:
github.com/abyssparanoia/rapid-go→ your module path - Proto packages:
package rapid.*→package {service-name}.* - Proto imports:
import "rapid/*"→import "{service-name}/*" - Docker networks:
rapid-go-network→{service-name}-network - Buf registry:
buf.build/abyssparanoia/rapid→buf.build/{org}/{service-name} - Project titles:
RAPID GO→ your project title - .claude references: Updates all documentation
3. Database selection:
- Deletes unused database code:
- If
mysql: removesdb/postgresql/andinternal/infrastructure/postgresql/ - If
postgresql: removesdb/mysql/andinternal/infrastructure/mysql/
- If
- Updates Go import statements:
internal/infrastructure/dependency/dependency.go- switches database import aliases (mysql↔postgresql)internal/infrastructure/grpc/internal/handler/public/handler.go- switches database importsinternal/infrastructure/cmd/internal/schema_migration_cmd/database_cmd/cmd.go- toggles commented migration imports
- Updates configuration files:
Makefile- database-specific generation targets.envrc.tmpl- environment variablesdocker-compose.yml- removes unused database service
- Updates .claude documentation:
.claude/rules/repository.md- path pattern and import examples.claude/rules/dependency-injection.md- import examples
4. Cleans up generated code:
- Deletes
internal/infrastructure/grpc/pb/rapid/(will be regenerated) - Deletes
schema/openapi/rapid/(will be regenerated)
5. Verifies database consistency:
- Checks that all database-specific files are consistent with selected database
- Reports warnings if any inconsistencies are detected (script continues normally)
Step 3: Regenerate Code
After initialization completes, regenerate all generated code:
# 1. Copy environment template and configure
cp .envrc.tmpl .envrc
# Edit .envrc with your database credentials
# 2. Run database migrations and generate SQLBoiler models
make migrate.up
# 3. Regenerate protocol buffer code
make generate.buf
# 4. Regenerate mock files
make generate.mock
Step 4: Verify Changes
# 1. Review all changes
git status
git diff
# 2. Ensure dependencies are correct
go mod tidy
# 3. Run linter
make lint.go
# 4. Run tests
make test
# 5. Verify server starts
make http.dev
Step 5: Commit Changes
git add .
git commit -m "Initialize repository from rapid-go template"
Parameters Reference
--go-module (Required)
New Go module import path.
Format: {host}/{organization}/{repository}
Examples:
github.com/mycompany/awesome-api- `gitlab.com/myteam/payment-servi
Установить init-new-repository в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл init-new-repository?
Initialize a new repository from rapid-go template by renaming all identifiers (Go modules, proto namespaces, Docker networks, .claude files) and selecting database backend (MySQL or PostgreSQL). Use when porting rapid-go to a new project or creating a new microservice based on rapid-go architecture. Automates: Go import path replacement, proto namespace changes, database code removal, Docker configuration updates, and .claude documentation updates.
Как установить скилл init-new-repository?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл init-new-repository запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic