{
  "markdown": "# Fraud Blocker Skills\n\nCoding skills + workflow automation for all Fraud Blocker workspace repos. Covers architecture patterns, naming\nconventions, and strict rules for 3 repos (`cms`, `api`, `tracker`), plus hooks, slash commands, and a bug-hunter\nskill built on top of them.\n\n---\n\n## Installation\n\n### Claude Code\n\n**Bước 1 — Add marketplace (1 lần duy nhất):**\n```sh\nclaude plugin marketplace add thanhhai0311/fraud-md\n```\n\n**Bước 2 — Install plugin:**\n```sh\nclaude plugin install fraud-skills\n```\n\n**Bước 3 — Enable trong project** (`.claude/settings.json`):\n```json\n{\n  \"enabledPlugins\": {\n    \"fraud-skills@fraud-skills-marketplace\": true\n  }\n}\n```\n\nSau khi install, các thành phần xuất hiện dưới namespace `fraud-skills:`:\n- Skills: `fraud-skills:cms`, `fraud-skills:api`, `fraud-skills:tracker`, `fraud-skills:critical-bug-hunter`\n- Commands: `/fraud-skills:self-heal-tests`, `/fraud-skills:review-skill-gaps`\n- Agent: `test-writer`\n- Hooks: `inject-skill-by-path`, `review-enforcer`, `detect-workflow-mode` (đăng ký sẵn qua plugin manifest)\n\n**Update plugin khi có skill mới:**\n```sh\nclaude plugin update fraud-skills\n```\n\n**Local dev (không cần marketplace):**\n```sh\nclaude plugin install /path/to/fraud-md\n```\n\n---\n\n### Codex (OpenAI)\n\n**Option 1 — Copy to project `.codex/skills/`:**\n```sh\ncp -r skills/* .codex/skills/\n```\n\n**Option 2 — Symlink:**\n```sh\nmkdir -p .codex/skills\nfor skill in skills/*/; do\n  ln -sf \"$(pwd)/$skill\" \".codex/skills/$(basename $skill)\"\ndone\n```\n\n**Option 3 — Use `.codex-plugin/`** (if Codex supports plugin install):\n```sh\ncodex plugin install /path/to/fraud-md\n```\n\n---\n\n### Gemini CLI\n\n```sh\n# Copy gemini-extension.json and GEMINI.md to project root\ncp gemini-extension.json ./\ncp GEMINI.md ./\n```\n\nOr if Gemini CLI supports plugin install, point it at this directory.\n\n---\n\n### Cursor / Other AI editors\n\nCopy the relevant `skills/<repo>/SKILL.md` content into the editor's custom instructions or rules file for that\nproject.\n\n---\n\n## Skills Index\n\n| Skill | Repo | Stack | Use when |\n|---|---|---|---|\n| `cms` | `cms/` | Remix 2 / React 18 / Polaris / Redux Saga / React Query | Admin UI: routes, pages, components, Redux, service layer, Shopify extensions |\n| `api` | `api/` | NestJS 11 / Mongoose / RabbitMQ / Redis | Backend: modules, controllers, services, repositories, consumers, outbox |\n| `tracker` | `tracker/` | NestJS 11 / Mongoose / RabbitMQ / Redis | Tracking: storefront intake, rule/bot/IP evaluation, outbox events, contracts |\n| `critical-bug-hunter` | all 3 | — | Deep-scan recent commits/PRs for high-severity correctness bugs |\n\n---\n\n## Plugin Structure\n\n```\nfraud-md/\n├── .claude-plugin/\n│   ├── plugin.json          # Claude Code manifest\n│   └── marketplace.json     # Claude marketplace listing\n├── .codex-plugin/\n│   └── plugin.json          # Codex manifest\n├── gemini-extension.json    # Gemini CLI extension\n├── CLAUDE.md                # Claude Code context (workflow, routing, MCP-by-phase)\n├── GEMINI.md                # Gemini CLI context\n├── README.md                # This file\n├── skills/\n│   ├── cms/SKILL.md\n│   ├── api/SKILL.md\n│   ├── tracker/SKILL.md\n│   └── critical-bug-hunter/SKILL.md\n├── commands/                # Slash commands (/self-heal-tests, /review-skill-gaps)\n├── agents/                  # Custom subagents (test-writer)\n├── hooks/                   # PreToolUse / SessionStart automation\n│   ├── inject-skill-by-path.sh\n│   ├── review-enforcer.sh\n│   └── detect-workflow-mode.sh\n├── rules/                   # Cross-skill facts not tied to one SKILL.md\n│   └── db-scale-and-security.md\n├── scripts/                 # Helper scripts used by hooks/skills\n│   ├── search-known-error.sh\n│   ├── search-skill-gaps.sh\n│   └── check-rabbitmq-contract.mjs\n├── agent-memory/            # Persistent memory for self-heal-tests / skill-gap tracking\n│   ├── skill-gaps/\n│   └── test-writer/\n└── workflows/                # Reserved for multi-agent Workflow scripts\n```\n\n---\n\n## Quick Reference\n\n### Frameworks\n| Repo | Framework | Module system |\n|---|---|---|\n| `cms` | Remix 2 + React 18 | ESM / TypeScript |\n| `api` | NestJS 11 | ESM / TypeScript |\n| `tracker` | NestJS 11 | ESM / TypeScript |\n\n### Service roles\n| Repo | Role |\n|---|---|\n| `cms` | Merchant-facing UI. No fraud decisions. No RabbitMQ. |\n| `tracker` | Write-side. Owns storefront tracking, rule/IP/bot evaluation, sync publish. |\n| `api` | Compatibility layer. Consumes RabbitMQ events from tracker, serves legacy reads. |\n\n### RabbitMQ rules (api + tracker)\n- Exchange always `'direct'`\n- Never change routing key/queue on one side without updating the other\n- Consumer on failure: `Nack(false)` — **never requeue**\n- Always idempotency-check before handling (see `rules/db-scale-and-security.md`)\n\n### Logger (api + tracker)\n```typescript\nprivate readonly logger = new Logger(ClassName.name);\nthis.logger.error('message', error);\nthis.logger.log('message');\n```\n\n### tracker storefront fast path\n- `void asyncFn()` for slow work (proxy check, outbox write, GeoIP)\n- Return `{ action }` immediately — never await enrichment on request path\n- Rule evaluation order: WHITELIST → BLACKLIST → REDIRECT (first-match-wins)\n\n---\n\n## Recommended additional plugins\n\nPlugin này chỉ cung cấp skills/hooks/rules riêng cho Fraud Blocker. Để làm việc thuận tiện hơn, nên cài thêm:\n\n| Plugin | Marketplace | Vì sao cần | Cài đặt |\n|---|---|---|---|\n| `security-guidance` | `claude-plugins-official` | Bổ sung `security-review` skill + `claude-security` agent để scan diff/PR trước khi merge (workflow yêu cầu ở Phase 3 khi đụng `api/`/`tracker`) | `claude plugin marketplace add claude-plugins-official && claude plugin install security-guidance` |\n| `shopify-plugin` | `shopify-ai-toolkit` | Cả 3 repo đều tích hợp Shopify (AppBridge, webhooks, Functions/extensions ở `cms`) — bổ sung skill cho Admin/Storefront GraphQL, Functions, CLI | `claude plugin marketplace add shopify/ai-toolkit && claude plugin install shopify-plugin` |\n\n> Kiểm tra tên marketplace/plugin chính xác bằng `claude plugin marketplace list` sau khi add — tên package của\n> bên thứ ba có thể đổi theo phiên bản.\n\n---\n\n## Recommended MCP servers\n\nCác MCP server dưới đây không đi kèm plugin (vì cần chạy process/credentials riêng cho từng máy), nhưng\n`CLAUDE.md` và các skill trong plugin này giả định chúng đã sẵn sàng (\"MCP Tools by Phase\"). Thiếu MCP nào thì\nbước tương ứng trong workflow (Discovery/Implementation/Verification) sẽ phải làm tay.\n\n### Code intelligence — bắt buộc để dùng đúng workflow Discovery\n- **CodeGraph** (`codegraph_*` tools) — tree-sitter knowledge graph cho toàn bộ symbol/edge/file trong repo,\n  dùng thay grep khi cần trace caller/callee/impact. Plugin này được viết với giả định CodeGraph đã init\n  (`codegraph init -i`) cho mỗi repo (`api`, `cms`, `tracker`) và mount riêng từng MCP server instance\n  (`codegraph-api`, `codegraph-cms`, `codegraph-tracker`). Nếu team chưa có setup này, hỏi người quản lý hạ tầng\n  nội bộ trước khi thêm — đây thường là self-hosted server, không phải package public trên npm/PyPI.\n\n### Database & cache — cần cho Implementation/Verification khi đụng schema/query\n- **MongoDB MCP** — đọc schema/index thật, chạy `find`/`aggregate`/`count` để verify query mới thay vì đoán từ\n  code. Dùng connection string từ `api/.env` (`MONGODB_URI`) / `tracker/.env`, **không hardcode** khi add server.\n  ```sh\n  claude mcp add mongodb -- npx -y mongodb-mcp-server --connectionString \"$MONGODB_URI\"\n  ```\n- **Redis MCP** — kiểm tra key pattern/TTL thật trước khi thêm cache key mới (theo `rules/db-scale-and-security.md`).\n  Chưa có server chính thức thống nhất; nếu team dùng community package, gắn theo tài liệu của package đó và\n  trỏ về Redis instance dev, không phải prod.\n\n### Issue/ticket tracking — cho Discovery khi cần spec/ticket thật\n- **Atlassian (Jira/Confluence) MCP** — pull ticket/spec thật thay vì suy diễn từ tên branch. Atlassian có Remote\n  MCP Server chính thức (OAuth, không cần self-host) — xem tài liệu Atlassian Developer để lấy URL + auth flow,\n  hoặc dùng community server (`mcp-atlassian`) nếu team tự host.\n- **GitLab MCP** — check branch/MR/CI status thật trong Phase 3 (Verification) và Discovery.\n  ```sh\n  claude mcp add gitlab -- npx -y @modelcontextprotocol/server-gitlab\n  ```\n  (cần set `GITLAB_PERSONAL_ACCESS_TOKEN` qua env, không truyền trực tiếp trong command)\n\n### Browser automation — cho Verification (E2E thật, không chỉ unit test)\n- **Playwright MCP** — primary E2E runner theo `CLAUDE.md`.\n  ```sh\n  claude mcp add playwright -- npx -y @playwright/mcp@latest\n  ```\n- **Puppeteer MCP** — supplementary, dùng khi cần điều khiển browser mức thấp hơn Playwright.\n  ```sh\n  claude mcp add puppeteer -- npx -y @modelcontextprotocol/server-puppeteer\n  ```\n\n### Filesystem / memory / search — tiện ích chung, ít rủi ro nhất để bắt đầu\n- **Filesystem MCP** — duyệt/đọc file ngoài project root khi cần so sánh với repo khác trong workspace.\n  ```sh\n  claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/workspace\n  ```\n- **Memory MCP** — lưu context giữa các session dài (đã có agent-memory riêng cho skill-gaps/test-writer trong\n  plugin này, nhưng Memory MCP hữu ích cho context ngoài phạm vi 2 nhóm đó).\n  ```sh\n  claude mcp add memory -- npx -y @modelcontextprotocol/server-memory\n  ```\n- **DuckDuckGo MCP** — search nhanh không cần API key, dùng khi WebSearch built-in không đủ (ví dụ tra proxy/IP\n  reputation trong bot-detection).\n\n> Tất cả lệnh `claude mcp add` trên chạy ở scope local theo mặc định. Muốn chia sẻ config MCP cho cả team, thêm\n> `--scope project` và commit `.mcp.json` — nhưng **không commit credentials/connection string thật** vào đó;\n> dùng biến môi trường (`${MONGODB_URI}` kiểu placeholder) và để mỗi máy set `.env` riêng.\n\n---\n\n## Updating Skills\n\nWhen repo patterns change, update the corresponding `skills/<name>/SKILL.md`, then bump `version` in\n`.claude-plugin/plugin.json` and `.claude-plugin/marketplace.json` before publishing:\n\n```sh\nvim skills/cms/SKILL.md\nclaude plugin update fraud-skills   # if testing from an installed copy\n```\n\nGap chưa merge vào skill → log vào `agent-memory/skill-gaps/entries/` theo `TEMPLATE.md`, merge qua\n`/review-skill-gaps` khi đã xác nhận (không tự sửa `SKILL.md`/`rules/*.md` ngay trong task, xem `CLAUDE.md`).\n",
  "bytes": 10323,
  "sha": "61611d49efa95de533693b2e23542056139c456757a1ca9871c82cabf698b1d5",
  "repo_slug": "thanhhai0311/fraud-md",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_thanhhai0311_fraud_md_88d65ea7/readme"
}