---
name: gitcore
version: 1.1.12
description: >-
  Sovereign Git hosting, Virtual Stacked PR DAGs, Speculative Parallel Merge Queues,
  machine-actionable SARIF v2.1.0 code reviews, and cryptographic agent attestation via GitCore (https://gitcore.net).
  Use this skill whenever the user or orchestrator mentions GitCore, stacked PRs, virtual branch DAGs,
  parallel agent swarms, merge queues, eliminating Git merge conflicts, SARIF code reviews,
  agent commit/PR attestation, air-gapped Git servers, or sovereign Git hosting.
author: "Peer Capital Limited <support@gitcore.com.ng>"
license: "MIT"
---

# GitCore Agent Skill (`gitcore`)

GitCore (`https://gitcore.net`) is a bare-metal sovereign Git platform engineered specifically so parallel AI coding agents can ship 10–100x more pull requests without trunk stalls or merge conflict storms.

## 1. Connect to GitCore (Preferred Order)

1. **MCP Server (`@gitcorenet/mcp`) — Preferred**:
   - Check if `gitcore` / `gitcore-mcp` tools are already registered in your MCP toolset.
   - The server exposes eight tools: `create_repo`, `push_stacked_pr`, `enqueue_speculative_merge`, `get_sarif_review`, `sign_agent_attestation`, `submit_sarif_review`, `get_pull_request_stack`, and `search_public_repos`.
   - If configuring MCP dynamically:
     - **Remote Streamable HTTP**: `https://mcp.gitcore.net/mcp` (also `https://gitcore.net/mcp`) with header `Authorization: Bearer $GITCORE_TOKEN`.
     - **Local Stdio**: Node.js 18+, `npx -y @gitcorenet/mcp`, env `GITCORE_TOKEN` (`gitcore_pat_...`) and optional `GITCORE_URL` (`https://gitcore.net` or air-gapped Sovereign VPC URL).
   - MCP resources: `gitcore://llms.txt`, `gitcore://llms-full.txt`, and `gitcore://openapi.json`.
2. **Bundled Helper Script (`scripts/gitcore-agent.mjs`) or Direct REST API**:
   - When MCP is unavailable, run `node scripts/gitcore-agent.mjs <command>` or call `https://gitcore.net/api/...` directly using `Authorization: Bearer $GITCORE_TOKEN` (full OpenAPI 3.1 spec at `https://gitcore.net/openapi.json`).

---

## 2. Standard Playbook for Conflict-Free Agent Swarms

Whenever implementing a multi-file feature or coordinating multiple parallel agents on GitCore, follow this 5-step workflow instead of pushing a single giant branch:

### Step 1: Provision or Select Target Repository (`create_repo`)
- Use `create_repo` (`POST /api/repos`) with `{ name, description, defaultBranch: "main", isPrivate }`.
- For local Git wire operations, clone via Smart HTTP v2:
  `git clone https://x-access-token:${GITCORE_TOKEN}@gitcore.net/<owner>/<repo>.git`

### Step 2: Decompose Work into Atomic Stacked PRs (`push_stacked_pr`)
- Keep each PR focused (~50–200 changed lines) to minimize conflict surface area and qualify for Tier-1 Low-Risk Auto-Approval:
  1. **Root PR (`PR #1`)**: Push schema / core types targeting `main` (`push_stacked_pr` with `head: "stack/01-types"`, `base: "main"`, `files: [...]`).
  2. **Child PR (`PR #2`)**: Stack business logic directly onto `PR #1` (`push_stacked_pr` with `head: "stack/02-engine"`, `parentPrNumber: 1`, `files: [...]`).
  3. **Leaf PR (`PR #3`)**: Stack API/UI wiring onto `PR #2` (`push_stacked_pr` with `head: "stack/03-api"`, `parentPrNumber: 2`, `files: [...]`).
- Note: `push_stacked_pr` commits files directly onto bare Git storage via temporary index trees—no local `git checkout` is needed when running in stateless cloud sandboxes.

### Step 3: Attach Cryptographic Provenance (`sign_agent_attestation`)
- Every agent-authored PR should carry verifiable provenance (`agentId`, `model`, `runId`, `promptHash`, `confidenceScore`, plus optional detached PGP/Ed25519 `clientSignature`).
- For registered agent accounts, create the PR first, then run `node scripts/gitcore-agent.mjs attest --owner <owner> --repo <repo> --pr <number> --model <model>`. The helper signs version-2 metadata bound to that PR using the registered Ed25519 key. Human accounts may pass an attestation inline inside `push_stacked_pr` or call `sign_agent_attestation`.

### Step 4: Inspect & Apply Machine-Actionable SARIF Reviews (`get_sarif_review`)
- Call `get_sarif_review` (`GET /api/repos/{owner}/{repo}/pulls/{number}/reviews/sarif`) before enqueueing:
  - Check `autoApprovalStatus.pingPongTriggered`: **STOP** automated review-fix loops immediately if `true` and surface to a human reviewer.
  - For each entry in `findings[]` with `suggestion` and `!isApplied`, either apply via `POST {applyEndpoint}` or push a clean update via `push_stacked_pr`.

### Step 5: Land Safely Through the Speculative Merge Queue (`enqueue_speculative_merge`)
- Never force-merge directly into protected `main`. Call `enqueue_speculative_merge` (`POST /api/repos/{owner}/{repo}/pulls/{number}/queue`) starting from the stack root (`stack.canMerge === true`).
- GitCore chains in-memory `git merge-tree --write-tree` commits across queued PRs, ejects *only* conflicting PRs without resetting healthy downstream PRs, and automatically rebases child PRs in your stack onto `main` as soon as their parent PR merges.

---

## 3. Additional References & CLI

### Headless Agent Registration

Agents can create a first-class `account_type: "agent"` identity without an OAuth popup, email link, or CAPTCHA:

```bash
node scripts/gitcore-agent.mjs auth agent-init \
  --handle claude-agent-x9 \
  --accept-terms \
  --confirm-18 \
  --json
```

The helper creates an Ed25519 OpenSSH keypair locally, proves possession through a short-lived signed challenge, and returns a one-time sandbox PAT plus a `claimUrl` for a human operator. Keep the private key local and private; the PAT is displayed once and expires in 30 days. Both consent flags are required. JSON output is used for every command, failures are written as structured JSON to stderr, and failures return a non-zero exit code.

Unclaimed agents use the Agent Sandbox limits: **5 repositories, 20 CI runs/hour, 500 CI minutes/month, 1 GB storage, and 10 merge-queue additions/hour**. A signed-in human account can claim the agent using the claim URL within 7 days; claimed agents receive standard human Team limits: **unlimited repositories, 3,500 CI minutes/month, and 5 GB storage**. Separate agent-specific hourly CI/queue caps are removed after claiming; normal platform rate limits still apply. `attest` signs PR provenance with the registered Ed25519 key. Registered SSH commit signatures are verified cryptographically against the identity key.

Key possession confirms control of the registered key, not which model or vendor is running. `agentId` and `model` attestation fields are provenance supplied by the agent, not independent provider verification.

- Read `references/api-reference.md` for full JSON payload schemas and curl recipes.
- Read `https://gitcore.net/llms-full.txt` for the full agent-oriented platform and API reference.
- Use `node scripts/gitcore-agent.mjs --help` for command syntax and JSON response conventions.
- Remote discovery indexes: `https://gitcore.net/llms.txt` and `https://gitcore.net/llms-full.txt`.
