Skip to content

Conversation

@jakedahn
Copy link
Contributor

@jakedahn jakedahn commented Oct 6, 2025

Summary by cubic

Migrates the tutorials into the repo and sets up automated MyST docs builds and deployment to docs.commontools.dev. Adds PR validation builds and publishes on pushes to main and migrate-tutorials.

  • New Features

    • Adds MyST-powered tutorials (install, LLM built-in, state, Common UI, CTS) with images and code samples.
    • Configures MyST project and npm scripts in tutorials/.
    • Introduces GitHub Actions workflow to build and deploy docs to GitHub Pages.
    • Adds CNAME for docs.commontools.dev and optional Netlify config.
  • Migration

    • Docs use Node.js tooling; run npm ci and npm run dev in tutorials/ for local work.
    • PRs build for validation; deployment runs on push to main and migrate-tutorials.
    • No impact on the Deno runtime; documentation is isolated under tutorials/.

jakedahn and others added 4 commits October 6, 2025 10:33
- Create deploy-docs.yml workflow to build and deploy MyST docs
- Trigger on main branch changes to tutorials/ directory
- Configure MyST for docs.commontools.dev custom domain
- Add CNAME file for GitHub Pages custom domain
- Document build process in README_BUILD.md
- Update MyST config with project metadata and base URL

The workflow uses Node.js for MyST builds (separate from Deno codebase)
and deploys static documentation to GitHub Pages automatically.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add migrate-tutorials branch to workflow triggers
- Enable workflow for pull requests (build-only)
- Restrict deployment to push events on main and migrate-tutorials
- PRs will build but not deploy (validation only)

This allows testing the deployment from the migration branch before merging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jakedahn jakedahn closed this Oct 6, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 issues found across 35 files

Prompt for AI agents (all 10 issues)

Understand the root cause of the following 10 issues and fix them.


<file name="tutorials/cts.md">

<violation number="1" location="tutorials/cts.md:9">
Fix the typo in the abstract: &quot;succint&quot; should be &quot;succinct&quot;.</violation>
</file>

<file name="tutorials/common_ui.md">

<violation number="1" location="tutorials/common_ui.md:266">
`ct-screen` only exposes `header` and `footer` named slots, so using `slot=&quot;top&quot;` here prevents the toolbar from rendering. Please use the `header` slot instead.</violation>

<violation number="2" location="tutorials/common_ui.md:274">
`ct-spacer` hasn’t been implemented yet, so this example should use an available spacer alternative to avoid a broken sample.</violation>

<violation number="3" location="tutorials/common_ui.md:310">
The keyboard component is named `ct-kbd`, not `ct-kdb`; please fix the typo so the docs reference the real element.</violation>
</file>

<file name="tutorials/state.md">

<violation number="1" location="tutorials/state.md:27">
Add the missing `);` so the second code sample remains valid TypeScript; otherwise readers copying it will hit a syntax error.</violation>
</file>

<file name="tutorials/myst.yml">

<violation number="1" location="tutorials/myst.yml:8">
The project.github link targets jakedahn/common, so the “Edit on GitHub” links generated by MyST will go to the wrong repository. Update this to the current commontoolsinc/labs/tutorials path so docs readers aren’t sent to the wrong repo.</violation>
</file>

<file name="tutorials/README.md">

<violation number="1" location="tutorials/README.md:3">
Running `myst` without a subcommand just prints the CLI help, so this quickstart won’t launch the local docs server. Replace it with `myst start` to match the working command used in the project scripts.</violation>
</file>

<file name="tutorials/package.json">

<violation number="1" location="tutorials/package.json:7">
The `clean` script uses `|| true` to swallow errors, but `true` is a POSIX utility and is missing on Windows, causing `npm run clean` to fail there. Replace the fallback with a cross-platform no-op such as `node -e &quot;process.exit(0)&quot;`.</violation>
</file>

<file name="tutorials/README_BUILD.md">

<violation number="1" location="tutorials/README_BUILD.md:12">
This bullet implies that only pushes to main deploy the docs, but the workflow also deploys when migrate-tutorials is pushed. Please update the documentation to mention both branches.</violation>
</file>

<file name=".github/workflows/deploy-docs.yml">

<violation number="1" location=".github/workflows/deploy-docs.yml:54">
Insert an actions/configure-pages step before uploading the artifact; otherwise actions/upload-pages-artifact will fail because Pages was never configured.</violation>
</file>


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

keywords: commontools, recipes, cts, types
abstract: |
The CTS (Common Type System) helps automatically convert types and common
coding patterns for you. This leads to more readable and succint code.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the typo in the abstract: "succint" should be "succinct".

Prompt for AI agents
Address the following comment on tutorials/cts.md at line 9:

<comment>Fix the typo in the abstract: &quot;succint&quot; should be &quot;succinct&quot;.</comment>

<file context>
@@ -0,0 +1,15 @@
+keywords: commontools, recipes, cts, types
+abstract: |
+  The CTS (Common Type System) helps automatically convert types and common
+  coding patterns for you. This leads to more readable and succint code.
+  In this section, we will go over the basic features offered by CTS.
+---
</file context>
Suggested change
coding patterns for you. This leads to more readable and succint code.
coding patterns for you. This leads to more readable and succinct code.
Fix with Cubic

<ct-hstack gap="sm">
<icon>question</icon>
<button>hello</button>
<ct-spacer />
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ct-spacer hasn’t been implemented yet, so this example should use an available spacer alternative to avoid a broken sample.

Prompt for AI agents
Address the following comment on tutorials/common_ui.md at line 274:

<comment>`ct-spacer` hasn’t been implemented yet, so this example should use an available spacer alternative to avoid a broken sample.</comment>

<file context>
@@ -0,0 +1,365 @@
+            &lt;ct-hstack gap=&quot;sm&quot;&gt;
+                &lt;icon&gt;question&lt;/icon&gt;
+                &lt;button&gt;hello&lt;/button&gt;
+                &lt;ct-spacer /&gt;
+                &lt;button&gt;hello&lt;/button&gt;
+            &lt;/ct-hstack&gt;
</file context>
Fix with Cubic

- gap: `ct-icon` (and `ct-label` has an optional in-built icon)
- gap: icon set?

- visual: `ct-kdb`, `ct-separator`, `ct-table`, `ct-tool-call`
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The keyboard component is named ct-kbd, not ct-kdb; please fix the typo so the docs reference the real element.

Prompt for AI agents
Address the following comment on tutorials/common_ui.md at line 310:

<comment>The keyboard component is named `ct-kbd`, not `ct-kdb`; please fix the typo so the docs reference the real element.</comment>

<file context>
@@ -0,0 +1,365 @@
+- gap: `ct-icon` (and `ct-label` has an optional in-built icon)
+    - gap: icon set?
+
+- visual: `ct-kdb`, `ct-separator`, `ct-table`, `ct-tool-call`
+	- gap: `ct-img` or `ct-media`
+
</file context>
Suggested change
- visual: `ct-kdb`, `ct-separator`, `ct-table`, `ct-tool-call`
- visual: `ct-kbd`, `ct-separator`, `ct-table`, `ct-tool-call`
Fix with Cubic


```{code-block} html
<ct-screen>
<ct-toolbar slot="top">
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ct-screen only exposes header and footer named slots, so using slot="top" here prevents the toolbar from rendering. Please use the header slot instead.

Prompt for AI agents
Address the following comment on tutorials/common_ui.md at line 266:

<comment>`ct-screen` only exposes `header` and `footer` named slots, so using `slot=&quot;top&quot;` here prevents the toolbar from rendering. Please use the `header` slot instead.</comment>

<file context>
@@ -0,0 +1,365 @@
+
+```{code-block} html
+&lt;ct-screen&gt;
+    &lt;ct-toolbar slot=&quot;top&quot;&gt;
+        &lt;ct-button&gt;hello&lt;/ct-button&gt;
+    &lt;/ct-toolbar&gt;
</file context>
Suggested change
<ct-toolbar slot="top">
<ct-toolbar slot="header">
Fix with Cubic

```{code-block} typescript
export default recipe("state test", () => {
const characterName = cell<string>("");
}
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the missing ); so the second code sample remains valid TypeScript; otherwise readers copying it will hit a syntax error.

Prompt for AI agents
Address the following comment on tutorials/state.md at line 27:

<comment>Add the missing `);` so the second code sample remains valid TypeScript; otherwise readers copying it will hit a syntax error.</comment>

<file context>
@@ -0,0 +1,230 @@
+```{code-block} typescript
+export default recipe(&quot;state test&quot;, () =&gt; {
+  const characterName = cell&lt;string&gt;(&quot;&quot;);
+}
+```
+Here, we have created a cell with a type argument of `string`,
</file context>
Suggested change
}
});
Fix with Cubic

title: Guide to the Common Tools Runtime
description: Documentation and tutorials for the Common Tools runtime and framework
keywords: [commontools, runtime, tutorials, documentation]
github: https://github.com/jakedahn/common/tree/main/labs
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project.github link targets jakedahn/common, so the “Edit on GitHub” links generated by MyST will go to the wrong repository. Update this to the current commontoolsinc/labs/tutorials path so docs readers aren’t sent to the wrong repo.

Prompt for AI agents
Address the following comment on tutorials/myst.yml at line 8:

<comment>The project.github link targets jakedahn/common, so the “Edit on GitHub” links generated by MyST will go to the wrong repository. Update this to the current commontoolsinc/labs/tutorials path so docs readers aren’t sent to the wrong repo.</comment>

<file context>
@@ -0,0 +1,28 @@
+  title: Guide to the Common Tools Runtime
+  description: Documentation and tutorials for the Common Tools runtime and framework
+  keywords: [commontools, runtime, tutorials, documentation]
+  github: https://github.com/jakedahn/common/tree/main/labs
+  # To autogenerate a Table of Contents, run &quot;myst init --write-toc&quot;
+  toc:
</file context>
Suggested change
github: https://github.com/jakedahn/common/tree/main/labs
github: https://github.com/commontoolsinc/labs/tree/main/tutorials
Fix with Cubic

@@ -0,0 +1,14 @@
# Tutorials

Install MyST Markdown tooling by following https://mystmd.org/guide/installing. Once set up, run `myst` in this directory to serve the tutorial pages locally.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running myst without a subcommand just prints the CLI help, so this quickstart won’t launch the local docs server. Replace it with myst start to match the working command used in the project scripts.

Prompt for AI agents
Address the following comment on tutorials/README.md at line 3:

<comment>Running `myst` without a subcommand just prints the CLI help, so this quickstart won’t launch the local docs server. Replace it with `myst start` to match the working command used in the project scripts.</comment>

<file context>
@@ -0,0 +1,14 @@
+# Tutorials
+
+Install MyST Markdown tooling by following https://mystmd.org/guide/installing. Once set up, run `myst` in this directory to serve the tutorial pages locally.
+
+## npm quickstart
</file context>
Suggested change
Install MyST Markdown tooling by following https://mystmd.org/guide/installing. Once set up, run `myst` in this directory to serve the tutorial pages locally.
Install MyST Markdown tooling by following https://mystmd.org/guide/installing. Once set up, run `myst start` in this directory to serve the tutorial pages locally.
Fix with Cubic

"version": "0.0.1",
"scripts": {
"build": "myst build --html",
"clean": "myst clean --cache || true",
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clean script uses || true to swallow errors, but true is a POSIX utility and is missing on Windows, causing npm run clean to fail there. Replace the fallback with a cross-platform no-op such as node -e "process.exit(0)".

Prompt for AI agents
Address the following comment on tutorials/package.json at line 7:

<comment>The `clean` script uses `|| true` to swallow errors, but `true` is a POSIX utility and is missing on Windows, causing `npm run clean` to fail there. Replace the fallback with a cross-platform no-op such as `node -e &quot;process.exit(0)&quot;`.</comment>

<file context>
@@ -0,0 +1,13 @@
+  &quot;version&quot;: &quot;0.0.1&quot;,
+  &quot;scripts&quot;: {
+    &quot;build&quot;: &quot;myst build --html&quot;,
+    &quot;clean&quot;: &quot;myst clean --cache || true&quot;,
+    &quot;dev&quot;: &quot;myst start&quot;
+  },
</file context>
Suggested change
"clean": "myst clean --cache || true",
"clean": "myst clean --cache || node -e \"process.exit(0)\"",
Fix with Cubic

## GitHub Actions Deployment

The documentation is automatically built and deployed via GitHub Actions when:
- Changes are pushed to the `main` branch
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bullet implies that only pushes to main deploy the docs, but the workflow also deploys when migrate-tutorials is pushed. Please update the documentation to mention both branches.

Prompt for AI agents
Address the following comment on tutorials/README_BUILD.md at line 12:

<comment>This bullet implies that only pushes to main deploy the docs, but the workflow also deploys when migrate-tutorials is pushed. Please update the documentation to mention both branches.</comment>

<file context>
@@ -0,0 +1,53 @@
+## GitHub Actions Deployment
+
+The documentation is automatically built and deployed via GitHub Actions when:
+- Changes are pushed to the `main` branch
+- The changes affect files in the `tutorials/` directory
+- Or when manually triggered via workflow dispatch
</file context>
Suggested change
- Changes are pushed to the `main` branch
- Changes are pushed to the `main` or `migrate-tutorials` branches
Fix with Cubic

- name: Copy CNAME to build directory
run: cp tutorials/CNAME tutorials/_build/html/CNAME

- name: Upload artifact
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insert an actions/configure-pages step before uploading the artifact; otherwise actions/upload-pages-artifact will fail because Pages was never configured.

Prompt for AI agents
Address the following comment on .github/workflows/deploy-docs.yml at line 54:

<comment>Insert an actions/configure-pages step before uploading the artifact; otherwise actions/upload-pages-artifact will fail because Pages was never configured.</comment>

<file context>
@@ -0,0 +1,70 @@
+      - name: Copy CNAME to build directory
+        run: cp tutorials/CNAME tutorials/_build/html/CNAME
+
+      - name: Upload artifact
+        uses: actions/upload-pages-artifact@v3
+        with:
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants