Hi devs,
Now that we’ve started exploring/using LLMs, I feel the next step is deciding how to capitalize and share our setup between devs as much as possible.
Goals:
- better consistency in LLM results
- benefit from the work of other devs
- simpler developer onboarding
Here’s an idea to get the conversation started.
The requirements I see:
- Be able to have different setups for repos in the xwiki GH org and the xwiki-contrib GH org repos.
- Be able to have a different setup for your own projects
- Be able to have common setup
- Ideally support different LLMs (however, the example below is mostly for Claude Code)
Claude Code natively walks up the directory tree loading every CLAUDE.md it finds. Organize repos by org on disk and you get context-switching for free.
Directory Layout on Developer Machine
~/dev/
├── xwiki/
│ ├── CLAUDE.md ← xwiki-org-wide config (symlink → xwiki-dev repo)
│ ├── .claude/
│ │ └── settings.json ← xwiki-org MCP servers (symlink)
│ ├── xwiki-commons/
│ ├── xwiki-rendering/
│ └── xwiki-platform/
│ └── CLAUDE.md ← repo-specific (checked in)
├── xwiki-contrib/
│ ├── CLAUDE.md ← contrib-wide config (symlink → xwiki-contrib-dev repo)
│ ├── some-extension/
│ └── another-extension/
│ └── CLAUDE.md ← repo-specific (checked in)
└── personal/
└── my-project/ ← no XWiki config loaded at all
Claude Code auto-composes: working in xwiki-platform loads ~/.claude/CLAUDE.md → ~/dev/xwiki/CLAUDE.md → xwiki-platform/CLAUDE.md. Personal projects get none of it.
Two Shared Repos
│ Repo │ Scope │
├─────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ xwiki/xwiki-dev │ xwiki org conventions, core dev skills, strict standards │
├─────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ xwiki-contrib/xwiki-contrib-dev │ contrib conventions — inherits xwiki-dev where applicable, looser where not │
└─────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────┘
Note that xwiki-dev could actually be the existing xwiki-dev-tools (with a subdirectory for LLM configs). And we’d create a similar repo for xwiki-contrib.
xwiki-contrib-dev’s CLAUDE.md can simply @see xwiki-dev content and add/override.
What Symlinks to What:
~/dev/xwiki/CLAUDE.md → ~/dev/xwiki/xwiki-dev/claude/CLAUDE.md
~/dev/xwiki/.claude/ → ~/dev/xwiki/xwiki-dev/claude/.claude/
~/dev/xwiki-contrib/CLAUDE.md → ~/dev/xwiki-contrib/xwiki-contrib-dev/claude/CLAUDE.md
setup.sh in each shared repo creates these symlinks. Developers run it once after cloning.
Layer Summary
│ Layer │ File │ Source │ Loaded when │
├──────────┼───────────────────────────────┼─────────────────────────────┼─────────────────────┤
│ Personal │ ~/.claude/CLAUDE.md │ developer's own │ always │
├──────────┼───────────────────────────────┼─────────────────────────────┼─────────────────────┤
│ Org-wide │ ~/dev/xwiki/CLAUDE.md │ xwiki-dev repo (symlink) │ all xwiki/* repos │
├──────────┼───────────────────────────────┼─────────────────────────────┼─────────────────────┤
│ Org-wide │ ~/dev/xwiki-contrib/CLAUDE.md │ xwiki-contrib-dev (symlink) │ all contrib/* repos │
├──────────┼───────────────────────────────┼─────────────────────────────┼─────────────────────┤
│ Repo │ <repo>/CLAUDE.md │ checked in to repo │ that repo only │
└──────────┴───────────────────────────────┴─────────────────────────────┴─────────────────────┘
MCP Servers — The Limitation
Claude Code only reads .claude/settings.json at the project root, not parent dirs. So for org-wide MCP:
- Option A: setup.sh merges org MCP entries into
~/.claude/settings.json(simplest) - Option B: Each repo’s
.claude/settings.jsonincludes them (checked in, no secrets) - Avoid: Putting tokens in checked-in files — setup.sh handles secret injection into
~/.claude/settings.json
Skills
- Use
npx skills add <owner/repo>to add a skill (that uses the tool fromvercel-labs/skillsGH repo) - When you do so, it creates a
skills-lock.jsonfile to lock the skill used in a given version. - We share custom skills by putting them in our
xwiki-dev(andxwiki-contrib-devrepos if need be) - Developers install the custom skills globally (or inside each repo, as they wish) using
npx skills add ./path/to/the/skills/directory - We commit the
skills-lock.jsonin ourxwiki-devrepo (andxwiki-contrib-devrepo if need be) - Developers install the 3rd party skills by running
npx skills experimental_installwhich will read theskills-lock.jsonfile and install the skills defined in it.
New Developer Onboarding
# One-time setup
mkdir -p ~/dev/xwiki ~/dev/xwiki-contrib
cd ~/dev/xwiki && git clone https://github.com/xwiki/xwiki-dev
./xwiki-dev/setup.sh # creates symlinks, prompts for API keys
cd ~/dev/xwiki-contrib && git clone https://github.com/xwiki-contrib/xwiki-contrib-dev
./xwiki-contrib-dev/setup.sh
After that, cloning any repo under the right directory “just works” — correct CLAUDE.md and MCP context auto-loads.
WDYT?
Open questions
- Do you see some simpler structure/process? We could use git submodules but I find it more complex to use.
- Could we use a xwiki claude plugin to distribute everything (and a xwiki-contrib plugin too)? I haven’t researched this.
- We need to be careful to commit the minimum to the claude.md files, skill files, etc. And review them from time to time.
- For those using LLMs other than Claude code, could it work with what’s defined above?
If we agree, then the next step is to propose some claude.md file for the different levels, and start with that, as it’s the most important.