agentleFS
MicrosoftKnown publishermicrosoft/chartifact/.github/copilot-instructions.md

chartifact

Copilot instructions83 starsChanged 12 months agoMITView on GitHub

Welcome to the Chartifact codebase! This document provides essential guidance for AI coding agents to be productive in this repository. Chartifact is a low-code framework for creating interactive, data-driven documents such as dashboards, reports, and presentations. Below are the key aspects to understand: Chartifact consists of several interoperating modules:

The file

Show its rules and text

We split this copilot-instructions.md into the rules it gives an agent

15 rules. About 0 are common, 9 are distinctive, and 6 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.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use standard CSS for styling documents.

    line 45
  2. Distinctive:

    NO HTML elements are allowed: - use only Markdown formatting.

    line 49
  3. Distinctive:

    No custom JavaScript execution or raw HTML in Markdown.

    line 50
  4. Very specific:

    Use simple string arrays for options: "options": ["Option1", "Option2"]

    line 57
  5. Very specific:

    Place chart specifications in the resources.charts section

    line 61
  6. Very specific:

    ALWAYS add responsive CSS for grid containers: Use min-width: 0 and overflow: hidden for grid areas containing tabulators

    line 65
  7. Very specific:

    If you are asked to create an example, do it in the packages/web-deploy/json folder, do not modify the destination folder …

    line 74
  8. Distinctive:

    IMPORTANT: NO HTML elements are allowed.

    line 75
  9. Very specific:

    After you know it validates statically, validate dynamically.

    line 77
  10. Distinctive:

    After creating or modifying examples, always run a smoke test to ensure they render correctly.

    line 82
  11. Very specific:

    Use the packages\html-wrapper\test\example.mjs script to generate an HTML file from your JSON example.

    line 83
  12. Distinctive:

    All components render correctly

    line 86
  13. Distinctive:

    If issues are found, fix them before finalizing your changes.

    line 88
  14. Distinctive:

    If the agent is run in the cloud:

    line 93
  15. Distinctive:

    If the agent is run locally:

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Copilot Instructions for Chartifact

Welcome to the Chartifact codebase! This document provides essential guidance for AI coding agents to be productive in this repository. Chartifact is a low-code framework for creating interactive, data-driven documents such as dashboards, reports, and presentations. Below are the key aspects to understand:

Big Picture Architecture

Chartifact consists of several interoperating modules:

  1. Document Schema: Defines plugins and components that communicate via reactive variables. Key components include:
    • Text: Markdown with dynamic placeholders.
    • Inputs: Textboxes, checkboxes, sliders, dropdowns.
    • Tables: Sortable, selectable, and editable data grids.
    • Charts: Vega and Vega-Lite visualizations.
    • Diagrams: Mermaid diagrams, including data-driven generation.
    • Images: Dynamic image URLs based on variables.
    • Presets: Named sets of variable values for quick scenario switching.
  2. Sandboxed Runtime: Securely renders documents in isolated environments.
  3. VS Code Extension: Provides tools for editing, previewing, and exporting documents.
  4. Web-Based Viewer and Editor: Enables quick edits and sharing.

Developer Workflows

Build

  • For now, don't build. We can add this later.

Testing

  • Currently we don't have much test coverage. We can add this later.

Version Control

  • Do NOT check in UMD build artifacts: Files matching *.umd.js in docs/dist/v1/ are build outputs and should not be committed in PRs
  • Do NOT edit docs/schema/idoc_v1.d.ts directly: This file is generated from packages/schema-doc/src/. Edit the source files in the schema-doc package instead
  • Do NOT check in built schema files: Files docs/schema/idoc_v1.d.ts and docs/schema/idoc_v1.json are generated from packages/schema-doc/src/ during the build process and should not be committed in PRs
  • These files are generated during the build process and committing them creates unnecessary merge conflicts

Project-Specific Conventions

  1. File Formats:
    • .idoc.md: Markdown format for human-readable documents.
    • .idoc.json: JSON format for structured, programmatic generation. This is compiled to markdown.
  2. Styling:
    • Use standard CSS for styling documents. Examples are provided for articles, dashboards, and slides.
  3. Security:
    • Documents are rendered in sandboxed iframes.
    • NO HTML elements are allowed - use only Markdown formatting.
    • No custom JavaScript execution or raw HTML in Markdown.
    • For layouts and styling, use only CSS classes applied to groups and standard Markdown elements.

Component Capabilities and Constraints

  1. Dropdown Components:
    • Dropdown options must be strings only, not objects
    • Use simple string arrays for options: "options": ["Option1", "Option2"]
    • For data-driven options, use dynamicOptions with a data source. See docs\assets\examples\json\features\7.dropdown.idoc.json
  2. Chart Components:
    • Place chart specifications in the resources.charts section
    • Reference charts using {"type": "chart", "chartKey": "yourChartKey"}
  3. Tabulator Components (Critical):
    • ALWAYS add responsive CSS for grid containers: Use min-width: 0 and overflow: hidden for grid areas containing tabulators
    • This prevents tabulator measurement errors that cause infinite growth and call stack overflow
    • Example: "#table { grid-area: table; min-width: 0; overflow: hidden; }"
    • Also include: ".tabulator { max-width: 100%; overflow: auto; }" and ".tabulator .tabulator-table { min-width: fit-content; }"

Examples

  • Source code for examples is in the packages/web-deploy/json folder
  • Examples in this repo use the json format and are compiled to markdown.
  • If you are asked to create an example, do it in the packages/web-deploy/json folder, do not modify the destination folder docs/assets/examples - this will be populated by a build.
  • IMPORTANT: NO HTML elements are allowed.
  • Validate the json against the TypeScript schema declaration of InteractiveDocumentWithSchema in docs\schema\idoc_v1.d.ts
  • After you know it validates statically, validate dynamically. See packages\compiler\test\validate.mjs

Smoke Test

  • After creating or modifying examples, always run a smoke test to ensure they render correctly.
  • Use the packages\html-wrapper\test\example.mjs script to generate an HTML file from your JSON example.
  • Open the generated HTML file in a browser to verify that:
    • There are no console errors or warnings
    • All components render correctly
    • Interactive elements function as expected
  • If issues are found, fix them before finalizing your changes.
  • Attach the smoke screenshot to your PR for verification.

Runtime host

If the agent is run in the cloud:

If the agent is run locally:

  • the user can preview documents using the VS Code extension.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.