You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CODEBASE-CONTEXT.md
+9-15Lines changed: 9 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -371,33 +371,27 @@ src/deprecated-module.js
371
371
372
372
**Warning:** Tooling may be required for proper implementation of `.contextignore`. AI agents may not consistently or easily use `.contextignore` as strictly as dedicated tooling can. Your mileage may vary (YMMV) depending on the AI model used.
373
373
374
-
## 7. Security Considerations
375
-
376
-
1. Avoid including sensitive information (API keys, passwords) in context files.
377
-
2. Be cautious with proprietary algorithms or trade secrets.
378
-
3. Use `.gitignore` to exclude sensitive context files from version control if necessary.
379
-
380
-
## 8. The .contextdocs File
374
+
## 7. The .contextdocs File
381
375
382
376
The `.contextdocs` file allows developers to specify external documentation sources that should be incorporated into the project's context. This feature is particularly useful for including documentation from dependencies, libraries, or related projects.
383
377
384
-
### 8.1 Location and Naming
378
+
### 7.1 Location and Naming
385
379
386
380
- The `.contextdocs` file should be placed in the root directory of the project.
387
381
- It must use one of the following extensions:
388
382
-`.contextdocs.md` (default, recommended)
389
383
-`.contextdocs.yaml` or `.contextdocs.yml`
390
384
-`.contextdocs.json`
391
385
392
-
### 8.2 File Structure
386
+
### 7.2 File Structure
393
387
394
388
The `.contextdocs` file should contain an array of documentation sources. Each source can be:
395
389
396
390
- A file path relative to the project root
397
391
- A URL to a markdown file
398
392
- A package name with associated documentation files
399
393
400
-
### 8.3 Examples
394
+
### 7.3 Examples
401
395
402
396
#### Markdown Format (.contextdocs.md) - Default
403
397
@@ -511,7 +505,7 @@ contextdocs:
511
505
}
512
506
```
513
507
514
-
### 8.4 Behavior
508
+
### 7.4 Behavior
515
509
516
510
- When an AI model or related tool is processing the project context, it should fetch and incorporate the specified documentation.
517
511
- For local files, the content should be read from the specified path.
@@ -520,24 +514,24 @@ contextdocs:
520
514
521
515
**Warning:** Tooling may be required for proper implementation of `.contextdocs`. AI agents may not consistently or easily use `.contextdocs` as strictly as dedicated tooling can. Your mileage may vary (YMMV) depending on the AI model used.
522
516
523
-
### 8.5 Use Cases
517
+
### 7.5 Use Cases
524
518
525
519
- Including documentation for key dependencies
526
520
- Referencing company-wide coding standards or guidelines
527
521
- Incorporating design documents or architectural overviews
528
522
- Linking to relevant external resources or tutorials
529
523
530
-
### 8.6 Considerations
524
+
### 7.6 Considerations
531
525
532
526
- Ensure that URLs point to stable, version-controlled documentation to maintain consistency.
533
527
- Be mindful of the total volume of documentation to avoid overwhelming the AI model with irrelevant information.
534
528
- Regularly review and update the `.contextdocs` file to ensure all referenced documentation remains relevant and up-to-date.
535
529
- Consider implementing caching mechanisms for external documentation to improve performance and reduce network requests.
536
530
537
-
## 9. Conclusion
531
+
## 8. Conclusion
538
532
539
533
The Codebase Context Specification provides a flexible, standardized approach to enriching codebases with contextual information for AI models. By adopting this convention and including role-specific information, development teams can enhance AI-assisted workflows, improving code quality and development efficiency across projects of any scale or complexity. The addition of role-specific guidelines and consistent naming conventions ensures that AI models have access to comprehensive, relevant, and well-structured information tailored to different aspects of the software development lifecycle.
540
534
541
-
## 10. TypeScript Linter Implementation
535
+
## 9. TypeScript Linter Implementation
542
536
543
537
For details on the TypeScript implementation of the linter for validating Codebase Context Specification files, please refer to the [TypeScript Linter README](linters/typescript/README.md).
This project supports the following Node.js versions:
23
+
24
+
- Node.js 18.x
25
+
- Node.js 20.x
26
+
- Node.js 22.x
27
+
28
+
We recommend using the latest LTS (Long Term Support) version of Node.js for optimal performance and security.
29
+
20
30
## Codebase Context: A New Convention
21
31
22
32
The Codebase Context Specification introduces a convention similar to `.env` and `.editorconfig` systems, but focused on documenting your code for both AI and humans. Just as `.env` files manage environment variables and `.editorconfig` ensures consistent coding styles, CCS files (`.context.md`, `.context.yaml`, `.context.json`) provide a standardized way to capture and communicate the context of your codebase.
@@ -46,8 +56,14 @@ To install the linter:
46
56
npm install -g codebase-context-lint
47
57
```
48
58
59
+
Note: Make sure you're using a supported Node.js version (18.x, 20.x, or 22.x) when installing and running the linter.
60
+
49
61
For more information on using the linter, please refer to the [linter's README](./linters/typescript/README.md).
50
62
63
+
## Recent Updates
64
+
65
+
We've recently updated our dependencies to address security vulnerabilities and improve compatibility with different Node.js versions. If you encounter any issues after updating, please report them in our GitHub issues.
66
+
51
67
## Using with AI Assistants
52
68
53
69
The [CODING-ASSISTANT-PROMPT.md](./CODING-ASSISTANT-PROMPT.md) file provides guidelines for AI assistants to understand and use the Codebase Context Specification. This allows for immediate adoption of the specification without requiring specific tooling integration.
Copy file name to clipboardExpand all lines: linters/typescript/README.md
+49-5Lines changed: 49 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,14 +35,26 @@ By adopting this convention, teams can ensure that both human developers and AI
35
35
36
36
For more detailed information about the Codebase Context Specification, please refer to the [main repository](https://github.com/Agentic-Insights/codebase-context-spec) and the [full specification](https://github.com/Agentic-Insights/codebase-context-spec/blob/main/CODEBASE-CONTEXT.md).
37
37
38
-
## 📦 Installation
38
+
## � Supported Node.js Versions
39
+
40
+
This linter supports the following Node.js versions:
41
+
42
+
- Node.js 18.x
43
+
- Node.js 20.x
44
+
- Node.js 22.x
45
+
46
+
We recommend using the latest LTS (Long Term Support) version of Node.js for optimal performance and security.
47
+
48
+
## �📦 Installation
39
49
40
50
You can install the linter globally using npm:
41
51
42
52
```
43
53
npm install -g codebase-context-lint
44
54
```
45
55
56
+
Note: Make sure you're using a supported Node.js version (18.x, 20.x, or 22.x) when installing and running the linter.
57
+
46
58
## 🚀 Usage
47
59
48
60
After installation, you can use the linter from the command line:
@@ -58,9 +70,37 @@ Replace `<directory_to_lint>` with the path to the directory containing your Cod
58
70
- 🔍 Validates the structure and content of `.context.md`, `.context.yaml`, and `.context.json` files
59
71
- ✅ Checks for required fields and sections
60
72
- 📄 Verifies the format of `.contextdocs.md` files
61
-
- 🚫 Validates ignore patterns in `.contextignore` files
73
+
- 🚫 Supports and validates `.contextignore` files for excluding specific files or directories
62
74
- 💬 Provides detailed error messages and warnings
63
75
76
+
## 📁 .contextignore Files
77
+
78
+
`.contextignore` files allow you to specify patterns for files and directories that should be ignored by the Codebase Context Lint. This is useful for excluding generated files, dependencies, or any other content that doesn't need context documentation.
79
+
80
+
### How to use .contextignore
81
+
82
+
1. Create a file named `.contextignore` in any directory of your project.
83
+
2. Add patterns to the file, one per line. These patterns follow the same rules as `.gitignore` files.
84
+
3. The linter will respect these ignore patterns when processing files in that directory and its subdirectories.
85
+
86
+
Example `.contextignore` file:
87
+
88
+
```
89
+
# Ignore node_modules directory
90
+
node_modules/
91
+
92
+
# Ignore all .log files
93
+
*.log
94
+
95
+
# Ignore a specific file
96
+
path/to/specific/file.js
97
+
98
+
# Ignore all files in a specific directory
99
+
path/to/ignore/*
100
+
```
101
+
102
+
The linter will validate the syntax of your `.contextignore` files and warn about any problematic patterns, such as attempting to ignore critical context files.
103
+
64
104
## 🤖 Using with AI Assistants
65
105
66
106
While this linter provides automated validation of CCS files, you can also use the Codebase Context Specification with AI assistants without any specific tooling. The [CODING-ASSISTANT-PROMPT.md](https://github.com/Agentic-Insights/codebase-context-spec/blob/main/CODING-ASSISTANT-PROMPT.md) file in the main repository provides guidelines for AI assistants to understand and use the Codebase Context Specification.
@@ -71,7 +111,7 @@ To use the Codebase Context Specification with an AI assistant:
71
111
2. Ask the AI to analyze your project's context files based on these guidelines.
72
112
3. The AI will be able to provide more accurate and context-aware responses by following the instructions in the prompt.
73
113
74
-
Note that while this approach allows for immediate use of the specification, some features like .contextignore should eventually be applied by tooling (such as this linter) for more robust implementation.
114
+
Note that while this approach allows for immediate use of the specification, some features like .contextignore are best implemented by tooling (such as this linter) for more robust and consistent application.
75
115
76
116
## 🛠️ Development
77
117
@@ -104,11 +144,15 @@ To contribute to this project:
104
144
7. Push to the branch (`git push origin feature/AmazingFeature`)
105
145
8. Open a Pull Request
106
146
107
-
## � Learn More
147
+
## 🔄 Recent Updates
148
+
149
+
We've recently updated our dependencies to address security vulnerabilities and improve compatibility with different Node.js versions. If you encounter any issues after updating, please report them in our GitHub issues.
150
+
151
+
## 📖 Learn More
108
152
109
153
For a deeper dive into the Codebase Context Specification, check out this [SubStack article by Vaskin](https://agenticinsights.substack.com/p/codebase-context-specification-rfc), the author of the specification.
0 commit comments