-
Notifications
You must be signed in to change notification settings - Fork 392
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (43 loc) · 1.63 KB
/
Copy pathMakefile
File metadata and controls
46 lines (43 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# setup-dev-llm-rules:
# If you are making changes into the Instant codebase,
# This sets you up with our team's AGENTS.md files!
#
# Usage:
# make setup-dev-llm-rules
#
# This will set up AGENTS.md and CLAUDE.md files in our root, server, and client repos
#
# Making customizations:
#. Sometimes you'll want to make changes to your own AGENTS.md file. To do that,
# Make any change you like _above_ the MARKER
#
# Importing updates:
# Sometimes dev-llm-rules will get updated. When you want to import those changes,
# re-run `make setup-dev-llm-rules`
# This will replace all the content below `MARKER`
# If the marker line is missing from an existing AGENTS.md, that directory is skipped.
MARKER = \# Instructions for development in this directory
.PHONY: setup-dev-llm-rules
setup-dev-llm-rules:
@for dir in . client server; do \
if [ ! -f "$$dir/dev-llm-rules.md" ]; then \
echo "$$dir: dev-llm-rules.md not found, skipping"; \
elif [ -f "$$dir/AGENTS.md" ] && ! grep -q "$(MARKER)" "$$dir/AGENTS.md"; then \
echo "$$dir: marker not found in AGENTS.md, skipping"; \
else \
if [ -f "$$dir/AGENTS.md" ]; then \
sed '/$(MARKER)/,$$d' "$$dir/AGENTS.md" > "$$dir/AGENTS.md.tmp"; \
cat "$$dir/AGENTS.md.tmp" "$$dir/dev-llm-rules.md" > "$$dir/AGENTS.md"; \
rm -f "$$dir/AGENTS.md.tmp"; \
echo "Updated $$dir/AGENTS.md"; \
else \
cp "$$dir/dev-llm-rules.md" "$$dir/AGENTS.md"; \
echo "Created $$dir/AGENTS.md"; \
fi; \
if [ ! -L "$$dir/CLAUDE.md" ]; then \
rm -f "$$dir/CLAUDE.md"; \
ln -s AGENTS.md "$$dir/CLAUDE.md"; \
echo "Created $$dir/CLAUDE.md -> AGENTS.md"; \
fi; \
fi; \
done