Logo Delete Initial Resource

Delete Initial Resource

Tổ chứcPhổ biến
marmelab
delete-initial-resource

Xóa một hoặc nhiều tài nguyên CRM ban đầu (contacts, companies, deals, tags, tasks) khỏi codebase. Dùng khi người dùng yêu cầu xóa hoặc loại bỏ một hay nhiều tài nguyên có sẵn này. Chạy script delete-initial-resource.ts để xóa thư mục riêng của từng tài nguyên, sau đó hướng dẫn dọn sạch mọi tệp tham chiếu đến chúng.

Tổng quan

Nhà phát hànhmarmelab
Kho mãatomic-crm
Tên kỹ năngdelete-initial-resource
Sao
1.4K
Bản fork
860
Tệp đi kèm
6
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 6 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được marmelab công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Delete Initial Resource trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/marmelab/atomic-crm/tree/main/.claude/skills/delete-initial-resource
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/marmelab/atomic-crm.git /tmp/atomic-crm
mkdir -p .claude/skills
cp -r /tmp/atomic-crm/.claude/skills/delete-initial-resource .claude/skills/delete-initial-resource
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Delete Initial Resource trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Delete Initial Resource ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Delete Initial Resource với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

delete-initial-resource

Overview

Removes one or more of the five initial Atomic CRM resources (contacts, companies, deals, tags, tasks) and every reference to them. Irreversible confirm the target(s) with the user first; rely on git to recover. Exit criterion: make typecheck && make lint is clean and no live reference to the deleted resource(s) survives in src/ or supabase/.

When to Use

  • The user asks to delete, remove, or strip out one or several built-in CRM resources.
  • Not for custom entities added during setup only the five built-ins above.

For the backend migration mechanics, see Skill({skill: "backend-dev"}) and Skill({skill: "writing-migrations"}).

Steps

  1. Confirm the target(s), then read each one's file before editing:
  2. Run the script (below) — deletes each src/components/atomic-crm/<resource>/ folder and prints the dependent files to clean.
  3. Clean each dependent file using the "Shapes" patterns below + the per-resource file.
  4. Verify (below).

Deleting several at once: clean from the most-coupled resource outward; clean a shared file once for both; and reconcile interacting union guidance — deleting both contacts and deals removes the notes/activity-log reference entirely rather than each narrowing it, so don't half-apply each file's "narrow the union" note.

The script

bash
node .claude/skills/delete-initial-resource/delete-initial-resource.ts <resource> [<resource> ...]

Validates the names, deletes each resource's folder, and prints the merged, de-duplicated dependent-file list (files inside a just-deleted folder are dropped). It does not edit those files — that's your job. Each entry in the script's dependentFiles map has a // comment saying what to remove; read it alongside the printed list, and update the map if the codebase grows new references.

Shapes a resource takes

A resource is rarely just a folder. The later shapes are invisible to a \b<resource>\b grep:

  • Standalone — imports, JSX, routes, menu/nav, dashboard widgets, the <Resource> entry in root/CRM.tsx. Wrapper components outside the folder that only render the resource: delete outright, then clean importers.
  • Field/column on another record — fans out far wider: the types.ts type, providers/commons/mergeContacts.ts, CSV/JSON import, i18n, stories/tests, StoryWrapper builders, and the sample CSVs (header and every row). For a link column, decide per-link: orphaned shell (typed, defaulted) or drop — remove the UI either way.
  • Aggregated nb_<resource> (from the _summary views) lands on a record type, read across shows/lists/filters/generators. Invisible to a \b<resource>\b grep (the _ is a word char) — grep nb_<resource> and the denormalized company_name separately.
  • Shared subsystems — notes (reference: "contacts" | "deals") and the activity log ("company" | "contact" | "deal" | "all" union). Narrow the union, delete the per-type render components (ActivityLog*Created.tsx) + dead branches, prune the providers/commons/activity.ts fetcher + consts.ts/types.ts members. Surviving === "<other>" checks stay valid — only the deleted member's branches go.
  • Config props (taskTypes, dealStages, companySectors) live in root/defaultConfiguration.ts, ConfigurationContext.tsx, CRM.tsx (default + jsdoc + store seed), App.tsx, and SettingsPage.tsx (the <Card> and the section-list entry). Not always named after the resource — grep the settings <Card> for other keys (Deals owned currency) and flag borderline-general ones rather than dropping them silently.
  • Custom dataProvider methods live in both providers; CrmDataProvider derives from the supabase one, so removing them there drops them from the type. Also clean the lifecycle-callback blocks in both providers, the sales beforeDelete reassignment, the supabase <resource> -> <resource>_summary getList routing, and the FakeRest generators (which drive record creation).
  • JSON importer (misc/useImportFromJson.ts) treats contacts/companies/notes/tasks as top-level types (import<X> fn, $.<x>.* path, a TYPES arm + switch, guards, stats/failedImports/idsMaps keys). Mirror in ImportPage.tsx + import-sample.json; the CSV importer (useContactImport.tsx) has parallel mappings.
  • Check useCallback/useMemo deps — a stale getTags/getCompanies there is invisible until tsc.

Backend (the script only touches frontend)

See the backend-dev skill for the migration workflow. In supabase/schemas/:

  • Drop/adjust the table + view, generate a migration (npx supabase db diff --local -f remove_<resource>); update contacts_summary/companies_summary if they aggregated it.
  • activity_log is a UNION ALL with the same column set per branch — remove the resource's columns from every branch (keep them aligned), delete its dedicated branch(es), and drop the matching snake→camel rename in the supabase getList("activity_log").
  • 06_grants.sql grants the table and its <resource>_id_seq (drop both). 05_policies.sql has an RLS-enable line and create policy statements (drop both).
  • A resource used inside a SQL function (merge_contacts): drop those lines + the unused local var. Editing 02_functions.sql regenerates the whole function (expected) — renumber leftover step comments.
  • Orphan check: deleting triggers can orphan helpers — but verify shared callers first (get_domain_favicon survives a companies delete because contact avatars also call it).
  • Edge functions are separate and easy to miss: merge_contacts/, _shared/db.ts (Kysely types), postmark/ (inbound email), and mcp/ (an AI subsystem whose depth varies per resource). When a surviving function loses a capability, flag it to the user.

Rationalizations

RationalizationReality
"I deleted the folder, the resource is gone."A resource is also fields on other records, nb_<resource> aggregates, shared subsystems, config props, dataProvider methods, and SQL — the folder is the easy part.
"A \b<resource>\b grep came back clean, so it's clean."nb_<resource> and denormalized company_name are invisible to that grep (_ is a word char). Grep them separately.
"I'll remove the i18n key from English only."The French catalog is type-checked against English — a one-sided removal is a tsc error. Remove from both or neither.
"The script edits the dependent files for me."The script only deletes folders and prints the list. Editing every dependent file is your job.
"Typecheck passes, so the deletion is complete."tsc misses broken views/functions/grants. Reset the DB and grep for live references too.

Red Flags

  • Editing files inside supabase/migrations/ (never — they are append-only history).
  • A one-sided i18n key removal (English without French, or vice versa).
  • Relying on a single \b<resource>\b grep and skipping nb_<resource> / company_name.
  • Deleting a shared SQL helper or edge-function capability without checking surviving callers.
  • Deleting several resources but half-applying each file's "narrow the union" note.
  • Skipping the db reset check when Supabase is running.

Verification

bash
make typecheck && make lint

Resolve whatever tsc surfaces (the dependent-file list is a guide, not a guarantee). Then grep -rniE "\b<resource>\b" over src/+supabase/, plus separate greps for nb_<resource>, company_name, and config-prop names (<resource>Types, companySectors, currency). Watch for benign/substring false positives (each resource file lists its own); never edit supabase/migrations/.

  • make typecheck && make lint is clean.
  • \b<resource>\b, nb_<resource>, company_name, and config-prop greps return only benign matches.
  • i18n keys removed from both catalogs, or neither.
  • Backend: table/view/policies/grants/sequences and any function references handled in supabase/schemas/ (not migrations/).
  • If Supabase is running, npx supabase db reset --local replays cleanly.
  • Any lost edge-function capability flagged to the user.

i18n is all-or-nothing: frenchCrmMessages.ts is type-checked against the type derived from englishCrmMessages.ts, so remove a key from both catalogs or neither (a one-sided removal is a tsc error). Dead resources.<x>.* keys are harmless — flag rather than force. frenchCrmMessages.ts uses literal … escapes; if an exact-string Edit fails on a block spanning one, fall back to sed -i '<from>,<to>d'.

If Supabase is running, npx supabase db reset --local replays the chain + seed.sql and catches a broken view/function/grant db diff misses (benign index "…_pkey" does not exist NOTICEs expected). On Node 24 (see .nvmrc), make test (vitest) is also available.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Delete Initial Resource làm được gì?

Xóa một hoặc nhiều tài nguyên CRM ban đầu (contacts, companies, deals, tags, tasks) khỏi codebase. Dùng khi người dùng yêu cầu xóa hoặc loại bỏ một hay nhiều tài nguyên có sẵn này. Chạy script delete-initial-resource.ts để xóa thư mục riêng của từng tài nguyên, sau đó hướng dẫn dọn sạch mọi tệp tham chiếu đến chúng.

Vì sao nên dùng Delete Initial Resource trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Delete Initial Resource là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Delete Initial Resource trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/marmelab/atomic-crm/tree/main/.claude/skills/delete-initial-resource. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Delete Initial Resource?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Delete Initial Resource với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Delete Initial Resource với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Delete Initial Resource có miễn phí không?

Có. Kỹ năng này được marmelab phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇