Skip to content

Add tracker labels support to PRD creation workflow#208

Merged
subsy merged 3 commits intomainfrom
claude/fix-create-prd-labels-dA43O
Jan 23, 2026
Merged

Add tracker labels support to PRD creation workflow#208
subsy merged 3 commits intomainfrom
claude/fix-create-prd-labels-dA43O

Conversation

@subsy
Copy link
Owner

@subsy subsy commented Jan 23, 2026

Summary

This PR adds support for applying tracker labels to issues created during the PRD (Product Requirements Document) creation workflow. Labels are now loaded from the config file's trackerOptions.labels setting and automatically applied to all beads issues (epics and child tasks).

Key Changes

  • CreatePrdArgs interface: Added optional trackerLabels field to pass labels through the command execution pipeline
  • Config loading: Implemented logic to parse trackerOptions.labels from stored config, supporting both comma-separated strings and array formats
  • PrdChatApp component:
    • Added trackerLabels prop to receive labels from parent
    • Implemented label instruction generation for beads format
    • Automatically injects --labels flag into all bd create and br create commands when labels are configured
    • Ensures 'ralph' label is always included first, followed by any additional configured labels

Implementation Details

  • Labels are parsed from config with trimming and filtering of empty values
  • Type-safe handling of both string and array label formats from config
  • Labels instruction is only added when using 'beads' format and labels are present
  • The --labels flag is injected into the AI prompt to ensure consistent application across all created issues

Summary by CodeRabbit

  • New Features
    • Added support for tracker labels in the PRD creation workflow
    • Labels can now be configured and automatically applied when creating issues via the beads tracker format
    • Enhanced tracker integration with centralised label management

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Jan 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
ralph-tui Ignored Ignored Preview Jan 23, 2026 5:19pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

Warning

Rate limit exceeded

@subsy has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 27 minutes and 11 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

This PR adds tracker label support to the PRD creation workflow. The CreatePrdArgs interface receives a new optional trackerLabels field, which is sourced from configuration during command execution. The labels are then passed to the PrdChatApp component, where they are used to construct label-instruction blocks in generated prompts for the beads tracker format.

Changes

Cohort / File(s) Summary
Command Arguments & Configuration
src/commands/create-prd.tsx
Added trackerLabels?: string[] field to CreatePrdArgs interface. Extended configuration loading to read and normalise tracker labels from trackerOptions.labels (supporting both comma-separated strings and arrays). Threaded labels through to PrdChatApp via runChatMode.
Chat UI Component
src/tui/components/PrdChatApp.tsx
Added trackerLabels?: string[] prop to PrdChatAppProps. When beads format is selected and labels are present, constructs and appends labelsInstruction blocks to prompts, instructing the creation of beads/BR issues with --labels flag including deduplicated labels and a default 'ralph' label.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Through configs we hop, labels in tow,
Threading them gently where beads come to grow,
Each task gets its marks, deduplicated with care,
Ralph stands as default—a bunny's flair! 🏷️

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the primary change: adding tracker labels support to the PRD creation workflow, which is directly reflected in the code changes to both CreatePrdArgs and PrdChatApp.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 5.26316% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.87%. Comparing base (8afc587) to head (e0afd67).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/commands/create-prd.tsx 5.26% 18 Missing ⚠️

❌ Your patch status has failed because the patch coverage (5.26%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #208      +/-   ##
==========================================
- Coverage   45.17%   44.87%   -0.31%     
==========================================
  Files          84       84              
  Lines       24299    24466     +167     
==========================================
+ Hits        10977    10978       +1     
- Misses      13322    13488     +166     
Files with missing lines Coverage Δ
src/commands/create-prd.tsx 19.31% <5.26%> (-0.81%) ⬇️

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/tui/components/PrdChatApp.tsx`:
- Around line 409-420: The callback handleTrackerSelect captures trackerLabels
but the dependency array omits it, causing stale closures; update the
useCallback dependencies to include trackerLabels (and any other used state) so
the function always sees current labels, and also make the deduplication that
builds allLabels case-insensitive by normalizing entries (e.g., toLowerCase)
before filtering out 'ralph' and removing duplicates so variants like 'Ralph' or
'RALPH' are handled; locate symbols labelsInstruction and handleTrackerSelect to
apply these changes.

claude and others added 3 commits January 23, 2026 17:18
The create-prd command loaded tracker config but never passed the
trackerOptions.labels to the PrdChatApp component. Issues created via
the beads skill were missing the labels configured during ralph-tui
setup. This fix loads labels from config and includes them as an
instruction in the beads skill prompt, matching the behavior of the
convert command.

https://claude.ai/code/session_01KdwvcSwmwRCScMm1UpGFtK
…ive dedup

The handleTrackerSelect callback captured trackerLabels but the
useCallback dependency array omitted it, risking stale closures.
Also normalize labels case-insensitively when deduplicating against the
always-included 'ralph' entry so that 'Ralph' or 'RALPH' variants
don't produce duplicates in the --labels flag.
Extract parseTrackerLabels and buildBeadsLabelsInstruction into tested
helpers to cover new PR lines: config label loading (string/array
formats, trimming, filtering) and case-insensitive dedup logic that
prevents duplicate 'ralph' variants in the --labels flag.
@subsy subsy force-pushed the claude/fix-create-prd-labels-dA43O branch from a218ebf to e0afd67 Compare January 23, 2026 17:19
@subsy subsy merged commit 355f086 into main Jan 23, 2026
7 checks passed
sakaman pushed a commit to sakaman/ralph-tui that referenced this pull request Feb 15, 2026
…dA43O

Add tracker labels support to PRD creation workflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments