mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-06-17 23:09:35 +00:00
Add Cursor skills and Dealix slash-command docs; hook guard scripts; ops checklists for staging gates A-D and PAID_BETA_READY verification; daily GTM and pilot/Proof Pack playbooks; cross-link command board, START_HERE, and execution pack. PR acceptance template includes local smoke and pytest results. Co-authored-by: Cursor <cursoragent@cursor.com>
55 lines
2.1 KiB
Markdown
55 lines
2.1 KiB
Markdown
# Claude Code — Hooks لـ Dealix (إعداد اختياري)
|
|
|
|
السكربتات تقرأ **JSON من stdin** (حدث `PreToolUse` من Claude Code). إذا لم يكن الشكل متوقعاً، تخرج `0` ولا تمنع (fail-open) لتجنب كسر الجلسة.
|
|
|
|
## السكربتات
|
|
|
|
- `dealix/scripts/guard_dealix_changes.py` — لأدوات تعديل ملفات (`Edit`, `Write`, `MultiEdit`, …)
|
|
- `dealix/scripts/guard_dealix_bash.py` — لأمر `Bash`
|
|
|
|
شغّلها من **جذر الريبو** (كما في الأمثلة أدناه). على Windows إذا لم يكن الأمر `python` في الـ PATH، استبدله بـ `py -3` في إعدادات الـ hooks وفي اختبار stdin أدناه.
|
|
|
|
## مثال `hooks` في `.claude/settings.json`
|
|
|
|
انسخ إلى إعدادات المشروع وادمج مع المفاتيح الموجودة (لا تحذف `projectInstructions` إلخ):
|
|
|
|
```json
|
|
{
|
|
"hooks": {
|
|
"PreToolUse": [
|
|
{
|
|
"matcher": "Edit|Write|MultiEdit",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "python dealix/scripts/guard_dealix_changes.py"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matcher": "Bash",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "python dealix/scripts/guard_dealix_bash.py"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
```
|
|
|
|
> تحقق من صيغة المخطط لدى نسخة Claude Code لديك؛ قد يختلف اسم المفتاح أو شكل الـ matcher.
|
|
|
|
## خروج الحظر
|
|
|
|
- عند منع العملية: سكربتاتنا تطبع سبباً على **stderr** وتخرج برمز **2** (أو غير صفر حسب ما يتوقعه عميل الـ hooks).
|
|
|
|
## اختبار يدوي
|
|
|
|
```bash
|
|
echo "{\"hook_event_name\":\"PreToolUse\",\"tool_name\":\"Edit\",\"tool_input\":{\"file_path\":\"dealix/api/main.py\"}}" | python dealix/scripts/guard_dealix_changes.py
|
|
echo "{\"hook_event_name\":\"PreToolUse\",\"tool_name\":\"Bash\",\"tool_input\":{\"command\":\"git push --force\"}}" | python dealix/scripts/guard_dealix_bash.py
|
|
```
|