.agents/initialize-repository/SKILL.md
Meta-skill (Phase 0) for bootstrapping new repositories with workflow system. Interactive callable tool that copies skills, documentation, and standards from source repository. Use when: Starting a new project that needs the workflow system Triggers: "initialize new repository", "bootstrap workflow", "replicate workflow system"
npx skillsauth add stharrold/bingo initialize-repositoryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The initialize-repository meta-skill is a Phase 0 (bootstrapping) tool that replicates the complete workflow system from a source repository to a new target repository. It provides an interactive Q&A system to configure what components get copied and how they're adapted for the new context.
Key capabilities:
Token efficiency:
Use this meta-skill when:
NOT part of normal workflow phases (1-6). This is Phase 0, run once per repository to set up the environment for the other skills to operate.
python .claude/skills/initialize-repository/scripts/initialize_repository.py \
<source-repo> <target-repo>
Arguments:
source-repo: Path to source repository (with workflow system)target-repo: Path to target repository (will be created)# Initialize new repository from current repo
python .claude/skills/initialize-repository/scripts/initialize_repository.py \
/path/to/german /path/to/my-new-project
# From current directory (source repo)
python .claude/skills/initialize-repository/scripts/initialize_repository.py \
. ../my-new-project
The script conducts a 4-phase interactive Q&A session:
Repository details:
gh CLI)Technology stack: 5. Python version (3.11 / 3.12 / 3.13)
Components to copy: 6. Copy workflow system? (required, always yes) 7. Copy domain-specific content (src/, resources/)? (yes/no) 8. Copy sample tests (tests/)? (yes/no) 9. Copy container configs (Containerfile, podman-compose.yml)? (yes/no) 10. Copy CI/CD pipelines (.github/workflows/tests.yml, azure-pipelines.yml)? (yes/no)
Copied verbatim:
.claude/skills/ (all 9 skills including this one)WORKFLOW.md (complete workflow guide)CONTRIBUTING.md (contributor guidelines).claude/skills/UPDATE_CHECKLIST.md (skill update checklist).gitignore (git exclusions)Generated/adapted:
README.md (customized for new repo purpose)CLAUDE.md (customized for new repo context)pyproject.toml (new repo name, purpose, dependencies)CHANGELOG.md (initial version 0.1.0)TODO.md (master workflow manifest)Created:
Optionally copied:
src/ and resources/ (if copy_domain = yes)tests/ (if copy_tests = yes)Containerfile, podman-compose.yml (if copy_containers = yes).github/workflows/tests.yml, azure-pipelines.yml (if copy_cicd = yes)If init_git = yes:
=== Phase 1: Configuration Selection ===
What is the primary purpose of this repository?
1) Web application
2) CLI tool
3) Library/package
4) Data analysis
5) Machine learning
6) Other
> 3
Brief description of the repository (one line):
> Python library for task automation
GitHub username [default: stharrold]
> stharrold
Python version
1) 3.11
2) 3.12
3) 3.13
[default: 3.11]
> 1
Which components should be copied?
Copy workflow system (.claude/skills/, WORKFLOW.md, etc.)? (Y/n)
> y
Copy domain-specific content (src/, resources/)? (y/N)
> n
Copy sample tests (tests/)? (y/N)
> y
Copy container configs (Containerfile, podman-compose.yml)? (y/N)
> n
Copy CI/CD pipelines (.github/workflows/tests.yml, azure-pipelines.yml)? (Y/n)
> y
✓ Configuration complete
=== Phase 2: Git Setup ===
Initialize git repository? (Y/n)
> y
Create branch structure (main, develop, contrib)? (Y/n)
> y
Set up remote repository? (y/N)
> y
Remote URL (e.g., https://github.com/user/repo.git):
> https://github.com/stharrold/my-new-project.git
✓ Git setup configuration complete
Review Configuration:
Source: /path/to/german
Target: /path/to/my-new-project
Name: my-new-project
Purpose: Library/package
GitHub User: stharrold
Copy workflow: True
Copy domain: False
Initialize git: True
Proceed with initialization? (Y/n)
> y
=== Phase 3: File Operations ===
ℹ Copying workflow skills...
✓ Copied skill: workflow-orchestrator
✓ Copied skill: tech-stack-adapter
✓ Copied skill: git-workflow-manager
✓ Copied skill: bmad-planner
✓ Copied skill: speckit-author
✓ Copied skill: quality-enforcer
✓ Copied skill: workflow-utilities
✓ Copied skill: initialize-repository
✓ Copied 9/9 skills
ℹ Copying workflow documentation...
✓ Copied: WORKFLOW.md
✓ Copied: CONTRIBUTING.md
✓ Copied: .claude/skills/UPDATE_CHECKLIST.md
ℹ Generating README.md...
✓ Generated README.md
ℹ Generating CLAUDE.md...
✓ Generated CLAUDE.md
ℹ Generating pyproject.toml...
✓ Generated pyproject.toml
ℹ Copying .gitignore...
✓ Copied .gitignore
ℹ Creating directory structure...
✓ Created: ARCHIVED/
✓ Created: planning/
✓ Created: specs/
✓ Created: tests/
✓ Directory structure created
ℹ Creating TODO.md master manifest...
✓ Created TODO.md master manifest
ℹ Creating CHANGELOG.md...
✓ Created CHANGELOG.md
ℹ Copying tests...
✓ Copied: tests/
ℹ Copying CI/CD pipelines...
✓ Copied: .github/workflows/tests.yml
✓ Copied: azure-pipelines.yml
✓ File operations complete
=== Phase 4: Git Initialization ===
ℹ Initializing git repository...
✓ Git initialized
ℹ Creating initial commit...
✓ Initial commit created on main
ℹ Creating develop branch...
✓ Created develop branch
ℹ Creating contrib/stharrold branch...
✓ Created contrib/stharrold branch
ℹ Setting up remote: https://github.com/stharrold/my-new-project.git
✓ Remote configured
Push to remote? (y/N)
> y
✓ Pushed to remote
✓ Git initialization complete
ℹ Validating repository structure...
✓ Repository structure validated
============================================================
✓ Repository Initialization Complete
============================================================
Repository: /path/to/my-new-project
Name: my-new-project
Purpose: Library/package
GitHub User: stharrold
Created:
✓ Workflow system (9 skills)
✓ Documentation (WORKFLOW.md, CLAUDE.md, CONTRIBUTING.md)
✓ Quality configs (pyproject.toml, .gitignore)
✓ Directory structure (ARCHIVED/, planning/, specs/)
✓ Tests (tests/)
✓ CI/CD pipelines (GitHub Actions + Azure Pipelines)
Git:
✓ Initialized repository
✓ Created branches: main, develop, contrib/stharrold
✓ Remote configured: https://github.com/stharrold/my-new-project.git
Next Steps:
1. cd /path/to/my-new-project
2. uv sync
3. Start first feature:
python .claude/skills/bmad-planner/scripts/create_planning.py \
my-feature stharrold
Documentation:
- README.md - Project overview
- WORKFLOW.md - Complete workflow guide
- CLAUDE.md - Claude Code interaction guide
- CONTRIBUTING.md - Contributor guidelines
🎉 Happy coding!
Skills (8 total):
.claude/skills/
├── workflow-orchestrator/ (~300 lines SKILL.md, orchestrator logic)
├── tech-stack-adapter/ (~200 lines, detect_stack.py)
├── git-workflow-manager/ (~500 lines, 8 scripts)
├── bmad-planner/ (~400 lines, 1006-line script, 3 templates)
├── speckit-author/ (~400 lines, 2 scripts, 2 templates)
├── quality-enforcer/ (~300 lines, 2 scripts)
├── workflow-utilities/ (~200 lines, 7 utility scripts)
└── initialize-repository/ (~400 lines, this meta-skill)
Documentation:
WORKFLOW.md (2,023 lines) - Complete 6-phase workflow guideCONTRIBUTING.md (575 lines) - Contributor guidelines with quality standards.claude/skills/UPDATE_CHECKLIST.md (393 lines) - Skill update checklistConfiguration:
.gitignore (290 chars) - Git exclusions for Python/IDE/OS filesREADME.md:
CLAUDE.md:
pyproject.toml:
CHANGELOG.md:
TODO.md:
target-repo/
├── .claude/
│ └── skills/ # 9 skills copied
├── ARCHIVED/ # With CLAUDE.md, README.md
├── planning/ # With CLAUDE.md, README.md, ARCHIVED/
├── specs/ # With CLAUDE.md, README.md, ARCHIVED/
├── src/ # Optional (if copy_domain = yes)
├── resources/ # Optional (if copy_domain = yes)
├── tests/ # Optional (if copy_tests = yes)
├── README.md # Generated
├── CLAUDE.md # Generated
├── WORKFLOW.md # Copied verbatim
├── CONTRIBUTING.md # Copied verbatim
├── CHANGELOG.md # Generated
├── TODO.md # Generated
├── pyproject.toml # Generated
└── .gitignore # Copied verbatim
Every directory (except ARCHIVED itself) contains:
CLAUDE.md - Context-specific guidanceREADME.md - Human-readable documentationARCHIVED/ subdirectory with its own CLAUDE.md and README.mdThese files are not modified during copying:
Workflow system:
.claude/skills/ files (SKILL.md, CLAUDE.md, scripts, templates)WORKFLOW.md (workflow is technology-agnostic)CONTRIBUTING.md (standards apply to all repos).claude/skills/UPDATE_CHECKLIST.md (update process unchanged).gitignore (Python/IDE exclusions standard)Rationale: These files define the workflow system itself and should be identical across all repositories using the system.
These files are customized for the new repository:
README.md:
gh CLICLAUDE.md:
pyproject.toml:
CHANGELOG.md:
TODO.md:
After running the script, the target repository will have:
8 workflow skills:
Complete documentation:
Quality configurations:
Compliant directory structure:
Optional git initialization:
Master workflow manifest:
This is NOT part of the normal 6-phase workflow. It's Phase 0 (bootstrapping).
Relationship to other phases:
Phase 0: Initialize Repository (this meta-skill)
↓ Creates environment for...
Phase 1: Planning (BMAD)
Phase 2: Development (SpecKit, feature worktrees)
Phase 3: Quality (quality-enforcer)
Phase 4: Integration (git-workflow-manager, PRs)
Phase 5: Release (release automation)
Phase 6: Hotfix (production fixes)
After running this meta-skill:
Does NOT interact with:
Use case:
Manual approach (without this meta-skill):
Total: ~3,500 tokens + manual work
Callable tool approach (with this meta-skill):
Total: ~200 tokens
Savings: ~3,300 tokens (94% reduction)
Additional benefits:
Before running:
gh CLI is authenticated (gh auth status)During Q&A:
After initialization:
uv sync to install dependenciesWhen to NOT use:
The initialize-repository script can be used with existing repositories, but requires careful planning because it overwrites certain files. This section provides guidance for safely applying the workflow system to existing projects.
⚠️ WARNING: The following files will be REPLACED:
Documentation files:
README.md - Replaced with generated README (your content will be lost)CLAUDE.md - Replaced with generated CLAUDE.md (your content will be lost)CHANGELOG.md - Replaced with initial v0.1.0 entry (your history will be lost)TODO.md - Replaced with master workflow manifest (if exists)Configuration files:
pyproject.toml - Replaced with generated config (your dependencies/settings will be lost).gitignore - Replaced with workflow system .gitignore (your exclusions will be lost)Workflow system:
.claude/skills/ - Created/merged (existing skills directory will be overwritten)✓ Your code and content remain untouched (unless you choose to copy domain content):
Source code:
src/ - Preserved (only overwritten if you select "copy domain content")resources/ - Preserved (only overwritten if you select "copy domain content")Tests:
tests/ - Preserved (only overwritten if you select "copy tests")All other files:
Before applying the workflow to an existing repository:
1. Clean git state:
cd /path/to/existing-repo
git status # Should show clean working tree
git commit -am "checkpoint: before applying workflow system"
2. Create backup branch:
git branch backup-before-workflow
git push origin backup-before-workflow # Optional: push to remote
3. Review files that will be overwritten:
# Check if you have content to preserve
ls -la README.md CLAUDE.md CHANGELOG.md pyproject.toml .gitignore
# Save important content from these files
mkdir -p /tmp/backup-docs
cp README.md CHANGELOG.md pyproject.toml .gitignore /tmp/backup-docs/
# CLAUDE.md might not exist yet
4. Decide on approach:
This approach applies the workflow to a test copy first, then selectively merges:
# Step 1: Create test copy of existing repository
cp -r /path/to/existing-repo /path/to/existing-repo-test
# Step 2: Apply workflow to test copy
python /path/to/source-with-workflow/.claude/skills/initialize-repository/scripts/initialize_repository.py \
/path/to/source-with-workflow \
/path/to/existing-repo-test
# Answer Q&A:
# - Repository purpose: [match your existing repo]
# - Description: [your existing repo description]
# - Copy workflow: yes (required)
# - Copy domain content: NO (preserve your existing src/)
# - Copy tests: NO (preserve your existing tests/)
# - Copy containers: [yes if you want workflow's container configs]
# - Initialize git: NO (already has git)
# Step 3: Review generated files in test copy
cd /path/to/existing-repo-test
cat README.md # Review generated README
cat CLAUDE.md # Review generated CLAUDE.md
cat pyproject.toml # Review generated config
# Step 4: Manually merge desired changes back to original
cd /path/to/existing-repo
# Copy workflow system (safe to overwrite)
cp -r /path/to/existing-repo-test/.claude .
# Merge documentation (manual)
# - Copy workflow sections from test/README.md to your README.md
# - Copy workflow sections from test/CLAUDE.md to your CLAUDE.md
# - Merge pyproject.toml dependencies (add pytest, ruff, mypy, coverage configs)
# - Merge .gitignore exclusions
# Copy workflow documentation (safe to add)
cp /path/to/existing-repo-test/WORKFLOW.md .
cp /path/to/existing-repo-test/CONTRIBUTING.md .
# Step 5: Create directory structure
python .claude/skills/workflow-utilities/scripts/directory_structure.py \
planning specs ARCHIVED
# Step 6: Create TODO.md master manifest
cat > TODO.md << 'EOF'
---
type: workflow-master-manifest
version: 5.0.0
last_update: "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
workflows:
active: []
archived: []
context_stats:
total_workflows_completed: 0
current_token_usage: 0
last_checkpoint: "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
---
# Master TODO Manifest
This is the master manifest tracking all workflow TODO files in this repository.
## Active Workflows
None currently active.
## Archived Workflows
None archived yet.
EOF
# Step 7: Commit workflow system
git add .claude/ WORKFLOW.md CONTRIBUTING.md TODO.md
git add planning/ specs/ ARCHIVED/ # If created
git commit -m "feat(workflow): integrate workflow v5.2 system
- Add 9 workflow skills for progressive development
- Add WORKFLOW.md, CONTRIBUTING.md documentation
- Add TODO.md master manifest
- Add compliant directory structure
Implements: Phase 0 workflow integration
Refs: initialize-repository v1.0.0"
# Step 8: Test workflow system
python .claude/skills/tech-stack-adapter/scripts/detect_stack.py
python .claude/skills/bmad-planner/scripts/create_planning.py test-feature $(git config user.name)
Benefits of Option A:
This approach applies the workflow directly, relying on git to track changes:
# Step 1: Ensure clean git state (CRITICAL)
cd /path/to/existing-repo
git status # MUST be clean
git commit -am "checkpoint: before workflow integration"
git branch backup-before-workflow
# Step 2: Save important content
mkdir -p .workflow-backup
cp README.md CHANGELOG.md .workflow-backup/
cp pyproject.toml .gitignore .workflow-backup/
# Step 3: Run initialize_repository.py
python /path/to/source-with-workflow/.claude/skills/initialize-repository/scripts/initialize_repository.py \
/path/to/source-with-workflow \
/path/to/existing-repo
# Answer Q&A:
# - Repository purpose: [match your existing repo]
# - Description: [your existing repo description]
# - Copy workflow: yes (required)
# - Copy domain content: NO (preserve your src/)
# - Copy tests: NO (preserve your tests/)
# - Copy containers: [decide based on needs]
# - Initialize git: NO (already initialized)
# Step 4: Review changes with git
git status
git diff README.md # See what changed
git diff pyproject.toml # See what changed
git diff .gitignore # See what changed
# Step 5: Restore and merge important content
# README.md - merge your original content with workflow sections
cp .workflow-backup/README.md README.md.original
# Manually edit README.md to include both your content and workflow sections
# pyproject.toml - merge dependencies
# Edit pyproject.toml to add back your custom dependencies
# Keep workflow's test/lint/coverage configurations
# .gitignore - merge exclusions
cat .workflow-backup/.gitignore >> .gitignore
# Then manually deduplicate
# CHANGELOG.md - merge history
cat .workflow-backup/CHANGELOG.md >> CHANGELOG.md
# Edit to merge chronologically
# Step 6: Commit workflow integration
git add -A
git commit -m "feat(workflow): integrate workflow v5.2 system
- Add 9 workflow skills
- Merge workflow documentation with existing content
- Add compliant directory structure
- Preserve existing code, tests, and domain content
Implements: Phase 0 workflow integration
Refs: initialize-repository v1.0.0"
# Step 7: Test workflow system
python .claude/skills/tech-stack-adapter/scripts/detect_stack.py
uv sync # Install new dependencies
python .claude/skills/quality-enforcer/scripts/run_quality_gates.py
Benefits of Option B:
After applying the workflow (either option), complete these steps:
1. Validate workflow system:
# Check skills were copied
ls .claude/skills/ # Should show 9 skills
# Validate versions
python .claude/skills/workflow-utilities/scripts/validate_versions.py --verbose
2. Install dependencies:
uv sync
# Or if using pip
pip install -e ".[dev]"
3. Test quality gates:
# Run full quality suite
python .claude/skills/quality-enforcer/scripts/run_quality_gates.py
# Run tests with coverage
uv run pytest --cov=src --cov-fail-under=80
# Run linting
uv run ruff check src/ tests/
# Run type checking
uv run mypy src/
4. Review and update documentation:
# Review generated CLAUDE.md
cat CLAUDE.md
# Add code architecture section specific to your project
# Review generated README.md
cat README.md
# Ensure it accurately describes your project
# Review WORKFLOW.md
cat WORKFLOW.md
# Familiarize yourself with the 6-phase workflow
5. Start first workflow:
# Create BMAD planning for existing feature
python .claude/skills/bmad-planner/scripts/create_planning.py \
existing-feature $(git config user.name)
# Or plan new feature
python .claude/skills/bmad-planner/scripts/create_planning.py \
new-feature $(git config user.name)
Issue 1: pyproject.toml conflicts with existing dependencies
Solution: Manually merge dependencies
# Keep your existing dependencies
[project]
dependencies = [
"your-existing-dep>=1.0",
"another-dep>=2.0",
]
# Add workflow dependencies
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"pytest-cov>=4.0",
"ruff>=0.1.0",
"mypy>=1.0",
]
# Keep workflow tool configurations
[tool.ruff]
# ... (from generated file)
[tool.mypy]
# ... (from generated file)
[tool.pytest.ini_options]
# ... (from generated file)
Issue 2: .gitignore conflicts with existing exclusions
Solution: Merge both .gitignore files
# Append workflow exclusions to your existing .gitignore
cat .workflow-backup/.gitignore > .gitignore.merged
cat .claude/skills/initialize-repository/templates/.gitignore >> .gitignore.merged
# Remove duplicates manually
sort .gitignore.merged | uniq > .gitignore
Issue 3: Existing tests fail with new quality gates
Solution: Adjust quality gate thresholds temporarily
# Check current coverage
uv run pytest --cov=src --cov-report=term
# If below 80%, set realistic initial target
# Edit pyproject.toml:
[tool.pytest.ini_options]
addopts = "--cov=src --cov-fail-under=60" # Temporary lower threshold
# Plan to improve coverage over time
# Use quality-enforcer to track progress
python .claude/skills/quality-enforcer/scripts/run_quality_gates.py
Issue 4: Git branch structure conflicts
Solution: Adapt workflow branch structure
# If you use different branch names (e.g., 'master' instead of 'main')
# Update git-workflow-manager scripts to use your branch names
# Or rename your branches to match workflow
git branch -m master main
git branch develop
git branch contrib/$(git config user.name)
For most existing repositories:
For simple existing repositories:
For complex existing repositories:
After initializing a repository with the workflow system, configure branch protection to enforce the workflow rules.
CRITICAL: Configure GitHub branch protection rules for main and develop branches.
Why this is important:
Setup instructions:
Navigate to GitHub repository settings:
Your Repository → Settings → Branches → Branch protection rules
Add rule for main branch:
mainAdd rule for develop branch:
developDetailed guide: See .github/BRANCH_PROTECTION.md in your new repository for step-by-step screenshots and troubleshooting.
Install the pre-push hook to prevent accidental direct pushes to main or develop:
cd /path/to/new-repo
cp .git-hooks/pre-push .git/hooks/pre-push
chmod +x .git/hooks/pre-push
What it does:
main or developTesting the hook:
# Try to push to main (should fail)
git checkout main
git commit --allow-empty -m "test"
git push origin main # Hook blocks this
# Expected output:
# ERROR: Direct push to main is not allowed.
# Please create a pull request instead.
If using Azure DevOps instead of GitHub:
Navigate to repository branch policies:
Your Project → Repos → Branches → main → Branch policies
Configure main branch policies:
Repeat for develop branch
After setup, verify protection is active:
# Attempt direct commit to main (should fail on remote)
git checkout main
git commit --allow-empty -m "test protection"
git push origin main
# Expected: GitHub/Azure DevOps rejects the push
# Success message: "remote: error: GH006: Protected branch update failed"
After running initialize_repository.py and configuring branch protection:
maindevelopuv sync)uv run pytest)The script validates and handles errors at each phase:
Pre-flight checks:
During execution:
Post-execution validation:
Exit codes:
Does NOT integrate with other skills - this is a meta-skill that creates the environment for them.
Creates foundation for:
After initialization, users interact with the 7 workflow skills, not this meta-skill.
development
Enforces quality gates: 80% test coverage, passing tests, successful builds, semantic versioning. Runs before PR creation. Use when: Running tests, checking coverage, validating quality, versioning Triggers: run tests, check coverage, quality gates, version bump
data-ai
Manages git operations: worktree creation, branch management, commits, PRs, semantic versioning, daily rebase workflow, and PR feedback handling. Use when: Creating branches/worktrees, committing, pushing, versioning, handling PR feedback Triggers: create worktree, commit, push, rebase, version, PR, PR feedback
tools
Interactive callable tool that creates BMAD planning documents (requirements, architecture, epics) in main repository on contrib branch. Three-persona Q&A system generates comprehensive planning before feature development. Use when: On contrib branch, planning phase, need requirements/architecture Triggers: plan feature, requirements, architecture, BMAD
testing
Persistent state management using AgentDB (DuckDB) for workflow analytics and checkpoints. Provides read-only analytics cache synchronized from TODO_*.md files, enabling: - Complex dependency graph queries - Historical workflow metrics - Context checkpoint storage/recovery - State transition analysis Use when: Data gathering and analysis for workflow state tracking Triggers: "analyze workflow", "query state", "checkpoint", "workflow metrics"