Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit e1207a1

Browse files
committed
feat: Add guidelines for using Codebase Context Specification with AI assistants
1 parent ea74208 commit e1207a1

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

CODING-ASSISTANT-PROMPT.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## Support the Codebase Context Specification
2+
3+
You are tasked with reading and understanding the Codebase Context Specification files in a project to get explicit context information from the codebase itself.
4+
5+
Follow these guidelines:
6+
7+
1. Look for the following files in the project root and subdirectories:
8+
- .context.md (primary)
9+
- .context.yaml or .context.yml
10+
- .context.json
11+
- .contextdocs.md
12+
- .contextignore
13+
14+
2. Prioritize reading .context.md files, as they are the primary source of context information.
15+
16+
3. When analyzing .context.md files:
17+
- Pay attention to the YAML front matter for structured data.
18+
- Carefully read the free-form Markdown content for additional context.
19+
20+
4. For .context.yaml, .context.yml, or .context.json files:
21+
- Parse the structured data and understand the relationships between different fields.
22+
- Look for key sections such as project-name, version, description, main-technologies, conventions, and ai-prompts.
23+
24+
5. When encountering a .contextdocs.md file:
25+
- Understand that it specifies external documentation sources.
26+
- Note the types of documentation sources (local, URL, or package) and their relevance to the project.
27+
28+
6. If a .contextignore file is present:
29+
- Recognize that it specifies files or directories to be excluded from context consideration.
30+
- Apply these exclusions when analyzing the project structure.
31+
32+
7. As you traverse deeper into the directory structure:
33+
- Understand that context accumulates and becomes more specific.
34+
- More specific contexts in subdirectories provide additional detail to broader contexts.
35+
36+
8. Pay special attention to role-specific sections in the context files, such as:
37+
- architecture
38+
- development
39+
- business-requirements
40+
- quality-assurance
41+
- deployment
42+
43+
9. Use the information gathered from these files to:
44+
- Understand the project's overall structure and purpose.
45+
- Identify key technologies, conventions, and best practices.
46+
- Recognize project-specific terminology and concepts.
47+
- Tailor your responses and code generation to align with the project's guidelines and requirements.
48+
49+
10. Be prepared to provide insights, answer questions, or generate code based on the context provided in these files.
50+
51+
Remember, the Codebase Context Specification is designed to enhance AI-assisted development. Your goal is to leverage this contextual information to provide more accurate, relevant, and project-specific assistance.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ The Codebase Context Specification is currently in a preview state. We're active
3737

3838
For the full specification, please refer to [CODEBASE-CONTEXT.md](CODEBASE-CONTEXT.md).
3939

40+
## Using with AI Assistants
41+
42+
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.
43+
44+
To use the Codebase Context Specification with an AI assistant:
45+
46+
1. Include the content of CODING-ASSISTANT-PROMPT.md in your prompt to the AI assistant.
47+
2. Ask the AI to analyze your project's context files based on these guidelines.
48+
3. The AI will be able to provide more accurate and context-aware responses by following the instructions in the prompt.
49+
50+
[A UI element graphic would be inserted here, demonstrating how the Codebase Context Specification could be integrated into development environments]
51+
52+
Note that while this approach allows for immediate use of the specification, some features like .contextignore should eventually be applied by tooling for more robust implementation.
53+
4054
## Tooling Recommendations
4155

4256
Developers are encouraged to create:
@@ -77,3 +91,4 @@ All contributions will be reviewed and discussed openly. Significant changes may
7791

7892
- [Full Specification (CODEBASE-CONTEXT.md)](CODEBASE-CONTEXT.md)
7993
- [Context File Example (.context.md)](.context.md)
94+
- [AI Assistant Prompt (CODING-ASSISTANT-PROMPT.md)](CODING-ASSISTANT-PROMPT.md)

linters/typescript/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@ Replace `<directory_to_lint>` with the path to the directory containing your Cod
5959
- 🚫 Validates ignore patterns in `.contextignore` files
6060
- 💬 Provides detailed error messages and warnings
6161

62+
## 🤖 Using with AI Assistants
63+
64+
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 root directory provides guidelines for AI assistants to understand and use the Codebase Context Specification.
65+
66+
To use the Codebase Context Specification with an AI assistant:
67+
68+
1. Include the content of CODING-ASSISTANT-PROMPT.md in your prompt to the AI assistant.
69+
2. Ask the AI to analyze your project's context files based on these guidelines.
70+
3. The AI will be able to provide more accurate and context-aware responses by following the instructions in the prompt.
71+
72+
[A UI element graphic would be inserted here, demonstrating how the Codebase Context Specification could be integrated into development environments]
73+
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.
75+
6276
## 🛠️ Development
6377

6478
To contribute to this project:

0 commit comments

Comments
 (0)