@dialecte/cli 0.2.1 → 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 (4) hide show
  1. package/README.md +43 -15
  2. package/dist/cli.js +1159 -782
  3. package/dist/lookups.js +291 -177
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -71,23 +71,44 @@ Env: `RUNS=5 dialecte bench` (repetitions kept as the min); `COVERAGE_CHILD_CAP=
71
71
  Every Dialecte package ships the agent skills that describe it in `skills/<name>/SKILL.md` (open
72
72
  [Agent Skills](https://agentskills.io) format), versioned with its code.
73
73
 
74
- - **In an app**: `npx @dialecte/cli skills sync` links the skills of your `@dialecte/*` (and any other)
75
- dependencies into `.claude/skills` and `.agents/skills` (Codex, Cursor, Gemini CLI, Copilot read the
74
+ - **In an app**: `npx @dialecte/cli skills sync` links the consumer skills of your `@dialecte/*` (and any
75
+ other) dependencies into `.claude/skills` and `.agents/skills` (Codex, Cursor, Gemini CLI, Copilot read the
76
76
  latter; add `--agent copilot` for `.github/skills`). Links follow your installed versions; rerun after
77
77
  adding a dependency. `--copy` writes copies instead of links.
78
- - **Station agents (Claude Code)**: when Claude Code is a target (the default) and the project's model vendor
79
- is anthropic, `skills sync` also writes one agent per station of `dialecte-lot` into
78
+ - **Consumer and contributor skills**: a skill whose frontmatter says `metadata:` / `audience: contributor` is
79
+ for changing a dialecte package (core's `dialecte-contributing`, `dialecte-lot`); a skill without one is a
80
+ consumer skill. A sync installs the consumer skills only and names the contributor skills it left out;
81
+ `--contributing` installs them too and is remembered (`contributing` in `.dialecte-skills.json`) until
82
+ `--no-contributing` removes them. `dialecte doctor` expects the skills of the audience the manifest says;
83
+ `skills check` refuses another audience value.
84
+ - **Station agents (Claude Code)**: when Claude Code is a target (the default), the contributor skills are
85
+ installed and the project's model vendor is anthropic, `skills sync` also writes one agent per station of `dialecte-lot` into
80
86
  `.claude/agents/dialecte-<station>.md`: `implementer` and `fixer` (standard tier), `implementer-strong` and
81
- `reviewer` (strong), `eval-runner` and `standard-reader` (standard), `grader` and `searcher` (fast). Each file
87
+ `reviewer` and `grader` (strong), `eval-runner` and `standard-reader` (standard), `searcher` (fast). Each file
82
88
  sets the model (from the `dialecte models` map, as the alias Claude Code accepts: `sonnet`, `opus`,
83
89
  `haiku`) and the tools: the reviewer holds the read tools and Bash (it runs the tests) and no Write or Edit,
84
- the searcher and the grader hold read tools only. The body is a few lines naming the station, the skills to
85
- load and the never-list; it never copies a skill. The files are owned through the manifest: replaced on
90
+ the searcher and the grader hold read tools only. These files are adapters: a station's tier and access
91
+ (`read`, `review`, `edit`) are the cli's, its definition is the `dialecte-lot` skill's `references/stations.md`
92
+ (one `### <station>` section with a `- Tier:` and an `- Access:` line), and the Claude tool names are only the
93
+ Claude form of the access. The body is a few lines naming the station and its section in the installed
94
+ `.claude/skills/dialecte-lot/references/stations.md`, the skills to load and the never-list; it never copies a skill.
95
+ The `eval-runner` and the `grader` read neither the page nor a lot skill (they judge the skill under test): their
96
+ brief carries their definition and names the only skill text they read. `skills check`, in a package shipping `dialecte-lot`, refuses a
97
+ `references/stations.md` that is missing, lacks a station, has an unknown section or a `Tier:` / `Access:` line out of
98
+ line with the cli. The files are owned through the manifest: replaced on
86
99
  every sync, removed when no longer produced, and a file of your own with the same name is reported, never
87
100
  overwritten. `dialecte doctor` warns about a stale or missing one. Other hosts (Copilot / VS Code, Codex,
88
101
  Gemini) get no agent files from this command yet: the tier of each station comes from `dialecte models`
89
102
  there, as the `Tier:` line of a brief says.
90
- - **Session-start check (Claude Code)**: `skills sync` adds a `SessionStart` hook running
103
+ - **Session-start check, every agent**: when `dialecte-lot` is installed by the sync (whatever the targets),
104
+ `skills sync` writes a section in the project's root `AGENTS.md`, between `<!-- dialecte-skills:session-check -->`
105
+ and `<!-- /dialecte-skills:session-check -->`, telling the agent to run `npx --no-install @dialecte/cli doctor --brief`
106
+ at a session start. It is created when there is no `AGENTS.md`, else appended after one blank line (every byte of
107
+ your text stays, line ends included), replaced when an older release wrote another sentence, and removed (with the
108
+ blank line it added, the file deleted when nothing else is left) by `--no-session-check`, `--no-contributing` or
109
+ a sync without `dialecte-lot`. A marker without its pair, or a doubled one, leaves the file alone with a warning.
110
+ An `AGENTS.md` holding only the section is no evidence of a vendor.
111
+ - **Session-start check (Claude Code)**: the same check as an adapter: `skills sync` adds a `SessionStart` hook running
91
112
  `npx --no-install @dialecte/cli doctor --brief` (the installed cli: no download at a session start) to
92
113
  `.claude/settings.json`, inserted by a minimal text edit (the rest of your file stays byte for byte), never
93
114
  duplicated, removed when you drop the claude target. If you edited the hook's text since, removal cuts only
@@ -96,7 +117,8 @@ Every Dialecte package ships the agent skills that describe it in `skills/<name>
96
117
  versions and the station agents are in sync, otherwise one line per problem with its fix, and always exits 0.
97
118
  `--no-session-check` leaves the hook out (and removes the one a sync added). Elsewhere, the `dialecte` skill
98
119
  tells the agent to run `doctor` first.
99
- - **Working on Dialecte**: `npx @dialecte/cli skills sync --from ../` takes them from your local checkouts.
120
+ - **Working on Dialecte**: `npx @dialecte/cli skills sync --from ../ --contributing` takes them from your local
121
+ checkouts, the contributor skills included.
100
122
  - **In a package**: `dialecte skills generate` rewrites the `<!-- dialecte-skills:generated <kind> -->`
101
123
  blocks (`extensions`, `core-methods`, `hooks`, `api`, `intents`) from the source; the `api` block lists
102
124
  the methods, then one section per package entry (each `exports` subpath shipping a `.d.ts`) with the
@@ -124,8 +146,10 @@ Exit codes: 0 an answer, 1 nothing found (or a warning for `doctor`), 2 a usage
124
146
  whose arguments a caller can copy (written-out values first; never a test case field, a fixture constant
125
147
  or a cast). No such call, no example.
126
148
  - `dialecte members <expression>` (`doc.query`, `doc.query.reference`, `tx.lifecycle.extract`): the
127
- IntelliSense walk on demand, from the live types of the package where it runs. In an app, point it at
128
- the namespace holding your project's types: `--namespace <Name> --entry <module>`.
149
+ IntelliSense walk on demand, from the live types of the package where it runs. In an app it reads the
150
+ installed dialecte (a dependency built on `@dialecte/core` exporting `./<version>` with its `./<version>/test`
151
+ entry: its namespace is its name capitalized, `Scl` from `@dialecte/scl/v2019C1`); with several, it lists them and
152
+ `--package <name>` / `--version <v>` picks one. `--namespace <Name> --entry <module>` override.
129
153
  - `dialecte schema <Tag> [--package <name>]`: parents, children in order with how often each may appear,
130
154
  attributes (required, identity, default, fixed, enumeration, pattern), text, xsi:type variants - read
131
155
  through the readers of the core each installed dialecte depends on (how often a child may appear is core's
@@ -141,9 +165,8 @@ Exit codes: 0 an answer, 1 nothing found (or a warning for `doctor`), 2 a usage
141
165
  `dialecte skills sync` remembered as `vendor` in `.dialecte-skills.json`, in every skill folder of the
142
166
  project. Sync detects it from the project (`.claude/`, `AGENTS.md` + `.codex/`, `.gemini/`; a folder holding
143
167
  only the skills a sync wrote is no evidence) and asks on a terminal when several agents, a multi-vendor host
144
- (Copilot, Cursor) or none are found. Without a terminal, a first sync that cannot tell (no manifest, nothing detected) exits 2 naming
145
- `--vendor <id>`, which also sets it without asking; a project that already has a manifest and an ambiguous
146
- or empty detection keeps syncing without a vendor and is told how to set it. When manifests disagree, `models` warns on stderr, naming them, and uses the
168
+ (Copilot, Cursor) or none are found. Without a terminal, a sync that cannot tell installs the skills without a vendor (`models` stays
169
+ unset: the skills need none) and says how to set it: `--vendor <id>`, which also sets it without asking. When manifests disagree, `models` warns on stderr, naming them, and uses the
147
170
  most recently written; an unknown vendor id in a manifest is ignored with a warning. Exit 1 for an unknown
148
171
  `--vendor`, 2 when no vendor is known.
149
172
 
@@ -860,6 +883,7 @@ A package tunes them in its package.json:
860
883
  },
861
884
  "generatedDocs": [".vitepress/data/elements-catalog.json"],
862
885
  "referencePatterns": ["SPEC-[0-9]+"],
886
+ "allowReferences": ["ticket number"],
863
887
  "baseBranch": "main"
864
888
  }
865
889
  ```
@@ -869,7 +893,11 @@ when it counts no test; `changedOnly: true` marks a step that runs only the test
869
893
  so "No test files found" passes with a note instead of failing; `restoresGeneratedDocs: true` restores the `generatedDocs` byte for byte after
870
894
  it); `baseBranch` is the branch
871
895
  `worktree add` starts from and `worktree prune` compares with (default `main`); `referencePatterns` adds the package's own patterns (extended regular expressions) to the plan
872
- tags and citations `rules` and `handover` refuse.
896
+ tags and citations `rules` and `handover` refuse; `allowReferences` lifts the generic tags the package commits on
897
+ purpose - `ticket number`, `acceptance criterion`, `plan tag` (an app that cites its issue numbers) - and
898
+ refuses any other label: a citation of a standard is never allowed. A lot may hold a symbolic link, a link to a
899
+ folder included: it is hashed and scanned as its target text and committed as a link, the way git stores it (a
900
+ rehearsal copies it as the same relative link).
873
901
 
874
902
  ### GitHub text: recap and text check
875
903