Skip to content

Commit fde8ece

Browse files
committed
automation scripts
1 parent ff07773 commit fde8ece

File tree

3 files changed

+39
-7
lines changed

3 files changed

+39
-7
lines changed

CLAUDE.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# QueryLeaf Development Guide
22

3-
QueryLeaf is a SQL to MongoDB compiler / translator.
3+
QueryLeaf is a SQL to MongoDB compiler / translator. It comes in three parts: library, http server, and postgres-wire server
44

55
## Build & Test Commands
66
- Full build: `yarn build`
@@ -25,3 +25,31 @@ QueryLeaf is a SQL to MongoDB compiler / translator.
2525
- Use async/await for asynchronous code
2626
- Follow existing patterns for similar functionality
2727
- Tests should cover both unit and integration cases
28+
29+
30+
## Cron task instructions
31+
32+
Your job is two things:
33+
1. To write and commit a new blog post for the site.
34+
2. Review the live site and fix any mistakes
35+
36+
### Writing a new post
37+
Our target audience is: Software engineers, DBAs, Ops, and other technical professionals using MongoDB.
38+
Posts should be MongoDB tutorials. Tutorials don't have to involve SQL, they should be tutorials on MongoDB generally, but if you provide a MongoDB tutorial that can also be accomplished in QueryLeaf's SQL syntax, make sure to include that as a callout towards the end of the article. Check the docs pages to make sure what you write is valid in this situation.
39+
40+
1. Scan existing blog posts to understand the style and form of the posts we need.
41+
2. Write a new blog post in the same style.
42+
3. Review the blog post to make sure the content is correct, and to verify it will compile to HTML correctly
43+
4. Commit the blog post
44+
45+
### Reviewing the live site
46+
1. You're going to check two blog posts: yesterday's post, and a random historical blog post
47+
2. Fetch them from the live website, review the HTML, look for a) rendering issues, b) broken links, c) invalid information
48+
3. If there are errors - fix and commit
49+
4. If no errors - don't do anything
50+
51+
Guidance:
52+
- Be careful with code blocks and escaping of content within a codeblock
53+
- Liquid syntax in a codeblock requires you to use {% raw %}
54+
- Set the post date to be yesterday, so that it appears immediately
55+
- Users are super technical and prefer content that is direct and to the point

automate.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
claude -p "Look at existing posts in this blog and write a new blog post you think will rank well in Google. Make sure it is not a duplicate of another post. Ensure it has the same tone and format as other posts, also make sure it links to another relevent post in a natural way. See docs/blog. Posts should be tutorials for MongoDB aimed at software engineers, in a friendly tone, no marketing fluff, should be direct and to the point. They can be about mongodb generally, they don't have to involve SQL. When you're done, review the post for correctness, then commit the new content and push it to the main branch." \
4-
--append-system-prompt "You are a MongoDB expert. You are also a SEO marketing expert for technical content" \
5-
--allowedTools "Bash(git:*)" "Edit" \
3+
claude -p "Follow the cron task instructions in the CLAUDE.md file" \
4+
--append-system-prompt "You are a software developer with expertise in using MongoDB as a datastore. You are also a great teacher and SEO marketing expert for technical content" \
5+
--allowedTools "Bash(git:*)" "Edit" "WebFetch(domain:queryleaf.com)" \
66
--permission-mode acceptEdits

cron.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
set -euxo pipefail
44
source ~/.bashrc
5-
export GIT_SSH_COMMAND='ssh -i /home/rathboma/.ssh/id_rsa -o IdentitiesOnly=yes -o UserKnownHostsFile=/home/rathboma/.ssh/known_hosts -o StrictHostKeyChecking=yes'
5+
export GIT_SSH_COMMAND='ssh -i /home/rathboma/.ssh/ql_rsa -o IdentitiesOnly=yes -o UserKnownHostsFile=/home/rathboma/.ssh/known_hosts -o StrictHostKeyChecking=no'
66
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
77
cd "$SCRIPT_DIR"
88

9-
git pull
10-
/home/rathboma/.local/bin/mise exec node@18 -- ./automate.sh
9+
git fetch origin
10+
git checkout master
11+
git reset --hard origin/master
12+
/home/rathboma/.local/bin/mise exec node@18 -- bin/automate.sh
13+
git push
14+
curl https://api.honeybadger.io/v1/check_in/nKIB9E &> /dev/null

0 commit comments

Comments
 (0)