@ascribed/cli 0.2.1-next.14 → 0.2.1-next.16

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
@@ -9,11 +9,11 @@ npx ascribe build
9
9
  npx ascribe fmt --check
10
10
  ```
11
11
 
12
- The [command reference](https://ascribed-dev.com/reference/cli/) covers every command, option, output, and exit code, and [Getting started](https://ascribed-dev.com/getting-started/) sets up a project.
12
+ The [command reference](https://ascribed-dev.com/go/cli-reference/) covers every command, option, output, and exit code, and [Getting started](https://ascribed-dev.com/go/getting-started/) sets up a project.
13
13
 
14
14
  ## The skill
15
15
 
16
- The package ships the Ascribe skill, in the [Agent Skills](https://agentskills.io) format, as `skills/ascribe/`, for tools that install skills from packages. It teaches an AI coding agent to check and fix Ascribe pages. In a project, `npx ascribe agents sync` writes it where agents look, with the project's own rules: see [Agents](https://ascribed-dev.com/guides/agents/).
16
+ The package ships the Ascribe skill, in the [Agent Skills](https://agentskills.io) format, as `skills/ascribe/`, for tools that install skills from packages. It teaches an AI coding agent to check and fix Ascribe pages. In a project, `npx ascribe agents sync` writes it where agents look, with the project's own rules: see [Agents](https://ascribed-dev.com/go/agents-guide/).
17
17
 
18
18
  ## Platforms
19
19
 
package/dist/binary.d.ts CHANGED
@@ -10,5 +10,3 @@ export declare function nativePackageName(currentPlatform?: string, currentArch?
10
10
  * tests; callers normally use `resolveBinary()` with no arguments.
11
11
  */
12
12
  export declare function resolveBinary(options?: BinaryPlatform): string;
13
- /** Backwards-compatible name for resolveBinary. */
14
- export declare const nativeBinaryPath: (currentPlatform?: string, currentArch?: string) => string;
package/dist/binary.js CHANGED
@@ -36,11 +36,4 @@ export function resolveBinary(options = {}) {
36
36
  "dependencies are enabled. The package manager must not omit optional dependencies.", { cause: error });
37
37
  }
38
38
  }
39
- /** Backwards-compatible name for resolveBinary. */
40
- export const nativeBinaryPath = (currentPlatform, currentArch) => resolveBinary(currentPlatform === undefined && currentArch === undefined
41
- ? {}
42
- : {
43
- ...(currentPlatform === undefined ? {} : { platform: currentPlatform }),
44
- ...(currentArch === undefined ? {} : { arch: currentArch }),
45
- });
46
39
  //# sourceMappingURL=binary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"binary.js","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,QAAQ,GAA2B;IACvC,cAAc,EAAE,4BAA4B;IAC5C,aAAa,EAAE,2BAA2B;IAC1C,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,yBAAyB;CACvC,CAAC;AAOF,MAAM,UAAU,iBAAiB,CAC/B,eAAe,GAAW,QAAQ,EAClC,WAAW,GAAW,IAAI;IAE1B,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,eAAe,IAAI,WAAW,EAAE,CAAC,CAAC;IAC3D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,kCAAkC,eAAe,IAAI,WAAW,IAAI;YAClE,uEAAuE,CAC1E,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAAO,GAAmB,EAAE;IACxD,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IACrD,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC;IACzC,MAAM,WAAW,GAAG,iBAAiB,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IACpE,MAAM,UAAU,GAAG,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,WAAW,QAAQ,UAAU,EAAE,CAAC,CAAC;IAC7D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,KAAK,CACb,mDAAmD,WAAW,GAAG,MAAM,IAAI;YACzE,+BAA+B,eAAe,IAAI,WAAW,wBAAwB;YACrF,oFAAoF,EACtF,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;AACH,CAAC;AAED,mDAAmD;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,eAAwB,EAAE,WAAoB,EAAU,EAAE,CACzF,aAAa,CACX,eAAe,KAAK,SAAS,IAAI,WAAW,KAAK,SAAS;IACxD,CAAC,CAAC,EAAE;IACJ,CAAC,CAAC;QACE,GAAG,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;QACvE,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;KAC5D,CACN,CAAC","sourcesContent":["import { createRequire } from \"node:module\";\nimport { arch, platform } from \"node:process\";\n\nconst require = createRequire(import.meta.url);\n\nconst packages: Record<string, string> = {\n \"darwin-arm64\": \"@ascribed/cli-darwin-arm64\",\n \"linux-arm64\": \"@ascribed/cli-linux-arm64\",\n \"linux-x64\": \"@ascribed/cli-linux-x64\",\n \"win32-x64\": \"@ascribed/cli-win32-x64\",\n};\n\nexport interface BinaryPlatform {\n platform?: string;\n arch?: string;\n}\n\nexport function nativePackageName(\n currentPlatform: string = platform,\n currentArch: string = arch,\n): string {\n const name = packages[`${currentPlatform}-${currentArch}`];\n if (name === undefined) {\n throw new Error(\n `@ascribed/cli does not support ${currentPlatform}/${currentArch}. ` +\n \"Supported platforms are darwin arm64, linux arm64/x64, and win32 x64.\",\n );\n }\n return name;\n}\n\n/**\n * Resolve the installed native executable for the current machine.\n *\n * The optional `platform` and `arch` arguments are intended for packaging\n * tests; callers normally use `resolveBinary()` with no arguments.\n */\nexport function resolveBinary(options: BinaryPlatform = {}): string {\n const currentPlatform = options.platform ?? platform;\n const currentArch = options.arch ?? arch;\n const packageName = nativePackageName(currentPlatform, currentArch);\n const executable = currentPlatform === \"win32\" ? \"ascribe.exe\" : \"ascribe\";\n try {\n return require.resolve(`${packageName}/bin/${executable}`);\n } catch (error) {\n const reason = error instanceof Error ? ` (${error.message})` : \"\";\n throw new Error(\n `@ascribed/cli could not find its native package ${packageName}${reason}. ` +\n `Reinstall @ascribed/cli for ${currentPlatform}/${currentArch}, and ensure optional ` +\n \"dependencies are enabled. The package manager must not omit optional dependencies.\",\n { cause: error },\n );\n }\n}\n\n/** Backwards-compatible name for resolveBinary. */\nexport const nativeBinaryPath = (currentPlatform?: string, currentArch?: string): string =>\n resolveBinary(\n currentPlatform === undefined && currentArch === undefined\n ? {}\n : {\n ...(currentPlatform === undefined ? {} : { platform: currentPlatform }),\n ...(currentArch === undefined ? {} : { arch: currentArch }),\n },\n );\n"]}
1
+ {"version":3,"file":"binary.js","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,QAAQ,GAA2B;IACvC,cAAc,EAAE,4BAA4B;IAC5C,aAAa,EAAE,2BAA2B;IAC1C,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,yBAAyB;CACvC,CAAC;AAOF,MAAM,UAAU,iBAAiB,CAC/B,eAAe,GAAW,QAAQ,EAClC,WAAW,GAAW,IAAI;IAE1B,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,eAAe,IAAI,WAAW,EAAE,CAAC,CAAC;IAC3D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,kCAAkC,eAAe,IAAI,WAAW,IAAI;YAClE,uEAAuE,CAC1E,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAAO,GAAmB,EAAE;IACxD,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IACrD,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC;IACzC,MAAM,WAAW,GAAG,iBAAiB,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IACpE,MAAM,UAAU,GAAG,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,WAAW,QAAQ,UAAU,EAAE,CAAC,CAAC;IAC7D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,KAAK,CACb,mDAAmD,WAAW,GAAG,MAAM,IAAI;YACzE,+BAA+B,eAAe,IAAI,WAAW,wBAAwB;YACrF,oFAAoF,EACtF,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { createRequire } from \"node:module\";\nimport { arch, platform } from \"node:process\";\n\nconst require = createRequire(import.meta.url);\n\nconst packages: Record<string, string> = {\n \"darwin-arm64\": \"@ascribed/cli-darwin-arm64\",\n \"linux-arm64\": \"@ascribed/cli-linux-arm64\",\n \"linux-x64\": \"@ascribed/cli-linux-x64\",\n \"win32-x64\": \"@ascribed/cli-win32-x64\",\n};\n\nexport interface BinaryPlatform {\n platform?: string;\n arch?: string;\n}\n\nexport function nativePackageName(\n currentPlatform: string = platform,\n currentArch: string = arch,\n): string {\n const name = packages[`${currentPlatform}-${currentArch}`];\n if (name === undefined) {\n throw new Error(\n `@ascribed/cli does not support ${currentPlatform}/${currentArch}. ` +\n \"Supported platforms are darwin arm64, linux arm64/x64, and win32 x64.\",\n );\n }\n return name;\n}\n\n/**\n * Resolve the installed native executable for the current machine.\n *\n * The optional `platform` and `arch` arguments are intended for packaging\n * tests; callers normally use `resolveBinary()` with no arguments.\n */\nexport function resolveBinary(options: BinaryPlatform = {}): string {\n const currentPlatform = options.platform ?? platform;\n const currentArch = options.arch ?? arch;\n const packageName = nativePackageName(currentPlatform, currentArch);\n const executable = currentPlatform === \"win32\" ? \"ascribe.exe\" : \"ascribe\";\n try {\n return require.resolve(`${packageName}/bin/${executable}`);\n } catch (error) {\n const reason = error instanceof Error ? ` (${error.message})` : \"\";\n throw new Error(\n `@ascribed/cli could not find its native package ${packageName}${reason}. ` +\n `Reinstall @ascribed/cli for ${currentPlatform}/${currentArch}, and ensure optional ` +\n \"dependencies are enabled. The package manager must not omit optional dependencies.\",\n { cause: error },\n );\n }\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- export { nativeBinaryPath, nativePackageName, resolveBinary } from "./binary.js";
2
+ export { nativePackageName, resolveBinary } from "./binary.js";
3
3
  export type { BinaryPlatform } from "./binary.js";
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { spawn } from "node:child_process";
3
3
  import { realpathSync } from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { resolveBinary } from "./binary.js";
6
- export { nativeBinaryPath, nativePackageName, resolveBinary } from "./binary.js";
6
+ export { nativePackageName, resolveBinary } from "./binary.js";
7
7
  if (process.argv[1] && realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {
8
8
  const child = spawn(resolveBinary(), process.argv.slice(2), {
9
9
  stdio: "inherit",
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjF,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACxF,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QAC1D,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QAC1B,OAAO,CAAC,KAAK,CAAC,oDAAoD,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACnF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACxB,OAAO,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { spawn } from \"node:child_process\";\nimport { realpathSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { resolveBinary } from \"./binary.js\";\n\nexport { nativeBinaryPath, nativePackageName, resolveBinary } from \"./binary.js\";\nexport type { BinaryPlatform } from \"./binary.js\";\n\nif (process.argv[1] && realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {\n const child = spawn(resolveBinary(), process.argv.slice(2), {\n stdio: \"inherit\",\n windowsHide: false,\n });\n child.on(\"error\", (error) => {\n console.error(`@ascribed/cli could not start the native binary: ${error.message}`);\n process.exitCode = 1;\n });\n child.on(\"exit\", (code) => {\n process.exitCode = code ?? 1;\n });\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG/D,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACxF,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QAC1D,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QAC1B,OAAO,CAAC,KAAK,CAAC,oDAAoD,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACnF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACxB,OAAO,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { spawn } from \"node:child_process\";\nimport { realpathSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { resolveBinary } from \"./binary.js\";\n\nexport { nativePackageName, resolveBinary } from \"./binary.js\";\nexport type { BinaryPlatform } from \"./binary.js\";\n\nif (process.argv[1] && realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {\n const child = spawn(resolveBinary(), process.argv.slice(2), {\n stdio: \"inherit\",\n windowsHide: false,\n });\n child.on(\"error\", (error) => {\n console.error(`@ascribed/cli could not start the native binary: ${error.message}`);\n process.exitCode = 1;\n });\n child.on(\"exit\", (code) => {\n process.exitCode = code ?? 1;\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ascribed/cli",
3
- "version": "0.2.1-next.14",
3
+ "version": "0.2.1-next.16",
4
4
  "description": "The Ascribe command-line tool.",
5
5
  "type": "module",
6
6
  "license": "MPL-2.0",
@@ -32,10 +32,10 @@
32
32
  "node": ">=24"
33
33
  },
34
34
  "optionalDependencies": {
35
- "@ascribed/cli-darwin-arm64": "0.2.1-next.14",
36
- "@ascribed/cli-linux-arm64": "0.2.1-next.14",
37
- "@ascribed/cli-linux-x64": "0.2.1-next.14",
38
- "@ascribed/cli-win32-x64": "0.2.1-next.14"
35
+ "@ascribed/cli-darwin-arm64": "0.2.1-next.16",
36
+ "@ascribed/cli-linux-arm64": "0.2.1-next.16",
37
+ "@ascribed/cli-linux-x64": "0.2.1-next.16",
38
+ "@ascribed/cli-win32-x64": "0.2.1-next.16"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^24.0.0"
@@ -43,7 +43,7 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "7f59c3e433d6830ddb59e07f050bd1ac21f71d11",
46
+ "gitHead": "0077fa1e1fcd4ef67f9c6d48575c3f06f98adce8",
47
47
  "scripts": {
48
48
  "build": "tsc -p tsconfig.json",
49
49
  "typecheck": "tsc --noEmit",
@@ -3,12 +3,12 @@ name: ascribe
3
3
  description: "Write and fix Markdown docs in an Ascribe project: pages with YAML frontmatter, `@` directives, and `{phrase}` keys, checked against the content model in `ascribe.toml`. Use when adding or editing pages in a folder with an `ascribe.toml`, fixing what `ascribe check` reports, or finding which frontmatter, directives, and phrases the project allows."
4
4
  license: MPL-2.0
5
5
  metadata:
6
- ascribe-version: "0.2.1-next.14"
6
+ ascribe-version: "0.2.1-next.16"
7
7
  ---
8
8
 
9
9
  # Ascribe
10
10
 
11
- Ascribe pages are Markdown with YAML frontmatter, `@` directives, and `{phrase}` keys, checked against a content model, `ascribe.toml`. A project's own rules (its page types, phrases, and the directives its pages use) are in the `AGENTS.md` beside its `ascribe.toml`, and `ascribe model` shows everything the content model allows. Read them before writing frontmatter, a directive, or a phrase.
11
+ Ascribe pages are Markdown with YAML frontmatter, `@` directives, and `{phrase}` keys, checked against a content model, `ascribe.toml`. A project's own rules (its page types, phrases, and the directives its pages use) are what `ascribe agents rules` prints, from anywhere in the project; a project that ran `ascribe agents sync` also has them in the `AGENTS.md` beside its `ascribe.toml`, and one that didn't has no such file. `ascribe model` shows everything the content model allows. Read them before writing frontmatter, a directive, or a phrase.
12
12
 
13
13
  ## The loop
14
14
 
@@ -30,18 +30,28 @@ When `ascribe` isn't on the path, the project may pin it in a `package.json`: ru
30
30
  Each changes nothing, and each takes `--format json`.
31
31
 
32
32
  - `ascribe explain <code>`: what a diagnostic means, how to fix it, and an example.
33
- - `ascribe model`: what the content model allows: page types and their frontmatter, dimensions, phrases, features, glossary terms, widgets, and builds.
33
+ - `ascribe model`: what the content model allows: page types and their frontmatter, dimensions, phrases, features, glossary terms, widgets, builds, and sources.
34
34
  - `ascribe outline <page>`: a page's title, type, and headings, with the ids links use.
35
35
  - `ascribe link <target> --from <page>`: whether a link works from a page, and what to write.
36
36
  - `ascribe render <page> --build <name>`: a page as one build's readers see it.
37
37
  - `ascribe refs <target>`: where a page, a heading (`guides/install.md#configure`), a phrase (`phrase:product`), or another entry is used.
38
- - `ascribe check --summary`: the problems counted by code and by file, for a project with many.
38
+ - `ascribe check --summary`: the problems counted by code and by file, for a project with many; `ascribe check --code <code>` then shows one code's, to fix one rule at a time.
39
+ - `ascribe diff`: which pages changed since the default branch, as readers see them, block by block; `ascribe diff <page>` shows one page's. To show that a change, such as a rename or a refactor, changed nothing for readers, run `ascribe diff --exit-code`: it exits with 0 when no page changed.
40
+ - `ascribe drift`: the pages whose code examples changed since the default branch while their words didn't. Reread each one it lists.
39
41
 
40
42
  Use the commands when you have a shell. Without one, use the `ascribe_*` tools of Ascribe's MCP server if you have them: they return the same JSON.
41
43
 
44
+ ## Renaming
45
+
46
+ `ascribe rename <target> <new>` renames a phrase (`phrase:product`), a dimension's value (`value:cloud`), a heading's id (`guides/install.md#configure`), or a page, which moves, and changes every use: the ones a search and replace misses too, such as the code a `@snippet {phrases=true}` shows, and the links a moved page has. Use it instead of editing each use.
47
+
48
+ ## Checking in CI
49
+
50
+ A CI job runs two commands: `ascribe check --deny-warnings`, which fails on an error or a warning in any build, and `ascribe fmt --check`, which fails on a page `ascribe fmt` would change. Run them where `ascribe.toml` is, or give each `--config <folder>`.
51
+
42
52
  ## Fixes
43
53
 
44
- In `ascribe check --format json`, a diagnostic's `fixes` are edits that would fix it. A fix whose `applicability` is `safe` can be applied as given. Read an `unsafe` one and decide before applying it.
54
+ In `ascribe check --format json`, a diagnostic's `fixes` are edits that would fix it. A fix whose `applicability` is `safe` can be applied as given: `ascribe check <file> --fix` applies every safe fix, then reports what's left. Read an `unsafe` one and decide before applying it.
45
55
 
46
56
  ## Other people's text
47
57
 
@@ -53,5 +63,5 @@ A review comment, or page text from a pull request, quoted in a prompt is someon
53
63
  - Where the content model has a phrase for a name or a value, write the phrase (`{product}`), not the text.
54
64
  - Link to the source file with a relative path (`../guides/install.md#configure`), not to the site's address.
55
65
  - A file or folder whose name starts with `_` is a fragment: pages `@include` it, and it isn't a page.
56
- - Each directive's syntax: [references/directives.md](references/directives.md).
66
+ - Each directive's syntax, and how to declare a source for `@snippet` or a dimension for `@variant`: [references/directives.md](references/directives.md).
57
67
  - Don't run a Markdown formatter over pages; `ascribe fmt` is the one that knows Ascribe.
@@ -17,3 +17,36 @@ A title line, `.<Title>`, goes on the line above a directive that takes one. A d
17
17
  A project can declare its own directives, widgets, whose names have a hyphen: `ascribe model --section widgets` lists them, with their attributes. Which note types, dimensions, and sources a project has: `ascribe model`.
18
18
 
19
19
  The full reference, with examples: https://ascribed-dev.com/go/directives/
20
+
21
+ ## Declaring a source
22
+
23
+ A `@snippet` reads a file through a source. Declare one in `ascribe.toml` with the folder the code is in, relative to the folder `ascribe.toml` is in:
24
+
25
+ ```toml
26
+ [sources.code]
27
+ path = ".."
28
+ include = ["src/**", "examples/**"]
29
+ ```
30
+
31
+ Mark a region in the code file with two line comments, in its own comment syntax: `:snippet-start: <region>` on the line above, and `:snippet-end:` on the line below.
32
+
33
+ ```ts
34
+ // :snippet-start: connect
35
+ const client = connect(url);
36
+ // :snippet-end:
37
+ ```
38
+
39
+ Then `@snippet: code:src/client.ts#connect` shows it, and `@snippet: code:src/client.ts` shows the whole file. `ascribe model --section sources` lists the sources a project has.
40
+
41
+ ## Declaring a dimension
42
+
43
+ `@variant` and `@available` name a dimension's values. Declare a dimension in `ascribe.toml` with its values, and optionally the labels readers see:
44
+
45
+ ```toml
46
+ [dimensions.platform]
47
+ label = "Platform"
48
+ values = ["linux", "macos", "windows"]
49
+ labels = { macos = "macOS" }
50
+ ```
51
+
52
+ A value belongs to one dimension only. `ascribe model --section dimensions` lists the dimensions a project has.