Skip to content

Commit 36cbc70

Browse files
committed
Initial commit: CodeContext.NET - AI Context Generator for C# Codebases
0 parents  commit 36cbc70

File tree

12 files changed

+1399
-0
lines changed

12 files changed

+1399
-0
lines changed

.gitignore

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.rsuser
6+
*.suo
7+
*.user
8+
*.userosscache
9+
*.sln.docstates
10+
11+
# User-specific files (MonoDevelop/Xamarin Studio)
12+
*.userprefs
13+
14+
# Mono auto generated files
15+
mono_crash.*
16+
17+
# Build results
18+
[Dd]ebug/
19+
[Dd]ebugPublic/
20+
[Rr]elease/
21+
[Rr]eleases/
22+
x64/
23+
x86/
24+
[Ww][Ii][Nn]32/
25+
[Aa][Rr][Mm]/
26+
[Aa][Rr][Mm]64/
27+
bld/
28+
[Bb]in/
29+
[Oo]bj/
30+
[Ll]og/
31+
[Ll]ogs/
32+
33+
# Visual Studio 2015/2017 cache/options directory
34+
.vs/
35+
36+
# Visual Studio 2017 auto generated files
37+
Generated\ Files/
38+
39+
# MSTest test Results
40+
[Tt]est[Rr]esult*/
41+
[Bb]uild[Ll]og.*
42+
43+
# NUnit
44+
*.VisualState.xml
45+
TestResult.xml
46+
nunit-*.xml
47+
48+
# Build Results of an ATL Project
49+
[Dd]ebugPS/
50+
[Rr]eleasePS/
51+
dlldata.c
52+
53+
# Benchmark Results
54+
BenchmarkDotNet.Artifacts/
55+
56+
# .NET
57+
project.lock.json
58+
project.fragment.lock.json
59+
artifacts/
60+
61+
# Tye
62+
.tye/
63+
64+
# ASP.NET Scaffolding
65+
ScaffoldingReadMe.txt
66+
67+
# StyleCop
68+
StyleCopReport.xml
69+
70+
# Files built by Visual Studio
71+
*_i.c
72+
*_p.c
73+
*_h.h
74+
*.ilk
75+
*.meta
76+
*.obj
77+
*.iobj
78+
*.pch
79+
*.pdb
80+
*.ipdb
81+
*.pgc
82+
*.pgd
83+
*.rsp
84+
*.sbr
85+
*.tlb
86+
*.tli
87+
*.tlh
88+
*.tmp
89+
*.tmp_proj
90+
*_wpftmp.csproj
91+
*.log
92+
*.tlog
93+
*.vspscc
94+
*.vssscc
95+
.builds
96+
*.pidb
97+
*.svclog
98+
*.scc
99+
100+
# Visual Studio profiler
101+
*.psess
102+
*.vsp
103+
*.vspx
104+
*.sap
105+
106+
# Visual Studio Trace Files
107+
*.e2e
108+
109+
# ReSharper is a .NET coding add-in
110+
_ReSharper*/
111+
*.[Rr]e[Ss]harper
112+
*.DotSettings.user
113+
114+
# JetBrains Rider
115+
*.sln.iml
116+
.idea/
117+
118+
# Visual Studio code coverage results
119+
*.coverage
120+
*.coveragexml
121+
122+
# NuGet Packages
123+
*.nupkg
124+
# NuGet Symbol Packages
125+
*.snupkg
126+
# The packages folder can be ignored because of Package Restore
127+
**/[Pp]ackages/*
128+
# except build/, which is used as an MSBuild target.
129+
!**/[Pp]ackages/build/
130+
# Uncomment if necessary however generally it will be regenerated when needed
131+
#!**/[Pp]ackages/repositories.config
132+
# NuGet v3's project.json files produces more ignorable files
133+
*.nuget.props
134+
*.nuget.targets
135+
136+
# Microsoft Azure Build Output
137+
csx/
138+
*.build.csdef
139+
140+
# Windows Store app package directories and files
141+
AppPackages/
142+
BundleArtifacts/
143+
Package.StoreAssociation.xml
144+
_pkginfo.txt
145+
*.appx
146+
*.appxbundle
147+
*.appxupload
148+
149+
# Visual Studio cache files
150+
# files ending in .cache can be ignored
151+
*.[Cc]ache
152+
# but keep track of directories ending in .cache
153+
!?*.[Cc]ache/
154+
155+
# Others
156+
ClientBin/
157+
~$*
158+
*~
159+
*.dbmdl
160+
*.dbproj.schemaview
161+
*.jfm
162+
*.pfx
163+
*.publishsettings
164+
orleans.codegen.cs
165+
166+
# Node.js Tools for Visual Studio
167+
.ntvs_analysis.dat
168+
node_modules/
169+
170+
# Backup & report files from converting an old project file
171+
# to a newer Visual Studio version. Backup files are not needed,
172+
# because we have git ;-)
173+
_UpgradeReport_Files/
174+
Backup*/
175+
UpgradeLog*.XML
176+
UpgradeLog*.htm
177+
ServiceFabricBackup/
178+
*.rptproj.bak
179+
180+
# Local History for Visual Studio Code
181+
.history/
182+
.ionide/
183+
184+
# macOS
185+
.DS_Store
186+
187+
# JetBrains Rider
188+
.idea/
189+
*.sln.iml
190+
191+
# Output files
192+
codebase-context.json
193+
codebase-context.md
194+
codebase-context.txt

CodeContext.sln

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeContext.Core", "src\CodeContext.Core\CodeContext.Core.csproj", "{9EA18276-D341-4C63-B26C-BFB65AF7067F}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeContext.CLI", "src\CodeContext.CLI\CodeContext.CLI.csproj", "{A8433CF5-8F81-445B-BAA2-9D20180B185B}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeContext.Tests", "tests\CodeContext.Tests\CodeContext.Tests.csproj", "{714B69CA-A19F-4456-B1F4-7113783B6FDC}"
13+
EndProject
14+
Global
15+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
16+
Debug|Any CPU = Debug|Any CPU
17+
Debug|x64 = Debug|x64
18+
Debug|x86 = Debug|x86
19+
Release|Any CPU = Release|Any CPU
20+
Release|x64 = Release|x64
21+
Release|x86 = Release|x86
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|x64.ActiveCfg = Debug|Any CPU
27+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|x64.Build.0 = Debug|Any CPU
28+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|x86.ActiveCfg = Debug|Any CPU
29+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|x86.Build.0 = Debug|Any CPU
30+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|x64.ActiveCfg = Release|Any CPU
33+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|x64.Build.0 = Release|Any CPU
34+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|x86.ActiveCfg = Release|Any CPU
35+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|x86.Build.0 = Release|Any CPU
36+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|x64.ActiveCfg = Debug|Any CPU
39+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|x64.Build.0 = Debug|Any CPU
40+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|x86.ActiveCfg = Debug|Any CPU
41+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|x86.Build.0 = Debug|Any CPU
42+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|Any CPU.ActiveCfg = Release|Any CPU
43+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|Any CPU.Build.0 = Release|Any CPU
44+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|x64.ActiveCfg = Release|Any CPU
45+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|x64.Build.0 = Release|Any CPU
46+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|x86.ActiveCfg = Release|Any CPU
47+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|x86.Build.0 = Release|Any CPU
48+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
50+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|x64.ActiveCfg = Debug|Any CPU
51+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|x64.Build.0 = Debug|Any CPU
52+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|x86.ActiveCfg = Debug|Any CPU
53+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|x86.Build.0 = Debug|Any CPU
54+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
55+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|Any CPU.Build.0 = Release|Any CPU
56+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|x64.ActiveCfg = Release|Any CPU
57+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|x64.Build.0 = Release|Any CPU
58+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|x86.ActiveCfg = Release|Any CPU
59+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|x86.Build.0 = Release|Any CPU
60+
EndGlobalSection
61+
GlobalSection(SolutionProperties) = preSolution
62+
HideSolutionNode = FALSE
63+
EndGlobalSection
64+
GlobalSection(NestedProjects) = preSolution
65+
{9EA18276-D341-4C63-B26C-BFB65AF7067F} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
66+
{A8433CF5-8F81-445B-BAA2-9D20180B185B} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
67+
{714B69CA-A19F-4456-B1F4-7113783B6FDC} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
68+
EndGlobalSection
69+
EndGlobal

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# CodeContext.NET
2+
3+
AI Context Generator for C# Codebases - Analyzes your C# projects to detect patterns and generate context for AI tools.
4+
5+
## Features
6+
7+
- Pattern detection (naming conventions, error handling, async patterns)
8+
- Package dependency analysis
9+
- Architecture layer detection
10+
- Multiple export formats (JSON, Markdown, Plain Text)
11+
- AI-ready prompts for ChatGPT and GitHub Copilot
12+
13+
## Installation
14+
15+
```bash
16+
dotnet tool install --global CodeContext.CLI
17+
```
18+
19+
## Usage
20+
21+
```bash
22+
# Analyze current directory
23+
codecontext
24+
25+
# Analyze specific project
26+
codecontext --path /path/to/project
27+
28+
# Export as JSON
29+
codecontext --format json --output ./output
30+
31+
# Verbose output
32+
codecontext --verbose
33+
```
34+
35+
## Example Output
36+
37+
```markdown
38+
## Detected Patterns
39+
40+
### Naming Convention
41+
- Public methods use PascalCase naming
42+
- Confidence: 90%, Occurrences: 45
43+
44+
### Error Handling
45+
- Use Result<T> pattern for error handling instead of exceptions
46+
- Confidence: 85%, Occurrences: 23
47+
48+
### Async Pattern
49+
- Async methods end with 'Async' suffix
50+
- Confidence: 95%, Occurrences: 38
51+
```
52+
53+
## Building from Source
54+
55+
```bash
56+
git clone https://github.com/Nonanti/CodeContext.NET
57+
cd CodeContext.NET
58+
dotnet build
59+
dotnet test
60+
```
61+
62+
## License
63+
64+
MIT
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="System.CommandLine" Version="2.0.0-rc.1.25451.107" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\CodeContext.Core\CodeContext.Core.csproj" />
16+
</ItemGroup>
17+
18+
</Project>

0 commit comments

Comments
 (0)