17601760 var dbPath = parseResult . GetValue ( setupDbOption ) ?? "./ai-code-graph/graph.db" ;
17611761 var created = new List < string > ( ) ;
17621762
1763- // 1. Create .claude/commands/ directory
1764- var commandsDir = Path . Combine ( Directory . GetCurrentDirectory ( ) , ".claude" , "commands" ) ;
1763+ // 1. Create .claude/commands/cg/ directory
1764+ var commandsDir = Path . Combine ( Directory . GetCurrentDirectory ( ) , ".claude" , "commands" , "cg" ) ;
17651765 Directory . CreateDirectory ( commandsDir ) ;
17661766
17671767 // 2. Write slash command files
1768- var contextCmd = Path . Combine ( commandsDir , "cg: context.md" ) ;
1768+ var contextCmd = Path . Combine ( commandsDir , "context.md" ) ;
17691769 if ( ! File . Exists ( contextCmd ) )
17701770 {
17711771 File . WriteAllText ( contextCmd , $@ "Get method context before editing: $ARGUMENTS
@@ -1782,7 +1782,7 @@ 4. If complexity (CC) is high (>10), warn about the method's complexity before m
17821782 created . Add ( contextCmd ) ;
17831783 }
17841784
1785- var hotspotsCmd = Path . Combine ( commandsDir , "cg: hotspots.md" ) ;
1785+ var hotspotsCmd = Path . Combine ( commandsDir , "hotspots.md" ) ;
17861786 if ( ! File . Exists ( hotspotsCmd ) )
17871787 {
17881788 File . WriteAllText ( hotspotsCmd , $@ "Show complexity hotspots in the codebase.
@@ -1796,7 +1796,7 @@ 1. Run `ai-code-graph hotspots --top 15 --db {dbPath}`
17961796 created . Add ( hotspotsCmd ) ;
17971797 }
17981798
1799- var duplicatesCmd = Path . Combine ( commandsDir , "cg: duplicates.md" ) ;
1799+ var duplicatesCmd = Path . Combine ( commandsDir , "duplicates.md" ) ;
18001800 if ( ! File . Exists ( duplicatesCmd ) )
18011801 {
18021802 File . WriteAllText ( duplicatesCmd , $@ "Show detected code duplicates in the codebase.
@@ -1811,7 +1811,7 @@ 3. Group the results by clone type (Type1 = exact, Type2 = renamed, Semantic = s
18111811 created . Add ( duplicatesCmd ) ;
18121812 }
18131813
1814- var driftCmd = Path . Combine ( commandsDir , "cg: drift.md" ) ;
1814+ var driftCmd = Path . Combine ( commandsDir , "drift.md" ) ;
18151815 if ( ! File . Exists ( driftCmd ) )
18161816 {
18171817 File . WriteAllText ( driftCmd , $@ "Run drift detection against the baseline.
@@ -1830,7 +1830,7 @@ 3. Group the results by clone type (Type1 = exact, Type2 = renamed, Semantic = s
18301830 created . Add ( driftCmd ) ;
18311831 }
18321832
1833- var callgraphCmd = Path . Combine ( commandsDir , "cg: callgraph.md" ) ;
1833+ var callgraphCmd = Path . Combine ( commandsDir , "callgraph.md" ) ;
18341834 if ( ! File . Exists ( callgraphCmd ) )
18351835 {
18361836 File . WriteAllText ( callgraphCmd , $@ "Explore method call graph: $ARGUMENTS
@@ -1845,7 +1845,7 @@ 4. Highlight any deep call chains or circular dependencies
18451845 created . Add ( callgraphCmd ) ;
18461846 }
18471847
1848- var treeCmd = Path . Combine ( commandsDir , "cg: tree.md" ) ;
1848+ var treeCmd = Path . Combine ( commandsDir , "tree.md" ) ;
18491849 if ( ! File . Exists ( treeCmd ) )
18501850 {
18511851 File . WriteAllText ( treeCmd , $@ "Display code structure tree.
@@ -1859,7 +1859,7 @@ 4. Use the structure to understand codebase organization
18591859 created . Add ( treeCmd ) ;
18601860 }
18611861
1862- var similarCmd = Path . Combine ( commandsDir , "cg: similar.md" ) ;
1862+ var similarCmd = Path . Combine ( commandsDir , "similar.md" ) ;
18631863 if ( ! File . Exists ( similarCmd ) )
18641864 {
18651865 File . WriteAllText ( similarCmd , $@ "Find methods similar to: $ARGUMENTS
@@ -1873,7 +1873,7 @@ 3. Present ranked list of similar methods with similarity scores
18731873 created . Add ( similarCmd ) ;
18741874 }
18751875
1876- var clustersCmd = Path . Combine ( commandsDir , "cg: clusters.md" ) ;
1876+ var clustersCmd = Path . Combine ( commandsDir , "clusters.md" ) ;
18771877 if ( ! File . Exists ( clustersCmd ) )
18781878 {
18791879 File . WriteAllText ( clustersCmd , $@ "Show intent clusters in the codebase.
@@ -1887,7 +1887,7 @@ 4. Highlight clusters with low cohesion (<0.5) as refactoring candidates
18871887 created . Add ( clustersCmd ) ;
18881888 }
18891889
1890- var searchCmd = Path . Combine ( commandsDir , "cg: token-search.md" ) ;
1890+ var searchCmd = Path . Combine ( commandsDir , "token-search.md" ) ;
18911891 if ( ! File . Exists ( searchCmd ) )
18921892 {
18931893 File . WriteAllText ( searchCmd , $@ "Search code by token overlap: $ARGUMENTS
@@ -1901,7 +1901,7 @@ 4. Suggest which methods are most relevant to the query
19011901 created . Add ( searchCmd ) ;
19021902 }
19031903
1904- var exportCmd = Path . Combine ( commandsDir , "cg: export.md" ) ;
1904+ var exportCmd = Path . Combine ( commandsDir , "export.md" ) ;
19051905 if ( ! File . Exists ( exportCmd ) )
19061906 {
19071907 File . WriteAllText ( exportCmd , $@ "Export code graph data.
@@ -1914,7 +1914,7 @@ 3. Present a summary of the exported data
19141914 created . Add ( exportCmd ) ;
19151915 }
19161916
1917- var analyzeCmd = Path . Combine ( commandsDir , "cg: analyze.md" ) ;
1917+ var analyzeCmd = Path . Combine ( commandsDir , "analyze.md" ) ;
19181918 if ( ! File . Exists ( analyzeCmd ) )
19191919 {
19201920 File . WriteAllText ( analyzeCmd , @"Analyze solution and build code graph.
@@ -1928,7 +1928,7 @@ 4. Inform the user that all slash commands are now available
19281928 created . Add ( analyzeCmd ) ;
19291929 }
19301930
1931- var churnCmd = Path . Combine ( commandsDir , "cg: churn.md" ) ;
1931+ var churnCmd = Path . Combine ( commandsDir , "churn.md" ) ;
19321932 if ( ! File . Exists ( churnCmd ) )
19331933 {
19341934 File . WriteAllText ( churnCmd , $@ "Show methods with high change-frequency x complexity (churn hotspots): $ARGUMENTS
@@ -1978,7 +1978,7 @@ 5. Suggest which methods would benefit most from refactoring to reduce complexit
19781978- Apply the same fix to duplicates when fixing bugs
19791979- Understand which intent cluster a method belongs to before refactoring
19801980
1981- Available slash commands (all prefixed with `cg:`) :
1981+ Available slash commands:
19821982- `/cg:analyze [solution]` - Analyze solution and build the graph
19831983- `/cg:context <method>` - Full method context before editing
19841984- `/cg:hotspots` - Top complexity hotspots
0 commit comments