Skip to content

Commit dfc8ec4

Browse files
authored
chore: agentify repo with AGENTS.md files, skills, and CLAUDE.md (#62)
- Add root AGENTS.md: tech stack, directory map, build commands, git workflow - Add content/AGENTS.md: blog post structure, frontmatter spec, image conventions - Add themes/memmachine/AGENTS.md: layout hierarchy, partials index, safe zones - Add tools/AGENTS.md: utility scripts overview - Add docs/data.md: YAML data files schema (data/ dir cannot hold Markdown) - Add .claude/CLAUDE.md: Claude Code project-level rules and common tasks - Add .claude/skills/write-blog/SKILL.md: /write-blog skill with evaluations - Add .claude/skills/hugo-chores/SKILL.md: /hugo-chores skill with evaluations - Add archetypes/blog.md: full-frontmatter blog post archetype - Update README.md: correct Hugo version, add Go prereq, --bind 0.0.0.0 flag, signed commit requirement, and AI agent link Signed-off-by: Steve Scargall <37674041+sscargal@users.noreply.github.com>
1 parent ae443b9 commit dfc8ec4

10 files changed

Lines changed: 1210 additions & 9 deletions

File tree

.claude/CLAUDE.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# CLAUDE.md — memmachine.github.io (Project-Level)
2+
3+
This file configures Claude Code for this specific project. It supplements your global `~/.claude/CLAUDE.md`.
4+
5+
## Project Summary
6+
7+
This is the Hugo static website for [MemMachine](https://memmachine.ai/) — an open-source AI agent memory layer. The site is built with Hugo Extended ≥ 0.149.0, uses a custom `memmachine` theme, and deploys to GitHub Pages. See `AGENTS.md` for the full orientation guide.
8+
9+
## Critical Rules
10+
11+
- **Never edit `public/`** — it is auto-generated by Hugo and overwritten on every build.
12+
- **Never edit `resources/`** — it is Hugo's resource cache; managed automatically.
13+
- **Never create `content/zh/`** — Chinese content is planned but not started. Do not create this directory without explicit user instruction.
14+
- **All commits must be signed** — use `git commit -sS`. Do not use `--no-verify` or omit the `-S` flag.
15+
- **Do not change website code** (layouts, CSS, JS, content files) unless the user explicitly asks. Default behavior is documentation, tooling, and content only.
16+
17+
## Build Verification
18+
19+
After any change, confirm the site builds cleanly:
20+
```bash
21+
hugo --gc --minify
22+
```
23+
24+
If the build fails, investigate and fix before committing. Never commit with a broken build.
25+
26+
## Key File Paths
27+
28+
| Purpose | Path |
29+
|---------|------|
30+
| Hugo config (menus, params, languages) | `hugo.toml` |
31+
| CI/CD workflow | `.github/workflows/hugo.yaml` |
32+
| All blog content | `content/en/blog/` |
33+
| Homepage content | `content/en/_index.md` |
34+
| Structured data (FAQ, examples, logos) | `data/` |
35+
| Theme layouts and partials | `themes/memmachine/layouts/` |
36+
| Theme CSS | `themes/memmachine/assets/css/` |
37+
| Theme JS | `themes/memmachine/assets/js/` |
38+
| Blog post archetype | `archetypes/blog.md` |
39+
40+
## Common Tasks
41+
42+
| Task | Approach |
43+
|------|---------|
44+
| Write a new blog post | Use `/write-blog` skill |
45+
| Update Hugo version | Use `/hugo-chores upgrade-hugo` |
46+
| Verify the build | Use `/hugo-chores verify-build` |
47+
| Add a FAQ entry | Edit `data/faq.yaml` |
48+
| Add an example card | Edit `data/examples.yaml` |
49+
| Update company logos | Run `tools/stargazers/`, review output, update `data/logos.yaml` |
50+
| Add/remove navigation items | Edit `hugo.toml` menus section |
51+
52+
## Local Skills
53+
54+
| Skill | Trigger | Purpose |
55+
|-------|---------|---------|
56+
| write-blog | `/write-blog` | Create a correctly structured blog post |
57+
| hugo-chores | `/hugo-chores` | Hugo upgrades, build verification, npm updates |
58+
59+
## Hugo Version
60+
61+
Minimum: **0.149.0 Extended**. The Extended edition is required for Sass/SCSS support. Standard Hugo will fail at build time.
62+
63+
## Git Remotes
64+
65+
- `origin` — your personal fork
66+
- `upstream``https://github.com/MemMachine/memmachine.github.io` (PRs target this)
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
---
2+
name: hugo-chores
3+
description: "Maintenance tasks for the memmachine.github.io Hugo site: upgrade Hugo version in CI/CD, verify the build, update npm dependencies. Use when the user wants to perform site maintenance."
4+
trigger: /hugo-chores
5+
---
6+
7+
# /hugo-chores
8+
9+
Perform maintenance tasks on the MemMachine website repository. Subcommands handle Hugo version upgrades, build verification, and npm dependency updates.
10+
11+
## Usage
12+
13+
```
14+
/hugo-chores # show available subcommands
15+
/hugo-chores upgrade-hugo # update Hugo version in CI/CD and docs
16+
/hugo-chores verify-build # run a production build and report results
17+
/hugo-chores update-npm # audit and update npm dependencies
18+
```
19+
20+
## What You Must Do When Invoked
21+
22+
If no subcommand is given, print the usage above and list the available subcommands with one-line descriptions. Do not run any commands.
23+
24+
If a subcommand is given, follow the steps for that subcommand below.
25+
26+
---
27+
28+
## Subcommand: upgrade-hugo
29+
30+
Upgrades the Hugo version used in CI/CD and updates all version references in documentation.
31+
32+
### Step 1 — Find the current version
33+
34+
```bash
35+
grep -n "HUGO_VERSION\|hugo-version\|hugo Extended" .github/workflows/hugo.yaml | head -10
36+
```
37+
38+
Parse the current version from the workflow file (look for the version string in the Hugo setup step, typically `extended_0.149.0` or similar format).
39+
40+
### Step 2 — Find the latest Hugo release
41+
42+
```bash
43+
# Check the latest release tag from the Hugo GitHub releases page
44+
curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep '"tag_name"'
45+
```
46+
47+
If network access is unavailable, ask the user to provide the latest version number.
48+
49+
### Step 3 — Compare versions
50+
51+
If the current version equals the latest, tell the user: "Hugo is already at the latest version (vX.X.X). No update needed." and stop.
52+
53+
If the latest is newer, proceed.
54+
55+
### Step 4 — Update the workflow file
56+
57+
In `.github/workflows/hugo.yaml`, find the Hugo installation step. Update the version string from the old version to the new version. Use the Edit tool for a targeted replacement.
58+
59+
Common patterns to update:
60+
- `extended_0.149.0``extended_{new_version}` (without the leading `v`)
61+
- `HUGO_VERSION: '0.149.0'``HUGO_VERSION: '{new_version}'`
62+
63+
### Step 5 — Update documentation
64+
65+
Update version references in these files (use grep first to find exact strings):
66+
67+
```bash
68+
grep -n "0\.14[0-9]\|hugo.*version\|Hugo.*version" README.md AGENTS.md 2>/dev/null
69+
```
70+
71+
Use the Edit tool to update each occurrence found.
72+
73+
### Step 6 — Verify
74+
75+
```bash
76+
hugo version
77+
```
78+
79+
Report the installed Hugo version. Note if it differs from the new CI version (that's expected if the user hasn't installed the new version locally yet).
80+
81+
### Step 7 — Report
82+
83+
Tell the user:
84+
- What was updated (workflow file + which docs)
85+
- Old version → new version
86+
- Reminder to commit the changes: `git commit -sS -m "chore: upgrade Hugo to v{new_version}"`
87+
- Note that CI will use the new version on next push to main
88+
89+
---
90+
91+
## Subcommand: verify-build
92+
93+
Runs a full production build and reports success or failure with useful diagnostics.
94+
95+
### Step 1 — Run the build
96+
97+
```bash
98+
hugo --gc --minify 2>&1
99+
```
100+
101+
### Step 2 — Report results
102+
103+
**On success:** Report:
104+
- "Build successful"
105+
- Total pages built (look for "pages" in hugo output)
106+
- Build time
107+
- Output directory: `public/`
108+
109+
**On failure:** Report:
110+
- The full error message from Hugo
111+
- Which file caused the error (if identifiable from the output)
112+
- Suggested fix based on the error type
113+
114+
Common error types and fixes:
115+
- `template: ... execute of template failed` — template syntax error in `themes/memmachine/layouts/`
116+
- `YAML parse error` — malformed frontmatter in a content file or data file
117+
- `Error: module ... not found` — run `hugo mod tidy` or check `hugo.toml`
118+
- `Sass compilation error` — CSS syntax error in `themes/memmachine/assets/css/`
119+
120+
### Step 3 — Clean up
121+
122+
If build succeeded, the `public/` directory now contains the built site. Remind the user that `public/` is gitignored and should not be committed.
123+
124+
---
125+
126+
## Subcommand: update-npm
127+
128+
Audits and updates Node.js dependencies (PostCSS, Autoprefixer).
129+
130+
### Step 1 — Check for vulnerabilities
131+
132+
```bash
133+
npm audit
134+
```
135+
136+
Report the number of vulnerabilities found by severity. If none, say so.
137+
138+
### Step 2 — Update dependencies
139+
140+
```bash
141+
npm update
142+
```
143+
144+
### Step 3 — Verify the build still passes
145+
146+
```bash
147+
hugo --gc --minify 2>&1
148+
```
149+
150+
If the build fails after the npm update, report the error. The user may need to investigate the breaking change in the updated package.
151+
152+
### Step 4 — Report
153+
154+
Tell the user:
155+
- Which packages were updated and to what versions (compare `package.json` before and after)
156+
- Whether the build passed
157+
- Reminder to commit: `git commit -sS -m "chore: update npm dependencies"`
158+
159+
---
160+
161+
## Evaluations
162+
163+
### Evaluation 1: upgrade-hugo with newer version available
164+
165+
**Setup:** Current workflow has `extended_0.149.0`. Latest GitHub release is `v0.151.0`.
166+
167+
**Expected behavior:**
168+
- Detects current version as `0.149.0`
169+
- Detects latest as `0.151.0`
170+
- Updates `.github/workflows/hugo.yaml` to `extended_0.151.0`
171+
- Updates version references in `README.md` and `AGENTS.md`
172+
- Reports: "Updated Hugo from 0.149.0 to 0.151.0 in 3 files"
173+
174+
**Pass criteria:** All files updated with correct version string; no other files modified.
175+
176+
---
177+
178+
### Evaluation 2: verify-build on clean repository
179+
180+
**Setup:** Repository has no uncommitted changes; all content and templates are valid.
181+
182+
**Expected behavior:**
183+
- Runs `hugo --gc --minify`
184+
- Build succeeds
185+
- Reports page count and build time
186+
- Does not commit or push anything
187+
188+
**Pass criteria:** Build passes; only read-only operations and the hugo command are run; `public/` is not staged for commit.

0 commit comments

Comments
 (0)