chore: add CLAUDE.md symlink and compile skill#544
Conversation
- 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>
| source ./setup_env.sh | ||
| MkBuildDir Deb | ||
| DebCMake ../ | ||
| make -j10 |
There was a problem hiding this comment.
nit: I like to use ninja instead of make (and it has the benefits of not having to specify a -jXX flag)
| docker exec "$CID" bash -lc ' | ||
| set -euo pipefail | ||
| cd /app | ||
| export CC=clang CXX=clang++ |
There was a problem hiding this comment.
nit: would be nice to have DebTidyCMake setting correctly CC and CXX
43e711c to
eca0c23
Compare
| } | ||
|
|
||
| GetDirectoryExtention() { | ||
| echo "_${DDPROF_EXTENSION_CC}_${DDPROF_EXTENSION_OS}_${1}" |
There was a problem hiding this comment.
Ensure that MkBuildDir DebTidy uses a correct suffix:
| # $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}" |
| 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} $@" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
This seems fragile and probably misses some errors
| 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. |
There was a problem hiding this comment.
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).
What does this PR do?
compileskill that reuses a running Ubuntu 24 dev container when possible, otherwise starts one detached, then runs the DebTidy (clang + clang-tidy) build viadocker exec.Motivation
Ensure you can compile from a claude agent.
Additional Notes
NA
How to test the change?
Start claude, do a /compile