@startuml ggen-lifecycle-architecture

!define RECTANGLE class

skinparam componentStyle rectangle
skinparam backgroundColor #FEFEFE
skinparam roundcorner 10

title ggen Lifecycle System Architecture - v1.2.0 Status\n✅ Core Complete (5,252 LOC) | ⚠️ Framework Adapters Planned for v1.4.0

' Core Components
package "Project Root" {
  [make.toml] as make #LightBlue
  note right of make
    **The Rust equivalent of package.json**
    - Defines lifecycle phases
    - Shell commands for any language
    - Hooks system
    - Environment configs
    - Dependencies (cargo, npm, pip, etc.)
  end note

  [ggen.toml] as ggen #LightGreen
  note right of ggen
    **Project configuration**
    - Framework metadata
    - Template paths
    - RDF semantic data
    - Variable defaults
  end note

  folder ".ggen/" {
    [state.json] as state #LightYellow
    [cache/] as cache #LightYellow
  }
}

package "Templates (Simple)" {
  [component.vue.tmpl] as tmpl1 #LightCoral
  [page.vue.tmpl] as tmpl2 #LightCoral
  [api.rs.tmpl] as tmpl3 #LightCoral

  note right of tmpl1
    **Templates stay simple**
    ---
    to: "src/components/{{name}}.vue"
    sh_before: "ggen validate {{name}}"
    sh_after: "ggen format {{output}}"
    ---
    <template>...</template>
  end note
}

package "ggen CLI (✅ 100% Complete)" {
  [Lifecycle Runner\n✅ COMPLETE] as runner #LightGreen
  [Hook Executor\n✅ COMPLETE] as hooks #LightGreen
  [State Manager\n✅ COMPLETE] as statemgr #LightGreen
  [Template Engine\n✅ COMPLETE] as engine #LightGreen
  [Bootstrap Command\n✅ COMPLETE] as bootstrap #LightGreen

  note right of runner
    **5,252 lines implemented**
    ✅ Phase execution
    ✅ make.toml parser
    ✅ Production validation
    ✅ 14 module files
    📁 ggen-core/src/lifecycle/
  end note

  note right of bootstrap
    **Project Scaffolding**
    ✅ ggen project new
    ✅ Type-based generation
    ✅ Framework selection
    📁 cli/src/cmds/project/new.rs
  end note
}

package "Framework Adapters (📋 Planned v1.4.0)" {
  [nuxt-4] as nuxt #LightGray
  [next-15] as next #LightGray
  [rust-cargo] as rust #LightGray
  [python-poetry] as python #LightGray
  [rails-7] as rails #LightGray

  note right of nuxt
    **v1.4.0 Roadmap**
    📋 Framework-specific adapters
    📋 Auto-detection
    📋 Template marketplace integration
    📋 Cross-language projects

    **Current Status:**
    ✅ Architecture designed
    ✅ Lifecycle system ready
    ❌ Adapters not yet implemented
  end note
}

' Relationships
make --> runner : defines phases
ggen --> runner : configuration
runner --> hooks : execute before/after
hooks --> tmpl1 : sh_before/sh_after
runner --> engine : render templates
engine --> statemgr : track generated
statemgr --> state : persist
runner --> nuxt : framework-specific
runner --> next : framework-specific
runner --> rust : framework-specific

' User interaction
actor Developer
Developer --> runner : ggen run <phase>
runner --> Developer : feedback

@enduml
