Skip to content

Commit 45a7425

Browse files
committed
init
0 parents  commit 45a7425

2,381 files changed

Lines changed: 512826 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
name: gen-changesets
3+
description: Use when generating changesets in the pythinker-code repository, including package bump selection, internal package and CLI bundle handling, bump levels, major confirmation, and English changelog wording.
4+
---
5+
6+
# Generate Changesets
7+
8+
`pythinker-code` uses changesets to manage versions and changelogs. The current user-facing published package is:
9+
10+
- `@pythoughts/pythinker-code`: the CLI
11+
12+
All other `@pythoughts/*` packages are treated as internal packages, including `@pythoughts/pythinker-code-sdk`, `agent-core`, `kosong`, `kaos`, `pythinker-code-oauth`, `pythinker-telemetry`, and `migration-legacy`.
13+
14+
## Core Rules
15+
16+
1. **Inspect the actual changes first.** Use `git status` / `git diff --name-only` to identify which packages were actually changed.
17+
2. **List packages that changesets can release.** If a changed package is ignored in `.changeset/config.json`, do not put that ignored package in frontmatter together with a non-ignored package; changesets rejects mixed ignored/non-ignored frontmatter.
18+
3. **Map ignored internal changes to the affected released package.** If an ignored internal package changes CLI output or behavior, list `@pythoughts/pythinker-code` and describe the actual user-visible or release-artifact change in the changelog text.
19+
4. **Internal package source changes that enter the CLI bundle must manually list the CLI.** `@pythoughts/pythinker-code` inline-bundles `@pythoughts/*` source, but those internal packages are devDependencies from the CLI's perspective, so changesets will not automatically propagate bumps. If a change enters the CLI output, list `@pythoughts/pythinker-code`.
20+
- **Web app (`@pythoughts/pythinker-web`) changes always enter the CLI bundle.** `@pythoughts/pythinker-web` is ignored by changesets (see `.changeset/config.json`) and cannot be mixed with `@pythoughts/pythinker-code` in one changeset frontmatter. Describe the web change in the changelog text, but list `@pythoughts/pythinker-code` so the CLI release carries the bundled `dist-web` output.
21+
5. **Docs-only and tests-only changes usually do not need a changeset.** README, internal docs, and `test/` changes that do not enter package output do not trigger a CLI bump.
22+
6. `@pythoughts/dashboard` / `dashboard-server` / `dashboard-web` are ignored by changesets and should not be handled.
23+
24+
## Workflow
25+
26+
1. List the changed packages and check whether each one is ignored by `.changeset/config.json`.
27+
2. Choose a bump level for each package.
28+
3. If an ignored internal package change enters the CLI bundle, put `@pythoughts/pythinker-code` in frontmatter instead of mixing the ignored package into the same changeset.
29+
4. Create a short kebab-case file under `.changeset/`.
30+
5. Split unrelated changes into separate changesets; keep one logical change in one file.
31+
32+
Format:
33+
34+
```markdown
35+
---
36+
"<package A>": patch
37+
"<package B>": minor
38+
---
39+
40+
<English changelog entry>
41+
```
42+
43+
## Bump Levels
44+
45+
| Level | When to use |
46+
|---|---|
47+
| `patch` | Bug fixes; build/package fixes; internal refactors that do not change behavior; wording tweaks; small dependency upgrades |
48+
| `minor` | New backwards-compatible features or capabilities |
49+
| `major` | Breaking changes: incompatible config changes, renamed or removed commands/arguments, behavior semantics changes, and similar |
50+
51+
### Major Rule
52+
53+
Never write `major` on your own.
54+
55+
If you believe a change qualifies as major, stop first, explain why, and ask the user for confirmation. Only write `major` after the user explicitly agrees. If the user does not reply, replies ambiguously, or disagrees, fall back to `minor`; if `minor` is also unclear, fall back to `patch`.
56+
57+
## Wording Rules
58+
59+
- Changelog entries **must be written in English**.
60+
- **Keep it short — ideally a single sentence that states what was done.** Do not write a paragraph, do not pile on technical detail, and do not enumerate every sub-change.
61+
- User-facing CLI wording should only be used when CLI users can perceive the change.
62+
- Internal changes that do not affect CLI users can still share a changeset with the CLI, but the wording must describe the real change honestly and must not present it as a user-facing feature.
63+
- Do not mention file names, class names, function names, PR numbers, or commit hashes.
64+
- Do not include real internal endpoints, key names, account names, or service names. If an example is needed, use neutral placeholders such as `example.com`, `example.test`, or `YOUR_API_KEY`.
65+
- Avoid vague words such as `refactor`, `optimize`, and `improve`. Describe the actual change, or use more specific wording.
66+
67+
## Common Examples
68+
69+
An internal package fixes a bug visible to CLI users:
70+
71+
```markdown
72+
---
73+
"@pythoughts/pythinker-code": patch
74+
---
75+
76+
Fix occasional loss of tool call results in long conversations.
77+
```
78+
79+
An internal package has an internal-only change, but it enters the CLI bundle:
80+
81+
```markdown
82+
---
83+
"@pythoughts/pythinker-code": patch
84+
---
85+
86+
Unify tool execution metadata handling.
87+
```
88+
89+
Only SDK source changed, and the CLI does not use it:
90+
91+
```markdown
92+
---
93+
"@pythoughts/pythinker-code-sdk": patch
94+
---
95+
96+
Clarify session status typing for internal SDK callers.
97+
```
98+
99+
## Web app changes
100+
101+
`@pythoughts/pythinker-web` is ignored by changesets and must **never** appear in a changeset frontmatter. Because the web app is bundled into the CLI release artifact, any web change that ships must list `@pythoughts/pythinker-code` instead and describe the actual web-facing change in the text.
102+
103+
- If a PR contains both web UI changes and server API changes, split them into separate changesets so each entry has a focused description.
104+
- Do not enumerate every micro-tweak; keep it to one sentence that captures what the web user gets.
105+
106+
Web-only fix:
107+
108+
```markdown
109+
---
110+
"@pythoughts/pythinker-code": patch
111+
---
112+
113+
Fix the web chat not scrolling to the bottom after sending a message.
114+
```
115+
116+
Web UI plus server APIs in the same PR (split into two changesets):
117+
118+
```markdown
119+
---
120+
"@pythoughts/pythinker-code": minor
121+
---
122+
123+
Add the server-hosted web UI, including chat layout and session list behaviors.
124+
```
125+
126+
```markdown
127+
---
128+
"@pythoughts/pythinker-code": minor
129+
---
130+
131+
Add the server REST and WebSocket APIs that power the web UI.
132+
```
133+
134+
## Red Flags
135+
136+
- You are about to write `major` without asking the user.
137+
- Internal package source enters the CLI bundle, but `@pythoughts/pythinker-code` is missing.
138+
- A changeset frontmatter mixes ignored internal packages with non-ignored packages.
139+
- `packages/node-sdk` was not changed, but `@pythoughts/pythinker-code-sdk` was listed for "internal package sync".
140+
- The changelog entry is in Chinese.
141+
- The wording claims more than the diff actually did.
142+
- The CLI wording mentions internal package names, class names, or PR numbers.
143+
- The entry includes real internal identifiers instead of neutral placeholders.

.agents/skills/gen-docs/SKILL.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: gen-docs
3+
description: Update Pythinker Code CLI user documentation after meaningful code changes that affect product behavior or user experience.
4+
---
5+
6+
# Gen Docs
7+
8+
## Overview
9+
10+
This repository maintains English user documentation under `docs/`.
11+
12+
Use this skill to update the corresponding documentation whenever the codebase has changes that affect product behavior or user experience.
13+
14+
For a **full pre-release audit** of all pages (detecting hallucinations and coverage gaps), use the `audit-docs` skill instead.
15+
16+
## Prerequisites
17+
18+
This skill depends on the following being in place. If any are missing, stop and report to the user before continuing:
19+
20+
- `docs/` directory with documentation pages and `docs/.vitepress/config.ts` set up (VitePress site).
21+
- `docs/AGENTS.md` style guide — defines terminology, typography, and writing style.
22+
23+
## Workflow
24+
25+
1. **Inspect changes**
26+
27+
- `git log main..HEAD --oneline` — commits on the current branch
28+
- `git diff main..HEAD --stat` — file-level scope
29+
- `ls .changeset/*.md` (excluding `README.md`) — pending changeset entries
30+
- Read `CHANGELOG.md` and any subpackage `packages/*/CHANGELOG.md` for already-recorded entries.
31+
32+
2. **Understand user-facing impact**
33+
34+
For each change, read the actual implementation when needed; **do not infer behavior from commit messages or PR titles alone**. Skip:
35+
36+
- Internal refactors with no externally visible behavior change
37+
- Tests, CI, type-only changes
38+
- Tooling / build-system changes that do not change how users invoke the CLI
39+
40+
If after the scan you conclude there is no user-facing impact, say so and stop.
41+
42+
3. **Keep release changelog syncing separate**
43+
44+
Do not copy unreleased changesets into `docs/release-notes/changelog.md`. After a release is published, use the `sync-changelog` skill to sync `apps/pythinker-code/CHANGELOG.md` into the docs site with release dates and section classification.
45+
46+
4. **Update user docs**
47+
48+
Following the rules in `docs/AGENTS.md`, edit the affected pages under `docs/`. Match terminology with the term table in `docs/AGENTS.md` and the existing wording in surrounding pages.
49+
50+
Cover all relevant sections:
51+
52+
- Guides (getting-started, use cases, interaction, sessions, IDE integration)
53+
- Customization (skills, agents, MCP, hooks, plugins, etc.)
54+
- Configuration (config files, env vars, providers, data locations)
55+
- Reference (CLI subcommands, slash commands, keyboard shortcuts)
56+
- Release notes (`docs/release-notes/breaking-changes.md` if a breaking change is involved)
57+
58+
## Rules and conventions
59+
60+
- **Terminology**: Use the term table in `docs/AGENTS.md` exactly. Do not invent synonyms.
61+
- **Scope discipline**: Only update sections affected by the recent changes. Do not opportunistically rewrite unrelated docs.
62+
- **Public examples**: Never write real internal endpoints, key names, account names, or service names into docs. Use neutral placeholders such as `https://api.example.com/v1`, `https://registry.example.com/v1/models/api.json`, `example.test`, and `YOUR_API_KEY`.
63+
- **Breaking changes**: If any change is breaking, also update `docs/release-notes/breaking-changes.md` (under `## Unreleased`) with `**Affected**` + `**Migration**` subsections.
64+
- **Do not edit auto-synced files**: `docs/release-notes/changelog.md` is regenerated by the sync script; any manual edit will be overwritten.
65+
66+
## Common mistakes
67+
68+
- Describing what code changed instead of what the user can now do (or can no longer do).
69+
- Adding a new section heading per feature instead of weaving the change into existing prose.

.agents/skills/opentui/SKILL.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
name: opentui
3+
description: Build terminal UIs with OpenTUI. Covers core, components, audio, keymaps, React, Solid, plugins, testing, standalone executables, QR encoding, SSH, and Three.js WebGPU.
4+
---
5+
6+
# OpenTUI Skill
7+
8+
Canonical reference docs are authored once in sibling `docs/**/*.mdx` files.
9+
10+
Inside the OpenTUI repo, this skill root lives at `packages/web/src/content/`, so the same files are also visible at `packages/web/src/content/docs/**/*.mdx`.
11+
12+
## Path invariant
13+
14+
- `/docs/<slug>` maps to `docs/<slug>.mdx` relative to this skill root
15+
- in the repo, that same slug maps to `packages/web/src/content/docs/<slug>.mdx`
16+
17+
## Reading order by area
18+
19+
- Getting started: `/docs/getting-started`
20+
- Core: `/docs/core-concepts/renderer`
21+
- Testing: `/docs/core-concepts/testing`
22+
- Audio: `/docs/core-concepts/audio`
23+
- Keymap: `/docs/keymap/overview`
24+
- React: `/docs/bindings/react`
25+
- Solid: `/docs/bindings/solid`
26+
- Components: `/docs/components/text`, `/docs/components/input`
27+
- Layout: `/docs/core-concepts/layout`
28+
- Keyboard: `/docs/core-concepts/keyboard`
29+
- Plugins: `/docs/plugins/slots`
30+
- Runtime and packaging: `/docs/reference/env-vars`, `/docs/reference/standalone-executables`
31+
- Package entrypoints: `/docs/reference/package-entrypoints`
32+
- QR encoding: `/docs/reference/qr-encoder`
33+
- SSH: `/docs/reference/ssh`
34+
- Three.js WebGPU: `/docs/reference/three`
35+
36+
## Quick routing by intent
37+
38+
| Intent(s) | Start here |
39+
| -------------------------------------------------------------------------------------------------- | ------------------------------------------- |
40+
| `getting-started`, `installation`, `quickstart`, `intro` | `docs/getting-started.mdx` |
41+
| `core`, `renderer`, `terminal`, `scrollback`, `lifecycle` | `docs/core-concepts/renderer.mdx` |
42+
| `audio`, `native-audio`, `sound`, `playback`, `streaming`, `radio`, `mp3`, `flac`, `pcm`, `fft` | `docs/core-concepts/audio.mdx` |
43+
| `keymap`, `keybindings`, `shortcuts`, `commands`, `leader`, `ex-commands` | `docs/keymap/overview.mdx` |
44+
| `layout`, `flexbox`, `yoga`, `positioning` | `docs/core-concepts/layout.mdx` |
45+
| `keyboard`, `input`, `keybindings`, `paste`, `focus` | `docs/core-concepts/keyboard.mdx` |
46+
| `testing`, `test-renderer`, `snapshots`, `frames` | `docs/core-concepts/testing.mdx` |
47+
| `react`, `jsx`, `hooks`, `keyboard`, `paste`, `focus`, `blur`, `selection`, `animation`, `testing` | `docs/bindings/react.mdx` |
48+
| `solid`, `jsx`, `signals`, `hooks`, `keyboard`, `animation`, `testing` | `docs/bindings/solid.mdx` |
49+
| `plugins`, `plugin`, `slots`, `registry`, `extensions` | `docs/plugins/slots.mdx` |
50+
| `text`, `styling`, `content`, `selection` | `docs/components/text.mdx` |
51+
| `input`, `form`, `editing`, `focus` | `docs/components/input.mdx` |
52+
| `env`, `environment`, `configuration`, `flags` | `docs/reference/env-vars.mdx` |
53+
| `standalone`, `executable`, `bun-compile`, `node-sea`, `node-assets` | `docs/reference/standalone-executables.mdx` |
54+
| `package-exports`, `entrypoints`, `subpath-exports`, `imports` | `docs/reference/package-entrypoints.mdx` |
55+
| `qr`, `qrcode`, `qr-encoder`, `svg-qr`, `gs1`, `eci`, `structured-append` | `docs/reference/qr-encoder.mdx` |
56+
| `ssh`, `remote-tui`, `ssh-server`, `authentication`, `middleware` | `docs/reference/ssh.mdx` |
57+
| `three`, `threejs`, `webgpu`, `3d`, `sprites`, `physics` | `docs/reference/three.mdx` |
58+
59+
For concrete component requests, jump straight to `docs/components/<name>.mdx` after the relevant entry page. For plugin implementation details, narrow from `docs/plugins/slots.mdx` into `docs/plugins/core.mdx`, `docs/plugins/react.mdx`, or `docs/plugins/solid.mdx`.
60+
61+
## Current skill entry pages
62+
63+
- `docs/getting-started.mdx`
64+
- `docs/core-concepts/renderer.mdx`
65+
- `docs/core-concepts/audio.mdx`
66+
- `docs/core-concepts/testing.mdx`
67+
- `docs/keymap/overview.mdx`
68+
- `docs/core-concepts/layout.mdx`
69+
- `docs/core-concepts/keyboard.mdx`
70+
- `docs/bindings/react.mdx`
71+
- `docs/bindings/solid.mdx`
72+
- `docs/plugins/slots.mdx`
73+
- `docs/components/text.mdx`
74+
- `docs/components/input.mdx`
75+
- `docs/reference/env-vars.mdx`
76+
- `docs/reference/standalone-executables.mdx`
77+
- `docs/reference/package-entrypoints.mdx`
78+
- `docs/reference/qr-encoder.mdx`
79+
- `docs/reference/ssh.mdx`
80+
- `docs/reference/three.mdx`
81+
82+
## Working rules
83+
84+
- Prefer the current entry pages first, then read narrower docs in the same section.
85+
- Read the sibling `docs/**/*.mdx` files directly instead of copying prose into this file.
86+
- Use stable `/docs/...` URLs when cross-referencing docs.

0 commit comments

Comments
 (0)