Managing code repos
Skill pvnarp/harness-agentic-skills/skills/harness/managing-code-repos
Manage Harness Code repositories via MCP. List, get, create, and update repos at account, org, or project scope. Browse branches, commits, file content, blames, diffs, tags, and protection rules at both repo and space scope. Use when asked to create a Harness Code repo, list branches, show a file from a branch, view commit history, set up branch protection, or audit code rules. Trigger phrases: code repo, harness code, branch protection, file content, commit history, blame, diff, git tag, repo rules, space rules.From its SKILL.md
npx -y skills add pvnarp/harness-agentic-skills --skill managing-code-reposAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
6.7 KB, as published. Nobody here has run it
Manage Harness Code Repositories
What this skill uses
Harness MCP tools: harness:harness_create, harness:harness_delete, harness:harness_describe, harness:harness_execute, harness:harness_get, harness:harness_list, harness:harness_update
Resource types: branch, commit, file_content, repo_rule, repository, space_rule, tag
Browse and administer Harness Code repos via MCP. Repos work at account, org, or project scope - omit org_id/project_id for account-scoped repos.
Instructions
Step 1: List or create a repo
List:
Call MCP tool: harness:harness_list
Parameters:
resource_type: "repository"
org_id: "<org>" # omit for account scope
project_id: "<project>" # omit for account/org scope
filters:
query: "<keyword>"
Create:
Call MCP tool: harness:harness_create
Parameters:
resource_type: "repository"
org_id: "<org>"
project_id: "<project>"
body:
identifier: "platform-api"
default_branch: "main"
description: "Platform API service"
is_public: false
readme: true
git_ignore: "Go"
license: "apache-2.0"
Update description / default_branch / visibility:
Call MCP tool: harness:harness_update
Parameters:
resource_type: "repository"
resource_id: "platform-api"
body:
default_branch: "develop"
description: "Platform API (Go service)"
Step 2: Branches
Call MCP tool: harness:harness_list
Parameters:
resource_type: "branch"
params:
repo_id: "platform-api"
Create branch:
Call MCP tool: harness:harness_create
Parameters:
resource_type: "branch"
params:
repo_id: "platform-api"
body:
name: "feature/auth"
target: "main" # base branch or commit SHA
Delete branch:
Call MCP tool: harness:harness_delete
Parameters:
resource_type: "branch"
resource_id: "feature/auth"
params:
repo_id: "platform-api"
Step 3: Commits
List commits:
Call MCP tool: harness:harness_list
Parameters:
resource_type: "commit"
params:
repo_id: "platform-api"
filters:
git_ref: "main"
after: "<sha-or-ref>"
Get a single commit:
Call MCP tool: harness:harness_get
Parameters:
resource_type: "commit"
resource_id: "<commit-sha>"
params:
repo_id: "platform-api"
Diff between refs:
Call MCP tool: harness:harness_execute
Parameters:
resource_type: "commit"
action: "diff"
params:
repo_id: "platform-api"
body:
base: "main"
head: "feature/auth"
Diff stats only:
Call MCP tool: harness:harness_execute
Parameters:
resource_type: "commit"
action: "diff_stats"
params:
repo_id: "platform-api"
body:
base: "main"
head: "feature/auth"
Step 4: File content and blame
Read a file at a ref:
Call MCP tool: harness:harness_get
Parameters:
resource_type: "file_content"
params:
repo_id: "platform-api"
path: "src/handler.go"
git_ref: "main"
Blame:
Call MCP tool: harness:harness_execute
Parameters:
resource_type: "file_content"
action: "blame"
params:
repo_id: "platform-api"
path: "src/handler.go"
git_ref: "main"
Step 5: Tags
Call MCP tool: harness:harness_list
Parameters:
resource_type: "tag"
params:
repo_id: "platform-api"
Create:
Call MCP tool: harness:harness_create
Parameters:
resource_type: "tag"
params:
repo_id: "platform-api"
body:
name: "v1.2.0"
target: "<commit-sha>"
message: "Release v1.2.0"
Step 6: Branch protection (repo-scoped rules)
Call MCP tool: harness:harness_list
Parameters:
resource_type: "repo_rule"
params:
repo_id: "platform-api"
Create a rule (require PR + approvals + status checks):
Call MCP tool: harness:harness_create
Parameters:
resource_type: "repo_rule"
params:
repo_id: "platform-api"
body:
identifier: "main-protection"
type: "branch"
pattern:
include:
- "main"
definition:
require_pull_request: true
require_approvals: 2
require_status_checks:
- "ci/build"
- "ci/test"
block_force_push: true
block_deletion: true
Step 7: Space-level rules
Apply rules across multiple repos in an org/project space:
Call MCP tool: harness:harness_list
Parameters:
resource_type: "space_rule"
org_id: "<org>"
project_id: "<project>"
Same body shape as repo_rule, scoped to the space rather than a single repo.
Examples
- "Create a Harness Code repo called platform-api with a README" → harness:harness_create repository with readme=true
- "Show me main branch HEAD of src/main.go" → harness:harness_get file_content with git_ref=main
- "Diff main vs feature/auth" → harness:harness_execute commit with action=diff
- "Require 2 approvals and CI green on main" → harness:harness_create repo_rule with definition.require_approvals=2 and require_status_checks
- "Who last touched this file?" → harness:harness_execute file_content blame
Related skills
Composes with (skills commonly invoked together):
Follow-ups (skills commonly chained after this one):
Performance Notes
- File content for very large files can be slow - prefer
git_ref+ path over fetching the whole tree. - Commit listing supports pagination; default page size varies by API.
space_ruleis preferred when you want consistent protection across many repos.
Troubleshooting
- "repo not found" - confirm scope. Account-scoped repos must omit
org_id/project_id. Useharness:harness_listfirst. - Branch create fails with "target invalid" -
targetmust be a branch name or full SHA, not a partial SHA. - Rule create rejected -
pattern.include/pattern.excludemust be glob patterns. Runharness:harness_describe(resource_type='repo_rule')for the current schema.