Ba

From j4flmao/agent-skills · View interactive version

Ba is an AI agent skill from the GitHub repository j4flmao/agent-skills. Use when the user asks for business analysis, requirements elicitation, a BRD, functional requirements, use cases, user stories with INVEST, acceptance criteria or stakeholder analysis. Produces analyzed requirements, process flows and traceable stories. Not for a full PRD from a brief (use create-p

How to use this skill

Skill file

Business Analysis

Purpose

Elicit, analyze, and document requirements through user stories, acceptance criteria, process models, and stakeholder analysis.

Agent Protocol

Trigger

Exact user phrases: "business analysis", "requirements", "user story", "acceptance criteria", "Gherkin", "INVEST", "process flow", "use case", "stakeholder analysis", "BRD", "functional requirements", "specification", "write story", "refine story", "requirements gathering".

Input Context

Before activating, verify:

Output Artifact

Writes user stories to docs/stories/ or acceptance criteria to the appropriate spec document.

Response Format

Answer exactly:

Story: {title}

As a: {user role}

I want: {goal}

So that: {benefit / value}

Acceptance Criteria:

Scenario: {title}

Given {context}

When {action}

Then {expected outcome}

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick. No explanations of agile or BDD concepts.

Completion Criteria

This skill is complete when:

Max Response Length

One story: 15 lines. Acceptance criteria: 10 lines per scenario.

Workflow

Step 1: Requirements Elicitation

Ask and document:

| Question | Purpose |

|----------|---------|

| Who is the user? | Define role and persona |

| What do they need to achieve? | Define the goal |

| Why is this valuable? | Define the benefit |

| What could go wrong? | Edge cases and error paths |

| How will we know it's done? | Acceptance criteria |"

Step 2: Write User Stories

As a {role}

I want {feature / goal}

So that {benefit / value}

INVEST checklist:

Step 3: Acceptance Criteria (Gherkin)

Scenario: {title}

Given {precondition / context}

When {action / trigger}

Then {expected result}

Additional keywords:

Scenario Outline: Login with valid credentials

Given the user is on the login page

When they enter "<email>" and "<password>"

And they click "Sign In"

Then they are redirected to the dashboard

Examples:

"| email | password |

| user@example.com | Pass123! |

| admin@example.com | Admin@456 |

Boundary scenarios to cover:

Step 4: Process Modeling

Document workflows as structured steps:

%%{init: {"theme": "default", "flowchart": {"useMaxWidth": true}}}%%
flowchart TD
  A[User submits order] --> B{Payment valid?}
  B -->|Yes| C[Create order]
  B -->|No| D[Show error]
  C --> E[Send confirmation]

When Mermaid is not available, use step-by-step:

  1. User submits order form
  2. System validates payment
  1. Order appears in user's order history

Step 5: Non-Functional Requirements

| Category | Examples |

|----------|----------|

| Performance | Response time < 2s, supports 1000 concurrent users |

| Security | TLS 1.3, OAuth2, input sanitization |

| Usability | WCAG 2.2 AA, mobile-responsive |

| Reliability | 99.9% uptime, automatic failover |

| Scalability | Horizontal scaling, stateless design |

Step 6: Stakeholder Analysis and Management

Identify all stakeholders affected by the requirements. Categorize by influence and interest. Define engagement strategy per stakeholder. Document concerns and ensure they are addressed. Plan validation sessions with key stakeholders. Maintain a stakeholder matrix updated throughout the project.

Step 7: Requirements Prioritization

Use a structured prioritization framework:

| Framework | Description | Best For |

|-----------|-------------|----------|

| MoSCoW | Must have, Should have, Could have, Won't have | Time-boxed delivery |

| Kano Model | Basic, Performance, Excitement factors | Customer satisfaction |

| Value vs Effort | Business value against implementation effort | Resource-constrained |

| Weighted Scoring |" Multi-criteria scoring (value, risk, cost, dependency) "| Portfolio decisions |

| RICE | Reach, Impact, Confidence, Effort | Growth and product features |"

Step 8: Requirements Validation

Conduct systematic validation with stakeholders:

Step 9: Requirements Management and Change Control

Establish a requirements baseline. Define a change control process for requirement changes. Assess impact of changes on scope, timeline, and cost. Maintain requirements traceability matrix. Communicate changes to all affected stakeholders.

Step 10: Story Refinement and Splitting

Refine large stories into sprint-sized pieces. Use splitting heuristics:

Framework / Methodologies

Business Analysis Framework Comparison

"| Framework | Focus | Artifacts | Best For | Process |

|-----------|-------|-----------|----------|---------|

| BABOK (IIBA) | Comprehensive BA practice | 30+ techniques across 6 knowledge areas | Enterprise BA, certification prep | Multi-phase, adaptive |

| Agile/Scrum BA | Iterative delivery | User stories, acceptance criteria, backlog | Scrum teams | Continuous refinement |

| Design Thinking | User-centric problem solving | Personas, journey maps, prototypes | Innovation and new products | Divergent → Convergent |

| Lean BA | Waste reduction, value focus | Value stream map, minimal spec | Process improvement | Value stream analysis |

| Use Case (UML) | System interaction modeling | Use case diagrams, scenarios, flows | Complex systems, formal specs | Actor-goal oriented |"

Decision Tree: Requirements Approach

What is the project type?
  ├── New product / major feature
  │   ├── User needs well understood?
  │   │   ├── Yes → Agile BA (user stories + backlog refinement)
  │   │   └── No → Design Thinking (research → prototype → test)
  ├── Process improvement / automation
  │   └── Lean BA (value stream mapping, waste identification)
  ├── Complex system with many integrations
  │   └── Use Case (UML) + BABOK techniques
  ├── Compliance / regulatory project
  │   └── BABOK (traceability matrix, formal sign-off)
  └── Small enhancement / bug fix
      └── Direct user story with minimal analysis

Requirements Elicitation Technique Selection

"| Technique | Best For | Participants | Time | Artifact |

|-----------|----------|--------------|------|----------|

| Interview | Deep understanding of individual perspectives | BA + single stakeholder | 30-60 min | Interview notes |

| Workshop | Collaborative requirement definition | BA + multiple stakeholders | 2-4 hours | Workshop output document |

| Observation | Understanding current process reality | BA + users in their environment | 2-8 hours | Process notes, pain points |

| Document analysis | Understanding existing system | BA only | 2-8 hours | Gap analysis |

| Survey/Questionnaire | Broad input from many stakeholders | BA + many respondents | Design: 1 day, Response: 1 week | Survey results |

| Prototyping | Validating understanding visually | BA + users | 1-5 days | Prototype, feedback log |

| Brainstorming | Generating ideas and possibilities | BA + creative team | 1-2 hours | Idea list |

| Focus group | Validating concepts with representative users | Facilitator + 6-10 users | 1-2 hours | Focus group report |

| Interface analysis | Understanding system boundaries | BA + technical team | 2-4 hours | Interface specification |

| Root cause analysis | Understanding underlying problems | BA + stakeholders | 1-3 hours | Root cause diagram |"

Common Pitfalls

Pitfall 1: Solution-Jumping

Stakeholders (and analysts) often jump to solutions before understanding the problem. "We need a report" instead of "we need to understand customer churn patterns". Always start with the problem and let the solution emerge from analysis.

Pitfall 2: Writing Stories Too Large

Epic-sized stories that take months to deliver cannot be estimated, tested, or completed in a sprint. Apply splitting techniques until each story can be done within 2-3 days. If a story takes longer, split it further.

Pitfall 3: Implementation Details in Stories

Stories that say "Add a button on the left sidebar" prescribe solutions instead of describing needs. The team should decide implementation. Write "User can access order history from any page" — the implementation detail belongs in design discussions.

Pitfall 4: Happy Path Only

Stories that only describe the sunshine scenario miss error handling, edge cases, and alternative flows. Every story must have at least one positive and one negative acceptance criterion. Cover authorization failures, data not found, concurrent access, and network issues.

Pitfall 5: Gherkin as Test Script

Gherkin scenarios written with implementation details ("Click the blue button") rather than business language ("Submit the form") create brittle scenarios that break when UI changes. Gherkin should describe behavior, not UI interactions.

Pitfall 6: No Non-Functional Requirements

Stories focused entirely on functionality while ignoring performance, security, usability, and scalability. Non-functional requirements are often discovered during testing, causing rework. Include relevant NFRs in every epic.

Pitfall 7: Stakeholder Assumption

Assuming stakeholders know what they want without validation leads to rework. What stakeholders say and what they actually need are often different. Validate through prototypes, acceptance criteria reviews, and iterative feedback.

Pitfall 8: Requirements Creep

Adding requirements without change control leads to scope creep. Every new requirement should go through the same prioritization and impact assessment process. Maintain a scope baseline and manage changes formally.

Pitfall 9: Insufficient Edge Case Coverage

Teams cover the happy path and a few obvious error cases, then discover production issues from untested edge cases. Use boundary value analysis and equivalence partitioning systematically. Cover concurrent access, race conditions, and data inconsistency scenarios.

Pitfall 10: Analysis Paralysis

Over-analyzing requirements before development starts delays delivery and doesn't prevent change (requirements will change anyway). Analyze enough to start development, then refine iteratively. The goal is shared understanding, not perfect documentation.

Best Practices

Templates & Tools

User Story Template

story:
  id: US-{n}
  title: {concise description}
  description: "|
    As a {role}
    I want {goal}
    So that {benefit}
  acceptance_criteria:
    - scenario: {title}
      given: {context}
      when: {action}
      then: {result}
    - scenario: {error case}
      given: {context}
      when: {action with invalid input}
      then: {error result}
  non_functional:
    - {performance requirement}
    - {security requirement}
  estimates:
    complexity: small / medium / large
    points: {story points}
  dependencies:
    - {related story or external dependency}
  status: backlog / refined / in_progress / done

BRD (Business Requirements Document) Outline

brd:
  document_control:
    title: {project name} Business Requirements
    version: 1.0
    author: {BA name}
    date: {date}
    status: draft / reviewed / approved
  sections:
    - section: executive_summary
      content: 1-2 paragraph overview of objectives and scope
    - section: business_context
      content: Current state, problem statement, opportunity
    - section: project_scope
      subsections:
        - in_scope: {list of what is included}
        - out_of_scope: {list of what is excluded}
        - assumptions: {list of assumptions made}
        - constraints: {list of constraints}
    - section: stakeholder_analysis
      content: Stakeholder matrix with influence, interest, engagement strategy
    - section: functional_requirements
      content: User stories organized by epic/feature
    - section: non_functional_requirements
      content: Performance, security, usability, reliability, scalability
    - section: process_models
      content: Current and future state process flows
    - section: data_requirements
      content: Data entities, relationships, volumes
    - section: interfaces
      content: Systems integrations, APIs, data exchange
    - section: acceptance_criteria
      content: High-level acceptance criteria for the project
    - section: assumptions_and_dependencies
      content: Key assumptions, dependencies, risks
    - section: approval
      content: Sign-off section

Requirements Traceability Matrix

rtm:
  entries:
    - id: REQ-001
      description: User can search orders by date range
      business_objective: BO-003 (Improve order management efficiency)
      source: Stakeholder workshop 2026-03-15
      owner: Product Manager
      priority: Must have
      status: Approved
      test_cases:
        - TC-001, TC-002, TC-003
      design_docs:
        - Design-Search-001
      release: v2.1
      change_history:
        - date: 2026-03-20
          change: Added date range filter
          reason: User feedback from beta
    - id: REQ-002
      description: Export search results to CSV
      business_objective: BO-003
      source: Stakeholder interview (Alice, Ops)
      owner: Product Manager
      priority: Should have
      status: Proposed
      test_cases: []
      design_docs: []
      release: null  # assigned at release planning

Case Studies (illustrative scenarios — figures are examples, not sourced benchmarks)

Case Study 1: E-Commerce Checkout Redesign

An e-commerce company's checkout had 40% abandonment. BA analysis using process mapping revealed 7 required fields, 3 page loads, and no guest checkout. User stories with acceptance criteria covered: guest checkout, address autocomplete, progress indicator, saved payment methods. After implementation, abandonment dropped to 22%. Key factor: stakeholder workshops included customer support agents who knew the top abandonment reasons.

Case Study 2: Healthcare Scheduling System

A hospital needed a new patient scheduling system. The BA team used stakeholder analysis to identify 12 distinct user roles (patients, receptionists, nurses, doctors, administrators...). Each role had unique needs. Gherkin scenarios captured complex business rules (scheduling conflicts, insurance validation, room availability). Using scenario outlines with examples, they covered 80+ variations with 15 scenario templates.

Case Study 3: Fintech Regulatory Reporting

A fintech needed to implement new regulatory reporting requirements. The BA team created a requirements traceability matrix from regulation text through requirements to test cases. They used structured analysis to identify data lineage requirements (where data originates, transforms, and is reported). The traceability matrix proved invaluable during regulatory audit — demonstrating complete coverage of every regulatory requirement.

Case Study 4: Internal Tool Rationalization

A company had 20+ internal tools for HR, IT, and Finance processes. BA analysis using Lean techniques discovered 60% of requirements were duplicated across tools. Lean BA workshops eliminated redundant features, standardized 40% of processes, and reduced the tool set from 20 to 8. Cost savings exceeded $500K annually.

Rules

References

Handoff

After completing this skill:

Architecture Decision Trees

Requirements Elicitation Method

| Decision Point | Option A | Option B | Decision Criteria |

|---|---|---|---|

| Stakeholder access | Direct interviews (rich detail) |" Document analysis (async) "| Stakeholder availability, project timeline |

| Problem complexity |" User story mapping (end-to-end view) "| Use case specs (detailed flows) | Team familiarity with agile vs formal methods |

| Validation method | Prototyping (interactive feedback) |" Written sign-off (formal approval) "| Speed of iteration, regulatory requirements |

Requirements Structuring

Implementation Patterns

User Story Template

`gherkin

Feature: User Authentication

As a registered user

I want to log in with email and password

So that I can access my account

Scenario: Successful login

Given I am on the login page

When I enter valid email and password

And I click "Sign In"

Then I should be redirected to my dashboard

And I should see my profile name in the header

Scenario: Failed login with invalid password

Given I am on the login page

When I enter an invalid password

Then I should see an error message "Invalid email or password"

And I should remain on the login page

`

Requirements Traceability Matrix

| Req ID | Priority | Source | Test Case | Status |

|---|---|---|---|---|

| FR-001 | High | Stakeholder interview #3 | TC-AUTH-01 | Verified |

| FR-002 | Medium | Regulatory req §5.2 | TC-COMP-04 | Pending |

| NFR-001 | High | SLA requirement | TC-PERF-02 | In review |

| FR-003 | Low | Competitive analysis | TC-FEAT-07 | Deferred |

Production Considerations

Quality Assurance

Stakeholder Management

Anti-Patterns

| Anti-Pattern | Symptom | Solution |

|---|---|---|

| Analyzing to death | 200-page BRD, never implemented | Timebox analysis, release in increments, validate early |

| Assumed consensus | Stakeholders disagree at demo | Document decisions, use decision log, validate individually |

| Copy-paste requirements | Requirements don't match actual system | Contextualize each requirement, link to business goal |

| Gold-plating | Features nobody asked for | Scope must map to prioritized business outcomes |

| Silent stakeholder | Missing critical domain knowledge | Identify and interview all power users explicitly |

Performance Optimization

Elicitation Efficiency

Documentation Velocity

Security Considerations

Sensitive Information

Compliance & Audit

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.