obsidian-dev-skills 1.1.4 → 1.2.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/README.md CHANGED
@@ -49,6 +49,7 @@ node node_modules/obsidian-dev-skills/scripts/init.mjs
49
49
  - Obsidian API usage
50
50
  - Plugin lifecycle management
51
51
  - Command and settings implementation
52
+ - `obsidianmd` ESLint rule patterns (`createDiv`/`createSpan`, `activeWindow`, `activeDocument`, sentence case)
52
53
 
53
54
  ### obsidian-theme-dev
54
55
  - CSS/SCSS development patterns
@@ -61,6 +62,9 @@ node node_modules/obsidian-dev-skills/scripts/init.mjs
61
62
  - Version management
62
63
  - Sync procedures
63
64
  - Testing and quality assurance
65
+ - Obsidian community **scorecard compliance** mapping (vulnerable transitive dep handling via `pnpm.overrides`, duplicate CSS selector detection, ESLint rule violations)
66
+ - Release workflow with **build provenance attestation** (`actions/attest-build-provenance@v2`)
67
+ - Portable **`CONTRIBUTING.md` template** for the scorecard hygiene check
64
68
 
65
69
  ### obsidian-ref
66
70
  - API documentation
@@ -80,7 +84,10 @@ Each project should also have a `project/` skill in `.agent/skills/project/` tha
80
84
 
81
85
  ### Updating Skills
82
86
 
83
- When skills are updated in this repository, all linked projects automatically get the updates. No manual sync required.
87
+ The update flow depends on how a project consumes this package:
88
+
89
+ - **npm install (default)**: When this package publishes a new version, downstream projects pick up updates the next time they run `pnpm obsidian-dev-skills` (or the equivalent npx/manual command). The init script re-copies skill files into `.agent/skills/`.
90
+ - **Sibling clone + symlinks (advanced)**: If a project symlinks `.agent/skills/<name>` to a sibling clone of this repository (e.g. via `scripts/setup-local.ps1`), updates appear instantly the moment files change here, with no per-project sync step.
84
91
 
85
92
  ### Tracking Sync Status
86
93
 
@@ -29,7 +29,10 @@ This skill covers:
29
29
 
30
30
  - `references/build-workflow.md`: Standard build and development commands.
31
31
  - `references/release-readiness.md`: Checklist for ensuring a project is ready for release.
32
+ - `references/scorecard-compliance.md`: Map of Obsidian community plugin scorecard signals to concrete fixes (vulnerability overrides, attestation workflow, CSS dedup, obsidianmd rules).
33
+ - `references/contributing-template.md`: Portable CONTRIBUTING.md template for the scorecard hygiene check.
34
+ - `references/security-privacy.md`: Developer policies, mandatory disclosures, and dependency vulnerability hygiene via `pnpm.overrides`.
32
35
  - `references/sync-procedure.md`: How to pull updates from reference repositories.
33
- - `references/versioning-releases.md`: Workflow for versioning and GitHub releases.
36
+ - `references/versioning-releases.md`: Workflow for versioning and GitHub releases, including the build-provenance attestation pattern.
34
37
  - `references/troubleshooting.md`: Common issues and their resolutions.
35
38
  - `references/quick-reference.md`: One-page cheat sheet for common operations.
@@ -0,0 +1,96 @@
1
+ <!--
2
+ Source: Authored for Obsidian plugin scorecard compliance
3
+ Last synced: See sync-status.json for authoritative sync dates
4
+ Update frequency: Update when the standard development setup changes
5
+ Applicability: Plugin
6
+ -->
7
+
8
+ # CONTRIBUTING.md Template
9
+
10
+ The Obsidian community scorecard's **Hygiene** check looks for a `CONTRIBUTING.md` at the repo root. The template below is portable across plugin repositories without modification, because it uses relative GitHub links (`../../issues`) and references generic plugin concepts.
11
+
12
+ ## When to drop in unmodified
13
+
14
+ Use the template as-is when the repo:
15
+
16
+ - Uses pnpm with the standard `pnpm dev`, `pnpm build`, `pnpm lint`, `pnpm lint:fix` scripts.
17
+ - Builds `main.js`, `styles.css`, and `manifest.json` to the repo root.
18
+ - Is licensed MIT.
19
+ - Uses the house terminology rules (properties, Markdown capitalized).
20
+
21
+ ## When to customize
22
+
23
+ Change the template only when:
24
+
25
+ - The plugin uses npm/yarn/bun instead of pnpm (update the install/build commands).
26
+ - The plugin has additional scripts the contributor needs to run (e.g. a separate test command).
27
+ - The license is not MIT (update the License section).
28
+
29
+ Do not customize the issue link — the relative `../../issues` form resolves correctly on any GitHub repo.
30
+
31
+ ## Template
32
+
33
+ ```markdown
34
+ # Contributing
35
+
36
+ Thanks for your interest in contributing. This document describes how to report issues, propose changes, and get a local development environment running.
37
+
38
+ ## Reporting issues
39
+
40
+ - Search [existing issues](../../issues) before opening a new one.
41
+ - For bugs, include: Obsidian version, plugin version, operating system, reproduction steps, and what you expected vs. what happened. Screenshots or a short screen recording help.
42
+ - For feature requests, describe the use case and the problem the feature would solve, not just the proposed solution.
43
+
44
+ ## Development setup
45
+
46
+ Requirements:
47
+
48
+ - [Node.js](https://nodejs.org/) (LTS recommended)
49
+ - [pnpm](https://pnpm.io/). This repo pins a specific version via `packageManager` in `package.json`.
50
+
51
+ `​`​`bash
52
+ pnpm install
53
+ pnpm dev # watch mode build
54
+ pnpm build # production build
55
+ pnpm lint # check code style
56
+ pnpm lint:fix # auto-fix where possible
57
+ `​`​`
58
+
59
+ Build artifacts (`main.js`, `manifest.json`, `styles.css`) are produced at the repo root.
60
+
61
+ To test against a real vault, point the build output at `<vault>/.obsidian/plugins/<plugin-id>/` (symlink the three files, or use a tool like [hot-reload](https://github.com/pjeby/hot-reload)).
62
+
63
+ ## Pull requests
64
+
65
+ - Open an issue first for anything non-trivial so we can agree on direction before you spend time on it.
66
+ - Keep PRs focused. One concern per PR is easier to review.
67
+ - Run `pnpm lint` and `pnpm build` before submitting; CI will run these too.
68
+ - Follow the existing code style. Use **"properties"** (not "frontmatter") when referring to YAML metadata. **"Markdown"** is always capitalized.
69
+ - Update the README if you change user-facing behavior.
70
+
71
+ ## Code style
72
+
73
+ - TypeScript strict mode, no `any` unless unavoidable.
74
+ - Prefer Obsidian's API (`Vault`, `MetadataCache`, `Workspace`) over Node `fs` for vault access.
75
+ - No network requests from the plugin runtime.
76
+
77
+ ## Releases
78
+
79
+ Maintainers cut releases by bumping the version in `manifest.json`, `package.json`, and `versions.json`, committing, then tagging and pushing the tag. The release workflow builds and attaches `main.js`, `manifest.json`, and `styles.css` with build provenance attestation.
80
+
81
+ ## License
82
+
83
+ By contributing, you agree that your contributions will be licensed under the [MIT License](LICENSE).
84
+ ```
85
+
86
+ ## Style notes
87
+
88
+ - The template avoids em dashes (`—`); prefer periods, commas, or parentheses instead.
89
+ - The template avoids the word "Claude" and any reference to AI assistance, since the file is user-facing documentation.
90
+ - Headings use sentence case to match Obsidian UI conventions.
91
+
92
+ ## Related Documentation
93
+
94
+ - [scorecard-compliance.md](scorecard-compliance.md) — covers every scorecard signal, not just the contributing guide.
95
+ - [release-readiness.md](release-readiness.md) — broader pre-release checklist.
96
+ - [versioning-releases.md](versioning-releases.md) — release workflow setup.
@@ -0,0 +1,376 @@
1
+ <!--
2
+ Source: Obsidian community plugin scorecard (community.obsidian.md/plugins/<id>)
3
+ Last synced: See sync-status.json for authoritative sync dates
4
+ Update frequency: Check the Obsidian community portal scorecard format for changes
5
+ Applicability: Plugin
6
+ -->
7
+
8
+ # Community Plugin Scorecard Compliance
9
+
10
+ The Obsidian community portal publishes an automated scorecard for every plugin. It scans the latest GitHub release plus the source repository and reports across four health categories (**Hygiene**, **Maintenance**, **Responsiveness**, **Adoption**) and a **Review** section that flags concrete issues from automated scans.
11
+
12
+ This document maps the scorecard signals to concrete fixes you can apply. Use it when a user asks "why is my score low?" or "help me fix my plugin's scorecard."
13
+
14
+ ## Health Category Fixes
15
+
16
+ ### Hygiene
17
+
18
+ The portal checks for four files at the repo root.
19
+
20
+ | Signal | Fix |
21
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
22
+ | Missing readme | Add `README.md` describing the plugin's purpose, installation, usage, and screenshots. |
23
+ | Missing license | Add `LICENSE` (MIT is typical). |
24
+ | Missing description | Ensure `manifest.json` has a clear `description` field. |
25
+ | Missing contributing | Add `CONTRIBUTING.md`. See [contributing-template.md](contributing-template.md) for a portable template. |
26
+
27
+ ### Maintenance, Responsiveness, Adoption
28
+
29
+ These reflect commit cadence, issue close rate, install count, and stars. They are not directly fixable by editing files. Steer the user toward consistent maintenance habits rather than a one-shot fix.
30
+
31
+ ## Review Section Fixes
32
+
33
+ The Review section is where most score improvement happens. Issues are grouped into **Risks**, **Warnings**, **Disclosures**, **Other**, and **Passed**.
34
+
35
+ ### Disclosures (informational, not fixable)
36
+
37
+ Disclosures are not deductions, they are informational. Common ones for plugins:
38
+
39
+ - **Vault Enumeration** — uses `vault.getFiles()`, `getMarkdownFiles()`, etc.
40
+ - **Vault Read** — uses `vault.read()` or `vault.cachedRead()`.
41
+ - **Vault Write** — uses `vault.modify()`, `vault.create()`, etc.
42
+ - **Clipboard Access** — reads or writes the system clipboard.
43
+ - **Malware scan not available** / **Vulnerable dependencies scan not available** — scanner-side limitations.
44
+
45
+ Do not try to remove these. They reflect the plugin's actual API surface and the user should understand them when installing.
46
+
47
+ ### Vulnerable transitive dev dependencies
48
+
49
+ The scanner reports advisories like:
50
+
51
+ > Potentially vulnerable dependency `<pkg>` (via `<parent>`). Upgrade to version X or later.
52
+
53
+ These are almost always **dev-only transitives** pulled in through `eslint`, `eslint-plugin-obsidianmd`, and `@typescript-eslint/*`. They never ship in `main.js`, but the scorecard still counts them.
54
+
55
+ **Fix**: add a `pnpm.overrides` block to `package.json` that forces patched versions. Major-version-scoped ranges keep API compatibility while bumping the patch:
56
+
57
+ ```json
58
+ {
59
+ "pnpm": {
60
+ "overrides": {
61
+ "minimatch@<3.1.3": "^3.1.3",
62
+ "minimatch@^4 || ^5 || ^6 || ^7 || ^8": "^8.0.5",
63
+ "minimatch@^9": "^9.0.6",
64
+ "picomatch@<2.3.2": "^2.3.2",
65
+ "picomatch@^3 || ^4": "^4.0.4",
66
+ "brace-expansion@<1.1.13": "^1.1.13",
67
+ "brace-expansion@^2": "^2.0.3",
68
+ "ajv@<6.14.0": "^6.14.0",
69
+ "ajv@^7 || ^8": "^8.18.0",
70
+ "flatted@<3.4.0": "^3.4.0",
71
+ "fast-uri@<3.1.1": "^3.1.1",
72
+ "yaml@<2.8.3": "^2.8.3"
73
+ }
74
+ }
75
+ }
76
+ ```
77
+
78
+ Then run `pnpm install` and `pnpm why <pkg>` to verify the patched version is resolved.
79
+
80
+ **Why this format**: pnpm override selectors match against resolved versions. The `package@<range>` key form lets you target one major at a time. A bare `package: "version"` would force every consumer to the same major and break anything depending on a different one.
81
+
82
+ ### Missing GitHub artifact attestation
83
+
84
+ > X release assets are missing a GitHub artifact attestation.
85
+
86
+ **Fix**: add a release workflow that runs `actions/attest-build-provenance@v2` against the release files. Drop this at `.github/workflows/release.yml`:
87
+
88
+ ```yaml
89
+ name: Release
90
+
91
+ on:
92
+ push:
93
+ tags:
94
+ - "*"
95
+
96
+ permissions:
97
+ contents: write
98
+ id-token: write
99
+ attestations: write
100
+
101
+ jobs:
102
+ release:
103
+ runs-on: ubuntu-latest
104
+ steps:
105
+ - uses: actions/checkout@v4
106
+ - uses: pnpm/action-setup@v4
107
+ - uses: actions/setup-node@v4
108
+ with:
109
+ node-version: "20"
110
+ cache: "pnpm"
111
+ - run: pnpm install --frozen-lockfile
112
+ - run: pnpm build
113
+ - uses: actions/attest-build-provenance@v2
114
+ with:
115
+ subject-path: |
116
+ main.js
117
+ styles.css
118
+ manifest.json
119
+ - env:
120
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121
+ TAG: ${{ github.ref_name }}
122
+ run: |
123
+ gh release create "$TAG" \
124
+ --title="$TAG" \
125
+ --generate-notes \
126
+ main.js styles.css manifest.json
127
+ ```
128
+
129
+ Then cut releases by pushing a tag (e.g. `git tag 0.1.0 && git push origin 0.1.0`) instead of uploading files manually. The workflow attaches the assets and registers the attestation, which the scorecard checks against the source repo for byte-for-byte reproducibility.
130
+
131
+ ### Duplicate CSS selectors
132
+
133
+ > Unexpected duplicate selector ".foo .bar", first used at line N.
134
+
135
+ **Fix**: merge the two rule blocks. If they target the same selector and have non-overlapping properties, combine into one block. If they target the same selector and one is meant to override the other (e.g. inside a media query), wrap the override in a more specific selector or use a CSS variable.
136
+
137
+ ### `!important` declarations
138
+
139
+ > Avoid `!important`. Override styles by increasing selector specificity or using CSS variables instead.
140
+
141
+ The fix is almost never to keep `!important` and hope the scorecard ignores it. Instead, scope the rule with a parent class so it wins the cascade naturally.
142
+
143
+ ```css
144
+ /* Wrong: leans on !important to beat Obsidian's defaults */
145
+ .my-plugin-btn {
146
+ border: none !important;
147
+ background: none !important;
148
+ }
149
+
150
+ /* Right: parent class boosts specificity, no !important needed */
151
+ .my-plugin-panel .my-plugin-btn {
152
+ border: none;
153
+ background: none;
154
+ }
155
+ ```
156
+
157
+ The parent class is whatever wrapper the plugin's UI lives inside (e.g. the panel root, settings container). For toggle classes that need to beat an element's natural display, chain the toggle class with the base class for the same specificity boost: `.my-plugin-panel .my-toggle-hidden { display: none; }`.
158
+
159
+ ### `:has()` selector
160
+
161
+ > Avoid `:has()`. It can cause significant performance issues due to broad selector invalidation.
162
+
163
+ Most uses of `:has()` are stylistic preferences that can be rewritten as descendant selectors targeting the child element directly.
164
+
165
+ ```css
166
+ /* Wrong: re-styles the parent based on a descendant */
167
+ .result:has(a[href*="http"]) {
168
+ word-break: break-all;
169
+ }
170
+
171
+ /* Right: targets the child directly */
172
+ .result a[href*="http"] {
173
+ word-break: break-all;
174
+ }
175
+ ```
176
+
177
+ If the rule genuinely needs to style a parent based on a child's presence, fall back to adding a marker class via TypeScript when the child is appended (e.g. `parentEl.addClass('has-external-link')`).
178
+
179
+ ### Don't override global Obsidian UI selectors
180
+
181
+ A plugin's `styles.css` is loaded globally. Rules targeting Obsidian's built-in classes affect every other plugin and Obsidian itself, not just yours.
182
+
183
+ ```css
184
+ /* Wrong: forces flex layout on every menu in Obsidian, not just this plugin's */
185
+ .menu .menu-item {
186
+ display: flex !important;
187
+ justify-content: space-between !important;
188
+ }
189
+ ```
190
+
191
+ **Fix**: either remove the rule and accept Obsidian's default styling, or scope it. Menus appended outside your plugin's panel (via `new Menu()`) can't be scoped via parent class, so the rule has to be removed, or a marker class added when the menu is opened. The scorecard does not specifically flag this leak, but it's a hygiene rule that prevents conflicts with other plugins.
192
+
193
+ ### `obsidianmd` ESLint rules (Warnings and Risks)
194
+
195
+ `eslint-plugin-obsidianmd` enforces Obsidian-idiomatic patterns. Common signals and fixes:
196
+
197
+ #### `obsidianmd/ui/sentence-case` (Risk if disabled, Warning if violated)
198
+
199
+ User-facing strings must follow sentence case. The rule auto-detects most static strings; template literals are sometimes missed but still violate the spirit of the rule.
200
+
201
+ ```ts
202
+ // Wrong
203
+ new Notice('Click Here To Continue');
204
+ this.countEl.setText('0 selected');
205
+
206
+ // Right
207
+ new Notice('Click here to continue');
208
+ this.countEl.setText('0 Selected');
209
+ ```
210
+
211
+ **Never disable this rule.** The scorecard explicitly flags `eslint-disable-next-line obsidianmd/ui/sentence-case` as a Risk and counts each occurrence. If a string genuinely cannot be sentence case (e.g. it embeds a proper noun or product name), fix the casing instead of disabling.
212
+
213
+ **Configure the rule for domain-specific acronyms.** The rule accepts `acronyms`, `brands`, `ignoreWords`, and `ignoreRegex` options. Use these when your plugin legitimately uses acronyms or quoted button names that the rule otherwise rejects.
214
+
215
+ ```js
216
+ // eslint.config.mjs
217
+ "obsidianmd/ui/sentence-case": ["error", {
218
+ acronyms: ["SEO", "MDX", "URL", "CSV", "H1", "H2", "H3", "H4", "H5", "H6"],
219
+ ignoreRegex: ['"[^"]+"'], // ignore content inside double quotes (referenced button/control names)
220
+ }]
221
+ ```
222
+
223
+ This is the right answer when the autofix expected output is something like `'Open seo audit panel'` (downcased acronym) but the string genuinely should read `'Open SEO audit panel'`. Configuring the rule is preferred over per-line disables, which are forbidden, or awkward rephrasing.
224
+
225
+ #### `obsidianmd/prefer-create-el-shorthand` (Warning)
226
+
227
+ Use `createDiv()` and `createSpan()` instead of `createEl('div')` and `createEl('span')`.
228
+
229
+ ```ts
230
+ // Wrong
231
+ const wrap = containerEl.createEl('div', { cls: 'my-wrap' });
232
+ const label = wrap.createEl('span', { text: 'Hello' });
233
+
234
+ // Right
235
+ const wrap = containerEl.createDiv({ cls: 'my-wrap' });
236
+ const label = wrap.createSpan({ text: 'Hello' });
237
+ ```
238
+
239
+ #### `obsidianmd/prefer-active-doc` (Warning)
240
+
241
+ Use `activeDocument` instead of `document` and `activeWindow.setTimeout/setInterval/clearTimeout/clearInterval` instead of the globals. This ensures behavior in Obsidian popout windows.
242
+
243
+ ```ts
244
+ // Wrong
245
+ this.registerDomEvent(document, 'click', handler);
246
+ setTimeout(refresh, 500);
247
+ clearInterval(this.intervalId);
248
+
249
+ // Right
250
+ this.registerDomEvent(activeDocument, 'click', handler);
251
+ activeWindow.setTimeout(refresh, 500);
252
+ activeWindow.clearInterval(this.intervalId);
253
+ ```
254
+
255
+ #### `obsidianmd/no-eslint-disable-without-description` (Risk)
256
+
257
+ > Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary.
258
+
259
+ Every `eslint-disable*` comment must end with `--` and a reason.
260
+
261
+ ```ts
262
+ // Wrong
263
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
264
+
265
+ // Right
266
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- third-party type is loose
267
+ ```
268
+
269
+ This is the most common Risk-tier finding for plugins that accumulated `eslint-disable` comments before adopting the rule. Audit every existing disable comment and either add a reason or refactor the code to avoid the disable.
270
+
271
+ #### `@typescript-eslint/no-unused-vars` (Warning)
272
+
273
+ > 'foo' is defined but never used. Allowed unused args must match /^_/u.
274
+
275
+ **Fix**: prefix unused parameters with `_` (e.g. `_file`, `_index`, `_settings`). For destructured properties you don't need, remove them.
276
+
277
+ #### `@typescript-eslint/no-explicit-any` (Warning)
278
+
279
+ > Unexpected `any`. Specify a different type.
280
+
281
+ **Fix**: replace `any` with `unknown` and narrow at the use site, or with a proper type. If the API is genuinely typed loosely (e.g. `JSON.parse`), use `unknown` and validate. Reserve `any` only for cases where even `unknown` is infeasible and document with an inline disable that has a description.
282
+
283
+ #### `@typescript-eslint/no-unnecessary-type-assertion` (Error after upgrading typescript-eslint)
284
+
285
+ > This assertion is unnecessary since it does not change the type of the expression.
286
+
287
+ **Fix**: run `pnpm lint:fix`. The autofix removes the redundant assertion.
288
+
289
+ #### `@typescript-eslint/no-misused-promises` (Warning)
290
+
291
+ > Promise returned in function argument where a void return was expected.
292
+
293
+ **Fix**: explicitly `void` or `.catch()` the promise:
294
+
295
+ ```ts
296
+ // Wrong
297
+ button.onclick = async () => { await doThing(); };
298
+
299
+ // Right (fire-and-forget)
300
+ button.onclick = () => { void doThing(); };
301
+
302
+ // Better (handle errors)
303
+ button.onclick = () => { doThing().catch(console.error); };
304
+ ```
305
+
306
+ #### `@typescript-eslint/no-floating-promises` (Warning)
307
+
308
+ > Promises must be awaited, end with a call to .catch, or be explicitly marked as ignored with the `void` operator.
309
+
310
+ Same fix as above.
311
+
312
+ ### `Plugin name should not be in all caps` (manifest.json)
313
+
314
+ Lowercase the `name` field in `manifest.json`. Title case is fine; all caps is not.
315
+
316
+ ```json
317
+ // Wrong
318
+ "name": "SEO"
319
+
320
+ // Right
321
+ "name": "SEO Checker" // proper noun is OK
322
+ "name": "Search engine optimization"
323
+ ```
324
+
325
+ ## ESLint Config Pattern for the Type-Aware Rules
326
+
327
+ When you bump `eslint-plugin-obsidianmd` to a version that adds type-aware rules (0.3.0+), the rules will fail on non-TypeScript files because there is no `parserOptions.project` for them. Scope the recommended config to TS only:
328
+
329
+ ```js
330
+ import obsidianmd from "eslint-plugin-obsidianmd";
331
+
332
+ export default defineConfig([
333
+ { ignores: ["main.js", "node_modules/**", "*.js", "scripts/**"] },
334
+ // Only run obsidianmd recommended rules on TypeScript files
335
+ ...obsidianmd.configs.recommended.map((config) => ({
336
+ ...config,
337
+ files: config.files ?? ["**/*.ts"],
338
+ })),
339
+ {
340
+ files: ["**/*.ts"],
341
+ languageOptions: {
342
+ parser: tsparser,
343
+ parserOptions: { project: "./tsconfig.json", sourceType: "module" },
344
+ // ...
345
+ },
346
+ },
347
+ ]);
348
+ ```
349
+
350
+ ## Verification Workflow
351
+
352
+ After applying fixes:
353
+
354
+ 1. `pnpm install` to refresh the lockfile.
355
+ 2. `pnpm why <vulnerable-pkg>` for each advisory to confirm the patched version is resolved everywhere.
356
+ 3. `pnpm build` to confirm the production build still works.
357
+ 4. `pnpm lint` to confirm no new errors.
358
+ 5. Bump `version` in `manifest.json`, `package.json`, and `versions.json`.
359
+ 6. Commit, then tag and push the tag. The release workflow handles the rest.
360
+ 7. Wait for the scorecard to refresh (usually within an hour of the release).
361
+
362
+ ## What the Scorecard Doesn't Penalize
363
+
364
+ - Plugin runtime API surface (vault read/write, clipboard, network) — these become **Disclosures** and inform the user, not deductions.
365
+ - Obsidian API breadth — using lots of API is fine and expected.
366
+ - Plugin file count or repo size.
367
+ - The plugin's actual functionality or popularity (Maintenance and Adoption are reported separately and do not require code changes).
368
+
369
+ ## Related Documentation
370
+
371
+ - [contributing-template.md](contributing-template.md) — canonical CONTRIBUTING.md text.
372
+ - [versioning-releases.md](versioning-releases.md) — release workflow setup.
373
+ - [security-privacy.md](security-privacy.md) — dependency vulnerability handling.
374
+ - [release-readiness.md](release-readiness.md) — broader pre-release checklist.
375
+ - [code-patterns.md](../../obsidian-dev/references/code-patterns.md) — idiomatic API usage that satisfies obsidianmd rules.
376
+ - [ux-copy.md](../../obsidian-ref/references/ux-copy.md) — sentence case and other UI text rules.
@@ -51,9 +51,43 @@ If your theme requires any of the following, you **must** disclose it clearly in
51
51
 
52
52
  Themes are CSS-only and have minimal security surface area, but still follow privacy guidelines for any optional features.
53
53
 
54
+ ## Dependency Vulnerability Hygiene (Plugins)
55
+
56
+ The community scorecard scans the lockfile and flags any package with a known advisory, even if the package is dev-only and never ships in `main.js`. Common offenders are transitives pulled in by `eslint`, `eslint-plugin-obsidianmd`, and `@typescript-eslint/*`: `minimatch`, `picomatch`, `brace-expansion`, `ajv`, `flatted`, `fast-uri`, `yaml`.
57
+
58
+ Use `pnpm.overrides` in `package.json` to force patched versions of vulnerable transitives without changing direct dependencies. Major-version-scoped ranges avoid breaking consumers that depend on a specific major:
59
+
60
+ ```json
61
+ {
62
+ "pnpm": {
63
+ "overrides": {
64
+ "minimatch@<3.1.3": "^3.1.3",
65
+ "minimatch@^4 || ^5 || ^6 || ^7 || ^8": "^8.0.5",
66
+ "minimatch@^9": "^9.0.6",
67
+ "picomatch@<2.3.2": "^2.3.2",
68
+ "picomatch@^3 || ^4": "^4.0.4",
69
+ "brace-expansion@<1.1.13": "^1.1.13",
70
+ "brace-expansion@^2": "^2.0.3",
71
+ "ajv@<6.14.0": "^6.14.0",
72
+ "ajv@^7 || ^8": "^8.18.0",
73
+ "flatted@<3.4.0": "^3.4.0",
74
+ "fast-uri@<3.1.1": "^3.1.1",
75
+ "yaml@<2.8.3": "^2.8.3"
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ Verify with `pnpm install` then `pnpm why <pkg>` for each advisory. Every resolved version should be at or above the advisory's fix version.
82
+
83
+ If a direct dependency (e.g. `eslint-plugin-obsidianmd`) has a newer release that already pulls in patched transitives, prefer bumping the direct dep before adding an override. Overrides are appropriate when no upstream release covers your case.
84
+
85
+ See [scorecard-compliance.md](scorecard-compliance.md) for the full set of scorecard signals and their fixes.
86
+
54
87
  ## Related Documentation
55
88
 
56
89
  - [release-readiness.md](release-readiness.md) - Comprehensive release checklist including policy adherence
90
+ - [scorecard-compliance.md](scorecard-compliance.md) - Mapping of scorecard signals to concrete fixes
57
91
  - [manifest.md](../../obsidian-ref/references/manifest.md) - Manifest requirements (includes security-related fields)
58
92
  - [Developer Policies](https://docs.obsidian.md/Developer+policies) - Official Obsidian Developer Policies
59
93
  - [Theme Guidelines](https://docs.obsidian.md/Themes/Releasing/Theme+guidelines) - Official Theme Guidelines
@@ -18,6 +18,93 @@ Update frequency: Check Obsidian Sample Theme repo for updates
18
18
  - Attach `main.js`, `manifest.json`, and `styles.css` to the release as individual assets.
19
19
  - Follow the plugin submission process to add/update your plugin in the community catalog.
20
20
 
21
+ ### Automated plugin releases with build provenance attestation
22
+
23
+ The Obsidian community scorecard penalizes plugin releases whose assets are missing a GitHub artifact attestation. The recommended way to satisfy this signal is a tag-triggered release workflow that runs `actions/attest-build-provenance@v2` against the release files.
24
+
25
+ Drop the following at `.github/workflows/release.yml`:
26
+
27
+ ```yaml
28
+ name: Release
29
+
30
+ on:
31
+ push:
32
+ tags:
33
+ - "*"
34
+
35
+ permissions:
36
+ contents: write
37
+ id-token: write
38
+ attestations: write
39
+
40
+ jobs:
41
+ release:
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+ - uses: pnpm/action-setup@v4
46
+ - uses: actions/setup-node@v4
47
+ with:
48
+ node-version: "20"
49
+ cache: "pnpm"
50
+ - run: pnpm install --frozen-lockfile
51
+ - run: pnpm build
52
+ - uses: actions/attest-build-provenance@v2
53
+ with:
54
+ subject-path: |
55
+ main.js
56
+ styles.css
57
+ manifest.json
58
+ - env:
59
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60
+ TAG: ${{ github.ref_name }}
61
+ run: |
62
+ gh release create "$TAG" \
63
+ --title="$TAG" \
64
+ --generate-notes \
65
+ main.js styles.css manifest.json
66
+ ```
67
+
68
+ Cut releases by pushing a tag (`git tag 0.1.0 && git push origin 0.1.0`). The workflow attaches the three required assets and registers the attestation. The scorecard's "Build verified" signal also fires once the workflow has run, because the attested artifacts can be reproduced byte-for-byte from source.
69
+
70
+ For the full set of scorecard signals and their fixes, see [scorecard-compliance.md](scorecard-compliance.md).
71
+
72
+ ### Pushing tags so the workflow actually fires
73
+
74
+ Push order matters. Push commits to the default branch **first**, in a separate command, then push the tag. If you push both in a single batch (`git push --tags --follow-tags` or some GUIs), GitHub occasionally processes the tag webhook before indexing the workflow file at that ref, and the trigger silently drops.
75
+
76
+ ```bash
77
+ git push origin master # commits first
78
+ # pause a few seconds
79
+ git push origin 0.1.0 # tag in a separate command
80
+ ```
81
+
82
+ If the workflow does not fire on a tag push, diagnose with:
83
+
84
+ ```bash
85
+ gh api repos/:owner/:repo/actions/runs --jq '.workflow_runs[0:5] | .[] | {id, event, status, conclusion, head_branch, created_at}'
86
+ gh workflow list
87
+ gh api repos/:owner/:repo/actions/permissions/workflow
88
+ ```
89
+
90
+ If `gh api .../runs` is empty for the tag, the trigger was dropped. Recovery options:
91
+
92
+ - **Add `workflow_dispatch:` to the trigger** so you can re-run from the Actions tab without a re-push.
93
+ - **Re-push the tag**: `git push origin :refs/tags/0.1.0 && git push origin 0.1.0`.
94
+ - **Manually create the release** in the GitHub UI. The release will exist but it will not have the build provenance attestation, which costs scorecard points until the next release.
95
+
96
+ ### Recovery trigger
97
+
98
+ It is worth adding a manual trigger alongside the tag-push trigger so future "the workflow didn't fire" situations have a one-click fix:
99
+
100
+ ```yaml
101
+ on:
102
+ push:
103
+ tags:
104
+ - "*"
105
+ workflow_dispatch:
106
+ ```
107
+
21
108
  > [!NOTE]
22
109
  > Themes and plugins have different asset requirements and submission paths. Ensure you follow the correct flow for your project type.
23
110
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "obsidian-dev-skills",
3
- "version": "1.1.4",
4
- "description": "Agent skills for Obsidian plugin and theme development",
3
+ "version": "1.2.1",
4
+ "description": "Agent skills for Obsidian plugin and theme development, including community scorecard compliance, release workflow attestation, and dependency vulnerability hygiene.",
5
5
  "keywords": [
6
6
  "obsidian",
7
7
  "plugin",
@@ -9,7 +9,9 @@
9
9
  "development",
10
10
  "skills",
11
11
  "ai",
12
- "agent"
12
+ "agent",
13
+ "scorecard",
14
+ "compliance"
13
15
  ],
14
16
  "homepage": "https://github.com/davidvkimball/obsidian-dev-skills",
15
17
  "repository": {
@@ -18,12 +20,14 @@
18
20
  },
19
21
  "license": "MIT",
20
22
  "author": "David V. Kimball",
23
+ "funding": "https://patreon.com/davidvkimball",
21
24
  "files": [
22
25
  "obsidian-dev/",
23
26
  "obsidian-theme-dev/",
24
27
  "obsidian-ops/",
25
28
  "obsidian-ref/",
26
- "scripts/"
29
+ "scripts/init.mjs",
30
+ "scripts/setup-local.ps1"
27
31
  ],
28
32
  "bin": {
29
33
  "obsidian-dev-skills": "./scripts/init.mjs"
@@ -32,6 +36,6 @@
32
36
  "postinstall": "node ./scripts/init.mjs"
33
37
  },
34
38
  "engines": {
35
- "node": ">=16.0.0"
39
+ "node": ">=18.0.0"
36
40
  }
37
41
  }
@@ -1,8 +1,11 @@
1
- # Setup skills symlinks for this repository
2
- # This script creates symlinks to the obsidian-dev-skills repository
1
+ # Setup skills symlinks for a downstream project
2
+ # This script creates symlinks to the obsidian-dev-skills repository.
3
+ # Intended to be copied into a downstream project's scripts/ directory.
4
+ # The default $SkillsRepoPath assumes obsidian-dev-skills is a sibling
5
+ # of the downstream project's repository root.
3
6
 
4
7
  param(
5
- [string]$SkillsRepoPath = "$PSScriptRoot\..\obsidian-dev-skills"
8
+ [string]$SkillsRepoPath = "$PSScriptRoot\..\..\obsidian-dev-skills"
6
9
  )
7
10
 
8
11
  $ErrorActionPreference = "Stop"
@@ -1,40 +0,0 @@
1
- import { execSync } from 'child_process';
2
- import path from 'path';
3
- import { fileURLToPath } from 'url';
4
-
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = path.dirname(__filename);
7
- const initScript = path.join(__dirname, 'init.mjs');
8
-
9
- const projects = [
10
- "C:\\Users\\david\\Development\\obsidian-alias-filename-history",
11
- "C:\\Users\\david\\Development\\obsidian-astro-composer",
12
- "C:\\Users\\david\\Development\\obsidian-astro-modular-settings",
13
- "C:\\Users\\david\\Development\\obsidian-bases-cms",
14
- "C:\\Users\\david\\Development\\obsidian-custom-slides",
15
- "C:\\Users\\david\\Development\\obsidian-disable-tabs",
16
- "C:\\Users\\david\\Development\\obsidian-explorer-focus",
17
- "C:\\Users\\david\\Development\\obsidian-home-base",
18
- "C:\\Users\\david\\Development\\obsidian-image-manager",
19
- "C:\\Users\\david\\Development\\obsidian-oxygen-settings",
20
- "C:\\Users\\david\\Development\\obsidian-periodic-links",
21
- "C:\\Users\\david\\Development\\obsidian-property-over-file-name",
22
- "C:\\Users\\david\\Development\\obsidian-seo",
23
- "C:\\Users\\david\\Development\\obsidian-ui-tweaker",
24
- "C:\\Users\\david\\Development\\obsidian-vault-cms",
25
- "C:\\Users\\david\\Development\\obsidian-zenmode"
26
- ];
27
-
28
- for (const project of projects) {
29
- console.log(`\n🔄 Updating skills for: ${path.basename(project)}`);
30
- try {
31
- execSync(`node "${initScript}"`, {
32
- cwd: project,
33
- stdio: 'inherit',
34
- env: { ...process.env, INIT_CWD: project }
35
- });
36
- console.log(`✅ Success: ${path.basename(project)}`);
37
- } catch (error) {
38
- console.error(`❌ Failed: ${path.basename(project)} - ${error.message}`);
39
- }
40
- }
@@ -1,45 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
-
4
- const projects = [
5
- "C:\\Users\\david\\Development\\obsidian-alias-filename-history",
6
- "C:\\Users\\david\\Development\\obsidian-astro-composer",
7
- "C:\\Users\\david\\Development\\obsidian-astro-modular-settings",
8
- "C:\\Users\\david\\Development\\obsidian-bases-cms",
9
- "C:\\Users\\david\\Development\\obsidian-custom-slides",
10
- "C:\\Users\\david\\Development\\obsidian-disable-tabs",
11
- "C:\\Users\\david\\Development\\obsidian-explorer-focus",
12
- "C:\\Users\\david\\Development\\obsidian-home-base",
13
- "C:\\Users\\david\\Development\\obsidian-image-manager",
14
- "C:\\Users\\david\\Development\\obsidian-oxygen-settings",
15
- "C:\\Users\\david\\Development\\obsidian-periodic-links",
16
- "C:\\Users\\david\\Development\\obsidian-property-over-file-name",
17
- "C:\\Users\\david\\Development\\obsidian-seo",
18
- "C:\\Users\\david\\Development\\obsidian-ui-tweaker",
19
- "C:\\Users\\david\\Development\\obsidian-vault-cms",
20
- "C:\\Users\\david\\Development\\obsidian-zenmode"
21
- ];
22
-
23
- console.log('| Project | Status | Last Sync | Source |');
24
- console.log('| --- | --- | --- | --- |');
25
-
26
- for (const project of projects) {
27
- const name = path.basename(project);
28
- let agentDir = path.join(project, '.agent');
29
- if (!fs.existsSync(agentDir) && fs.existsSync(path.join(project, '.agents'))) {
30
- agentDir = path.join(project, '.agents');
31
- }
32
-
33
- const syncStatusPath = path.join(agentDir, 'sync-status.json');
34
-
35
- if (fs.existsSync(syncStatusPath)) {
36
- try {
37
- const status = JSON.parse(fs.readFileSync(syncStatusPath, 'utf8'));
38
- console.log(`| ${name} | ✅ Found | ${status.lastFullSync || 'Unknown'} | ${status.lastSyncSource || 'Unknown'} |`);
39
- } catch (e) {
40
- console.log(`| ${name} | ⚠️ Parse Error | - | - |`);
41
- }
42
- } else {
43
- console.log(`| ${name} | ❌ Missing | - | - |`);
44
- }
45
- }