ralph-tui-cn-prd — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited ralph-tui-cn-prd (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Create detailed Product Requirements Documents optimized for AI agent execution via ralph-tui with the chronis (cn) CLI.
[PRD]...[/PRD] markers for TUI parsingImportant: Do NOT start implementing. Just create the PRD.
Ask questions one set at a time. Each answer should inform your next questions. Focus on:
1. What is the primary goal of this feature?
A. Improve user onboarding experience
B. Increase user retention
C. Reduce support burden
D. Other: [please specify]
2. Who is the target user?
A. New users only
B. Existing users only
C. All users
D. Admin users onlyThis lets users respond with "1A, 2C" for quick iteration.
Always ask about quality gates with two-tier classification:
What commands validate the codebase? These run ONCE when all stories are done (epic-level):
A. task ci (go-task runner)
B. make ci
C. bun typecheck && bun lint
D. cargo test
E. Other: [specify your commands]
For individual stories, what story-specific checks apply?
A. UI stories: verify in browser using dev-browser skill
B. UI stories: Playwright e2e test for that story
C. Backend stories: curl/test the specific endpoint
D. Other: [specify]Why two tiers? Running bun typecheck after every single story wastes agent context and time. Intermediate stories may have temporary type errors that the next story fixes. General checks run once at the end.
After each response, decide whether to:
Typically 2-4 rounds of questions are needed.
Always ask about test coverage expectations:
What test layers does this epic need?
A. Unit only (pure logic, projections, state machines)
B. Unit + Contract (data shapes across IPC boundary)
C. Unit + Contract + Integration (cross-service flows)
D. Full trophy: Unit + Contract + Integration + Frontend + E2E
E. Other: [specify]
Which behaviors are "block merge" critical?
A. Auto-completion / background logic (bugs are invisible to users)
B. Data filtering / query correctness (wrong data shown)
C. Orchestration (wrong things triggered)
D. All of the above
E. Other: [specify]Use the answers to populate the Testing Trophy section in the PRD.
Generate the PRD with these sections:
Brief description of the feature and the problem it solves.
Specific, measurable objectives (bullet list).
CRITICAL: Split gates into two tiers. The conversion tool (ralph-tui-cn-beads) reads this section directly.
## Quality Gates
### Epic-Level (run once on epic completion)
General codebase checks. These validate the whole project and run ONCE when all stories are done:
- `task ci` — full CI pipeline (typecheck + lint + test)
- `bun typecheck` — type checking
- `bun lint` — linting
### Story-Level (checked per story)
Criteria checked on specific stories where relevant:
- **UI stories:** Verify in browser using dev-browser skill
- **Backend stories:** Verify endpoint returns expected response
- **Migration stories:** Verify column/table exists after migrationEach story needs:
[Schema], [Backend], [UI], [Integration] — tells the conversion tool which story-level gates apply- [ ] checkboxes the agent marks as doneEach story should be small enough to implement in one focused AI agent session.
Format:
### US-001: [Title] [Schema]
**Description:** As a [user], I want [feature] so that [benefit].
**Acceptance Criteria:**
- [ ] Specific verifiable criterion
- [ ] Another criterion
- [ ] (story-level gate if applicable)
Mark each item [x] as you complete it. Only close when all are checked.Important — writing verifiable criteria:
Every criterion must be something the agent can concretely verify:
Good (agent can check these):
- [ ] File apps/core/src/new_module.rs exists and compiles- [ ] GET /api/v1/events returns 200 with JSON body- [ ] Column investorType added with default 'cold' (check migration file)- [ ] Component renders without errors (verify in browser)Bad (agent cannot verify these):
- [ ] Works correctly- [ ] Good UX- [ ] Handles edge cases- [ ] PerformantNote: Do NOT include epic-level gates (typecheck, lint, ci) in individual story criteria — they are defined once in the Quality Gates section and run on epic completion only. Story-level gates (browser verification, endpoint testing) DO belong in the relevant stories.
REQUIRED for every epic. Define the expected test coverage across all layers BEFORE implementation begins. This prevents shipping features with test debt.
The testing trophy prioritizes integration and contract tests over unit tests and E2E:
╭───────╮
│ E2E │ Few, slow, high confidence
╭──┴───────┴──╮
│ Integration │ Cross-boundary flows
╭──┴─────────────┴──╮
│ Contract/Handler │ Data shapes, API boundaries
╭──┴───────────────────┴──╮
│ Unit (logic only) │ Pure functions, state machines
╰──────────────────────────╯For each layer, list specific tests the epic requires:
## Testing Trophy
### Unit Tests
- [ ] [Projection] TaskRunProjection handles Started/Completed events (N tests)
- [ ] [Store] get_outputs filters deliverable steps only
- [ ] [Logic] auto-completion derives correct status from sibling runs
### Contract Tests
- [ ] [Handler] list_task_runs returns sorted TaskRunSummary array
- [ ] [Handler] run_job returns task_run_id, creates workflows
- [ ] [Handler] get_task_run_outputs filters is_deliverable == true
- [ ] [Frontend API] listTaskRuns/runJob/getTaskRunOutputs match handler shapes
### Integration Tests
- [ ] [Service] run_job creates TaskRun + triggers linked workflows
- [ ] [Flow] workflow completion → auto-completes parent TaskRun
### Frontend Tests
- [ ] [Component] Empty state shows Run Job CTA
- [ ] [Component] Accordion expand loads outputs
- [ ] [Component] Approve/Reject actions invoke correct commandsTDD-First Rules:
Every story follows test-driven development. Tests are written BEFORE or ALONGSIDE implementation, never after.
- [ ] Test: [description] (file: [path])- [ ] Contract test: [invoke command] returns expected shapeTesting trophy complete — all layers covered per the Testing Trophy sectionTest Placement in Stories (examples):
### US-003: Create TaskRun entity [Backend]
**Acceptance Criteria:**
- [ ] Test: TaskRunProjection handles Started event and queries by ID (red first)
- [ ] Test: TaskRunProjection derives status from child workflow runs
- [ ] TaskRun struct with fields: task_run_id, job_id, status, ...
- [ ] AllSource projection registered
- [ ] All tests green: cargo test task_run
### US-007: Expandable accordion [UI]
**Acceptance Criteria:**
- [ ] Contract test: getTaskRunOutputs returns WorkflowRunOutputs[] with nested steps
- [ ] Contract test: approve_step_run accepts stepRunId + disposition
- [ ] Accordion expands on click, loads outputs via getTaskRunOutputs
- [ ] All tests green: bun test job-detail-runsClassify tests by deployment gate:
Anti-patterns to reject:
Numbered list of specific functionalities:
Be explicit and unambiguous.
What this feature will NOT include. Critical for managing scope.
How will success be measured?
Remaining questions or areas needing clarification.
The PRD will be executed by AI coding agents via ralph-tui. Therefore:
- [ ] checkbox the agent can verify and mark - [x][UI], [Schema], [Backend]) so story-level gates are unambiguousCRITICAL: Wrap the final PRD in markers for TUI parsing:
[PRD]
# PRD: Feature Name
## Overview
...
## Quality Gates
### Epic-Level (run once on epic completion)
...
### Story-Level (checked per story)
...
## User Stories
...
[/PRD]File naming: The TUI will save to ./docs/proposals/prd-[feature-name].md
User: Create a PRD for adding dark mode to the TUI
Assistant: I'll help you create a PRD for dark mode. Let me ask a few questions:
A. Reduce eye strain for long sessions B. Match system theme preference C. Provide visual customization D. Other
A. Yes, save to config file B. No, session only C. Follow system preference
User: 1A, 2A
Assistant: Great! A couple more questions:
A. All TUI components B. Only the main execution view C. Main view + settings D. Other
A. task ci B. bun typecheck && bun lint C. make ci D. Other: [specify]
A. Verify in browser using dev-browser skill B. Playwright e2e test per story C. Both A and B D. No story-level checks needed
User: 3A, 4B, 5A
Assistant: Perfect, I have enough to generate the PRD.
[PRD]
Add dark mode support to ralph-tui to reduce eye strain during long orchestration sessions. The feature will apply to all TUI components and persist the user's preference in the config file.
General codebase checks that run ONCE when all stories are done:
bun typecheck — type checking passes with zero errorsbun lint — linting passes with zero warningsDescription: As a user, I want to set my preferred theme (light/dark) so that it persists across sessions.
Acceptance Criteria:
theme field to .ralph-tui.yaml schemaMark each item [x] as you complete it. Only close when all are checked.
Description: As a user, I want a soft-contrast dark theme that's easy on the eyes.
Acceptance Criteria:
Mark each item [x] as you complete it. Only close when all are checked.
Description: As a user, I want all TUI components to respect my theme preference.
Acceptance Criteria:
Mark each item [x] as you complete it. Only close when all are checked.
Description: As a user, I want to toggle themes from within the TUI settings.
Acceptance Criteria:
.ralph-tui.yaml after toggle)Mark each item [x] as you complete it. Only close when all are checked.
.ralph-tui.yaml[/PRD]
Before outputting the PRD:
[Schema], [Backend], [UI], [Integration]- [ ] checkbox[PRD]...[/PRD] markers~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.