ntn-skills 0.2.0 → 2.0.0

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,85 +1,15 @@
1
1
  # Changelog
2
2
 
3
- ## 0.2.0 — 2026-10-14
4
-
5
- Current-target reads now reuse complete observations for up to five minutes, and catalogs for up to 60 seconds. Callers that require immediate remote validation must use `--refresh`; pinned snapshot reads remain immutable and offline. Preserve existing configuration/state when upgrading; disposable observations now use the separate cache root.
6
-
7
- - Read skills from databases with rich-text Description and References, without requiring native Skills exports.
8
- - Materialize reference pages as relative Markdown files, preserve links through create/import/write/export, and include referenced-page edits in version conflicts.
9
- - Create editable reference child pages during imports and retain omitted pages in Notion while excluding them from new snapshots and exports.
10
- - Support page-only libraries without Files, with normalized Markdown and repeat imports that reuse existing pages; optional Files retains exact source bytes and other assets.
11
- - Report the selected storage mode in doctor and update CLI help, both READMEs, protocol and Agent integration references.
12
- - Resume interrupted reference imports using existing child-page IDs, reject duplicate paths, and normalize equivalent relative links when comparing page-only content.
13
- - Report safe transport failure reasons without exposing raw stderr, credentials or signed URLs; preserve unknown write outcomes.
14
- - Retry transient read/query transport and service failures up to three times with bounded backoff; mutation requests are never retried automatically.
15
- - Recover transient References attachment downloads with scoped timeouts and bounded retry; reject denied access without retry or signed URL disclosure.
16
- - Add repository-local verification recipes and command-to-case coverage with isolated config/state/cache and XDG bases, preserved evidence and system-Trash cleanup.
17
- - Limit npm documentation files to the explicit public guide set; keep implementation designs and verification maps repository-only without broken package-relative links.
18
- - Add `sync bind/status/plan/apply/reconcile/unbind`, immutable checked plans, per-binding common baselines, grouped multi-target distribution and durable partial/unknown-operation recovery without replaying mutations.
19
- - Resolve local directory, parent and per-file symlink chains; preserve links on writes, reject saved-target drift at commit guards, retain removed/replaced bytes and fence cooperating processes. Native Node filesystem calls retain a documented check-to-syscall race.
20
- - Change current reads to complete bounded observations: 5m Skill and 60s catalog defaults, mutually exclusive `--refresh`/`--offline`/`--max-age`, explicit source/freshness metadata and unchanged immutable pinned reads. Writes, sync and doctor still validate online.
21
- - Add XDG/application cache roots, cache-only status/retirement and configurable cache policy; preserve configuration, bindings, baselines, plans, receipts, immutable snapshots and content objects through cache cleanup/upgrade.
22
- - Add `import --target` for verified whole-Skill replacement on one existing page, preserving page identity across rename and rejecting stale, missing or non-main targets without creation fallback.
23
- - Run CI on Ubuntu/macOS 15 and Node.js 22/24 through the package verification controller, retain consumer evidence/tarballs as artifacts, and exercise explicit Linux retention failure without losing cached bytes.
24
- - Fence the entire content/catalog retirement batch before system Trash operations, so unavailable retention preserves bytes without exposing later observations or accepting delayed publishers.
25
-
26
- ## 0.1.3 — 2026-10-14
27
-
28
- - Wait for the npm attestation document to become available after registry metadata appears.
29
- - Give each CLI boundary scenario its own test timeout.
30
-
31
- ## 0.1.2 — 2026-10-14
32
-
33
- - Publish from GitHub Actions with npm OIDC; verify provenance for public repositories and registry evidence for private repositories.
34
- - Simplify installation and release documentation.
35
-
36
- ## 0.1.0 — 2026-10-14
37
-
38
- Initial npm release, published with maintainer web authentication.
39
-
40
- ### Public repository baseline
41
-
42
- - Set the public npm package name to `ntn-skills`, matching the executable and bootstrap Skill; retain the `notion-skills-cli` source repository.
43
- - Add equivalent English and Simplified Chinese READMEs with a centered header, language switch and section navigation; package both language files.
44
- - Move detailed operations into the [usage guide](docs/usage.md), and document source-access and release status.
45
- - Separate consumer installation and use from contributor source/build steps in both READMEs; consumers install a built tarball with npm and run on Node.js 22.19.0 or newer.
46
- - Replace the Bun runtime platform, executable shebang and distribution target with Node.js; keep Bun 1.4.3 for development/build/tests, and exercise npm consumers on Node.js 22 and 24 in CI.
47
- - Add an English installation and first-read walkthrough, tarball consumption, upgrade and uninstall instructions, and explicit runtime/platform evidence boundaries in [README](README.md).
48
- - Document metadata freshness separately from retained snapshots and upload staging, inherited workspace/API endpoint settings, network behavior and optional local data cleanup across the [protocol](docs/protocol.md), [host integration](docs/host-integration.md) and [Skill reference](skills/ntn-skills/references/integration.md).
49
- - Use the returned snapshot ID to list every attachment; a pinned file ref filters only its own path.
50
- - Set the public issue and private vulnerability-reporting channels, security support for the latest patch of the current 0.x series, and a seven-day acknowledgement target without a promised fix deadline in [SECURITY](SECURITY.md).
51
- - Define 0.x compatibility, deprecation migration guidance and fast-forward integration in [CONTRIBUTING](CONTRIBUTING.md), and prepare the package/release metadata and CI release lane.
52
- - Update production archive dependency `fflate` to 0.8.3.
53
-
54
- ### Initial 0.1.0 functionality
55
-
56
- - Add Bun development monorepo with a Node.js CLI using Effect 4.0.4, platform services, schemas, and scoped ntn transport.
57
- - Discover accessible typed Skills Databases with explicit search coverage and registered-source supplementation.
58
- - Resolve exact skill names, metadata-derived aliases, page IDs, and page URLs; return structured missing/ambiguous/incomplete errors.
59
- - Read immutable export snapshots one file at a time, including line ranges, UTF-8 BOM text, and explicit binary output.
60
- - Support skill:// refs, pinned snapshots, and relative reference resolution.
61
- - Ship ntn-skills bootstrap Skill, host integration contract, contributor/security policies, and reproducible CI checks.
62
- - Keep parser failures machine-readable, with optional Boolean switches and no interactive wizard.
63
- - Bound rate-limit retries and validate Notion error responses with Schema.
64
- - Package docs and bundled dependency licenses, and check formatting with pinned Biome.
65
- - Store global source configuration under ~/.config/ntn-skills with XDG_CONFIG_HOME and NTN_SKILLS_CONFIG_HOME overrides; migrate legacy registrations once and retain a backup without moving snapshots.
66
- - Require English-letter Notion titles with single spaces and derive the invocation name by lowercasing and replacing spaces with hyphens; validate matching export frontmatter and preserve historical snapshot reads.
67
- - Make root and command help self-contained for agents with argument/flag descriptions, online/offline modes, usage examples, output conventions, storage and error-recovery guidance.
68
- - Add create/write with dry runs, shared targets, pinned-version conflict detection, verified snapshots and explicit partial/unknown outcomes; preserve nested paths and extra metadata in the source ZIP.
69
- - Add config.default_database and config show/set-default/clear-default; create selects an explicit database, the configured default, or the sole discovered Skills Database. Preserve the default when adding sources and reject ambiguous/incomplete discovery.
70
- - Add import for a local ZIP, folder or any .md/.markdown filename, with one-Skill entrypoint selection, name/description overrides, bounded ZIP decoding, preserved attachment bytes, dry runs and verified new snapshots.
71
- - Preserve initial H1 headings on create/import by writing Markdown after page creation and compare normalized write responses with page readback and exported content.
72
- - Add complete ZIP/directory export with offline pinned refs, a versioned portable manifest, deterministic archive bytes, content digests and reuse/conflict handling for existing output.
73
- - Preserve imported source bytes, arbitrary Markdown filenames, extra frontmatter and nested supporting files in a retained source ZIP; reconstruct current edits without changing historical snapshots.
74
- - Make create pure creation with CREATE_CONFLICT on an existing invocation name; import creates absent names, reuses identical content or replaces different content on the same page with version checks.
75
- - Compare page and Skills Markdown across equivalent plain-text code labels and paragraph spacing without discarding blank lines inside fenced code.
76
- - Rename the discovery command from catalog to list; make ntn-skills list the agent-facing entrypoint in help, the bootstrap Skill and host integration, with automatic pagination and metadata-only output.
77
- - Unify read/files/open/write/export targets across names, invocation aliases, page IDs/URLs, refs and snapshot IDs; use --path instead of second positional paths and remove read --snapshot/refresh modes.
78
- - Replace ls with files and databases with database list; database discovery no longer queries Skill rows. List queries match invocation aliases and return compact metadata/count/coverage.
79
- - Reuse identical local read/export output with reused=true; reject differing output with OUTPUT_CONFLICT. Identical writes return unchanged=true without remote mutation.
80
- - Add optional global config.token with priority over NOTION_API_TOKEN and existing ntn login; set via config set-token --stdin, clear offline, preserve other settings and expose only token_configured in configuration output.
81
- - Scope online caches by the selected credential digest; existing pinned snapshots remain readable offline, while pinned writes from an older scope format require a fresh online read.
82
- - Accept Database IDs, URLs and exact registered aliases consistently across --database flags and config set-default; persist defaults as canonical IDs and enforce alias constraints on offline pinned targets.
83
- - Return the queried databases map in list, retain cross-database same-name Skills, and include database maps in ambiguity errors plus owning database labels in failed-source coverage.
84
- - Reject repeated --database values before execution, including identical values and --database=value; explicit help remains offline and takes precedence.
85
- - Accept notion.so URLs alongside notion.com/notion.site when resolving database and page identities.
3
+ All notable changes to `ntn-skills` are documented in this file.
4
+
5
+ ## [2.0.0] - 2026-12-03
6
+
7
+ ### Added
8
+ - **Minimal 3-Table Notion Control Plane**: One-command `ntn-skills init` auto-bootstraps `Sources`, `Skills`, and `Files` tables with bidirectional relations on any blank Notion page.
9
+ - **3-Tier `Visibility` Routing (`always | discoverable | manual`)**:
10
+ - `always`: Top-level host symlinks or managed directory copies;
11
+ - `discoverable`: Auto-synthesized immutable local `skill-catalog` skill sharded by `Scenes`, pinning `Kind = router` strategy routers at the top with pre-materialized `store/` paths for 2-hop zero-plugin `Read` access across any agent host;
12
+ - `manual`: Silent long-tail reserve woken on demand via `$skill`, `skill_find`/`skill_load`, `Requires`, or `ntn-skills load`.
13
+ - **Static `manifest.json` & `ntn-skills status`**: Machine-readable lockfile and governance summary covering Visibility distribution, Notion draft buffer, active upstream overlays, and 30-day local `Hot Loads`.
14
+ - **Three-Stage Skill Evolution**: Local incubation (`new` with automatic in-place adoption), isolated live overlay patching (`edit -> diff --remote -> push` & `reset-overlay`), and lossless Git graduation (`pull --clean`, `attach`, and subtree-pruned `upstream apply` auto-reconciliation).
15
+ - **Built-in Agent Guide & Diagnostics**: `ntn-skills skill` (`--path`, `--install`, `--uninstall`), `ntn-skills doctor`, precise `sync` pulled-diff & local-pending reporting, XDG Base Directory support (`XDG_DATA_HOME` / `XDG_CONFIG_HOME`), and native `launchd` / `systemd` / `dagu` / `github-actions` / `crontab` scheduling.
package/CONTRIBUTING.md CHANGED
@@ -1,54 +1,30 @@
1
- # Contributing
1
+ # Contributing to ntn-skills
2
2
 
3
- ## Development setup
3
+ Thank you for your interest in contributing to `ntn-skills`.
4
4
 
5
- Use Bun 1.4.3 for development and the committed lockfile. The published CLI runs on Node.js 22.19.0 or newer; install Node.js and npm as well for the fresh-consumer checks. Clone the repository, then work from the checkout root:
5
+ ## Prerequisites
6
6
 
7
- ```bash
8
- git clone https://github.com/yoyooyooo/notion-skills-cli.git
9
- cd notion-skills-cli
10
- bun install --frozen-lockfile
11
- bun run dev --help
12
- bun run check && bun run package:check
13
- ```
14
-
15
- Use `bun run dev <command>` to exercise the TypeScript CLI entrypoint directly during development; it uses the default official `ntn` transport without requiring a distribution build.
16
-
17
- For repeatable live verification, read `.cursor/skills/verify-ntn-skills/SKILL.md` and its feature map in the source checkout. Its executable `control.ts` isolates config/state/cache and XDG bases, records real CLI actions and readback, and preserves evidence while moving owned scratch to system Trash. The map routes the [implemented sync/cache design](https://github.com/yoyooyooo/notion-skills-cli/blob/main/docs/sync-cache-cli-design.md) to acceptance cases; case definitions are not passing results. Live mutations require current task authorization; the npm package excludes these repository-local maintenance files, so unpublished changes must be read from the checkout.
7
+ - macOS or Linux
8
+ - `git`
9
+ - [Bun](https://bun.sh) `>= 1.2.0`
18
10
 
19
- Build and pack a consumer artifact from the checkout root:
11
+ ## Development Setup & Verification
20
12
 
21
13
  ```bash
22
- bun run build
23
- node packages/cli/dist/ntn-skills.js --help
24
- mkdir -p release
25
- bun pm pack --cwd packages/cli --destination ../../release
26
- ```
27
-
28
- The archive filename follows the package version. Consumers install that tarball with npm as described in [the README](README.md#installation). Update source with `git pull --ff-only`, reinstall dependencies and rebuild before producing a new tarball.
29
-
30
- `check` runs type checking, formatting checks, tests and the Node.js distribution build. `package:check` validates documentation links, packs the CLI and installs it with npm in a fresh consuming project, then executes the installed binary with Node.js. CI covers Node.js 22 and 24 on Linux and macOS. Run both checks before proposing a pull request or release. Tests must not depend on personal credentials or mutate a live Notion workspace. Keep live verification separate and disclose the environment and authorization used.
31
-
32
- CI uses Ubuntu and macOS 15 with Node.js 22.19.0 and 24. Every job runs the complete deterministic suite, then drives package verification through `control.ts init/package`; successful runs retain the installed-consumer outputs and exact tarball. Per-matrix evidence is uploaded for seven days, including available failure records. macOS jobs require `/usr/bin/trash`, exercise real cache retirement and recycle owned scratch. Linux consumers verify `RETENTION_UNAVAILABLE` and unchanged cached bytes; Linux scratch remains on the disposable runner because no recycle capability is implemented. These checks require no live Notion credentials. Before integration, inspect all four checks for the PR's current head, not an earlier main run.
14
+ git clone https://github.com/yoyooyooo/ntn-skills.git
15
+ cd ntn-skills
16
+ bun install
33
17
 
34
- Keep Effect and platform versions aligned at 4.0.4. New commands use `effect/cli`; external execution uses scoped Effect platform capabilities. Pure path and identity transformations remain ordinary TypeScript. Preserve the [JSON and ref contract](docs/protocol.md), explicit discovery coverage and immutable snapshot semantics.
35
-
36
- Preserve the Skill naming contract: Notion Name uses ASCII English letters and single spaces (1-64 characters); its lowercase form with spaces replaced by hyphens is the invocation name and must equal the export frontmatter name. Do not introduce independent alias configuration or silently normalize invalid titles. Descriptions and file contents may use any language.
37
-
38
- Add behavior tests for plausible consumer-visible failures: ambiguity, pagination, partial discovery, file boundaries, version consistency and permission failure. Avoid asserting implementation text or internal call wiring. A pull request should explain the user-visible problem, resulting behavior and checks actually run. Keep unrelated changes separate.
39
-
40
- ## Compatibility and deprecation
41
-
42
- The 0.x series is experimental. A minor release may change public commands or protocol behavior incompatibly; a patch release preserves existing semantics and provides compatible fixes. Consumers should tolerate additional JSON fields and handle unfamiliar error codes as structured failures. Additional fields or codes must not silently change the meaning of existing fields or successful operations.
43
-
44
- Document a deprecation and its replacement in the relevant reference and [CHANGELOG](CHANGELOG.md), including migration steps and the version that removes it. Breaking changes must be called out before consumers upgrade. Update both READMEs ([English](README.md) and [简体中文](README.zh-CN.md)), the [usage guide](docs/usage.md), [protocol documentation](docs/protocol.md), [host integration](docs/host-integration.md) and affected Skill references when public behavior changes. Keep language navigation, commands, release status, capabilities and limits equivalent; detailed guides are maintained in English. Verify README rendering, anchors and packaged language files when the entry structure changes.
45
-
46
- ## Git and release workflow
18
+ # Run all quality gates before opening a PR:
19
+ bun run check # Runs lint + typecheck + test
20
+ ```
47
21
 
48
- Update your checkout with `git pull --ff-only`. Integration is fast-forward only; rebase contributions onto the current target branch rather than creating merge commits. Keep reviewable commits focused on the change.
22
+ If you modify `skills/ntn-skills/SKILL.md`, copy the updated file to `packages/cli/assets/ntn-skills/SKILL.md` (`packages/cli/test/bundled-skill.test.ts` enforces byte-for-byte equality).
49
23
 
50
- The private core is bundled into the CLI distribution. Before release, verify the tarball from outside the workspace and follow [the release procedure](docs/releasing.md). Releases use immutable annotated `v<version>` tags; publishing a registry package or creating a hosted repository requires explicit release authorization. A prepared version or local tarball does not establish that a package is published.
24
+ If you change user-facing behavior, flags, or workflows, update both `README.md` and `README.zh-CN.md` (plus `INSTALL.md` if setup steps change) so English and Simplified Chinese documentation stay aligned.
51
25
 
52
- ## Reporting bugs and vulnerabilities
26
+ ## Engineering Rules
53
27
 
54
- Use [GitHub issues](https://github.com/yoyooyooo/notion-skills-cli/issues) for bugs and usage questions. Include the command, sanitized response, runtime and `ntn` versions, expected behavior and a minimal reproduction. Never include credentials, signed URLs, private Skill contents or personal database identifiers in public reports. Report vulnerabilities through [the private channel in SECURITY.md](SECURITY.md#reporting-a-vulnerability).
28
+ - **Linear History**: Use clean, focused commits suitable for rebase-merging onto `main`.
29
+ - **Never Mutate Production Notion Libraries in Tests**: Unit tests must use the deterministic fake backends in `packages/core/test/fakes.ts`. Live smoke tests must enable `NTN_SKILLS_TEST_ONLY=1` against a dedicated test page.
30
+ - **Trash-Only File Removal**: Use `moveToSystemTrash` rather than raw `fs.rm` / `unlink` when retiring user-visible directories or workdirs.
package/INSTALL.md ADDED
@@ -0,0 +1,132 @@
1
+ # ntn-skills — Agent Setup Protocol
2
+
3
+ > **Audience**: Coding Agents (Claude Code, Cursor, Pi, Codex, Antigravity, OpenBot, etc.) executing setup on behalf of a user.
4
+ >
5
+ > **Goal**: Install `ntn-skills`, bootstrap (or bind) a 3-table Notion Skills Library, configure local zero-latency exports, enable background sync, and verify everything passes `ntn-skills doctor --json`.
6
+
7
+ ---
8
+
9
+ ## Non-Negotiable Safety Rules
10
+
11
+ 1. **Never ask the user to paste secrets into chat.** Guide the user to write `NOTION_TOKEN` (and optional `GITHUB_TOKEN`) directly into `~/.config/ntn-skills/credentials.env` with `chmod 600`. Never print secret values in terminal output or replies.
12
+ 2. **Never overwrite or delete existing non-managed skill directories.** Before choosing export directories, inspect `~/.agents/skills` and `~/.claude/skills`. If either already contains non-managed skills, ask the user whether to export to a separate directory first (via `--export <dir>`) or migrate existing skills later.
13
+ 3. **Close stdin on all non-interactive CLI calls** (`</dev/null`). Use `--json` when parsing command output.
14
+ 4. **Verify with `ntn-skills doctor --json`.** Do not declare setup complete until `"ok": true` is confirmed.
15
+
16
+ ---
17
+
18
+ ## Step 1 — Inspect Local Environment (Automatic, Read-Only)
19
+
20
+ Run a quick read-only probe to detect OS, `git`, `bun`, existing `ntn-skills`, existing skill folders, and whether Pi (`~/.pi/agent`) is present:
21
+
22
+ ```bash
23
+ uname -s
24
+ command -v git bun ntn-skills || true
25
+ ls -la ~/.agents/skills ~/.claude/skills ~/.pi/agent 2>/dev/null || true
26
+ ls -la ~/.config/ntn-skills/credentials.env ~/.config/ntn-skills/config.json 2>/dev/null || true
27
+ ```
28
+
29
+ ---
30
+
31
+ ## Step 2 — Install or Upgrade `ntn-skills` CLI
32
+
33
+ Run the idempotent installer (add `--with-pi` if the user uses Pi; add `--install-bun` if Bun is missing and the user agrees):
34
+
35
+ ```bash
36
+ curl -fsSL https://raw.githubusercontent.com/yoyooyooo/ntn-skills/main/scripts/install.sh | bash -s -- </dev/null
37
+ # For Pi users (enables $skill inline loading + skill_find / skill_load tools):
38
+ # curl -fsSL https://raw.githubusercontent.com/yoyooyooo/ntn-skills/main/scripts/install.sh | bash -s -- --with-pi </dev/null
39
+ ```
40
+
41
+ Ensure `~/.local/bin` is on `PATH` (or invoke `~/.local/bin/ntn-skills` explicitly) and confirm:
42
+
43
+ ```bash
44
+ ntn-skills --version </dev/null
45
+ ntn-skills skill --path </dev/null # Built-in management guide shipped with the binary
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Step 3 — Collect Minimal User Authorization (2 Prerequisites)
51
+
52
+ If `~/.config/ntn-skills/credentials.env` does not yet exist (and `NOTION_TOKEN` is not set in the environment), ask the user to complete these two quick steps in Notion and report back **only the Notion page URL** (plus their preferred export directory if Step 1 detected existing non-managed skills):
53
+
54
+ 1. **Create a Notion Integration & save token locally** (do **not** paste token into chat):
55
+ - Open `https://www.notion.so/profile/integrations` -> create an **Internal Integration** -> copy the token (`ntn_...`).
56
+ - Run locally in their terminal:
57
+ ```bash
58
+ mkdir -p ~/.config/ntn-skills
59
+ cat > ~/.config/ntn-skills/credentials.env <<'EOF'
60
+ NOTION_TOKEN=ntn_your_token_here
61
+ # Optional: avoids GitHub API rate limits & enables private GitHub skill repos
62
+ # GITHUB_TOKEN=ghp_your_token_here
63
+ EOF
64
+ chmod 600 ~/.config/ntn-skills/credentials.env
65
+ ```
66
+ 2. **Choose & share a Notion Root Page**:
67
+ - **First-time user**: Create a blank Notion page (e.g., `Agent Skills`), click `...` -> **Connections** -> add your Integration, and share the page URL with the Agent.
68
+ - **Adding a 2nd machine**: Open your existing `ntn-skills` Library root page and share its URL with the Agent.
69
+
70
+ ---
71
+
72
+ ## Step 4 — Bootstrap Notion 3-Table Library & Global Config (Single Idempotent Command)
73
+
74
+ Once `credentials.env` is in place and the user provides `<NOTION_PAGE_URL>`, run `ntn-skills init`:
75
+
76
+ - **Default setup** (exports to `~/.agents/skills` with `prefetch: discoverable`):
77
+ ```bash
78
+ ntn-skills init --root "<NOTION_PAGE_URL>" --json </dev/null
79
+ ```
80
+ - **Custom or multi-surface export directories** (e.g., Grok Box `${HOME}/agent-data/workflows` using `copy` mode alongside `~/.agents/skills` using `symlink`, or `~/.claude/skills`):
81
+ ```bash
82
+ # Single custom directory (e.g. Grok Bot workflows in copy mode):
83
+ ntn-skills init --root "<NOTION_PAGE_URL>" --export '${HOME}/agent-data/workflows' --mode copy --json </dev/null
84
+ # Dual surfaces on a Grok Box (Grok Bot workflows as copy + Raft/Pi ~/.agents/skills as symlink):
85
+ ntn-skills init --root "<NOTION_PAGE_URL>" --export ~/.agents/skills --export '${HOME}/agent-data/workflows:copy' --json </dev/null
86
+ ```
87
+ - **Machine profile filtering** (optional, e.g., `--profile default,work`):
88
+ ```bash
89
+ ntn-skills init --root "<NOTION_PAGE_URL>" --profile default,work --json </dev/null
90
+ ```
91
+
92
+ What `ntn-skills init` handles automatically and idempotently:
93
+ 1. **Blank page**: Creates the clean v2 3-table schema (`Sources`, `Skills`, `Files`) with all bidirectional relations (`Origin <-> Skills`, `Skill <-> Supporting Files`, `Requires`). **Existing library**: Binds the 3 tables without modifying them.
94
+ 2. Writes `~/.config/ntn-skills/config.json`.
95
+ 3. Links the built-in `ntn-skills` management guide shipped with the CLI binary into the configured export directory (unless already managed by the library), keeping a brand-new Notion library 100% clean with 0 external seed rows.
96
+ 4. Runs the first `sync --full` and exports `always` skills as top-level symlinks plus an auto-generated `skill-catalog` index for `discoverable` skills.
97
+
98
+ ---
99
+
100
+ ## Step 5 — Enable Background Sync & Verify with `doctor`
101
+
102
+ Install the native OS background sync timer (`launchd` on macOS, `systemd` on Linux; runs fast overlap-window incremental sync every 12 minutes + daily full reconciliation):
103
+
104
+ ```bash
105
+ ntn-skills schedule install --json </dev/null
106
+ ```
107
+
108
+ Run the end-to-end health check:
109
+
110
+ ```bash
111
+ ntn-skills doctor --json </dev/null
112
+ ```
113
+
114
+ Confirm `"ok": true` and that `credentials`, `config`, `notion_connection`, `catalog_cache`, `export:*`, and `background_sync` are healthy.
115
+
116
+ ---
117
+
118
+ ## Step 6 — Optional Onboarding Offer (After `"ok": true`)
119
+
120
+ Report the setup summary clearly to the user (Library ID, 3 table status, export directory, exported skill count, background sync active). Then offer two optional next steps:
121
+
122
+ 1. **Import an existing upstream or private Git skill repo**:
123
+ ```bash
124
+ # Community/reference repo (defaults to Visibility=manual; zero context cost):
125
+ ntn-skills source add <git-repo-url> --name <source-name> [--root skills] --policy track </dev/null
126
+ # User's own primary skill repo (auto-indexed into skill-catalog via --discoverable):
127
+ ntn-skills source add <git-repo-url> --name <source-name> [--root skills] --policy track --discoverable </dev/null
128
+ ```
129
+ 2. **Import local standalone skills into the Notion Draft Buffer**:
130
+ ```bash
131
+ ntn-skills new <local-skill-dir> --visibility discoverable </dev/null
132
+ ```
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 notion-skills-cli contributors
3
+ Copyright (c) 2026 yoyooyooo
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal