Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
56 changes: 28 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Mounts byte-identical (canonical → mirrors)
run: bin/sync-mounts.sh --check
- name: Standalone skill package
run: node dev-scripts/check-skill-package.mjs

- name: Make scripts executable
run: chmod +x bin/sync-mounts.sh dev-scripts/*.mjs visualize/scripts/*.sh visualize/scripts/*.mjs
run: chmod +x dev-scripts/*.mjs skills/visualize/scripts/*.sh skills/visualize/scripts/*.mjs

- name: Plugin manifests parse as JSON
run: |
Expand All @@ -25,28 +25,28 @@ jobs:

- name: Bash syntax check
run: |
bash -n visualize/scripts/_common.sh
bash -n visualize/scripts/publish.sh
bash -n skills/visualize/scripts/_common.sh
bash -n skills/visualize/scripts/publish.sh
bash -n dev-scripts/build-previews.sh
bash -n dev-scripts/build-template-previews.sh
bash -n dev-scripts/build-templates-showcase.sh

- name: Node syntax check
run: |
node --check visualize/scripts/catalog.mjs
node --check visualize/scripts/teach.mjs
node --check visualize/scripts/palette.mjs
node --check visualize/scripts/detect.mjs
node --check visualize/scripts/browser-contrast.mjs
node --check visualize/scripts/browser-diagram.mjs
node --check visualize/scripts/render-mermaid.mjs
node --check visualize/scripts/image-contract.mjs
node --check visualize/scripts/generate-image.mjs
node --check visualize/scripts/record-image.mjs
node --check visualize/scripts/print-check.mjs
node --check visualize/scripts/slide-canvas-overflow.mjs
node --check visualize/scripts/slide-canvas-smoke.mjs
node --check visualize/shells/slide-canvas/slide-canvas.js
node --check skills/visualize/scripts/catalog.mjs
node --check skills/visualize/scripts/teach.mjs
node --check skills/visualize/scripts/palette.mjs
node --check skills/visualize/scripts/detect.mjs
node --check skills/visualize/scripts/browser-contrast.mjs
node --check skills/visualize/scripts/browser-diagram.mjs
node --check skills/visualize/scripts/render-mermaid.mjs
node --check skills/visualize/scripts/image-contract.mjs
node --check skills/visualize/scripts/generate-image.mjs
node --check skills/visualize/scripts/record-image.mjs
node --check skills/visualize/scripts/print-check.mjs
node --check skills/visualize/scripts/slide-canvas-overflow.mjs
node --check skills/visualize/scripts/slide-canvas-smoke.mjs
node --check skills/visualize/shells/slide-canvas/slide-canvas.js
node --check dev-scripts/catalog-index.mjs
node --check dev-scripts/check-authoring-contracts.mjs
node --check dev-scripts/check-fixtures.mjs
Expand Down Expand Up @@ -86,17 +86,17 @@ jobs:
- name: slide-canvas unit tests
# Pure-logic helpers (computeScale, parseSlideHash, static API).
# Zero deps; runs with the bundled node:test runner.
run: node --test visualize/shells/slide-canvas/slide-canvas.test.mjs
run: node --test skills/visualize/shells/slide-canvas/slide-canvas.test.mjs

- name: Portable image-generation contract
run: node --test visualize/scripts/image-contract.test.mjs visualize/scripts/image-generation.test.mjs visualize/scripts/image-routes.test.mjs
run: node --test skills/visualize/scripts/image-contract.test.mjs skills/visualize/scripts/image-generation.test.mjs skills/visualize/scripts/image-routes.test.mjs

- name: Authoring contract
# Enforces the template.md / patterns / shells / fixtures model.
run: node dev-scripts/check-authoring-contracts.mjs

- name: Slide-canvas overflow self-test
run: node visualize/scripts/slide-canvas-overflow.mjs --self-test
run: node skills/visualize/scripts/slide-canvas-overflow.mjs --self-test

- name: Library / CDN policy enforcement
# Fails the build if any template <script src=...> references a
Expand All @@ -105,10 +105,10 @@ jobs:
run: node dev-scripts/check-library-policy.mjs --quiet

- name: Diagram geometry self-test
run: node visualize/scripts/browser-diagram.mjs --self-test
run: node skills/visualize/scripts/browser-diagram.mjs --self-test

- name: Mermaid authoring-path self-test
run: node visualize/scripts/render-mermaid.mjs --self-test
run: node skills/visualize/scripts/render-mermaid.mjs --self-test

- name: Fixture manifest checks
# Runs each detect / contrast / smoke check declared in fixtures/manifest.json.
Expand All @@ -119,7 +119,7 @@ jobs:
run: |
node dev-scripts/inventory-template-composition.mjs --strict
dev-scripts/build-template-previews.sh --matrix dev-scripts/template-preview-matrix.json
find temp/template-previews -name '*.html' -print0 | xargs -0 node visualize/scripts/detect.mjs --strict
find temp/template-previews -name '*.html' -print0 | xargs -0 node skills/visualize/scripts/detect.mjs --strict

- name: Preview freshness — design-systems/<ds>/preview*.html match generated
# Re-runs build-previews.sh in --check mode. Fails if committed
Expand All @@ -133,7 +133,7 @@ jobs:
# hygiene; floating branch refs let upstream rewrite history.
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
with:
scandir: ./visualize/scripts
scandir: ./skills/visualize/scripts
severity: warning

# Deliberately no wire-level smoke against a spawned API. The bash
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ env.npm_config_cache }}
key: mermaid-${{ runner.os }}-${{ runner.arch }}-${{ steps.toolchain.outputs.node }}-${{ steps.toolchain.outputs.npm }}-${{ hashFiles('visualize/scripts/render-mermaid.mjs') }}
key: mermaid-${{ runner.os }}-${{ runner.arch }}-${{ steps.toolchain.outputs.node }}-${{ steps.toolchain.outputs.npm }}-${{ hashFiles('skills/visualize/scripts/render-mermaid.mjs') }}

- name: Prepare pinned Mermaid CLI
# Keep cold package acquisition outside the renderer's 60-second
Expand All @@ -179,4 +179,4 @@ jobs:
# Covers direct npx-cli.js execution through Node, valid and invalid
# source, the end-to-end deadline, and taskkill-based descendant cleanup.
timeout-minutes: 3
run: node visualize/scripts/render-mermaid.mjs --self-test
run: node skills/visualize/scripts/render-mermaid.mjs --self-test
28 changes: 11 additions & 17 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
# AGENTS.md — instructions for AI coding agents working in this repo

This repo is the source for the `visualize` agent skill. Most edits land under `visualize/` (the canonical mount); the three mirror mounts under `skills/`, `hermes/design/`, and `pi/agent/skills/` are regenerated by `bin/sync-mounts.sh`. **Never edit the mirrors directly** — CI fails on drift.
This repo is the source for the `visualize` agent skill. `skills/visualize/` is the single authored and installable skill directory. Edit it directly; there are no distribution mirrors or placeholder transforms.

## Editing workflow

1. Edit runtime instructions and helpers under `visualize/`; full catalog sources under `catalog/`; authoring tools under `dev-scripts/`. Run `node dev-scripts/catalog-index.mjs` after catalog edits to regenerate the bundled index and fallback.
2. Run `bin/sync-mounts.sh` to propagate.
3. Commit both the canonical change and the mirror updates in the same commit.
1. Edit runtime instructions and helpers under `skills/visualize/`; full catalog sources under `catalog/`; authoring tools under `dev-scripts/`. Run `node dev-scripts/catalog-index.mjs` after catalog edits to regenerate the bundled index and fallback.
2. Run `node dev-scripts/check-skill-package.mjs` and the checks relevant to the change.

`visualize/design-systems/animation-patterns.md` is runtime-owned shared guidance for `animate` and catalog preview authors. Edit it directly; catalog generation does not overwrite it.
`skills/visualize/design-systems/animation-patterns.md` is runtime-owned shared guidance for `animate` and catalog preview authors. Edit it directly; catalog generation does not overwrite it.

## Adding content

- **Template** → `visualize/templates/<slug>/template.md`. Keep the contract compact: frontmatter, use/exclusion rules, structure, creation guidance, hierarchy/mobile contracts, and concrete failure modes. See `CONTRIBUTING.md` for the canonical shape.
- **Template** → `skills/visualize/templates/<slug>/template.md`. Keep the contract compact: frontmatter, use/exclusion rules, structure, creation guidance, hierarchy/mobile contracts, and concrete failure modes. See `CONTRIBUTING.md` for the canonical shape.
- **Design system** → `catalog/design-systems/<slug>/{DESIGN.md,tokens.css}`.
- **Pattern recipe** → `visualize/patterns/<slug>.md`. Use for recurring creation guidance, not reusable component CSS.
- **Reference doc** → `visualize/reference/<topic>.md`. Lean intent + named failure modes only. Don't write defensive scaffolding.
- **Pattern recipe** → `skills/visualize/patterns/<slug>.md`. Use for recurring creation guidance, not reusable component CSS.
- **Reference doc** → `skills/visualize/reference/<topic>.md`. Lean intent + named failure modes only. Don't write defensive scaffolding.

## Skill authoring split

- **Avoid duplication.** Information should live in either `SKILL.md` or reference files, not both. Repeated rules drift, especially when a later edit fixes one copy and misses the other.
- **Keep `SKILL.md` procedural.** `SKILL.md` should carry only essential procedural instructions, workflow guidance, command routing, shared contracts, and global rules. Move detailed reference material into focused files under `visualize/reference/`.
- **Keep `SKILL.md` procedural.** `SKILL.md` should carry only essential procedural instructions, workflow guidance, command routing, shared contracts, and global rules. Move detailed reference material into focused files under `skills/visualize/reference/`.
- **Separate variations from the core workflow.** When the skill supports multiple variations, keep only the shared workflow and selection guidance in `SKILL.md`. Move variant-specific details, examples, edge cases, and failure modes into separate reference files.
- **Reference docs defer to `SKILL.md`.** Shared skill behavior belongs in `SKILL.md`. Reference docs should first apply the shared rules in `SKILL.md`, then describe only topic- or verb-specific procedure, failure modes, and consequences. Do not restate shared fallback logic, output shape, global bans, diff guards, or context-resolution policy in references.

Expand All @@ -40,21 +39,16 @@ Every constraint the skill imposes must answer: *what bad output would result wi
## Repository layout

```
visualize/ ← canonical installed skill
skills/visualize/ ← single authored and installed skill
├── SKILL.md
├── reference/ ← typography / color / spatial / motion / copy
├── patterns/ ← creation-time pattern recipes
├── design-systems/ ← generated index/source pin/Clean fallback + runtime-owned animation-patterns.md
├── templates/ ← template contracts (template.md per template)
└── scripts/ ← bash + Node helpers

skills/visualize/ ← mirror — npm-skills (`npx skills add`)
hermes/design/visualize/ ← mirror — Hermes well-known
pi/agent/skills/visualize/ ← mirror — Pi / OpenClaw

catalog/design-systems/ ← full authoritative catalog and generated previews
dev-scripts/preview-kit/ ← development-only preview sources
visualize/fixtures/ ← shared fixtures used by shipped check helpers
bin/sync-mounts.sh ← regenerate the three mirrors
.github/workflows/ci.yml ← mirror-check + JSON lint + shellcheck
skills/visualize/fixtures/ ← shared fixtures used by shipped check helpers
.github/workflows/ci.yml ← standalone package + JSON lint + shellcheck
```
Loading
Loading