From a24f465c4670790e929ac37ff8623092891c0fe6 Mon Sep 17 00:00:00 2001 From: mAi Date: Sun, 1 Feb 2026 00:13:07 +0100 Subject: [PATCH] Initial mVP setup with Gitea Action workflow - README with usage instructions - Gitea Action to handle issues via SSH to VPS - Supports skill hints in issue body (skill: role-pa, etc) - Labels: urgent, research, writing, code, waiting --- .gitea/workflows/handle-issue.yaml | 74 ++++++++++++++++++++++++++++++ README.md | 51 +++++++++++++++++++- 2 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/handle-issue.yaml diff --git a/.gitea/workflows/handle-issue.yaml b/.gitea/workflows/handle-issue.yaml new file mode 100644 index 0000000..9a31393 --- /dev/null +++ b/.gitea/workflows/handle-issue.yaml @@ -0,0 +1,74 @@ +name: Handle Issue with mAi + +on: + issues: + types: [opened, labeled] + +jobs: + handle-issue: + runs-on: ubuntu-latest + if: > + github.event.action == 'opened' || + (github.event.action == 'labeled' && github.event.label.name == 'urgent') + + steps: + - name: Process issue with mAi + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.VPS_HOST }} + username: ${{ secrets.VPS_USER }} + key: ${{ secrets.VPS_SSH_KEY }} + port: ${{ secrets.VPS_PORT }} + script: | + # Source environment + source ~/.config/mai/gitea.env + export PATH="$HOME/.nix-profile/bin:$HOME/.local/bin:$PATH" + + # Issue details + REPO="${{ github.repository }}" + ISSUE_NUMBER="${{ github.event.issue.number }}" + ISSUE_TITLE="${{ github.event.issue.title }}" + + # Comment that we're starting + curl -s -X POST -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{"body":"🤖 mAi is on it..."}' \ + "$GITEA_URL/api/v1/repos/$REPO/issues/$ISSUE_NUMBER/comments" + + # Add in-progress label + curl -s -X POST -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{"labels":["in-progress"]}' \ + "$GITEA_URL/api/v1/repos/$REPO/issues/$ISSUE_NUMBER/labels" || true + + # Get full issue body + ISSUE_BODY=$(curl -s -H "Authorization: token $GITEA_TOKEN" \ + "$GITEA_URL/api/v1/repos/$REPO/issues/$ISSUE_NUMBER" | jq -r '.body // ""') + + # Extract skill hint if present + SKILL=$(echo "$ISSUE_BODY" | grep -oP 'skill:\s*\K\S+' | head -1) + SKILL_PROMPT="" + if [ -n "$SKILL" ]; then + SKILL_PROMPT="Use the /$SKILL skill. " + fi + + # Run Claude + cd ~/dev + claude -p "${SKILL_PROMPT}You are mAi, a personal AI assistant. + + Work on this task: $REPO#$ISSUE_NUMBER + Title: $ISSUE_TITLE + + $ISSUE_BODY + + Complete the task and post your results as a comment on the issue. + Use the Gitea API: POST $GITEA_URL/api/v1/repos/$REPO/issues/$ISSUE_NUMBER/comments + with body: {\"body\": \"your response here\"} + + When done, remove the in-progress label and add 'done' label." \ + --dangerously-skip-permissions \ + 2>&1 | tee -a ~/dev/mAI/worker/action.log + + # Fallback: remove in-progress if still there + curl -s -X DELETE -H "Authorization: token $GITEA_TOKEN" \ + "$GITEA_URL/api/v1/repos/$REPO/issues/$ISSUE_NUMBER/labels/in-progress" || true diff --git a/README.md b/README.md index 9150f5d..368a6bc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,50 @@ -# mVP +# mVP - m Vice President -m Vice President - Personal AI Assistant \ No newline at end of file +Your personal AI assistant. Create issues, mAi handles them. + +## How It Works + +1. **Create an issue** describing what you need +2. **mAi picks it up** (via webhook or scheduled run) +3. **Work gets done** - research, writing, code, whatever +4. **Results posted** as comments or linked PRs + +## Issue Format + +Just describe what you need. Optionally add labels or skill hints: + +```markdown +Title: Research best practices for X + +skill: role-researcher + +Find and summarize the top 3 approaches to X... +``` + +## Skills + +Specify in issue body with `skill: ` or use labels: + +| Skill | Use For | +|-------|---------| +| `role-pa` | Emails, scheduling, organization | +| `role-researcher` | Deep research and analysis | +| `role-coder` | Code and technical tasks | +| `web` | Web research and fetching | +| `analyze` | Data analysis | + +## Labels + +- `urgent` - Process first +- `research` - Research task +- `writing` - Writing/drafting +- `code` - Programming +- `waiting` - Skip for now (needs input) + +## Examples + +**Research:** "Compare cloud providers for small startup" + +**Writing:** "Draft weekly update email for project X" + +**Code:** "Create Python script to parse sales.csv"