@db-ux/agent-cli 3.0.2-copilot2-e7bf98b → 3.1.18

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 (3) hide show
  1. package/README.md +23 -4
  2. package/build/index.js +5 -5
  3. package/package.json +11 -11
package/README.md CHANGED
@@ -7,17 +7,19 @@
7
7
 
8
8
  ## Usage
9
9
 
10
- We provide a cli tool to copy `@db-ux` docs to your repository to provide it for AI Agents.
10
+ We provide a command-line interface (CLI) tool that copies the `@db-ux` documentation to your repository, making it available to AI agents.
11
+
12
+ ### Running the CLI Tool
13
+
11
14
  Use this command in your repository:
12
15
 
13
16
  ```shell
14
17
  npx @db-ux/agent-cli
15
18
  ```
16
19
 
17
- This will search for all `@db-ux` packages inside your `node_modules` and copy the documentation to your repository.
18
- A new folder will be created named `_db-ux-docs`.
20
+ The DB UX Design System documentation will be added to (or replaced in subsequent runs, e.g. after a DB UX Design System update) in the file `.github/copilot-instructions.md` (if this file does not yet exist in your codebase, it will be created).
19
21
 
20
- You might want to add this folder to your `.gitignore` file.
22
+ ### Advanced Usage
21
23
 
22
24
  You can also change the root path where the tool should check for `node_modules`:
23
25
 
@@ -25,6 +27,23 @@ You can also change the root path where the tool should check for `node_modules`
25
27
  npx @db-ux/agent-cli packages/frontend
26
28
  ```
27
29
 
30
+ This is useful in monorepo setups where your DB UX packages might be installed in a specific workspace directory.
31
+
32
+ ### What the tool does
33
+
34
+ 1. **Scans your project's node_modules** for installed `@db-ux` packages
35
+ 2. **Extracts relevant documentation** based on your installed versions
36
+ 3. **Creates or updates** `.github/copilot-instructions.md` with component documentation
37
+ 4. **Provides AI agents** with context about available components and their usage patterns
38
+
39
+ ### Best practices
40
+
41
+ We've had the best experience with GitHub Copilot when using the following settings:
42
+
43
+ - Agent mode works best for code generation and may also offer the best developer experience.
44
+ - Regarding the provided models, GPT-4o seemed to strike the best balance between "used tokens" and performance, although "Claude Sonnet 4" is still better. However, you run out of tokens quite quickly with this model.
45
+ - If you're primarily interested in testing this functionality at the moment, we have quite a bit of experience using a prompt that is both equal and non-trivial, but rather complex, such as "Can you create a new page with a dashboard? It should contain selections for KPIs. Each KPI is a card containing information and buttons."
46
+
28
47
  ## Deutsche Bahn brand
29
48
 
30
49
  As we'd like to perfectly support our users and customers on their digital journey, the usage of Deutsche Bahn brand and trademarks are bound of clear guidelines and restrictions even if being used with the code that we're providing with this product; Deutsche Bahn fully reserves all rights regarding the Deutsche Bahn brand, even though that we're providing the code of DB UX Design System products free to use and release it under the Apache 2.0 license.
package/build/index.js CHANGED
@@ -10,7 +10,7 @@ function findAllNodeModulesDirectories(directory, found = []) {
10
10
  if (!fs.existsSync(directory)) {
11
11
  return found;
12
12
  }
13
- const entries = fs.readdirSync(directory, { withFileTypes: true });
13
+ const entries = fs.readdirSync(directory, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name, "en"));
14
14
  for (const entry of entries) {
15
15
  if (entry.isDirectory()) {
16
16
  if (entry.name === "node_modules") {
@@ -35,8 +35,8 @@ var generateCopilot = (rootPath) => {
35
35
  let copilotInstructionsContent = "";
36
36
  for (const nodeModulesPath of nodeModulesDirectories) {
37
37
  const databaseUxPaths = [
38
- path.join(nodeModulesPath, "@db-ux"),
39
- path.join(nodeModulesPath, "@db-ux-inner-source")
38
+ path.join(nodeModulesPath, "@db-ux/"),
39
+ path.join(nodeModulesPath, "@db-ux-inner-source/")
40
40
  ];
41
41
  for (const databaseUxPath of databaseUxPaths) {
42
42
  if (!fs.existsSync(databaseUxPath)) {
@@ -90,8 +90,8 @@ ${content}
90
90
  copilotInstructionsPath,
91
91
  "utf8"
92
92
  );
93
- const startMarker = "--- START: DB UX Copilot Instructions ---";
94
- const endMarker = "--- END: DB UX Copilot Instructions ---";
93
+ const startMarker = "--- START: DB UX Copilot Instructions \u2013 do not edit below ---";
94
+ const endMarker = "--- END: DB UX Copilot Instructions \u2013 do not edit above ---";
95
95
  const startIndex = copilotFileContent.indexOf(startMarker);
96
96
  const endIndex = copilotFileContent.indexOf(endMarker);
97
97
  if (startIndex !== -1 && endIndex !== -1 && endIndex > startIndex) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@db-ux/agent-cli",
3
- "version": "3.0.2-copilot2-e7bf98b",
3
+ "version": "3.1.18",
4
4
  "type": "module",
5
5
  "description": "CLI for DB UX Design System generate AI agent instructions",
6
6
  "repository": {
@@ -11,28 +11,28 @@
11
11
  "bin": {
12
12
  "@db-ux/agent-cli": "build/index.js"
13
13
  },
14
- "main": "build.js",
14
+ "main": "build/index.js",
15
15
  "files": [
16
- "build"
16
+ "build",
17
+ "CHANGELOG.md"
17
18
  ],
18
19
  "scripts": {
19
20
  "build": "node esbuild.js",
20
21
  "copy-build": "npm-run-all copy-build:*",
21
- "copy-build:build": "cpr build ../../build-outputs/agent-cli/build -o",
22
- "copy-build:package.json": "cpr package.json ../../build-outputs/agent-cli/package.json -o",
23
- "copy-build:readme": "cpr README.md ../../build-outputs/agent-cli/README.md -o",
22
+ "copy-build:build": "cpr build ../../build-outputs/agent-cli/build --overwrite",
23
+ "copy-build:package.json": "cpr package.json ../../build-outputs/agent-cli/package.json --overwrite",
24
+ "copy-build:readme": "cpr README.md ../../build-outputs/agent-cli/README.md --overwrite",
24
25
  "test": "vitest run --config vitest.config.ts",
25
26
  "test:cli": "tsx src/cli.ts --help"
26
27
  },
27
28
  "dependencies": {
28
- "commander": "^14.0.0",
29
- "glob": "^11.0.2"
29
+ "commander": "14.0.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "cpr": "3.0.1",
33
- "esbuild": "0.25.5",
34
- "tsx": "^4.19.4",
35
- "vitest": "^3.2.1"
33
+ "esbuild": "0.25.10",
34
+ "tsx": "4.20.6",
35
+ "vitest": "3.2.4"
36
36
  },
37
37
  "publishConfig": {
38
38
  "registry": "https://registry.npmjs.org/",