dotmd-cli 0.48.1 → 0.48.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dotmd-cli",
3
- "version": "0.48.1",
3
+ "version": "0.48.3",
4
4
  "description": "CLI for managing markdown documents with YAML frontmatter — index, query, validate, graph, export, Notion sync, AI summaries.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,6 +40,7 @@
40
40
  "scripts": {
41
41
  "test": "node --test test/*.test.mjs",
42
42
  "preversion": "npm test",
43
+ "version": "node bin/dotmd.mjs hud >/dev/null 2>&1; git add .claude/commands docs/docs.md 2>/dev/null; true",
43
44
  "postversion": "git push origin main --tags && gh release create v$npm_package_version --generate-notes --title v$npm_package_version && sleep 5 && gh run watch $(gh run list --workflow=publish.yml --limit 1 --json databaseId --jq '.[0].databaseId') --exit-status && sleep 10 && npm cache clean --force && npm install -g dotmd-cli@$npm_package_version"
44
45
  },
45
46
  "engines": {
@@ -229,22 +229,12 @@ export function refreshStaleSlashCommands(config) {
229
229
  return results.filter(r => r.action === 'updated');
230
230
  }
231
231
 
232
- export function checkClaudeCommands(cwd, opts = {}) {
233
- const { version = pkg.version } = opts;
234
- const commandsDir = path.join(cwd, '.claude', 'commands');
235
- if (!existsSync(commandsDir)) return [];
236
-
237
- const warnings = [];
238
- for (const name of ['plans.md', 'docs.md', 'baton.md']) {
239
- const filePath = path.join(commandsDir, name);
240
- const installedVersion = getInstalledVersion(filePath);
241
- if (installedVersion && installedVersion !== version) {
242
- warnings.push({
243
- path: `.claude/commands/${name}`,
244
- level: 'warning',
245
- message: `Claude command outdated (v${installedVersion} → v${version}). Run \`dotmd doctor\` to update.`,
246
- });
247
- }
248
- }
249
- return warnings;
232
+ // Intentionally returns []. Slash-command stamp drift is auto-healed every
233
+ // time `dotmd hud` runs (SessionStart hook), and `dotmd doctor` regens them
234
+ // on demand. Surfacing a warning at `dotmd check` time was pure noise — it
235
+ // fired on every release until the next session, despite the user having no
236
+ // action to take (the heal is automatic). Kept the function for API stability
237
+ // in case downstream callers import it.
238
+ export function checkClaudeCommands(_cwd, _opts = {}) {
239
+ return [];
250
240
  }
package/src/new.mjs CHANGED
@@ -22,6 +22,23 @@ function surfacesScaffold(ctx) {
22
22
  return 'surfaces:';
23
23
  }
24
24
 
25
+ // Module-taxonomy parallel of surfacesScaffold. When `taxonomy.modules` is set,
26
+ // scaffold lists valid values + a `- none` placeholder so the validator's
27
+ // modules-required check passes by default and the author can swap to a real
28
+ // module from the listed taxonomy. When unset, the project doesn't enumerate
29
+ // modules — drop the placeholder entirely so new plans aren't sprinkled with a
30
+ // meaningless sentinel.
31
+ function modulesScaffold(ctx, kind /* 'doc' | 'plan' */) {
32
+ const valid = ctx?.validModules;
33
+ if (Array.isArray(valid) && valid.length > 0) {
34
+ const comment = kind === 'plan'
35
+ ? `# modules — valid: ${valid.join(', ')} (or \`none\` for tooling/infra plans)`
36
+ : `# modules — valid: ${valid.join(', ')} (or \`none\` for platform/infra docs)`;
37
+ return `${comment}\nmodules:\n - none`;
38
+ }
39
+ return 'modules:';
40
+ }
41
+
25
42
  const BUILTIN_TEMPLATES = {
26
43
  doc: {
27
44
  description: 'Reference doc, design note, module overview — build-up shape lite',
@@ -35,9 +52,7 @@ const BUILTIN_TEMPLATES = {
35
52
  `status: ${s}`,
36
53
  `created: ${d}`,
37
54
  `updated: ${d}`,
38
- '# modules — real module name(s), or `none` for platform/infra docs',
39
- 'modules:',
40
- ' - none',
55
+ modulesScaffold(ctx, 'doc'),
41
56
  surfacesScaffold(ctx),
42
57
  'domain:',
43
58
  'audience: internal',
@@ -75,9 +90,7 @@ ${ctx?.bodyInput?.trim() ?? ''}
75
90
  `created: ${d}`,
76
91
  `updated: ${d}`,
77
92
  surfacesScaffold(ctx),
78
- '# modules — real module name(s), or `none` for tooling/infra plans',
79
- 'modules:',
80
- ' - none',
93
+ modulesScaffold(ctx, 'plan'),
81
94
  'domain:',
82
95
  'audience: internal',
83
96
  'parent_plan:',
@@ -477,7 +490,8 @@ export async function runNew(argv, config, opts = {}) {
477
490
  // Generate content
478
491
  let content;
479
492
  const validSurfaces = config.raw?.taxonomy?.surfaces ?? (config.validSurfaces ? [...config.validSurfaces] : null);
480
- const tmplCtx = { status, title: docTitle, today, bodyInput, validSurfaces };
493
+ const validModules = config.raw?.taxonomy?.modules ?? (config.validModules ? [...config.validModules] : null);
494
+ const tmplCtx = { status, title: docTitle, today, bodyInput, validSurfaces, validModules };
481
495
  if (typeof template === 'function') {
482
496
  content = template(name, tmplCtx);
483
497
  } else {
package/src/runlist.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { readFileSync } from 'node:fs';
1
+ import { existsSync, readFileSync } from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { extractFrontmatter, parseSimpleFrontmatter } from './frontmatter.mjs';
4
4
  import {
@@ -14,6 +14,34 @@ import { bold, cyan, dim, green, red, yellow } from './color.mjs';
14
14
 
15
15
  const PICKUPABLE_STATUSES = new Set(['active', 'planned', 'in-session']);
16
16
 
17
+ // resolveDocPath only tries cwd / repo-root / docs-root joins, so bare plan
18
+ // slugs like `clear-the-deck` don't resolve when plans live under
19
+ // `<docsRoot>/plans/`. The other commands (`dotmd set <slug>`, `dotmd plans`)
20
+ // take slugs — runlist should too. Try the direct resolve first, then
21
+ // fall back to `<root>/plans/<slug>.md` under each configured doc root.
22
+ function resolveHubInput(input, config) {
23
+ const direct = resolveDocPath(input, config);
24
+ if (direct) return direct;
25
+
26
+ if (!input.endsWith('.md')) {
27
+ const withExt = resolveDocPath(input + '.md', config);
28
+ if (withExt) return withExt;
29
+ }
30
+
31
+ const slugFile = input.endsWith('.md') ? input : `${input}.md`;
32
+ const roots = config.docsRoots || (config.docsRoot ? [config.docsRoot] : []);
33
+ for (const root of roots) {
34
+ const candidate = path.join(root, 'plans', slugFile);
35
+ if (existsSync(candidate)) return candidate;
36
+ // Multi-root layouts may already have a `plans` root, so also try the
37
+ // root itself.
38
+ const rootCandidate = path.join(root, slugFile);
39
+ if (existsSync(rootCandidate)) return rootCandidate;
40
+ }
41
+
42
+ return null;
43
+ }
44
+
17
45
  // Read a hub plan's `runlist:` and resolve each entry to a repo-relative path
18
46
  // plus its current status. Missing files are reported with `missing: true`;
19
47
  // callers decide how to render them. Pure: no IO beyond file reads.
@@ -112,7 +140,7 @@ export async function runRunlist(argv, config, opts = {}) {
112
140
  : 'Usage: dotmd runlist <hub-plan>');
113
141
  }
114
142
 
115
- const hubAbs = resolveDocPath(hubInput, config);
143
+ const hubAbs = resolveHubInput(hubInput, config);
116
144
  if (!hubAbs) die(`Hub plan not found: ${hubInput}`);
117
145
  const hubRepoPath = toRepoPath(hubAbs, config.repoRoot);
118
146