cm-reporting-integration

📁 cirscn/cm-reporting 📅 6 days ago
1
总安装量
1
周安装量
#53977
全站排名
安装命令
npx skills add https://github.com/cirscn/cm-reporting --skill cm-reporting-integration

Agent 安装分布

codex 1

Skill 文档

CM Reporting Integration

Use this skill to deliver production-grade cm-reporting integrations, not only demos.

Fast Routing

Route requests first, then load the minimum references.

  • New host integration from zero → read references/integration-snippets.md.
  • API/contract clarification → read references/contracts.md.
  • Template/version/file lookup → read references/template-matrix.md.
  • Runtime/export/restore failures → read references/troubleshooting.md.
  • Template file path lookup automation → run scripts/resolve-template-path.mjs.

Non-Negotiable Constraints

Apply these rules in every solution:

  • Keep templateType and versionId strictly matched across render, restore, and export.
  • Import cm-reporting/styles.css exactly once in host runtime.
  • Provide official template .xlsx as ArrayBuffer when calling Excel export APIs.
  • Treat Snapshot as full-state contract (schemaVersion/templateType/versionId/data).
  • Return integrations callback result in { items: [...] } | null | undefined shape only.
  • Respect package license (PolyForm-Noncommercial-1.0.0) in usage recommendations.

Standard Delivery Workflow

Follow this order unless user asks otherwise.

  1. Confirm host environment and peer dependency ranges.
  2. Choose template delivery strategy (static/CDN/internal service).
  3. Implement baseline CMReporting mounting with required props.
  4. Add host orchestration via CMReportingRef (get/set/export/validate).
  5. Add Snapshot persistence and recovery path.
  6. Add Excel export action with tested template fetch path.
  7. Add integrations callbacks if host needs external pickers.
  8. Add legacy adapter flow only when interoperability is required.
  9. Run final acceptance checklist from references before handoff.

Output Requirements

When producing integration code or guidance, always include:

  • Explicit dependency and peer dependency install commands.
  • Concrete templateType + versionId examples.
  • Snapshot save + restore behavior definition.
  • Excel export data flow (template source → ArrayBuffer → Blob download).
  • Failure fallback behavior (cancel flow, null return, retry boundaries).

Anti-Patterns to Avoid

  • Do not generate workbook from scratch for export.
  • Do not assume template files exist without mapping verification.
  • Do not mix incompatible template/version pairs.
  • Do not return raw arrays from integrations callbacks; wrap in { items }.
  • Do not advise manual mutation of package internals or private APIs.

References

Load only what the request needs:

  • references/integration-snippets.md: full quickstart + production recipes.
  • references/contracts.md: public API and callback contract tables.
  • references/template-matrix.md: complete template/version/file mapping.
  • references/troubleshooting.md: symptom-to-action playbook.