ワンクリックで
instance-analyze
Analyze Canvas instance configuration to understand the target environment for plugin development
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Analyze Canvas instance configuration to understand the target environment for plugin development
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | instance-analyze |
| description | Analyze Canvas instance configuration to understand the target environment for plugin development |
This skill provides guidance for analyzing a Canvas Medical instance's configuration before building plugins. The analysis informs plugin design decisions and identifies existing resources to leverage.
Execution standard: Run Python scripts and Python-based tooling with uv run ... (for scripts, uv run python <script>.py ...). Do not invoke bare python or pip.
Use this skill when:
First, ask the user about the plugin they intend to build. This helps identify if there's already a related plugin and tailors the analysis to their specific needs.
{
"questions": [
{
"question": "What plugin are you planning to build? Please describe its purpose briefly.",
"header": "Plugin Intent",
"options": [
{"label": "Clinical Alert", "description": "Alerts for vitals, lab results, or clinical conditions"},
{"label": "Workflow Automation", "description": "Automate tasks, appointments, or care coordination"},
{"label": "Data Integration", "description": "Sync data with external systems or EHRs"},
{"label": "Patient Engagement", "description": "Patient messaging, reminders, or education"}
],
"multiSelect": false
}
]
}
Store the user's response to use later when:
Read credentials from ~/.canvas/credentials.ini to discover configured instances:
cat ~/.canvas/credentials.ini
Parse the file to extract all section names (instance names). Each section represents a configured Canvas instance:
[instance-name]
client_id=xxx
client_secret=yyy
root_password=zzz
Ask the user which instance to analyze using AskUserQuestion, dynamically populating the options with instances discovered in Step 2:
{
"questions": [
{
"question": "What Canvas instance should I analyze?",
"header": "Instance",
"options": [
{"label": "<instance-1>", "description": "From credentials.ini"},
{"label": "<instance-2>", "description": "From credentials.ini"},
{"label": "...", "description": "Add all discovered instances"}
],
"multiSelect": false
}
]
}
If the user provides an instance name with the command (e.g., /analyze-instance plugin-testing), use that directly without asking.
After the user selects an instance, verify it has root_password configured. If missing, tell the user:
Please add
root_passwordto your~/.canvas/credentials.iniunder the[{instance}]section:[plugin-testing] client_id=your_client_id client_secret=your_client_secret root_password=your_admin_password
Use the scraper script to extract configuration from the admin portal:
uv run python ${CLAUDE_PLUGIN_ROOT}/scripts/scrape_canvas_instance.py <instance_name> <root_password>
This script uses browser automation to:
Login to Admin Portal
https://{hostname}.canvasmedical.com/admin/rootroot_password from credentials.iniExtract Configuration from these pages:
/admin/api/careteamrole/ - Roles (where is active is true)/admin/api/team/ - Teams/admin/api/questionnaire/ - Questionnaires (where is active is true)/admin/api/notetype/ - Note types (where is active is true)/admin/api/notetype/ - Appointment types (where is active and is schedulable are true)/admin/plugin_io/plugin/ - Installed pluginsCreate a comprehensive markdown report with this structure:
# Canvas Instance Configuration Report
**Instance**: {hostname}.canvasmedical.com
**Generated**: {date}
## Summary
| Category | Count |
|----------|-------|
| Roles | X |
| Teams | X |
| Questionnaires | X |
| Note Types | X |
| Appointment Types | X |
| Installed Plugins | X |
## Roles
| Name | Description |
|------|-------------|
| ... | ... |
## Teams
| Name | Members | Description |
|------|---------|-------------|
| ... | ... | ... |
## Questionnaires
| Name | Code | Status |
|------|------|--------|
| ... | ... | Active/Inactive |
## Note Types
| Name | Category |
|------|----------|
| ... | ... |
## Appointment Types
| Name | Duration | Category |
|------|----------|----------|
| ... | ... | ... |
## Installed Plugins
| Name | Version | Status |
|------|---------|--------|
| ... | ... | Active/Inactive |
## Plugin Development Recommendations
Based on this configuration:
- **Available Teams for Task Assignment**: [list teams that could receive tasks]
- **Relevant Questionnaires**: [questionnaires that might be relevant to the use case]
- **Existing Plugins**: [any plugins that might conflict or complement new development]
Save the report to instance-config-{hostname}.md in the current working directory.
Tell the user the file path and offer to explain any section in detail.
If {workspace_dir}/.cpa-workflow-artifacts/plugin-spec.md exists (where workspace_dir is the git repository root), read it and tailor the report to highlight:
Credentials Security: Never log or store credentials. Use them only for the session.
Read-Only: This analysis only reads configuration. It does not modify anything.
Relevance Filtering: When presenting the report, highlight items most relevant to the plugin being developed (if known from a previous brainstorming session).
Plugin Conflicts: Flag any installed plugins that might interact with what's being built.
User: "I need to analyze the plugin-testing instance before building a vitals alert plugin"
You: [Uses AskUserQuestion to confirm instance]
User: Confirms plugin-testing
You: [Reads credentials and runs scraper script]
You: """I've analyzed the plugin-testing instance and saved the report to instance-config-plugin-testing.md.
Key findings relevant to your vitals alert plugin:
Would you like me to explain any section in more detail?"""
User: Yes / No
Canvas SDK reference and documentation. Use whenever a question, claim, or piece of code touches Canvas SDK capabilities, API usage, implementation patterns, or testing — including quick conversational questions ("how do I ingest ADTs?", "what's the import for X?", "does Canvas support Y?"). The bundled docs are the source of truth; do not answer Canvas SDK questions from memory.
FHIR API reference and documentation for Canvas plugins that need to read or write data via FHIR endpoints
This skill should be used when the user asks to "write tests", "create tests", "generate tests", "unit tests", "pytest", "test guidelines", "testing rules", "test standards", "how to test", "test this code", "add tests", "validate tests", "check tests", "improve tests", or when working with Python test files. Provides comprehensive guidelines for creating pytest unit tests with 100% coverage following strict naming conventions, mock patterns, and parametrization standards.
Custom Data anti-patterns and corrections for Canvas plugins - unnecessary compatibility checks, misuse of AttributeHubs vs CustomModels
Database query optimization for Canvas plugins - N+1 detection, prefetch_related, select_related
Security review for plugins acting as FHIR API clients - token management, scope validation, and patient-scoped authorization