@recallnet/remark-lint-docs-freshness 0.2.2 → 0.2.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.
Files changed (2) hide show
  1. package/README.md +56 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -2,9 +2,64 @@
2
2
 
3
3
  Checks Markdown frontmatter `reviewed` dates against policy-defined `max_age_days`.
4
4
 
5
- Use with `remark-frontmatter`:
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -D remark remark-frontmatter @recallnet/remark-lint-docs-freshness
9
+ ```
10
+
11
+ ## Use
12
+
13
+ Use with `remark-frontmatter` so YAML frontmatter is available to the rule:
6
14
 
7
15
  ```js
16
+ import { remark } from "remark";
8
17
  import remarkFrontmatter from "remark-frontmatter";
9
18
  import remarkLintDocsFreshness from "@recallnet/remark-lint-docs-freshness";
19
+
20
+ await remark()
21
+ .use(remarkFrontmatter)
22
+ .use(remarkLintDocsFreshness, {
23
+ cwd: process.cwd(),
24
+ policyPath: "./docs/docs-policy.json",
25
+ })
26
+ .process({
27
+ path: "docs/architecture/cache.md",
28
+ value: `---
29
+ review_policy: periodic-7
30
+ reviewed: 2026-03-01
31
+ ---
32
+
33
+ # Cache`,
34
+ });
10
35
  ```
36
+
37
+ ## What It Checks
38
+
39
+ - only files that match `in_scope_paths` in `docs/docs-policy.json`
40
+ - only docs using periodic review policies
41
+ - frontmatter `reviewed` values in `YYYY-MM-DD` format
42
+ - whether `reviewed` is older than the policy's `max_age_days`
43
+
44
+ The rule reports messages such as:
45
+
46
+ ```text
47
+ Document is stale: reviewed=2026-03-01 age_days=18 max_age_days=7.
48
+ ```
49
+
50
+ ## Options
51
+
52
+ - `cwd`
53
+ Repository root used to resolve the docs policy and the current file path.
54
+ - `policyPath`
55
+ Path to the docs policy file relative to `cwd`.
56
+ Defaults to `docs/docs-policy.json`.
57
+ - `today`
58
+ Override the current date as `YYYY-MM-DD`.
59
+ Useful for deterministic tests.
60
+
61
+ ## Notes
62
+
63
+ - Docs with non-periodic policies such as `historical` are ignored.
64
+ - If frontmatter is missing or unreadable for an in-scope file, the rule reports that freshness could not be checked.
65
+ - This package is intended for docs-governance setups that keep freshness policy in repo config rather than hardcoding date thresholds in lint config.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recallnet/remark-lint-docs-freshness",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Remark plugin that checks docs reviewed dates against repo policy.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "yaml": "^2.8.3",
29
- "@recallnet/docs-governance-policy": "0.2.2"
29
+ "@recallnet/docs-governance-policy": "0.2.3"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "remark-frontmatter": "^5.0.0"