@aicgen/aicgen 1.0.2 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -55,17 +55,33 @@ npm install -g @aicgen/aicgen
55
55
  npx @aicgen/aicgen init
56
56
  ```
57
57
 
58
+ ### From Homebrew (macOS)
59
+
60
+ ```bash
61
+ # Add the tap
62
+ brew tap aicgen/aicgen
63
+
64
+ # Install aicgen
65
+ brew install aicgen
66
+ ```
67
+
58
68
  ### From Binary (Standalone)
59
69
 
60
- Download the latest binary for your platform from the [releases page](https://github.com/aicgen/aicgen/releases):
70
+ Download the latest installer for your platform from the [releases page](https://github.com/aicgen/aicgen/releases):
61
71
 
62
- - **Windows**: `aicgen.exe`
63
- - **Linux**: `aicgen-linux`
64
- - **macOS**: `aicgen-macos`
72
+ - **Windows**: `aicgen-setup-x64.exe` installer
73
+ - **Linux (Debian/Ubuntu)**: `aicgen_amd64.deb`
74
+ - **Linux (Fedora/RHEL)**: `aicgen_x86_64.rpm`
65
75
 
66
76
  ```bash
67
- # Windows
68
- .\aicgen.exe init
77
+ # Windows - run the installer
78
+ aicgen-setup-x64.exe
79
+
80
+ # Linux (Debian/Ubuntu)
81
+ sudo dpkg -i aicgen_amd64.deb
82
+
83
+ # Linux (Fedora/RHEL)
84
+ sudo rpm -i aicgen_x86_64.rpm
69
85
  ```
70
86
 
71
87
  ### From Source
@@ -0,0 +1,50 @@
1
+ # Bounded Contexts
2
+
3
+ ## Core Principle
4
+
5
+ Divide the domain into logical boundaries where a specific model applies. Each context has its own ubiquitous language, data model, and rules.
6
+
7
+ ## Context Mapping Patterns
8
+
9
+ Relates different bounded contexts to each other.
10
+
11
+ ### Partnership
12
+
13
+ Two contexts succeed or fail together. Teams work closely to align interfaces.
14
+
15
+ ### Shared Kernel
16
+
17
+ Sharing a subset of the domain model (code/database) between contexts. High coupling, use sparingly (e.g., for generic Auth/IDs).
18
+
19
+ ### Customer/Supplier
20
+
21
+ Downstream context (Customer) depends on Upstream context (Supplier). Upstream must negotiate changes with Downstream.
22
+
23
+ ### Conformist
24
+
25
+ Downstream blindly conforms to Upstream's model without negotiation.
26
+
27
+ ### Anticorruption Layer (ACL)
28
+
29
+ Downstream isolates itself from Upstream's model by translating it into its own internal model.
30
+
31
+ ## Implementation Structure
32
+
33
+ ```typescript
34
+ // Context: Sales
35
+ namespace Sales {
36
+ export class Order { ... } // Sales-specific Order model
37
+ }
38
+
39
+ // Context: Shipping
40
+ namespace Shipping {
41
+ export class Shipment { ... }
42
+ // Shipping might interact with Sales via ACL or events
43
+ }
44
+ ```
45
+
46
+ ## Best Practices
47
+
48
+ - **Explicit Boundaries**: Code for one context should not bleed into another.
49
+ - **Ubiquitous Language**: Use the same terminology in code as functionality.
50
+ - **Decoupled Deployment**: Ideally, contexts can be deployed independently (microservices or modular monoliths).
@@ -0,0 +1,7 @@
1
+ # Bounded Contexts
2
+
3
+ Domain-Driven Design (DDD) patterns for defining explicit model boundaries.
4
+
5
+ ## Guidelines
6
+
7
+ - `context-map` - Context Mapping patterns (Partnership, Shared Kernel, ACL) ([context-map.md](context-map.md))
@@ -0,0 +1,7 @@
1
+ # Component-Based Architecture
2
+
3
+ Composing applications from isolated, reusable UI/Logic components.
4
+
5
+ ## Guidelines
6
+
7
+ - `structure` - Atomic Design, State Management ([structure.md](structure.md))
@@ -0,0 +1,63 @@
1
+ # Component-Based Architecture
2
+
3
+ ## Core Principle
4
+
5
+ Build the application as a composition of reusable, self-contained components. Common in frontend (React/Vue/Flutter) and mobile development.
6
+
7
+ ## Component Types
8
+
9
+ ### Atoms (Basic UI)
10
+
11
+ Smallest units. Buttons, inputs, icons. No business logic.
12
+
13
+ ### Molecules (Composite)
14
+
15
+ Groups of atoms. Search bar (Input + Button), User Card (Avatar + Text).
16
+
17
+ ### Organisms (Complex Sections)
18
+
19
+ Complex standalone UI sections. Navigation bar, Product Grid.
20
+
21
+ ### Templates & Pages
22
+
23
+ Layout structures and full views connecting organisms with data.
24
+
25
+ ## State Management
26
+
27
+ - **Local State**: UI state specific to a component (e.g., `isOpen`).
28
+ - **Lifted State**: Shared state moved up to a common ancestor.
29
+ - **Global Store**: Application-wide state (Redux/Zustand/Bloc) for data accessed by many unrelated components.
30
+
31
+ ## Implementation Example (React)
32
+
33
+ ```tsx
34
+ // Atom
35
+ const Button = ({ onClick, children }) => (
36
+ <button onClick={onClick}>{children}</button>
37
+ );
38
+
39
+ // Molecule
40
+ const SearchBar = ({ onSearch }) => (
41
+ <div className="search">
42
+ <Input />
43
+ <Button onClick={onSearch}>Search</Button>
44
+ </div>
45
+ );
46
+
47
+ // Page (Organism composition)
48
+ const Dashboard = () => {
49
+ return (
50
+ <Layout>
51
+ <Header />
52
+ <SearchBar />
53
+ <UserGrid />
54
+ </Layout>
55
+ );
56
+ };
57
+ ```
58
+
59
+ ## Best Practices
60
+
61
+ - **Single Responsibility**: A component should do one thing well.
62
+ - **Props Interface**: Define clear contracts for data input.
63
+ - **Composition over Inheritance**: Build complex UIs by combining simpler components.
@@ -10,3 +10,5 @@ Architecture-specific guidelines and best practices.
10
10
  - `layered/` - Layered architecture
11
11
  - `hexagonal/` - Hexagonal (Ports & Adapters) architecture
12
12
  - `refactor/` - Refactoring strategies
13
+ - `bounded-contexts/` - Bounded Contexts architecture
14
+ - `component-based/` - Component-Based architecture
@@ -1203,3 +1203,115 @@ patterns-gof:
1203
1203
  - observer
1204
1204
  - decorator
1205
1205
  category: Design Patterns
1206
+ architecture-bounded-contexts:
1207
+ path: architecture/bounded-contexts/context-map.md
1208
+ architectures:
1209
+ - bounded-contexts
1210
+ levels:
1211
+ - standard
1212
+ - expert
1213
+ - full
1214
+ tags:
1215
+ - ddd
1216
+ - boundaries
1217
+ - context-mapping
1218
+ category: Architecture
1219
+
1220
+ architecture-component-based:
1221
+ path: architecture/component-based/structure.md
1222
+ architectures:
1223
+ - component-based
1224
+ levels:
1225
+ - basic
1226
+ - standard
1227
+ - expert
1228
+ - full
1229
+ tags:
1230
+ - components
1231
+ - react
1232
+ - ui
1233
+ - composition
1234
+ category: Architecture
1235
+ kotlin-basics:
1236
+ path: language/kotlin/basics.md
1237
+ languages:
1238
+ - kotlin
1239
+ levels:
1240
+ - basic
1241
+ - standard
1242
+ - expert
1243
+ - full
1244
+ tags:
1245
+ - kotlin
1246
+ - null-safety
1247
+ - basics
1248
+ category: Language
1249
+
1250
+ kotlin-coroutines:
1251
+ path: language/kotlin/coroutines.md
1252
+ languages:
1253
+ - kotlin
1254
+ levels:
1255
+ - standard
1256
+ - expert
1257
+ - full
1258
+ tags:
1259
+ - kotlin
1260
+ - async
1261
+ - coroutines
1262
+ category: Language
1263
+
1264
+ kotlin-idioms:
1265
+ path: language/kotlin/idioms.md
1266
+ languages:
1267
+ - kotlin
1268
+ levels:
1269
+ - expert
1270
+ - full
1271
+ tags:
1272
+ - kotlin
1273
+ - scope-functions
1274
+ - extensions
1275
+ category: Language
1276
+
1277
+ php-basics:
1278
+ path: language/php/basics.md
1279
+ languages:
1280
+ - php
1281
+ levels:
1282
+ - basic
1283
+ - standard
1284
+ - expert
1285
+ - full
1286
+ tags:
1287
+ - php
1288
+ - types
1289
+ - basics
1290
+ category: Language
1291
+
1292
+ php-oop:
1293
+ path: language/php/oop.md
1294
+ languages:
1295
+ - php
1296
+ levels:
1297
+ - standard
1298
+ - expert
1299
+ - full
1300
+ tags:
1301
+ - php
1302
+ - oop
1303
+ - interfaces
1304
+ category: Language
1305
+
1306
+ php-modern:
1307
+ path: language/php/modern.md
1308
+ languages:
1309
+ - php
1310
+ levels:
1311
+ - expert
1312
+ - full
1313
+ tags:
1314
+ - php
1315
+ - php8
1316
+ - attributes
1317
+ category: Language
@@ -12,3 +12,6 @@ Programming language best practices and idioms.
12
12
  - `java/` - Java guidelines
13
13
  - `csharp/` - C# guidelines
14
14
  - `ruby/` - Ruby guidelines
15
+ - `swift/` - Swift guidelines
16
+ - `kotlin/` - Kotlin guidelines
17
+ - `php/` - PHP guidelines
@@ -0,0 +1,35 @@
1
+ # Kotlin Basics
2
+
3
+ ## Null Safety
4
+
5
+ Kotlin distinguishes between nullable and non-nullable types.
6
+
7
+ - `String` - Cannot hold null.
8
+ - `String?` - Can hold null.
9
+
10
+ ```kotlin
11
+ var a: String = "abc"
12
+ // a = null // compilation error
13
+
14
+ var b: String? = "abc"
15
+ b = null // ok
16
+ ```
17
+
18
+ Use safe calls (`?.`) or the Elvis operator (`?:`) when dealing with nullable types.
19
+
20
+ ```kotlin
21
+ val l = b?.length ?: -1
22
+ ```
23
+
24
+ ## Val vs Var
25
+
26
+ - `val`: Read-only (immutable reference). Prefer this by default.
27
+ - `var`: Mutable.
28
+
29
+ ## Data Classes
30
+
31
+ Use data classes to hold data. They automatically generate `equals()`, `hashCode()`, `toString()`, and `copy()`.
32
+
33
+ ```kotlin
34
+ data class User(val name: String, val age: Int)
35
+ ```
@@ -0,0 +1,32 @@
1
+ # Kotlin Coroutines
2
+
3
+ ## Suspend Functions
4
+
5
+ Functions that can pause and resume execution without blocking the thread.
6
+
7
+ ```kotlin
8
+ suspend fun fetchData(): String {
9
+ delay(1000) // Non-blocking delay
10
+ return "Data"
11
+ }
12
+ ```
13
+
14
+ ## Builders
15
+
16
+ - `launch`: Starts a new coroutine that does not return a result (fire and forget).
17
+ - `async`: Starts a new coroutine that returns a `Deferred` (like a Promise).
18
+
19
+ ## Dispatchers
20
+
21
+ - `Dispatchers.Main`: UI thread.
22
+ - `Dispatchers.IO`: Network/Disk operations.
23
+ - `Dispatchers.Default`: CPU-intensive work.
24
+
25
+ ```kotlin
26
+ viewModelScope.launch(Dispatchers.IO) {
27
+ val data = fetchData()
28
+ withContext(Dispatchers.Main) {
29
+ updateUI(data)
30
+ }
31
+ }
32
+ ```
@@ -0,0 +1,48 @@
1
+ # Kotlin Idioms
2
+
3
+ ## Scope Functions
4
+
5
+ Functions that execute a block of code within the context of an object.
6
+
7
+ ### let
8
+
9
+ Use for null checks or mapping.
10
+
11
+ ```kotlin
12
+ val str: String? = "hello"
13
+ str?.let {
14
+ println(it.length)
15
+ }
16
+ ```
17
+
18
+ ### apply
19
+
20
+ Use for object configuration. Returns the object itself.
21
+
22
+ ```kotlin
23
+ val dialog = Dialog(context).apply {
24
+ setTitle("Hello")
25
+ show()
26
+ }
27
+ ```
28
+
29
+ ### run
30
+
31
+ Use for object configuration and computing a result.
32
+
33
+ ```kotlin
34
+ val result = service.run {
35
+ configure()
36
+ execute()
37
+ }
38
+ ```
39
+
40
+ ## Extension Functions
41
+
42
+ Add functionality to existing classes without inheriting from them.
43
+
44
+ ```kotlin
45
+ fun String.removeSpaces(): String = this.replace(" ", "")
46
+
47
+ val clean = "hello world".removeSpaces()
48
+ ```
@@ -0,0 +1,9 @@
1
+ # Kotlin Guidelines
2
+
3
+ Best practices for Kotlin development on Android and backend.
4
+
5
+ ## Guidelines
6
+
7
+ - `basics` - Syntax, Null Safety, Data Classes ([basics.md](basics.md))
8
+ - `coroutines` - Async programming, Suspended functions ([coroutines.md](coroutines.md))
9
+ - `idioms` - Scope functions (`let`, `apply`), Extensions ([idioms.md](idioms.md))
@@ -0,0 +1,39 @@
1
+ # PHP Basics
2
+
3
+ ## Strict Types
4
+
5
+ Always enable strict typing in new files to prevent unexpected type coercion.
6
+
7
+ ```php
8
+ declare(strict_types=1);
9
+ ```
10
+
11
+ ## Type Declarations
12
+
13
+ Always specify argument and return types.
14
+
15
+ ```php
16
+ function add(int $a, int $b): int {
17
+ return $a + $b;
18
+ }
19
+ ```
20
+
21
+ ## Union and Intersection Types
22
+
23
+ Use robust type definitions.
24
+
25
+ ```php
26
+ function process(Input|string $data): Result&Serializable {
27
+ // ...
28
+ }
29
+ ```
30
+
31
+ ## Nullable Types
32
+
33
+ Use `?Type` for nullable arguments or return values.
34
+
35
+ ```php
36
+ function find(?int $id): ?User {
37
+ return $id ? User::find($id) : null;
38
+ }
39
+ ```
@@ -0,0 +1,9 @@
1
+ # PHP Guidelines
2
+
3
+ Modern PHP standards and best practices (PHP 8.0+).
4
+
5
+ ## Guidelines
6
+
7
+ - `basics` - Strict types, Type declarations ([basics.md](basics.md))
8
+ - `oop` - Classes, Interfaces, Enums ([oop.md](oop.md))
9
+ - `modern` - Attributes, Match expressions ([modern.md](modern.md))
@@ -0,0 +1,36 @@
1
+ # Modern PHP
2
+
3
+ ## Attributes
4
+
5
+ Use Attributes (PHP 8+) instead of PHPDoc annotations.
6
+
7
+ ```php
8
+ #[Route('/api/users', methods: ['GET'])]
9
+ public function list(): Response { ... }
10
+ ```
11
+
12
+ ## Constructor Property Promotion
13
+
14
+ Reduce boilerplate by defining properties in the constructor.
15
+
16
+ ```php
17
+ class Point {
18
+ public function __construct(
19
+ public float $x = 0.0,
20
+ public float $y = 0.0,
21
+ ) {}
22
+ }
23
+ ```
24
+
25
+ ## Match Expression
26
+
27
+ Use `match` instead of `switch`. It is strict, returns a value, and doesn't fall through.
28
+
29
+ ```php
30
+ $message = match ($statusCode) {
31
+ 200, 300 => null,
32
+ 400 => 'not found',
33
+ 500 => 'server error',
34
+ default => 'unknown status code',
35
+ };
36
+ ```
@@ -0,0 +1,45 @@
1
+ # PHP OOP
2
+
3
+ ## Classes and properties
4
+
5
+ Use typed properties and visibility modifiers.
6
+
7
+ ```php
8
+ class User {
9
+ public function __construct(
10
+ private string $name,
11
+ public readonly int $id
12
+ ) {}
13
+ }
14
+ ```
15
+
16
+ ## Interfaces
17
+
18
+ Define contracts using interfaces.
19
+
20
+ ```php
21
+ interface Logger {
22
+ public function log(string $message): void;
23
+ }
24
+ ```
25
+
26
+ ## Traits
27
+
28
+ Use traits for horizontal code reuse, but use sparingly.
29
+
30
+ ```php
31
+ trait Loggable {
32
+ private function log(string $msg) { ... }
33
+ }
34
+ ```
35
+
36
+ ## Enums
37
+
38
+ Use native Enums (PHP 8.1+) instead of class constants.
39
+
40
+ ```php
41
+ enum Status: string {
42
+ case Draft = 'draft';
43
+ case Published = 'published';
44
+ }
45
+ ```
package/data/version.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "version": "1.0.0",
3
3
  "lastUpdated": "2026-01-15",
4
- "totalGuidelines": 91,
4
+ "totalGuidelines": 99,
5
5
  "categories": {
6
- "Language": 33,
7
- "Architecture": 19,
6
+ "Language": 39,
7
+ "Architecture": 21,
8
8
  "Testing": 4,
9
9
  "Security": 4,
10
10
  "Performance": 4,
@@ -26,7 +26,9 @@
26
26
  "ruby": 2,
27
27
  "javascript": 2,
28
28
  "dart": 4,
29
- "swift": 5
29
+ "swift": 5,
30
+ "kotlin": 3,
31
+ "php": 3
30
32
  },
31
33
  "architectures": {
32
34
  "microservices": 5,
@@ -36,13 +38,15 @@
36
38
  "event-driven": 2,
37
39
  "layered": 1,
38
40
  "serverless": 2,
39
- "hexagonal": 1
41
+ "hexagonal": 1,
42
+ "bounded-contexts": 1,
43
+ "component-based": 1
40
44
  },
41
45
  "levels": {
42
- "basic": 20,
43
- "standard": 77,
44
- "expert": 91,
45
- "full": 91
46
+ "basic": 23,
47
+ "standard": 83,
48
+ "expert": 99,
49
+ "full": 99
46
50
  },
47
51
  "datasources": {
48
52
  "sql": 3,
package/dist/index.js CHANGED
@@ -48492,6 +48492,144 @@ var EMBEDDED_DATA = {
48492
48492
  "decorator"
48493
48493
  ],
48494
48494
  category: "Design Patterns"
48495
+ },
48496
+ "architecture-bounded-contexts": {
48497
+ path: "architecture/bounded-contexts/context-map.md",
48498
+ architectures: [
48499
+ "bounded-contexts"
48500
+ ],
48501
+ levels: [
48502
+ "standard",
48503
+ "expert",
48504
+ "full"
48505
+ ],
48506
+ tags: [
48507
+ "ddd",
48508
+ "boundaries",
48509
+ "context-mapping"
48510
+ ],
48511
+ category: "Architecture"
48512
+ },
48513
+ "architecture-component-based": {
48514
+ path: "architecture/component-based/structure.md",
48515
+ architectures: [
48516
+ "component-based"
48517
+ ],
48518
+ levels: [
48519
+ "basic",
48520
+ "standard",
48521
+ "expert",
48522
+ "full"
48523
+ ],
48524
+ tags: [
48525
+ "components",
48526
+ "react",
48527
+ "ui",
48528
+ "composition"
48529
+ ],
48530
+ category: "Architecture"
48531
+ },
48532
+ "kotlin-basics": {
48533
+ path: "language/kotlin/basics.md",
48534
+ languages: [
48535
+ "kotlin"
48536
+ ],
48537
+ levels: [
48538
+ "basic",
48539
+ "standard",
48540
+ "expert",
48541
+ "full"
48542
+ ],
48543
+ tags: [
48544
+ "kotlin",
48545
+ "null-safety",
48546
+ "basics"
48547
+ ],
48548
+ category: "Language"
48549
+ },
48550
+ "kotlin-coroutines": {
48551
+ path: "language/kotlin/coroutines.md",
48552
+ languages: [
48553
+ "kotlin"
48554
+ ],
48555
+ levels: [
48556
+ "standard",
48557
+ "expert",
48558
+ "full"
48559
+ ],
48560
+ tags: [
48561
+ "kotlin",
48562
+ "async",
48563
+ "coroutines"
48564
+ ],
48565
+ category: "Language"
48566
+ },
48567
+ "kotlin-idioms": {
48568
+ path: "language/kotlin/idioms.md",
48569
+ languages: [
48570
+ "kotlin"
48571
+ ],
48572
+ levels: [
48573
+ "expert",
48574
+ "full"
48575
+ ],
48576
+ tags: [
48577
+ "kotlin",
48578
+ "scope-functions",
48579
+ "extensions"
48580
+ ],
48581
+ category: "Language"
48582
+ },
48583
+ "php-basics": {
48584
+ path: "language/php/basics.md",
48585
+ languages: [
48586
+ "php"
48587
+ ],
48588
+ levels: [
48589
+ "basic",
48590
+ "standard",
48591
+ "expert",
48592
+ "full"
48593
+ ],
48594
+ tags: [
48595
+ "php",
48596
+ "types",
48597
+ "basics"
48598
+ ],
48599
+ category: "Language"
48600
+ },
48601
+ "php-oop": {
48602
+ path: "language/php/oop.md",
48603
+ languages: [
48604
+ "php"
48605
+ ],
48606
+ levels: [
48607
+ "standard",
48608
+ "expert",
48609
+ "full"
48610
+ ],
48611
+ tags: [
48612
+ "php",
48613
+ "oop",
48614
+ "interfaces"
48615
+ ],
48616
+ category: "Language"
48617
+ },
48618
+ "php-modern": {
48619
+ path: "language/php/modern.md",
48620
+ languages: [
48621
+ "php"
48622
+ ],
48623
+ levels: [
48624
+ "expert",
48625
+ "full"
48626
+ ],
48627
+ tags: [
48628
+ "php",
48629
+ "php8",
48630
+ "attributes"
48631
+ ],
48632
+ category: "Language"
48495
48633
  }
48496
48634
  },
48497
48635
  guidelines: {
@@ -50461,6 +50599,139 @@ let (result1, result2) = tokio::join!(
50461
50599
  fetch_data("url2")
50462
50600
  );
50463
50601
  \`\`\`
50602
+ `,
50603
+ "language/php/modern.md": `# Modern PHP
50604
+
50605
+ ## Attributes
50606
+
50607
+ Use Attributes (PHP 8+) instead of PHPDoc annotations.
50608
+
50609
+ \`\`\`php
50610
+ #[Route('/api/users', methods: ['GET'])]
50611
+ public function list(): Response { ... }
50612
+ \`\`\`
50613
+
50614
+ ## Constructor Property Promotion
50615
+
50616
+ Reduce boilerplate by defining properties in the constructor.
50617
+
50618
+ \`\`\`php
50619
+ class Point {
50620
+ public function __construct(
50621
+ public float $x = 0.0,
50622
+ public float $y = 0.0,
50623
+ ) {}
50624
+ }
50625
+ \`\`\`
50626
+
50627
+ ## Match Expression
50628
+
50629
+ Use \`match\` instead of \`switch\`. It is strict, returns a value, and doesn't fall through.
50630
+
50631
+ \`\`\`php
50632
+ $message = match ($statusCode) {
50633
+ 200, 300 => null,
50634
+ 400 => 'not found',
50635
+ 500 => 'server error',
50636
+ default => 'unknown status code',
50637
+ };
50638
+ \`\`\`
50639
+ `,
50640
+ "language/php/oop.md": `# PHP OOP
50641
+
50642
+ ## Classes and properties
50643
+
50644
+ Use typed properties and visibility modifiers.
50645
+
50646
+ \`\`\`php
50647
+ class User {
50648
+ public function __construct(
50649
+ private string $name,
50650
+ public readonly int $id
50651
+ ) {}
50652
+ }
50653
+ \`\`\`
50654
+
50655
+ ## Interfaces
50656
+
50657
+ Define contracts using interfaces.
50658
+
50659
+ \`\`\`php
50660
+ interface Logger {
50661
+ public function log(string $message): void;
50662
+ }
50663
+ \`\`\`
50664
+
50665
+ ## Traits
50666
+
50667
+ Use traits for horizontal code reuse, but use sparingly.
50668
+
50669
+ \`\`\`php
50670
+ trait Loggable {
50671
+ private function log(string $msg) { ... }
50672
+ }
50673
+ \`\`\`
50674
+
50675
+ ## Enums
50676
+
50677
+ Use native Enums (PHP 8.1+) instead of class constants.
50678
+
50679
+ \`\`\`php
50680
+ enum Status: string {
50681
+ case Draft = 'draft';
50682
+ case Published = 'published';
50683
+ }
50684
+ \`\`\`
50685
+ `,
50686
+ "language/php/basics.md": `# PHP Basics
50687
+
50688
+ ## Strict Types
50689
+
50690
+ Always enable strict typing in new files to prevent unexpected type coercion.
50691
+
50692
+ \`\`\`php
50693
+ declare(strict_types=1);
50694
+ \`\`\`
50695
+
50696
+ ## Type Declarations
50697
+
50698
+ Always specify argument and return types.
50699
+
50700
+ \`\`\`php
50701
+ function add(int $a, int $b): int {
50702
+ return $a + $b;
50703
+ }
50704
+ \`\`\`
50705
+
50706
+ ## Union and Intersection Types
50707
+
50708
+ Use robust type definitions.
50709
+
50710
+ \`\`\`php
50711
+ function process(Input|string $data): Result&Serializable {
50712
+ // ...
50713
+ }
50714
+ \`\`\`
50715
+
50716
+ ## Nullable Types
50717
+
50718
+ Use \`?Type\` for nullable arguments or return values.
50719
+
50720
+ \`\`\`php
50721
+ function find(?int $id): ?User {
50722
+ return $id ? User::find($id) : null;
50723
+ }
50724
+ \`\`\`
50725
+ `,
50726
+ "language/php/index.md": `# PHP Guidelines
50727
+
50728
+ Modern PHP standards and best practices (PHP 8.0+).
50729
+
50730
+ ## Guidelines
50731
+
50732
+ - \`basics\` - Strict types, Type declarations ([basics.md](basics.md))
50733
+ - \`oop\` - Classes, Interfaces, Enums ([oop.md](oop.md))
50734
+ - \`modern\` - Attributes, Match expressions ([modern.md](modern.md))
50464
50735
  `,
50465
50736
  "language/java/testing.md": `# Java Testing (JUnit 5)
50466
50737
 
@@ -54239,6 +54510,90 @@ struct User {
54239
54510
  - [Google Swift Style Guide](https://google.github.io/swift/)
54240
54511
  - [Kodeco Swift Style Guide](https://github.com/kodecocodes/swift-style-guide)
54241
54512
  `,
54513
+ "language/kotlin/coroutines.md": `# Kotlin Coroutines
54514
+
54515
+ ## Suspend Functions
54516
+
54517
+ Functions that can pause and resume execution without blocking the thread.
54518
+
54519
+ \`\`\`kotlin
54520
+ suspend fun fetchData(): String {
54521
+ delay(1000) // Non-blocking delay
54522
+ return "Data"
54523
+ }
54524
+ \`\`\`
54525
+
54526
+ ## Builders
54527
+
54528
+ - \`launch\`: Starts a new coroutine that does not return a result (fire and forget).
54529
+ - \`async\`: Starts a new coroutine that returns a \`Deferred\` (like a Promise).
54530
+
54531
+ ## Dispatchers
54532
+
54533
+ - \`Dispatchers.Main\`: UI thread.
54534
+ - \`Dispatchers.IO\`: Network/Disk operations.
54535
+ - \`Dispatchers.Default\`: CPU-intensive work.
54536
+
54537
+ \`\`\`kotlin
54538
+ viewModelScope.launch(Dispatchers.IO) {
54539
+ val data = fetchData()
54540
+ withContext(Dispatchers.Main) {
54541
+ updateUI(data)
54542
+ }
54543
+ }
54544
+ \`\`\`
54545
+ `,
54546
+ "language/kotlin/idioms.md": `# Kotlin Idioms
54547
+
54548
+ ## Scope Functions
54549
+
54550
+ Functions that execute a block of code within the context of an object.
54551
+
54552
+ ### let
54553
+
54554
+ Use for null checks or mapping.
54555
+
54556
+ \`\`\`kotlin
54557
+ val str: String? = "hello"
54558
+ str?.let {
54559
+ println(it.length)
54560
+ }
54561
+ \`\`\`
54562
+
54563
+ ### apply
54564
+
54565
+ Use for object configuration. Returns the object itself.
54566
+
54567
+ \`\`\`kotlin
54568
+ val dialog = Dialog(context).apply {
54569
+ setTitle("Hello")
54570
+ show()
54571
+ }
54572
+ \`\`\`
54573
+
54574
+ ### run
54575
+
54576
+ Use for object configuration and computing a result.
54577
+
54578
+ \`\`\`kotlin
54579
+ val result = service.run {
54580
+ configure()
54581
+ execute()
54582
+ }
54583
+ \`\`\`
54584
+
54585
+ ## Extension Functions
54586
+
54587
+ Add functionality to existing classes without inheriting from them.
54588
+
54589
+ \`\`\`kotlin
54590
+ fun String.removeSpaces(): String = this.replace(" ", "")
54591
+
54592
+ val clean = "hello world".removeSpaces()
54593
+ \`\`\`
54594
+ `,
54595
+ "language/kotlin/basics.md": '# Kotlin Basics\n\n## Null Safety\n\nKotlin distinguishes between nullable and non-nullable types.\n\n- `String` - Cannot hold null.\n- `String?` - Can hold null.\n\n```kotlin\nvar a: String = "abc"\n// a = null // compilation error\n\nvar b: String? = "abc"\nb = null // ok\n```\n\nUse safe calls (`?.`) or the Elvis operator (`?:`) when dealing with nullable types.\n\n```kotlin\nval l = b?.length ?: -1\n```\n\n## Val vs Var\n\n- `val`: Read-only (immutable reference). Prefer this by default.\n- `var`: Mutable.\n\n## Data Classes\n\nUse data classes to hold data. They automatically generate `equals()`, `hashCode()`, `toString()`, and `copy()`.\n\n```kotlin\ndata class User(val name: String, val age: Int)\n```\n',
54596
+ "language/kotlin/index.md": "# Kotlin Guidelines\n\nBest practices for Kotlin development on Android and backend.\n\n## Guidelines\n\n- `basics` - Syntax, Null Safety, Data Classes ([basics.md](basics.md))\n- `coroutines` - Async programming, Suspended functions ([coroutines.md](coroutines.md))\n- `idioms` - Scope functions (`let`, `apply`), Extensions ([idioms.md](idioms.md))\n",
54242
54597
  "language/typescript/generics.md": `# TypeScript Generics
54243
54598
 
54244
54599
  ## Basic Generic Functions
@@ -57603,7 +57958,7 @@ stream.listen(
57603
57958
  - Use \`async*\` and \`yield\` for generating stream data
57604
57959
  - Prefer \`await for\` over \`listen\` for sequential processing
57605
57960
  `,
57606
- "language/index.md": "# Language-Specific Guidelines\n\nProgramming language best practices and idioms.\n\n## Available Languages\n\n- `typescript/` - TypeScript guidelines\n- `javascript/` - JavaScript (ES6+) guidelines\n- `python/` - Python guidelines\n- `go/` - Go guidelines\n- `rust/` - Rust guidelines\n- `java/` - Java guidelines\n- `csharp/` - C# guidelines\n- `ruby/` - Ruby guidelines\n",
57961
+ "language/index.md": "# Language-Specific Guidelines\n\nProgramming language best practices and idioms.\n\n## Available Languages\n\n- `typescript/` - TypeScript guidelines\n- `javascript/` - JavaScript (ES6+) guidelines\n- `python/` - Python guidelines\n- `go/` - Go guidelines\n- `rust/` - Rust guidelines\n- `java/` - Java guidelines\n- `csharp/` - C# guidelines\n- `ruby/` - Ruby guidelines\n- `swift/` - Swift guidelines\n- `kotlin/` - Kotlin guidelines\n- `php/` - PHP guidelines\n",
57607
57962
  "patterns/domain-logic.md": `# Domain Logic Patterns
57608
57963
 
57609
57964
  ## Transaction Script
@@ -60216,6 +60571,78 @@ This directory contains feature toggle patterns.
60216
60571
  ## Available Chunks
60217
60572
 
60218
60573
  - **patterns.md** - Release toggles, experiment toggles, ops toggles
60574
+ `,
60575
+ "architecture/component-based/structure.md": `# Component-Based Architecture
60576
+
60577
+ ## Core Principle
60578
+
60579
+ Build the application as a composition of reusable, self-contained components. Common in frontend (React/Vue/Flutter) and mobile development.
60580
+
60581
+ ## Component Types
60582
+
60583
+ ### Atoms (Basic UI)
60584
+
60585
+ Smallest units. Buttons, inputs, icons. No business logic.
60586
+
60587
+ ### Molecules (Composite)
60588
+
60589
+ Groups of atoms. Search bar (Input + Button), User Card (Avatar + Text).
60590
+
60591
+ ### Organisms (Complex Sections)
60592
+
60593
+ Complex standalone UI sections. Navigation bar, Product Grid.
60594
+
60595
+ ### Templates & Pages
60596
+
60597
+ Layout structures and full views connecting organisms with data.
60598
+
60599
+ ## State Management
60600
+
60601
+ - **Local State**: UI state specific to a component (e.g., \`isOpen\`).
60602
+ - **Lifted State**: Shared state moved up to a common ancestor.
60603
+ - **Global Store**: Application-wide state (Redux/Zustand/Bloc) for data accessed by many unrelated components.
60604
+
60605
+ ## Implementation Example (React)
60606
+
60607
+ \`\`\`tsx
60608
+ // Atom
60609
+ const Button = ({ onClick, children }) => (
60610
+ <button onClick={onClick}>{children}</button>
60611
+ );
60612
+
60613
+ // Molecule
60614
+ const SearchBar = ({ onSearch }) => (
60615
+ <div className="search">
60616
+ <Input />
60617
+ <Button onClick={onSearch}>Search</Button>
60618
+ </div>
60619
+ );
60620
+
60621
+ // Page (Organism composition)
60622
+ const Dashboard = () => {
60623
+ return (
60624
+ <Layout>
60625
+ <Header />
60626
+ <SearchBar />
60627
+ <UserGrid />
60628
+ </Layout>
60629
+ );
60630
+ };
60631
+ \`\`\`
60632
+
60633
+ ## Best Practices
60634
+
60635
+ - **Single Responsibility**: A component should do one thing well.
60636
+ - **Props Interface**: Define clear contracts for data input.
60637
+ - **Composition over Inheritance**: Build complex UIs by combining simpler components.
60638
+ `,
60639
+ "architecture/component-based/index.md": `# Component-Based Architecture
60640
+
60641
+ Composing applications from isolated, reusable UI/Logic components.
60642
+
60643
+ ## Guidelines
60644
+
60645
+ - \`structure\` - Atomic Design, State Management ([structure.md](structure.md))
60219
60646
  `,
60220
60647
  "architecture/ddd/tactical.md": `# DDD Tactical Patterns
60221
60648
 
@@ -60557,6 +60984,65 @@ This directory contains layered architecture patterns.
60557
60984
  ## Available Chunks
60558
60985
 
60559
60986
  - **layers.md** - Presentation, Domain, Data Access layers
60987
+ `,
60988
+ "architecture/bounded-contexts/context-map.md": `# Bounded Contexts
60989
+
60990
+ ## Core Principle
60991
+
60992
+ Divide the domain into logical boundaries where a specific model applies. Each context has its own ubiquitous language, data model, and rules.
60993
+
60994
+ ## Context Mapping Patterns
60995
+
60996
+ Relates different bounded contexts to each other.
60997
+
60998
+ ### Partnership
60999
+
61000
+ Two contexts succeed or fail together. Teams work closely to align interfaces.
61001
+
61002
+ ### Shared Kernel
61003
+
61004
+ Sharing a subset of the domain model (code/database) between contexts. High coupling, use sparingly (e.g., for generic Auth/IDs).
61005
+
61006
+ ### Customer/Supplier
61007
+
61008
+ Downstream context (Customer) depends on Upstream context (Supplier). Upstream must negotiate changes with Downstream.
61009
+
61010
+ ### Conformist
61011
+
61012
+ Downstream blindly conforms to Upstream's model without negotiation.
61013
+
61014
+ ### Anticorruption Layer (ACL)
61015
+
61016
+ Downstream isolates itself from Upstream's model by translating it into its own internal model.
61017
+
61018
+ ## Implementation Structure
61019
+
61020
+ \`\`\`typescript
61021
+ // Context: Sales
61022
+ namespace Sales {
61023
+ export class Order { ... } // Sales-specific Order model
61024
+ }
61025
+
61026
+ // Context: Shipping
61027
+ namespace Shipping {
61028
+ export class Shipment { ... }
61029
+ // Shipping might interact with Sales via ACL or events
61030
+ }
61031
+ \`\`\`
61032
+
61033
+ ## Best Practices
61034
+
61035
+ - **Explicit Boundaries**: Code for one context should not bleed into another.
61036
+ - **Ubiquitous Language**: Use the same terminology in code as functionality.
61037
+ - **Decoupled Deployment**: Ideally, contexts can be deployed independently (microservices or modular monoliths).
61038
+ `,
61039
+ "architecture/bounded-contexts/index.md": `# Bounded Contexts
61040
+
61041
+ Domain-Driven Design (DDD) patterns for defining explicit model boundaries.
61042
+
61043
+ ## Guidelines
61044
+
61045
+ - \`context-map\` - Context Mapping patterns (Partnership, Shared Kernel, ACL) ([context-map.md](context-map.md))
60560
61046
  `,
60561
61047
  "architecture/gui/patterns.md": `# GUI Architecture Patterns
60562
61048
 
@@ -60699,7 +61185,7 @@ This directory contains GUI architecture patterns.
60699
61185
 
60700
61186
  - **patterns.md** - MVC, MVP, MVVM, Component Architecture
60701
61187
  `,
60702
- "architecture/index.md": "# Architecture Patterns\n\nArchitecture-specific guidelines and best practices.\n\n## Available Architectures\n\n- `microservices/` - Microservices architecture\n- `modular-monolith/` - Modular monolith patterns\n- `event-driven/` - Event-driven architecture\n- `layered/` - Layered architecture\n- `hexagonal/` - Hexagonal (Ports & Adapters) architecture\n- `refactor/` - Refactoring strategies\n",
61188
+ "architecture/index.md": "# Architecture Patterns\n\nArchitecture-specific guidelines and best practices.\n\n## Available Architectures\n\n- `microservices/` - Microservices architecture\n- `modular-monolith/` - Modular monolith patterns\n- `event-driven/` - Event-driven architecture\n- `layered/` - Layered architecture\n- `hexagonal/` - Hexagonal (Ports & Adapters) architecture\n- `refactor/` - Refactoring strategies\n- `bounded-contexts/` - Bounded Contexts architecture\n- `component-based/` - Component-Based architecture\n",
60703
61189
  "devops/ci-cd.md": `# CI/CD Practices
60704
61190
 
60705
61191
  ## Continuous Integration
@@ -67768,6 +68254,9 @@ class AnalysisValidator {
67768
68254
  "csharp",
67769
68255
  "ruby",
67770
68256
  "dart",
68257
+ "swift",
68258
+ "kotlin",
68259
+ "php",
67771
68260
  "unknown"
67772
68261
  ]);
67773
68262
  this.validProjectTypes = new Set([
@@ -67789,6 +68278,8 @@ class AnalysisValidator {
67789
68278
  "ddd",
67790
68279
  "serverless",
67791
68280
  "monorepo",
68281
+ "bounded-contexts",
68282
+ "component-based",
67792
68283
  "other"
67793
68284
  ]);
67794
68285
  this.validDatasources = new Set([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aicgen/aicgen",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "description": "AI Config Generator - Automated AI assistant configuration for your projects",
5
5
  "keywords": [
6
6
  "ai",