Add Trilium-specific Claude Code skills + fix CLAUDE.md path-rot#10148
Add Trilium-specific Claude Code skills + fix CLAUDE.md path-rot#10148eliandoran wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive suite of Claude "skills" (developer guides, reference documents, templates, and helper scripts) under .claude/skills/ to document and streamline development workflows in Trilium. These cover key areas such as adding internal API routes, LLM/MCP tools, building client UI, release management, Electron desktop bridge, database migrations, and CKEditor 5 integration. It also aligns CLAUDE.md and .github/copilot-instructions.md with these updated guidelines. The feedback on the ipc-parity.mjs script is constructive, suggesting a regex improvement to robustly support asynchronous setup functions.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| for (const fn of matchAll( | ||
| text, | ||
| /export\s+function\s+((?:setup|register)\w+)\s*\(/g, | ||
| (m) => m[1] | ||
| )) { |
There was a problem hiding this comment.
The regex currently expects synchronous functions (export function ...). If any setup or registration function is made asynchronous in the future (e.g., export async function setupX()), it will be silently skipped by this script. Supporting optional async makes the parser more robust.
| for (const fn of matchAll( | |
| text, | |
| /export\s+function\s+((?:setup|register)\w+)\s*\(/g, | |
| (m) => m[1] | |
| )) { | |
| for (const fn of matchAll( | |
| text, | |
| /export\s+(?:async\s+)?function\s+((?:setup|register)\w+)\s*\(/g, | |
| (m) => m[1] | |
| )) { |
532db4f to
aeadd08
Compare
Greptile SummaryThis PR fixes rotted paths in
Confidence Score: 5/5All changes are documentation only — no runnable application code was modified. The two bundled scripts are developer tooling (pre-flight checks and IPC parity analysis) that run outside the application. Safe to merge. Every corrected path was verified against the live repo. The seven new skills cite real file:line anchors and were validated before submission. The bundled scripts contain no application logic. The only open items are stale paths in copilot-instructions.md sections untouched by this PR, which a follow-up can clean up. .github/copilot-instructions.md still has a handful of stale apps/server/src/ references in sections not touched by this PR (becca, events, search, Shaca on line 14). Important Files Changed
|
Migrations, schema.sql, options_init, the options route, hidden_subtree, ws and cls moved from apps/server into packages/trilium-core. The DB-migration recipe in particular described creating apps/server/src/migrations/*.sql, a path that no longer exists (migrations are now integer-versioned entries in the descending MIGRATIONS array in packages/trilium-core). Re-resolve each moved path and mirror the fix into .github/copilot-instructions.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
aeadd08 to
a253a11
Compare
Bundle ReportBundle size has no change ✅ Affected Assets, Files, and Routes:view changes for bundle: client-esmAssets Changed:
|
Add/extend DB migrations and Becca entity fields: the descending MIGRATIONS array, schema.sql parity, the hashedProperties cross-instance sync-hash hazard, CLS-wrapped JS migrations, and the spec harness. Ships migration + spec templates. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author client UI the Preact-hooks way: which froca-reactive hook for which job and the loadResults filter each wires, the reusable-component/per-component-CSS rules, and the Modal/LazyDialog summon+register wiring. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add an LLM/MCP tool exposed to both chat and the MCP server: the synchronous-execute NotAPromise guard, mutates->transaction wiring, the allToolRegistries registration point, the return-{error} contract, protected-note guards, and the getTool()/cls.init() spec harness.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire an internal REST route: core-shared (runs under WASM) vs server-only, the apiRoute/asyncApiRoute sync-transactional trap, the implicit 200/204/[status,body] return conventions, convertEntitiesToPojo, and CoreApiTester. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire a window.electronApi.* method across the contextBridge (the 7 handler modules each registered from main.ts), the send/sendSync/invoke decision, crash-safety, and renderer-input validation. Ships scripts/ipc-parity.mjs and a protocol/security triage reference. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cut/debug a release: the two divergent version scripts, the CI consistency gate that checks only 5 of 8 files, the exact release-notes path the publish step requires, rc/beta latest labeling, and RELEASE_PAT. Ships scripts/preflight-release-check.mts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire a CKEditor 5 plugin into Trilium's own bundle: the 5 plugin arrays in plugins.ts, toolbar/slash/translation_overrides wiring, the data-trilium-* persistence pipeline through markdown/share, and the real webdriverio+GPL test harness. Companion to the upstream ckeditor5-* skills. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…runtime specs Correct the stale '@vitest/browser unconfigured' line (browser mode IS configured for the ckeditor5 bundles via webdriverio+Chrome), add a CKEditor browser-mode row, pointers to the new migration/LLM-tool/preload spec harnesses, and a 'core specs run twice (server + standalone WASM)' footgun. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ng-coverage trilium-core coverage is collected through BOTH the server and the standalone suites; add the standalone suite as a third coverage-source row with its lcov path and run command. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…guide Distinguish filling an existing locale from registering a brand-new one (pointer to the dev-guide), and replace the hardcoded Romanian coverage figures with a measure-first instruction. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a Custom Skills section to CLAUDE.md noting where skills live and that adding/updating one is committed with the chore(skills) prefix (one skill per commit). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a253a11 to
c3d53eb
Compare
Summary
A repo-wide audit for ways to improve AI-assistant capabilities (Claude Code / Copilot) surfaced two things: our always-loaded instruction files had rotted, and several recurring, footgun-dense workflows had no captured guidance. This PR fixes the docs and adds seven Trilium-specific custom skills.
1. Fix stale paths in
CLAUDE.md+.github/copilot-instructions.mdServer services were relocated
apps/server/ → packages/trilium-core/, but the instruction files still cited the old paths. Verified dead and corrected: the DB-migration recipe (it described creatingapps/server/src/migrations/*.sql— a path that no longer exists; real migrations are the descendingMIGRATIONSarray inpackages/trilium-core/src/migrations/migrations.ts),schema.sql,options_init, the options route,hidden_subtree,ws, andcls.2. Seven new skills (
.claude/skills/)Each is footgun-first, carries on-demand reference files, and (where useful) a runnable script:
evolving-the-data-modelhashedPropertiescross-instance sync-hash hazard; migration/spec templatesbuilding-client-uiloadResultsfilter each wires; Modal/LazyDialogwiringadding-llm-mcp-toolsexecutemust be sync (NotAPromiseguard);mutates→transaction; spec harnessadding-internal-api-routeapiRoutesync-transactional trap; implicit return conventions;CoreApiTesterelectron-desktop-bridgescripts/ipc-parity.mjscutting-a-releaseRELEASE_PAT. Shipsscripts/preflight-release-check.mtstrilium-ckeditor5-integration3. Refresh three existing skills
writing-unit-tests— correct the stale "@vitest/browserunconfigured" line (it is configured), add a browser-mode row + a "core specs run twice (server + standalone WASM)" footgun.analyzing-coverage— add the standalone (sqlite-wasm) suite as a third coverage source.translating-locales— distinguish filling vs registering a locale; replace hardcoded coverage figures with measure-first.How it was verified
Every skill was authored from a spec verified against live code, then reviewed by a second pass that spot-checked citations and ran the scripts (
ipc-parity.mjsexits 0;preflight-release-check.mtspasses 5 scenarios). The review caught and fixed real citation drift (e.g. a false migration example, inflated hook counts).Not included / follow-ups
llm-providers-and-streaminghas a ready spec; e2e, etapi, standalone-providers, note-types, hidden-subtree, docs, options, packaging, search-modifier).ckeditor5-*draft skills (this PR'strilium-ckeditor5-integrationis their Trilium companion).🤖 Generated with Claude Code