overleaf-forge 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "overleaf-forge",
3
+ "version": "2.7.1",
4
+ "description": "MCP server to read, edit, compile, and verify Overleaf/LaTeX projects over git: conflict-safe edits, figure upload, clean-build verification, citation and voice linting.",
5
+ "type": "module",
6
+ "main": "overleaf-mcp-server.js",
7
+ "bin": {
8
+ "overleaf-forge": "./overleaf-mcp-server.js"
9
+ },
10
+ "files": [
11
+ "overleaf-mcp-server.js",
12
+ "templates/",
13
+ "writing-guidelines.md",
14
+ "projects.example.json"
15
+ ],
16
+ "scripts": {
17
+ "start": "node overleaf-mcp-server.js",
18
+ "test": "node --test"
19
+ },
20
+ "keywords": [
21
+ "mcp",
22
+ "model-context-protocol",
23
+ "overleaf",
24
+ "latex",
25
+ "latexmk",
26
+ "claude",
27
+ "anthropic",
28
+ "ai",
29
+ "git",
30
+ "bibtex"
31
+ ],
32
+ "license": "MIT",
33
+ "author": "Aeva",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/nomanfoundhere/overleaf-mcp.git"
37
+ },
38
+ "homepage": "https://github.com/nomanfoundhere/overleaf-mcp#readme",
39
+ "bugs": {
40
+ "url": "https://github.com/nomanfoundhere/overleaf-mcp/issues"
41
+ },
42
+ "dependencies": {
43
+ "@modelcontextprotocol/sdk": "^1.0.0"
44
+ },
45
+ "engines": {
46
+ "node": ">=18.0.0"
47
+ }
48
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "settings": {
3
+ "gitToken": "olp_REPLACE_WITH_YOUR_OVERLEAF_GIT_TOKEN",
4
+ "repoDir": "/Users/you/PDFs/Overleaf GIT",
5
+ "academicRoot": "/Users/you/PDFs/School/Textbooks and Syllabus",
6
+ "ssaSubdir": "MY SSAs",
7
+ "voiceLinter": "python3 /path/to/your/voice_lint.py"
8
+ },
9
+ "projects": {
10
+ "default": {
11
+ "name": "My Paper",
12
+ "projectId": "YOUR_PROJECT_ID",
13
+ "cwd": "/Users/you/where/you/run/claude/for/this/project"
14
+ },
15
+ "thesis": {
16
+ "name": "Thesis",
17
+ "projectId": "ANOTHER_PROJECT_ID",
18
+ "cwd": "/Users/you/Documents/Thesis",
19
+ "localPath": "/custom/clone/path"
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,34 @@
1
+ # __SSA_NAME__
2
+
3
+ > Fill these in. Each block is here because past SSAs have needed it. Drop blocks that genuinely do not apply, but do not leave them blank — empty context is the most common reason Claude drifts.
4
+
5
+ ## Topic and scope
6
+ - What is this SSA actually about? One paragraph in your own words.
7
+ - What is in scope, and what is explicitly out of scope?
8
+
9
+ ## Deadline and submission
10
+ - Hard deadline (date + time):
11
+ - Submission target (Canvas, hand-in, etc.):
12
+ - Page or length limit, if any:
13
+
14
+ ## Collaborators and division of labour
15
+ - Who else is on this SSA:
16
+ - Who is doing what:
17
+ - What you specifically own:
18
+
19
+ ## Pinned decisions
20
+ - Decisions already made that should not be re-litigated mid-draft:
21
+
22
+ ## Source material
23
+ - Lecture notes / chapters / datasheets / papers you are working from:
24
+ - Citation style (default IEEE):
25
+
26
+ ## Structure constraints
27
+ - Required sections (Goals, Summary, Details, etc.) in order:
28
+ - Anything unusual (e.g. an appendix the assignment requires):
29
+
30
+ ## Known unknowns
31
+ - Things that are still open and will need updating:
32
+
33
+ ## Other context
34
+ - Anything else Claude should keep in mind throughout the write-up:
@@ -0,0 +1,169 @@
1
+ %% ----- Document Class -----
2
+ \documentclass[a4paper]{article}
3
+
4
+ %% ----- Font -----
5
+ \usepackage[T1]{fontenc}
6
+ \usepackage[RMstyle=Light,SSstyle=Text,TTstyle=Light,DefaultFeatures={Ligatures=Common}]{plex-otf}
7
+ \renewcommand*\familydefault{\sfdefault}
8
+
9
+ \usepackage[basic,italic,symbolgreek]{mathastext}
10
+
11
+ \makeatletter
12
+ \@for\@tempa:=a,b,c,d,e,h,i,k,l,m,n,o,q,r,s,t,u,v,w,x\do{%
13
+ \MTsetmathskips{\@tempa}{0.5mu}{0.5mu}}%
14
+ \makeatother
15
+
16
+ \MTsetmathskips{f}{2.5mu}{0.5mu}
17
+ \MTsetmathskips{g}{1.5mu}{0.5mu}
18
+ \MTsetmathskips{j}{2.5mu}{0.5mu}
19
+ \MTsetmathskips{p}{1.5mu}{0mu}
20
+ \MTsetmathskips{y}{1.5mu}{0.5mu}
21
+ \MTsetmathskips{z}{1mu}{0.5mu}
22
+
23
+ %% ----- Basics -----
24
+ \usepackage{graphicx}
25
+ \graphicspath{{figures/}}
26
+ \usepackage{hyperref}
27
+ \usepackage{subcaption}
28
+ \usepackage{xurl}
29
+ \usepackage{multicol}
30
+ \usepackage{parskip}
31
+ \usepackage{longtable}
32
+ \usepackage{siunitx}
33
+ \sisetup{mode=text} %% prevents mathastext/siunitx conflict (\mathrm undefined in XeTeX)
34
+ \usepackage{xcolor}
35
+ \usepackage[margin=1in]{geometry}
36
+ \usepackage{minted}
37
+ \usemintedstyle{fruity}
38
+ \usepackage{listings}
39
+ \usepackage{enumitem}
40
+ \usepackage{wrapfig}
41
+ \usepackage{ragged2e}
42
+ \usepackage{array}
43
+ \usepackage{hhline}
44
+ \usepackage{colortbl}
45
+ \usepackage{marginnote}
46
+ \usepackage{emoji}
47
+ \usepackage{tocloft}
48
+ \usepackage{tcolorbox}
49
+ \tcbuselibrary{skins,breakable}
50
+ \usepackage{titlesec}
51
+ \usepackage{titling}
52
+ \usepackage{booktabs}
53
+ \usepackage{tikz}
54
+ \usetikzlibrary{positioning, calc, arrows.meta}
55
+ \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
56
+ \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
57
+ \usepackage{pdflscape}
58
+ \usepackage{everypage}
59
+ \newcommand{\Lpagenumber}{%
60
+ \ifdim\textwidth=\linewidth\else\bgroup
61
+ \dimendef\margin=0
62
+ \ifodd\value{page}\margin=\oddsidemargin
63
+ \else\margin=\evensidemargin\fi
64
+ \raisebox{\dimexpr-\topmargin-\headheight-\headsep-0.5\linewidth}[0pt][0pt]{%
65
+ \rlap{\hspace{\dimexpr\margin+\textheight+\footskip}%
66
+ \llap{\rotatebox{90}{\thepage}}}}%
67
+ \egroup\fi}
68
+ \AddEverypageHook{\Lpagenumber}
69
+ \usepackage[backend=biber,style=ieee,sorting=none]{biblatex}
70
+ \addbibresource{refs.bib}
71
+
72
+ %% ----- Equation annotations -----
73
+ \usepackage{annotate-equations}
74
+
75
+ %% ----- Body text color -----
76
+ \let\originalnormalfont\normalfont
77
+ \renewcommand{\normalfont}{\originalnormalfont\color{black!60}}
78
+
79
+ %% ----- Headings locked to full black -----
80
+ \titleformat{\section}{\normalfont\Large\bfseries\color{black}}{\thesection}{1em}{}
81
+ \titleformat{\subsection}{\normalfont\large\bfseries\color{black}}{\thesubsection}{1em}{}
82
+ \titleformat{\subsubsection}{\normalfont\normalsize\bfseries\color{black}}{\thesubsubsection}{1em}{}
83
+
84
+ %% ----- Title block locked to full black -----
85
+ \pretitle{\begin{center}\color{black}\Large\bfseries}
86
+ \posttitle{\end{center}}
87
+ \preauthor{\begin{center}\color{black}\normalsize}
88
+ \postauthor{\end{center}}
89
+ \predate{\begin{center}\color{black}\normalsize}
90
+ \postdate{\end{center}}
91
+ \titleformat{\paragraph}[hang]{\normalfont\normalsize\bfseries\color{black}}{\theparagraph}{1em}{}
92
+ \titlespacing*{\paragraph}{0pt}{2ex plus 0.5ex minus 0.2ex}{0.5em}
93
+
94
+ %% ----- For Code -----
95
+ \definecolor{codegreen}{rgb}{0,0.6,0}
96
+ \definecolor{codegray}{rgb}{0.5,0.5,0.5}
97
+ \definecolor{codepurple}{rgb}{0.58,0,0.82}
98
+ \definecolor{backcolour}{rgb}{0.95,0.95,0.92}
99
+ \lstdefinestyle{mystyle}{
100
+ backgroundcolor=\color{backcolour},
101
+ commentstyle=\color{codegreen},
102
+ keywordstyle=\color{magenta},
103
+ numberstyle=\tiny\color{codegray},
104
+ stringstyle=\color{codepurple},
105
+ basicstyle=\ttfamily\footnotesize,
106
+ breakatwhitespace=false,
107
+ breaklines=true,
108
+ captionpos=b,
109
+ keepspaces=true,
110
+ numbers=left,
111
+ numbersep=5pt,
112
+ showspaces=false,
113
+ showstringspaces=false,
114
+ showtabs=false,
115
+ tabsize=2
116
+ }
117
+ \lstset{style=mystyle}
118
+ \allowdisplaybreaks
119
+
120
+ %% ----- ToC settings -----
121
+ \renewcommand{\cftsecdotsep}{\cftdotsep}
122
+ \renewcommand{\contentsname}{}
123
+ \renewcommand{\cftdot}{ -. }
124
+ \renewcommand{\cftsecfont}{\color{black}}
125
+ \renewcommand{\cftsubsecfont}{\color{black}}
126
+ \renewcommand{\cftsecpagefont}{\color{black}}
127
+ \renewcommand{\cftsubsecpagefont}{\color{black}}
128
+
129
+ %% ----- Title Page Data -----
130
+ \title{\textbf{__SSA_TITLE__}}
131
+ \author{\textbf{Written and submitted by Your Name}}
132
+ \date{\textbf{__SSA_DATE__}}
133
+
134
+ \begin{document}
135
+ \maketitle
136
+ \begin{center}
137
+ \url{__OVERLEAF_READ_URL__}
138
+ \end{center}
139
+
140
+ \input{Chapters/ch1}
141
+
142
+ \vspace{1em}
143
+ \begin{tcolorbox}[
144
+ arc=0pt,
145
+ colback=white,
146
+ colframe=gray,
147
+ colbacktitle=gray,
148
+ coltitle=white,
149
+ title=DETAILS,
150
+ boxrule=0.5pt,
151
+ fonttitle=\bfseries\large,
152
+ breakable
153
+ ]
154
+ \vspace{-3em}
155
+ \tableofcontents
156
+ \end{tcolorbox}
157
+
158
+ \clearpage
159
+ \input{Chapters/ch2}
160
+
161
+ \clearpage
162
+ \addcontentsline{toc}{section}{References}
163
+ \printbibliography
164
+
165
+ \clearpage
166
+ \input{Chapters/app_A}
167
+
168
+
169
+ \end{document}
@@ -0,0 +1,245 @@
1
+ # Overleaf Writing Guidelines
2
+
3
+ This file is read on every `get_context` call. It is the single source of truth for **LaTeX mechanics, SSA structure, and enforcement**. Authorial voice rules live in the user's global `CLAUDE.md` — this file deliberately does not duplicate them. If you are not certain you have read `CLAUDE.md` already this session, stop and read it before writing prose.
4
+
5
+ ---
6
+
7
+ ## 0. Pre-flight — read before any edit
8
+
9
+ Before drafting or modifying any `.tex`:
10
+
11
+ 1. Call `get_context` for the active project (it autodetects from CWD; no need to pass `projectName`).
12
+ 2. Call `status_summary` and skim what already exists. Read the surrounding section with `get_section_content` rather than guessing.
13
+ 3. Read `refs.bib` if you intend to cite. New citations need a `refs.bib` entry — do not invent `\cite{}` keys.
14
+ 4. If preamble or package availability is in doubt, read the project's `main.tex` preamble before adding any `\usepackage{}` or environment.
15
+
16
+ Skipping this step is the most common cause of "Claude wrote good-looking LaTeX that doesn't build."
17
+
18
+ ---
19
+
20
+ ## 1. End-of-write enforcement checklist
21
+
22
+ **Before declaring a writing task complete, walk this list literally.** Do not paraphrase, do not skim — read each item and check the file.
23
+
24
+ - [ ] **Em-dashes:** zero `—` characters in the prose (search the file). Replace with comma, parenthesis, colon, or sentence break. (Exception: none. The rule has no exceptions in this project.)
25
+ - [ ] **`\autoref{}` everywhere:** zero bare `\ref{}` or `\pageref{}` in the file. Cross-refs use `\autoref{}`. The preamble loads `hyperref` for this — there is no excuse.
26
+ - [ ] **All tables are `longtable`.** No bare `tabular`, no `tabularx`. Header row repeats via `\endhead`.
27
+ - [ ] **Display math:** no `\[ ... \]`. Only `equation`, `align`, `gather`, or `multline`. `\allowdisplaybreaks` is on globally — do not add it locally.
28
+ - [ ] **No math-mode font commands:** no `\mathrm`, `\mathbf`, `\mathit`, `\mathsf`, `\mathcal` unless absolutely required for disambiguation (and even then prefer `siunitx`).
29
+ - [ ] **`siunitx` for units:** no `m/s`, no `kg`, no `\%` typed by hand next to numbers. Use `\SI{}{}` and `\si{}`.
30
+ - [ ] **No `\emph`, no `\\` for spacing, no `\newline`.** Use `\vspace{}` / structure instead.
31
+ - [ ] **Every non-trivial number is interpreted in the sentence that contains it** (see SSA rules below).
32
+ - [ ] **Every factual claim that isn't common knowledge has a `\cite{}`** and a matching `refs.bib` entry. No raw URLs in the prose.
33
+ - [ ] **`compile_file` succeeds.** Run it on the project entrypoint (usually `main.tex`). If it fails, fix and re-run before reporting done. A successful diff is not the same as a successful build.
34
+ - [ ] **Voice check against CLAUDE.md** — re-read the "Phrases to avoid wholesale" list and grep for them in your changes.
35
+
36
+ This checklist exists because the rules below get skimmed. Run it.
37
+
38
+ ---
39
+
40
+ ## 2. LaTeX mechanics
41
+
42
+ ### 2.1 Engine and preamble
43
+
44
+ - **Engine:** LuaLaTeX. Required for `plex-otf` and `emoji`. Do not switch engines without being asked.
45
+ - **Font:** IBM Plex Sans via `plex-otf`, sans-serif default family.
46
+ - The canonical full main.tex (preamble + title block + Chapters input + tcolorbox-wrapped ToC + bibliography + appendix) lives in `templates/main.tex`. **Read it before adding any new package or environment.** Do not rebuild from memory and do not reorder preamble blocks — package order is load-bearing (e.g. `hyperref` must load before `cleveref`, `mathastext` before `siunitx`).
47
+ - The preamble already includes `\allowdisplaybreaks`. All equations break across pages by default — never add it locally.
48
+ - The preamble already loads `hyperref`, so `\autoref{}` is available everywhere. There is never a reason to use `\ref{}`.
49
+ - The preamble already loads `longtable`. Use `longtable` for any multi-row data table — even short ones — so future row additions don't require switching environments.
50
+
51
+ ### 2.2 Section structure and ToC
52
+
53
+ - `\section{}` — main chapters.
54
+ - `\subsection{}` — major divisions.
55
+ - `\subsubsection{}` — minor divisions.
56
+ - `\paragraph{}` — named items inside a section (categories, design options, listed configurations). These appear in the ToC and give an at-a-glance view of contents. The SSA1 thermal-storage section is the model.
57
+ - Do not go deeper than `\paragraph` unless strictly necessary.
58
+ - The ToC must be readable as a standalone outline of what the document contains. If your ToC reads as a generic skeleton ("Introduction / Method / Results / Conclusion"), the document is under-structured.
59
+
60
+ ### 2.3 Cross-references
61
+
62
+ - Always `\autoref{}`. Never bare `\ref{}` or `\pageref{}`.
63
+ - Label conventions: `sec:`, `fig:`, `tab:`, `eq:`, `app:`. Be consistent within a document.
64
+
65
+ ### 2.4 Math
66
+
67
+ - Inline: `$ ... $`.
68
+ - Display: `equation`, `align`, `gather`, `multline`. Never `\[ \]`.
69
+ - No math-mode font commands (`\mathrm`, `\mathbf`, `\mathit`, `\mathsf`, …). Variables stay in default math italic.
70
+ - Use `annotate-equations` to label variables on **first introduction** of an equation, and to annotate non-obvious steps (a substitution, a change of variable, a physical interpretation). Do **not** annotate trivial algebra.
71
+ - Symbol consistency: pick a symbol per quantity at the start of the document and do not redefine it. If you must reuse a letter, declare scope explicitly.
72
+
73
+ ### 2.5 Text formatting
74
+
75
+ - `\textbf{}`, `\textit{}`, `\texttt{}` allowed but sparingly. Reshape the sentence before reaching for `\textbf{}`.
76
+ - File names, paths, variable names, code inline: `\verb|...|` or `\texttt{}`.
77
+ - No `\emph{}` — italic does not sit well with the sans font.
78
+
79
+ ### 2.6 Spacing and breaks
80
+
81
+ - No `\newline`, no `\\` for spacing in prose. Use `\vspace{}`, `\parskip`, or proper structure.
82
+ - Use `\noindent` only when typographically necessary, not as a habit.
83
+
84
+ ### 2.7 Citations
85
+
86
+ - `biblatex` with `style=ieee` and `backend=biber`. Cite with `\cite{}`.
87
+ - Numeric, ordered by appearance.
88
+ - Every non-obvious factual claim needs a citation.
89
+ - Cite the primary source. If a textbook cites a paper, cite the paper.
90
+ - No raw URLs in prose. URLs live only in the `refs.bib` entry.
91
+
92
+ ### 2.8 Code
93
+
94
+ - `minted` with `style=fruity`.
95
+ - Short focused snippets in the body when explaining code line-by-line; the full script goes in the appendix and is referenced with `\autoref{app:...}`.
96
+ - Do not paste entire files into the main flow. If a snippet runs longer than ~25 lines, ask whether it should be appendix-shaped.
97
+
98
+ ### 2.9 Figures
99
+
100
+ - Captions below figures (`\caption` after `\includegraphics`).
101
+ - Place images near the referencing text. Do not force floats far from context.
102
+ - Subfigures via `subcaption` package when needed.
103
+ - PDF-page extracts (slide screenshots, report pages used as figures) wrap in `\fbox{}` to frame them as external documents.
104
+ - Photographs, diagrams, plots: no `\fbox{}`.
105
+ - Every figure is referenced from the prose with `\autoref{}` and is interpreted, not just shown.
106
+
107
+ ### 2.10 Tables
108
+
109
+ - **Default environment is `longtable`.** Not `tabular`, not `tabularx`. Even a three-row table goes in `longtable` so a later row addition does not force an environment swap. The preamble already loads it and configures page-breaking.
110
+ - `booktabs` rules (`\toprule`, `\midrule`, `\bottomrule`). No vertical rules.
111
+ - Header row is repeated on every page with `\endfirsthead` / `\endhead`. Skipping this on a `longtable` means the second-page rows appear with no column labels — wrong, even when the table happens to fit on one page in the current draft.
112
+ - Numbers align by decimal where it aids comparison (`siunitx` `S` column).
113
+
114
+ ### 2.11 Units and quantities
115
+
116
+ - All physical quantities in prose, math, captions, and tables go through `siunitx`. No hand-typed `kg/s`, no `100\,\mathrm{W}`.
117
+ - Use `\num{}` for bare numbers that need formatting (thousands separators).
118
+
119
+ ### 2.12 `tcolorbox`
120
+
121
+ - Use for callouts, notes, highlighted derivations.
122
+ - Always include `breakable` so boxes split across pages.
123
+
124
+ ### 2.13 Appendices
125
+
126
+ - Long tables and full code listings live in the appendix.
127
+ - Reference each appendix item from the main text with `\autoref{}`. An appendix that is never referenced is dead weight — either reference it or cut it.
128
+
129
+ ---
130
+
131
+ ## 3. SSA writing style
132
+
133
+ **Applies to any project whose name contains "SSA". These rules override the general register when they conflict.** Voice rules in CLAUDE.md generally agree with what follows, with the explicit exception that first-person is allowed and expected here (CLAUDE.md flags this as the SSA exception).
134
+
135
+ ### 3.1 Voice and person
136
+
137
+ First person throughout: "I did X", "I wrote Y", "I felt Z". When work was genuinely collaborative, name people and say who did what. Do not absorb others' contributions into "we" and do not undersell your own. Informal but substantive: "I reckon", "basically", "sort of", "in my view", "I guess" carry meaning about confidence and framing — do not suppress them. If something surprised you, or an approach was scrapped, say so and say why.
138
+
139
+ ### 3.2 Directness
140
+
141
+ Lead with the finding, then explain. Do not build to a reveal. "Thermal storage is eliminated. Three independent arguments support this, each sufficient on its own" is the model — not three paragraphs of build-up landing on "therefore, thermal storage is eliminated." Especially in Details sections. Exception: derivations and process-heavy sections (CAD, coding, collaborative analysis) are naturally chronological and should stay that way.
142
+
143
+ ### 3.3 Hedging
144
+
145
+ Natural hedging is welcome — "in practice", "roughly", "in principle", "at the time". Informal hedges ("I think", "tbh", "lowkey", "I reckon", "I feel that") are OK in process narration, transitions, and meta-commentary. They must vanish when you make a technical claim or run a formal argument. Never "I think the greedy policy might be optimal" — write "the greedy policy is provably optimal for a lossless store." Flag unexpected results explicitly: "Perhaps the core idea still works, but at the very least this specific configuration is probably not tenable."
146
+
147
+ ### 3.4 Intuition before formalism
148
+
149
+ For any non-trivial concept, give the intuitive picture first, then the formal version. Not optional. The intuitive version should stand alone for someone skipping the maths. Then, if needed: "Formal argument." Never present a derivation or result without first explaining what it captures physically or geometrically.
150
+
151
+ ### 3.5 Process transparency
152
+
153
+ The Summary especially should document how the work actually happened, including course corrections. "At the time, the plan was X. After the Wednesday meeting, Z was locked in" is exactly right. Do not sand the narrative into a clean linear story when reality was not linear. Show reasoning, not just conclusions. Cross-reference other SSAs explicitly by number: "Going back to SSA 3...", "Building on SSA 4...". Cross-reference figures with page numbers in long documents: "as seen in Figure 3 on pg. 5". It is fine to flag unfinished work at submission and to flag known bugs openly.
154
+
155
+ ### 3.6 Motivation before method
156
+
157
+ WHY before HOW. "Since the first deadline was tight, I did most of this before the first meeting" tells the reader something. "I did the analysis in Python" without context tells them nothing. The reader must understand the design goal or problem before the method appears.
158
+
159
+ ### 3.7 Numbers need immediate interpretation
160
+
161
+ Never leave a number dangling. Every figure is followed in the same sentence (or the next clause) by what it means in context: "74.8 GWh, clearly not realistic at any real scale"; "284.8 hours, which immediately rules out any technology limited to daily or weekly cycling." The number and its implication are one unit. Applies to derived quantities, experimental results, and design parameters alike.
162
+
163
+ ### 3.8 Parenthetical asides
164
+
165
+ Natural parenthetical commentary, including informal practical remarks, is welcome. "(Uploading 417 charts individually wasn't working out so I used Claude to package it)" is the right register for the Summary. These ground the document in what actually happened.
166
+
167
+ ### 3.9 Internal cross-referencing
168
+
169
+ Reference earlier sections when building on them. Do not re-derive, point back. "The six-month deficit established in Section 1" is fine and expected. The same holds across a series: "Going back to the analysis in an earlier SSA..."
170
+
171
+ ### 3.10 Meta-commentary
172
+
173
+ Flagging why a section exists, what changed partway through, or what a result does or does not imply is a legitimate move: "A note on the utility of this section: by the time this was written, we had already decided on pumped hydro — but documenting the thermal storage reasoning is likely useful for future deliverables." Flag your own bugs and unresolved issues rather than hiding them.
174
+
175
+ ### 3.11 Section-specific tone
176
+
177
+ - **Goals** — bullet points only. Outcome-oriented and precise. One sentence per goal. No padding.
178
+ - **Summary** — narrative, roughly chronological, reads like a lab notebook written by someone who can write. Dense but connected paragraphs. Documents how work actually unfolded, including pivots.
179
+ - **Conclusion / Recommendation** — tight. Lead with the recommendation or key result. No preamble. Numbers with context. Trade-offs stated plainly.
180
+ - **Problems Faced** — genuinely honest. If something was hard, say specifically what and why. "The derivation was difficult and tedious." "I ran out of time before finishing the implementation." "No significant problems were faced" is acceptable when true — but do not invent problems and do not sanitise real ones.
181
+ - **Future Work** — forward-looking and practical. Specific, not vague: not "refine the design" but "export as .dxf and .3mf, check the full assembly with the cart, make changes if necessary." May include work that was supposed to be in this SSA but was not finished, and things unrelated to the main topic.
182
+ - **Details / Content sections** — technical but readable. Always interpret figures and tables after presenting them. Never let a result sit without commentary. Process narration ("I first tried X, then messaged Y, and we concluded Z") is documentation, not padding.
183
+
184
+ ### 3.12 References and citations (SSA)
185
+
186
+ All sources — papers, books, datasheets, Wikipedia, YouTube videos — go in `refs.bib` and are cited with `\cite{}`, appearing as `[1]`, `[2]`, etc. Never paste raw URLs into prose. The URL may appear in the bibliography entry but not in the running text. Every non-obvious factual claim needs a citation. Wikipedia is acceptable for definitions and overviews. Cite primary sources where available.
187
+
188
+ ---
189
+
190
+ ## 4. Common failure modes (negative examples)
191
+
192
+ ### 4.1 AI-voice leaking in
193
+
194
+ Bad — generic AI register:
195
+
196
+ > It is important to note that thermal storage offers a number of significant advantages. Furthermore, this technology has been shown to play a key role in modern energy systems, highlighting its potential to revolutionize the field.
197
+
198
+ Why it is bad: "It is important to note", "a number of", "furthermore", "play a key role", "highlighting", "revolutionize" — every phrase is from the CLAUDE.md "phrases to avoid" list. Awe-marker stacking, no content.
199
+
200
+ Good — same point, SSA register:
201
+
202
+ > Thermal storage looked viable on paper: high round-trip efficiency at the scales documented in [3], and a low marginal cost above ~50 MWh. The first deadline made testing this in detail tight, and by the Wednesday meeting it was clear the cycling profile we actually needed (sub-daily, partial-state) was outside the operating envelope of every candidate in [3]–[5]. That is what eliminated it.
203
+
204
+ ### 4.2 Number dangling
205
+
206
+ Bad:
207
+
208
+ > The system achieves 74.8 GWh of storage. This is a large value.
209
+
210
+ Good:
211
+
212
+ > The system would require 74.8 GWh of storage — roughly the daily consumption of a mid-sized European city, clearly not realistic at any real scale.
213
+
214
+ ### 4.3 LaTeX that compiles but is wrong-shape
215
+
216
+ Bad:
217
+
218
+ ```latex
219
+ The result is \mathbf{x} = 12.4 m/s as shown in Ref. \ref{fig:result}.
220
+ \[ y = \alpha x + \beta \]
221
+ ```
222
+
223
+ Wrong on four counts: `\mathbf{}`, hand-typed units, bare `\ref{}` (and "Ref." prefix), `\[ \]`. Correct form:
224
+
225
+ ```latex
226
+ The result is $x = \SI{12.4}{\meter\per\second}$ as shown in \autoref{fig:result}.
227
+ \begin{equation}
228
+ y = \alpha x + \beta
229
+ \label{eq:linear-model}
230
+ \end{equation}
231
+ ```
232
+
233
+ ### 4.4 Build broke and nobody noticed
234
+
235
+ If `compile_file` returned anything other than `✓ PDF written to ...`, the task is not done. Do not paper over a missing package or undefined reference by silently removing the line that triggered it — fix the underlying cause (missing `\usepackage{}`, missing `\label{}`, missing `refs.bib` entry).
236
+
237
+ ---
238
+
239
+ ## 5. When you are unsure
240
+
241
+ - Re-read this file (`get_context`) rather than guessing.
242
+ - Read the surrounding section before editing it.
243
+ - Read the preamble before adding a package.
244
+ - Run `compile_file` after every meaningful change, not only at the end.
245
+ - If a rule here conflicts with something the user just said in conversation, the user's most recent instruction wins — but flag the conflict explicitly so they can confirm.