xiaohongshu
xiaohongshu
apply-qa-fixes
Systematically consume QA quality gate outputs and apply prioritized fixes for high-severity issues, NFR failures, and test coverage gaps. Use when quality review identifies issues requiring remediation.
Full skill instructions
Systematically consume QA quality gate outputs and apply prioritized fixes for issues identified during quality review.
After Quinn's quality review creates a quality gate with CONCERNS or FAIL status, this skill enables James to systematically consume the findings and apply fixes in a deterministic, prioritized manner.
Core Principles:
Integration:
This skill should be used when:
This skill should NOT be used when:
.claude/tasks/{task-id}.md.claude/quality/gates/{task-id}-gate-{date}.yaml.claude/quality/assessments/Purpose: Load project configuration, locate task file, find latest quality gate, verify readiness.
Actions:
Load Configuration:
python .claude/skills/bmad-commands/scripts/read_file.py \
--path .claude/config.yaml \
--output json
Parse configuration to extract:
Load Task File:
python .claude/skills/bmad-commands/scripts/read_file.py \
--path .claude/tasks/{task_id}.md \
--output json
Verify task is ready for fixes:
Locate Latest Quality Gate:
Search .claude/quality/gates/ for latest gate file:
{task-id}-gate-{date}.yamlLoad Quality Gate:
python .claude/skills/bmad-commands/scripts/read_file.py \
--path .claude/quality/gates/{gate_file} \
--output json
Parse gate YAML structure:
decision - Gate status (PASS/CONCERNS/FAIL/WAIVED)overall_score - Quality score (0-100)dimensions - Quality dimension scorestop_issues - High/medium/low severity issuesnfr_validation - NFR assessment resultstrace - Traceability gapstest_design - Test coverage gapsaction_items - Recommended actionsHalt if:
See: references/templates.md for gate schema and configuration format
Purpose: Extract all issues from quality gate and assessment reports.
Actions:
Parse Top Issues from Gate:
From gate.yaml:
top_issues:
- id: "SEC-001"
category: "security"
severity: "high"
description: "Missing input validation on user endpoint"
location: "src/api/user.ts:45"
recommendation: "Add Joi validation schema"
Categorize by severity:
Parse NFR Failures:
From gate.nfr_validation:
nfr_validation:
security:
status: "FAIL"
score: 45
concerns:
- "Missing SQL parameterization (src/db/queries.ts:23)"
- "No rate limiting on API endpoints"
Extract:
Parse Test Coverage Gaps:
From gate.test_design.coverage_gaps:
coverage_gaps:
- ac_id: "AC2"
description: "User authentication flow"
missing_tests:
- "Should reject invalid credentials"
- "Should handle expired tokens"
Parse Traceability Gaps:
From gate.trace.ac_gaps:
ac_gaps:
- ac_id: "AC4"
description: "Secure password storage"
coverage: "partial"
missing: ["bcrypt hashing not implemented"]
Outputs:
high_severity_issues[] - List of high severity issues with locationsmedium_severity_issues[] - List of medium severity issueslow_severity_issues[] - List of low severity issuesnfr_failures[] - NFR FAIL statuses with fixes needednfr_concerns[] - NFR CONCERNS with recommended fixescoverage_gaps[] - Test scenarios to addtrace_gaps[] - Uncovered acceptance criteriaSee: references/templates.md for full gate schema and parsing examples
Purpose: Create deterministic, prioritized fix plan ensuring critical issues addressed first.
Priority Rules:
Within Same Priority:
Actions:
Build Priority List:
fix_plan = [
// Priority 1: High severity
{ priority: 1, issue_id: "SEC-001", type: "security", ... },
{ priority: 1, issue_id: "SEC-002", type: "security", ... },
// Priority 2: NFR failures
{ priority: 2, issue_id: "NFR-SEC-001", type: "nfr_fail", ... },
// Priority 3: Coverage gaps
{ priority: 3, issue_id: "TEST-001", type: "coverage_gap", ac_id: "AC2", ... },
// ... continue for all priorities
]
Calculate Impact:
For each fix, estimate:
Check Guardrails:
Verify fix plan doesn't exceed James's guardrails:
Present Fix Plan to User:
=== Fix Plan ===
Total Issues: 15
Priority 1 (High Severity): 3 issues
- SEC-001: Missing input validation (src/api/user.ts)
- SEC-002: SQL injection risk (src/db/queries.ts)
- PERF-001: N+1 query issue (src/services/data.ts)
Priority 2 (NFR Failures): 2 issues
- NFR-SEC-001: No rate limiting
- NFR-REL-001: Missing error logging
Priority 3 (Coverage Gaps): 5 tests to add
- AC2: User authentication flow (2 tests)
- AC4: Secure password storage (3 tests)
Estimated Impact:
- Files to modify: 8
- Tests to add: 5
- Expected diff: ~600 lines
Proceed with fixes? (y/n)
Outputs:
fix_plan[] - Ordered list of fixes to applyestimated_impact{} - Files, lines, testsguardrail_check{} - Pass/fail statusSee: references/priority-rules.md for detailed priority logic and references/examples.md for fix plan examples
Purpose: Apply fixes from plan using bmad-commands primitives and Claude Code tools.
Actions:
For each fix in fix_plan (in priority order):
Load Affected Files:
Use Claude Code Read tool to load files needing modification:
Read: src/api/user.ts
Read: tests/api/user.test.ts
Apply Code Fix:
Use Claude Code Edit tool to apply fix:
Edit: src/api/user.ts
Old: const user = await db.query(`SELECT * FROM users WHERE id = ${userId}`)
New: const user = await db.query('SELECT * FROM users WHERE id = ?', [userId])
Principles:
Add Missing Tests:
Use Claude Code Write tool to add test files:
Write: tests/api/user-auth.test.ts
Content: [Test scenarios from coverage_gaps]
Use Edit tool to add tests to existing files:
Edit: tests/api/user.test.ts
Add tests for:
- Should reject invalid credentials
- Should handle expired tokens
Track Progress:
Update todo list as fixes applied:
✅ Fix 1/15: Added input validation (SEC-001)
✅ Fix 2/15: Added SQL parameterization (SEC-002)
⏳ Fix 3/15: Adding rate limiting middleware...
Error Handling:
If fix fails:
Outputs:
fixes_applied[] - List of successfully applied fixesfixes_failed[] - List of failed fixes with errorsfiles_modified[] - All files changedtests_added - Count of new testsSee: references/examples.md for fix application examples
Purpose: Run tests and lint to verify fixes don't introduce regressions.
Actions:
Run Lint:
# Lint check (exact command depends on project)
npm run lint
# or
eslint src/
Capture output:
Run Tests:
python .claude/skills/bmad-commands/scripts/run_tests.py \
--path . \
--framework auto \
--output json
Parse results:
{
"success": true,
"outputs": {
"passed": true,
"total_tests": 45,
"tests_passed": 45,
"tests_failed": 0,
"coverage_percent": 89
}
}
Check Coverage Improvement:
Compare before/after coverage:
Iterate if Needed:
If tests fail:
Halt if:
Outputs:
lint_passed - Booleantests_passed - Booleancoverage_before - Numbercoverage_after - Numbercoverage_improvement - Numbervalidation_clean - BooleanSee: references/templates.md for validation report format
Purpose: Update task Implementation Record with fix details.
STRICT PERMISSIONS:
AUTHORIZED to update:
NOT AUTHORIZED to update:
Actions:
Load Current Task File:
python .claude/skills/bmad-commands/scripts/read_file.py \
--path .claude/tasks/{task_id}.md \
--output json
Generate Fix Summary:
### QA Fixes Applied (2025-01-15)
**Quality Gate:** .claude/quality/gates/{task-id}-gate-{date}.yaml
**Status Before:** CONCERNS (72/100)
**Status After:** Ready for re-review
**Fixes Applied (15 total):**
**Priority 1 (High Severity):**
1. SEC-001: Added input validation (src/api/user.ts:45)
2. SEC-002: Added SQL parameterization (src/db/queries.ts:23)
3. PERF-001: Fixed N+1 query (src/services/data.ts:67)
**Priority 2 (NFR Failures):**
4. NFR-SEC-001: Added rate limiting middleware
5. NFR-REL-001: Added error logging and monitoring
**Priority 3 (Coverage Gaps):**
6-10. Added 5 missing tests for AC2, AC4
**Priority 4-7:**
11-15. Addressed medium/low severity issues
**Validation Results:**
- ✅ Lint: 0 problems
- ✅ Tests: 45/45 passed
- ✅ Coverage: 82% → 89% (+7%)
**Files Modified:**
- src/api/user.ts
- src/db/queries.ts
- src/services/data.ts
- src/middleware/rate-limit.ts (new)
- tests/api/user.test.ts
- tests/api/user-auth.test.ts (new)
- tests/db/queries.test.ts
**Next Steps:**
- Ready for Quinn re-review: @quinn *review {task-id}
Update Implementation Record:
Use Edit tool to append fix summary to Implementation Record section:
Edit: .claude/tasks/{task-id}.md
Section: Implementation Record
Action: Append QA fix summary
Update File List:
Add newly created/modified files to task file list.
Update Status (if needed):
If fixes require re-review:
Outputs:
task_updated - Booleanfix_summary - Markdown textSee: references/templates.md for task update template
Purpose: Track metrics for observability and learning.
Actions:
Emit structured telemetry:
{
"event": "skill.apply-qa-fixes.completed",
"timestamp": "2025-01-15T10:30:00Z",
"data": {
"task_id": "task-001",
"quality_gate": ".claude/quality/gates/task-001-gate-2025-01-15.yaml",
"fixes_count": 15,
"fixes_applied": {
"high_severity": 3,
"nfr_failures": 2,
"coverage_gaps": 5,
"nfr_concerns": 2,
"medium_severity": 2,
"low_severity": 1
},
"tests_added": 5,
"coverage_before": 82,
"coverage_after": 89,
"coverage_improvement": 7,
"files_modified": 7,
"validation_passed": true,
"duration_ms": 180000,
"iterations": 1,
"fixes_failed": 0
}
}
Metrics to Track:
Use Cases:
Skill complete when:
James Routing:
# In james-developer-v2.md
command: "*apply-qa-fixes"
routing_logic:
- condition: "high_severity_count > 5 OR nfr_failures > 2"
guardrails:
max_files: 10
max_diff_lines: 800
require_user_confirmation: true
- condition: "high_severity_count > 0 OR nfr_failures > 0"
guardrails:
max_files: 7
max_diff_lines: 600
- condition: "default"
guardrails:
max_files: 5
max_diff_lines: 400
Usage:
# After Quinn review creates gate with CONCERNS/FAIL
@james *apply-qa-fixes task-001
# James:
# ✅ Quality gate loaded: CONCERNS (3 high, 2 medium issues)
# ✅ Fix plan created (5 fixes prioritized)
# ⏳ Applying fixes...
# ✅ All fixes applied
# ✅ Validation passed
# ✅ Task updated
#
# Ready for re-review: @quinn *review task-001
Escalate to user when:
references/templates.md - Gate schema, task update template, output formatsreferences/priority-rules.md - Detailed priority logic and decision rulesreferences/examples.md - Fix application examples and usage scenariosPart of BMAD Enhanced Development Suite - Integrates with Quinn (Quality) for complete feedback loop
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience