Agent skill
add-backlog-to-prd
Fetch open issues from brave/brave-browser (by label or assignee) and add missing ones to the Brave Core PRD backlog. Triggers on: add backlog to prd, update prd with issues, sync backlog, fetch issues for prd, add intermittent tests.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/add-backlog-to-prd
SKILL.md
PRD Brave Core - Add Backlog Issues
Automatically fetch open issues from the brave/brave-browser repository and add any missing ones to the Brave Core Bot PRD.
The Job
- Get the configured git user.name (used as the GitHub username)
- Fetch all open issues with the
bot/type/testlabel from brave/brave-browser - Fetch all open issues assigned to the git user.name from brave/brave-browser
- Combine both sets of issues (deduplicated)
- Compare with existing issues in the PRD (
./prd.json) - Add any missing issues as new user stories
- Provide a recap of what was added
Important: This skill is specifically for the Brave Core Bot PRD format.
Step 1: Get Git Username
Get the configured git user.name to use as the GitHub username for fetching assigned issues:
git config user.name
Step 2: Fetch GitHub Issues
Fetch issues from TWO sources and combine them:
- Labeled issues (bot/type/test):
gh issue list --repo brave/brave-browser --label "bot/type/test" --state open --json number,title,url,labels --limit 100
- Assigned issues (assigned to the git user.name):
gh issue list --repo brave/brave-browser --assignee "<git_user_name>" --state open --json number,title,url,labels --limit 100
- Combine and deduplicate by issue number:
jq -s '[.[][] | {number, title, url, labels}] | unique_by(.number)' <(gh issue list --repo brave/brave-browser --label "bot/type/test" --state open --json number,title,url,labels --limit 100) <(gh issue list --repo brave/brave-browser --assignee "$(git config user.name)" --state open --json number,title,url,labels --limit 100)
Step 3: Process Issues and Update PRD
A single helper script handles both new and existing PRDs:
jq -s '[.[][] | {number, title, url, labels}] | unique_by(.number)' \
<(gh issue list --repo brave/brave-browser --label "bot/type/test" --state open --json number,title,url,labels --limit 100) \
<(gh issue list --repo brave/brave-browser --assignee "$(git config user.name)" --state open --json number,title,url,labels --limit 100) | \
.claude/skills/add-backlog-to-prd/update_prd_with_issues.py ./prd.json > /tmp/prd_updated.json && \
mv /tmp/prd_updated.json ./prd.json
If ./prd.json doesn't exist yet, the script creates a new PRD. If it already exists, it only appends missing issues and never modifies existing stories.
What the script does:
- Detect issue type: Issues with "Test failure:" title prefix or
bot/type/testlabel are treated as test issues; all others get generic stories - For test issues:
- Extract test names from issue titles (handles multiple prefixes)
- Determine test location at generation time by running
git grepto find if the test is insrc/braveorsrc(Chromium) - Generate test-specific acceptance criteria with correct test binary and filter
- Include
testType,testLocation, andtestFilterfields
- For generic issues:
- Use the issue title directly as the story title
- Generate standard acceptance criteria (fetch issue, analyze, implement, build, format, presubmit, gn_check, find and run relevant tests)
- Generate proper user story structure with sequential US-XXX IDs and priority ordering
- Skip issues already in the PRD
- Safety check verifies existing stories were not modified
Step 4: Provide Recap
Generate a comprehensive recap showing:
-
New Issues Added: List each new user story with:
- US-XXX number
- Test name
- Issue number
- Test type
- Status
-
Existing Issues Status Overview: Summarize existing stories by status:
- Merged
- Pushed
- Pending
- Skipped
- Invalid
-
Total PRD Statistics:
- Total count before and after
- Count by status
Example Output Format
# PRD Update Recap
## Summary
Successfully fetched 15 open issues from the `bot/type/test` label and added 7 missing issues to the PRD.
## New Issues Added (US-016 to US-022)
1. **US-016** - Fix test: BraveSearchTestEnabled.DefaultAPIVisibleKnownHost (issue #52439)
- Type: browser_test
- Status: pending
- Priority: 16
[... more entries ...]
## Existing Issues Status Overview
### Merged (6 issues)
- US-001: SolanaProviderTest.AccountChangedEventAndReload (#50022)
[... more entries ...]
### Pushed (1 issue)
[... entries ...]
### Skipped (7 issues)
[... entries ...]
### Invalid (1 issue)
[... entries ...]
### Pending (7 new issues)
[... entries ...]
## Total PRD Statistics
- Total user stories: 22 (was 15, added 7)
- Merged: 6
- Pushed: 1
- Pending: 7
- Skipped: 7
- Invalid: 1
Important Notes
- Always preserve the exact structure of existing user stories
- Test issues include the BEST-PRACTICES.md read step in acceptance criteria
- Test type determination is critical for generating correct test commands
- Priority numbers must be sequential and not conflict with existing ones
- All new stories start in "pending" status
Error Handling
- If
ghCLI is not available, report error and exit - If
./prd.jsondoesn't exist, a new one is created automatically - If GitHub API rate limit is hit, report error with retry time
- If
jqis not available, report error and exit
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?