Génération de scaffolding CW

VérifiéSûr

Permet d'ajouter des composants standardisés (workflows GitHub, CODEOWNERS, charts Helm, catalogues Backstage) à des dépôts existants ou de générer des structures de projet complètes (archétypes) localement. Utile lors de la configuration initiale d'un projet ou de l'ajout de conformité et d'automatisation.

Spar Skills Guide Bot
DevOpsIntermédiaire
5002/06/2026
Claude Code
#scaffolding#code-generation#devops#project-templates

Recommandé pour

Notre avis

Ajoute des composants standardisés (CODEOWNERS, workflows GitHub, charts Helm, catalog Backstage) à des dépôts existants ou génère des archétypes de projets complets via l'outil CLI cw.

Points forts

  • Automatise les tâches de configuration répétitives
  • Prend en charge de nombreux types de composants et archétypes
  • Offre des modes interactif et non interactif
  • Inclut des commandes de validation et de dépannage

Limites

  • Nécessite l'installation de l'outil CLI cw
  • Les modifications de fichiers sont effectuées directement, nécessitant une confirmation explicite
  • Limité aux modèles prédéfinis
Quand l'utiliser

Utilisez cette compétence lorsque vous devez ajouter des composants DevOps courants comme des workflows GitHub, CODEOWNERS ou des fichiers de catalogue Backstage à un dépôt, ou pour générer une nouvelle structure de projet.

Quand l'éviter

Évitez cette compétence si vous avez besoin de composants personnalisés non couverts par les modèles prédéfinis, ou si vous préférez configurer chaque fichier manuellement.

Analyse de sécurité

Sûr
Score qualité90/100

The skill only uses the cw CLI tool to scaffold files (codeowners, workflows, helm charts, etc.) within the current repository. It requires user confirmation before modifying files and does not execute arbitrary system commands, destructive actions, or exfiltrate data. The allowed-tools are scoped to cw scaffold:* and cw version, both safe.

Aucun point d'attention détecté

Exemples

Add CODEOWNERS to a repository
Add CODEOWNERS to this repository. The team name is 'my-team'.
Generate a Go HTTP service
Generate a new Go HTTP service project in a directory called 'my-service'.

name: cw-scaffold description: Add components to existing repos or generate archetypes locally. Use when adding GitHub workflows, CODEOWNERS, Helm charts, Backstage catalog files, or generating new project structures. allowed-tools:

  • Bash(cw scaffold:*)
  • Bash(cw version)

CW Scaffolding

Add standardized components to existing repositories or generate complete project archetypes locally.

When to Use This Skill

Use this skill when:

  • Adding CODEOWNERS to a repository
  • Setting up GitHub workflows (linting, dependency updates, PR review)
  • Adding Backstage catalog configuration
  • Creating Helm charts
  • Generating a new project structure locally

Instructions

Step 1: Understand the Request

Determine what the user wants:

  • Component: Add a specific feature to an existing repo
  • Archetype: Generate a complete project structure

Available Components:

| Group | Component | Purpose | |-------|-----------|---------| | backstage | catalog-yaml-component | Register as Backstage Component | | backstage | catalog-yaml-location | Register as Backstage Location | | backstage | catalog-yaml-system | Register as Backstage System | | github | codeowners | Define code ownership | | github | workflow-claude-review-prs | AI-powered PR review | | github | workflow-close-stale-prs | Auto-close stale PRs | | github | workflow-megalinter | Comprehensive linting | | github | workflow-renovate | Automated dependency updates | | helm | chart-basic | Kubernetes Helm chart |

Available Archetypes:

| Archetype | Purpose | |-----------|---------| | blank-repo | Minimal starter with CODEOWNERS and Backstage | | go-http-service | Production-ready Go HTTP service |

Step 2: Pre-flight Checks

cw version  # Verify CLI installed
pwd         # Confirm in correct directory (for components)

For components, user should be in the repository root.

Step 3: Component Generation

IMPORTANT: This modifies files in the repository. Get user confirmation before running.

Interactive mode:

cw scaffold generate -c

With specific version:

cw scaffold generate -c --version v2.5.0

Non-interactive mode (for automation):

Create config.yaml:

componentGroup: github
componentName: codeowners
inputs:
  github_team_name: your-team

Run:

cw scaffold generate --config config.yaml --skip-pr

Step 4: Archetype Generation

Interactive mode:

cw scaffold generate -a

This prompts for:

  • Archetype selection
  • Output directory
  • Project-specific inputs

Step 5: Post-Generation

After generation:

  1. Review generated files:

    git status
    git diff
    
  2. Commit changes: Use /commit skill for proper commit message

  3. Create PR if needed: The CLI may offer to create a PR automatically

Common Workflows

Add CODEOWNERS

cd your-repo
cw scaffold generate -c
# Select: github -> codeowners
# Provide: team name

Add Megalinter

cd your-repo
cw scaffold generate -c
# Select: github -> workflow-megalinter

Add Renovate for Dependency Updates

cd your-repo
cw scaffold generate -c
# Select: github -> workflow-renovate

Generate Go Service Locally

cw scaffold generate -a
# Select: go-http-service
# Specify: output directory
# Provide: project name, team, etc.

Validation

To validate templates (useful for template maintainers):

cw scaffold validate <path> -c   # Validate as component
cw scaffold validate <path> -a   # Validate as archetype
cw scaffold validate <path> -f   # Fail fast on first error

Troubleshooting

Component not found:

rm -rf ~/.cw/cli/cached-templates/
cw scaffold generate -c  # Re-fetches templates

Wrong version:

cw scaffold generate -c --version v2.5.0

Test local templates:

cw scaffold generate -c --path /path/to/local/repo-templates

View available components/archetypes:

cw scaffold info -c
cw scaffold info -a
Skills similaires