Contribution pipeline

From magnus919/hermes-profiles · View interactive version

Contribution pipeline is an AI agent skill from the GitHub repository magnus919/hermes-profiles. Full issue-to-PR lifecycle with 5-phase gated pipeline. Produces contributions maintainers look forward to — project-aware, thoroughly tested, security-gated, well-documented. Skill bundle with sub-skills for security, test quality, documentation, clean-room verification, and vault integration.

How to use this skill

Skill file

Contribution Pipeline

Full lifecycle from assigned issue to merged PR. Five phases with concrete, falsifiable gates — no LLM-judged rubber stamps. Every phase produces an artifact that the next phase consumes. Every gate has a criterion that can fail.

This is a skill bundle. The orchestrator routes to sub-skills for specialized domains:

| Sub-Skill | Domain | When Loaded |

|---|---|---|

| contribution-security | Static analysis, secrets scanning, disclosure policies | P3.5 Security Gate |

| contribution-test-quality | Test design, change-detector prevention, scorecard | P2 Test Quality Gate |

| contribution-documentation | Code comments, commits, CHANGELOG, README, Mermaid | P2 Documentation + P4 PR Body |

| contribution-clean-room | Docker/VM verification, CI fingerprinting, environment classification | P3 Clean-Room Verification |

| contribution-vault-integration | Project fingerprint caching, knowledge graph persistence | P0 Caching + Cross-session |


Trigger Patterns

The skill accepts input through four patterns:

| Pattern | Input | Example |

|---|---|---|

| Issue-driven (primary) | Issue URL or owner/repo#number | https://github.com/org/repo/issues/42 |

| Discovery-driven | Repo URL + issue description | "Found a bug in org/repo: X crashes when Y is null" |

| Kanban-driven | Kanban card with issue_url + repo metadata | Card body parsed from structured fields |

| Cohort-driven | Multiple issue URLs sharing root cause | Consolidation detected → omnibus PR pattern |

Pre-flight checks before any phase begins:


Quick Reference

| Phase | What It Produces | Gate (Falsifiable) | Time Budget |

|---|---|---|---|

| P0: Muster & Orientation | Project fingerprint (cached) | Can you describe what maintainers ACTUALLY enforce? | 5 min |

| P1: Comprehension | Reproduction trace + root-cause + baseline | Does repro script produce FAIL on target branch? | 15 min |

| P2: Design & Implementation | Working branch (tests fail before fix, pass after) | git stash && cleanroom test run green + test quality scorecard ≥6/8 | 30 min |

| P3: Clean-Room Verification | Verification report + CI divergence surface | All checks pass in isolation | 10 min |

| P3.5: Security Gate | Static analysis + secrets scan report | Zero critical/high findings. Zero secrets. | Auto |

| P4: PR Creation | Filled template + Conventional Commit + Mermaid | PR open, CI green, SLA disclosed | 5 min |

| Post-PR | CI monitoring + staleness handling | PR merged (skill-level Done) | Passive |

Skill-level Done: PR is MERGED — not just created. Post-PR is a passive responsibility tracked across sessions.


Phase Definitions

See references/phase-definitions.md for the complete specification of each phase: required artifacts, gate criteria, rollback rules, and fallback paths.

See references/gate-criteria.md for the concrete, falsifiable criteria at every phase transition.

See references/trigger-patterns.md for the four input patterns with parsing, validation, and branching logic.

See references/project-fingerprint-template.md for the 8-field conventions card produced by P0.

See references/remote-docker-verification.md for the sync-build-recreate-test sequence when the build target is a remote Docker host (P3 clean-room verification).

See references/patch-recovery.md for recovery procedures when the patch tool corrupts a file (P2 implementation).


Cross-Cutting Rules

  1. Every gate is falsifiable. "Do you understand?" is not a gate. "Does the reproduction script produce a FAIL on the target branch?" is a gate.
  1. Project fingerprint caching. P0 output cached per-project with HEAD hash. Subsequent PRs to the same project skip P0. Staleness check: compare cached HEAD hash against current. TTL: 1 hour.
  1. WIP limit: one PR per project. Maintainer attention is the bottleneck, not code generation throughput. Exception: changes under 10 lines bypass the limit.
  1. Clean-room failure → comprehension, not implementation. If P3 fails, the agent didn't understand the problem. Roll back to P1, not P2.
  1. "No defect the agent could reasonably catch." Not "zero defects." Design preferences and edge case interpretations legitimately require human review.
  1. Honest SLA disclosure. At PR creation: "I don't run continuously — responses within 24-48h." No aspirational promises that can't be kept.
  1. PR verbosity scales to change size. ~50 + (lines_changed × 0.5) words max, capped at 500. A one-liner gets a 3-line PR body.
  1. Documentation written alongside code. Commit messages, code comments, and inline docs happen during P2 implementation — not in a separate post-hoc phase.
  1. Safe-to-fail exits at every phase. If the agent hits a blocker, report what's known and escalate. Don't generate increasingly wrong work.
  1. Templates lie. Merged PRs tell truth. P0 must study 3-5 recently merged PRs from different contributors — not just read CONTRIBUTING.md.
  1. Triage test infrastructure before P3. Before attempting clean-room verification, check what's available: docker compose ps for running fixtures, which pytest for test runner, pip list 2>/dev/null | grep pytest for package availability. If the full integration suite can't run, run the subset that can and document the gap in the PR body. A documented partial verification is better than a skipped gate or a fabricated pass.

Sub-Skill Loading

At the appropriate phase, load the sub-skill for specialized domain guidance.

If the sub-skill is not installed, use the fallback — do not skip the gate.

| Phase | Sub-Skill | What It Provides | Fallback When Missing |

|---|---|---|---|

| P2 test quality | contribution-test-quality | Test design, change-detector prevention, 8-point scorecard | Manual scorecard: check each of the 8 criteria from gate-criteria.md via AST scan and heuristics |

| P2 documentation | contribution-documentation | Code comments, commits, CHANGELOG, README conventions | Follow project's merged PRs for documentation patterns. Conventional Commits with DCO sign-off. |

| P3 clean-room | contribution-clean-room | Docker/VM verification, CI fingerprinting, environment classification | See references/remote-docker-verification.md. Sync code, build, recreate, run test suite. Report what was verified and what wasn't. |

| P3.5 security | contribution-security | semgrep config, secrets scan, dependency check | Run git diff main -- <changed-files> and grep for: secrets patterns (password, secret, key, token, AKIA, -----BEGIN), debug artifacts (print, pdb, breakpoint), local paths (/Users, /home/, hostnames). If no new deps, skip dep check. |

| P0/P4 persistence | contribution-vault-integration | Project fingerprint caching, knowledge graph persistence | Skip — fingerprint freshness is checked by P0 staleness check. No vault write required. |


Pitfalls


Cross-Reference

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.