Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/command-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Tüm sistem komutları, tetikleyicileri, gerekli araçları ve çalıştırma mo
| `/start` | İş gününün başlangıcı | Read, Write, Edit, Bash(date) | Doğrudan çalıştır | Hafızayı yükle, günlük not oluştur, görevleri gözden geçir |
| `/sync` | Gün ortası (3-4 saat sonra) | Read, Write, Edit, Bash(date), Agent | Doğrudan çalıştır | Hafızayı tazele, not defterini işle, görevleri gözden geçir |
| `/wrap-up` | İş gününün sonu | Read, Write, Edit, Bash(date), Agent | Doğrudan çalıştır | Günlük denetim, bilgiyi dışsallaştır, yarını hazırla |
| `/status` | Oturum sırasında hızlı kontrol gerektiğinde | Read, Bash(git) | Doğrudan çalıştır | Aktif alanı, workspace değişikliklerini ve kritik git sinyallerini kısa göster |
| `/standup` | Gün başlangıcı (hızlı mod) | Read, Edit, Glob, Bash(git,date) | Doğrudan çalıştır | Git + görevlerden dün/bugün/engeller otomatik oluştur |
| `/clear` | Bağlam baskısı veya görev tamamlanması | Read, Write, Edit, Bash(date) | Doğrudan çalıştır | Durumu damıt, bağlamı temizle, otomatik devam et |

Expand Down
215 changes: 215 additions & 0 deletions .claude/commands/status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
---
description: Hızlı git durumu özeti - aktif alan, çalışma alanı, kritik sinyaller, sonraki adım
argument-hint: ""
allowed-tools:
- Read
- Bash(git status:*, git branch:*, git rev-parse:*, git rev-list:*, git diff:*, git ls-files:*)
---

Kısa, read-only durum özeti üret. Yalnızca git tabanlı veri kullan. Hiçbir dosyaya yazma.

Bu komut git sinyallerinden deterministik bir snapshot üretir. Bu yüzden git repo içinde tam çalışır; git repo dışında çağrıldığında kurulum veya diğer komutlar bozulmaz, yalnızca sınırlı fallback çıktısı döner.

## Adımlar

### Adım 1: Git repo kontrolü

Önce şunu çalıştır:

```bash
git rev-parse --is-inside-work-tree
```

Başarısız olursa şu fallback bloğunu yazdır ve dur:

```text
Durum: git repo değil
Focus: unavailable
Workspace: unavailable
Git: unavailable
Risk: none
Sonraki: bu komutu bir git reposu içinde çalıştır
```

Bu fallback bir hata yönetimi davranışıdır, kullanım engeli değildir:

- `/status` için git verisi yoktur
- `kalfa init` ve diğer komutlar yine kullanılabilir
- kullanıcıya yalnızca bu komutun neden sınırlı çıktıya düştüğünü açıkça göster

### Adım 2: Git durumunu topla (paralel)

Şunları topla:

**Branch adı:**

```bash
git branch --show-current
```

Boşsa `detached HEAD` kullan.

**Ana durum çıktısı:**

```bash
git status --short --branch
```

**Merge conflict sinyali:**

```bash
git diff --name-only --diff-filter=U
```

**Untracked dosyalar:**

```bash
git ls-files --others --exclude-standard
```

**Tracking branch kontrolü:**

```bash
git rev-parse --abbrev-ref --symbolic-full-name @{upstream}
```

Başarılıysa ahead/behind sayısını al:

```bash
git rev-list --left-right --count HEAD...@{upstream}
```

Başarısızsa tracking yok kabul et.

### Adım 3: Alanları türet

#### Durum

- Branch adı varsa kullan
- Yoksa `detached HEAD`

#### Focus

Sadece `Workspace` için hesaplanan benzersiz path listesinden türet. Anlamsal etiket üretme; yalnızca path prefix kullan.

Kurallar:

1. Path listesi boşsa `clean workspace`
2. Tek path varsa:
- parent directory varsa onu kullan
- yoksa dosya yolunun kendisini kullan
3. Hem `.claude/commands/*` path'leri hem de `.claude/command-index.md` varsa focus olarak `.claude/commands` kullan
4. Bir directory prefix benzersiz path'lerin yarısından fazlasını kapsıyorsa en derin geçerli prefix'i kullan
5. Ortak baskın prefix yoksa `mixed changes`

#### Workspace

- Hiç değişiklik yoksa tam olarak `Workspace: clean`
- Değişiklik varsa benzersiz path sayısını hesapla ve en fazla 2-3 örnek path göster:

```text
Workspace: <N changed> (<örnek path 1>, <örnek path 2>, <örnek path 3>)
```

Staged, unstaged, untracked ve unmerged path'leri tek listede düşün; aynı path'i iki kez sayma.

Deterministik kurallar:

- Örnek path'leri leksikografik sırayla seç
- En fazla ilk 3 örneği göster
- Hiçbir durumda ikinci bir `Workspace` satırı ekleme

#### Git

Tek satırda özetle:

- Çalışma alanı temizse `clean`, aksi halde `dirty`
- Tracking varsa:
- tam biçim `clean/dirty • ahead X / behind Y`
- Tracking yoksa:
- tam biçim `clean/dirty • tracking unavailable`

Örnekler:

```text
Git: clean • ahead 0 / behind 0
Git: dirty • ahead 1 / behind 0
Git: dirty • tracking unavailable
```

#### Risk

Tek satır yaz. En fazla 2-3 kritik sinyal göster. Hiçbiri yoksa tam olarak `Risk: none` yaz.

Sadece şu sinyaller geçerli:

- `merge conflict`
- `branch diverged`
- `dirty workspace`
- `<N> untracked files`

Kurallar:

- Merge conflict varsa en yüksek öncelik
- `branch diverged` yalnızca hem ahead hem behind > 0 ise
- Dirty workspace sinyali yalnızca tracked veya staged değişiklik varsa
- Untracked dosyalar ayrı sinyal olabilir
- En fazla ilk 3 sinyali göster, fazlasını ekleme

Örnek:

```text
Risk: merge conflict; dirty workspace
Risk: branch diverged; 3 untracked files
Risk: none
```

#### Sonraki

Tek ve net aksiyon ver:

Mapping sırası sabit olsun:

1. Unmerged path varsa: `çatışmaları çöz ve tekrar durum kontrol et`
2. Tracking var ve ahead > 0 ve behind > 0 ise: `branch'i sync et ve sonra değişikliklere dön`
3. Tracking var ve behind > 0 ise: `upstream değişikliklerini al ve tekrar kontrol et`
4. Tracked veya staged değişiklik varsa: `değişiklikleri gözden geçir ve commit'e hazırla`
5. Yalnızca untracked dosyalar varsa: `untracked dosyaları ekle ya da yok say`
6. Tracking yoksa: `branch tracking ayarla veya local değişiklikle devam et`
7. Workspace temiz ve tracking var ve ahead > 0 ise: `yerel commit'leri push et`
8. Workspace temiz ve tracking var ve ahead 0 / behind 0 ise: `yeni iş için branch aç veya bir sonraki göreve başla`

### Adım 4: Çıktıyı yazdır

Çıktı kısa, sabit ve deterministik olmalı. Hedef 6-8 satır; hiçbir durumda 15 satırı geçme.

Sert kural:

- Normal durumda yalnızca bu 6 satırı yaz
- Fallback durumda da yalnızca bu 6 satırı yaz
- Ek açıklama, ikinci blok, dipnot veya uzun liste ekleme
Comment on lines +184 to +190
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Output length rule is internally inconsistent.

Line 184 permits 6–8 lines, while Lines 188–190 require exactly 6 lines in all modes. This should be unified to avoid divergent implementations.

Suggested patch
-Çıktı kısa, sabit ve deterministik olmalı. Hedef 6-8 satır; hiçbir durumda 15 satırı geçme.
+Çıktı kısa, sabit ve deterministik olmalı. Her durumda tam 6 satır üret.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Çıktı kısa, sabit ve deterministik olmalı. Hedef 6-8 satır; hiçbir durumda 15 satırı geçme.
Sert kural:
- Normal durumda yalnızca bu 6 satırı yaz
- Fallback durumda da yalnızca bu 6 satırı yaz
- Ek açıklama, ikinci blok, dipnot veya uzun liste ekleme
Çıktı kısa, sabit ve deterministik olmalı. Her durumda tam 6 satır üret.
Sert kural:
- Normal durumda yalnızca bu 6 satırı yaz
- Fallback durumda da yalnızca bu 6 satırı yaz
- Ek açıklama, ikinci blok, dipnot veya uzun liste ekleme
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/commands/status.md around lines 184 - 190, Unify the output-length
rule in .claude/commands/status.md by deciding whether the target is a fixed 6
lines or a range of 6–8 lines and making both the short-description sentence
("Çıktı kısa, sabit ve deterministik olmalı. Hedef 6-8 satır; hiçbir durumda 15
satırı geçme.") and the strict rule block ("Sert kural: - Normal durumda
yalnızca bu 6 satırı yaz - Fallback durumda da yalnızca bu 6 satırı yaz")
consistent: either change the short-description to target 6 lines and update the
range mention to "Hedef 6 satır" and adjust the strict bullets to match "6
satır", or change the strict bullets to allow 6–8 lines in both normal and
fallback modes; ensure the same numeric constraint appears verbatim in both
places so implementations cannot diverge.

- Satır sınırına yaklaşılırsa örnek path ve risk sinyallerini kısalt; yeni satır ekleme

Tam biçim:

```text
Durum: ...
Focus: ...
Workspace: ...
Git: ...
Risk: ...
Sonraki: ...
```

Clean workspace örneği:

```text
Durum: main
Focus: clean workspace
Workspace: clean
Git: clean • ahead 0 / behind 0
Risk: none
Sonraki: yeni iş için branch aç veya bir sonraki göreve başla
```

Uzun açıklama, ek paragraf veya ikinci rapor bloğu üretme.
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Herhangi bir işlem yapmadan önce daima `.claude/memory.md` dosyasını oku.
## Hızlı Başlangıç

* `/start` ile güne başla
* `/status` ile anlık git tabanlı durum özeti al (git repo dışında sınırlı fallback döner)
* `/sync` ile gün ortasında hafızayı tazele
* `/wrap-up` ile günü kapat
* `/audit` ile son yapılan işin kalitesini doğrula
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Proje durumu: aktif olarak geliştiriliyor
|---------|------|----------|
| **Skill'ler** | 994 | 16 kategoride yapılandırılmış operasyonel prosedürler |
| **Agent'lar** | 10 | Kalıcı hafızaya sahip uzman alt-agent'lar |
| **Komutlar** | 22 | İş akışı ritüelleri ve araçlar |
| **Komutlar** | 23 | İş akışı ritüelleri ve araçlar |
| **Hook'lar** | 9 | Deterministik güvenlik kontrolleri |
| **Hafıza** | 6 katman | Oturumlar arası bağlam koruma |

Expand Down Expand Up @@ -108,12 +108,16 @@ kalfa --help

### Gün içinde bağlamı sağlıklı tut

1. Oturum ortasında `/sync` çalıştırın.
2. Bağlam ağırlaştığında `/clear` kullanın.
1. Hızlı durum kontrolü gerektiğinde `/status` çalıştırın.
1. `/status` yalnızca git verisini okur; `memory.md`, görev panosu veya günlük not kullanmaz.
2. Bu yüzden en anlamlı çıktıyı bir git repo içinde verir.
3. Git repo dışında da çalıştırılabilir; bu durumda kısa fallback çıktısı verip komutu git repo içinde kullanmanızı söyler.
2. Oturum ortasında `/sync` çalıştırın.
3. Bağlam ağırlaştığında `/clear` kullanın.
1. Oturum özeti günlük nota yazılır.
2. Hafıza dosyası güncellenir.
3. Çalışma kaldığı yerden devam eder.
3. Gün sonunda `/wrap-up` ile kapanış yapın.
4. Gün sonunda `/wrap-up` ile kapanış yapın.

### Kalite kontrollerini işlet

Expand Down Expand Up @@ -196,7 +200,7 @@ Yerelde çalıştırma:

1. Bu repo bir uygulama build çıktısı üretmez; operasyon dosyası sağlar.
1. Hedef projenizde `claude` başlatın.
2. `/start`, `/sync`, `/wrap-up` akışlarını çalıştırın.
2. `/start`, `/status`, `/sync`, `/wrap-up` akışlarını çalıştırın.

Testleri çalıştırma:

Expand Down
9 changes: 5 additions & 4 deletions bin/kalfa.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ const path = require("node:path");
const figlet = require("figlet");

const TEMPLATE_ITEMS = [
".claude",
"CLAUDE.md",
{ source: ".claude", destination: ".claude" },
{ source: "CLAUDE.md", destination: "CLAUDE.md" },
{ source: "templates/gitignore", destination: ".gitignore" },
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid overwriting project .gitignore on forced init

Adding templates/gitignore to TEMPLATE_ITEMS means kalfa init --force now replaces an existing project .gitignore with the small Kalfa template, deleting all pre-existing ignore rules for that repository. This is a destructive regression introduced by this change, because users often run --force to refresh Kalfa files and will unintentionally lose their repo-specific patterns (e.g., build artifacts, env files), immediately polluting git status and risking accidental commits of sensitive files.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

init won’t add Kalfa ignore rules when .gitignore already exists.

Because existing files are skipped by default, the new .gitignore template is not applied in the common case of initialized repos. This leaves runtime artifacts unignored unless users force-overwrite their whole .gitignore.

Suggested approach: merge missing template lines instead of full-file copy for `.gitignore`
+function mergeGitignoreTemplate(sourcePath, destinationPath, options, results) {
+	const templateLines = fs
+		.readFileSync(sourcePath, "utf8")
+		.split(/\r?\n/)
+		.filter((line) => line.trim().length > 0);
+
+	const existingLines = fs.existsSync(destinationPath)
+		? fs.readFileSync(destinationPath, "utf8").split(/\r?\n/)
+		: [];
+
+	const missingLines = templateLines.filter((line) => !existingLines.includes(line));
+	if (missingLines.length === 0) return;
+
+	results.copied.push(destinationPath);
+	if (options.dryRun) return;
+
+	ensureDir(path.dirname(destinationPath), false);
+	const needsNewline = existingLines.length > 0 && existingLines[existingLines.length - 1] !== "";
+	const prefix = needsNewline ? "\n" : "";
+	fs.appendFileSync(destinationPath, `${prefix}${missingLines.join("\n")}\n`, "utf8");
+}
+
 for (const item of TEMPLATE_ITEMS) {
 	const sourcePath = path.join(packageRoot, item.source);
 	const destinationPath = path.join(targetRoot, item.destination);
+	if (item.destination === ".gitignore") {
+		mergeGitignoreTemplate(sourcePath, destinationPath, options, results);
+		continue;
+	}
 	copyRecursive(sourcePath, destinationPath, options, results);
 }

Also applies to: 129-130

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bin/kalfa.js` at line 10, For the .gitignore template entry (the mapping with
source "templates/gitignore" and destination ".gitignore") change the copy logic
so that if a destination ".gitignore" already exists you read both the existing
.gitignore and the template, compute which non-empty unique lines from the
template are missing, append only those missing lines (with a single newline
separator) to the existing file, and write the merged result back; keep the
original full-file copy behavior for other destinations. Apply the same merge
behavior to the similar handling referenced around lines 129-130 so existing
.gitignore files get augmented instead of skipped or overwritten.

];

function printBanner() {
Expand Down Expand Up @@ -125,8 +126,8 @@ function runInit(options) {
}

for (const item of TEMPLATE_ITEMS) {
const sourcePath = path.join(packageRoot, item);
const destinationPath = path.join(targetRoot, item);
const sourcePath = path.join(packageRoot, item.source);
const destinationPath = path.join(targetRoot, item.destination);
copyRecursive(sourcePath, destinationPath, options, results);
}

Expand Down
Binary file added komunite-kalfa-1.0.0.tgz
Binary file not shown.
6 changes: 6 additions & 0 deletions templates/gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Kalfa runtime artifacts
.claude/logs/
.claude/agent-memory/
.claude/backups/
.claude/hooks/__counter
__NEEDS_ONBOARD
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Scope __NEEDS_ONBOARD to the .claude tree.

__NEEDS_ONBOARD is currently a broad ignore token and may hide unrelated files with the same name outside .claude/.

Suggested patch
-__NEEDS_ONBOARD
+.claude/__NEEDS_ONBOARD
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
__NEEDS_ONBOARD
.claude/__NEEDS_ONBOARD
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@templates/gitignore` at line 6, Replace the broad ignore token
__NEEDS_ONBOARD with a path-scoped pattern so it only ignores files under the
.claude tree; update the entry in templates/gitignore to
/.claude/__NEEDS_ONBOARD (or /.claude/__NEEDS_ONBOARD* if variants/extensions
exist) so the ignore applies only to the .claude/ directory and does not hide
similarly named files elsewhere.

5 changes: 5 additions & 0 deletions tests/cli.integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ test("init copies starter files to target directory", async () => {
const expected = [
".claude",
"CLAUDE.md",
".gitignore",
".claude/workspace/Scratchpad.md",
".claude/workspace/TaskBoard.md",
".claude/workspace/DailyNotes",
Expand All @@ -78,4 +79,8 @@ test("init copies starter files to target directory", async () => {
const absolute = path.join(targetDir, item);
assert.equal(fs.existsSync(absolute), true, `missing ${absolute}`);
}

const gitignore = fs.readFileSync(path.join(targetDir, ".gitignore"), "utf8");
assert.match(gitignore, /^\.claude\/logs\/$/m);
assert.match(gitignore, /^\.claude\/agent-memory\/$/m);
});
Loading