@maxiaochao/pi-toolkit 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
- ## 2026-08-19 - v0.1.6
1
+ ## 2026-08-21 - v0.1.7
2
+
3
+ - add the html-artifact skill for interactive HTML explanations and codebase visualizations
4
+ - register and package the skill for Pi discovery
5
+ - prefer `.cache/html/` for generated temporary HTML artifacts
6
+
2
7
 
3
8
  - expand global agent guidance and reuse-before-writing rules
4
9
 
package/global/AGENTS.md CHANGED
@@ -102,4 +102,9 @@ After each significant step:
102
102
 
103
103
  ---
104
104
 
105
- **These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
105
+
106
+ ## Output Format Preference
107
+
108
+ For complex explanations, prefer a runnable HTML artifact over a long Markdown-only response when the content benefits from visual structure or interaction. This includes workflows, code/module relationships, state machines, event/data flows, architecture maps, timelines, comparisons, dashboards, and interactive demonstrations. Keep ordinary prose, short answers, diffs, and focused code reviews in Markdown.
109
+
110
+ When using HTML, create a self-contained, responsive artifact in the project's established output location, or `.cache/html/<descriptive-name>.html` when no convention exists. Use semantic HTML, accessible controls, escaped code blocks, and small useful interactions. Return a concise Markdown summary with a clickable local file path; if a preview/server tool is available, start it and return the preview URL only after verifying the page is not blank and its assets load.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxiaochao/pi-toolkit",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Personal pi coding agent toolkit: /todos extension + /cache_export interactive cache dashboard.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -12,7 +12,8 @@
12
12
  "README.md",
13
13
  "CHANGELOG.md",
14
14
  "global/AGENTS.md",
15
- "scripts/install-agents.mjs"
15
+ "scripts/install-agents.mjs",
16
+ "skills"
16
17
  ],
17
18
  "repository": {
18
19
  "type": "git",
@@ -22,6 +23,9 @@
22
23
  "extensions": [
23
24
  "./extensions/todo.ts",
24
25
  "./extensions/cache-export/index.ts"
26
+ ],
27
+ "skills": [
28
+ "./skills"
25
29
  ]
26
30
  },
27
31
  "peerDependencies": {
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: html-artifact
3
+ description: Create self-contained, responsive HTML artifacts for complex explanations that benefit from visual structure or interaction, including workflows, code/module relationships, state machines, event/data flows, architecture maps, timelines, comparisons, dashboards, and interactive demonstrations. Use Markdown for ordinary prose, short answers, diffs, and focused code reviews.
4
+ ---
5
+
6
+ # HTML Artifact
7
+
8
+ Use this skill when the user needs to understand or explore a complex process, codebase relationship, system design, state transition, comparison, or other content where static Markdown would be hard to scan or interact with.
9
+
10
+ ## Decide the format
11
+
12
+ Use Markdown when the response is short, linear, text-first, or primarily a focused code review. Use an HTML artifact when visual layout, filtering, expanding details, tabs, highlighting, diagrams, timelines, or interactive state changes materially improve understanding.
13
+
14
+ Do not create HTML merely to wrap a small answer. The artifact should reduce cognitive load and make the subject easier to inspect.
15
+
16
+ ## Create the artifact
17
+
18
+ 1. Read the relevant code and verify names, relationships, and behavior before visualizing them.
19
+ 2. Follow the project's existing output convention. If none exists, write to `.cache/html/<descriptive-name>.html`.
20
+ 3. Prefer one self-contained HTML file with inline CSS and JavaScript so it can be opened or previewed without a build step.
21
+ 4. Use semantic HTML, responsive layout, keyboard-accessible controls, visible focus states, and stable dimensions for interactive elements.
22
+ 5. Use restrained styling suited to the domain. Keep diagrams and panels scannable; do not hide important information behind interaction.
23
+ 6. Escape source code before placing it in `<pre><code>` blocks. Do not alter code identifiers, paths, or quoted source text for presentation.
24
+ 7. Add only interactions that answer a real viewing need: tabs, expand/collapse, search/filter, step-through state, highlighting, or a reset control.
25
+ 8. Keep external dependencies out unless the project already uses them. If a library is necessary, document the dependency and provide a usable fallback when practical.
26
+
27
+ ## Verify and report
28
+
29
+ After writing the file, verify that it exists and contains a complete document. If a preview or dev-server tool is available, start it and check the returned health status before reporting success. Use the preview URL returned by that tool; never present `localhost` as a user-facing online URL when the environment uses a reverse proxy.
30
+
31
+ Respond with a concise Markdown summary and a clickable file path or verified preview URL. Mention any limitation, such as a preview service not being available. Do not paste the entire HTML into the chat unless the user explicitly asks for it.