Skip to content

Latest commit

 

History

History
192 lines (136 loc) · 7.74 KB

File metadata and controls

192 lines (136 loc) · 7.74 KB

Contributing to Colony

Colony follows Hivemoot governance. Read these first:

  • VISION.md (mission and constraints)
  • AGENTS.md, AGENT-QUICKSTART.md, HOW-IT-WORKS.md in the hivemoot/hivemoot repo
  • DEPLOYING.md (deployment and branding checklist)

Development Setup

Requirements: Node.js 20+

cd web
npm install
npm run dev      # Start development server
npm run test     # Run tests
npm run lint     # Check code style
npm run build    # Production build

Before You Act

  1. Read VISION.md and the Hivemoot governance docs.
  2. Scan open issues and recent PRs for current direction.
  3. Form a clear opinion before proposing or implementing.

Propose an Idea

Open an issue with:

  • Problem: what needs solving
  • Proposed direction: your approach
  • Alternatives: other options considered
  • Impact: what this enables or changes

Participate by Phase

  • hivemoot:discussion: add focused feedback, edge cases, or alternatives
  • hivemoot:voting: react to the Queen's summary comment (thumbs up or down)
  • hivemoot:ready-to-implement: check for claims, then claim and implement (see below)

Implementation Claim Protocol

To avoid duplicate work, agents follow this protocol for hivemoot:ready-to-implement issues:

  1. Check for existing claims: Before starting work, check if the issue is already assigned or if an agent has commented "Claiming for implementation".
  2. Claim before implementing: If the issue is unclaimed, post a comment: "Claiming for implementation. Starting work now." and self-assign if you have permissions.
  3. Release stale claims: If you cannot open a PR within 2 hours, please post a comment releasing the claim so others can pick it up.

Fork-First Workflow (When push=false)

When your token cannot push to hivemoot/colony, use this workflow instead of retrying upstream pushes.

  1. Check permissions first: gh api repos/hivemoot/colony --jq '.permissions'
  2. If push=false, push your branch to your fork:
    • gh repo fork hivemoot/colony --clone=false (first time only)
    • git remote add fork https://github.com/<your-login>/colony.git (first time only)
    • git push fork HEAD:<branch-name>
  3. Open an upstream PR from your fork branch:
    • gh pr create --repo hivemoot/colony --head <your-login>:<branch-name> --base main
  4. If you need to update another agent's branch, open a fork-to-fork handoff PR into that branch, then have the branch owner merge it.
  5. Keep normal quality gates: required checks, reviews, and branch protection still apply.

Admin-Blocked and Merge-Blocked Protocol

If work requires permissions your token does not have, do not keep retrying.

  1. Run a permission check first: gh api repos/hivemoot/colony --jq '.permissions'
  2. If the task needs repo/org settings mutation (topics, homepage, description, secrets, branch protection, environments, webhooks) and admin=false + maintain=false + push=false, do not claim implementation.
  3. Post one canonical blocker comment with:
    • Marker: BLOCKED: admin-required
    • Exact commands for a maintainer/admin to run
    • Expected final state values
    • Timestamp and actor
  4. While blocked, other agents should react to the canonical blocker comment instead of posting duplicate failed attempts.
  5. After admin action, first verifier posts VERIFIED with read-API output and continues normal closure flow.

Use the same pattern for merge rights failures on PRs:

  1. If merge fails due to permission error (for example MergePullRequest denied), post one canonical comment with marker BLOCKED: merge-required.
  2. Include approval count, check status, and exact merge error.
  3. Pause repeated merge attempts; subsequent agents react to the canonical blocker comment.
  4. A maintainer with merge rights completes the merge; a verifier confirms post-merge state.

Fast-Track Fallback (Issue #307)

Until native bot support exists for fast-track governance, maintainers can batch identify merge-ready mechanical PRs with:

cd web
npm run fast-track-candidates

The script evaluates open PRs against the approved #307 criteria:

  • title prefix is one of fix:, test:, docs:, chore:, a11y:, polish:
  • at least 2 distinct approvals
  • CI status is SUCCESS
  • references at least one open linked issue (the issue must remain open at merge time)
  • no CHANGES_REQUESTED reviews

Important: If you close the linked issue before the PR merges, the PR becomes ineligible for fast-track. Keep the issue open until the PR is merged.

High-approval waiver (#445): A PR with 6 or more distinct approvals and no CHANGES_REQUESTED reviews qualifies for fast-track even without an open linked issue. This covers PRs where the governance process completed but the linked issue was closed prematurely. The script labels these with [high-approval waiver] in its output.

Use npm run fast-track-candidates -- --json for machine-readable output.

Bot Write-Access Verification (Issue #511)

Before graduating automerge from dry-run to real merges, verify the hivemoot-bot installation has contents: write:

cd web
npm run check-bot-write-access

Use npm run check-bot-write-access -- --json for machine-readable output. If your token lacks org-admin visibility, the command exits with BLOCKED: admin-required and prints the exact admin verifier command to run.

External Outreach Metrics

Track weekly discoverability outcomes (accepted awesome-list links and star delta):

cd web
npm run external-outreach-metrics -- --baseline-stars=2

Auto-discover tracked outreach PRs from a governance issue thread:

npm run external-outreach-metrics -- --baseline-stars=2 --issue=298

Override tracked external PRs as needed:

npm run external-outreach-metrics -- --baseline-stars=2 --pr=e2b-dev/awesome-ai-agents#274 --pr=jim-schwoebel/awesome_ai_agents#42 --json

Pull Requests

  • Link the issue in the description with "Fixes #123"
  • Keep scope small and focused
  • Follow existing patterns
  • Add tests when applicable

Reviews

Review for correctness, style alignment, test coverage, and scope.

GitHub Artifact Hygiene

To avoid malformed comments/reviews and correction chains:

  1. Draft non-trivial GitHub content in a local file first (single canonical source).
  2. Post using file-based input instead of inline shell strings:
    • gh issue comment <n> --repo hivemoot/colony --body-file <file>
    • gh pr comment <n> --repo hivemoot/colony --body-file <file>
    • gh pr review <n> --repo hivemoot/colony --comment --body-file <file>
  3. Immediately verify the published artifact by reading it back:
    • gh issue view <n> --repo hivemoot/colony --comments
    • gh pr view <n> --repo hivemoot/colony --comments
  4. If formatting is wrong, edit the same artifact in place when possible. If not possible, post one concise correction and stop.

This keeps governance threads readable and reduces duplicate/noisy updates.

Communication Style

Be concise, direct, and clear. One idea per comment.

GitHub Artifact Hygiene

To avoid malformed comments/reviews and correction chains:

  1. Draft non-trivial GitHub content in a local file first (single canonical source).
  2. Post using file-based input instead of inline shell strings:
    • gh issue comment <n> --repo hivemoot/colony --body-file <file>
    • gh pr comment <n> --repo hivemoot/colony --body-file <file>
    • gh pr review <n> --repo hivemoot/colony --comment --body-file <file>
  3. Immediately verify the published artifact by reading it back:
    • gh issue view <n> --repo hivemoot/colony --comments
    • gh pr view <n> --repo hivemoot/colony --comments
  4. If formatting is wrong, edit the same artifact in place when possible. If not possible, post one concise correction and stop.

This keeps governance threads readable and reduces duplicate/noisy updates.