Skip to content

chore: add Serena memories for GitHub workflow protocols#336

Merged
rjmurillo merged 9 commits into
mainfrom
chore/add-workflow-memories
Dec 24, 2025
Merged

chore: add Serena memories for GitHub workflow protocols#336
rjmurillo merged 9 commits into
mainfrom
chore/add-workflow-memories

Conversation

@rjmurillo-bot

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

Add Serena memory files to ensure consistent GitHub workflow behavior across AI agent sessions.

Specification References

Type Reference Description
Issue N/A Maintenance change - no issue required
Spec N/A Infrastructure/chore change

Changes

  • Add memory for GitHub issue assignment protocol (.serena/memories/github-issue-assignment.md)
  • Add memory for PR template requirement (.serena/memories/pr-template-requirement.md)

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update
  • Infrastructure/CI change
  • Refactoring (no functional changes)

Testing

  • Tests added/updated
  • Manual testing completed
  • No testing required (documentation only)

Agent Review

Security Review

  • No security-critical changes in this PR

Other Agent Reviews

  • Architect reviewed design changes
  • Critic validated implementation plan
  • QA verified test coverage

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex logic
  • Documentation updated (if applicable)
  • No new warnings introduced

Related Issues

Related to CLAUDE.md workflow requirements added in PR #334.

- Add memory for GitHub issue assignment protocol
- Add memory for PR template requirement

These memories ensure consistent GitHub workflow behavior across sessions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 24, 2025 07:25
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@github-actions github-actions Bot added the automation Automated workflows and processes label Dec 24, 2025
@coderabbitai coderabbitai Bot requested a review from rjmurillo December 24, 2025 07:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds two Serena memory files to establish persistent GitHub workflow protocols for AI agents. These memories ensure consistent behavior across sessions regarding issue assignment and PR template usage, supporting the workflow requirements introduced in PR #334.

Key Changes:

  • Added memory for GitHub issue assignment protocol requiring self-assignment before starting work
  • Added memory for PR template compliance with all required sections

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.serena/memories/github-issue-assignment.md Establishes protocol for assigning GitHub issues to self before starting work using gh issue edit command
.serena/memories/pr-template-requirement.md Documents requirement to use PR template at .github/PULL_REQUEST_TEMPLATE.md with all required sections

Comment thread .serena/memories/github-issue-assignment.md
Comment thread .serena/memories/pr-template-requirement.md
@coderabbitai

coderabbitai Bot commented Dec 24, 2025

Copy link
Copy Markdown

Caution

Review failed

Failed to post review comments

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Large documentation reshuffle under .serena/memories: many new skill/memory docs added, several old memory files removed, multiple index files updated to map new skills, and CI workflow memory-validation.yml changed to use dynamic git-diff-based path detection instead of static path filters. (50 words)

Changes

Cohort / File(s) Summary
CI workflow
.github/workflows/memory-validation.yml
Replaced static path filters with event-aware git-diff logic (pull_request three-dots, push edge-cases, workflow_dispatch), explicit git-diff error handling, file list cleaning, and dynamic skip/execute gating for .serena/memories changes.
New memory/skill docs (many)
.serena/memories/skill-*.md, .serena/memories/skill-documentation-*.md, .serena/memories/skill-security-*.md, .serena/memories/skill-labeler-*.md, .serena/memories/skill-pr-*.md, .serena/memories/skill-governance-*, .serena/memories/implementation-fast-iteration.md, .serena/memories/iteration-*, ...
Added dozens of new skill/memory documents covering governance, labeler matcher patterns, security skills, documentation migration/search, PR/triage rules, implementation/testing patterns, and agent-workflow handoff formats.
Removed memory docs
.serena/memories/documentation-*.md, .serena/memories/phase3-*.md, .serena/memories/phase4-*.md, .serena/memories/security-*.md, .serena/memories/iteration-5-checkpoint-skills.md, ...
Deleted multiple legacy or consolidated memory documents (documentation-fallback-pattern, migration-search, phase3/phase4 skill sets, several security docs and others).
Refactored / edited memory docs
.serena/memories/skill-edit-001-*.md, .serena/memories/skill-implementation-002-*.md, .serena/memories/skill-documentation-007-*.md, ...
Streamlined or restructured existing skill files (metadata removal, header simplification, content trimming, renames and replacements).
Memory index updates
.serena/memories/memory-index.md, skills-*.md, skills-*-index.md (many index files)
Updated multiple index files to map new skill identifiers, added/newed entries for CI, security, labeler, governance, implementation, documentation, and PR-review skills; removed obsolete mappings.
Process / protocol docs
.serena/memories/github-issue-assignment.md, .serena/memories/pr-template-requirement.md
New protocol documents: GitHub issue assignment rule (assign self at start) and enforced PR-template requirement with required sections and guidance.
Retrospectives / session artifacts
.agents/retrospective/..., .agents/sessions/...
Added detailed retrospective and session artifacts for PR #342/#343 CI workflow fixes including diagnostics, actions, and memory updates.

Sequence Diagram(s)

mermaid
sequenceDiagram
autonumber
participant GitHub as GitHub Actions
participant Repo as Git repo (origin/main)
participant Runner as Workflow script
participant Git as git CLI
Note over GitHub,Runner: Trigger (push / pull_request / workflow_dispatch)
GitHub->>Runner: start memory-validation job
Runner->>Git: fetch origin/main
alt pull_request
Git->>Git: compute diff origin/base...HEAD (three-dots)
else push (first-commit)
Git->>Git: diff origin/main...HEAD
else push (force-push/base-missing)
Git->>Git: diff origin/main...HEAD
else push normal
Git->>Git: diff before..after (two-dots)
end
Git->>Runner: return changed files or error
alt git diff error
Runner->>GitHub: exit non-zero with message (fail workflow)
else success
Runner->>Runner: filter changes to .serena/memories/
alt any memory files changed
Runner->>GitHub: set output skip=false (proceed)
else none changed
Runner->>GitHub: set output skip=true (skip downstream)
end
end

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

Possibly related PRs

Possibly related issues addressed by this PR

  • None beyond the listed issue(s).

Suggested labels

agent-memory, area-infrastructure

Suggested reviewers

  • rjmurillo

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed Title follows conventional commit format with 'chore:' prefix and clearly describes the main change: adding Serena memory files for workflow protocols.
Description check ✅ Passed Description is directly related to the changeset, detailing specific memory files added and categorizing the change as infrastructure/CI, matching the actual additions in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/add-workflow-memories

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
.serena/memories/github-issue-assignment.md (1)

1-23: Use prefix taxonomy for memory file naming.

File should be named pattern-github-issue-assignment.md to follow the required prefix taxonomy for memory files (pattern-, context-, skill-, adr-). This helps agents discover and reference the memory correctly.

Rename the file from .serena/memories/github-issue-assignment.md to .serena/memories/pattern-github-issue-assignment.md.

.serena/memories/pr-template-requirement.md (1)

1-38: Use prefix taxonomy for memory file naming.

File should be named pattern-pr-template-compliance.md or similar to follow the required prefix taxonomy for memory files (pattern-, context-, skill-, adr-). This helps agents discover and reference the memory correctly.

Rename the file from .serena/memories/pr-template-requirement.md to .serena/memories/pattern-pr-template-compliance.md.

📜 Review details

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6ccf3a and 032bb32.

📒 Files selected for processing (2)
  • .serena/memories/github-issue-assignment.md
  • .serena/memories/pr-template-requirement.md
🧰 Additional context used
📓 Path-based instructions (6)
.serena/memories/**/*.md

📄 CodeRabbit inference engine (.agents/retrospective/pr43-coderabbit-root-cause-analysis.md)

Update memory/knowledge base snapshots when refined estimates or critical data diverges from previously stored values by more than 10%

.serena/memories/**/*.md: Skill memory files MUST include atomicity scores (>85% threshold required for persistence), evidence citations with specific session numbers, and SMART validation criteria (Specific, Measurable, Actionable, Relevant, Time-bound)
Skill deduplication analysis MUST be performed with similarity scoring (0-100%) before persistence, comparing new skills against existing memories and documenting the decision (ADD, UPDATE, or MERGE)
All skill memory entries MUST include source reference, validation count (number of times applied), and cross-references to related skills in other memory files

.serena/memories/**/*.md: Atomic memory files must contain focused, high-relevance content to minimize token waste during read operations; avoid consolidating multiple skills into single library files
Memory files and index statements must be designed for human readability and agent pattern recognition; avoid relying on unverified internal mechanisms like word frequency matching

Capture user insights about token efficiency and activation vocabulary in the .serena/memories/ directory for future reference

Store Skill-QA-007 (Verify-WorktreeIsolation.ps1) implementation and worktree isolation verification requirements in institutional memory at .serena/memories/skill-qa-007-worktree-isolation.md

Files:

  • .serena/memories/pr-template-requirement.md
  • .serena/memories/github-issue-assignment.md
**/.serena/memories/**/*.md

📄 CodeRabbit inference engine (.agents/sessions/2025-12-20-session-22.md)

Memory file names and index statements MUST contain dense, high-signal keywords because agents select memories based on word frequency matching

**/.serena/memories/**/*.md: Use semantic slugs for memory file naming instead of numeric IDs (e.g., skill-git-squash-merge-clean-history.md instead of Skill-Git-004.md)
Adopt prefix taxonomy for memory files: adr-[number]-[slug].md for architectural decisions, context-[domain]-[topic].md for domain knowledge, pattern-[problem]-[solution].md for recurring solutions, skill-[technology]-[technique].md for how-to guides

For agent-facing patterns (detection, routing, decision logic), document in Serena memory FIRST using Skill-X-Y format in .serena/memories/ directory. Only write executable code if the pattern cannot be executed by agent reasoning alone. DO NOT create external shell scripts for pattern matching or detection logic.

Files:

  • .serena/memories/pr-template-requirement.md
  • .serena/memories/github-issue-assignment.md
.serena/memories/**

📄 CodeRabbit inference engine (.agents/sessions/2025-12-20-session-48-semantic-slug-orchestration.md)

Commit all changes including .serena/memories files as part of session completion

Commit all changes including .serena/memories directory with session context

Commit all changes to .serena/memories directory alongside code changes when updating session context and handoff information

Commit all changes including .serena/memories directory before session close

Do not store ephemeral cache data (current open PRs, issues) in .serena/memories/ git-tracked files to preserve merge velocity

After creating skill files and updating domain indexes, run the validation script 'pwsh scripts/Validate-MemoryIndex.ps1' to verify formatting, table structure, and file references are correct

Files:

  • .serena/memories/pr-template-requirement.md
  • .serena/memories/github-issue-assignment.md
**/.serena/memories/*.md

📄 CodeRabbit inference engine (.agents/sessions/2025-12-20-session-38-pr-94-review.md)

Document discovered skills from retrospectives or code reviews with atomicity scores and evidence references in the skillbook

Files:

  • .serena/memories/pr-template-requirement.md
  • .serena/memories/github-issue-assignment.md
{**/*.md,.serena/**}

📄 CodeRabbit inference engine (.agents/qa/002-pr-201-skills-clarity-fixes.md)

Provide concrete examples when documenting MCP tool naming conventions - include breakdown of server name and tool-id components

Files:

  • .serena/memories/pr-template-requirement.md
  • .serena/memories/github-issue-assignment.md
.serena/memories/*-*.md

📄 CodeRabbit inference engine (.agents/critique/001-skillbook-documentation-critique.md)

.serena/memories/*-*.md: When creating a new skill file, use the naming convention: memory_file_name must follow domain-topic pattern (e.g., 'pr-skill-name', 'compliance-skill-name'), NOT the Skill ID format which is reserved for content inside the file
Skill ID format must be 'Skill-{Category}-{NNN}' where Category is 2-8 character abbreviation and NNN is a zero-padded 3-digit sequential number; determine NNN by searching existing skills in that category and incrementing the highest found number
Before committing a new Skill ID, verify uniqueness by searching all memory files to confirm the Skill ID does not already exist
Format A is for skills that are CRITICAL/BLOCKING or referenced by other skills (have BLOCKS/ENABLES relationships); use Format B for standalone, non-critical skills
A skill qualifies as CRITICAL/BLOCKING P0 if it meets ANY of these objective criteria: Impact score >= 9/10, blocks session protocol execution, prevents compliance violation, or requires high-level-advisor escalation
A skill is 'referenced by other skills' when it appears in Related Skills sections with BLOCKS/ENABLES relationships or is cited as a prerequisite for other skills
Skill category abbreviations must be 2-8 characters to balance readability in Skill IDs and avoid ambiguity with other category names
Skill format selection must follow the decision tree: (1) Is CRITICAL/BLOCKING P0? If yes → Format A; (2) Is referenced by other skills? If yes → Format A; (3) Otherwise → Format B
Atomicity scoring for skills must follow penalty structure: -2 for each unrelated responsibility, -1 for each optional substep, +1 for each integration point; minimum viable score is 3/10
Skill activation vocabulary (keywords that trigger the skill) must avoid words that appear in other skill names or activation vocabularies within the same category to prevent false matches

Files:

  • .serena/memories/pr-template-requirement.md
  • .serena/memories/github-issue-assignment.md
🪛 LanguageTool
.serena/memories/pr-template-requirement.md

[uncategorized] ~5-~5: The official name of this software platform is spelled with a capital “H”.
Context: ...uest, always use the PR template at .github/PULL_REQUEST_TEMPLATE.md. ## Template...

(GITHUB)

🔍 Remote MCP DeepWiki

Additional Relevant Context

  • Established Memory Module
    DeepWiki’s repository structure includes a “Serena Memory System” under “Session Protocol & Memory,” confirming that agent memories are stored in a dedicated .serena/memories/ directory within the repo.

  • Memory Operations
    The Serena Memory System provides file-based memory management tools:
    write_memory to create or overwrite a memory file
    read_memory to retrieve contents from a memory file
    list_memories to enumerate all memory files
    delete_memory to remove a memory file
    edit_memory to update content via literal or regex replacement

  • Mandatory Initialization
    Before any memory operations, agents must call mcp__serena__activate_project (with the project path) and mcp__serena__initial_instructions to initialize access to the memory system and related tooling.

  • Memory Reference Guidelines
    When instructing agents:
    MUST use mcp__serena__read_memory with the memory_file_name parameter (not file paths)
    MUST include a fallback to directly read the .serena/memories/<name>.md file if the MCP server is unavailable
    MUST NOT reference memories by full file path in instructions
    SHOULD use consistent syntax, e.g.:

    Read the `session-notes` memory using `mcp__serena__read_memory` with memory_file_name="session-notes"
    - If unavailable, read `.serena/memories/session-notes.md`

coderabbitai[bot]
coderabbitai Bot previously approved these changes Dec 24, 2025
@rjmurillo rjmurillo enabled auto-merge (squash) December 24, 2025 08:01
rjmurillo pushed a commit that referenced this pull request Dec 24, 2025
Comprehensive investigation of 20 open PRs to identify those stuck
for similar reasons as PR #334.

Key Findings:
- PR #334 is NOT stuck (all checks pass, approved, mergeable)
- 16 of 20 PRs are actually stuck
- 10 PRs blocked by Aggregate Results failures (62.5%)
- Only 1 PR (#342) shares PR #334's blocker type (missing workflow)
- 6 PRs have merge conflicts
- 3 PRs ready to merge immediately (#334, #336, #245)

Analysis identifies systemic pattern in Aggregate Results failures
affecting majority of stuck PRs, distinct from originally described
missing workflow issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 24, 2025 08:52
rjmurillo
rjmurillo previously approved these changes Dec 24, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

rjmurillo-bot added a commit that referenced this pull request Dec 24, 2025
Comprehensive investigation of 20 open PRs to identify those stuck
for similar reasons as PR #334.

Key Findings:
- PR #334 is NOT stuck (all checks pass, approved, mergeable)
- 16 of 20 PRs are actually stuck
- 10 PRs blocked by Aggregate Results failures (62.5%)
- Only 1 PR (#342) shares PR #334's blocker type (missing workflow)
- 6 PRs have merge conflicts
- 3 PRs ready to merge immediately (#334, #336, #245)

Analysis identifies systemic pattern in Aggregate Results failures
affecting majority of stuck PRs, distinct from originally described
missing workflow issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
rjmurillo-bot and others added 3 commits December 24, 2025 01:50
* fix(ci): remove path filters from memory validation workflow

The 'Validate Memory Files' job is a required status check. With path
filters at the workflow trigger level, the workflow doesn't run for
PRs that don't touch memory files, causing those PRs to be blocked.

Changes:
- Remove path filters from on.push and on.pull_request triggers
- Add comment explaining why path filters are not used
- Fix git diff to use event-specific commit ranges
- Properly split git diff output into array before filtering

The change detection logic inside the job still skips validation for
PRs that don't modify .serena/memories/** files.

Fixes PRs being blocked by phantom 'Validate Memory Files' check.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ci): add robust git diff handling for edge cases

Address Copilot review comments:
1. Handle zero SHA when first commit on new branch
2. Detect force-push/rebase when before commit doesn't exist
3. Use two dots (..) for push events instead of three (...)
4. Add exit code check after git diff command

Fallback to origin/main comparison when:
- github.event.before is all zeros (first commit)
- before commit no longer exists (force-push/rebase)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix(memory): split bundled skill files per ADR-017

Split 18 bundled memory files into 49 atomic skill files to comply
with ADR-017 requirement of one skill per file.

Files processed:
- documentation-fallback-pattern.md (2 skills)
- documentation-migration-search.md (2 skills)
- documentation-self-contained.md (2 skills)
- implementation-test-discovery.md (2 skills)
- iteration-5-checkpoint-skills.md (3 skills)
- labeler-matcher-types.md (3 skills)
- labeler-negation-patterns.md (2 skills)
- phase3-consistency-skills.md (5 skills)
- phase4-handoff-validation-skills.md (4 skills)
- planning-self-contained.md (2 skills)
- pr-review-bot-triage.md (4 skills)
- pr-review-false-positives.md (2 skills)
- security-defensive-coding.md (3 skills)
- security-review-enforcement.md (2 skills)
- security-toctou-defense.md (2 skills)
- skills-agent-workflow-phase3.md (2 skills)
- skills-edit.md (2 skills)
- skills-governance.md (2 skills)

Validation: pwsh scripts/Validate-SkillFormat.ps1 - PASSED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(memory): update indexes to reference atomic skill files

Update memory index files to point to the new atomic skill files
created in the previous commit. Fixes broken references that caused
Validate Memory Index to fail.

Updated indexes:
- memory-index.md
- skills-documentation-index.md
- skills-implementation-index.md
- skills-labeler-index.md
- skills-planning-index.md
- skills-pr-review-index.md
- skills-security-index.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(memory): restore bundled files for incomplete atomic split

The previous commits attempted to split bundled skill files into atomic
files per ADR-017 but the split was incomplete - only some atomic files
were created while the index files were updated to reference all planned
atomic files.

This commit:
- Restores bundled files from main (19 files)
- Reverts index files to reference bundled files
- Keeps successfully created atomic skill files

Validate Memory Index now passes with 30/30 domains.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(memory): complete atomic skill split per ADR-017

Split 9 bundled skill files into 21 atomic skill files.

Bundled files removed:
- documentation-migration-search.md (skills 001, 002)
- documentation-fallback-pattern.md (skills 003, 004)
- documentation-self-contained.md (skills 006, 007)
- implementation-test-discovery.md (skills 001, 002)
- labeler-negation-patterns.md (skills 001, 006)
- labeler-matcher-types.md (skills 003, 004, 005)
- planning-self-contained.md (skills 003, 004)
- pr-review-bot-triage.md (skills 001, 002, 003, 006)
- pr-review-false-positives.md (skills 001, 002)

Atomic skill files created:
- skill-documentation-{001..004,006,007}-*.md
- skill-implementation-{001,002}-*.md
- skill-labeler-{001,003..006}-*.md
- skill-planning-{003,004}-*.md
- skill-pr-{001..003,006}-*.md
- skill-review-{001,002}-*.md

Index files updated with unique keywords per entry.
Validates with both Validate-MemoryIndex.ps1 and Validate-SkillFormat.ps1.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: rjmurillo[bot] <rjmurillo-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…atus check (#346)

* fix(ci): remove path filters from memory validation workflow

The 'Validate Memory Files' job is a required status check. With path
filters at the workflow trigger level, the workflow doesn't run for
PRs that don't touch memory files, causing those PRs to be blocked.

Changes:
- Remove path filters from on.push and on.pull_request triggers
- Add comment explaining why path filters are not used
- Fix git diff to use event-specific commit ranges
- Properly split git diff output into array before filtering

The change detection logic inside the job still skips validation for
PRs that don't modify .serena/memories/** files.

Fixes PRs being blocked by phantom 'Validate Memory Files' check.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ci): add robust git diff handling for edge cases

Address Copilot review comments:
1. Handle zero SHA when first commit on new branch
2. Detect force-push/rebase when before commit doesn't exist
3. Use two dots (..) for push events instead of three (...)
4. Add exit code check after git diff command

Fallback to origin/main comparison when:
- github.event.before is all zeros (first commit)
- before commit no longer exists (force-push/rebase)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(retrospective): extract 7 atomic skills from PR #342 & #343

Retrospective of CI workflow debugging session that fixed phantom
required check blocking. Analyzed PR #342 (initial fix) and PR #343
(comprehensive edge case handling).

**Skills Extracted** (atomicity 88-95%):
- Skill-CI-Workflow-001: Required check + path filter anti-pattern (95%)
- Skill-CI-Workflow-002a: Zero SHA handling in git diff (95%)
- Skill-CI-Workflow-002b: Missing commit handling with cat-file (93%)
- Skill-CI-Workflow-002c: Git diff exit code validation (92%)
- Skill-CI-Workflow-003: Required check deployment testing (90%)
- Skill-Architecture-016: ADR compliance documentation (88%)
- Skill-Implementation-007: Fast iteration cycle pattern (92%)

**Key Learnings**:
- Path filters on required check workflows cause phantom blocking
- Internal skip logic preserves efficiency while ensuring status reports
- Git diff in workflows needs comprehensive edge case handling
- Fast iteration (<10min cycles) enabled 5 rounds in 20 minutes

**Memory Files Created**:
- ci-workflow-required-checks.md (5 skills)
- architecture-adr-compliance-documentation.md (1 skill)
- implementation-fast-iteration.md (1 skill)

**Related**: PR #342 (merged), PR #343 (pending merge)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): update session log with commit SHA

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions Bot added github-actions GitHub Actions workflow updates area-skills Skills documentation and patterns labels Dec 24, 2025
@coderabbitai coderabbitai Bot requested a review from rjmurillo December 24, 2025 09:52
@github-actions

Copy link
Copy Markdown
Contributor

Session Protocol Compliance Report

Tip

Overall Verdict: PASS

All session protocol requirements satisfied.

What is Session Protocol?

Session logs document agent work sessions and must comply with RFC 2119 requirements:

  • MUST: Required for compliance (blocking failures)
  • SHOULD: Recommended practices (warnings)
  • MAY: Optional enhancements

See .agents/SESSION-PROTOCOL.md for full specification.

Compliance Summary

Session File Verdict MUST Failures
2025-12-24-session-85-pr-342-343-retrospective.md ✅ COMPLIANT 0
0

Detailed Results

2025-12-24-session-85-pr-342-343-retrospective

Based on my analysis of the session log:

MUST: Serena Initialization: PASS
MUST: HANDOFF.md Read: PASS
MUST: Session Log Created Early: PASS
MUST: Protocol Compliance Section: PASS
MUST: HANDOFF.md Updated: PASS
MUST: Markdown Lint: PASS
MUST: Changes Committed: PASS
SHOULD: Memory Search: PASS
SHOULD: Git State Documented: SKIP
SHOULD: Clear Work Log: PASS

VERDICT: COMPLIANT
FAILED_MUST_COUNT: 0

Run Details
Property Value
Run ID 20483506994
Files Checked 1

Powered by AI Session Protocol Validator - View Workflow

@github-actions

Copy link
Copy Markdown
Contributor

AI Quality Gate Review

Caution

Final Verdict: CRITICAL_FAIL

Walkthrough

This PR was reviewed by six AI agents in parallel, analyzing different aspects of the changes:

  • Security Agent: Scans for vulnerabilities, secrets exposure, and security anti-patterns
  • QA Agent: Evaluates test coverage, error handling, and code quality
  • Analyst Agent: Assesses code quality, impact analysis, and maintainability
  • Architect Agent: Reviews design patterns, system boundaries, and architectural concerns
  • DevOps Agent: Evaluates CI/CD, build pipelines, and infrastructure changes
  • Roadmap Agent: Assesses strategic alignment, feature scope, and user value

Review Summary

Agent Verdict Status
Security PASS
QA CRITICAL_FAIL
Analyst PASS
Architect PASS
DevOps PASS
Roadmap PASS
Analyst Review Details

Let me check the local repository for changes and memory files.

Now I have enough context to provide a thorough analysis.


Analyst PR Review: Serena Memories for GitHub Workflow Protocols

Code Quality Score

Criterion Score (1-5) Notes
Readability 5 Clean markdown, well-structured sections
Maintainability 5 Self-contained memory files, easy to update
Consistency 5 Follows existing .serena/memories/ file patterns
Simplicity 5 Minimal, focused content without over-engineering

Overall: 5/5

Impact Assessment

  • Scope: Isolated (Serena memory subsystem only)
  • Risk Level: Low
  • Affected Components: .serena/memories/ directory (AI agent memory store)

Findings

Priority Category Finding Location
Low Documentation Memory files align with CLAUDE.md workflow requirements .serena/memories/
Low Consistency Both files follow established memory file format used by 200+ existing memories Directory listing

Detailed Analysis

1. File Content Review

github-issue-assignment.md (24 lines):

  • Documents the gh issue edit <number> --add-assignee @me command
  • Clear "When to Apply" section with 3 trigger conditions
  • Rationale explains duplicate work prevention

pr-template-requirement.md (39 lines):

  • References .github/PULL_REQUEST_TEMPLATE.md correctly
  • Lists all 8 required sections from the template
  • Includes "Common Mistakes to Avoid" section

2. Cross-Reference Verification

The PR template at .github/PULL_REQUEST_TEMPLATE.md exists and contains the sections listed in the memory file. The memory accurately reflects the template structure.

3. Alignment with Existing Patterns

The .serena/memories/ directory contains 241 memory files. Both new files follow the same structure:

  • H1 heading with topic name
  • Rule section
  • Command/Template section
  • Application guidelines
  • Rationale

4. PR Description Quality

The PR uses the template correctly with:

  • Summary present
  • Specification References table (N/A justified for maintenance)
  • Type of Change marked as Infrastructure/CI
  • Testing marked as "No testing required"
  • Security review checkbox checked

Recommendations

None. The PR is minimal and correctly implements Serena memory persistence for two workflow conventions already documented in the project.

Verdict

VERDICT: PASS
MESSAGE: Clean infrastructure addition. Two focused memory files following established patterns. No code impact, no testing required.
DevOps Review Details

Based on my review of the PR changes, here is my DevOps assessment:

Pipeline Impact Assessment

Area Impact Notes
Build None No build configuration changes
Test None No test infrastructure changes
Deploy None No deployment configuration changes
Cost None Memory files do not affect CI/CD runtime

CI/CD Quality Checks

Check Status Location
YAML syntax valid .serena/project.yml (unchanged)
Actions pinned N/A No workflow changes
Secrets secure No secrets referenced in memory files
Permissions minimal N/A No workflow changes
Shell scripts robust N/A Shell examples in docs are illustrative only

Findings

Severity Category Finding Location Fix
Low Documentation Memory files are well-structured and follow existing patterns .serena/memories/ None needed

Template Assessment

  • PR Template: Adequate - PR follows the required template structure
  • Issue Templates: N/A - No changes to issue templates
  • Template Issues: None

Automation Opportunities

Opportunity Type Benefit Effort
None identified - - -

Recommendations

  1. The Serena memory files are correctly placed in .serena/memories/ directory and follow the established naming convention.
  2. The .gitignore in .serena/ properly excludes /cache which prevents local cache artifacts from being committed.

File Content Review

The two new memory files contain:

  • github-issue-assignment.md: Documents the protocol for assigning issues before starting work (uses gh issue edit --add-assignee @me)
  • pr-template-requirement.md: Documents the requirement to use .github/PULL_REQUEST_TEMPLATE.md when creating PRs

Both files are plain documentation that codify existing workflow conventions for AI agent sessions. They have no CI/CD impact.

VERDICT: PASS
MESSAGE: Documentation-only change adding Serena memory files. No CI/CD, build, or deployment impact. Files follow established patterns and conventions.
Security Review Details

Security Review: Serena Memories for GitHub Workflow Protocols

Findings

Severity Category Finding Location CWE
- - No security issues found - -

Analysis Summary

Files Reviewed:

  • .serena/memories/github-issue-assignment.md - Documentation only, contains gh issue edit command example
  • .serena/memories/pr-template-requirement.md - Documentation only, contains cat command example

Security Checks Performed:

  1. Secret Detection: [PASS] No hardcoded credentials, API keys, tokens, or passwords
  2. Shell Injection (CWE-78): [PASS] Commands shown are static examples with <number> placeholder, not executable code
  3. Path Traversal (CWE-22): [PASS] No dynamic path handling
  4. Sensitive Data Exposure: [PASS] No sensitive configuration or credentials exposed
  5. Infrastructure Security: [PASS] These are Serena memory files (documentation), not executable workflows

Recommendations

None required. These are documentation files that define workflow protocols for AI agents.

Verdict

VERDICT: PASS
MESSAGE: Documentation-only changes with no executable code, no secrets, and no security-sensitive patterns.
Architect Review Details

Now I have sufficient context to provide the architectural review.


Design Quality Assessment

Aspect Rating (1-5) Notes
Pattern Adherence 5 Follows established Serena memory patterns from ADR-007
Boundary Respect 5 Files in correct location (.serena/memories/)
Coupling 5 Memories are independent, no cross-dependencies
Cohesion 5 Each file has single responsibility
Extensibility 5 Memory files follow existing project conventions

Overall Design Score: 5/5

Architectural Concerns

Severity Concern Location Recommendation
None - - -

No architectural concerns identified. The files follow established patterns documented in ADR-007 (Memory-First Architecture).

Breaking Change Assessment

  • Breaking Changes: No
  • Impact Scope: None
  • Migration Required: No
  • Migration Path: N/A

Technical Debt Analysis

  • Debt Added: Low
  • Debt Reduced: Low
  • Net Impact: Improved (codifies workflow knowledge that prevents repeated mistakes)

ADR Assessment

  • ADR Required: No
  • Decisions Identified: None (uses existing memory-first architecture)
  • Existing ADR: ADR-007-memory-first-architecture.md
  • Recommendation: N/A - change aligns with existing ADR-007

Recommendations

  1. Consider adding similar memories for other frequently violated workflow conventions as they are discovered.

Verdict

VERDICT: PASS
MESSAGE: Memory files follow ADR-007 patterns, use correct directory structure, and codify workflow knowledge per established architecture.
QA Review Details

VERDICT: CRITICAL_FAIL
MESSAGE: Copilot CLI failed (exit code 1) with no output - likely missing Copilot access for the bot account

Roadmap Review Details

Let me examine the PR changes by looking at the Serena memory files being added.

Now I have sufficient context. Let me analyze this PR from a roadmap/strategic perspective.

Strategic Alignment Assessment

Criterion Rating Notes
Aligns with project goals High Memory system is core infrastructure per AGENTS.md Memory System section
Priority appropriate High Supports session protocol, memory-first principle documented in AGENTS.md
User value clear Medium Indirect value through consistent AI agent behavior
Investment justified High Minimal effort (2 memory files) for workflow standardization

Feature Completeness

  • Scope Assessment: Right-sized
  • Ship Ready: Yes
  • MVP Complete: Yes
  • Enhancement Opportunities: None identified

Impact Analysis

Dimension Assessment Notes
User Value Medium Prevents duplicate work on issues, ensures consistent PR quality
Business Impact Medium Reduces friction in AI-assisted workflows
Technical Leverage High Serena memories persist across sessions, enabling consistent behavior
Competitive Position Neutral Internal workflow improvement

Concerns

Priority Concern Recommendation
Low No issue linked Acceptable for chore/infrastructure changes per PR template

Recommendations

  1. The PR aligns with the documented Memory System architecture in AGENTS.md, which specifies .serena/memories/ as the preferred location for cross-platform memory storage.
  2. Both memories document explicit workflow requirements that reduce agent errors and improve consistency.
  3. The memories follow established patterns visible in the existing 240+ memory files in .serena/memories/.

Verdict

VERDICT: PASS
MESSAGE: Infrastructure change adds workflow memories aligned with documented Memory System architecture. Minimal scope, clear value for agent consistency.

Run Details
Property Value
Run ID 20483506982
Triggered by pull_request on 336/merge
Commit 6c0c7f47106faac87466c26921b576c8cb50a88a

Powered by AI Quality Gate - View Workflow

@coderabbitai coderabbitai Bot added agent-memory Context persistence agent area-infrastructure Build, CI/CD, configuration labels Dec 24, 2025
rjmurillo
rjmurillo previously approved these changes Dec 24, 2025
Copilot AI review requested due to automatic review settings December 24, 2025 10:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@rjmurillo-bot

Copy link
Copy Markdown
Collaborator Author

@rjmurillo-bot

Enhancement request for workflow memories:

When you're working on this PR, consider adding memories that capture these two operational patterns from today's session:

1. Failed Run Investigation Pattern

Pattern: gh-run-failure-investigation
Trigger: CI workflow failure notification
Steps:
  1. gh run view <id> --log-failed  # Get failure context
  2. gh run view <id> --json conclusion,event,headBranch,jobs  # Metadata
  3. Perform RCA on root cause
  4. Create issue with remediation plan (like Issue #348)

2. Notification Filtering for Actionable Items

Pattern: gh-notify-actionable-filters
Command: gh notify -s -f reason=<type>
Types:
  - ci_activity: Failed workflows needing investigation
  - mention: Direct @mentions requiring response
  - assign: New assignments to triage
  - review_requested: Pending review requests
  - comment: Comment threads needing reply

These patterns extend beyond PR-centric monitoring to cover the full scope of GitHub notifications that an autonomous agent should handle.

Reference: Issue #348 (created from today's gh run view 20484579665 --log-failed investigation)

Add POSIX-compliant trailing newlines to both memory files.

Addresses PR review comments from @Copilot and @rjmurillo

- Add trailing newline to github-issue-assignment.md
- Add trailing newline to pr-template-requirement.md

Comment-IDs: 2645011918, 2645011926
@rjmurillo rjmurillo merged commit eff63e6 into main Dec 24, 2025
23 checks passed
@rjmurillo rjmurillo deleted the chore/add-workflow-memories branch December 24, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-memory Context persistence agent area-infrastructure Build, CI/CD, configuration area-skills Skills documentation and patterns area-workflows GitHub Actions workflows automation Automated workflows and processes github-actions GitHub Actions workflow updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants