@@ -32,6 +32,78 @@ Note that for a pull request to be accepted, it has to pass all the tests on CI,
3232- ` pytest ` : Successfull execution of all tests in the ` tests ` folder.
3333
3434
35+ ## Design notes, and working with coding agents
36+
37+ The reasoning behind the design — a domain glossary, architecture decision records, feature
38+ specs, the papers the algorithms follow, and memory for coding agents — is kept in a separate,
39+ internal repository,
40+ [ dolfinx-adjoint-knowledge] ( https://github.com/scientificcomputing/dolfinx-adjoint-knowledge ) ,
41+ so that this one stays free of files most contributors do not need.
42+
43+ ** None of it is required.** You can build, test and contribute without it, and nothing in the
44+ package imports or reads it.
45+
46+ ### Linking it in
47+
48+ If you have access, clone it * beside* this repository and link it in from the repository root.
49+ The paths it provides are the ones this project's tooling and agent instructions already look
50+ for, so linking them makes everything resolve in place:
51+
52+ ``` bash
53+ git clone git@github.com:scientificcomputing/dolfinx-adjoint-knowledge.git ../dolfinx-adjoint-knowledge
54+
55+ ln -sf ../dolfinx-adjoint-knowledge/CONTEXT.md CONTEXT.md
56+ ln -sf ../dolfinx-adjoint-knowledge/CLAUDE.md CLAUDE.md
57+ ln -sf ../dolfinx-adjoint-knowledge/scratch .scratch
58+ ln -sf ../dolfinx-adjoint-knowledge/references references
59+ ln -sf ../../dolfinx-adjoint-knowledge/adr docs/adr
60+ ln -sf ../../dolfinx-adjoint-knowledge/agents docs/agents
61+
62+ # Keep them out of this repository's history. `.git/info/exclude` is per-clone and is not
63+ # itself versioned, so this has to be done again in every clone. Do not give the patterns a
64+ # trailing slash: `.scratch/` matches a directory and stops matching once it is a symlink.
65+ printf ' %s\n' CONTEXT.md CLAUDE.md .scratch references docs/adr docs/agents >> .git/info/exclude
66+ ```
67+
68+ The development container mounts only this repository, so these links point outside the mount
69+ and are not readable from inside it. That is harmless — building and testing touch only ` src/ ` ,
70+ ` tests/ ` and ` demos/ ` .
71+
72+ ### What an agent picks up once it is linked
73+
74+ [ Claude Code] ( https://claude.com/claude-code ) reads most of this on its own:
75+
76+ | Path | What it gives the agent |
77+ | ------------- | -------------------------------------------------------------------------- |
78+ | ` CLAUDE.md ` | Project instructions, read automatically at the start of every session. |
79+ | ` CONTEXT.md ` | The domain glossary: the words this project uses, and the ones it avoids. |
80+ | ` docs/adr/ ` | Why things are the way they are, so decisions are not silently re-litigated.|
81+ | ` docs/agents/ ` | Where issues live, and the triage vocabulary the skills expect. |
82+ | ` .scratch/ ` | Specs and issues, one directory per feature. |
83+ | ` references/ ` | The papers to follow rather than improvising. |
84+
85+ Agent memory is stored per project outside the repository, and is symlinked to the knowledge
86+ repository so that it is versioned rather than left in a cache directory:
87+
88+ ``` bash
89+ # The directory name is the absolute path to your checkout with "/" replaced by "-"
90+ ln -s " $PWD /../dolfinx-adjoint-knowledge/memory" \
91+ ~ /.claude/projects/" $( pwd | tr / -) " /memory
92+ ```
93+
94+ ### Skills
95+
96+ The repository-scoped skills the agent instructions refer to — ` grilling ` , ` domain-modeling ` ,
97+ ` code-review ` , ` to-spec ` and others — are vendored under ` .agents/skills/ ` , exposed to Claude
98+ Code through ` .claude/skills/ ` , and pinned in ` skills-lock.json ` . They come from
99+ [ mattpocock/skills] ( https://github.com/mattpocock/skills ) and are not part of the knowledge
100+ repository, since they are upstream content rather than anything specific to this project.
101+
102+ ` setup-matt-pocock-skills ` scaffolds the per-repository configuration those skills assume — the
103+ issue tracker layout, the triage vocabulary and the domain doc paths, which is what
104+ ` docs/agents/ ` contains. It configures the repository; it does not install the skills.
105+
106+
35107### Our Pledge
36108
37109In the interest of fostering an open and welcoming environment, we as
0 commit comments