Skip to content

Add AGENTS.md for Cursor Cloud development environment#9685

Open
nickmisasi wants to merge 4 commits intomainfrom
cursor/env-setup-f815
Open

Add AGENTS.md for Cursor Cloud development environment#9685
nickmisasi wants to merge 4 commits intomainfrom
cursor/env-setup-f815

Conversation

@nickmisasi
Copy link
Copy Markdown
Contributor

@nickmisasi nickmisasi commented Apr 13, 2026

Summary

Adds AGENTS.CLOUD.md with Cursor Cloud-specific development environment instructions for future cloud agents. The VM update script copies it to AGENTS.md on startup so it only affects cloud agent environments, not local developer setups.

Documents:

  • Android SDK setup and emulator configuration (API 28 for speed, API 34 for modern look)
  • Docker-based Mattermost Server setup with enterprise test license (MM_SERVICEENVIRONMENT=test required)
  • npm install workarounds for Linux (missing iOS tooling)
  • APK installation fast-path using adb push + pm install + dex optimization
  • Emulator interaction: mobile-mcp recommended, computerUse subagent alternative, REST API fallback
  • Docker daemon startup instructions

Ticket Link

N/A — environment setup documentation

Checklist

  • Added or updated unit tests (required for all new features)

Device Information

This PR was tested on: Android API 28 emulator (x86_64, software emulation) on Linux Cloud VM

Screenshots

Mattermost app showing hello world message in Town Square

Release Note

NONE
Open in Web Open in Cursor 

- Android SDK setup and emulator configuration (API 28, software emulation)
- Docker-based Mattermost Server setup with enterprise license
- npm install workarounds for missing iOS tooling on Linux
- APK installation fast-path using adb push + pm install
- ADB interaction notes for React Native TextInput limitations

Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

Coverage Comparison Report

Generated on April 13, 2026 at 20:29:31 UTC

+-----------------+------------+------------+-----------+
| Metric          | Main       | This PR    | Diff      |
+-----------------+------------+------------+-----------+
| Lines           |     85.13% |     85.13% |     0.00% |
| Statements      |     84.99% |     84.99% |     0.00% |
| Branches        |     72.18% |     72.18% |     0.00% |
| Functions       |     83.97% |     83.97% |     0.00% |
+-----------------+------------+------------+-----------+
| Total           |     81.56% |     81.56% |     0.00% |
+-----------------+------------+------------+-----------+

cursoragent and others added 3 commits April 13, 2026 19:59
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
…tructions

- Document mobile-mcp as recommended interaction method
- Add computerUse subagent 100-image limit caveat
- Add REST API fallback for posting messages
- Add Docker daemon startup instructions

Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
Cloud-specific instructions are stored in AGENTS.CLOUD.md and only
copied to AGENTS.md by the VM update script, so they don't affect
local developer setups.

Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
@nickmisasi nickmisasi marked this pull request as ready for review April 13, 2026 20:21
@nickmisasi nickmisasi requested a review from enahum April 13, 2026 20:21
@nickmisasi
Copy link
Copy Markdown
Contributor Author

@enahum for context: this file is used by the Cursor Cloud Agents to help with environment setup - let's them run the mobile app directly in their cloud sandbox to test but fixes, record walk throughs of them, etc.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

A new documentation file AGENTS.CLOUD.md is added to provide Cursor Cloud-specific operating instructions for the Mattermost Mobile React Native app, including environment setup, toolchain configuration, build commands, emulator setup, and testing guidance.

Changes

Cohort / File(s) Summary
Cloud Documentation
AGENTS.CLOUD.md
New documentation file providing Cursor Cloud VM environment constraints, build and test workflows, Android emulator configuration, APK installation approaches, Docker server setup instructions, and practical development guidance for the React Native codebase.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title states 'Add AGENTS.md for Cursor Cloud development environment' but the file added is actually 'AGENTS.CLOUD.md', not 'AGENTS.md'. The title is misleading about the actual filename being introduced. Update the title to accurately reflect the added file: 'Add AGENTS.CLOUD.md for Cursor Cloud development environment' to match the actual changeset.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the purpose of the new AGENTS.CLOUD.md file, the rationale for the filename, and documents the key content areas including Android SDK setup, Docker configuration, emulator interaction, and npm workarounds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/env-setup-f815

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
AGENTS.CLOUD.md (1)

80-80: Pin Docker image to a stable tag (or digest)

Line 80 uses mattermost/mattermost-enterprise-edition:master, which is non-reproducible and can break setup as upstream moves. Pin to a known version (or digest).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.CLOUD.md` at line 80, Replace the floating Docker tag
mattermost/mattermost-enterprise-edition:master with a pinned immutable
reference; update the image string to a specific release tag (e.g.,
mattermost/mattermost-enterprise-edition:vX.Y.Z) or better yet a content digest
(sha256:...) so the deployment is reproducible, and document the chosen
tag/digest and its upstream release date in the same section for future updates.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@AGENTS.CLOUD.md`:
- Around line 1-3: Update the top headers so they match the file name and use
consistent hyphenation: change the main header text "# AGENTS.md" to "#
AGENTS.CLOUD.md" and change the subheader "## Cursor Cloud specific
instructions" to "## Cursor Cloud-specific instructions" so the document title
and the Cloud-specific phrasing are consistent with the filename and style.
- Line 112: Replace the instruction that recommends running `chmod 666
/var/run/docker.sock` with guidance to avoid world-writable socket permissions:
advise adding the user to the `docker` group (e.g., `usermod -aG docker
<user>`), or configuring rootless Docker, or using more secure socket ACLs
(e.g., `setfacl`) or chown to the `docker` group so only authorized users can
access `/var/run/docker.sock`; explicitly state not to use `chmod 666` and
include a short note about security risks.

---

Nitpick comments:
In `@AGENTS.CLOUD.md`:
- Line 80: Replace the floating Docker tag
mattermost/mattermost-enterprise-edition:master with a pinned immutable
reference; update the image string to a specific release tag (e.g.,
mattermost/mattermost-enterprise-edition:vX.Y.Z) or better yet a content digest
(sha256:...) so the deployment is reproducible, and document the chosen
tag/digest and its upstream release date in the same section for future updates.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b4cc8c5d-4fd3-40fe-a0ad-069c2000a829

📥 Commits

Reviewing files that changed from the base of the PR and between 8d68b1b and d4920ed.

📒 Files selected for processing (1)
  • AGENTS.CLOUD.md

Comment thread AGENTS.CLOUD.md
Comment on lines +1 to +3
# AGENTS.md

## Cursor Cloud specific instructions
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Align heading with actual file name and hyphenation

Line 1 says # AGENTS.md in AGENTS.CLOUD.md, and Line 3 should read “Cloud-specific” for consistency/readability.

Suggested doc change
-# AGENTS.md
+# AGENTS.CLOUD.md

-## Cursor Cloud specific instructions
+## Cursor Cloud-specific instructions
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# AGENTS.md
## Cursor Cloud specific instructions
# AGENTS.CLOUD.md
## Cursor Cloud-specific instructions
🧰 Tools
🪛 LanguageTool

[uncategorized] ~3-~3: When ‘Cloud-specific’ is used as a modifier, it is usually spelled with a hyphen.
Context: # AGENTS.md ## Cursor Cloud specific instructions ### Environment Overview ...

(SPECIFIC_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.CLOUD.md` around lines 1 - 3, Update the top headers so they match the
file name and use consistent hyphenation: change the main header text "#
AGENTS.md" to "# AGENTS.CLOUD.md" and change the subheader "## Cursor Cloud
specific instructions" to "## Cursor Cloud-specific instructions" so the
document title and the Cloud-specific phrasing are consistent with the filename
and style.

Comment thread AGENTS.CLOUD.md
SESSION_NAME="dockerd"
tmux -f /exec-daemon/tmux.portal.conf new-session -d -s "$SESSION_NAME" -- sudo dockerd
```
After starting, fix socket permissions: `sudo chmod 666 /var/run/docker.sock`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid world-writable Docker socket permissions

Line 112 recommends chmod 666 /var/run/docker.sock, which weakens host security significantly. Prefer group-based access instead (docker group) or rootless Docker.

Suggested doc change
-After starting, fix socket permissions: `sudo chmod 666 /var/run/docker.sock`
+After starting, prefer group-based Docker access instead of opening the socket to all users:
+`sudo usermod -aG docker "$USER"` (then re-login), or run Docker in rootless mode.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
After starting, fix socket permissions: `sudo chmod 666 /var/run/docker.sock`
After starting, prefer group-based Docker access instead of opening the socket to all users:
`sudo usermod -aG docker "$USER"` (then re-login), or run Docker in rootless mode.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.CLOUD.md` at line 112, Replace the instruction that recommends running
`chmod 666 /var/run/docker.sock` with guidance to avoid world-writable socket
permissions: advise adding the user to the `docker` group (e.g., `usermod -aG
docker <user>`), or configuring rootless Docker, or using more secure socket
ACLs (e.g., `setfacl`) or chown to the `docker` group so only authorized users
can access `/var/run/docker.sock`; explicitly state not to use `chmod 666` and
include a short note about security risks.

@nickmisasi
Copy link
Copy Markdown
Contributor Author

@coderabbitai resolve

These are specific instructions for a sandbox environment.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

Tip

For best results, initiate chat on the files or code changes.

@nickmisasi Understood — resolving all comments. Thanks for the context that these are tailored instructions for the Cursor Cloud sandbox environment, not general developer guidance.

[resolve]

Copy link
Copy Markdown
Contributor

@enahum enahum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments, give me your feedback

Comment thread AGENTS.CLOUD.md
Comment thread AGENTS.CLOUD.md
| Lint | `npm run lint` |
| TypeScript check | `npm run tsc` |
| Auto-fix lint | `npm run fix` |
| Unit tests | `npm run test` |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm test

Comment thread AGENTS.CLOUD.md
### Android SDK

- Installed at `/opt/android-sdk` with env vars in `~/.bashrc` (`ANDROID_HOME`, `ANDROID_SDK_ROOT`, `JAVA_HOME`, `PATH`).
- SDK components: platform-tools, platforms;android-35, build-tools;35.0.0, ndk;27.1.12297006, emulator, system-images;android-28;default;x86_64.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to read the tools and ndk versions from the gradle file as they will change in time

Comment thread AGENTS.CLOUD.md
Comment thread AGENTS.CLOUD.md

### Test Notes

- Jest tests: 551/552 suites pass. 2 snapshot failures in `app/components/formatted_date/index.test.tsx` for the `ko` locale are a pre-existing Node.js `Intl` formatting difference (Korean meridiem `오전` vs `AM`), not a code issue.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Careful with this, we want to continue adding tests

Comment thread AGENTS.CLOUD.md
- Jest tests: 551/552 suites pass. 2 snapshot failures in `app/components/formatted_date/index.test.tsx` for the `ko` locale are a pre-existing Node.js `Intl` formatting difference (Korean meridiem `오전` vs `AM`), not a code issue.
- Build for Android with `-PreactNativeArchitectures=x86_64` to speed up builds (only targets the emulator arch).

### Interacting with the Emulator
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you looked into integrating this with Maestro? Perhaps ot could write the end to end tests with Maestro and just run them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants