Skip to content

chore: add CLAUDE.md symlink and compile skill#544

Open
r1viollet wants to merge 2 commits intomainfrom
r1viollet/claude-setup
Open

chore: add CLAUDE.md symlink and compile skill#544
r1viollet wants to merge 2 commits intomainfrom
r1viollet/claude-setup

Conversation

@r1viollet
Copy link
Copy Markdown
Collaborator

What does this PR do?

  • Symlink CLAUDE.md -> AGENTS.md so Claude Code auto-loads the agent guide (formatting rules, build workflow) in every session without duplicating content.
  • Add a project-level compile skill that reuses a running Ubuntu 24 dev container when possible, otherwise starts one detached, then runs the DebTidy (clang + clang-tidy) build via docker exec.

Motivation

Ensure you can compile from a claude agent.

Additional Notes

NA

How to test the change?

Start claude, do a /compile

- Symlink CLAUDE.md -> AGENTS.md so Claude Code auto-loads the agent
  guide (formatting rules, build workflow) in every session without
  duplicating content.
- Add a project-level `compile` skill that reuses a running Ubuntu 24
  dev container when possible, otherwise starts one detached, then runs
  the DebTidy (clang + clang-tidy) build via `docker exec`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@r1viollet r1viollet marked this pull request as ready for review April 24, 2026 14:09
@r1viollet r1viollet requested a review from nsavoire as a code owner April 24, 2026 14:09
Comment thread .claude/skills/compile/SKILL.md Outdated
source ./setup_env.sh
MkBuildDir Deb
DebCMake ../
make -j10
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I like to use ninja instead of make (and it has the benefits of not having to specify a -jXX flag)

Comment thread .claude/skills/compile/SKILL.md Outdated
docker exec "$CID" bash -lc '
set -euo pipefail
cd /app
export CC=clang CXX=clang++
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would be nice to have DebTidyCMake setting correctly CC and CXX

nsavoire
nsavoire previously approved these changes Apr 27, 2026
@r1viollet r1viollet force-pushed the r1viollet/claude-setup branch from 43e711c to eca0c23 Compare April 28, 2026 08:37
Comment thread setup_env.sh
}

GetDirectoryExtention() {
echo "_${DDPROF_EXTENSION_CC}_${DDPROF_EXTENSION_OS}_${1}"
Copy link
Copy Markdown
Collaborator

@nsavoire nsavoire Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that MkBuildDir DebTidy uses a correct suffix:

Suggested change
# $1: mode suffix (Rel, Debug, DebTidy, SanitizedDebug, ...)
# DebTidy is clang-only by design — force the clang segment regardless of CC.
local CC_SUFFIX=${DDPROF_EXTENSION_CC}
if [[ "$1" == "DebTidy" ]]; then
CC_SUFFIX=clang
fi
echo "_${CC_SUFFIX}_${DDPROF_EXTENSION_OS}_${1}"

Comment thread setup_env.sh
local VENDOR_EXTENSION=$(GetDirectoryExtention ${BUILD_TYPE})
# shellcheck disable=SC2086
cmake_cmd="cmake ${COMMON_OPT} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DVENDOR_EXTENSION=${VENDOR_EXTENSION} $@"
cmake_cmd="cmake -GNinja ${COMMON_OPT} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DVENDOR_EXTENSION=${VENDOR_EXTENSION} $@"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Examples in Agents.MD need to be adjusted to use ninja instead of make

On failure, extract the first compiler/clang-tidy errors:

```bash
grep -E "error:" /tmp/ddprof_compile.log | head -20
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fragile and probably misses some errors

Comment on lines +105 to +108
isn't blocked. **Do not pipe to `tee`** when backgrounding — `tee` swallows
the failing exit code from `ninja` and the build looks like it succeeded. If
you need the log on disk, redirect with `> /tmp/ddprof_compile.log 2>&1`
instead, or set `set -o pipefail` and check `${PIPESTATUS[0]}` explicitly.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing, it says don't pipe to tee, then says set pipefail AND check ${PIPESTATUS[0]}.
With pipefail (already set in the heredoc one block above) tee is fine and ${PIPESTATUS[0]} is redundant (it's an alternative to setting pipefail).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants