How the Hiring Agent Distinguishes Between Open-Source and Self-Owned GitHub Projects

The Hiring Agent classifies repositories as "open_source" or "self_project" based on contributor count, marking repositories with more than one unique contributor as open-source and all others as self-owned.

The interviewstreet/hiring-agent repository automates candidate portfolio analysis by retrieving public GitHub data and applying a deterministic heuristic to distinguish between open-source and self-owned GitHub projects. This classification logic resides in the fetch_all_github_repos function and enables downstream LLM prompts to prioritize meaningful collaborative work when evaluating engineering candidates.

Fetching Repository Contributors via the GitHub API

The classification process begins by retrieving contributor metadata for each public repository. In github.py, the fetch_repo_contributors function calls the GitHub REST API endpoint GET /repos/{owner}/{repo}/contributors to fetch the complete list of distinct contributors.

According to the source code, the implementation stores the API response in contributors_data and calculates the contributor count using Python's len() function:

contributors_data = fetch_repo_contributors(username, repo_name)
contributor_count = len(contributors_data)

This logic appears in lines 39-41 of github.py, where the agent prepares the raw data needed for the classification heuristic.

The Contributor Count Heuristic for Project Classification

After gathering contributor statistics, the agent applies a binary classification rule within the fetch_all_github_repos function. According to lines 46-48 in github.py, the logic uses a conditional expression:

project_type = (
    "open_source" if contributor_count > 1 else "self_project"
)

If contributor_count exceeds one, the repository is labeled "open_source"; otherwise, it receives the "self_project" classification. This simple threshold effectively distinguishes solo personal projects from community-driven repositories.

The classified project_type field becomes part of the repository metadata object, which the system passes to the github_project_selection.jinja template for LLM-based portfolio analysis.

Filtering Out Low-Quality Forks

Before classification, the agent filters out forked repositories that likely represent trivial copies rather than maintained forks. Lines 34-36 in github.py implement this guard clause:

if repo.get("fork") and repo.get("forks_count", 0) < 5:
    continue

Forks with fewer than 5 stars are skipped entirely, preventing "toy" forks from skewing the candidate's portfolio analysis. This ensures that the project_type classification only applies to substantive repositories.

Implementation Example: Classifying a Candidate's Portfolio

To classify an entire candidate portfolio, import the fetch_all_github_repos function and process the returned metadata:

from github import fetch_all_github_repos

# Example: classify a candidate's repositories

github_url = "https://github.com/example-candidate"
projects = fetch_all_github_repos(github_url, max_repos=50)

for p in projects:
    print(f"{p['name']}: {p['project_type']} (contributors: {p['contributor_count']})")

Typical output distinguishes collaborative work from solo projects:


awesome-api: open_source (contributors: 4)
personal-website: self_project (contributors: 1)

For single-repository analysis, use the lower-level helper functions directly:

from github import fetch_repo_contributors, extract_github_username

owner = extract_github_username("https://github.com/example-candidate")
contributors = fetch_repo_contributors(owner, "awesome-api")
project_type = "open_source" if len(contributors) > 1 else "self_project"

print(project_type)   # → open_source

The resulting project_type values integrate with the GitHubProfile dataclass defined in models.py and feed into the selection templates used by the hiring pipeline.

Summary

  • The Hiring Agent uses a contributor count heuristic in github.py to label repositories as "open_source" or "self_project".
  • Repositories with more than one contributor are classified as open-source; all others are marked as self-owned.
  • Low-quality forks (those with fewer than 5 stars) are filtered out before classification to ensure data quality.
  • The classification supports downstream LLM prompts in github_project_selection.jinja to highlight relevant collaborative experience.

Frequently Asked Questions

What threshold does the hiring agent use to classify a project as open-source?

The agent applies a strict contributor count threshold of greater than one. Any repository with two or more unique contributors is classified as "open_source", while repositories with exactly one contributor are labeled "self_project". This logic is implemented in lines 46-48 of github.py.

How does the hiring agent handle forked repositories?

The agent filters out forks that have fewer than 5 stars before classification. Specifically, lines 34-36 in github.py skip any repository where repo.get("fork") is true and repo.get("forks_count", 0) is less than 5, preventing insignificant forks from affecting the portfolio analysis.

Where is the project classification stored after determination?

The project_type string is stored within the repository metadata dictionary returned by fetch_all_github_repos. This data populates the GitHubProfile dataclass defined in models.py and is passed to the LLM prompt template at prompts/templates/github_project_selection.jinja for final project selection.

Can the classification logic be customized?

While the current implementation uses a hardcoded threshold of one contributor in the fetch_all_github_repos function, the modular design of github.py allows developers to modify the classification logic or adjust the contributor count threshold by editing the conditional statement at lines 46-48.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →