Logo de Smart Documents

Smart Documents

Organização
Happy-Technologies-LLC
smart-documents

Manage smart documents with version control, approval workflows, automated content generation, document templates, merge fields, and distribution

Visão geral

Publicado porHappy-Technologies-LLC
Repositóriohappy-platform-skills
Nome da habilidadesmart-documents
Estrelas
41
Forks
14
Arquivos incluídos
Somente instruções
LicençaApache-2.0
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Sem arquivos extras

    Tudo de que o modelo precisa está nas instruções — sem arquivos extras para sincronizar.

  • Código aberto

    Publicada por Happy-Technologies-LLC no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Smart Documents no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/Happy-Technologies-LLC/happy-platform-skills/tree/main/skills/document/smart-documents
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

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/document/smart-documents .claude/skills/smart-documents
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Smart Documents em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Smart Documents automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Smart Documents não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

Smart Documents

Overview

This skill provides a structured approach to managing smart documents in ServiceNow Document Intelligence. It helps you:

  • Create and manage document records in sn_doc_management with full lifecycle tracking
  • Configure document templates in sn_doc_template with reusable structures for common document types
  • Implement version control using sn_doc_version to track document revisions and maintain audit history
  • Set up approval workflows via sn_doc_approval and sysapproval_approver for document review and sign-off
  • Define merge fields in sn_doc_merge_field for automated content generation from ServiceNow data
  • Manage document distribution through sn_doc_distribution for controlled sharing and delivery

When to use: When creating standardized documents (policies, SOPs, contracts, compliance reports), when documents require version control and approval before publication, or when generating documents with dynamic data from ServiceNow records.

Plugin required: com.sn_doc_intelligence

Prerequisites

  • Roles: sn_doc_management_admin, sn_doc_management_user, document_management, or admin
  • Access: Read/write access to sn_doc_management, sn_doc_template, sn_doc_version, sn_doc_approval, and sys_attachment tables
  • Knowledge: Understanding of your organization's document governance policies, approval hierarchies, and distribution requirements
  • Plugin: Document Intelligence (com.sn_doc_intelligence) must be activated

Procedure

Step 1: Create or Select a Document Template

Templates define the structure, merge fields, and default content for each document type.

Query existing templates:

Using MCP (Claude Code/Desktop):

Tool: SN-Query-Table
Parameters:
  table_name: sn_doc_template
  query: active=true^document_typeLIKEpolicy^ORdocument_typeLIKEcontract^ORdocument_typeLIKEreport
  fields: sys_id,name,description,document_type,category,version,state,merge_field_count,approval_required
  limit: 25
  order_by: name

Using REST API:

bash
GET /api/now/table/sn_doc_template?sysparm_query=active=true^ORDERBYname&sysparm_fields=sys_id,name,description,document_type,category,version,state,merge_field_count,approval_required&sysparm_limit=25&sysparm_display_value=true

Create a new template:

Using MCP:

Tool: SN-Create-Record
Parameters:
  table_name: sn_doc_template
  fields:
    name: "IT Security Policy Template"
    description: "Standard template for IT security policies with approval workflow. Includes merge fields for department, effective date, and policy owner."
    document_type: policy
    category: information_security
    approval_required: true
    approval_group: [security_governance_group_sys_id]
    version: "1.0"
    state: draft
    active: true

Using REST API:

bash
POST /api/now/table/sn_doc_template
Content-Type: application/json

{
  "name": "IT Security Policy Template",
  "description": "Standard template for IT security policies with approval workflow",
  "document_type": "policy",
  "category": "information_security",
  "approval_required": "true",
  "approval_group": "[security_governance_group_sys_id]",
  "version": "1.0",
  "state": "draft",
  "active": "true"
}

Step 2: Define Merge Fields

Configure merge fields that pull dynamic data from ServiceNow records into the document.

Using MCP:

Tool: SN-Create-Record
Parameters:
  table_name: sn_doc_merge_field
  fields:
    template: [template_sys_id]
    field_name: "department_name"
    display_label: "Department Name"
    source_table: cmn_department
    source_field: name
    placeholder: "{{department_name}}"
    field_type: reference
    required: true
    order: 100

Common merge fields by document type:

Document TypeMerge FieldSource TableSource FieldPlaceholder
PolicyDepartmentcmn_departmentname{{department_name}}
PolicyEffective Date(manual)(date){{effective_date}}
PolicyPolicy Ownersys_username{{policy_owner}}
PolicyReview Date(calculated)(date){{next_review_date}}
ContractVendor Namecore_companyname{{vendor_name}}
ContractContract Valueast_contracttotal_cost{{contract_value}}
ContractStart Dateast_contractstarts{{start_date}}
ContractEnd Dateast_contractends{{end_date}}
ReportReport Period(manual)(string){{report_period}}
ReportAuthorsys_username{{author_name}}
ReportGenerated Date(system)(datetime){{generated_date}}

Using REST API:

bash
POST /api/now/table/sn_doc_merge_field
Content-Type: application/json

{
  "template": "[template_sys_id]",
  "field_name": "department_name",
  "display_label": "Department Name",
  "source_table": "cmn_department",
  "source_field": "name",
  "placeholder": "{{department_name}}",
  "field_type": "reference",
  "required": "true",
  "order": "100"
}

Step 3: Create a Document from Template

Generate a new document instance from the template, populating merge fields with actual data.

Using MCP:

Tool: SN-Create-Record
Parameters:
  table_name: sn_doc_management
  fields:
    short_description: "IT Security Policy - Remote Access - Engineering Department"
    template: [template_sys_id]
    document_type: policy
    category: information_security
    department: [department_sys_id]
    owner: [policy_owner_sys_id]
    effective_date: "2026-04-01"
    review_date: "2027-04-01"
    state: draft
    version: "1.0"
    confidentiality: internal

Using REST API:

bash
POST /api/now/table/sn_doc_management
Content-Type: application/json

{
  "short_description": "IT Security Policy - Remote Access - Engineering Department",
  "template": "[template_sys_id]",
  "document_type": "policy",
  "category": "information_security",
  "department": "[department_sys_id]",
  "owner": "[policy_owner_sys_id]",
  "effective_date": "2026-04-01",
  "review_date": "2027-04-01",
  "state": "draft",
  "version": "1.0",
  "confidentiality": "internal"
}

Step 4: Manage Document Versions

Track revisions and maintain version history.

Create a new version when editing:

Using MCP:

Tool: SN-Create-Record
Parameters:
  table_name: sn_doc_version
  fields:
    document: [document_sys_id]
    version_number: "1.1"
    change_description: "Updated remote access VPN requirements per security audit findings. Added MFA requirement for all remote connections."
    author: [editor_sys_id]
    state: draft
    previous_version: [previous_version_sys_id]
    attachment: [updated_attachment_sys_id]

Query version history:

Tool: SN-Query-Table
Parameters:
  table_name: sn_doc_version
  query: document=[document_sys_id]
  fields: sys_id,version_number,change_description,author,state,sys_created_on,attachment,previous_version
  limit: 20
  order_by: -sys_created_on

Using REST API:

bash
# Create new version
POST /api/now/table/sn_doc_version
Content-Type: application/json

{
  "document": "[document_sys_id]",
  "version_number": "1.1",
  "change_description": "Updated remote access VPN requirements",
  "author": "[editor_sys_id]",
  "state": "draft",
  "previous_version": "[previous_version_sys_id]"
}

# Get version history
GET /api/now/table/sn_doc_version?sysparm_query=document=[document_sys_id]^ORDERBYDESCsys_created_on&sysparm_fields=sys_id,version_number,change_description,author,state,sys_created_on&sysparm_limit=20&sysparm_display_value=true

Step 5: Submit for Approval

Route the document through the configured approval workflow.

Using MCP:

Tool: SN-Create-Record
Parameters:
  table_name: sn_doc_approval
  fields:
    document: [document_sys_id]
    document_version: [version_sys_id]
    approval_type: sequential
    state: requested
    short_description: "Approval required: IT Security Policy v1.1 - Remote Access"
    comments: "Updated policy requires approval from Security Governance and CISO before publication."

Then create individual approver records:

Tool: SN-Create-Record
Parameters:
  table_name: sysapproval_approver
  fields:
    sysapproval: [approval_sys_id]
    approver: [approver_sys_id]
    state: requested
    order: 100
    comments: "Please review the updated remote access policy. Key changes: MFA requirement added for all VPN connections."

Using REST API:

bash
POST /api/now/table/sn_doc_approval
Content-Type: application/json

{
  "document": "[document_sys_id]",
  "document_version": "[version_sys_id]",
  "approval_type": "sequential",
  "state": "requested",
  "short_description": "Approval required: IT Security Policy v1.1"
}

Monitor approval status:

Tool: SN-Query-Table
Parameters:
  table_name: sysapproval_approver
  query: sysapproval=[approval_sys_id]
  fields: sys_id,approver,state,comments,sys_updated_on,order
  limit: 10
  order_by: order

Step 6: Publish and Update Document State

After approval, publish the document and update its state.

Using MCP:

Tool: SN-Update-Record
Parameters:
  table_name: sn_doc_management
  sys_id: [document_sys_id]
  data:
    state: published
    version: "1.1"
    published_date: "2026-03-19"
    work_notes: "Document approved by Security Governance (2026-03-17) and CISO (2026-03-19). Published as version 1.1."

Update the version record:

Tool: SN-Update-Record
Parameters:
  table_name: sn_doc_version
  sys_id: [version_sys_id]
  data:
    state: published

Using REST API:

bash
PATCH /api/now/table/sn_doc_management/[document_sys_id]
Content-Type: application/json

{
  "state": "published",
  "version": "1.1",
  "published_date": "2026-03-19",
  "work_notes": "Approved and published as version 1.1."
}

Step 7: Configure Document Distribution

Set up controlled distribution to ensure the right audiences receive the document.

Using MCP:

Tool: SN-Create-Record
Parameters:
  table_name: sn_doc_distribution
  fields:
    document: [document_sys_id]
    distribution_type: group
    recipient_group: [engineering_group_sys_id]
    delivery_method: email_notification
    notify_on_update: true
    acknowledgment_required: true
    acknowledgment_deadline: "2026-04-15"
    short_description: "Distribute IT Security Policy v1.1 to Engineering"

Using REST API:

bash
POST /api/now/table/sn_doc_distribution
Content-Type: application/json

{
  "document": "[document_sys_id]",
  "distribution_type": "group",
  "recipient_group": "[engineering_group_sys_id]",
  "delivery_method": "email_notification",
  "notify_on_update": "true",
  "acknowledgment_required": "true",
  "acknowledgment_deadline": "2026-04-15"
}

Track acknowledgments:

Tool: SN-Query-Table
Parameters:
  table_name: sn_doc_distribution
  query: document=[document_sys_id]
  fields: sys_id,recipient_group,recipient_user,delivery_method,acknowledged,acknowledged_date,acknowledgment_deadline
  limit: 50

Step 8: Monitor Document Lifecycle

Track documents approaching review dates or requiring updates.

Using MCP:

Tool: SN-Query-Table
Parameters:
  table_name: sn_doc_management
  query: state=published^review_date<=javascript:gs.daysAgoEnd(-30)^review_date>=javascript:gs.beginningOfToday()
  fields: sys_id,number,short_description,document_type,owner,review_date,version,department
  limit: 25
  order_by: review_date

Using REST API:

bash
GET /api/now/table/sn_doc_management?sysparm_query=state=published^review_dateBETWEENjavascript:gs.beginningOfToday()@javascript:gs.daysAgoEnd(-30)^ORDERBYreview_date&sysparm_fields=sys_id,number,short_description,document_type,owner,review_date,version,department&sysparm_limit=25&sysparm_display_value=true

Generate a lifecycle report:

Tool: SN-Add-Work-Notes
Parameters:
  table_name: sn_doc_management
  sys_id: [document_sys_id]
  work_notes: |
    === DOCUMENT LIFECYCLE STATUS ===
    Document: [number] - [short_description]
    Current Version: [version]
    State: Published
    Owner: [owner]

    VERSION HISTORY:
    - v1.0 (2026-01-15) - Initial publication
    - v1.1 (2026-03-19) - Updated MFA requirements

    APPROVAL HISTORY:
    - v1.0: Approved by Security Governance (2026-01-12), CISO (2026-01-14)
    - v1.1: Approved by Security Governance (2026-03-17), CISO (2026-03-19)

    DISTRIBUTION:
    - Engineering: 45/50 acknowledged (90%)
    - IT Operations: 28/30 acknowledged (93%)
    - Outstanding: 7 users past deadline

    NEXT REVIEW: 2027-04-01 (378 days)
    ACTION: Schedule review kickoff for 2027-02-01

Tool Usage

MCP Tools Reference

ToolWhen to Use
SN-Natural-Language-SearchFind documents by description or content keywords
SN-Query-TableQuery documents, templates, versions, approvals, distributions
SN-Get-RecordRetrieve a specific document or template record
SN-Create-RecordCreate documents, versions, approvals, distributions, merge fields
SN-Update-RecordUpdate document state, publish, archive
SN-Add-Work-NotesDocument lifecycle events and review notes

REST API Reference

EndpointMethodPurpose
/api/now/table/sn_doc_managementGET/POST/PATCHManage document records
/api/now/table/sn_doc_templateGET/POSTManage document templates
/api/now/table/sn_doc_versionGET/POST/PATCHTrack document versions
/api/now/table/sn_doc_approvalGET/POSTManage document approvals
/api/now/table/sn_doc_distributionGET/POSTManage distribution lists
/api/now/table/sn_doc_merge_fieldGET/POSTConfigure merge fields
/api/now/table/sysapproval_approverGET/POSTManage individual approvers
/api/now/table/sys_attachmentGETAccess document file attachments

Best Practices

  • Template governance: Maintain a central library of approved templates; restrict template creation to document management administrators
  • Version discipline: Never overwrite a published version; always create a new version record to preserve audit trail
  • Meaningful change descriptions: Every version must include a clear description of what changed and why, not just "updated document"
  • Approval before distribution: Never distribute a document that has not completed its approval workflow
  • Acknowledgment tracking: For compliance-critical documents (policies, procedures), require acknowledgment and track completion rates
  • Review cadence: Set review dates based on document type: policies annually, procedures semi-annually, standards quarterly
  • Confidentiality classification: Tag every document with a confidentiality level (public, internal, confidential, restricted) to control access
  • Merge field validation: Test all merge fields with sample data before publishing a template to ensure proper rendering

Troubleshooting

"Template merge fields not populating"

Cause: Merge field placeholders in the document content do not match the configured placeholder values in sn_doc_merge_field Solution: Verify that placeholders use exact matching syntax (e.g., {{department_name}}). Check for extra spaces or encoding issues. Query sn_doc_merge_field with template=[template_sys_id] to confirm field configurations.

"Approval workflow not triggering"

Cause: The template's approval_required flag is not set, or no approval group is configured Solution: Verify the template has approval_required=true and a valid approval_group. Check that the approval group has active members with the approver_user role.

"Document version conflict"

Cause: Two users editing the same document simultaneously, or a version was created without locking the previous version Solution: Query sn_doc_version for the document to identify competing drafts. Implement a checkout/lock mechanism using the document state field (set to checked_out when editing).

"Distribution notification not sent"

Cause: Email notification configuration is missing or the recipient group has no email-enabled members Solution: Verify the notification template exists in sysevent_email_action with event name matching the distribution trigger. Check that recipients have valid email addresses in their sys_user records.

"Cannot find document attachments"

Cause: Attachments may be linked to the version record rather than the document record Solution: Query sys_attachment with both table_name=sn_doc_management^table_sys_id=[doc_sys_id] and table_name=sn_doc_version^table_sys_id=[version_sys_id] to find all related files.

Examples

Example 1: Create and Publish a Security Policy

Input: "Create a new data classification policy for the Finance department"

Process:

  1. Select template: "IT Security Policy Template"
  2. Create document with merge fields: Department=Finance, Owner=CISO, Effective=2026-04-01
  3. Upload draft content as attachment
  4. Create version 1.0
  5. Submit for approval: Security Governance then CISO
  6. After approval, publish and distribute to Finance department
  7. Require acknowledgment within 30 days

Example 2: Update an Existing Procedure Document

Input: "Update the incident response procedure to include ransomware playbook"

Process:

Tool: SN-Create-Record
Parameters:
  table_name: sn_doc_version
  fields:
    document: [ir_procedure_sys_id]
    version_number: "3.2"
    change_description: "Added ransomware response playbook (Section 7). Updated escalation matrix to include Cyber Insurance carrier notification. Revised recovery time objectives per 2026 BCP update."
    author: [security_analyst_sys_id]
    state: draft
    previous_version: [v31_sys_id]

Example 3: Automated Contract Document Generation

Input: "Generate an NDA document from template for vendor onboarding"

Process:

  1. Select template: "Mutual NDA Template"
  2. Populate merge fields from core_company and sys_user:
    • {{vendor_name}}: "TechPartners Inc"
    • {{vendor_address}}: "123 Innovation Blvd, Austin, TX"
    • {{effective_date}}: "2026-03-19"
    • {{term_length}}: "2 years"
    • {{company_signatory}}: "Jane Smith, VP Legal"
  3. Generate document, create version 1.0
  4. Route for legal approval
  5. After approval, distribute to vendor via secure link
Tool: SN-Create-Record
Parameters:
  table_name: sn_doc_management
  fields:
    short_description: "Mutual NDA - TechPartners Inc - Vendor Onboarding"
    template: [nda_template_sys_id]
    document_type: contract
    category: nda
    state: draft
    version: "1.0"
    confidentiality: confidential
    related_record_table: core_company
    related_record: [vendor_sys_id]

Related Skills

  • document/document-extraction - Extract structured data from uploaded documents
  • legal/contract-analysis - Analyze generated contract documents for risk
  • legal/contract-obligation-extraction - Extract obligations from contract documents
  • catalog/approval-workflows - Configure approval workflows for document processes
  • admin/workflow-creation - Build custom document lifecycle workflows

Perguntas frequentes

O que a habilidade de IA Smart Documents faz?

Manage smart documents with version control, approval workflows, automated content generation, document templates, merge fields, and distribution

Por que usar Smart Documents no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Smart Documents é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Smart Documents no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/Happy-Technologies-LLC/happy-platform-skills/tree/main/skills/document/smart-documents. O TypingMind lê o arquivo SKILL.md e instala a habilidade para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Smart Documents?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Smart Documents?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Smart Documents com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Smart Documents é gratuita?

Sim. A habilidade é publicada no GitHub por Happy-Technologies-LLC sob a licença Apache-2.0. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇