chore: add shared devin workspace tooling

This commit is contained in:
defiQUG
2026-04-25 12:42:36 -07:00
parent 2b5a039931
commit 529f819b0f
8 changed files with 175 additions and 0 deletions

18
.devin/README.md Normal file
View File

@@ -0,0 +1,18 @@
# Devin for Terminal in Cursor
This project is configured to use Devin for Terminal as a local CLI companion inside Cursor.
- Cursor config import is enabled through `.cursor/rules/` and `.cursor/mcp.json` if present.
- Windsurf config import is disabled for this project.
- `AGENTS.md` remains the canonical shared project guidance.
- Personal Devin overrides and secrets belong in `.devin/config.local.json`, which is gitignored.
- Run `devin auth login` interactively before first use.
Useful commands:
```bash
devin
devin -- "review this repo and suggest the next safe task"
devin auth status
devin mcp list
```

View File

@@ -0,0 +1,21 @@
---
name: reviewer
description: Read-only reviewer for Cursor/Devin handoffs
allowed-tools:
- read
- grep
- glob
- exec
permissions:
allow:
- Exec(git status)
- Exec(git diff)
- Exec(git log)
deny:
- write
- edit
---
You are a read-only review subagent for this Cursor workspace.
Review changes for correctness, security, operational risk, and consistency with `AGENTS.md` and relevant `.cursor/rules/` guidance. Do not modify files. Report only actionable findings first, ordered by severity, with exact file paths.

38
.devin/config.json Normal file
View File

@@ -0,0 +1,38 @@
{
// Devin for Terminal project config optimized for Cursor as the primary IDE.
"read_config_from": {
"cursor": true,
"windsurf": false,
"claude": true
},
"permissions": {
"allow": [
"Read(**)",
"Exec(git status)",
"Exec(git diff)",
"Exec(git log)",
"Exec(pnpm run)",
"Exec(bash scripts/verify)",
"Exec(bash scripts/validation)"
],
"ask": [
"Write(**)",
"Exec(git commit)",
"Exec(git push)",
"Exec(docker)",
"Exec(docker compose)",
"mcp__*"
],
"deny": [
"Exec(rm)",
"Exec(sudo)",
"Exec(chmod -R)",
"Exec(chown -R)",
"Write(.env*)",
"Write(**/.env*)",
"Write(reports/secrets/**)",
"Write(config/production/*did-secrets.env)"
]
},
"mcpServers": {}
}

14
.devin/hooks.v1.json Normal file
View File

@@ -0,0 +1,14 @@
{
"PreToolUse": [
{
"matcher": "exec",
"hooks": [
{
"type": "command",
"command": "bash scripts/devin/block-dangerous-command.sh",
"timeout": 10
}
]
}
]
}

View File

@@ -0,0 +1,22 @@
---
name: cursor-handoff
description: Align Devin for Terminal work with this Cursor workspace and project rules
allowed-tools:
- read
- grep
- glob
- exec
triggers:
- user
- model
---
Use this skill when starting or resuming work in this repository from Devin for Terminal.
1. Treat Cursor as the primary IDE context and read `.cursor/rules/` when relevant.
2. Read `AGENTS.md` first for canonical project guidance.
3. Do not rely on Windsurf rules, skills, workflows, or MCP settings for this project.
4. Check `git status --short` before editing and preserve unrelated user changes.
5. Prefer dry-run flags for operator, deployment, DNS, Proxmox, and LAN-sensitive scripts.
6. Never write secrets or runtime credentials into tracked files.
7. When using MCP servers, assume Cursor and Devin maintain separate authentication sessions.

View File

@@ -0,0 +1,28 @@
---
name: review
description: Review code changes before commit or handoff
allowed-tools:
- read
- grep
- glob
- exec
permissions:
allow:
- Exec(git status)
- Exec(git diff)
- Exec(git log)
deny:
- write
- edit
triggers:
- user
- model
---
Review the current changes with a correctness-first stance.
1. Run `git status --short`.
2. Run `git diff` and, if staged changes exist, `git diff --staged`.
3. Focus on bugs, security regressions, deployment risk, missing validation, and secret exposure.
4. Cite exact file paths and keep findings ordered by severity.
5. If no issues are found, say so and call out any test or validation gaps.

3
.gitignore vendored
View File

@@ -26,6 +26,9 @@ Thumbs.db
# Local-only Cursor session / context (exclude from Gitea)
.cursor/local/
# Devin for Terminal personal overrides / secrets
.devin/config.local.json
# IDE files
.vscode/
.idea/

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
payload_json="$(cat)"
PAYLOAD_JSON="$payload_json" python3 - <<'PY'
import json
import os
import re
import sys
payload = json.loads(os.environ.get("PAYLOAD_JSON", "{}"))
command = str(payload.get("tool_input", {}).get("command", "")).strip()
blocked = [
(r"(^|\s)rm\s+-[^;&|]*[rf]", "Recursive or forced removal must be reviewed manually."),
(r"(^|\s)sudo(\s|$)", "sudo is blocked for Devin sessions in this workspace."),
(r"(^|\s)git\s+reset\s+--hard(\s|$)", "Hard resets can discard user work."),
(r"(^|\s)git\s+checkout\s+--(\s|$)", "Checkout restore can discard user work."),
(r"(^|\s)git\s+clean(\s|$)", "git clean can delete untracked user work."),
(r"(^|\s)chmod\s+-R(\s|$)", "Recursive chmod is too broad for an automated hook."),
(r"(^|\s)chown\s+-R(\s|$)", "Recursive chown is too broad for an automated hook."),
]
for pattern, reason in blocked:
if re.search(pattern, command):
print(json.dumps({"decision": "block", "reason": reason}))
sys.exit(2)
sys.exit(0)
PY