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: patterns/1-initial/ai-code-generation-context.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,12 @@ With the growing use of AI tools (like GitHub Copilot, ChatGPT, or custom LLMs),
12
12
13
13
## Context
14
14
15
-
- InnerSource adoption is in place across the organization
16
-
- Developers are encouraged to use AI tools to improve productivity
17
-
- Contributors may not be familiar or failed to prompt meticulously while generating code through AI with the target codebase's idioms, architecture, or constraints
18
-
- Maintainers want to empower contributors using AI while preserving code consistency and maintainability
19
-
- Multiple teams are contributing to shared repositories with varying levels of familiarity with project standards
20
-
- Code review processes are becoming bottlenecked by AI-generated code that requires significant rework
15
+
- InnerSource adoption is in place across the organisation.
16
+
- Developers are encouraged to use AI tools to improve their productivity.
17
+
- Contributors may not be familiar with or fail to meticulously prompt when generating code through AI, using the target codebase's idioms, architecture, or constraints.
18
+
- Maintainers want to empower contributors using AI while preserving code consistency and maintainability.
19
+
- Multiple teams are contributing to shared repositories with varying levels of familiarity with project standards.
20
+
- Code review processes are becoming bottlenecked by AI-generated code that requires significant rework.
21
21
22
22
## Forces
23
23
@@ -27,17 +27,17 @@ With the growing use of AI tools (like GitHub Copilot, ChatGPT, or custom LLMs),
27
27
-**Productivity vs. Quality Trade-off**: While AI tools boost individual productivity, they can reduce overall team productivity if the generated code requires extensive rework
28
28
-**Context Switching Cost**: Developers benefit from AI tools only when they have the right contextual grounding, but manually providing this context for each AI interaction is time-consuming
29
29
-**Inconsistent Standards**: Different AI tools and different prompting approaches by contributors can lead to wildly inconsistent code styles and patterns
30
-
-**Maintenance Burden**: Creating and maintaining comprehensive AI context requires ongoing effort from maintainers
30
+
-**Maintenance Burden**: Creating and maintaining the comprehensive AI context requires ongoing effort from maintainers
31
31
-**Tool Integration Complexity**: Different AI tools have different ways of consuming context, making it challenging to create universal guidance
32
32
-**AI Tool Cost Constraints**: Comprehensive AI context increases processing costs (AI tools charge based on "tokens" \* units of text measurement) and usage limits, requiring strategic balance between context completeness and efficiency
33
33
34
34
## Solution
35
35
36
-
Provide an **AI Code Generation Context Package** within the repository to guide AI tools in producing contributions that align with project standards. This package serves as a comprehensive reference that contributors can easily provide to AI tools to ensure generated code follows project conventions.
36
+
Provide an **AI Code Generation Context**folder within the repository to guide AI tools in producing contributions that align with project standards. This folder serves as a comprehensive reference that contributors can easily provide to AI tools, ensuring that generated code adheres to project conventions.
37
37
38
38
### Implementation Structure
39
39
40
-
Create a`innersource-ai/` folder in the repository root containing:
40
+
Create an`innersource-ai/` folder in the repository root containing:
41
41
42
42
#### Core Documentation Files (Required)
43
43
@@ -55,18 +55,18 @@ Create a `innersource-ai/` folder in the repository root containing:
55
55
- High-level system architecture and component relationships
56
56
- Data flow patterns and API design principles
57
57
- Dependency management guidelines
58
-
- Module organization and layering principles
58
+
- Module organisation and layering principles
59
59
- Integration patterns with external systems
60
60
61
61
`STYLE_GUIDE.md`: Comprehensive coding guidelines
62
62
63
63
- Language-specific style rules
64
-
- Code organization patterns
64
+
- Code organisation patterns
65
65
- Documentation standards
66
66
- Performance considerations
67
67
- Security guidelines and common vulnerabilities to avoid
68
68
69
-
#### Optional Enhancements (Implement As Needed)
69
+
#### Enhancements (Optional)
70
70
71
71
##### Practical Examples
72
72
@@ -95,16 +95,16 @@ Create a `innersource-ai/` folder in the repository root containing:
95
95
96
96
##### Advanced Features
97
97
98
-
`EMBEDDINGS/` (Optional): For advanced LLM integrations
98
+
`EMBEDDINGS/`: For advanced LLM integrations
99
99
100
100
- Searchable knowledge base of project patterns
101
101
- Vector embeddings of code examples
102
102
- Semantic search capabilities for finding relevant patterns
103
103
104
-
### Implementation Strategy
105
-
106
104
**Context Efficiency**: Start with core documentation files (~1000 words of context) to balance context value with AI tool costs. Expand strategically based on measured impact on review cycles and code quality.
107
105
106
+
**Naming Convension**: The suggested file and folder names follow industry common practices. However, codebase owners may choose alternative names that are more discoverable and relatable to their specific project or codebase. Any chosen naming convention should be clearly documented and communicated to contributors through proper documentation.
107
+
108
108
### Usage Patterns
109
109
110
110
#### For Contributors
@@ -148,7 +148,7 @@ This solution balances the productivity benefits of AI tools with the quality re
0 commit comments