script-sync
Skill40 starsChanged 4 months agoApache-2.0View on GitHub
Explicit pull, local edit, freshness check, and push workflow for ServiceNow scripts with Happy Platform MCP 5.1
In this repository184 other files it gives its agents.
- happy-platform-skillsSkill
- application-scopeSkill
- batch-operationsSkill
- configuration-validationSkill
- deployment-workflowSkill
- generic-crud-operationsSkill
- instance-managementSkill
- schema-discoverySkill
- script-executionSkill
- smart-assessmentSkill
- task-analysisSkill
- task-summarizationSkill
- update-set-managementSkill
- user-provisioningSkill
- workflow-creationSkill
- workspace-insightsSkill
- approval-summarizationSkill
- approval-workflowsSkill
- catalog-builder-aiSkill
- catalog-item-generationSkill
- item-creationSkill
- multi-turn-orderingSkill
- request-fulfillmentSkill
- ui-policiesSkill
- variable-managementSkill
- ci-discoverySkill
- cmdb-search-analysisSkill
- data-qualitySkill
- impact-analysisSkill
- relationship-mappingSkill
- service-graph-diagnosisSkill
- activity-responseSkill
- csm-case-summarizationSkill
- chat-recommendationSkill
- email-recommendationSkill
- csm-kb-generationSkill
- resolution-notesSkill
- csm-sentiment-analysisSkill
- csm-sidebar-summarizationSkill
- csm-suggested-stepsSkill
- trending-topicsSkill
- automated-testingSkill
- business-rulesSkill
- client-scriptsSkill
- code-assistSkill
- code-reviewSkill
- data-importSkill
- debugging-techniquesSkill
- fluent-sdkSkill
- glide-api-referenceSkill
- mcp-server-installationSkill
- mcp-serverSkill
- notificationsSkill
- performance-optimizationSkill
- scheduled-jobsSkill
- scripted-rest-apisSkill
- script-includesSkill
- servicenow-docs-mcpSkill
- test-generationSkill
- ui-actionsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 9 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Use this explicit workflow to pull the current record, edit a local copy, check that the remote record has not changed, and push the …
- Distinctive: line 39
Read and write access to the target script table
- Distinctive: line 50
Use a bounded query with explicit fields.
- Very specific: line 63
Stop if the query is ambiguous.
- Very specific: line 77
Write only the returned script value to a local .js file.
- Distinctive: line 115
After the freshness check passes, update only the intended field:
- Distinctive: line 127
Do not use a background script for this normal record update.
- Very specific: line 132
Read the record again with SN-Get-Record.
- Very specific: line 162
Use explicit instance on every live record call, especially in concurrent work or critical environments.
- Distinctive: line 166
Keep the original pulled version until verification succeeds.
- Distinctive: line 167
Commit local changes only after reviewing the diff and remote verification.
- Distinctive: line 168
Never store instance credentials or access tokens with local script files.
- Distinctive: line 174
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.
- Distinctive: line 193
Keep the explicit workflow, or build a separately reviewed deployment pipeline with equivalent freshness and verification gates.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Script Pull, Edit, and Push Workflow
Overview
Happy Platform MCP 5.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.
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: devStop if the query is ambiguous. Select one sys_id; do not update multiple
same-named scripts by assumption.
2. Pull the authoritative record
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: devWrite 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:
scripts/servicenow/script_includes/IncidentUtils.js
scripts/servicenow/script_includes/IncidentUtils.metadata.json3. 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:
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: devCompare 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:
Tool: SN-Update-Record
Parameters:
table_name: sys_script_include
sys_id: <script_sys_id>
data:
script: <reviewed_local_script>
instance: devDo 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 5.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 type | Table | Common script field |
| Business Rule | sys_script | script |
| Script Include | sys_script_include | script |
| Client Script | sys_script_client | script |
| UI Script | sys_ui_script | script |
| UI Action | sys_ui_action | script |
| Scheduled Job | sysauto_script | script |
| Fix Script | sys_script_fix | script |
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
instanceon 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 5.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-managementdevelopment/business-rulesdevelopment/script-includes
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

