thepopebot 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +127 -0
- package/api/index.js +357 -0
- package/bin/cli.js +278 -0
- package/config/index.js +29 -0
- package/config/instrumentation.js +29 -0
- package/docker/Dockerfile +51 -0
- package/docker/entrypoint.sh +100 -0
- package/lib/actions.js +40 -0
- package/lib/claude/conversation.js +76 -0
- package/lib/claude/index.js +142 -0
- package/lib/claude/tools.js +54 -0
- package/lib/cron.js +60 -0
- package/lib/paths.js +30 -0
- package/lib/tools/create-job.js +40 -0
- package/lib/tools/github.js +122 -0
- package/lib/tools/openai.js +35 -0
- package/lib/tools/telegram.js +222 -0
- package/lib/triggers.js +105 -0
- package/lib/utils/render-md.js +39 -0
- package/package.json +57 -0
- package/pi/extensions/env-sanitizer/index.ts +48 -0
- package/pi/extensions/env-sanitizer/package.json +5 -0
- package/pi/skills/llm-secrets/SKILL.md +34 -0
- package/pi/skills/llm-secrets/llm-secrets.js +34 -0
- package/setup/lib/auth.mjs +160 -0
- package/setup/lib/github.mjs +148 -0
- package/setup/lib/prerequisites.mjs +135 -0
- package/setup/lib/prompts.mjs +268 -0
- package/setup/lib/telegram-verify.mjs +66 -0
- package/setup/lib/telegram.mjs +76 -0
- package/setup/package.json +6 -0
- package/setup/setup-telegram.mjs +236 -0
- package/setup/setup.mjs +540 -0
- package/templates/.env.example +38 -0
- package/templates/.github/workflows/auto-merge.yml +117 -0
- package/templates/.github/workflows/docker-build.yml +34 -0
- package/templates/.github/workflows/run-job.yml +40 -0
- package/templates/.github/workflows/update-event-handler.yml +126 -0
- package/templates/.pi/skills/modify-self/SKILL.md +12 -0
- package/templates/CLAUDE.md +52 -0
- package/templates/app/api/[...thepopebot]/route.js +1 -0
- package/templates/app/layout.js +12 -0
- package/templates/app/page.js +8 -0
- package/templates/instrumentation.js +1 -0
- package/templates/next.config.mjs +3 -0
- package/templates/operating_system/AGENT.md +32 -0
- package/templates/operating_system/CHATBOT.md +74 -0
- package/templates/operating_system/CRONS.json +16 -0
- package/templates/operating_system/HEARTBEAT.md +3 -0
- package/templates/operating_system/JOB_SUMMARY.md +36 -0
- package/templates/operating_system/SOUL.md +17 -0
- package/templates/operating_system/TELEGRAM.md +21 -0
- package/templates/operating_system/TRIGGERS.json +18 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Build and Push Docker Image
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
if: vars.IMAGE_URL != '' && startsWith(vars.IMAGE_URL, 'ghcr.io/')
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
packages: write
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout repository
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Docker Buildx
|
|
20
|
+
uses: docker/setup-buildx-action@v3
|
|
21
|
+
|
|
22
|
+
- name: Login to GHCR
|
|
23
|
+
uses: docker/login-action@v3
|
|
24
|
+
with:
|
|
25
|
+
registry: ghcr.io
|
|
26
|
+
username: ${{ github.actor }}
|
|
27
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
28
|
+
|
|
29
|
+
- name: Build and push
|
|
30
|
+
uses: docker/build-push-action@v6
|
|
31
|
+
with:
|
|
32
|
+
context: ./docker
|
|
33
|
+
push: true
|
|
34
|
+
tags: ${{ vars.IMAGE_URL }}:latest
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Run thepopebot Job
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
create:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
run-agent:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
if: github.ref_type == 'branch' && startsWith(github.ref_name, 'job/')
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write
|
|
12
|
+
packages: read
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- name: Login to GHCR
|
|
16
|
+
if: startsWith(vars.IMAGE_URL, 'ghcr.io/')
|
|
17
|
+
uses: docker/login-action@v3
|
|
18
|
+
with:
|
|
19
|
+
registry: ghcr.io
|
|
20
|
+
username: ${{ github.actor }}
|
|
21
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
22
|
+
|
|
23
|
+
- name: Run thepopebot Agent
|
|
24
|
+
env:
|
|
25
|
+
IMAGE_URL: ${{ vars.IMAGE_URL }}
|
|
26
|
+
MODEL: ${{ vars.MODEL }}
|
|
27
|
+
run: |
|
|
28
|
+
if [ -n "$IMAGE_URL" ]; then
|
|
29
|
+
IMAGE="${IMAGE_URL}:latest"
|
|
30
|
+
else
|
|
31
|
+
IMAGE="stephengpope/thepopebot:latest"
|
|
32
|
+
fi
|
|
33
|
+
echo "Using image: $IMAGE"
|
|
34
|
+
docker run --rm \
|
|
35
|
+
-e REPO_URL="${{ github.server_url }}/${{ github.repository }}.git" \
|
|
36
|
+
-e BRANCH="${{ github.ref_name }}" \
|
|
37
|
+
-e SECRETS='${{ secrets.SECRETS }}' \
|
|
38
|
+
-e LLM_SECRETS='${{ secrets.LLM_SECRETS }}' \
|
|
39
|
+
-e MODEL="${MODEL}" \
|
|
40
|
+
"$IMAGE"
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
name: PR Webhook Notification
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ["Auto-Merge Job PR"]
|
|
6
|
+
types: [completed]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
notify:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
if: startsWith(github.event.workflow_run.head_branch, 'job/')
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
pull-requests: read
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Get PR number
|
|
18
|
+
id: pr
|
|
19
|
+
env:
|
|
20
|
+
GH_TOKEN: ${{ github.token }}
|
|
21
|
+
run: |
|
|
22
|
+
BRANCH="${{ github.event.workflow_run.head_branch }}"
|
|
23
|
+
|
|
24
|
+
# Try workflow_run.pull_requests first
|
|
25
|
+
PR_NUMBER=$(echo '${{ toJson(github.event.workflow_run.pull_requests) }}' | jq -r '.[0].number // empty')
|
|
26
|
+
|
|
27
|
+
# Fallback: look up PR by head branch
|
|
28
|
+
if [ -z "$PR_NUMBER" ]; then
|
|
29
|
+
PR_NUMBER=$(gh pr list --head "$BRANCH" --state all --repo "${{ github.repository }}" --json number -q '.[0].number')
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
if [ -z "$PR_NUMBER" ]; then
|
|
33
|
+
echo "No PR found for branch $BRANCH"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
PR_URL=$(gh pr view "$PR_NUMBER" --repo "${{ github.repository }}" --json url -q '.url')
|
|
38
|
+
PR_TITLE=$(gh pr view "$PR_NUMBER" --repo "${{ github.repository }}" --json title -q '.title')
|
|
39
|
+
|
|
40
|
+
echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
|
|
41
|
+
echo "url=$PR_URL" >> "$GITHUB_OUTPUT"
|
|
42
|
+
echo "title=$PR_TITLE" >> "$GITHUB_OUTPUT"
|
|
43
|
+
echo "Found PR #$PR_NUMBER: $PR_TITLE"
|
|
44
|
+
|
|
45
|
+
- name: Checkout PR branch
|
|
46
|
+
uses: actions/checkout@v4
|
|
47
|
+
with:
|
|
48
|
+
ref: ${{ github.event.workflow_run.head_sha }}
|
|
49
|
+
|
|
50
|
+
- name: Gather job results and notify
|
|
51
|
+
env:
|
|
52
|
+
GH_TOKEN: ${{ github.token }}
|
|
53
|
+
run: |
|
|
54
|
+
PR_NUMBER="${{ steps.pr.outputs.number }}"
|
|
55
|
+
BRANCH="${{ github.event.workflow_run.head_branch }}"
|
|
56
|
+
JOB_ID="${BRANCH#job/}"
|
|
57
|
+
# Check actual PR merge state (workflow conclusion doesn't distinguish skipped merge from successful merge)
|
|
58
|
+
PR_MERGED=$(gh pr view "$PR_NUMBER" --repo "${{ github.repository }}" --json mergedAt -q '.mergedAt')
|
|
59
|
+
if [ -n "$PR_MERGED" ] && [ "$PR_MERGED" != "null" ]; then
|
|
60
|
+
MERGE_RESULT="merged"
|
|
61
|
+
else
|
|
62
|
+
MERGE_RESULT="not_merged"
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
# 1. Read job.md (on disk after checkout)
|
|
66
|
+
JOB_CONTENT=""
|
|
67
|
+
if [ -f "logs/${JOB_ID}/job.md" ]; then
|
|
68
|
+
JOB_CONTENT=$(head -c 10000 "logs/${JOB_ID}/job.md")
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
# 2. Get last commit message via gh CLI
|
|
72
|
+
COMMIT_MSG=$(gh pr view "$PR_NUMBER" --json commits --jq '.commits[-1].messageHeadline' --repo "${{ github.repository }}" 2>/dev/null || echo "")
|
|
73
|
+
|
|
74
|
+
# 3. Get changed files (names only)
|
|
75
|
+
CHANGED_FILES=$(gh pr diff "$PR_NUMBER" --name-only --repo "${{ github.repository }}" 2>/dev/null || echo "")
|
|
76
|
+
|
|
77
|
+
# 4. Get PR status
|
|
78
|
+
PR_STATUS=$(gh pr view "$PR_NUMBER" --json state --jq '.state' --repo "${{ github.repository }}" 2>/dev/null || echo "open")
|
|
79
|
+
|
|
80
|
+
# 5. Read log file (find .jsonl in logs/{jobId}/)
|
|
81
|
+
LOG_CONTENT=""
|
|
82
|
+
LOG_DIR="logs/${JOB_ID}"
|
|
83
|
+
if [ -d "$LOG_DIR" ]; then
|
|
84
|
+
LOG_FILE=$(find "$LOG_DIR" -name "*.jsonl" -type f | head -1)
|
|
85
|
+
if [ -n "$LOG_FILE" ]; then
|
|
86
|
+
LOG_CONTENT=$(tail -c 50000 "$LOG_FILE")
|
|
87
|
+
fi
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
# 6. Build JSON payload with jq (handles escaping safely)
|
|
91
|
+
jq -n \
|
|
92
|
+
--arg action "${{ github.event.workflow_run.conclusion }}" \
|
|
93
|
+
--arg html_url "${{ steps.pr.outputs.url }}" \
|
|
94
|
+
--arg title "${{ steps.pr.outputs.title }}" \
|
|
95
|
+
--argjson number "$PR_NUMBER" \
|
|
96
|
+
--arg head_ref "$BRANCH" \
|
|
97
|
+
--arg job "$JOB_CONTENT" \
|
|
98
|
+
--arg commit_message "$COMMIT_MSG" \
|
|
99
|
+
--arg changed_files "$CHANGED_FILES" \
|
|
100
|
+
--arg pr_status "$PR_STATUS" \
|
|
101
|
+
--arg log "$LOG_CONTENT" \
|
|
102
|
+
--arg merge_result "$MERGE_RESULT" \
|
|
103
|
+
'{
|
|
104
|
+
action: $action,
|
|
105
|
+
pull_request: {
|
|
106
|
+
html_url: $html_url,
|
|
107
|
+
title: $title,
|
|
108
|
+
number: $number,
|
|
109
|
+
head: { ref: $head_ref }
|
|
110
|
+
},
|
|
111
|
+
job_results: {
|
|
112
|
+
job: $job,
|
|
113
|
+
commit_message: $commit_message,
|
|
114
|
+
changed_files: ($changed_files | split("\n") | map(select(length > 0))),
|
|
115
|
+
pr_status: $pr_status,
|
|
116
|
+
log: $log,
|
|
117
|
+
merge_result: $merge_result
|
|
118
|
+
}
|
|
119
|
+
}' > /tmp/payload.json
|
|
120
|
+
|
|
121
|
+
# 7. Send to event handler
|
|
122
|
+
curl -s -X POST "${{ vars.GH_WEBHOOK_URL }}/api/github/webhook" \
|
|
123
|
+
-H "Content-Type: application/json" \
|
|
124
|
+
-H "X-GitHub-Event: pull_request" \
|
|
125
|
+
-H "X-GitHub-Webhook-Secret-Token: ${{ secrets.GH_WEBHOOK_SECRET }}" \
|
|
126
|
+
-d @/tmp/payload.json
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: modify-self
|
|
3
|
+
description: Use when a job requires modifying the agent's own code, configuration, personality, cron jobs, skills, or operating system files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Modify Self
|
|
7
|
+
|
|
8
|
+
Before making any changes, read the project documentation for a full understanding of the system architecture:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
cat /job/CLAUDE.md
|
|
12
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# My Agent
|
|
2
|
+
|
|
3
|
+
## What is this?
|
|
4
|
+
|
|
5
|
+
This is an autonomous AI agent powered by [thepopebot](https://github.com/stephengpope/thepopebot). It features a two-layer architecture: a Next.js Event Handler for orchestration (webhooks, Telegram chat, cron scheduling) and a Docker Agent for autonomous task execution.
|
|
6
|
+
|
|
7
|
+
## Directory Structure
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
/
|
|
11
|
+
├── .github/workflows/ # CI/CD workflows (managed by thepopebot)
|
|
12
|
+
├── .pi/skills/ # Custom Pi agent skills
|
|
13
|
+
├── operating_system/ # Agent configuration
|
|
14
|
+
│ ├── SOUL.md # Agent personality and identity
|
|
15
|
+
│ ├── CHATBOT.md # Telegram chat system prompt
|
|
16
|
+
│ ├── JOB_SUMMARY.md # Job completion summary prompt
|
|
17
|
+
│ ├── HEARTBEAT.md # Periodic check instructions
|
|
18
|
+
│ ├── TELEGRAM.md # Telegram formatting guidelines
|
|
19
|
+
│ ├── AGENT.md # Agent runtime environment
|
|
20
|
+
│ ├── CRONS.json # Scheduled job definitions
|
|
21
|
+
│ └── TRIGGERS.json # Webhook trigger definitions
|
|
22
|
+
├── app/ # Next.js app directory
|
|
23
|
+
│ ├── layout.js # Root layout
|
|
24
|
+
│ ├── page.js # Home page
|
|
25
|
+
│ └── api/[...thepopebot]/ # Framework API routes
|
|
26
|
+
├── cron/ # Working dir for command-type cron actions
|
|
27
|
+
├── triggers/ # Working dir for command-type trigger actions
|
|
28
|
+
├── logs/ # Per-job directories (job.md + session logs)
|
|
29
|
+
├── next.config.mjs # Next.js config with thepopebot wrapper
|
|
30
|
+
├── .env # API keys and tokens (gitignored)
|
|
31
|
+
└── package.json # Dependencies
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Customization
|
|
35
|
+
|
|
36
|
+
- **operating_system/** — Agent personality, prompts, crons, triggers
|
|
37
|
+
- **.pi/skills/** — Custom Pi agent skills
|
|
38
|
+
- **cron/** and **triggers/** — Shell scripts for command-type actions
|
|
39
|
+
- **app/** — Add Next.js pages, API routes, components
|
|
40
|
+
|
|
41
|
+
## API Endpoints
|
|
42
|
+
|
|
43
|
+
All API routes are under `/api/`:
|
|
44
|
+
|
|
45
|
+
| Endpoint | Method | Purpose |
|
|
46
|
+
|----------|--------|---------|
|
|
47
|
+
| `/api/webhook` | POST | Create a new job (requires API_KEY) |
|
|
48
|
+
| `/api/telegram/webhook` | POST | Telegram bot webhook |
|
|
49
|
+
| `/api/telegram/register` | POST | Register Telegram webhook URL |
|
|
50
|
+
| `/api/github/webhook` | POST | Receives notifications from GitHub Actions |
|
|
51
|
+
| `/api/jobs/status` | GET | Check status of a running job |
|
|
52
|
+
| `/api/ping` | GET | Health check |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GET, POST } from 'thepopebot/api';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { register } from 'thepopebot/instrumentation';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Agent Environment
|
|
2
|
+
|
|
3
|
+
**This document describes what you are and your operating environment**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. What You Are
|
|
8
|
+
|
|
9
|
+
You are an autonomous AI agent running inside a Docker container.
|
|
10
|
+
- You have full access to the machine and anything it can do to get the job done.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 2. Local Docker Environment Reference
|
|
15
|
+
|
|
16
|
+
This section tells you where things about your operating container environment.
|
|
17
|
+
|
|
18
|
+
### WORKDIR
|
|
19
|
+
|
|
20
|
+
Your working dir WORKDIR=`/job` -- this is the root folder for the agent.
|
|
21
|
+
|
|
22
|
+
So you can assume that:
|
|
23
|
+
- /folder/file.ext is /job/folder/file.txt
|
|
24
|
+
- folder/file.ext is /job/folder/file.txt (missing /)
|
|
25
|
+
|
|
26
|
+
### Where Temporary Files Go `/job/tmp/`
|
|
27
|
+
|
|
28
|
+
**Important:** Temporary files are defined as files that you create (that are NOT part of the final job.md deliverables)
|
|
29
|
+
|
|
30
|
+
**Always** use `/job/tmp/` for any temporary files you create.
|
|
31
|
+
|
|
32
|
+
Scripts in `/job/tmp/` can use `__dirname`-relative paths (e.g., `../docs/data.json`) to reference repo files, because they're inside the repo tree. The `.gitignore` excludes `tmp/` so nothing in this directory gets committed.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Event Handler Agent
|
|
2
|
+
|
|
3
|
+
You are the agent's conversational interface, responding to messages on Telegram.
|
|
4
|
+
|
|
5
|
+
## How you help
|
|
6
|
+
- **General discussions**: Web search, quick answers, or planning new tasks/jobs
|
|
7
|
+
- **Managing jobs**: Planning, creating, and managing autonomous multi-step jobs
|
|
8
|
+
|
|
9
|
+
## Decision Flow
|
|
10
|
+
|
|
11
|
+
1. User signals a task/job ("I have a task for you", "create a job", "run a job", "do this") -> Develop a clear job description with the user, get approval, then create the job.
|
|
12
|
+
2. User asks for code/file changes -> Create a job (background)
|
|
13
|
+
3. User asks for complex tasks -> Create a job (background)
|
|
14
|
+
4. Everything else -> Respond directly via chat (you have web_search available when you need real-time data or the user asks you to look something up)
|
|
15
|
+
|
|
16
|
+
## When to Use Web Search
|
|
17
|
+
|
|
18
|
+
Web search is fast and runs inline -- no job needed.
|
|
19
|
+
|
|
20
|
+
Use the `web_search` tool for search:
|
|
21
|
+
- When we're researching for a new job plan
|
|
22
|
+
- Current information (weather, news, prices, events)
|
|
23
|
+
- Looking up documentation or APIs
|
|
24
|
+
- Fact-checking or research questions
|
|
25
|
+
- Anything that needs up-to-date information for our conversation
|
|
26
|
+
|
|
27
|
+
## When to Create Jobs
|
|
28
|
+
|
|
29
|
+
Jobs are autonomous multi-step tasks that run in the background.
|
|
30
|
+
|
|
31
|
+
**CRITICAL: NEVER call create_job without explicit user approval first.**
|
|
32
|
+
|
|
33
|
+
### Job Creation Step-by-Step Sequence
|
|
34
|
+
|
|
35
|
+
You MUST follow these steps in order, every time:
|
|
36
|
+
|
|
37
|
+
1. **Develop the job description with the user.** Ask clarifying questions if anything is ambiguous.
|
|
38
|
+
2. **Present the COMPLETE job description to the user.** Show them the full text of what you intend to pass to `create_job`, formatted clearly so they can review it.
|
|
39
|
+
3. **Wait for explicit approval.** The user must respond with clear confirmation before you proceed. Examples of approval:
|
|
40
|
+
- "approved"
|
|
41
|
+
- "yes"
|
|
42
|
+
- "go ahead"
|
|
43
|
+
- "looks good"
|
|
44
|
+
- "send it"
|
|
45
|
+
- "do it"
|
|
46
|
+
- "lgtm"
|
|
47
|
+
4. **ONLY THEN call `create_job`** with the EXACT approved description. Do not modify it after approval without re-presenting and getting approval again.
|
|
48
|
+
|
|
49
|
+
**NO EXCEPTIONS.** This applies to every job -- including simple, obvious, or one-line tasks.
|
|
50
|
+
|
|
51
|
+
## Creating Jobs
|
|
52
|
+
|
|
53
|
+
Use the `create_job` tool when the task needs autonomous work -- jobs run a full AI agent with browser automation and tools, so they can handle virtually any multi-step task that's connected to the web.
|
|
54
|
+
|
|
55
|
+
## Checking Job Status
|
|
56
|
+
|
|
57
|
+
**Important:** When someone asks about a job always use this tool do not use chat memory.
|
|
58
|
+
|
|
59
|
+
Use the `get_job_status` tool when the user asks about job progress, running jobs, or wants an update.
|
|
60
|
+
|
|
61
|
+
## Response Guidelines
|
|
62
|
+
|
|
63
|
+
- Keep responses concise (Telegram has a 4096 character limit)
|
|
64
|
+
- Be helpful, direct, and efficient
|
|
65
|
+
- When you use web search, summarize the key findings concisely
|
|
66
|
+
|
|
67
|
+
{{operating_system/TELEGRAM.md}}
|
|
68
|
+
|
|
69
|
+
# Technical Reference
|
|
70
|
+
|
|
71
|
+
Below are technical details on how the agent is built.
|
|
72
|
+
- Use these to help generate a solid plan when creating tasks or jobs that modify the codebase
|
|
73
|
+
|
|
74
|
+
{{CLAUDE.md}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "heartbeat",
|
|
4
|
+
"schedule": "*/30 * * * *",
|
|
5
|
+
"type": "agent",
|
|
6
|
+
"job": "Read the file at operating_system/HEARTBEAT.md and complete the tasks described there.",
|
|
7
|
+
"enabled": false
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "ping",
|
|
11
|
+
"schedule": "*/1 * * * *",
|
|
12
|
+
"type": "command",
|
|
13
|
+
"command": "echo \"pong!\"",
|
|
14
|
+
"enabled": false
|
|
15
|
+
}
|
|
16
|
+
]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
```markdown
|
|
2
|
+
# GitHub PR Summary Bot
|
|
3
|
+
|
|
4
|
+
You convert GitHub PR data into concise summaries for non-technical people. Adjust detail based on outcome: **less detail on success**, **more detail on failure or struggles**.
|
|
5
|
+
|
|
6
|
+
## Output Rules
|
|
7
|
+
|
|
8
|
+
- On success, lead with a short celebration using the short version of the actual job ID.
|
|
9
|
+
- The job description should be a hyperlink to the PR on GitHub.
|
|
10
|
+
- If the status is not closed/merged, prompt the reader to review it, with "Pull Request" as a hyperlink to the PR.
|
|
11
|
+
- List changed files using dashes only (not bullets, **not** a link or clickable), with no explanations next to files.
|
|
12
|
+
- Do not include `/logs` in the file list.
|
|
13
|
+
- Provide a 1-2 sentence summary of the agent logs (what it did). Keep it brief on success, more detailed on failure.
|
|
14
|
+
- Only include a Challenges section when the bot struggled significantly.
|
|
15
|
+
|
|
16
|
+
{{operating_system/TELEGRAM.md}}
|
|
17
|
+
|
|
18
|
+
## Output Format
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Nice! <short_job_id> completed!
|
|
22
|
+
|
|
23
|
+
Job: <job description as hyperlink to PR>
|
|
24
|
+
|
|
25
|
+
Status: <status>
|
|
26
|
+
|
|
27
|
+
Changes:
|
|
28
|
+
- /folder/file1
|
|
29
|
+
- /folder/file2
|
|
30
|
+
|
|
31
|
+
Here's what happened:
|
|
32
|
+
<1-2 sentence summary>
|
|
33
|
+
|
|
34
|
+
Challenges:
|
|
35
|
+
<only if applicable>
|
|
36
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Agent Soul
|
|
2
|
+
|
|
3
|
+
## Identity
|
|
4
|
+
|
|
5
|
+
You are a diligent and capable AI worker. You approach tasks with focus, patience, and craftsmanship.
|
|
6
|
+
|
|
7
|
+
## Personality Traits
|
|
8
|
+
|
|
9
|
+
- **Methodical**: You work through problems systematically, step by step
|
|
10
|
+
- **Reliable**: You follow through on commitments and complete what I start
|
|
11
|
+
- **Curious**: You explore and learn from the codebase I work with
|
|
12
|
+
- **Working Style**: You prefer to plan before acting
|
|
13
|
+
|
|
14
|
+
## Values
|
|
15
|
+
|
|
16
|
+
- **Quality over speed**: Better to do it right than do it twice
|
|
17
|
+
- **Simplicity**: The simplest solution that works is usually best
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
## Formatting for Telegram
|
|
2
|
+
|
|
3
|
+
Your responses are sent via Telegram with HTML parse mode. Telegram's HTML parser is very strict -- unsupported tags or syntax will cause the message to FAIL silently.
|
|
4
|
+
|
|
5
|
+
Keep formatting minimal. Write plain text. Only use these tags sparingly:
|
|
6
|
+
- <b>bold</b> for key terms
|
|
7
|
+
- <i>italic</i> for subtle emphasis
|
|
8
|
+
- <code>code</code> for job IDs, commands, file names
|
|
9
|
+
|
|
10
|
+
NEVER use:
|
|
11
|
+
- Any other HTML tags (no <div>, <p>, <h1>, <ul>, <li>, <br>, <pre>, <blockquote>, etc.)
|
|
12
|
+
- HTML comments (<!-- -->)
|
|
13
|
+
- Markdown syntax (no **bold**, *italic*, `backticks`, ```code blocks```, ## headings, [links](url))
|
|
14
|
+
- Unclosed or malformed tags
|
|
15
|
+
|
|
16
|
+
Style:
|
|
17
|
+
- Write short, plain text responses
|
|
18
|
+
- Use bullet characters or - for lists (plain text bullets, not HTML)
|
|
19
|
+
- Use CAPS or <b>bold</b> for section headers, not heading tags
|
|
20
|
+
- One thought per line, blank lines between sections
|
|
21
|
+
- Keep under 1000 chars when possible
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "on-github-event",
|
|
4
|
+
"watch_path": "/github/webhook",
|
|
5
|
+
"actions": [
|
|
6
|
+
{ "type": "command", "command": "echo 'github webhook fired'" }
|
|
7
|
+
],
|
|
8
|
+
"enabled": false
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "on-webhook-log",
|
|
12
|
+
"watch_path": "/webhook",
|
|
13
|
+
"actions": [
|
|
14
|
+
{ "type": "command", "command": "echo 'webhook received: {{body}}'" }
|
|
15
|
+
],
|
|
16
|
+
"enabled": false
|
|
17
|
+
}
|
|
18
|
+
]
|