Skip to content

Comments

docs: improve markdown PRD to Beads workflow documentation#51

Closed
artile wants to merge 2 commits intosubsy:mainfrom
artile:feat/prd-beads-workflow-improvements
Closed

docs: improve markdown PRD to Beads workflow documentation#51
artile wants to merge 2 commits intosubsy:mainfrom
artile:feat/prd-beads-workflow-improvements

Conversation

@artile
Copy link

@artile artile commented Jan 14, 2026

Summary

Improve Developer Experience for converting markdown PRDs to Beads issues.

README changes:

  • Add "From PRD to Beads: Next Steps" section with clear conversion workflow
  • Update "Getting Started" to show separate paths for JSON and Beads
  • Add troubleshooting entry for "PRD file is not valid JSON" error
  • Clarify that --prd flag expects JSON, not markdown

Interactive console improvements:

  • Enhance Beads detection to check both .beads directory AND bd CLI
  • Show unavailable options with helpful reasons
  • Add tip message when Beads is available with epic ID guidance

Problem Solved

Fixes the common confusion where users try to run ralph-tui run --prd file.md with a markdown PRD and don't know how to convert it for Beads.

Test plan

  • Build succeeds (bun run build)
  • Manual test: Create PRD in chat mode, verify Beads option shows with helpful tip

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Restructured README into streamlined sections (Documentation, Quick Links, Features, CLI Commands, Configuration, Custom Skills, Development) and replaced lengthy step-by-step guides with concise, feature-focused guidance and external docs links.
    • Removed explicit references to specific trackers and JSON-centric tutorials, replacing with a general "Task Trackers" concept and condensed troubleshooting.
  • New Features

    • UI now shows tool/tracker availability and contextual guidance when additional options become available.

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

Improve Developer Experience for converting markdown PRDs to Beads issues:

README changes:
- Add "From PRD to Beads: Next Steps" section with clear conversion workflow
- Update "Getting Started" to show separate paths for JSON and Beads
- Add troubleshooting entry for "PRD file is not valid JSON" error
- Clarify that --prd flag expects JSON, not markdown

Interactive console improvements:
- Enhance Beads detection to check both .beads directory AND bd CLI
- Show unavailable options with helpful reasons
- Add tip message when Beads is available with epic ID guidance

This fixes the common confusion where users try to run "ralph-tui run --prd file.md"
with a markdown PRD and don't know how to convert it for Beads.

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 14, 2026

@artile is attempting to deploy a commit to the plgeek Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

Walkthrough

The README is substantially restructured and condensed; the TUI component PrdChatApp.tsx now performs an asynchronous runtime probe for the bd CLI and exposes tracker options with optional unavailability reasons, updating UI flows and PRD review messaging accordingly.

Changes

Cohort / File(s) Summary
Documentation
README.md
Reworked structure: condensed sections (Documentation, Quick Links, Features, CLI Commands, etc.), removed detailed step-by-step JSON flows, added “Custom Skills Directory”, updated links (website/docs/OpenTUI), and shortened troubleshooting/development guidance.
TUI component
src/tui/components/PrdChatApp.tsx
Added isBdAvailable probe using node:child_process spawn; made getTrackerOptions async (now returns Promise<TrackerOption[]>); added optional unavailableReason?: string to TrackerOption; trackerOptions now loaded asynchronously on mount; UI shows conditional extra help when Beads is available and includes unavailable reasons.

Sequence Diagram(s)

sequenceDiagram
    participant Component as PrdChatApp Component
    participant AsyncFn as getTrackerOptions()
    participant Probe as isBdAvailable()
    participant Proc as Child Process
    participant State as Component State

    Component->>AsyncFn: onMount call getTrackerOptions(cwd)
    AsyncFn->>Probe: probe for bd CLI
    Probe->>Proc: spawn bd probe command
    Proc-->>Probe: probe result (exit/code/output)
    Probe-->>AsyncFn: return beadsAvailable boolean
    AsyncFn->>AsyncFn: assemble TrackerOption[] (set unavailableReason if needed)
    AsyncFn-->>Component: resolve TrackerOption[]
    Component->>State: set trackerOptions
    Component->>Component: render UI with conditional help/explanations
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I sniff the PATH and twitch my nose,
I spawn a check where bd might doze.
If Beads awaken, I sing a cheer,
Tracker options bright and clear! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title mentions 'improve markdown PRD to Beads workflow documentation', but the README.md changes were reverted per reviewer feedback; only code changes to PrdChatApp.tsx remain, which focus on Beads detection and UI improvements rather than documentation. Clarify whether the title should reflect the code-only nature of the current changeset (Beads detection improvements) or update it to align with the actual changes made.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

@vercel
Copy link

vercel bot commented Jan 14, 2026

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

Project Deployment Review Updated (UTC)
ralph-tui Error Error Jan 14, 2026 9:34pm

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: 2

🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 705-708: Add a language specifier to the fenced code block
containing the error output so it reads ```text instead of ```, e.g., change the
code fence that wraps "Configuration errors: - PRD file is not valid JSON:
/path/to/my-prd.md" to start with ```text to enable proper syntax highlighting
and accessibility.

In `@src/tui/components/PrdChatApp.tsx`:
- Around line 216-223: The PRD detection can race with the async trackerOptions
load causing an empty trackerOptions when handlePrdDetected builds the message;
to fix, have handlePrdDetected explicitly await getTrackerOptions(cwd) (or use
cached/set state if already loaded) before using trackerOptions, falling back to
the freshly loaded options if state is still empty, and only proceed to
build/send the review message after those options are resolved; update
references in PrdChatApp to use the awaited result (or a helper like
ensureTrackerOptions) instead of relying solely on the mount useEffect-populated
trackerOptions state (also apply same change where handlePrdDetected logic
repeats around lines ~287-296).
🧹 Nitpick comments (1)
src/tui/components/PrdChatApp.tsx (1)

84-104: Potential double resolution in timeout handler.

When the timeout fires, proc.kill() is called followed by resolve(false). However, killing the process will also trigger the close event, which calls resolve(code === 0). Although subsequent resolve() calls are no-ops, this is a code smell. Consider tracking resolution state or removing the redundant resolve(false) after kill().

Proposed fix
 async function isBdAvailable(): Promise<boolean> {
   return new Promise((resolve) => {
+    let resolved = false;
+    const safeResolve = (value: boolean) => {
+      if (!resolved) {
+        resolved = true;
+        resolve(value);
+      }
+    };
+
     const proc = spawn('bd', ['--version'], {
       stdio: ['ignore', 'pipe', 'pipe'],
     });

     proc.on('close', (code) => {
-      resolve(code === 0);
+      safeResolve(code === 0);
     });

     proc.on('error', () => {
-      resolve(false);
+      safeResolve(false);
     });

     // Timeout after 2 seconds
     setTimeout(() => {
       proc.kill();
-      resolve(false);
+      safeResolve(false);
     }, 2000);
   });
 }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d54fff and f3bd79d.

📒 Files selected for processing (2)
  • README.md
  • src/tui/components/PrdChatApp.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Start all code files with a file-level JSDoc comment section explaining the file's purpose, prefixed with 'ABOUTME: '

Files:

  • src/tui/components/PrdChatApp.tsx
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Start all code files with a file-level JSDoc comment section explaining the file's purpose, prefixed with "ABOUTME: "

Files:

  • src/tui/components/PrdChatApp.tsx
🪛 markdownlint-cli2 (0.18.1)
README.md

705-705: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (5)
README.md (2)

166-185: Clear documentation for PRD-to-Beads workflow.

The updated "Getting Started" section and new "From PRD to Beads: Next Steps" subsection effectively clarify the distinction between JSON and Beads paths. The step-by-step instructions for converting markdown PRDs to Beads issues and running with epic IDs address the user confusion mentioned in the PR objectives.

Also applies to: 273-303


702-730: Helpful troubleshooting entry for common error.

The new troubleshooting section for "PRD file is not valid JSON" provides clear solutions for both JSON and Beads workflows, directly addressing the user confusion when running ralph-tui run --prd file.md with a markdown file.

src/tui/components/PrdChatApp.tsx (3)

1-5: ABOUTME comment present and well-formatted.

The file-level JSDoc comment correctly describes the component's purpose with the required "ABOUTME:" prefix. As per coding guidelines, this is correctly implemented.


109-134: BD availability logic is well-structured.

The getTrackerOptions function correctly checks both the .beads directory existence and the bd CLI availability before marking Beads as available. The unavailableReason provides clear guidance for users on how to resolve availability issues.


298-308: Helpful tip for Beads users.

The conditional extraHelp message that appears when Beads is available provides useful guidance about the epic ID workflow, aligning well with the documentation updates in README.md.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

README.md Outdated
Comment on lines 705 to 708
```
Configuration errors:
- PRD file is not valid JSON: /path/to/my-prd.md
```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add language specifier to fenced code block.

The error output code block is missing a language identifier. Adding one improves syntax highlighting and accessibility.

Proposed fix
-```
+```text
 Configuration errors:
 - PRD file is not valid JSON: /path/to/my-prd.md
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

705-705: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In `@README.md` around lines 705 - 708, Add a language specifier to the fenced
code block containing the error output so it reads ```text instead of ```, e.g.,
change the code fence that wraps "Configuration errors: - PRD file is not valid
JSON: /path/to/my-prd.md" to start with ```text to enable proper syntax
highlighting and accessibility.

Comment on lines +216 to +223
// Load tracker options on mount
useEffect(() => {
void getTrackerOptions(cwd).then((options) => {
if (isMountedRef.current) {
setTrackerOptions(options);
}
});
}, [cwd]);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Potential race condition: trackerOptions may be empty when PRD is detected.

The trackerOptions state is loaded asynchronously on mount, but handlePrdDetected uses it directly. If the BD availability check is slow and the user completes the PRD chat quickly, trackerOptions could still be an empty array when building the review message, resulting in no options being displayed.

Consider awaiting the tracker options or providing a fallback.

Proposed fix - await options in handlePrdDetected
   const handlePrdDetected = async (content: string, name: string) => {
     try {
       const fullOutputDir = join(cwd, outputDir);

       // Ensure output directory exists
       try {
         await access(fullOutputDir);
       } catch {
         await mkdir(fullOutputDir, { recursive: true });
       }

       // Generate filename
       const slug = slugify(name);
       const filename = `prd-${slug}.md`;
       const filepath = join(fullOutputDir, filename);

       // Write the file
       await writeFile(filepath, content, 'utf-8');

       // Update state for review phase
       if (isMountedRef.current) {
         setPrdContent(content);
         setPrdPath(filepath);
         setFeatureName(name);
         setPhase('review');

+        // Ensure tracker options are loaded
+        const options = trackerOptions.length > 0 
+          ? trackerOptions 
+          : await getTrackerOptions(cwd);
+        
         // Build tracker options text with unavailable reasons
-        const optionsText = trackerOptions
+        const optionsText = options
           .map((t) => {

Also applies to: 287-296

🤖 Prompt for AI Agents
In `@src/tui/components/PrdChatApp.tsx` around lines 216 - 223, The PRD detection
can race with the async trackerOptions load causing an empty trackerOptions when
handlePrdDetected builds the message; to fix, have handlePrdDetected explicitly
await getTrackerOptions(cwd) (or use cached/set state if already loaded) before
using trackerOptions, falling back to the freshly loaded options if state is
still empty, and only proceed to build/send the review message after those
options are resolved; update references in PrdChatApp to use the awaited result
(or a helper like ensureTrackerOptions) instead of relying solely on the mount
useEffect-populated trackerOptions state (also apply same change where
handlePrdDetected logic repeats around lines ~287-296).

@subsy
Copy link
Owner

subsy commented Jan 14, 2026

@artile thanks for the contribution! I really like the intent here, but think you've based this on an old branch,

Yesterday most of the heavy readme moved to docs (ralph-tui.com/docs).
Thats all now in the website/docs folder of this repo.

Do you want to take a stab at updating this PR to remove the README changes and update the docs directly?

The documentation has been moved to ralph-tui.com website.
Reverting README changes to match main branch.

Code changes in PrdChatApp.tsx remain - Beads detection improvements.
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 `@README.md`:
- Line 209: Replace the community fork link for OpenTUI in the README entry "-
[OpenTUI](https://github.com/anomalyco/opentui) - Terminal UI framework" with
the official repository URL; update the markdown link target so the list item
referencing "OpenTUI" points to "https://github.com/sst/opentui" instead of
"https://github.com/anomalyco/opentui".
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3bd79d and 2fa829a.

📒 Files selected for processing (1)
  • README.md
🧰 Additional context used
🪛 LanguageTool
README.md

[locale-violation] ~220-~220: License must be spelled with a “c” when used as a noun in British English. Use “licence”.
Context: ...cept](https://ghuntley.com/ralph/). ## License MIT License - see LICENSE f...

(LICENCE_LICENSE_NOUN_SINGULAR)


[locale-violation] ~222-~222: License must be spelled with a “c” when used as a noun in British English. Use “licence”.
Context: .../ghuntley.com/ralph/). ## License MIT License - see LICENSE for details.

(LICENCE_LICENSE_NOUN_SINGULAR)


[locale-violation] ~222-~222: LICENSE must be spelled with a “c” when used as a noun in British English. Use “licence”.
Context: ...alph/). ## License MIT License - see LICENSE for details.

(LICENCE_LICENSE_NOUN_SINGULAR)

🔇 Additional comments (2)
README.md (2)

32-43: All external documentation links are live and accessible. No action required.


1-222: No changes needed—the README state is correct.

The commit correctly reverts expanded documentation to match the main branch's consolidated state. The message "revert: remove README changes (docs moved to external site)" means the commit removes unnecessary README expansions from a feature branch and returns to main's intended state, which points users to ralph-tui.com for comprehensive documentation whilst keeping essential reference content in the README itself.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


- [Bun](https://bun.sh) - JavaScript runtime
- [OpenTUI](https://github.com/AshMartian/opentui) - Terminal UI framework
- [OpenTUI](https://github.com/anomalyco/opentui) - Terminal UI framework
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

OpenTUI GitHub anomalyco opentui repository

💡 Result:

There’s an OpenTUI repository under anomalyco on GitHub (anomalyco/opentui) that hosts releases (latest listed v0.1.72). It appears to be a community fork/package of the OpenTUI project; the primary/official OpenTUI repo is sst/opentui. Sources: [anomalyco release listing][1], repo summary page [2], and the official sst/opentui GitHub README [3].

Sources:

  1. anomalyco/opentui release v0.1.72 — NewReleases. [1]
  2. anomalyco/opentui repository details — GitGenius. [2]
  3. sst/opentui (official OpenTUI) — GitHub README. [3]

Link to official OpenTUI repository instead of community fork.

The README links to anomalyco/opentui, which is a community fork/package of OpenTUI. The official and primary OpenTUI repository is sst/opentui. Update the link to point to the authoritative source: https://github.com/sst/opentui.

🤖 Prompt for AI Agents
In `@README.md` at line 209, Replace the community fork link for OpenTUI in the
README entry "- [OpenTUI](https://github.com/anomalyco/opentui) - Terminal UI
framework" with the official repository URL; update the markdown link target so
the list item referencing "OpenTUI" points to "https://github.com/sst/opentui"
instead of "https://github.com/anomalyco/opentui".

@subsy
Copy link
Owner

subsy commented Jan 27, 2026

@artile this is now quite diverged from the current codebase so Im going to work on implementing these things in a separate branch

@subsy
Copy link
Owner

subsy commented Jan 27, 2026

@artile now superceded by #232

@subsy subsy closed this Jan 27, 2026
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