Skip to content

Latest commit

 

History

History
96 lines (67 loc) · 2.59 KB

File metadata and controls

96 lines (67 loc) · 2.59 KB

AI_LOOP — Using OpenCode with nextcloud-deploy

Overview

This document describes how to safely and effectively use OpenCode (or other AI coding assistants) with this repository. The goal is to avoid accidental modifications to sensitive files while making productive changes.

Safe Workflow

1. Start a Session

opencode
# or on a specific task:
opencode --prompt "Add a backup script to this project"

2. Before Asking the AI

  • Ensure the working tree is clean: git status
  • If you have uncommitted work, either commit it or stash it before asking for AI help.
  • Know which files you want the AI to touch (and which it must NOT touch).

3. Tell the AI

Always include relevant context from AGENTS.md in your prompt, or reference these files explicitly:

Read AGENTS.md first. Then read PROJECT_STATUS.md, ROADMAP.md, and SECURITY_REVIEW.md.
Do NOT modify .env, data/, or existing scripts/*.sh (init-env.sh, create-band-structure.sh).

4. After the AI Makes Changes

scripts/ai-test.sh        # validate everything
git diff                   # review changes carefully
git diff --stat            # quick file summary

5. Commit (Only When Ready)

git add <intended files>
git commit -m "description of change"

Never commit .env or data files.

Scripts Reference

Script Purpose
scripts/ai-test.sh Validate compose files + lint shell scripts
scripts/ai-task.sh Run OpenCode with a task description, guided by AGENTS.md
scripts/ai-review.sh Review current diff with OpenCode without editing

Example Prompts

Quick Fix

Read AGENTS.md. The docker-compose.yml has no healthcheck for the app service.
Add one: check http://localhost:80/status.php every 30s. Do NOT modify anything else.
Run scripts/ai-test.sh after making the change.

Feature Request

Read AGENTS.md and ROADMAP.md. Implement a backup script (scripts/backup.sh) that:
- Dumps the MariaDB database using mysqldump
- Tars the nextcloud data directory
- Saves to ./backups/ with a timestamp
- Rotates backups older than 14 days
Run scripts/ai-test.sh after.

Security Review

Read AGENTS.md and SECURITY_REVIEW.md. Review the docker-compose.yml for any security
issues. Report what you find without making any changes.

Files the AI Must Never Touch

  • .env (secrets, gitignored)
  • data/ (runtime state, gitignored)
  • .git/ (version control internals)

Files the AI Should Generally Not Touch

  • scripts/init-env.sh
  • scripts/create-band-structure.sh

Unless the user explicitly asks you to modify them.