kortext 2.2.0 → 2.2.3

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/AGENTS.md CHANGED
@@ -12,17 +12,17 @@ Her yeni oturum `+operation-manager` olarak başlar.
12
12
 
13
13
  Şu yolları kontrol et:
14
14
 
15
- - `kortext/workspace/memory/context/`
16
- - `kortext/workspace/memory/handover.md`
17
- - `kortext/settings/config.md` (KORTEXT_INTERACTION_LANGUAGE kontrolü için)
15
+ - `.kortext/workspace/memory/context/`
16
+ - `.kortext/workspace/memory/handover.md`
17
+ - `.kortext/settings/config.md` (KORTEXT_INTERACTION_LANGUAGE kontrolü için)
18
18
 
19
19
  ## Başlangıç Kararı
20
20
 
21
- - Eğer `kortext/workspace/memory/context/` içinde aktif görev dosyası varsa, `+operation-manager` dosyada belirtilen ilgili ajanı devam ettirir.
22
- - Eğer aktif görev yoksa ama `kortext/workspace/memory/handover.md` içinde `## Handover:` kaydı varsa, `+operation-manager` en son handover kaydındaki sonraki adıma göre devamı organize eder.
23
- - Eğer aktif görev ve handover kaydı yoksa, `+operation-manager` `kortext/workflows/00-kortext-setup.md` akışını başlatır.
21
+ - Eğer `.kortext/workspace/memory/context/` içinde aktif görev dosyası varsa, `+operation-manager` dosyada belirtilen ilgili ajanı devam ettirir.
22
+ - Eğer aktif görev yoksa ama `.kortext/workspace/memory/handover.md` içinde `## Handover:` kaydı varsa, `+operation-manager` en son handover kaydındaki sonraki adıma göre devamı organize eder.
23
+ - Eğer aktif görev ve handover kaydı yoksa, `+operation-manager` `.kortext/workflows/00-kortext-setup.md` akışını başlatır.
24
24
 
25
25
  ## Şablon Kuralı
26
26
 
27
- - `kortext/workspace/templates/` altındaki dosyalar çalışma durumu sayılmaz.
27
+ - `.kortext/workspace/templates/` altındaki dosyalar çalışma durumu sayılmaz.
28
28
  -
package/README.md CHANGED
@@ -23,14 +23,14 @@ No coding knowledge required. You describe what you want to build — Kortext ag
23
23
  ## Quick Start
24
24
 
25
25
  ```bash
26
- # Install
26
+ # Install (one-time, global)
27
27
  npm install -g kortext
28
28
 
29
29
  # In your project directory
30
30
  kortext init
31
31
 
32
32
  # Fill in the blueprint (describes your product)
33
- # workspace/references/blueprint.md
33
+ # .kortext/workspace/references/blueprint.md
34
34
 
35
35
  # Then tell your AI agent:
36
36
  # !start analysis
@@ -41,15 +41,22 @@ kortext init
41
41
  ## Architecture
42
42
 
43
43
  ```
44
- kortext/
45
- ├── agents/ # 14 persona definitions (operation-manager, backend-dev, qa...)
46
- ├── workflows/ # 12 workflow pipelines (analysis, planning, dev, deploy...)
47
- ├── hooks/ # 16 git + runtime hooks (lock, audit, secret-scan, snapshot...)
48
- ├── scripts/ # 13 Python automation scripts (backlog, handover, health...)
49
- ├── rules/ # Behavior rules, commands, branching strategy
50
- ├── settings/ # Config, runtime adapters (Claude/Gemini/Codex), INTEGRATION-MAP
51
- ├── skills/ # Per-persona skill folders (populate with your stack)
52
- └── workspace/ # Memory, backlog, references, templates, reports
44
+ proje/
45
+ ├── AGENTS.md # AI runtime entry point (auto-generated by kortext init)
46
+ └── .kortext/ # All framework files live here (like .git/)
47
+ ├── agents/ # 14 persona definitions
48
+ ├── workflows/ # 12 workflow pipelines
49
+ ├── hooks/ # 16 git + runtime hooks
50
+ ├── scripts/ # 13 Python automation scripts
51
+ ├── rules/ # Behavior rules, commands, branching strategy
52
+ ├── settings/ # Config, runtime adapters, INTEGRATION-MAP
53
+ ├── skills/ # Per-persona skill folders
54
+ └── workspace/ # Memory, backlog, references, templates, reports
55
+ ├── references/
56
+ │ └── blueprint.md # ← You fill this in
57
+ └── memory/
58
+ ├── backlog/ # Tasks live here
59
+ └── context/ # Active agent files
53
60
  ```
54
61
 
55
62
  ---
@@ -6,7 +6,7 @@ kortext_find_root() {
6
6
  local dir="${1:-$PWD}"
7
7
 
8
8
  while [ "$dir" != "/" ]; do
9
- if [ -d "$dir/kortext/hooks" ] || [ -d "$dir/.kortext/hooks" ]; then
9
+ if [ -d "$dir/.kortext/hooks" ]; then
10
10
  printf '%s\n' "$dir"
11
11
  return 0
12
12
  fi
@@ -18,16 +18,26 @@ kortext_find_root() {
18
18
 
19
19
  KORTEXT_ROOT="${KORTEXT_ROOT:-$(kortext_find_root "$PWD" 2>/dev/null || pwd)}"
20
20
 
21
- if [ -d "$KORTEXT_ROOT/kortext" ]; then
22
- KORTEXT_REL="${KORTEXT_REL:-kortext}"
23
- elif [ -d "$KORTEXT_ROOT/.kortext" ]; then
24
- KORTEXT_REL="${KORTEXT_REL:-.kortext}"
25
- else
26
- KORTEXT_REL="${KORTEXT_REL:-kortext}"
21
+ # .kortext zorunlu çift modlu sistem kaldırıldı
22
+ KORTEXT_REL="${KORTEXT_REL:-.kortext}"
23
+ KORTEXT_DIR="${KORTEXT_DIR:-$KORTEXT_ROOT/$KORTEXT_REL}"
24
+
25
+ # Hata kontrolü: .kortext/ bulunmazsa açık hata ver
26
+ if [ ! -d "$KORTEXT_DIR/hooks" ]; then
27
+ echo "❌ HATA: .kortext/ dizini bulunamadı: $KORTEXT_DIR" >&2
28
+ return 1
27
29
  fi
28
30
 
29
- KORTEXT_DIR="${KORTEXT_DIR:-$KORTEXT_ROOT/$KORTEXT_REL}"
30
- KORTEXT_WORKSPACE_DIR="${KORTEXT_WORKSPACE_DIR:-$KORTEXT_DIR/workspace}"
31
+ # KORTEXT_WORKSPACE_DIR: npm global kurulumda framework ve proje dizini ayrılır.
32
+ # Önce çalışma dizininde local workspace/ ara; yoksa framework'ün kendi workspace/'ini kullan.
33
+ if [ -z "${KORTEXT_WORKSPACE_DIR:-}" ]; then
34
+ if [ -d "$PWD/workspace" ]; then
35
+ KORTEXT_WORKSPACE_DIR="$PWD/workspace"
36
+ else
37
+ KORTEXT_WORKSPACE_DIR="$KORTEXT_DIR/workspace"
38
+ fi
39
+ fi
40
+ export KORTEXT_WORKSPACE_DIR
31
41
 
32
42
  kortext_abs_path() {
33
43
  local path="$1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kortext",
3
- "version": "2.2.0",
3
+ "version": "2.2.3",
4
4
  "description": "AI Agent Framework for Operational Discipline and Automated Project Management",
5
5
  "main": "index.js",
6
6
  "bin": {
package/rules/behavior.md CHANGED
@@ -246,7 +246,7 @@ Projeye özel `workspace/references/` ve `workspace/reports/` dosyalarında onay
246
246
 
247
247
  ### İletişim Dili (Communication Language)
248
248
 
249
- 1. **Config Kontrolü:** Ajan, her oturum başında `kortext/settings/config.md` dosyasındaki `KORTEXT_INTERACTION_LANGUAGE` değerini okumalıdır.
249
+ 1. **Config Kontrolü:** Ajan, her oturum başında `.kortext/settings/config.md` dosyasındaki `KORTEXT_INTERACTION_LANGUAGE` değerini okumalıdır.
250
250
  2. **Dil Uyumu:** Kullanıcı ile kurulan tüm iletişim (yanıtlar, açıklamalar, raporlar), config dosyasında belirtilen dilde (`tr` veya `en`) yapılmalıdır.
251
251
  3. **Teknik İstisna:** Dosya yolları, kod blokları, hata mesajları ve framework çekirdek terimleri (Backlog Item ID, Persona isimleri vb.) orijinal formatında (genellikle İngilizce) bırakılmalıdır.
252
- 4. **Dinamik Değişim:** Eğer kullanıcı sohbet sırasında dili değiştirirse, ajan kullanıcıyı `config.md` dosyasını güncellemeye yönlendirmeli, ancak o andan itibaren yeni dilde yanıt vermeye başlamalıdır.
252
+ 4. **Dinamik Değişim:** Eğer kullanıcı sohbet sırasında dili değiştirirse, ajan kullanıcıyı `.kortext/settings/config.md` dosyasını güncellemeye yönlendirmeli, ancak o andan itibaren yeni dilde yanıt vermeye başlamalıdır.
@@ -74,13 +74,94 @@ def _run_shell_script(script_path: Path, args: list[str], env_overrides: dict[st
74
74
  return result.returncode
75
75
 
76
76
 
77
+ def _scaffold_project(project_dir: Path) -> Path:
78
+ """Tüm framework dosyalarını proje/.kortext/ altına kopyalar.
79
+
80
+ Yapı:
81
+ proje/
82
+ ├── AGENTS.md ← AI runtime'ın proje kökünde bulduğu dosya
83
+ └── .kortext/
84
+ ├── agents/
85
+ ├── hooks/
86
+ ├── scripts/
87
+ ├── workflows/
88
+ ├── rules/
89
+ ├── settings/
90
+ └── workspace/ ← proje-spesifik bellek (backlog, context...)
91
+
92
+ İkinci çalıştırmada mevcut .kortext/'e dokunulmaz; workspace/ güncellenmez
93
+ (içinde proje verisi olabilir).
94
+ """
95
+ import shutil
96
+
97
+ kortext_dst = project_dir / ".kortext"
98
+
99
+ if kortext_dst.exists():
100
+ print(f"ℹ️ .kortext/ zaten mevcut, atlandı: {kortext_dst}")
101
+ else:
102
+ # Tüm framework klasörlerini kopyala
103
+ folders = ["agents", "hooks", "scripts", "workflows", "rules", "settings", "skills", "workspace"]
104
+ kortext_dst.mkdir()
105
+ for folder in folders:
106
+ src = ROOT / folder
107
+ dst = kortext_dst / folder
108
+ if src.exists():
109
+ shutil.copytree(str(src), str(dst))
110
+ print(f"✅ .kortext/ oluşturuldu: {kortext_dst}")
111
+
112
+ # AGENTS.md proje kökünde olmalı (AI runtime'lar buraya bakar)
113
+ agents_src = ROOT / "AGENTS.md"
114
+ agents_dst = project_dir / "AGENTS.md"
115
+ if agents_src.exists() and not agents_dst.exists():
116
+ shutil.copy2(str(agents_src), str(agents_dst))
117
+ print(f"✅ AGENTS.md kopyalandı: {agents_dst}")
118
+ elif agents_dst.exists():
119
+ print(f"ℹ️ AGENTS.md zaten mevcut, atlandı.")
120
+
121
+ return kortext_dst
122
+
123
+
77
124
  def cmd_init(args: argparse.Namespace) -> int:
78
- """`kortext init` — kortext-init.sh'i tetikler. Runtime bilgisi env ile geçer."""
79
- env: dict[str, str] = {}
125
+ """`kortext init` — proje dizinine .kortext/ scaffold eder,
126
+ git hook'larını ve runtime adapter'ı kurar.
127
+ """
128
+ project_dir = Path.cwd()
129
+
130
+ # 1. Her şeyi .kortext/ altına kopyala
131
+ kortext_dst = _scaffold_project(project_dir)
132
+
133
+ # 2. Git hook'ları ve runtime adapter: .kortext/ içindeki hook'lardan çalıştır
134
+ env: dict[str, str] = {
135
+ "KORTEXT_ROOT": str(project_dir), # proje kökü
136
+ "KORTEXT_DIR": str(kortext_dst), # .kortext/ dizini
137
+ "KORTEXT_WORKSPACE_DIR": str(kortext_dst / "workspace"),
138
+ }
80
139
  if args.runtime:
81
140
  env["KORTEXT_RUNTIME"] = args.runtime
82
- # kortext-init.sh git hook kurulumunu da yapar.
83
- return _run_shell_script(HOOKS / "kortext-init.sh", ["--install-hooks"], env)
141
+
142
+ init_sh = kortext_dst / "hooks" / "kortext-init.sh"
143
+ rc = _run_shell_script(init_sh, ["--install-hooks"], env)
144
+ if rc != 0:
145
+ return rc
146
+
147
+ _run_shell_script(init_sh, ["--install-runtime"], env)
148
+
149
+ # 4. .kortext/ ve AGENTS.md'yi git'e ekle (varsa git repo)
150
+ if (project_dir / ".git").exists():
151
+ subprocess.run(
152
+ ["git", "add", ".kortext/", "AGENTS.md"],
153
+ cwd=str(project_dir),
154
+ capture_output=True,
155
+ )
156
+ print("✅ .kortext/ git'e eklendi (git add)")
157
+
158
+ print("\n🎉 Kortext kurulumu tamamlandı.")
159
+ print(f"\n proje/")
160
+ print(f" ├── AGENTS.md")
161
+ print(f" └── .kortext/ ← tüm framework burada (git'te)")
162
+ print(f"\n💡 Sıradaki adım: .kortext/workspace/references/blueprint.md dosyasını doldur,")
163
+ print(f" ardından AI ajanına '!start analysis' yaz.\n")
164
+ return 0
84
165
 
85
166
 
86
167
  def cmd_start(args: argparse.Namespace) -> int:
@@ -9,10 +9,10 @@
9
9
 
10
10
  Kortext, birden fazla personanın (`/agents/`) kendi rolleri, yetenekleri ve görevleri doğrultusunda; belirlenmiş olan kural (`/rules/`) ve talimatlara (`/workflows/`) uygun olarak projeyi (`/workspace/`) hayata geçirme adımlarını tanımlar.
11
11
 
12
- > Nihai kurulumda aşağıdaki tüm dosya ve dizinler proje kökündeki `.kortext/` altında yer alır. Framework geliştirme çalışmaları sırasında gizli klasörle uğraşmamak için aynı yapı geçici olarak `kortext/` adıyla tutulabilir; yayın öncesi toplu dönüşümle `.kortext/` adına geçirilir. Başlangıç komut dosyası (`AGENTS.md`) proje kök dizininde yer alır:
12
+ > Tüm dosya ve dizinler proje kökündeki `.kortext/` altında yer alır. Başlangıç komut dosyası (`AGENTS.md`) proje kök dizininde yer alır:
13
13
 
14
14
  ```text
15
- kortext/
15
+ .kortext/
16
16
  ├── agents/ # Uzmanlaşmış persona tanımları, yetkiler ve iş akışları
17
17
  ├── hooks/ # Otomatik sistem denetimleri, Git kalkanları ve güvenlik tetikleyicileri
18
18
  ├── rules/ # Projeden bağımsız, tüm personaların uyması gereken katı kurallar
@@ -40,11 +40,11 @@ Kortext, bir AI ajanı (Claude, Gemini vb.) üzerinde çalışan **çok ajanlı
40
40
 
41
41
  ### 2.1 Kortext'i Projeye Ekle
42
42
 
43
- Kortext klasörünü projenin kökündeki `.kortext/` (veya geliştirme ortamında `kortext/`) dizinine yerleştir:
43
+ Kortext klasörünü projenin kökündeki `.kortext/` dizinine yerleştir:
44
44
 
45
45
  ```
46
46
  proje-koku/
47
- ├── kortext/ ← tüm Kortext dosyaları buraya
47
+ ├── .kortext/ ← tüm Kortext dosyaları buraya
48
48
  ├── AGENTS.md ← AI ajanına "buradan başla" talimatı (proje kökünde)
49
49
  ├── src/
50
50
  └── ...
@@ -53,7 +53,7 @@ proje-koku/
53
53
  ### 2.2 Git Hook'larını Kur
54
54
 
55
55
  ```bash
56
- bash kortext/hooks/kortext-init.sh --install-hooks
56
+ bash .kortext/hooks/kortext-init.sh --install-hooks
57
57
  ```
58
58
 
59
59
  Bu komut şu hook'ları kurar:
@@ -76,7 +76,7 @@ export KORTEXT_HOOK_MODE="strict" # ihlallerde uyarı yerine hata ver
76
76
 
77
77
  ### Adım 1 — Blueprint'i Doldur
78
78
 
79
- `kortext/workspace/references/blueprint.md` dosyasını aç ve doldur:
79
+ `.kortext/workspace/references/blueprint.md` dosyasını aç ve doldur:
80
80
 
81
81
  ```markdown
82
82
  # Proje Adı
package/settings/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.0
1
+ 2.2.3