combicode 1.3.0 → 1.4.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.0](https://github.com/aaurelions/combicode/compare/combicode-js-v1.3.0...combicode-js-v1.4.0) (2025-08-13)
4
+
5
+
6
+ ### Features
7
+
8
+ * Add --llms-txt flag for llms.txt documentation context ([0817554](https://github.com/aaurelions/combicode/commit/081755435594b0ca5208609b2724eb47bd73c2dc))
9
+
3
10
  ## [1.3.0](https://github.com/aaurelions/combicode/compare/combicode-js-v1.2.1...combicode-js-v1.3.0) (2025-06-25)
4
11
 
5
12
 
package/README.md CHANGED
@@ -80,18 +80,28 @@ Use the `--exclude` or `-e` flag with comma-separated glob patterns.
80
80
  npx combicode -e "**/*_test.py,docs/**"
81
81
  ```
82
82
 
83
+ ### Generating Context for `llms.txt`
84
+
85
+ The `--llms.txt` or `-l` flag is designed for projects that use an [`llms.txt`](https://llmstxt.org/) file to specify important documentation. When this flag is used, Combicode inserts a specialized system prompt telling the LLM that the provided context is the project's definitive documentation for a specific version. This helps the LLM provide more accurate answers and avoid using deprecated functions.
86
+
87
+ ```bash
88
+ # Combine all markdown files for an llms.txt context
89
+ npx combicode -l -i .md -o llms.txt
90
+ ```
91
+
83
92
  ## All CLI Options
84
93
 
85
- | Option | Alias | Description | Default |
86
- | ---------------- | ----- | ------------------------------------------------------------ | --------------- |
87
- | `--output` | `-o` | The name of the output file. | `combicode.txt` |
88
- | `--dry-run` | `-d` | Preview files without creating the output file. | `false` |
89
- | `--include-ext` | `-i` | Comma-separated list of extensions to exclusively include. | (include all) |
90
- | `--exclude` | `-e` | Comma-separated list of additional glob patterns to exclude. | (none) |
91
- | `--no-gitignore` | | Do not use patterns from the project's `.gitignore` file. | `false` |
92
- | `--no-header` | | Omit the introductory prompt and file tree from the output. | `false` |
93
- | `--version` | `-v` | Show the version number. | |
94
- | `--help` | `-h` | Show the help message. | |
94
+ | Option | Alias | Description | Default |
95
+ | ---------------- | ----- | ------------------------------------------------------------------------------ | --------------- |
96
+ | `--output` | `-o` | The name of the output file. | `combicode.txt` |
97
+ | `--dry-run` | `-d` | Preview files without creating the output file. | `false` |
98
+ | `--include-ext` | `-i` | Comma-separated list of extensions to exclusively include. | (include all) |
99
+ | `--exclude` | `-e` | Comma-separated list of additional glob patterns to exclude. | (none) |
100
+ | `--llms-txt` | `-l` | Use a specialized system prompt for context generated from an `llms.txt` file. | `false` |
101
+ | `--no-gitignore` | | Do not use patterns from the project's `.gitignore` file. | `false` |
102
+ | `--no-header` | | Omit the introductory prompt and file tree from the output. | `false` |
103
+ | `--version` | `-v` | Show the version number. | |
104
+ | `--help` | `-h` | Show the help message. | |
95
105
 
96
106
  ## License
97
107
 
package/index.js CHANGED
@@ -8,7 +8,7 @@ const glob = require("fast-glob");
8
8
 
9
9
  const { version } = require("./package.json");
10
10
 
11
- const SYSTEM_PROMPT = `You are an expert software architect. The user is providing you with the complete source code for a project, contained in a single file. Your task is to meticulously analyze the provided codebase to gain a comprehensive understanding of its structure, functionality, dependencies, and overall architecture.
11
+ const DEFAULT_SYSTEM_PROMPT = `You are an expert software architect. The user is providing you with the complete source code for a project, contained in a single file. Your task is to meticulously analyze the provided codebase to gain a comprehensive understanding of its structure, functionality, dependencies, and overall architecture.
12
12
 
13
13
  A file tree is provided below to give you a high-level overview. The subsequent sections contain the full content of each file, clearly marked with "// FILE: <path>".
14
14
 
@@ -17,6 +17,13 @@ Your instructions are:
17
17
  2. **Identify Key Components:** Pay close attention to configuration files (like package.json, pyproject.toml), entry points (like index.js, main.py), and core logic.
18
18
  `;
19
19
 
20
+ const LLMS_TXT_SYSTEM_PROMPT = `You are an expert software architect. The user is providing you with the full documentation for a project, sourced from the project's 'llms.txt' file. This file contains the complete context needed to understand the project's features, APIs, and usage for a specific version. Your task is to act as a definitive source of truth based *only* on this provided documentation.
21
+
22
+ When answering questions or writing code, adhere strictly to the functions, variables, and methods described in this context. Do not use or suggest any deprecated or older functionalities that are not present here.
23
+
24
+ A file tree of the documentation source is provided below for a high-level overview. The subsequent sections contain the full content of each file, clearly marked with "// FILE: <path>".
25
+ `;
26
+
20
27
  function loadDefaultIgnorePatterns() {
21
28
  const configPath = path.resolve(__dirname, "config", "ignore.json");
22
29
  try {
@@ -108,6 +115,12 @@ async function main() {
108
115
  describe: "Comma-separated glob patterns to exclude",
109
116
  type: "string",
110
117
  })
118
+ .option("l", {
119
+ alias: "llms-txt",
120
+ describe: "Use the system prompt for llms.txt context",
121
+ type: "boolean",
122
+ default: false,
123
+ })
111
124
  .option("no-gitignore", {
112
125
  describe: "Ignore the project's .gitignore file",
113
126
  type: "boolean",
@@ -192,7 +205,10 @@ async function main() {
192
205
  const outputStream = fs.createWriteStream(argv.output);
193
206
 
194
207
  if (!argv.noHeader) {
195
- outputStream.write(SYSTEM_PROMPT + "\n");
208
+ const systemPrompt = argv.llmsTxt
209
+ ? LLMS_TXT_SYSTEM_PROMPT
210
+ : DEFAULT_SYSTEM_PROMPT;
211
+ outputStream.write(systemPrompt + "\n");
196
212
  outputStream.write("## Project File Tree\n\n");
197
213
  outputStream.write("```\n");
198
214
  const tree = generateFileTree(relativeFiles, projectRoot);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "combicode",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "A CLI tool to combine a project's codebase into a single file for LLM context.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -24,7 +24,10 @@
24
24
  "prompt",
25
25
  "developer-tool",
26
26
  "codegen",
27
- "chatgpt"
27
+ "chatgpt",
28
+ "llms.txt",
29
+ "llms",
30
+ "llms-full.txt"
28
31
  ],
29
32
  "author": "A. Aurelions",
30
33
  "license": "MIT",