agentsclimarketplace

Cht specialist

Skill medic/cht-ai-tools/skills/cht-specialist

Expert assistance with Community Health Toolkit (CHT) development, configuration, troubleshooting, and architecture. Use when working with CHT applications, forms (XLSForm/XForm), tasks.js, targets.js, contact-summary.templated.js, app_settings.json, purge.js, cht-conf CLI, Docker deployment, workflows, integrations, CouchDB/PouchDB, offline-first architecture, replication, SMS messaging, contact hierarchy, user roles and permissions, or any CHT-related questions. Provides guidance on building CHT apps, debugging issues, understanding architecture, data models, and following best practices.From its SKILL.md

Install
npx -y skills add medic/cht-ai-tools --skill cht-specialist

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

12.4 KB, as published. Nobody here has run it

CHT Specialist

When to Consult Reference Files

Read the detailed reference files when the user asks about:

TopicReference File
cht-conf CLI commands, options, CSV imports, authenticationreferences/cht-conf-reference.md
Tasks.js schema, events, actions, resolvedIfreferences/tasks-reference.md
Targets.js schema, counting modes, groupByreferences/targets-reference.md
Contact summary fields, cards, contextreferences/contact-summary-reference.md
XLSForm syntax, CHT widgets, CHT-specific form patternsreferences/forms-reference.md
app_settings.json configurationreferences/app-settings-reference.md
REST API endpoints, export, users, contactsreferences/api-reference.md
Sentinel transitions, muting, death reporting, registrationsreferences/transitions-reference.md
SMS messaging, gateways, schedules, statesreferences/messaging-reference.md
Translations, localization, multilingual formsreferences/translations-reference.md
Docker/Kubernetes deployment, monitoringreferences/hosting-reference.md
Version compatibility, migrationsreferences/version-compatibility.md
Database document schemasreferences/database-schema.md
Utils functions (addDate, getField, isFormSubmittedInWindow, etc.)references/utils-reference.md
CHT API (cht.v1 permissions, extension libs, analytics)references/cht-api-reference.md

ODK/XLSForm Documentation

When working with XLSForm/ODK forms, consult these files based on the topic:

User asks about...Read this file
Form structure, survey/choices/settings sheetsreferences/odk-forms/01-structure.md
Question types (text, select, date, geopoint, image, etc.) or appearance optionsreferences/odk-forms/02-question-types.md
Skip logic (relevant), validation (constraint), calculation, default, triggerreferences/odk-forms/03-form-logic.md
XPath functions (string, math, date, select, repeat functions)references/odk-forms/04-functions.md
Groups, repeats, field-list, nested structures, repeat countsreferences/odk-forms/05-groups-repeats.md
External CSV data, cascading selects, choice_filter, instance()references/odk-forms/06-external-data.md
Multiple languages, translations, label::language columnsreferences/odk-forms/07-multilanguage.md
Markdown formatting, grids, themes, style columnreferences/odk-forms/08-styling.md
ODK Entities, longitudinal data, entity_create, entity_updatereferences/odk-forms/09-entities.md
Audit logging, tracking enumerator behavior, audit typereferences/odk-forms/10-audit-logging.md
Form encryption, RSA keys, public_key settingreferences/odk-forms/11-encryption.md
CHT-specific: db:person, contact-summary, countdown-timer, cht: functionsreferences/odk-forms/12-cht-extensions.md
Quick patterns, common calculations (age, BMI, EDD), cheat sheetsreferences/odk-forms/13-quick-reference.md

Guidance:

  • For CHT-specific form features (contact selector, countdown timer, cht: XPath functions): read 12-cht-extensions.md first
  • For standard ODK/XLSForm syntax: use the topic-specific files above
  • For quick lookup of common patterns: start with 13-quick-reference.md
  • When analyzing or creating a form: read 01-structure.md + relevant topic files

Assets

Asset TypeLocation
Form templates (home visit, assessment, registration)assets/templates/
Example configurationsassets/examples/

Overview

Expert guidance for the Community Health Toolkit (CHT), an open-source framework for building digital health applications in low-resource, offline-first settings. CHT powers applications for community health workers (CHWs), nurses, supervisors, and data managers.

Key Characteristics:

  • Offline-first architecture using CouchDB/PouchDB
  • XLSForm-based care guides and reports
  • JavaScript-based task and target configuration
  • Role-based permissions and data replication
  • SMS workflow support

Prerequisites

  • Node.js 20+ and npm
  • Docker and Docker Compose
  • cht-conf CLI tool (npm install -g cht-conf)

Quick Start

Local Development Setup

# Install cht-conf globally
npm install -g cht-conf

# Initialize a new CHT project
mkdir my-cht-app && cd my-cht-app
cht initialise-project-layout

# Deploy to local instance
cht --url=https://medic:password@localhost --accept-self-signed-certs

Docker CHT Instance

See references/hosting-reference.md for Docker Compose setup, Kubernetes deployment, and monitoring.


Project Structure

my-cht-app/
  app_settings.json          # Main app configuration (compiled)
  app_settings/
    base_settings.json       # Base settings
    forms.json               # Form settings
    schedules.json           # SMS schedules
  contact-summary.templated.js  # Contact profile configuration
  tasks.js                   # Task definitions
  targets.js                 # Target/goal definitions
  purge.js                   # Data purging rules
  resources.json             # Icon and resource mappings
  resources/                 # Icons and media
  forms/
    app/                     # App forms (care guides)
      form_name.xlsx
      form_name.properties.json
      form_name-media/
    contact/                 # Contact creation forms
  translations/
    messages-en.properties
    messages-fr.properties

Tasks Configuration

Tasks are reminders that appear in the Tasks tab, prompting users to complete follow-up activities. See references/tasks-reference.md for complete schema, event timing, actions, and resolution logic.


Targets Configuration

Targets display key performance indicators on the Analytics tab. See references/targets-reference.md for complete schema, counting modes (idType), date filtering, and groupBy aggregation.


Contact Summary Configuration

Contact summary defines the profile page for contacts, including fields, condition cards, and context variables. See references/contact-summary-reference.md for fields schema, cards configuration, and available filters.


Forms (XLSForm)

CHT uses XLSForm format converted to ODK XForm. See references/forms-reference.md for form structure, CHT widgets, XPath functions, and properties.json configuration.


cht-conf CLI Commands

For detailed cht-conf documentation, see references/cht-conf-reference.md which covers all 42 CLI actions, CSV data import, authentication methods, and contact hierarchy management.

Common Commands

CommandDescription
cht initialise-project-layoutInitialize new project
cht --local compile-app-settings upload-app-settingsCompile and upload settings
cht --local convert-app-forms upload-app-formsConvert and upload all app forms
cht --local convert-app-forms upload-app-forms -- form1 form2Convert specific forms
cht --local convert-contact-forms upload-contact-formsConvert and upload contact forms
cht --local upload-resourcesUpload icons and media
cht --local upload-custom-translationsUpload translations
cht --local csv-to-docs upload-docsImport CSV data
cht --local move-contacts -- --contacts=<id> --parent=<id>Move contacts
cht --local edit-contacts -- --columns=field --files=data.csvBulk edit contacts

Connection Options

# Local with self-signed certs
cht --url=https://medic:password@localhost --accept-self-signed-certs

# Remote instance
cht --url=https://user:[email protected]

# Using instance shorthand
cht --instance=your-instance

# Skip server checks (offline compilation)
cht --no-check compile-app-settings

Troubleshooting

Common Issues

Task not appearing:

  1. Check appliesTo and appliesToType match your data
  2. Verify appliesIf returns true for your scenario
  3. Check event timing (days, start, end)
  4. Tasks only show for restricted users

Target not counting correctly:

  1. Verify appliesIf logic
  2. Check date filter ('reported' vs 'now')
  3. For percent, check passesIf logic
  4. Verify appliesToType matches form codes

Form not showing:

  1. Check context.expression in properties.json
  2. Verify user has required permissions
  3. Check form was uploaded successfully

Replication issues:

  1. Check user permissions and place assignment
  2. Verify contact hierarchy
  3. Check for document conflicts

Debug Commands

# Check form conversion
cht --local convert-app-forms

# Validate app settings
cht --local compile-app-settings

# Check instance connection
cht --url=https://... fetch-forms-from-server

Best Practices

Forms

  • Keep titles under 40 characters
  • Use Title Case for titles
  • Don't include patient name in form title
  • Stack radio buttons vertically
  • Use images to aid understanding
  • Group related questions logically

Tasks

  • Limit task generation to near future (60 days past, 180 days future)
  • Use unique task names
  • Provide clear resolution conditions
  • Consider performance with many contacts
  • Use appliesIf to filter early for better performance

Targets

  • Use sentence case for titles
  • Keep titles under 40-50 characters
  • Choose appropriate date filter ('reported' vs 'now')
  • Set meaningful goals
  • Use idType: 'contact' to avoid double-counting

Contact Summary

  • Group related information in cards
  • Only show actionable information
  • Use icons for important statuses
  • Keep field count reasonable for mobile

Version Compatibility

FeatureMinimum Version
Configurable contact types3.7.0
CHT API (cht.v1)3.12.0
Task priority scoring4.21.0
Contact form task actions4.21.0
trigger countdown timer4.7.0
string tel input4.11.0
cht:difference-in-* functions4.7.0
add-date function4.0.0
userSummary in expressions4.21.0
duplicate_check in contact forms4.19.0

CHT Docs MCP Server

The CHT provides an official MCP (Model Context Protocol) server for AI-assisted development.

URL: https://mcp-docs.dev.medicmobile.org/mcp

ToolDescription
ask_questionQuery CHT documentation via Kapa AI
search_docsDirect documentation search
get_sourcesList available knowledge sources

Installation:

claude mcp add --transport http cht-kapa-docs https://mcp-docs.dev.medicmobile.org/mcp

Keep looking

Skills are one crate of 628,971. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.