bitbucket-workflow

Bitbucket best practices for pull requests, Pipelines CI/CD, Jira integration, and Atlassian ecosystem workflows

16 stars

Best use case

bitbucket-workflow is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Bitbucket best practices for pull requests, Pipelines CI/CD, Jira integration, and Atlassian ecosystem workflows

Teams using bitbucket-workflow should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/bitbucket-workflow/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/devops/bitbucket-workflow/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/bitbucket-workflow/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How bitbucket-workflow Compares

Feature / Agentbitbucket-workflowStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Bitbucket best practices for pull requests, Pipelines CI/CD, Jira integration, and Atlassian ecosystem workflows

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Bitbucket Workflow Best Practices

You are an expert in Bitbucket workflows, including pull requests, Bitbucket Pipelines, Jira integration, and Atlassian ecosystem best practices.

## Core Principles

- Use pull requests for all code changes with proper review processes
- Implement CI/CD with Bitbucket Pipelines using `bitbucket-pipelines.yml`
- Leverage Jira integration for seamless issue tracking
- Follow branching models like Gitflow for structured development
- Maintain security through branch permissions and access controls

## Pull Request Best Practices

### Creating Effective Pull Requests

1. **Keep PRs focused and reviewable**
   - One feature or fix per PR
   - Include context in the description

2. **PR Title Convention**
   - Reference Jira issue: `PROJ-123: Add user authentication`
   - Use conventional format: `feat: implement login page`

3. **PR Description Template**
   ```markdown
   ## Summary
   Brief description of changes and motivation.

   ## Jira Issue
   [PROJ-123](https://your-org.atlassian.net/browse/PROJ-123)

   ## Changes
   - List of specific changes made

   ## Testing
   - How the changes were tested
   - Manual testing steps

   ## Checklist
   - [ ] Tests added/updated
   - [ ] Documentation updated
   - [ ] Pipeline passes
   ```

### Code Review in Bitbucket

1. **Add reviewers** - Select appropriate team members
2. **Use tasks** - Create tasks for actionable feedback
3. **Approve or request changes** - Clear approval workflow
4. **Resolve discussions** - Address all feedback before merge

### Merge Strategies

- **Merge commit**: Preserves full branch history
- **Squash**: Combines commits into single commit
- **Fast-forward**: Linear history when possible

## Bitbucket Pipelines

### Basic Pipeline Configuration

```yaml
image: node:20

definitions:
  caches:
    npm: ~/.npm

  steps:
    - step: &build-step
        name: Build
        caches:
          - npm
        script:
          - npm ci
          - npm run build
        artifacts:
          - dist/**

    - step: &test-step
        name: Test
        caches:
          - npm
        script:
          - npm ci
          - npm test

pipelines:
  default:
    - step: *build-step
    - step: *test-step

  branches:
    main:
      - step: *build-step
      - step: *test-step
      - step:
          name: Deploy to Production
          deployment: production
          trigger: manual
          script:
            - pipe: atlassian/aws-s3-deploy:1.1.0
              variables:
                AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
                AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
                AWS_DEFAULT_REGION: 'us-east-1'
                S3_BUCKET: 'my-bucket'
                LOCAL_PATH: 'dist'

    develop:
      - step: *build-step
      - step: *test-step
      - step:
          name: Deploy to Staging
          deployment: staging
          script:
            - ./deploy.sh staging
```

### Pipeline Features

#### Parallel Steps

```yaml
pipelines:
  default:
    - parallel:
        - step:
            name: Unit Tests
            script:
              - npm test:unit
        - step:
            name: Integration Tests
            script:
              - npm test:integration
        - step:
            name: Lint
            script:
              - npm run lint
```

#### Conditional Steps

```yaml
pipelines:
  pull-requests:
    '**':
      - step:
          name: Build and Test
          script:
            - npm ci
            - npm test
          condition:
            changesets:
              includePaths:
                - "src/**"
                - "package.json"
```

#### Custom Pipes

```yaml
pipelines:
  default:
    - step:
        name: Deploy
        script:
          - pipe: atlassian/aws-ecs-deploy:1.6.0
            variables:
              AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
              AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
              AWS_DEFAULT_REGION: 'us-east-1'
              CLUSTER_NAME: 'my-cluster'
              SERVICE_NAME: 'my-service'
              TASK_DEFINITION: 'task-definition.json'
```

### Services for Testing

```yaml
definitions:
  services:
    postgres:
      image: postgres:15
      variables:
        POSTGRES_DB: test_db
        POSTGRES_USER: test_user
        POSTGRES_PASSWORD: test_pass
    redis:
      image: redis:7

pipelines:
  default:
    - step:
        name: Integration Tests
        services:
          - postgres
          - redis
        script:
          - npm ci
          - npm run test:integration
```

### Caching

```yaml
definitions:
  caches:
    npm: ~/.npm
    pip: ~/.cache/pip
    gradle: ~/.gradle/caches

pipelines:
  default:
    - step:
        caches:
          - npm
        script:
          - npm ci
          - npm run build
```

## Jira Integration

### Smart Commits

Enable smart commits to update Jira issues from commit messages:

```
PROJ-123 #comment Fixed the login redirect issue
PROJ-123 #time 2h 30m
PROJ-123 #done
```

### Branch Naming

Include Jira issue key in branch names:
- `feature/PROJ-123-user-authentication`
- `bugfix/PROJ-456-fix-login-redirect`

This automatically links branches to issues.

### Automation Rules

Set up Jira automation:
- Move issue to "In Progress" when branch created
- Move issue to "In Review" when PR opened
- Move issue to "Done" when PR merged

## Branching Models

### Gitflow in Bitbucket

```yaml
pipelines:
  branches:
    main:
      - step:
          name: Deploy Production
          deployment: production
          script:
            - ./deploy.sh production

    develop:
      - step:
          name: Deploy Staging
          deployment: staging
          script:
            - ./deploy.sh staging

    'release/*':
      - step:
          name: Release Build
          script:
            - npm run build:release

    'feature/*':
      - step:
          name: Feature Build and Test
          script:
            - npm ci
            - npm test

    'hotfix/*':
      - step:
          name: Hotfix Build
          script:
            - npm ci
            - npm test
```

### Branch Permissions

Configure in Repository settings > Branch permissions:

**Main branch:**
- No direct pushes
- Require pull request
- Minimum 1 approval
- Require passing builds
- Require all tasks resolved

**Develop branch:**
- Require pull request
- Minimum 1 approval
- Require passing builds

## Repository Management

### Default Reviewers

Set up default reviewers for consistent code review:
- Add team leads as default reviewers
- Use CODEOWNERS-like patterns

### Merge Checks

Enable merge checks:
- Minimum approvals
- No unresolved tasks
- Passing builds
- No changes requested

### Access Levels

- **Admin**: Full control
- **Write**: Push and merge
- **Read**: Clone and view

## Security Best Practices

### Repository Variables

Configure secure variables in Repository settings > Pipelines > Variables:

```yaml
# Reference in pipeline
script:
  - echo "Deploying with token"
  - ./deploy.sh --token=$DEPLOY_TOKEN
```

Variable options:
- **Secured**: Masked in logs
- **Required for deployment**

### IP Allowlisting

Restrict pipeline access to specific IP ranges for deployment environments.

### Access Tokens

Use repository or project access tokens instead of personal tokens:
- Scoped to specific repositories
- Easier to rotate
- Better audit trail

## Deployment Environments

### Environment Configuration

```yaml
pipelines:
  branches:
    main:
      - step:
          name: Deploy to Production
          deployment: production
          script:
            - ./deploy.sh
```

Configure environments in Repository settings > Deployments:
- Set environment variables per environment
- Configure deployment permissions
- View deployment history

### Deployment Permissions

- Require specific user approval for production
- Set up deployment windows
- Enable deployment freeze periods

## Atlassian Ecosystem Integration

### Confluence Integration

- Link repositories to Confluence spaces
- Embed code snippets
- Auto-update documentation from commits

### Trello Integration

- Connect cards to commits
- Automatic card movement on PR events

### Opsgenie Integration

- Trigger alerts from pipeline failures
- On-call notifications for deployment issues

## Best Practices Summary

1. **Use descriptive branch names** with Jira keys
2. **Configure branch permissions** for main branches
3. **Implement comprehensive pipelines** with proper stages
4. **Use pipes** for common tasks (AWS, Docker, etc.)
5. **Enable smart commits** for Jira updates
6. **Set up deployment environments** with proper permissions
7. **Use repository variables** for secrets
8. **Configure merge checks** for quality gates
9. **Leverage Atlassian integrations** for seamless workflow

Related Skills

inspire-workflows

16
from diegosouzapw/awesome-omni-skill

Inspire team development workflows, deployment pipelines, and PR processes. Use when following team processes or understanding how things get done.

gitops-workflow

16
from diegosouzapw/awesome-omni-skill

Implement GitOps workflows with ArgoCD and Flux for automated, declarative Kubernetes deployments with continuous reconciliation. Use when implementing GitOps practices, automating Kubernetes deployments, or setting up declarative infrastructure management.

github-workflow-authoring

16
from diegosouzapw/awesome-omni-skill

This skill should be used when creating or improving GitHub Actions CI/CD workflows for Breenix kernel development. Use for authoring new test workflows, optimizing existing CI pipelines, adding new test types, fixing workflow configuration issues, or adapting workflows for new kernel features.

docker-workflow

16
from diegosouzapw/awesome-omni-skill

Comprehensive Docker containerization workflow covering multi-stage builds, docker-compose orchestration, image optimization, debugging, and production best practices. Use when containerizing applications, setting up development environments, or deploying with Docker.

dev-workflow

16
from diegosouzapw/awesome-omni-skill

Developer productivity workflows - PR review, CI monitoring, deploy tracking, code metrics

cicd-workflows

16
from diegosouzapw/awesome-omni-skill

Helps understand and write EAS workflow YAML files for Expo projects. Use this skill when the user asks about CI/CD or workflows in an Expo or EAS context, mentions .eas/workflows/, or wants help with EAS build pipelines or deployment automation.

ci-cd-workflows

16
from diegosouzapw/awesome-omni-skill

Guide for GitHub Actions workflows, test orchestration, parallel testing, adapter builds, releases, and CI/CD configuration. Use when working with .github/workflows/, versions.json, or troubleshooting CI issues.

ansible-workflow

16
from diegosouzapw/awesome-omni-skill

Ansible automation workflow guidelines. Activate when working with Ansible playbooks, ansible-playbook, inventory files (.yml, .ini), or Ansible-specific patterns.

workflows-review

16
from diegosouzapw/awesome-omni-skill

Perform exhaustive code reviews using multi-agent analysis, ultra-thinking, and worktrees

workflow

16
from diegosouzapw/awesome-omni-skill

Start, monitor, and manage workflow executions in Periscope

workflow-patterns

16
from diegosouzapw/awesome-omni-skill

Use this skill when implementing tasks according to Conductor's TDD workflow, handling phase checkpoints, managing git commits for tasks, or understanding the verification protocol.

workflow-orchestrator

16
from diegosouzapw/awesome-omni-skill

Project workflow system - cost tracking, parallel execution, security gates, agent orchestration. Use when: start day, begin session, status check, new feature, build, implement, end day, wrap up, debug, investigate, research, evaluate.