Skip to content
562 changes: 562 additions & 0 deletions src/plugins/trackers/builtin/beads-rust-bv/index.ts

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/plugins/trackers/builtin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import createJsonTracker from './json/index.js';
import createBeadsTracker from './beads/index.js';
import createBeadsBvTracker from './beads-bv/index.js';
import createBeadsRustTracker from './beads-rust/index.js';
import createBeadsRustBvTracker from './beads-rust-bv/index.js';

/**
* All built-in tracker plugin factories.
Expand All @@ -18,6 +19,7 @@ export const builtinTrackers = {
beads: createBeadsTracker,
'beads-bv': createBeadsBvTracker,
'beads-rust': createBeadsRustTracker,
'beads-rust-bv': createBeadsRustBvTracker,
} as const;

/**
Expand All @@ -37,4 +39,5 @@ export {
createBeadsTracker,
createBeadsBvTracker,
createBeadsRustTracker,
createBeadsRustBvTracker,
};
99 changes: 99 additions & 0 deletions src/templates/builtin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,105 @@ When finished (or if already complete), signal completion with:
<promise>COMPLETE</promise>
`;

/**
* Beads-rust + bv tracker template - uses br commands with bv selection context.
* Context-first structure: PRD → Selection Context → Patterns → Task → Workflow
*/
export const BEADS_RUST_BV_TEMPLATE = `{{!-- Full PRD for project context (agent studies this first) --}}
{{#if prdContent}}
## PRD: {{prdName}}
{{#if prdDescription}}
{{prdDescription}}
{{/if}}

### Progress: {{prdCompletedCount}}/{{prdTotalCount}} tasks complete

<details>
<summary>Full PRD Document (click to expand)</summary>

{{prdContent}}

</details>
{{/if}}

{{!-- Why this task was selected (bv context) --}}
{{#if selectionReason}}
## Why This Task Was Selected
{{selectionReason}}
{{/if}}

{{!-- Learnings from previous iterations (patterns first) --}}
{{#if codebasePatterns}}
## Codebase Patterns (Study These First)
{{codebasePatterns}}
{{/if}}

## Bead Details
- **ID**: {{taskId}}
- **Title**: {{taskTitle}}
{{#if epicId}}
- **Epic**: {{epicId}}{{#if epicTitle}} - {{epicTitle}}{{/if}}
{{/if}}
{{#if taskDescription}}
- **Description**: {{taskDescription}}
{{/if}}

{{#if acceptanceCriteria}}
## Acceptance Criteria
{{acceptanceCriteria}}
{{/if}}

{{#if dependsOn}}
## Dependencies
This task depends on: {{dependsOn}}
{{/if}}

{{#if blocks}}
## Impact
Completing this task will unblock: {{blocks}}
{{/if}}

{{#if recentProgress}}
## Recent Progress
{{recentProgress}}
{{/if}}

## Workflow
1. Study the PRD context above to understand the bigger picture (if available)
2. Study \`.ralph-tui/progress.md\` to understand overall status, implementation progress, and learnings including codebase patterns and gotchas
3. Implement the requirements (stay on current branch)
4. Run your project's quality checks (typecheck, lint, etc.)
{{#if config.autoCommit}}
5. Do NOT create git commits. Changes will be committed automatically by the engine after task completion.
{{else}}
5. Do NOT create git commits. Leave all changes uncommitted for manual review.
{{/if}}
6. Close the bead: \`br close {{taskId}} --reason "Brief description"\`
7. Flush tracker state to JSONL (no git side effects): \`br sync --flush-only\`
8. Document learnings (see below)
9. Signal completion

## Before Completing
APPEND to \`.ralph-tui/progress.md\`:
\`\`\`
## [Date] - {{taskId}}
- What was implemented
- Files changed
- **Learnings:**
- Patterns discovered
- Gotchas encountered
---
\`\`\`

If you discovered a **reusable pattern**, also add it to the \`## Codebase Patterns\` section at the TOP of progress.md.

## Stop Condition
**IMPORTANT**: If the work is already complete (implemented in a previous iteration or already exists), verify it works correctly and signal completion immediately.

When finished (or if already complete), signal completion with:
<promise>COMPLETE</promise>
`;

/**
* JSON (prd.json) tracker template - structured for PRD user stories.
* Context-first structure: PRD → Patterns → Task → Workflow
Expand Down
7 changes: 7 additions & 0 deletions src/templates/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
BEADS_TEMPLATE,
BEADS_RUST_TEMPLATE,
BEADS_BV_TEMPLATE,
BEADS_RUST_BV_TEMPLATE,
JSON_TEMPLATE,
} from './builtin.js';

Expand All @@ -42,6 +43,8 @@ export function getBuiltinTemplate(trackerType: BuiltinTemplateType): string {
return BEADS_RUST_TEMPLATE;
case 'beads-bv':
return BEADS_BV_TEMPLATE;
case 'beads-rust-bv':
return BEADS_RUST_BV_TEMPLATE;
case 'json':
return JSON_TEMPLATE;
case 'default':
Expand All @@ -56,6 +59,9 @@ export function getBuiltinTemplate(trackerType: BuiltinTemplateType): string {
* @returns The matching built-in template type
*/
export function getTemplateTypeFromPlugin(pluginName: string): BuiltinTemplateType {
if (pluginName.includes('beads-rust-bv')) {
return 'beads-rust-bv';
}
if (pluginName.includes('beads-bv')) {
return 'beads-bv';
}
Expand Down Expand Up @@ -643,6 +649,7 @@ export function installBuiltinTemplates(force = false): {
'default': DEFAULT_TEMPLATE,
'beads': BEADS_TEMPLATE,
'beads-bv': BEADS_BV_TEMPLATE,
'beads-rust-bv': BEADS_RUST_BV_TEMPLATE,
'json': JSON_TEMPLATE,
};

Expand Down
1 change: 1 addition & 0 deletions src/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ export {
DEFAULT_TEMPLATE,
BEADS_TEMPLATE,
BEADS_BV_TEMPLATE,
BEADS_RUST_BV_TEMPLATE,
JSON_TEMPLATE,
} from './builtin.js';
2 changes: 1 addition & 1 deletion src/templates/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export interface TemplateRenderResult {
* Supported built-in template types.
* Each tracker type has a corresponding default template.
*/
export type BuiltinTemplateType = 'default' | 'beads' | 'beads-rust' | 'json' | 'beads-bv';
export type BuiltinTemplateType = 'default' | 'beads' | 'beads-rust' | 'json' | 'beads-bv' | 'beads-rust-bv';

/**
* Template configuration in ralph config.
Expand Down
Loading
Loading