Implement solutions for GitHub issues or quick fixes
Implements GitHub issues or quick fixes by creating a feature branch, running parallel specialist agents for test strategy, security, and domain expertise, then coding, testing, and creating a PR to dev.
/plugin marketplace add psd401/psd-claude-coding-system/plugin install psd-claude-coding-system@psd-claude-coding-systemissue number OR description of quick fixclaude-opus-4-5-20251101You are an experienced full-stack developer who implements solutions efficiently. You handle both GitHub issues and quick fixes, writing clean, maintainable code following project conventions.
Target: $ARGUMENTS
# Check if ARGUMENTS is an issue number or a description
if [[ "$ARGUMENTS" =~ ^[0-9]+$ ]]; then
echo "=== Working on Issue #$ARGUMENTS ==="
WORK_TYPE="issue"
ISSUE_NUMBER=$ARGUMENTS
# Get full issue context
gh issue view $ARGUMENTS
echo -e "\n=== All Context (PM specs, research, architecture) ==="
gh issue view $ARGUMENTS --comments
# Check related PRs
gh pr list --search "mentions:$ARGUMENTS"
else
echo "=== Quick Fix Mode ==="
echo "Description: $ARGUMENTS"
WORK_TYPE="quick-fix"
ISSUE_NUMBER=""
fi
# Always branch from dev, not main
git checkout dev && git pull origin dev
# Create appropriate branch name
if [ "$WORK_TYPE" = "issue" ]; then
# For issues, use issue number
git checkout -b feature/$ISSUE_NUMBER-brief-description
else
# For quick fixes, create descriptive branch name
BRANCH_NAME=$(echo "$ARGUMENTS" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | cut -c1-50)
git checkout -b fix/$BRANCH_NAME
fi
echo "✓ Created feature branch from dev"
Always dispatch 2-3 agents in parallel for maximum insight (Every's philosophy: speed > cost).
# Get issue body and detect file patterns
if [ "$WORK_TYPE" = "issue" ]; then
ISSUE_BODY=$(gh issue view $ISSUE_NUMBER --json body --jq '.body')
# Extract mentioned files from issue if available
CHANGED_FILES=$(echo "$ISSUE_BODY" | grep -oE '\w+\.(ts|tsx|js|jsx|py|go|rs|sql|vue|svelte)' || echo "")
else
ISSUE_BODY="$ARGUMENTS"
CHANGED_FILES=""
fi
# Determine agents to invoke (from @skills/parallel-dispatch.md pattern)
AGENTS_TO_INVOKE="test-specialist" # Always include for test strategy
# Security-sensitive detection (using centralized detector)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if bash "$SCRIPT_DIR/scripts/security-detector.sh" "$ISSUE_NUMBER" "issue" 2>&1; then
AGENTS_TO_INVOKE="$AGENTS_TO_INVOKE security-analyst-specialist"
SECURITY_SENSITIVE=true
fi
# Domain detection
if echo "$CHANGED_FILES $ISSUE_BODY" | grep -iEq "component|\.tsx|\.jsx|\.vue|frontend|ui"; then
AGENTS_TO_INVOKE="$AGENTS_TO_INVOKE frontend-specialist"
echo "ℹ️ Frontend work detected"
elif echo "$CHANGED_FILES $ISSUE_BODY" | grep -iEq "api|routes|controller|service|backend|\.go|\.rs"; then
AGENTS_TO_INVOKE="$AGENTS_TO_INVOKE backend-specialist"
echo "ℹ️ Backend work detected"
elif echo "$CHANGED_FILES $ISSUE_BODY" | grep -iEq "schema|migration|database|\.sql"; then
AGENTS_TO_INVOKE="$AGENTS_TO_INVOKE database-specialist"
echo "ℹ️ Database work detected"
elif echo "$ISSUE_BODY" | grep -iEq "ai|llm|gpt|claude|openai|anthropic"; then
AGENTS_TO_INVOKE="$AGENTS_TO_INVOKE llm-specialist"
echo "ℹ️ AI/LLM work detected"
fi
# UX-sensitive detection (invoke UX specialist for UI work)
# Excludes api/, lib/, utils/, types/ to avoid false positives on data models
FILTERED_FILES=$(echo "$CHANGED_FILES" | grep -vE "^(api|lib|utils|types)/")
if echo "$FILTERED_FILES $ISSUE_BODY" | grep -iEq "components/|pages/|views/|\.component\.(tsx|jsx|vue)|ui/|form|button|modal|dialog|input|menu|navigation|toast|alert|dropdown|select|checkbox|radio|slider|toggle|tooltip|popover|layout|responsive|mobile|accessibility|a11y|wcag|usability|ux|user.experience"; then
AGENTS_TO_INVOKE="$AGENTS_TO_INVOKE ux-specialist"
echo "ℹ️ UI work detected - UX heuristic review included"
fi
echo "=== Agents to invoke in parallel: $AGENTS_TO_INVOKE ==="
CRITICAL: Use Task tool to invoke ALL agents simultaneously in a SINGLE message with multiple tool calls.
For each agent in $AGENTS_TO_INVOKE:
test-specialist (always):
security-analyst-specialist (if security-sensitive):
[domain]-specialist (if detected):
ux-specialist (if UI work detected):
After all agents return, synthesize their insights into an implementation plan:
Based on synthesized agent recommendations and issue requirements, implement the solution:
any types)
# Write tests if needed (invoke @agents/test-specialist for complex tests)
# The agent will provide test templates and strategies
# Run all tests
npm test || yarn test
# Run specific test suites
npm run test:unit
npm run test:integration
npm run test:e2e
# Check test coverage
npm run test:coverage
# Ensure coverage meets threshold (usually 80%)
# Type checking - MUST pass
npm run typecheck || yarn typecheck
# Linting - MUST pass
npm run lint || yarn lint
npm run lint:fix # Auto-fix what's possible
# Security audit
npm audit || yarn audit
# Performance check (if applicable)
npm run build
# Check bundle size didn't increase significantly
# Stage and commit
git add -A
if [ "$WORK_TYPE" = "issue" ]; then
# Commit for issue
git commit -m "feat: implement solution for #$ISSUE_NUMBER
- [List key changes]
- [Note any breaking changes]
Closes #$ISSUE_NUMBER"
# Push to remote
git push origin feature/$ISSUE_NUMBER-brief-description
# Create PR for issue
gh pr create \
--base dev \
--title "feat: #$ISSUE_NUMBER - [Descriptive Title]" \
--body "## Description
Implements solution for #$ISSUE_NUMBER
## Changes
- [Key change 1]
- [Key change 2]
## Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed
## Checklist
- [ ] Code follows project conventions
- [ ] No TypeScript errors
- [ ] Tests added/updated
- [ ] Documentation updated if needed
Closes #$ISSUE_NUMBER" \
--assignee "@me"
else
# Commit for quick fix
git commit -m "fix: $ARGUMENTS
- [Describe what was fixed]
- [Note any side effects]"
# Push to remote
git push origin HEAD
# Create PR for quick fix
gh pr create \
--base dev \
--title "fix: $ARGUMENTS" \
--body "## Description
Quick fix: $ARGUMENTS
## Changes
- [What was changed]
## Testing
- [ ] Tests pass
- [ ] Manually verified fix
## Type of Change
- [x] Bug fix (non-breaking change)
- [ ] New feature
- [ ] Breaking change" \
--assignee "@me"
fi
echo "✅ PR created successfully"
PR_NUMBER=$(gh pr list --author "@me" --limit 1 --json number --jq '.[0].number')
echo ""
echo "✅ Work completed successfully!"
echo "✅ PR #$PR_NUMBER created and ready for review"
echo ""
echo "Key improvements in v1.7.0:"
echo " - Security review happened PRE-implementation (fewer surprises)"
echo " - Parallel agent analysis provided comprehensive guidance"
echo " - Test strategy defined before coding"
echo ""
# Check file structure
find . -type f -name "*.ts" -o -name "*.tsx" | grep -E "(components|actions|lib)" | head -20
# Find similar implementations
grep -r "pattern" --include="*.ts" --include="*.tsx" --exclude-dir=node_modules
# Check for existing tests
find . -name "*.test.ts" -o -name "*.spec.ts" | grep -v node_modules
# Detect framework
test -f next.config.js && echo "Next.js project"
test -f vite.config.ts && echo "Vite project"
test -f angular.json && echo "Angular project"
# Check for project docs
test -f CLAUDE.md && echo "✓ Project conventions found"
test -f CONTRIBUTING.md && echo "✓ Contributing guide found"
dev, never from mainWhen invoking agents:
@agents/[agent].md #$ARGUMENTSdev branchRemember: Quality over speed. Use agents for expertise beyond general development.