THIS FILE MUST BE READ AT THE START OF EVERY SESSION
STATUS: MANDATORY - NOT OPTIONAL - NOT NEGOTIABLE
BEFORE doing ANYTHING else, you MUST:
- ✅ Read this PROTOCOL.md file completely
- ✅ Copy the Session Checklist below into your working notes
- ✅ Check off each item as you complete it
- ✅ Run
./verify-protocol.shbefore committing (if available)
If you skip this protocol, you WILL:
- ❌ Break traceability between code and Jira
- ❌ Create merge conflicts for other developers
- ❌ Lose work history and context
- ❌ Block other agents from continuing your work
- ❌ Violate project standards
Common failure patterns:
- Agent jumps directly into coding without reading documentation
- Agent assumes familiarity with project from previous sessions
- Agent treats checklists as "suggestions" rather than requirements
- Agent focuses on user request and ignores protocol overhead
THIS IS WRONG. PROTOCOL IS NOT OVERHEAD. PROTOCOL IS THE WORK.
This PROTOCOL.md intentionally comes alphabetically before other docs to be seen first.
The AGENTS.md file's FIRST section points here.
The .claude/prompts/session-start.md file auto-loads this protocol.
Git hooks verify protocol compliance before allowing commits.
Run ./verify-protocol.sh to check protocol compliance before committing.
COPY THIS CHECKLIST INTO YOUR WORKING NOTES FOR EVERY SESSION:
# Session Protocol Checklist - [Date] - [Agent Name]
## 📋 BEFORE STARTING WORK
### Phase 1: Read Documentation
- [ ] Read PROTOCOL.md completely (this file)
- [ ] Read AGENTS.md for project context
- [ ] Read HISTORY.md for current status and "Up Next" tasks
- [ ] Review PROJECT.md if unfamiliar with setup
- [ ] Note recommended next task from HISTORY.md
### Phase 2: Verify Jira Issue
- [ ] Confirm Jira issue exists for planned work
- [ ] If no issue: CREATE one now (never work without issue)
- [ ] Note Jira issue key: ____________
- [ ] Verify issue is in correct status
- [ ] Check issue is assigned properly
- [ ] Review acceptance criteria
### Phase 3: Git Setup
- [ ] Verify on `dev` branch: `git branch`
- [ ] Pull latest: `git pull origin dev`
- [ ] Verify remote configured: `git remote -v`
- [ ] Check clean state: `git status`
## 💻 DURING DEVELOPMENT
### Phase 4: Create Feature Branch
- [ ] Branch from `dev` (not main!)
- [ ] Use correct naming: `<type>/{PROJ-KEY}-<description>`
- [ ] Branch name includes Jira key: ____________
- [ ] Verify: `git branch` shows new branch
### Phase 5: Implementation
- [ ] Follow code standards from AGENTS.md
- [ ] Add type hints/docstrings where appropriate
- [ ] Test changes before committing
- [ ] Keep commits focused and atomic
### Phase 6: Commit with Smart Commits
- [ ] Every commit includes Jira key
- [ ] Use format: `{PROJ-KEY} #comment <message>`
- [ ] Add time tracking: `#time Xh Ym`
- [ ] Update status: `#in-progress`, `#in-review`, `#done`
- [ ] Commit messages are descriptive (not "fix" or "update")
### Phase 7: Update Jira
- [ ] Add comment documenting progress
- [ ] Transition issue status as appropriate
- [ ] Link related issues if dependencies found
- [ ] Update story points/estimates if changed
## ✅ AFTER COMPLETING WORK
### Phase 8: Documentation
- [ ] **CRITICAL**: Update HISTORY.md with:
- [ ] What was completed (with Jira keys)
- [ ] Key decisions made
- [ ] New files created
- [ ] Blockers encountered
- [ ] Next recommended tasks
- [ ] Update README.md if user-facing changes
- [ ] Update PROJECT.md if architecture changed
- [ ] Create/update technical docs if needed
### Phase 9: Testing
- [ ] Run automated tests if they exist
- [ ] Manual testing with sample data
- [ ] Test edge cases
- [ ] Verify no regressions
### Phase 10: Merge to Dev
- [ ] Switch to dev: `git checkout dev`
- [ ] Pull latest: `git pull origin dev`
- [ ] Merge feature: `git merge feature/{PROJ-KEY}-description`
- [ ] Resolve conflicts if any
- [ ] Verify clean merge
### Phase 11: Push Everything (CRITICAL!)
- [ ] Push dev: `git push origin dev`
- [ ] Push feature branch: `git push origin feature/{PROJ-KEY}-description`
- [ ] Verify branches on GitHub web interface
- [ ] Check Jira for automatic commit links
### Phase 12: Jira Verification
- [ ] Verify commits linked in Jira issue
- [ ] Confirm status updated correctly
- [ ] Add manual comment if auto-link failed
## 🎯 SESSION COMPLETION
### Phase 13: Final Verification
- [ ] All changes committed: `git status` clean
- [ ] All branches pushed to GitHub
- [ ] HISTORY.md updated with session summary
- [ ] Jira issues updated and transitioned
- [ ] No uncommitted or unpushed work
### Phase 14: Handoff Documentation
- [ ] Updated "Up Next" section in HISTORY.md
- [ ] Documented any blockers
- [ ] Listed recommended next tasks (with Jira keys)
- [ ] Flagged urgent issues
- [ ] Noted technical debt created
### Phase 15: Self-Verification
- [ ] ✅ Is there a Jira issue for this work?
- [ ] ✅ Are all commits pushed to GitHub?
- [ ] ✅ Does HISTORY.md reflect what I did?
- [ ] ✅ Are Jira issues updated?
- [ ] ✅ Did I test my changes?
- [ ] ✅ Can someone else continue from here?
**If ANY checkbox above is unchecked, you are NOT done with this session.**MEMORIZE THIS SEQUENCE:
# 1. Start from dev
git checkout dev
git pull origin dev
# 2. Create feature branch with Jira key
git checkout -b feature/{PROJ-123}-description
# 3. Do work, commit with smart commits
git add <files>
git commit -m "{PROJ-123} #time 1h #comment Implemented feature X"
# 4. More commits as needed...
git commit -m "{PROJ-123} #time 30m #comment Added tests"
git commit -m "{PROJ-123} #in-review #comment Ready for review"
# 5. Merge to dev
git checkout dev
git pull origin dev
git merge feature/{PROJ-123}-description
# 6. Push EVERYTHING
git push origin dev
git push origin feature/{PROJ-123}-description
# 7. Update HISTORY.md
# ... edit HISTORY.md ...
git commit -am "Update HISTORY.md with session progress"
git push origin devALWAYS include Jira key in EVERY commit:
# Basic format
{PROJ-KEY} #<command> <arguments>
# Status transitions
{PROJ-123} #in-progress #comment Starting implementation
{PROJ-123} #in-review #comment Ready for code review
{PROJ-123} #done #comment Completed and tested
# Time tracking
{PROJ-123} #time 2h 30m Completed user authentication
{PROJ-123} #time 1h 15m Fixed bugs and added tests
# Combined
{PROJ-123} #time 1h #in-review #comment Feature complete, needs review
# Comments only
{PROJ-123} #comment Blocked waiting for API documentationRecovery:
- STOP all work immediately
- Create Jira issue NOW
- Create new feature branch with correct issue key
- Cherry-pick commits to new branch OR redo commits
- Delete incorrect branch
- Update HISTORY.md to document this mistake
Recovery:
- Push immediately:
git push origin --all - Verify in GitHub web interface
- Check Jira for commit links
- Add manual Jira comment if links missing
- Update HISTORY.md noting this was corrected
Recovery:
- Update HISTORY.md immediately
- Commit:
git commit -am "Update HISTORY.md with recent progress" - Push:
git push origin dev - Add Jira comment noting documentation updated
Recovery:
- Rename:
git branch -m old-name feature/{PROJ-123}-new-name - Delete old remote:
git push origin :old-name - Push new:
git push origin feature/{PROJ-123}-new-name - Update any PRs or references
Recovery:
- Create feature branch from current position
- Reset main to match origin:
git reset --hard origin/main - Cherry-pick commits to feature branch
- Follow normal merge to dev workflow
- Document mistake in HISTORY.md
Recovery:
- Amend last commit:
git commit --amend -m "{PROJ-123} Original message" - For older commits: Use interactive rebase
git rebase -i - Force push if not yet shared:
git push --force-with-lease - If already pushed: Add follow-up commit referencing issue
Every line of code must trace back to a business requirement (Jira issue). This enables:
- Audit trails for compliance
- Understanding why code exists
- Impact analysis for changes
- Prioritization of technical debt
Multiple agents/developers work on the same codebase:
- HISTORY.md enables seamless handoffs
- Jira integration keeps everyone informed
- GitHub branches prevent conflicts
- Documentation prevents duplicate work
Following protocol ensures:
- Code is tested before merging
- Changes are reviewed
- Documentation stays current
- Technical debt is tracked
When you end a session, others must continue:
- HISTORY.md shows current state
- Jira shows what's next
- Git shows what changed
- Documentation shows how it works
ALWAYS DO:
- ✅ Read PROTOCOL.md at session start
- ✅ Create Jira issue BEFORE coding
- ✅ Use Jira key in branch names
- ✅ Use smart commits for EVERY commit
- ✅ Push to GitHub after EVERY merge
- ✅ Update HISTORY.md with EVERY session
- ✅ Complete the session checklist
NEVER DO:
- ❌ Start work without reading PROTOCOL.md
- ❌ Work without a Jira issue
- ❌ Commit without Jira key
- ❌ Forget to push to GitHub
- ❌ Skip HISTORY.md updates
- ❌ Leave work in broken/incomplete state
- ❌ Assume you remember from last session
If you CANNOT complete a checklist item:
- Document in Jira: Add comment explaining blocker
- Update HISTORY.md: Note blocker in current status
- Flag for user: Create clear summary of issue
- Do NOT proceed: Stop work on this task
- Check alternatives: Review "Alternative tasks" in HISTORY.md
Never move forward hoping the issue resolves itself.
Before committing, run:
./verify-protocol.shThis checks:
- HISTORY.md updated today
- Current branch has Jira key
- Recent commits have Jira keys
- No uncommitted changes (except HISTORY.md)
- Remote branches are pushed
When starting a new session, you should see:
🚨 PROTOCOL REMINDER 🚨
Before proceeding, ensure you have:
1. ✅ Read PROTOCOL.md completely
2. ✅ Copied session checklist to working notes
3. ✅ Read HISTORY.md for current status
4. ✅ Identified next task with Jira issue
5. ✅ Verified git state (on dev, pulled latest)
If you haven't done these, STOP and do them now.
If you catch yourself thinking:
- "I'll just quickly fix this without creating an issue" → ❌ WRONG
- "I'll update HISTORY.md later" → ❌ WRONG
- "I remember what to do from last time" → ❌ WRONG
- "This is too small to need a checklist" → ❌ WRONG
- "I'll push to GitHub when I'm done with everything" → ❌ WRONG
STOP. Read PROTOCOL.md again. Follow the checklist.
A protocol-compliant session has:
- ✅ All work linked to Jira issues
- ✅ All commits on GitHub with smart commit messages
- ✅ HISTORY.md updated with clear next steps
- ✅ Clean git state (no uncommitted work)
- ✅ Jira issues in correct status
- ✅ Documentation current and accurate
This PROTOCOL.md file:
- Last Updated: 2025-11-08
- Version: 2.0.0
- Status: MANDATORY
- Enforcement: STRICT
- Applies to: ALL agents, ALL sessions, ALL projects using this framework
The ONLY acceptable reason to skip protocol:
NONE. THERE ARE NO EXCEPTIONS.
Even for:
- "Quick fixes" → NO, create issue and follow protocol
- "Urgent bugs" → NO, follow hotfix protocol in WORKFLOWS.md
- "Documentation updates" → NO, still need issue and tracking
- "Tiny changes" → NO, if it's worth changing, it's worth tracking
If you are reading this and thinking "I'll just skip the checklist this one time":
STOP. GO BACK. READ FROM THE TOP.
The protocol exists because agents (including you) forget. The checklist exists because memory is unreliable. The enforcement exists because good intentions aren't enough.
FOLLOW THE PROTOCOL. EVERY TIME. NO EXCEPTIONS.
🚨 NOW COPY THE SESSION CHECKLIST AND BEGIN YOUR WORK 🚨