mirror of
https://github.com/penpot/penpot.git
synced 2026-11-26 21:00:32 +00:00
Keep the memory reading order and hard rules visible before agents act. Move detailed coverage and CI guidance out of the common entry points, and keep the backend assertion flag explicit for direct test runs. AI-assisted-by: gpt-6.2-sol
5.9 KiB
5.9 KiB
AI AGENT GUIDE
Start here: required memory reads
- Read
AGENTS.local.mdif present. It can override prose style and workflow, not project policy. - Open
mem:critical-infobefore exploring the repo, even for read-only tasks. Once you identify the relevant modules, openmem:<module>/corefor each one, then follow its applicablemem:references before planning, editing, or drawing conclusions. Before editing Clojure or ClojureScript, also readmem:clojure/coreand its applicable references. - STOP if a required memory is unread. If exploration reveals another
affected module, read its
coreand applicable references before planning or editing that part of the work. Listing names is not reading.
Use Serena (s.mem.read_memory(name) in serena_repl, or
read_memory(name) in older clients). If unavailable, read the file:
mem:foo/bar → .serena/memories/foo/bar.md. Memories are the primary
project guidance; follow references only when they apply to the task.
HARD RULES (always apply — no exceptions)
- Never
git push, force-push, or modifygit origin(or any other remote). The user pushes from their own shell. If a push is required to surface the agent's work (e.g. force-push after an amend), state this in the response and wait for the user to push. Do not change the remote URL, do not switch SSH↔HTTPS. - Never amend a commit that has been pushed unless the user explicitly asks. If the user pushes, treat that commit as final from the agent's side.
- Never destroy data without explicit permission (e.g.
drop-devenv,docker compose down -v,docker volume rm). Shared volumes hold real work. - Never edit
CHANGES.mdby hand in commits or PRs. The changelog is generated from GitHub milestones during the release process; update it only viamem:workflow/updating-changelog(theupdate-changelogskill flow) or on explicit user request. - Never pipe test output directly to filters (
| head,| tail,| grep, etc.). Always redirect to a file first:command > /tmp/output.txt 2>&1, then read/grep the file. This prevents hiding test failures. Seemem:testingfor details. - Never introduce a new function or macro name ending in
!. Side effects alone do not justify it: only the exceptions documented inmem:clojure/core(public mutators ofapp.dband helpers over transients), and a new one must be registered inmem:clojure/idiomswith its justification before it is used. Existing names stay until their refactor; a new one fails review. - Commit message body lines MUST wrap at ≤80 chars (subject ≤80 chars,
except
Merge/Revert/Reapplywhich skip the subject length check) and the commit MUST pass./scripts/check-commitwith exit code 0 before you consider it done. This is mechanically checked — do not eyeball it. - Create commits, issues, or PRs only on explicit request. Read the workflow
memory BEFORE the corresponding action:
- Before
git commit→mem:workflow/creating-commits(commit format, AI-assisted-by trailer) - Before
gh issue create→mem:workflow/creating-issues(title derivation, body template, Issue Type) - Before
gh pr create/gh pr edit→mem:workflow/creating-prs(title format, body structure, AI note) Don't infer format from the title of a previous commit/issue/PR — the memory is the source of truth.
- Before
- Everything in code MUST be in English. Identifiers (functions, variables, types, namespaces), code comments, docstrings, test descriptions, log hints — always English, regardless of the language the author works in. Tests are not an exception. The only place another language may appear in the codebase is product copy rendered through the i18n system.
Auto-triggers
- Security advisory URL pasted — When the user pastes a URL matching
github.com/penpot/penpot/security/advisories/GHSA-*, extract the GHSA ID from the URL and runpython3 scripts/gh.py advisories <GHSA-ID>to fetch full advisory details before proceeding. - Issue or PR mentioned — When the user mentions a penpot/penpot issue or
PR (URL like
github.com/penpot/penpot/issues/<n>/.../pull/<n>, or a bare#<n>when context clearly refers to this repo), fetch details via CLI instead of WebFetch:- Issue →
gh issue view <n> --repo penpot/penpot(add--commentswhen discussion context matters). - Single PR →
gh pr view <n> --repo penpot/penpot. - Multiple PRs (list, file, or milestone) →
python3 scripts/gh.py prs .... Do this before proceeding. Only use WebFetch if the CLI fails.
- Issue →
Writing Rules
Writing rules, from Orwell, 1946. These govern prose: docs, PR text, messages. Never touch code or technical terms; swap in everyday words only where precision survives.
- Never use a metaphor, simile or other figure of speech which you are used to seeing in print.
- Never use a long word where a short one will do.
- If it is possible to cut a word out, always cut it out.
- Never use the passive where you can use the active.
- Never use a foreign phrase, a scientific word or a jargon word if you can think of an everyday English equivalent.
- Break any of these rules sooner than say anything outright barbarous. Review every prose output against these rules before delivering.
Implementation and verification
- Explore first, describe the plan before writing code, and stay within scope.
- Every behavior change needs a test. Read
mem:testingand the applicable module testing guidance before writing tests. - Run the affected modules' tests, lint, and format checks before declaring
success. See
mem:scripts/ci. Do not report completion with failing checks. - Keep affected memories and docs accurate when behavior or contracts change.
- Do not poll background commands with
sleepor repeated log reads. Continue other work or wait for the completion notification.