project: add a CLAUDE.md file (Bug 2015621)#911
project: add a CLAUDE.md file (Bug 2015621)#911cgsheeh wants to merge 5 commits intomozilla-conduit:mainfrom
CLAUDE.md file (Bug 2015621)#911Conversation
Add a `CLAUDE.md` file which outlines some basic details of working in the Lando project, including some code conventions and general layout of the project. We can start with this as a baseline and iterate on it as needed.
|
View this pull request in Lando to land it once approved. |
CLAUDE.md
Outdated
|
|
||
| ## Coding Conventions | ||
|
|
||
| - Always add assert messages in tests: `assert a == b, "a and b should be equal"`. Where possible, comments surrounding assert statements should instead become assert messages. |
There was a problem hiding this comment.
nits:
| - Always add assert messages in tests: `assert a == b, "a and b should be equal"`. Where possible, comments surrounding assert statements should instead become assert messages. | |
| - Type-hint function arguments and return values | |
| - Always add assert messages in tests: `assert a == b, "a and b should be equal"`. Where possible, comments surrounding assert statements should instead become assert messages. |
There was a problem hiding this comment.
We use ruff to enforce ANN rules, so the agent will see test and formatting failures for type hints anyways. I added a note about this, and suggested that the agent should use specific types as much as possible (ie don't use str | int as a type, just pick one of str or int).
zzzeid
left a comment
There was a problem hiding this comment.
I would suggest removing all references to package versions, it doesn't seem necessary and could be a pain to keep up to date.
There was a problem hiding this comment.
Seems like the content of this file could be useful as a general overview of Lando for anyone who wants to learn more about how it works. I don't think we should make it specific for consumption by bots.
There was a problem hiding this comment.
We could rename the file to CONTRIBUTING.md, and just add an @CONTRIBUTING.md to CLAUDE.md. Firefox does something in this ilk https://searchfox.org/firefox-main/source/CLAUDE.md.
zzzeid
left a comment
There was a problem hiding this comment.
Can you add more context to the bug as well, as to why we are adding this file? Is there an integration that's going to depend on this?
I would rename this to a more generic explainer and maybe tell that integration to point to that instead.
There's also duplication of info between this and the README so maybe we should just update the README with more comprehensive info.
…d point to readme
It's in the file at the very top: "This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository." Essentially when you run Here are the Firefox
Good call. I moved much of the content to the README and made this file reference the README. |
I changed these to instead include a reference to the file where the version can be found. |
Is claude or any other similar tool unable to detect the README itself (i.e., this universally accepted naming convention for a file that should give you the information you need about something)? Or on a per-session or use basis, can the README file be specified for the source of this information? This new file seems redundant/unnecessary. The README additions themselves are good though but I think the language could be updated to be a little less mechanical. |
CLAUDE.md is automatically injected into claude's context. Claude could read the README, but it would have to decide to based on a prompt. It may decide to read that file, it may not read it, or it may read it and read many other unnecessary files which pollute the context. Think of this like a repo-level config file for a tool, similar to
The file is currently only 3 lines, and it's mostly just a "pointer" to the README. The actual substance are the README improvements. Over time, CLAUDE.md may diverge from the readme as it contains more mechanical language and instructions on specific behaviours for the AI to take. |
Add a
CLAUDE.mdfile which outlines some basic detailsof working in the Lando project, including some code
conventions and general layout of the project. We can
start with this as a baseline and iterate on it as
needed.