Every meaningful change to PatchPro should be tracked through a GitHub issue. This ensures:
- Visibility: Team knows what's being worked on
- Context: Future developers understand why changes were made
- Traceability: Commits link to discussions and decisions
- Planning: Work can be estimated and prioritized
Create a GitHub issue BEFORE starting work on:
- ✅ New features or enhancements
- ✅ Significant bug fixes (not typos/quick fixes)
- ✅ Work spanning multiple files or components
- ✅ Architectural changes or refactoring
- ✅ Any work that takes >30 minutes
- ✅ Work that other team members should know about
- ✅ Performance improvements
- ✅ Security fixes
DO NOT create issues for:
- ❌ Typo fixes in comments
- ❌ Formatting/linting auto-fixes
- ❌ Version bumps (unless breaking changes)
- ❌ Trivial documentation updates
1. STOP and Draft
- Before writing any code, draft the issue description
- Include problem statement, scope, tasks, and DoD
- Think through the technical approach
2. Discuss
- Share issue draft with user/team lead for approval
- Incorporate feedback
- Ensure alignment on scope and approach
3. Create
- Once approved, create the issue in GitHub
- Use the Sprint-0 template format
- Assign appropriate labels and milestone
4. Reference
- Include issue number in ALL commits
- Update PR description with issue
- Link related issues (depends on, blocks, related to)
## S{sprint}-{component}-{number}: Brief Title
**Epic**: Sprint-{number} (Team {team})
**Component**: {AG|AN|CI|QA|UI|DX}
**Priority**: {High|Medium|Low}
**Blocked by**: {issue numbers or "None"}
**Blocks**: {issue numbers or "None"}
### Problem Statement
**Current behavior:**
[Describe what's happening now]
**Expected behavior:**
[Describe what should happen]
**Impact:**
[Why this matters - user impact, technical debt, blockers]
### Root Cause Analysis
[Technical explanation of why the problem occurs - optional for features]
### Scope
**In scope:**
- Item 1
- Item 2
**Out of scope:**
- Item 1
- Item 2
### Tasks
- [ ] Task 1 with specific action
- [ ] Task 2 with specific action
- [ ] Task 3 with specific action
- [ ] Write/update tests
- [ ] Update documentation
### Definition of Done
- [ ] All tasks completed
- [ ] Tests pass (unit + integration)
- [ ] Code reviewed and approved
- [ ] Documentation updated
- [ ] No regressions introduced
- [ ] Acceptance criteria met
### Technical Notes
**Files to modify:**
- `path/to/file.py` - what changes
**Implementation approach:**
[Code snippets, algorithms, design decisions]
**Dependencies:**
[External libraries, other PRs, etc.]
### Related Issues
- Depends on: #X
- Related to: #Y
- Blocks: #Z- AN: Analysis (findings, normalization, schema)
- AG: Agent (LLM, prompts, patch generation, fix application)
- CI: CI/CD (GitHub Actions, workflows, deployment)
- QA: Quality Assurance (tests, validation, evaluation)
- UI: User Interface (CLI, output formatting, UX)
- DX: Developer Experience (setup, docs, tooling)
- SEC: Security (vulnerabilities, access control)
- PERF: Performance (optimization, profiling)
Follow Conventional Commits:
type(scope): brief description [S0-XX-##]
Longer description explaining the change in detail.
Why was this change necessary? What problem does it solve?
- Key change 1
- Key change 2
- Key change 3
Technical notes:
- Implementation detail
- Design decision rationale
Fixes #issue-number
Related: #other-issue
feat: New featurefix: Bug fixdocs: Documentation onlyrefactor: Code change that neither fixes a bug nor adds a featureperf: Performance improvementtest: Adding or updating testschore: Maintenance (deps, config, build)style: Code style (formatting, missing semicolons, etc.)ci: CI/CD changes
analyzer: Findings analysis logicagent: LLM agent and promptscli: Command-line interfacediff: Diff generationhooks: Git hooksci: GitHub Actions
When adding work to an existing PR:
- Create new issue for the additional work
- Update PR description to list all issues addressed
- Reference issue in commit messages
- Keep PR focused - if scope grows too large, split into separate PRs
## Description
[Brief overview of changes]
## Related Issues
Fixes #42
Fixes #43
Related: #44
## Changes
- Feature/fix 1 description
- Feature/fix 2 description
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests pass
- [ ] Manual testing completed
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No breaking changes (or documented)# 1. User reports issue
User: "The patches have wrong paths and git apply fails"
# 2. Copilot drafts issue
Copilot: [Analyzes problem, drafts S0-AG-02 issue with full details]
# 3. User approves
User: "Looks good, create it"
Copilot: [Creates issue in GitHub, gets #42]
# 4. Copilot implements fix with issue reference
git add src/patchpro_bot/analyzer.py
git commit -m "fix(analyzer): normalize file paths in findings [S0-AG-02]
Add _normalize_path() helper to RuffNormalizer and SemgrepNormalizer
classes. Converts absolute file paths to relative paths from git root
when creating Location objects.
This ensures that downstream components (LLM, patch generator) receive
clean relative paths instead of absolute paths, preventing malformed
patches that fail git apply.
- Add _normalize_path() method using git rev-parse
- Update Location creation in both normalizers
- Handle edge cases (already relative, no git repo)
Technical notes:
- Path normalization happens at finding creation time
- Prevents LLM from seeing confusing absolute paths
- Ensures patches have correct relative paths for git apply
Fixes #42"
# 5. Update PR description
Copilot: [Adds issue to PR #11's "Related Issues" section]
# 6. Mark tasks complete as work progresses
Copilot: [Updates issue checklist, adds comments with progress]- Check if issue exists for this work
- If not, STOP and create issue first
- Read issue completely and understand scope
- Check for related/blocking issues
- Ask questions if anything unclear
- Commit frequently with clear messages
- Reference issue number in every commit
- Update issue checklist as tasks complete
- Document decisions in issue comments
- Keep scope focused on issue objectives
- All commits reference issue number
- PR description lists all related issues
- Issue checklist reflects actual progress
- Tests pass locally
- Code reviewed (self-review first)
- Issue automatically closes (via "Fixes #X")
- Verify issue shows as closed
- Check if any blocked issues can now proceed
[Draft] → [Open] → [In Progress] → [In Review] → [Done] → [Closed]
↓ ↓ ↓ ↓ ↓ ↓
Draft Create First PR PR Issue
issue in GH commit opened merged closed
sprint-0,sprint-1, etc. - Sprint trackingpriority:high,priority:medium,priority:low- Prioritizationcomponent:agent,component:analysis, etc. - Component trackingtype:bug,type:feature,type:refactor- Work typeblocked- Waiting on dependenciesgood-first-issue- Good for new contributors
- Use milestones for sprint planning
- Group related issues under sprint milestones
- Track progress toward sprint goals
- Always ask about existing issues before suggesting code changes
- Draft issues proactively when user describes a problem
- Reference context from related issues in commit messages
- Keep issue updated with progress and blockers
- Link related work to maintain traceability
- Use issue templates consistently
- Keep issues focused - one problem per issue
- Update regularly - reflect current state
- Close promptly - don't leave zombie issues
- Reference liberally - over-linking is better than under-linking
This project uses Fish shell as the default shell. All terminal commands must be Fish-compatible.
Key Differences from Bash:
- ❌ No heredocs: Fish doesn't support
<<EOFsyntax - ❌ Different logic: Use
and/orinstead of&&/|| - ❌ Different variables: Use
setinstead ofexport
CRITICAL: Always Use Scripts for Complex/Multi-line Commands
❌ NEVER do this in terminal directly:
# WRONG - Complex command inline
gh issue create --title "..." --body "..." --label "..."✅ ALWAYS create a script file:
# CORRECT - Create script first
create_file /tmp/script.sh "#!/bin/bash\ncommand..."
chmod +x /tmp/script.sh
/tmp/script.shWhen to use scripts:
- Any command > 80 characters
- Commands with multi-line arguments
- Commands with special characters (quotes, parentheses, etc.)
- GitHub CLI commands (gh issue, gh pr, etc.)
- Any command that would use heredocs in bash
Use printf for Simple Inline Scripts:
# ✅ For simple one-liners only
printf 'import json\nprint("test")\n' | python3Chain Commands:
# ✅ CORRECT - Fish shell
command1; and command2
# ❌ WRONG - Bash syntax
command1 && command2When generating terminal commands:
- Always use Fish shell syntax
- Use temp files (
/tmp/*.py,/tmp/*.sh) for multi-line scripts - Test commands are Fish-compatible before suggesting
- Avoid heredocs - use
cat > fileinstead - Use
;or; andfor command chaining, not&&
If unclear about:
- Whether to create an issue → Create it (better to over-document)
- How to scope an issue → Ask team lead
- How to reference issues → Follow examples in this doc
- Issue numbering → Follow S{sprint}-{component}-{number} format
- Shell syntax → Use Fish shell, not Bash
Last Updated: 2025-10-05
Maintained By: Team PLG_5
Questions: Ask in #patchpro-dev channel