agentleFS
bestagentkitsbestagentkits/cloud-harness-mcp/AGENTS.md

cloud-harness-mcp

AGENTS.md115 starsChanged 4 months agoMITView on GitHub

Cloud Harness MCP is intentionally a private, single-owner remote coding harness. Preserve that threat model: it permits arbitrary repository-controlled execution inside a constrained executor, but it is not a hostile multi-tenant sandbox. Start with README.md. Read the relevant document under docs/ before changing its boundary. Code, schemas, tests, manifests, and scripts own WHAT and HOW; documentation owns WHY and WHERE. Point docs to executable owners instead of copying behavior, defaults, command inventories, or configuration. - Keep the credential-free ingress proxy…

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository3 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

19 rules. About 2 are common, 7 are distinctive, and 10 are very specific to this project.

  • ≈2

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Start with README.md. Read the relevant document under docs/ before changing its boundary.

    line 10
  2. Common:

    Keep the credential-free ingress proxy as the only host-published Compose service, bound to loopback.

    line 34
  3. Common:

    Keep Docker authority, job/state mounts, and optional GitHub App credentials confined to the runner.

    line 37
  4. Very specific:

    Treat the schemas and result envelope in packages/contracts/src/ and the lifecycle, idempotency, restart, and truncation semantics in …

    line 56
  5. Very specific:

    Never commit .env files, tokens, keys, databases, runtime state, private repository URLs, or user data.

    line 63
  6. Distinctive:

    Treat bootstrap, deployment, rollback, production verification, and manual container or state recovery as live operations.

    line 66
  7. Very specific:

    Every security rule still applies to both shells: no unsafe-inline, no unsafe-eval, no CDN or remote assets, no secret, API key, OAuth …

    line 80
  8. Very specific:

    Before starting an issue, check its labels, assignees, and linked PRs.

    line 119
  9. Distinctive:

    When you find a related or duplicate issue, comment on it with a reference to the issue you are working on instead of duplicating work.

    line 128
  10. Distinctive:

    Keep changes narrow and preserve public contracts unless the accepted scope intentionally changes them.

    line 137
  11. Distinctive:

    Run the narrowest relevant test first, then the applicable repository gate:

    line 139
  12. Distinctive:

    Do not weaken security checks, cleanup assertions, timeouts, or tests to make a gate pass.

    line 155
  13. Distinctive:

    If you start watch processes or Compose services, check for an existing project process first, track what you start, and stop it when the …

    line 157
  14. Very specific:

    Use npm ci for a clean dependency install.

    line 160
  15. Very specific:

    Update .agents/skills/cloudharness/SKILL.md and the affected reference documents under .agents/skills/cloudharness/references/ to keep …

    line 176
  16. Very specific:

    Run npm run plugin:sync to ensure .agents/skills/cloudharness/ and plugins/cloud-harness/skills/cloudharness/ remain byte-identical.

    line 179
  17. Very specific:

    Verify skill contract compliance by running npm test packages/contracts/test/cloudharness-skill-contract.test.ts (or npm run verify).

    line 181
  18. Very specific:

    Before starting, check for an existing in progress owner or a duplicate issue.

    line 195
  19. Distinctive:

    Keep plans and reports out of evergreen guidance, and do not add release notes or governance files unless the repository contract requires …

    line 202

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Cloud Harness MCP collaborator guide

Purpose and authority

Cloud Harness MCP is intentionally a private, single-owner remote coding harness. Preserve that threat model: it permits arbitrary repository-controlled execution inside a constrained executor, but it is not a hostile multi-tenant sandbox.

Start with README.md. Read the relevant document under docs/ before changing its boundary. Code, schemas, tests, manifests, and scripts own WHAT and HOW; documentation owns WHY and WHERE. Point docs to executable owners instead of copying behavior, defaults, command inventories, or configuration.

Navigation

ConcernRead firstExecutable authority and evidence
Trust model and isolationdocs/security-model.mdapps/api/src/request-security.ts, apps/runner/src/workspace-service.ts, test/integration/docker-sandbox.docker.test.ts
Public MCP contractdocs/mcp-api.mdpackages/contracts/src/, apps/api/src/mcp-server.ts, packages/contracts/test/, test/integration/
MCP Events (webhook delivery)docs/mcp-api.md, docs/security-model.mdpackages/contracts/src/events-api.ts, apps/api/src/events/, apps/runner/src/event-outbox.ts, apps/runner/src/mcp-event-service.ts, test/integration/mcp-events-http.test.ts
API/runner boundarydocs/system-architecture.mdapps/api/src/, apps/runner/src/, compose*.yaml, scripts/verify-compose-boundaries.mjs
Repository and executor behaviordocs/security-model.mdapps/runner/src/repository-policy.ts, worker/, runner and Docker tests
Configurationdocs/configuration.md.env.example, packages/contracts/src/config.ts, apps/api/src/config.ts, apps/runner/src/config.ts, compose*.yaml
Development and verificationdocs/development.mdpackage.json, .github/workflows/ci.yml, tests
Deployment and recoverydocs/deployment.md, docs/operations.md, docs/troubleshooting.mddeploy/, compose.production.yaml, scripts/verify-production.mjs, scripts/deploy-canary.mjs
Operator dashboard UI (legacy shell)docs/design-guidelines.mdapps/api/dashboard/, apps/api/src/dashboard-router.ts, apps/api/src/dashboard-assets.ts, apps/api/test/dashboard-ui-contract.test.ts
Dashboard 2.0 (React app)docs/adr/0005-dashboard-react-rewrite.md, docs/dashboard-parity-matrix.md, docs/design-guidelines.mdapps/dashboard/, apps/api/src/dashboard-react-assets.ts (manifest serving), apps/api/src/dashboard-security.ts (CSP), apps/api/src/dashboard-router.ts (BFF)
Official user docs & guidesdocs-site/docs-site/, scripts/build-docs-reference.mjs, npm run docs:build
Agent skill & MCP tool guidance.agents/skills/cloudharness/SKILL.md.agents/skills/cloudharness/, plugins/cloud-harness/, packages/contracts/test/cloudharness-skill-contract.test.ts, npm run plugin:sync

Safety-critical invariants

  • Keep the credential-free ingress proxy as the only host-published Compose service, bound to loopback. The API and runner must not publish host ports; the ingress must not receive secrets or join the control network.
  • Keep Docker authority, job/state mounts, and optional GitHub App credentials confined to the runner. The API must not receive host mounts or the Docker socket. Executors must not receive control-plane credentials, and the harness must not push repository credentials into them. The single documented exception is an operator-created GitHub runtime secret (GH_TOKEN or GITHUB_TOKEN), which is an explicit owner opt-in for authenticating the workspace gh CLI and is recorded in docs/security-model.md.
  • Preserve the executor restrictions and resource bounds owned by apps/runner/src/workspace-service.ts. dependency-access is the owner-approved shipped network default and network-none remains the isolation opt-out, per workspace or instance-wide; the executable owners and docs/security-model.md own the resolution order, the per-start attestation requirement, and the fail-closed DEPENDENCY_EGRESS_UNAVAILABLE behaviour. No raw bridge profile is selectable, and egress is never a silent downgrade.
  • Preserve credential-free HTTPS repository URLs, host/address validation, and constrained cloning. Private-clone credentials stay in the trusted broker and must never persist in the checkout, remote URL, logs, fixtures, or command output; the executor-environment exception is the operator-injected GitHub runtime secret named above.
  • Treat the schemas and result envelope in packages/contracts/src/ and the lifecycle, idempotency, restart, and truncation semantics in docs/mcp-api.md as public contracts. Change their source, tests, and user guidance together.
  • Scope cleanup by the verified workspace identity, canonical job path, state record, and managed-container labels. Never recursively remove a jobs root or run broad Docker cleanup on a shared host.
  • Never commit .env files, tokens, keys, databases, runtime state, private repository URLs, or user data. Do not claim live private-clone or production verification without owner-authorized, sanitized evidence.
  • Treat bootstrap, deployment, rollback, production verification, and manual container or state recovery as live operations. Follow the owning runbook, resolve exact targets first, and do not perform them from an ordinary code task without explicit authorization.

Dashboard frontend rules

ADR 0005 supersedes Issue #220's "no framework" decision. Do not re-apply the old frontend-only rules to apps/dashboard: React, TypeScript, the ADR's dependency allowlist, self-hosted Geist fonts under font-src 'self', and browser storage for non-secret preferences and UI restore are allowed there. The legacy shell in apps/api/dashboard/ keeps its own rules and contract tests until cutover.

Every security rule still applies to both shells: no unsafe-inline, no unsafe-eval, no CDN or remote assets, no secret, API key, OAuth token, terminal output or owner ID in browser storage or persisted caches, the BFF session cookie and CSRF header on every mutation, Host/Origin checks, and redacted principal-scoped projections. A UI affordance never grants a capability. Replace a markup-coupled test with a behavioural test when its page moves; never delete coverage. Track page ownership in the parity matrix.

Deploy failure lessons

  • A Deploy production failure at deploy-canary.mjs with UND_ERR_CONNECT_TIMEOUT/ECONNREFUSED right after compose up is usually a transient route gap in the freshly recreated container, not a release bug. Confirm from the host (docker exec cloud-harness-mcp-ingress-1 node -e ... TCP probe to the canary host) before changing code; the canary retries only its first side-effect-free server/discover call on transport errors. Never read or print the canary credentials file while diagnosing.
  • The curl ... port 3100 lines before the canary are the expected readiness wait loop, not the failure.
  • client_loop: send disconnect: Broken pipe mid-build means the CI session dropped. Check the host with systemctl status cloud-harness-deploy-<sha> and its journal, not the CI log: the deploy runs as that systemd unit and keeps going. Never move the deploy back into the SSH/sudo session; sudo kills the process group before any rollback trap can run.
  • The installed /usr/local/sbin/cloud-harness-deploy is the previous release's script, so a fix to deploy-release.sh protects only later deploys. Deploying an older commit never downgrades it (/var/lib/cloud-harness/deploy-tooling-release).
  • A leftover /var/lib/cloud-harness/deploy-in-progress means a deploy was killed after stopping the release; cloud-harness-deploy-recover.service (boot) or the deploy unit's ExecStopPost rolls it back. Do not delete the marker by hand before reading its journal.

Issue and PR coordination

Parallel contributors and agents coordinate through issue state, so keep it current:

  • Before starting an issue, check its labels, assignees, and linked PRs. Skip or coordinate on an issue already in progress, in review, or done.
  • Assign yourself (or the requesting owner) and move the issue through exactly one status label at a time: in progress while implementing, blocked when waiting on an external decision or prerequisite (comment what blocks it), in review during isolated code review, done once the PR is open and green, and shipped after it merges to main.
  • main is the integration branch; merging to it triggers Deploy production, so a merge is a live operation that needs owner authorization.
  • When you find a related or duplicate issue, comment on it with a reference to the issue you are working on instead of duplicating work. File an unrelated defect you discover as its own issue rather than widening the current PR.

Change workflow

  1. Inspect the relevant document, executable owner, nearby tests, and current working tree. Preserve unrelated edits.
  2. For defects, prove the failure and its boundary before changing behavior. Keep changes narrow and preserve public contracts unless the accepted scope intentionally changes them.
  3. Run the narrowest relevant test first, then the applicable repository gate:
    • Normal code changes: npm run verify. On Windows or non-POSIX hosts, use targeted suites (npm run test:unit, npm run test:integration, npm run lint, npm run typecheck) as your baseline; shell fixture tests in test/deploy-release-runtime.test.ts and test/upgrade-nginx-routes.test.ts require a POSIX host and are verified in Linux CI. The nginx upgrade script refuses its test root when run as root, so in a root-only container run that suite as an unprivileged user instead of treating the failure as a regression.
    • Compose or network-boundary changes: npm run verify:compose and npm run verify.
    • Shell changes: run the syntax check owned by .github/workflows/ci.yml.
    • Docker/executor changes: build with docker compose --profile images build executor-image api runner, then run npm run test:docker and npm run test:e2e when Docker and network access are available.
  4. Do not weaken security checks, cleanup assertions, timeouts, or tests to make a gate pass. Report an unavailable prerequisite or pre-existing failure.
  5. If you start watch processes or Compose services, check for an existing project process first, track what you start, and stop it when the task ends.

Use npm ci for a clean dependency install. The root package.json remains the command authority; do not duplicate its full script list here. Do not run npm run verify:production casually: it targets a live MCP endpoint, requires owner credentials, and creates a disposable workspace.

Whenever shipping changes with user or operational impact (new features, workflows, configuration keys, public contracts, troubleshooting steps, or use cases), evaluate and update both internal docs (docs/) and the official docs site (docs-site/). Keep user and operator guides in sync (such as docs-site/ai-tools/, docs-site/dashboard/, docs-site/reference/, and docs-site/troubleshooting.md), and run npm run docs:reference or npm run plugin:sync if tool or contract surfaces changed.

Whenever MCP tool surfaces, schemas, capabilities, options, execution behaviors, or workspace lifecycle features change or are added:

  • Update .agents/skills/cloudharness/SKILL.md and the affected reference documents under .agents/skills/cloudharness/references/ to keep agent tool usage guidance accurate and effective.
  • Run npm run plugin:sync to ensure .agents/skills/cloudharness/ and plugins/cloud-harness/skills/cloudharness/ remain byte-identical.
  • Verify skill contract compliance by running npm test packages/contracts/test/cloudharness-skill-contract.test.ts (or npm run verify).

Issue coordination

Parallel contributors and agents coordinate through issue labels, so keep them current on the issue you are working on and assign its owner:

  • in progress while implementing, blocked while waiting on a dependency or decision (say what in a comment), in review while an isolated reviewer checks the change, done once the PR is open, and shipped once it is merged. Replace the previous state label rather than stacking them. The released label is applied by the release automation, not by hand.
  • Before starting, check for an existing in progress owner or a duplicate issue. Comment on related or duplicate issues with a reference instead of doing the work twice.
  • File a separate issue for an unrelated defect or hardening gap found along the way rather than widening the current PR, and resolve it instead of leaving it for later.

Keep plans and reports out of evergreen guidance, and do not add release notes or governance files unless the repository contract requires them.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.