Feature Action
Comprehensive command designed for create, flow, feature, branch. Includes structured workflows, validation checks, and reusable patterns for git.
Feature Action
Create and configure a Git Flow feature branch with proper naming, tracking, and development setup.
When to Use This Command
Run this command when you need to:
- Start a new feature branch following Git Flow conventions from the develop branch
- Set up a properly named and tracked branch with remote origin configured
- Initialize a feature workspace with correct branch lineage and push tracking
Consider alternatives when:
- Your project uses trunk-based development with short-lived branches off main
- You need a hotfix branch for production which follows a different Git Flow path
Quick Start
Configuration
name: feature-action type: command category: git
Example Invocation
claude command:run feature-action --name "user-dashboard-widgets"
Example Output
Checking repository state...
Current branch: develop
Working tree: clean
Develop is up to date with origin/develop
Creating feature branch...
Branch: feature/user-dashboard-widgets
Base: develop (commit a4c8e12)
Tracking: origin/feature/user-dashboard-widgets
Feature branch ready:
git checkout feature/user-dashboard-widgets (already on it)
Start coding your feature!
Core Concepts
Git Flow Feature Overview
| Aspect | Details |
|---|---|
| Base Branch | Always branches from develop, never from main |
| Naming | feature/descriptive-name following kebab-case convention |
| Merge Target | Merges back into develop when complete |
| Lifetime | Exists until the feature is done, then deleted after merge |
| Collaboration | Pushed to origin so multiple developers can work on it |
Feature Branch Workflow
main: ----*-----------*-------->
\ /
develop: --*--+--*--*--+--*----->
\ /
feature: *--*--*
create merge
branch back
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| name | string | (required) | Feature name in kebab-case for the branch suffix |
| base | string | develop | Base branch to create the feature from |
| push | boolean | true | Push feature branch to origin immediately |
| stash-first | boolean | true | Stash uncommitted changes before switching branches |
| ticket | string | (none) | Prepend ticket ID to branch name like PROJ-123 |
Best Practices
-
Use descriptive feature names - A name like
user-dashboard-widgetstells the team exactly what is being built. Avoid vague names likenew-stuffthat provide no context in branch listings. -
Pull develop before branching - Always ensure your local develop branch is up to date with origin before creating the feature branch to avoid starting from a stale base.
-
Keep features focused - Each feature branch should represent a single deliverable. If the scope grows, split it into multiple feature branches and merge them to develop independently.
-
Delete after merge - Once the feature is merged back into develop, delete both the local and remote feature branch to keep the repository clean and branch lists manageable.
-
Rebase regularly - Periodically rebase your feature branch onto develop to incorporate upstream changes and reduce the size of the eventual merge conflict surface.
Common Issues
-
Develop branch does not exist - Some repositories use main as the integration branch. Set the base parameter to main or create a develop branch first with
git checkout -b develop main. -
Uncommitted changes block checkout - The command stashes changes by default, but if the stash fails due to untracked files, add them first with
git add .or usegit stash --include-untracked. -
Branch name already exists - If a feature branch with the same name exists from a previous attempt, delete it first with
git branch -d feature/old-nameor choose a more specific name with an additional qualifier. -
Remote push fails with authentication error - If the push to origin fails, verify your SSH key or personal access token is configured correctly. Run
git remote -vto confirm the remote URL is using the correct protocol for your authentication method.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.