Logo Script Sync

Script Sync

Tổ chức
Happy-Technologies-LLC
script-sync

Explicit pull, local edit, freshness check, and push workflow for ServiceNow scripts with Happy Platform MCP 6.1

Tổng quan

Nhà phát hànhHappy-Technologies-LLC
Kho mãhappy-platform-skills
Tên kỹ năngscript-sync
Sao
41
Bản fork
14
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépApache-2.0
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 là Markdown thuần túy, không phải 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ộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được Happy-Technologies-LLC công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Script Sync 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 thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/Happy-Technologies-LLC/happy-platform-skills/tree/main/skills/admin/script-sync
  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/Happy-Technologies-LLC/happy-platform-skills.git /tmp/happy-platform-skills
mkdir -p .claude/skills
cp -r /tmp/happy-platform-skills/skills/admin/script-sync .claude/skills/script-sync
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 Script Sync 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ự tải Script Sync 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 Script Sync không bị giới hạn ở mô hình mà kỹ năng này được viết cho. 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 kỹ năng chưa dùng không tốn chi phí.

  • Đổ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.

Script Pull, Edit, and Push Workflow

Overview

Happy Platform MCP 6.1 has no automatic script synchronization or watch tool. Use this explicit workflow to pull the current record, edit a local copy, check that the remote record has not changed, and push the intended script field with SN-Update-Record.

This workflow favors reviewable changes and conflict detection over background automation. It works for Business Rules, Script Includes, Client Scripts, UI Scripts, UI Actions, Scheduled Jobs, and other records whose script is stored in a table field.

Prerequisites

  • Read and write access to the target script table
  • The target ServiceNow instance name
  • A local directory outside the installed npm package
  • Git or another local version-control system
  • The table name, record sys_id, and script field name
  • The correct application scope and update set selected before any push

Procedure

1. Discover the record

Use a bounded query with explicit fields. Always route the request to the intended instance.

text
Tool: SN-Query-Table
Parameters:
  table_name: sys_script_include
  query: name=IncidentUtils
  fields: sys_id,name,script,sys_updated_on,sys_mod_count,sys_scope
  limit: 5
  instance: dev

Stop if the query is ambiguous. Select one sys_id; do not update multiple same-named scripts by assumption.

2. Pull the authoritative record

text
Tool: SN-Get-Record
Parameters:
  table_name: sys_script_include
  sys_id: <script_sys_id>
  fields: sys_id,name,script,sys_updated_on,sys_mod_count,sys_scope
  instance: dev

Write only the returned script value to a local .js file. In adjacent local metadata, record the table, sys_id, instance, sys_updated_on, and sys_mod_count from this pull. Do not put ServiceNow credentials in the file or repository.

Example layout:

text
scripts/servicenow/script_includes/IncidentUtils.js
scripts/servicenow/script_includes/IncidentUtils.metadata.json

3. Edit and review locally

Edit the JavaScript in the IDE, run applicable static checks or tests, and inspect the Git diff. Keep the change scoped to the script field you intend to deploy.

4. Check remote freshness before pushing

Immediately before updating, retrieve the record again:

text
Tool: SN-Get-Record
Parameters:
  table_name: sys_script_include
  sys_id: <script_sys_id>
  fields: sys_id,script,sys_updated_on,sys_mod_count
  instance: dev

Compare both sys_updated_on and sys_mod_count with the saved pull metadata. Also compare the returned script with the original local base. If any value has changed, stop: pull the new version, review the remote changes, and merge them locally. Never overwrite a fresher remote edit automatically.

5. Push the reviewed script field

After the freshness check passes, update only the intended field:

text
Tool: SN-Update-Record
Parameters:
  table_name: sys_script_include
  sys_id: <script_sys_id>
  data:
    script: <reviewed_local_script>
  instance: dev

Do not use a background script for this normal record update. The generic MCP update is the primary operation and preserves per-call instance routing.

6. Verify the push

Read the record again with SN-Get-Record. Confirm that the remote script matches the reviewed local content and record the new sys_updated_on and sys_mod_count. Then verify the associated sys_update_xml capture in the current update set with a bounded SN-Query-Table query.

7. Repeat explicitly for later edits

There is no watch mode in Happy Platform MCP 6.1. For each change, repeat the freshness check, update, and verification. A local file watcher may run linting or tests, but it must not push ServiceNow changes without the explicit conflict check and update sequence above.

Supported Record Patterns

Script typeTableCommon script field
Business Rulesys_scriptscript
Script Includesys_script_includescript
Client Scriptsys_script_clientscript
UI Scriptsys_ui_scriptscript
UI Actionsys_ui_actionscript
Scheduled Jobsysauto_scriptscript
Fix Scriptsys_script_fixscript

Confirm unfamiliar table and field names with SN-Get-Table-Schema before adapting this workflow.

Best Practices

  • Set the application scope and update set before pushing configuration.
  • Use explicit instance on every live record call, especially in concurrent work or critical environments.
  • Pull immediately before editing and check freshness immediately before push.
  • Limit field selection to the script and concurrency metadata you need.
  • Keep the original pulled version until verification succeeds.
  • Commit local changes only after reviewing the diff and remote verification.
  • Never store instance credentials or access tokens with local script files.

Troubleshooting

The remote record changed after the pull

Do not push. Save the local edits, retrieve the new remote script, and perform a three-way merge using the original pull as the base. Re-run the freshness check after resolving the merge.

The update succeeded but no update-set record appears

Confirm the correct application scope and current update set, then inspect sys_update_xml. Do not retry blindly: first determine whether the table or field is update-set captured.

The local and remote scripts differ after update

Retrieve the record again and compare exact content. Check whether a business rule, formatter, or scoped-app policy transformed the value. Treat the remote record as authoritative until the discrepancy is understood.

Continuous synchronization is required

Happy Platform MCP 6.1 does not provide automatic pull, push, or watch tools. Keep the explicit workflow, or build a separately reviewed deployment pipeline with equivalent freshness and verification gates.

Related Skills

  • admin/update-set-management
  • development/business-rules
  • development/script-includes

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

Kỹ năng AI Script Sync làm được gì?

Explicit pull, local edit, freshness check, and push workflow for ServiceNow scripts with Happy Platform MCP 6.1

Vì sao nên dùng Script Sync 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. Script Sync 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 Script Sync trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Happy-Technologies-LLC/happy-platform-skills/tree/main/skills/admin/script-sync. TypingMind đọc tệp SKILL.md và cài đặt thành 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 Script Sync?

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.

Bạn có thể dùng Script Sync 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 Script Sync 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 Script Sync có miễn phí không?

Có. Kỹ năng này được Happy-Technologies-LLC phát hành trên GitHub theo giấy phép Apache-2.0. 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 cho mô hình các công cụ mới để gọi — mã đượ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à tiêu chí của đầu ra tốt. 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 👇