Install
$ agentstack add skill-jimmc414-claude-code-plugin-marketplace-match-stable-pairs ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
match-stable-pairs
When to Use
- Hospital-resident matching
- Stable marriage problem
- College admissions
- Job candidate matching
- Any two-sided market with preferences
- When you need a "stable" matching (no pair wants to switch)
When NOT to Use
- One-sided assignment (use Hungarian algorithm)
- Weighted matching optimization (different problem)
- When preferences aren't strict orderings
The Pattern
Gale-Shapley Algorithm: Proposers propose in preference order; acceptors tentatively accept best offer so far.
def stable_matching(proposer_prefs, acceptor_prefs):
"""Find stable matching using Gale-Shapley algorithm.
Returns dict mapping proposers to matched acceptors.
Proposer-optimal: proposers get best partner possible.
"""
n = len(proposer_prefs)
# Track state
unmatched = set(range(n)) # Unmatched proposers
matched = {} # acceptor -> proposer
proposals = [list(prefs) for prefs in proposer_prefs] # Remaining preferences
while unmatched:
proposer = unmatched.pop()
if not proposals[proposer]:
continue # Proposer exhausted all options
acceptor = proposals[proposer].pop(0) # Best remaining choice
if acceptor not in matched:
# Acceptor is free, tentatively accept
matched[acceptor] = proposer
elif acceptor_prefs[acceptor].index(proposer) proposer
# Pre-sort: for each proposer, list acceptors by preference
proposals = [sorted(ids, key=lambda a: P[p][a]) for p in ids]
while unmatched:
p = unmatched.pop()
a = proposals[p].pop() # Best remaining acceptor
if a not in matched:
matched[a] = p
elif A[a][p] < A[a][matched[a]]: # a prefers p to current
unmatched.add(matched[a])
matched[a] = p
else:
unmatched.add(p) # Rejected, try again
return {(p, a) for a, p in matched.items()}
Key Principles
- Proposer advantage: Algorithm is optimal for proposing side
- Tentative matching: Acceptors can "trade up"
- Guaranteed stable: No blocking pairs in result
- O(n^2) time: Each proposer proposes to each acceptor at most once
- Pre-sort preferences: Makes lookup O(1) during matching
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: jimmc414
- Source: jimmc414/claude-code-plugin-marketplace
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.