Skip to content

v1.19.0: Git Repository Initialization

Choose a tag to compare

@Data-Wise Data-Wise released this 15 Jan 21:14
· 577 commits to main since this release

Release v1.19.0: Git Repository Initialization

This release adds the /craft:git:init command with comprehensive repository initialization capabilities.

🆕 New Command: /craft:git:init

A complete git repository initialization wizard that automates:

  • Branch structure setup (3 workflow patterns)
  • GitHub integration with branch protection
  • CI workflow generation
  • Project template files
  • Safe transaction-based operations

Quick Start

# Interactive wizard
/craft:git:init

# Preview changes
/craft:git:init --dry-run

# Quick setup with defaults
/craft:git:init --yes --remote user/repo

# Via smart routing
/craft:do "initialize project"

✨ Features

Interactive 9-Step Wizard

  1. Repository Check - Detects existing repo or creates new
  2. Remote Setup - Local only, connect existing, or create GitHub repo
  3. Branch Structure - Choose workflow pattern
  4. Branch Protection - Configure GitHub protection rules
  5. CI Workflow - Auto-detect project type and generate workflow
  6. Project Files - Create .STATUS, CLAUDE.md, PR template
  7. Initial Commit - Conventional commit with co-author
  8. Push to Remote - Sync branches to GitHub
  9. Validation - Run /craft:check to verify setup

Workflow Patterns

Main + Dev (Default) - Team collaboration

main (protected) ← PR only
  ↑
dev (integration) ← Plan & integrate
  ↑
feature/* ← Development

Simple - Personal projects

main ← Direct commits

GitFlow - Complex releases

main ← Releases
  ↑
release/* ← Preparation
  ↑
develop ← Integration
  ↑
feature/* ← Development

GitHub Integration

  • ✅ Repository creation via gh repo create
  • ✅ Branch protection (require PR + CI)
  • ✅ Visibility settings (public/private)
  • ✅ Topics and labels
  • ✅ Admin bypass for emergencies

CI Auto-Detection

Supports:

  • Python (UV/Poetry/Pip)
  • Node.js (npm/yarn/pnpm)
  • Rust (Cargo)
  • Go (go mod)
  • Claude Code plugin validation
  • Generic shell template

Template System

.STATUS Template:

status: Initial Setup
version: 0.1.0-dev
progress: 0%
repo: https://github.com/{{USER}}/{{REPO}}

CLAUDE.md Template:

  • Git workflow documentation
  • Branch constraints
  • Quick commands
  • Troubleshooting guide

PR Template:

  • Summary checklist
  • Test plan
  • Breaking changes
  • Documentation updates

Safety Features

  • Dry-run mode - Preview without execution
  • Rollback-on-error - Automatic cleanup on failure
  • Transaction-based - All-or-nothing approach
  • Validation - Runs /craft:check after setup

📚 Documentation

Complete Reference (900 lines)

  • All arguments and options
  • Usage examples (basic + advanced)
  • 3 workflow patterns detailed
  • 9-step wizard flow
  • Error handling with rollback
  • Integration points
  • Best practices
  • Troubleshooting guide

Architecture Diagrams (11 Mermaid)

  • Command execution flowchart
  • Workflow pattern architecture
  • Component relationships
  • Data flow sequences
  • Error handling flow
  • Template processing
  • Integration map
  • State machine
  • File system operations

User Tutorial (650 lines)

  • 4 starting scenarios:
    • Brand new project
    • Existing code, no git
    • Existing repository
    • Dry-run preview
  • Step-by-step walkthrough
  • Common workflows
  • After initialization guidance
  • Troubleshooting solutions
  • Tips & best practices

Documentation Index

  • Role-based quick starts
  • Task-based navigation
  • Learning paths (quick/complete/team)
  • Coverage metrics
  • Search guide

✅ Testing

48 tests, 100% coverage

Test categories:

  • Command file structure
  • YAML frontmatter validation
  • Documentation completeness
  • Workflow patterns
  • Wizard steps
  • Template files
  • Hub integration
  • Getting started guide
  • Smart routing
  • Related commands
  • Error handling
  • Plugin manifest

📊 Metrics

Metric Before After Change
Total Commands 89 90 +1
Craft Commands 77 78 +1
Git Commands 4 5 +1
Documentation Lines - ~2,000 +2,000
Mermaid Diagrams - 11 +11
Tests - 48 +48

🔗 Integration

Smart Routing

Accessible via /craft:do with these phrases:

  • "initialize project"
  • "set up git"
  • "create repository"
  • "bootstrap project"
  • "new project setup"

Related Commands

  • /craft:git:worktree - Create feature branch worktree
  • /craft:git:branch - Branch operations
  • /craft:git:clean - Clean up merged branches
  • /craft:ci:generate - Generate CI workflow
  • /craft:check - Validate project structure

📁 Files Added

Command (1)

  • commands/git/init.md (473 lines)

Documentation (4)

  • docs/commands/git-init-reference.md (900 lines)
  • docs/architecture/git-init-flow.md (11 diagrams)
  • docs/guide/git-init-tutorial.md (650 lines)
  • docs/git-init-docs-index.md

Templates (3)

  • templates/git-init/STATUS-template.yaml
  • templates/git-init/CLAUDE-template.md
  • templates/git-init/pull_request_template.md

Tests (2)

  • tests/test_git_init_command.py (48 tests)
  • tests/git_init_test_report.md

Updates (3)

  • .claude-plugin/plugin.json - Version + count
  • commands/hub.md - Added git:init
  • docs/guide/getting-started.md - Initialization section

🎯 Use Cases

New Project

/craft:git:init
# → Complete setup with GitHub, CI, templates

Existing Code

cd existing-project
/craft:git:init
# → Add git workflow to existing code

Add Craft Workflow

cd existing-repo
/craft:git:init
# → Add dev branch + protection

Preview First

/craft:git:init --dry-run
# → See what would happen

🚀 Getting Started

  1. Run the wizard:

    /craft:git:init
  2. Follow the prompts to configure your repository

  3. Start developing:

    git checkout dev
    /craft:git:worktree feature/my-feature
  4. Read the docs:

💡 Tips

  • Always start from dev branch after initialization
  • Use dry-run to preview changes first
  • Enable branch protection for production projects
  • Generate CI early for quality gates
  • Customize templates for your team's standards

🔧 Requirements

  • Git 2.23+
  • GitHub CLI (gh) - Optional, for GitHub features
  • Python 3.8+ - For CI template generation (optional)

🐛 Known Issues

None

🙏 Acknowledgments

Developed by Claude Sonnet 4.5 as part of the craft plugin ecosystem.


Full Changelog: v1.18.1...v1.19.0

Documentation: https://data-wise.github.io/craft/
Repository: https://github.com/Data-Wise/craft