-
Notifications
You must be signed in to change notification settings - Fork 99
Add a claude.md #3047
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
Open
MJRichardson
wants to merge
1
commit into
main
Choose a base branch
from
michrich/claude-md
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add a claude.md #3047
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## What this repo is | ||
|
|
||
| This is the [Octopus Deploy documentation site](https://octopus.com/docs), built with [Astro](https://astro.build/). All content lives under `src/pages/docs/` and mirrors the URL structure of the live site exactly. | ||
|
|
||
| ## Common commands | ||
|
|
||
| ```bash | ||
| pnpm install # Install dependencies | ||
| pnpm dev # Run dev server at localhost:3000 (also processes images + watches files) | ||
| pnpm build # Build static output to ./dist | ||
| pnpm preview # Serve the built ./dist folder | ||
| pnpm test # Build + run Playwright tests (redirect checks and bookmark checks) | ||
| pnpm spellcheck # Spell-check only files changed vs origin/main | ||
| pnpm spellcheck-all # Spell-check all .md/.mdx files | ||
| pnpm format # Format all source files with Prettier | ||
| ``` | ||
|
|
||
| `pnpm dev` runs four scripts in parallel: image processing (`dev:img`), dictionary sorting, the Astro dev server, and a file watcher that auto-formats on save. | ||
|
|
||
| The full CI pipeline also runs `pnpm crawl` (link checking) and `pnpm thin` (static asset cleanup) after the build. | ||
|
|
||
| ## Running a single Playwright test | ||
|
|
||
| ```bash | ||
| # Run a specific test file | ||
| npx playwright test tests/redirect.spec.ts | ||
|
|
||
| # Run a specific test by name (substring match) | ||
| npx playwright test --grep "Check redirects" | ||
| ``` | ||
|
|
||
| Tests require the site to already be built (`pnpm build`). The Playwright config starts `npm run preview` as the web server automatically. | ||
|
|
||
| ## Image processing | ||
|
|
||
| Before building, run `pnpm dev:img` to generate responsive WebP variants of images in `public/docs/img/` → `public/docs/i/{small,medium,large}/`. This step must complete before `astro build` for images to resolve correctly. The `pnpm dev` command handles this automatically. | ||
|
|
||
| Image sizes: small=600px, medium=1000px, large=2000px. | ||
|
|
||
| ## Content architecture | ||
|
|
||
| ### URL → file mapping | ||
|
|
||
| The URL path after `/docs/` maps directly to `src/pages/docs/`. For example: | ||
|
|
||
| - `octopus.com/docs/infrastructure/deployment-targets/tentacle` → | ||
| `src/pages/docs/infrastructure/deployment-targets/tentacle/index.md(x)` or | ||
| `src/pages/docs/infrastructure/deployment-targets/tentacle.md` | ||
|
|
||
| ### Frontmatter fields | ||
|
|
||
| Every page requires these frontmatter fields: | ||
|
|
||
| ```yaml | ||
| --- | ||
| layout: src/layouts/Default.astro | ||
| pubDate: 2023-01-01 | ||
| modDate: 2024-05-24 | ||
| title: Page Title | ||
| navTitle: Short Nav Title # optional, shorter version for sidebar | ||
| navSection: Section Name # groups pages in the sidebar | ||
| navOrder: 10 # controls ordering within a section | ||
| description: SEO description | ||
| icon: fa-solid fa-cloud # Font Awesome class; add if missing | ||
| --- | ||
| ``` | ||
|
|
||
| The navigation is auto-generated from frontmatter (`navTitle`, `navSection`, `navOrder`). | ||
|
|
||
| ### Redirects | ||
|
|
||
| Never delete pages. Instead, replace the content with a redirect stub: | ||
|
|
||
| ```yaml | ||
| --- | ||
| layout: src/layouts/Redirect.astro | ||
| title: Redirect | ||
| redirect: https://octopus.com/docs/new-path/to/page | ||
| pubDate: 2023-01-01 | ||
| navSearch: false | ||
| navSitemap: false | ||
| navMenu: false | ||
| --- | ||
| ``` | ||
|
|
||
| ### Shared/include content | ||
|
|
||
| Reusable content lives in `src/shared-content/`. To use it, rename the consuming file from `.md` to `.mdx`, then: | ||
|
|
||
| ```mdx | ||
| import MyInclude from 'src/shared-content/path/to/file.include.md' | ||
|
|
||
| <MyInclude /> | ||
| ``` | ||
|
|
||
| ### MDX gotchas | ||
|
|
||
| - Custom heading IDs (`## Heading {#my-id}`) must be escaped in MDX: `## Heading \{#my-id}` | ||
| - Short-form links (`<https://example.com>`) don't work in MDX; use `[text](url)` instead. | ||
|
|
||
| ### Markdown directives (remark-directive) | ||
|
|
||
| Custom containers are available via `:::` syntax: | ||
|
|
||
| ```markdown | ||
| :::div{.hint} | ||
| Hint content here. | ||
| ::: | ||
|
|
||
| :::figure | ||
| { height="400" width="600" } | ||
| ::: | ||
| ``` | ||
|
|
||
| Available callout classes: `hint`, `info`, `success`, `warning`, `problem`. | ||
|
|
||
| Tables are automatically wrapped in `<div class="table-wrap">` by the build pipeline. | ||
|
|
||
| ## Spell-check | ||
|
|
||
| The spell checker uses `cspell` with a custom dictionary at `dictionary-octopus.txt`. Add new technical terms there when flagged. | ||
|
|
||
| **Flagged words** (must not use): `utilize`, `whilst`, `on-premise`, `whitelist`, `blacklist`, `enable/disable` (prefer `let`/`deactivate`), `within` (use `in`). | ||
|
|
||
| ## Path aliases (tsconfig) | ||
|
|
||
| - `@config` → `src/config.ts` | ||
| - `@components` → `src/themes/octopus/components/` | ||
| - `@util` → `src/themes/octopus/utilities/` | ||
|
|
||
| ## Example values (use these in docs) | ||
|
|
||
| - Octopus URL: `https://your-octopus-url` | ||
| - API key: `API-YOUR-KEY` | ||
| - Snapshot name: `Snapshot XXXXX` | ||
| - Subscription ID: `g3662re9njtelsyfhm7t` | ||
| - Password: `your-secret-password` | ||
|
|
||
| Prefer `your-value` over `my-value` throughout. | ||
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.