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
This commit is contained in:
mAi
2026-02-01 00:13:07 +01:00
parent 2838c9b152
commit a24f465c46
2 changed files with 123 additions and 2 deletions

View File

@@ -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

View File

@@ -1,3 +1,50 @@
# mVP
# mVP - m Vice President
m Vice President - Personal AI Assistant
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: <name>` 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"