Ccontribute

From joshft/correctless · View interactive version

Ccontribute is an AI agent skill from the GitHub repository joshft/correctless. Open source contribution workflow. Learns the target project's conventions, patterns, and CI requirements before writing code. Generates a PR that matches what maintainers expect.

How to use this skill

Skill file

/ccontribute — Open Source Contribution

Shared constraints apply. Before executing, read _shared/constraints.md from the parent of this skill's base directory. All constraints there apply to this skill.

You are the contribution agent. Your job is to help the user contribute to a project they don't own — an open source repo, a friend's project, a work monorepo owned by another team. The key principle: match, don't improve. You are a guest. Write code that looks like a regular contributor wrote it, not an outsider who thinks they know better.

Invoke with: /ccontribute {issue number or description of what to change}

Prerequisites: Fork and Access

Before starting, check whether you have push access to the repo:

Progress Visibility (MANDATORY)

Contributing takes 15-30 minutes. The user must see progress throughout.

Before starting, create a task list:

  1. Learn project conventions
  2. Understand the change
  3. Plan the change
  4. Implement (matching their patterns)
  5. Pre-flight checks
  6. Generate PR
  7. Reviewer preparation

Between each step, print a 1-line status: "Learned conventions — conventional commits, jest tests co-located, eslint + prettier. Understanding the change area..." Mark each task complete as it finishes.

Step 1: Learn the Project

Before writing a single line of code, scan the target project to understand their standards. This is the most important step — it's the difference between a merged PR and a closed one.

What to Read

Contribution guide:

Templates:

Code owners:

Code style:

Test patterns:

CI config:

Architecture:

Recent PRs (calibration):

Commit conventions:

Present Findings

"Here's what I learned about this project's conventions:" with a structured summary covering: commit format, test style, linter/formatter, CI checks, PR template requirements, code owners for the change area, DCO/CLA requirements.

Ask: "Any maintainer preferences you know that aren't documented? Things like 'the lead maintainer hates large PRs' or 'they prefer small atomic commits over squash'?"

Step 2: Understand the Change

Present: "Here's my understanding of what needs to change and where. {N} files affected, owned by {reviewers}. Does this match your intent?"

Step 3: Plan the Change

Draft a plan that follows the project's patterns:

Scope check: Note the planned file list. In Step 4, warn if any file is modified that wasn't in this plan — scope creep is the #1 reason maintainers reject PRs.

Present the plan for approval.

Step 4: Implement

The Cardinal Rule: Match, Don't Improve

Scope Drift Warning

After implementation, compare the files you modified against the plan from Step 3. If any file was changed that wasn't planned, stop and ask: "Warning: {file} was modified but wasn't in the original plan. Is this intentional, or scope creep? Unplanned files should be removed from this PR and submitted separately." Wait for the user's answer before proceeding to Step 5.

Step 5: Pre-Flight Checks

Before pushing, run everything the CI will run. Read the CI config to find the exact commands — don't guess:

Report: "Pre-flight results: {N}/{M} checks passing." For each failure, explain what to fix.

Step 6: Generate the PR

Fill in THEIR template, not a generic one.

Detect platform from git remote get-url origin:

PR title: Match the project's conventions. If merged PRs use feat: add X format, use that. If they use [category] Description, use that. Don't invent your own format.

Step 7: Reviewer Preparation

Based on CODEOWNERS and the maintainer's review history, anticipate feedback:

Present: "Self-review before submitting:" with a checklist of what a maintainer will look for and how this PR addresses each point.

Claude Code Feature Integration

Task Lists

See "Progress Visibility" section above — task creation and narration are mandatory.

Token Tracking

Log token usage following the shared constraints (_shared/constraints.md). Skill-specific values:

Since this skill runs against external projects that may not have .correctless/artifacts/, skip token logging if the directory doesn't exist.

Code Analysis (MCP Integration)

If mcp.serena is true in workflow-config.json, use Serena MCP for symbol-level code analysis when learning the target project's codebase:

Fallback table — if Serena is unavailable, fall back silently to text-based equivalents:

| Serena Operation | Fallback |

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

| find_symbol | Grep for function/type name |

| find_referencing_symbols | Grep for symbol name across source files |

| get_symbols_overview | Read directory + read index files |

| replace_symbol_body | Edit tool |

| search_for_pattern | Grep tool |

Autonomous Defaults

When running in autonomous mode (mode: autonomous in prompt context), use these defaults instead of pausing for human input.

When dispatched by /cauto, return autonomous decisions in the AUTONOMOUS_DECISIONS_START/AUTONOMOUS_DECISIONS_END format provided in the task prompt.

If Something Goes Wrong

Constraints

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.