-
Notifications
You must be signed in to change notification settings - Fork 1
feat(docs): add apps/docs documentation site #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .nuxt/ | ||
| .output/ | ||
| dist/ | ||
| .data/ | ||
| node_modules/ | ||
| .turbo/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "configPath": "../../dist/_worker.js/wrangler.json" } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # ASK Docs | ||
|
|
||
| Documentation site for [`@pleaseai/ask`](../../packages/cli/), built with the [`docs-please`](https://github.com/pleaseai/docs) Nuxt layer. | ||
|
|
||
| ## Development | ||
|
|
||
| ```bash | ||
| # From the workspace root | ||
| bun install | ||
| bun run --cwd apps/docs dev | ||
| ``` | ||
|
|
||
| ## Build | ||
|
|
||
| ```bash | ||
| # Cloudflare Pages (production) | ||
| bun run --cwd apps/docs build | ||
|
|
||
| # Local Node preset (no D1 required) | ||
| bun run --cwd apps/docs build:node | ||
| ``` | ||
|
|
||
| The build target picks the [`@nuxt/content`](https://content.nuxt.com) database backend automatically: | ||
|
|
||
| - Cloudflare signals (`NITRO_PRESET=cloudflare_pages`, `CF_PAGES=1`, or `NUXT_CONTENT_DATABASE_TYPE=d1`) → D1 binding `DB` | ||
| - Local builds → native `sqlite` connector at `.data/content/contents.sqlite` | ||
|
|
||
| ## Structure | ||
|
|
||
| ``` | ||
| apps/docs/ | ||
| ├── app/ | ||
| │ └── app.config.ts # site metadata (title, GitHub repo, UI overrides) | ||
| ├── content/ | ||
| │ ├── index.md # landing page | ||
| │ └── docs/ | ||
| │ └── 1.getting-started/ | ||
| │ ├── 1.introduction.md | ||
| │ └── 2.installation.md | ||
| ├── public/ # static assets | ||
| ├── eslint.config.ts | ||
| ├── nuxt.config.ts | ||
| ├── package.json | ||
| ├── tsconfig.json | ||
| └── wrangler.jsonc # Cloudflare Pages config (D1 binding) | ||
| ``` | ||
|
|
||
| ## Deploy (Cloudflare Pages) | ||
|
|
||
| 1. Create the D1 database: `wrangler d1 create ask-docs-db` | ||
| 2. Paste the returned `database_id` into `wrangler.jsonc` | ||
| 3. Cloudflare Pages project: root = repo root, build command = `bun run --cwd apps/docs build`, output = `apps/docs/dist` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| export default defineAppConfig({ | ||
| docs: { | ||
| title: 'ASK', | ||
| github: { | ||
| url: 'https://github.com/pleaseai/ask', | ||
| owner: 'pleaseai', | ||
| name: 'ask', | ||
| branch: 'main', | ||
| }, | ||
| }, | ||
| github: { | ||
| rootDir: 'apps/docs', | ||
| }, | ||
| ui: { | ||
| pageHero: { | ||
| slots: { | ||
| title: 'font-semibold sm:text-6xl', | ||
| container: '!pb-0', | ||
| }, | ||
| }, | ||
| pageCard: { | ||
| slots: { | ||
| container: 'lg:flex min-w-0', | ||
| wrapper: 'flex-none', | ||
| }, | ||
| }, | ||
| }, | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| title: Getting Started | ||
| icon: i-lucide-rocket | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The Prompt for AI agents |
||
33 changes: 33 additions & 0 deletions
33
apps/docs/content/docs/1.getting-started/1.introduction.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| title: Introduction | ||
| description: What ASK is and why it exists. | ||
| --- | ||
|
|
||
| # Introduction | ||
|
|
||
| **ASK** (Agent Skills Kit) is a CLI that downloads version-specific library documentation and source for AI coding agents, then generates an `AGENTS.md` index plus per-library Claude Code skills under `.claude/skills/<name>-docs/SKILL.md`. | ||
|
|
||
| The agent reads the docs that match the version your project actually runs — not the snapshot baked into its training data. | ||
|
|
||
| ## Why this exists | ||
|
|
||
| Training data ages. Lockfiles don't. | ||
|
|
||
| When an agent recalls "how `zod` works" from memory, it's recalling whatever shape the API had at the cutoff. When the project pins `zod@3.22.0`, the agent should be reading `~/.ask/...zod/3.22.0/README.md`, not guessing. | ||
|
|
||
| ASK bridges the two by: | ||
|
|
||
| 1. Reading the version from `bun.lock` → `package-lock.json` → `pnpm-lock.yaml` → `yarn.lock` → `package.json` range fallback. | ||
| 2. Fetching docs/source once and caching under `~/.ask/` (override via `ASK_HOME`). | ||
| 3. Printing absolute paths to stdout, errors to stderr — safe for `$(ask …)` composition. | ||
|
|
||
| ## How agents consume ASK | ||
|
|
||
| Two surfaces, depending on workflow: | ||
|
|
||
| - **Declarative** — `ask.json` at the project root lists libraries. `ask install` resolves every entry, materializes docs under `.ask/docs/<name>@<version>/`, writes a Claude skill, and regenerates the auto-managed block in `AGENTS.md`. | ||
| - **One-shot** — `ask docs <spec>` and `ask src <spec>` emit cached paths for ad-hoc reads. Composable with `rg`, `cat`, `fd`. | ||
|
|
||
| ## Next steps | ||
|
|
||
| - [Installation](/docs/getting-started/installation) — install the CLI and run it against an existing project. |
78 changes: 78 additions & 0 deletions
78
apps/docs/content/docs/1.getting-started/2.installation.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| --- | ||
| title: Installation | ||
| description: Install the ASK CLI and run it against your project. | ||
| --- | ||
|
|
||
| # Installation | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Node.js **22.5+** (required for the `node:sqlite` connector used by some integrations) | ||
| - A package manager (bun, npm, pnpm, or yarn) — ASK reads whichever lockfile is present | ||
|
|
||
| ## Install the CLI | ||
|
|
||
| ```bash | ||
| # bun (recommended for this repo) | ||
| bun add -d @pleaseai/ask | ||
|
|
||
| # npm | ||
| npm install -D @pleaseai/ask | ||
|
|
||
| # pnpm | ||
| pnpm add -D @pleaseai/ask | ||
|
|
||
| # yarn | ||
| yarn add -D @pleaseai/ask | ||
| ``` | ||
|
|
||
| Or run ad-hoc without installing: | ||
|
|
||
| ```bash | ||
| bunx @pleaseai/ask docs zod | ||
| npx @pleaseai/ask docs zod | ||
| ``` | ||
|
|
||
| ## First run | ||
|
|
||
| Declare libraries in `ask.json`: | ||
|
|
||
| ```json | ||
| { | ||
| "libraries": [ | ||
| "npm:next", | ||
| "npm:zod", | ||
| { "spec": "github:tanstack/intent", "ref": "v0.5.0" } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| Then resolve, fetch, and wire everything up: | ||
|
|
||
| ```bash | ||
| ask install | ||
| ``` | ||
|
|
||
| This will: | ||
|
|
||
| 1. Resolve every entry against the project's lockfile (or the pinned `ref` for github specs). | ||
| 2. Fetch docs into `.ask/docs/<name>@<version>/` (gitignored). | ||
| 3. Write a Claude Code skill at `.claude/skills/<name>-docs/SKILL.md`. | ||
| 4. Regenerate the `<!-- BEGIN:ask-docs-auto-generated -->` block in `AGENTS.md`. | ||
|
|
||
| ## One-shot reads | ||
|
|
||
| No `ask.json` required: | ||
|
|
||
| ```bash | ||
| # Candidate doc directories (one per line) | ||
| ask docs zod | ||
|
|
||
| # Cached checkout root (single path) | ||
| ask src facebook/react | ||
|
|
||
| # Producer-shipped skills | ||
| ask skills list vercel/ai | ||
| ``` | ||
|
|
||
| All three commands share a single cache at `~/.ask/` (override with `ASK_HOME`). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| --- | ||
| title: ASK | ||
| seo: | ||
| title: Version-accurate library docs for AI coding agents | ||
| description: ASK (Agent Skills Kit) downloads version-specific library documentation and generates AGENTS.md and Claude Code skills so AI agents reference accurate docs instead of training data. | ||
| --- | ||
|
|
||
| ::u-page-hero | ||
| #headline | ||
| :::u-button{to="https://github.com/pleaseai/ask/releases" target="_blank" variant="outline" size="sm"} | ||
| ASK is on npm → | ||
| ::: | ||
|
|
||
| #title | ||
| Version-accurate library docs for AI coding agents. | ||
|
|
||
| #description | ||
| ASK downloads version-specific library docs and generates **AGENTS.md** + **Claude Code skills** so your agent reads real code at the version your project actually runs — not last year's training snapshot. | ||
|
|
||
| #links | ||
| :::u-button{to="/docs/getting-started/introduction" size="lg"} | ||
| Get Started → | ||
| ::: | ||
|
|
||
| :::u-button{to="https://github.com/pleaseai/ask" target="_blank" variant="outline" size="lg"} | ||
| Star on GitHub | ||
| ::: | ||
| :: | ||
|
|
||
| ::u-page-section | ||
| :::u-page-grid{class="lg:grid-cols-2"} | ||
| ::::u-page-card{class="col-span-1"} | ||
| #title | ||
| Pinned to your [lockfile]{.text-primary} | ||
|
|
||
| #description | ||
| ASK resolves versions from `bun.lock`, `package-lock.json`, `pnpm-lock.yaml`, or `yarn.lock` — every read reflects the version your project actually installs. | ||
| :::: | ||
|
|
||
| ::::u-page-card{class="col-span-1"} | ||
| #title | ||
| Generates [AGENTS.md]{.text-primary} | ||
|
|
||
| #description | ||
| Each library lands as a Claude Code skill under `.claude/skills/<name>-docs/SKILL.md`, indexed by a single auto-generated `AGENTS.md` block. | ||
| :::: | ||
|
|
||
| ::::u-page-card{class="col-span-2"} | ||
| #title | ||
| Works with [npm, PyPI, Go, Crates, Pub, Hex, NuGet, Maven]{.text-primary} | ||
|
|
||
| #description | ||
| The ASK Registry maps ecosystem specs (`npm:react`, `pypi:fastapi`, `crates:tokio`) to their GitHub source and docs path. Bare `owner/repo` works too. | ||
|
|
||
| #body | ||
| ```bash | ||
| ask install # resolve every entry in ask.json | ||
| ask add npm:next # add a library and regenerate AGENTS.md | ||
| ask docs zod # print candidate doc paths for the version in lockfile | ||
| ask src facebook/react # print the cached checkout root | ||
| ``` | ||
| :::: | ||
|
|
||
| ::::u-page-card{class="col-span-1"} | ||
| #title | ||
| [One-shot reading]{.text-primary} commands | ||
|
|
||
| #description | ||
| `ask docs <spec>` and `ask src <spec>` emit absolute paths to stdout — drop them straight into `$(…)` for `rg`, `cat`, `fd`, or any tool that takes a path. | ||
| :::: | ||
|
|
||
| ::::u-page-card{class="col-span-1"} | ||
| #title | ||
| Cached at [`~/.ask/`]{.text-primary} | ||
|
|
||
| #description | ||
| Every fetched library is stored once under `~/.ask/`. Multiple projects share the same cache; `ask cache ls` and `ask cache clean` manage disk pressure. | ||
| :::: | ||
| ::: | ||
| :: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import pleaseai from '@pleaseai/eslint-config' | ||
|
|
||
| export default pleaseai( | ||
| { | ||
| vue: true, | ||
| }, | ||
| { | ||
| // MDC syntax (`#headline`, `::component`, `:::block`) parses as | ||
| // invalid Markdown to ESLint's `markdown` plugin. Skip content/. | ||
| ignores: ['content/**/*.md'], | ||
| }, | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Remove this file and add
.wrangler/to.gitignore. Theconfig.jsoninside.wrangler/deploy/is auto-generated bywrangler deploy/wrangler pages deployand should not be committed to version control. The repo's source-of-truth for Wrangler config is alreadyapps/docs/wrangler.jsonc.Prompt for AI agents