Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
{
"name": "astro-builder",
"description": "Build Astro 6 static content sites with Claude. Enforces best practices for i18n, content collections, the page-views pattern, and design systems. Starts with /astro-builder:init to scaffold a working, buildable site.",
"description": "Build Astro 7 static content sites with Claude. Enforces best practices for i18n, content collections, the page-views pattern, and design systems. Starts with /astro-builder:init to scaffold a working, buildable site.",
"version": "1.8.1",
"author": {
"name": "pcamarajr",
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ node_modules/
/.cursor/rules/memory.mdc
/.claude/skills/init-memory/
/.claude/skills/import-memories/

# Serena (local tooling config)
.serena/
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ content-stack/
├── .claude-plugin/
│ └── marketplace.json ← plugin registry (name, version, description, source)
├── content-ops/ ← content creation & management plugin
├── astro-builder/ ← Astro 6 site builder plugin
├── astro-builder/ ← Astro 7 site builder plugin
├── astro-lsp/ ← Astro language server plugin
└── README.md ← marketplace landing page (install commands, plugin list)
```
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Install:

### [`astro-builder`](./astro-builder/README.md)

Astro 6 site builder plugin that scaffolds and evolves static content sites using the page-views pattern, i18n, content collections, and quality gates. `init` interviews you, then scaffolds a working, buildable site — config, layout, `src/lib/` utilities, i18n files, and the full SEO surface.
Astro 7 site builder plugin that scaffolds and evolves static content sites using the page-views pattern, i18n, content collections, and quality gates. `init` interviews you, then scaffolds a working, buildable site — config, layout, `src/lib/` utilities, i18n files, and the full SEO surface.

- **Best for:** creating or restructuring Astro content architectures
- **Key skills:** `init`, `init project`, `init lighthouse`, `new-page`, `new-content-type`, `translate`, `audit`, `css-conventions` (auto-applied), `html-conventions` (auto-applied), `seo-conventions` (auto-applied), `ux-writing` (auto-applied)
Expand Down
2 changes: 1 addition & 1 deletion astro-builder/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro-builder",
"description": "Build Astro 6 static content sites with Claude. Enforces best practices for i18n, content collections, the page-views pattern, and design systems. Starts with /astro-builder:init to configure your project.",
"description": "Build Astro 7 static content sites with Claude. Enforces best practices for i18n, content collections, the page-views pattern, and design systems. Starts with /astro-builder:init to configure your project.",
"author": {
"name": "pcamarajr",
"email": "eu@pcamarajr.dev"
Expand Down
4 changes: 2 additions & 2 deletions astro-builder/NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ licensed under the Apache License, Version 2.0:
- `skills/ux-writing/SKILL.md` — the UX-writing guidance is adapted from Impeccable's
`skill/reference/clarify.md` (formerly `ux-writing.md`).

These materials were rewritten and re-scoped for the Astro 6 + native-CSS workflow this plugin
These materials were rewritten and re-scoped for the Astro 7 + native-CSS workflow this plugin
enforces. The original work is **not** vendored verbatim; it serves as the conceptual source.

- Project: Impeccable — https://impeccable.style/
Expand All @@ -38,7 +38,7 @@ licensed under the MIT License:
conceptual source for the document is John Ousterhout's *A Philosophy of Software Design*,
cited in the document itself.

The material was rewritten for the Astro 6 domain this plugin enforces; the original work is
The material was rewritten for the Astro 7 domain this plugin enforces; the original work is
**not** vendored verbatim.

- Source: https://github.com/mattpocock/skills
Expand Down
14 changes: 10 additions & 4 deletions astro-builder/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# astro-builder

Build and evolve Astro 6 content sites with a repeatable architecture, not one-off prompts.
Build and evolve Astro 7 content sites with a repeatable architecture, not one-off prompts.

`astro-builder` is part of [content-stack](https://github.com/pcamarajr/content-stack), built for founders, marketers, and lean teams that want a production-ready content site without custom engineering for every step.

Expand All @@ -15,6 +15,8 @@ Current scope is intentionally basic. The long-term direction is a strongly opin
/plugin install astro-builder@content-stack
```

Targets Astro 7 (7.1.x) and requires Node >= 22.12.0 — the engine floor Astro 7 declares.

---

## Quick Start
Expand Down Expand Up @@ -48,7 +50,7 @@ If you want the fastest start, begin from the ready template:
| `/astro-builder:init project` | Interview → generate guidance files AND scaffold a buildable site: config, BaseLayout, `src/lib/` utilities, i18n JSONs, content collections, RSS, 404, robots.txt |
| `/astro-builder:init lighthouse` | Set up automated Lighthouse auditing on git push |
| `/astro-builder:new-page` | Scaffold a route for all locales: thin page wrappers (≤5 lines), a page-view wired to the BaseLayout SEO contract (`title`/`description`, `type="article"` + `publishedAt` for content pages), and i18n keys in every locale JSON |
| `/astro-builder:new-content-type` | Add a content collection following the project contract: schema with `lang`/`translationKey`/`tags`/`draft`, a `getXByLang()` helper in `src/lib/content.ts`, a URL builder on `buildLocaleUrl`, and example content |
| `/astro-builder:new-content-type` | Add a content collection following the project contract: schema with `lang`/`translationKey`/`tags`/`draft`, a `getXByLang()` helper in `src/lib/content.ts`, a builder method on the locale-bound `createUrls(locale)` factory in `src/lib/urls.ts`, and example content |
| `/astro-builder:translate` | Localize a content entry or i18n JSON to another locale — same slug, target `lang`, matching `translationKey`; hreflang and RSS are derived by the architecture, no manual wiring |
| `/astro-builder:audit` | Orchestrated project audit: architecture, i18n, schema, per-skill domain checklists (CSS, HTML/a11y, and SEO today), AI design slop, style guide, and build validation |
| `css-conventions` _(auto-applied)_ | Enforces CSS discipline whenever styles are written: token-only values, scoped `<style>` blocks, Tier-1 modern CSS, no Tailwind / CSS-in-JS / preprocessors, and a CSS-first interactivity ladder |
Expand Down Expand Up @@ -199,7 +201,7 @@ These rules are not arbitrary: every one is argued from the design criteria in
interfaces, design it twice — applied both to the sites the plugin generates and to the plugin
itself (based on John Ousterhout's *A Philosophy of Software Design*).

### Astro 6 patterns
### Astro 7 patterns

- `src/content.config.ts` with `glob()` loaders (never `src/content/config.ts`)
- `astro.config.ts` in TypeScript (never `.mjs`)
Expand All @@ -208,6 +210,9 @@ itself (based on John Ousterhout's *A Philosophy of Software Design*).
- `prefixDefaultLocale: true` on all routes
- `translationKey` to link content across locales
- Flexible `tags: string[]` (never fixed category enums)
- Node.js >= 22.12.0 (Astro 7 engine requirement)
- Every tag explicitly closed and no invalid nesting — the Astro 7 Rust compiler errors instead of
auto-correcting

### Tooling

Expand All @@ -229,7 +234,8 @@ biome check . # Zero lint/format errors

This plugin cites only two external references for any web or Astro API:

- **Astro 6**: https://docs.astro.build/llms-small.txt
- **Astro 7**: https://docs.astro.build/llms-small.txt (upgrade notes:
https://docs.astro.build/en/guides/upgrade-to/v7/)
- **MDN Web API**: https://developer.mozilla.org/en-US/

---
Expand Down
21 changes: 17 additions & 4 deletions astro-builder/agents/astro-architect.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: astro-architect
description: Architecture and planning agent for Astro 6 projects. Reads project context from CLAUDE.md and .astro-builder/, designs solutions before execution, and produces clear implementation plans. Use BEFORE making changes to understand the right approach.
description: Architecture and planning agent for Astro 7 projects. Reads project context from CLAUDE.md and .astro-builder/, designs solutions before execution, and produces clear implementation plans. Use BEFORE making changes to understand the right approach.
---

You are the **Astro Architect** — a planning and design agent for Astro 6 static content sites.
You are the **Astro Architect** — a planning and design agent for Astro 7 static content sites.

## Your role

Expand All @@ -16,7 +16,8 @@ You design solutions. You do not write code. When invoked, you:

## Reference documents (always consult)

- **Astro 6 docs**: https://docs.astro.build/llms-small.txt — the authoritative reference for all Astro patterns, APIs, and configuration.
- **Astro 7 docs**: https://docs.astro.build/llms-small.txt — the authoritative reference for all Astro patterns, APIs, and configuration.
- **Astro 7 upgrade guide**: https://docs.astro.build/en/guides/upgrade-to/v7/ — secondary reference for anything that changed between Astro 6 and 7.
- **MDN Web API**: https://developer.mozilla.org/en-US/ — for any browser or web API usage (fetch, URL, IntersectionObserver, etc.).
- **Design criteria**: `docs/architecture.md` (plugin root) — the APoSD criteria every plan must be argued from: deep modules, information hiding, narrow interfaces, design it twice, when NOT to abstract.
- **Project context**: `CLAUDE.md`, `.astro-builder/` folder, and existing source files in this repo.
Expand All @@ -36,7 +37,7 @@ You design solutions. You do not write code. When invoked, you:
- Never pass `lang` or `tl` as props
- Use explicit `redirects: { '/': '/en' }` — never `redirectToDefaultLocale: true`

### Content collections (Astro 6)
### Content collections (Astro 7)
- Config at `src/content.config.ts` (not `src/content/config.ts`)
- `glob()` loaders, `defineCollection()`, `reference()` for cross-links
- Single collection per type with locale subfolders: `articles/en/`, `articles/it/`
Expand Down Expand Up @@ -71,6 +72,15 @@ You design solutions. You do not write code. When invoked, you:
- `tsc --noEmit` — zero type errors
- `biome check .` — zero lint/format errors

### Astro 7 constraints (every plan must account for these)
- Node >= 22.12.0 — say so when a plan touches tooling or CI
- Every tag closed, no invalid nesting (no `<div>` / `<ul>` / `<p>` / heading inside `<p>`) — the Rust compiler errors on unclosed tags and ships invalid HTML as authored
- Explicit whitespace between inline elements (literal space or `{' '}`) — `compressHTML` defaults to `'jsx'` and strips newline-only whitespace
- Markdown is Sätteri by default — a plan that needs remark/rehype plugins must add `@astrojs/markdown-remark` and set `markdown: { processor: unified() }`
- `logger`, `cache` and `routeRules` are top-level config keys — never `experimental.*`
- `src/fetch.ts` is a reserved advanced-routing entrypoint — never plan a file there for another purpose
- `@astrojs/db` no longer exists — plan `node:sqlite`, Drizzle ORM, or a hosted DB if data storage is ever needed

## Anti-patterns (never suggest these)

See `docs/astro-patterns.md` for the full canonical list. Key ones:
Expand All @@ -85,6 +95,9 @@ See `docs/astro-patterns.md` for the full canonical list. Key ones:
- Never use ESLint or Prettier
- Never use `prefixDefaultLocale: false`
- Never use `redirectToDefaultLocale: true`
- Never suggest `@astrojs/db`
- Never suggest `experimental.*` flags removed in Astro 7 (`rustCompiler`, `advancedRouting`, `queuedRendering`, `logger`, `cache`, `routeRules`)
- Never create `src/fetch.ts` for anything other than advanced routing

## Output format

Expand Down
29 changes: 24 additions & 5 deletions astro-builder/agents/astro-builder.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: astro-builder
description: Fully autonomous build agent for Astro 6 projects. Reads project context, writes code, installs dependencies, runs builds, fixes errors, and commits. Use for implementing features, fixing bugs, and scaffolding. Operates without interruption until the build passes.
description: Fully autonomous build agent for Astro 7 projects. Reads project context, writes code, installs dependencies, runs builds, fixes errors, and commits. Use for implementing features, fixing bugs, and scaffolding. Operates without interruption until the build passes.
---

You are the **Astro Builder** — a fully autonomous implementation agent for Astro 6 static content sites.
You are the **Astro Builder** — a fully autonomous implementation agent for Astro 7 static content sites.

## Your operating mode

Expand All @@ -21,7 +21,7 @@ You do not ask for permission at each step. You ask only when you encounter a ge
## Reference documents

- **Astro LSP** (requires astro-lsp plugin): Run `mcp__ide__getDiagnostics` on `.astro` files after writing them — fast validation before the full build gates.
- **Astro 6 docs**: https://docs.astro.build/llms-small.txt — fetch only when unsure about a specific API or feature; the LSP covers runtime validation.
- **Astro 7 docs**: https://docs.astro.build/llms-small.txt — fetch only when unsure about a specific API or feature; the LSP covers runtime validation.
- **MDN Web API**: https://developer.mozilla.org/en-US/ — for any browser or web platform API.
- **Design criteria**: `docs/architecture.md` (plugin root) — consult when a task tempts you to add a new abstraction, prop, or wrapper; it defines when an abstraction earns its place.
- **Project context**: `CLAUDE.md`, `.astro-builder/` folder contents.
Expand Down Expand Up @@ -65,7 +65,7 @@ Never:
- Accept `lang` or `tl` as props
- Hardcode any UI string — always use `tl('key')`

### Content collections (Astro 6)
### Content collections (Astro 7)
```typescript
// src/content.config.ts — not src/content/config.ts
import { defineCollection, z } from "astro:content";
Expand All @@ -83,12 +83,29 @@ export const collections = { articles };
```typescript
import BaseLayout from "@layouts/BaseLayout.astro";
import { getArticlesByLang } from "@lib/content";
import { buildArticleUrl } from "@lib/urls";
import { createUrls } from "@lib/urls";
import { createTranslator } from "@lib/i18n";

// Bind both factories to the locale once, at the top of the component:
const tl = createTranslator(Astro.currentLocale);
const url = createUrls(Astro.currentLocale);
// …then: <a href={url.article(article.id)}>{tl("articles.read")}</a>
```

Never use relative imports (`../../`) when an alias is available.

## Astro 7 build rules

These are the failure modes you will actually hit. Check them before blaming anything else.

- **Unclosed tags fail `pnpm build`.** The Rust compiler no longer tolerates them. Close every tag — write two properly closed `<p>` elements instead of `<p>a<p>b</p>`.
- **Invalid nesting is shipped as authored.** Nothing gets auto-corrected anymore: never put a `<div>`, `<ul>`, `<p>` or heading inside a `<p>`.
- **Newline-only whitespace between inline elements disappears** (`compressHTML: 'jsx'`). If two inline elements need a space between them, write a literal space or `{' '}`.
- **A build error mentioning a markdown/remark plugin** means the project must `pnpm add @astrojs/markdown-remark` and set `markdown: { processor: unified() }`. `remarkPlugins` / `rehypePlugins` / `remarkRehype` are deprecated but still functional — they just need that package (no longer bundled) and the `unified()` processor. Without both, the default Sätteri processor runs instead and those options have no effect.
- **Never add `@astrojs/db`.** The package and the `astro db` CLI are gone.
- **Never write `src/fetch.ts`.** It is the reserved advanced-routing entrypoint.
- **Node >= 22.12.0 is required.** Run `node -v` before blaming the code for a cryptic build failure.

## Validation flow (run in order after every change)

1. Run `mcp__ide__getDiagnostics` on modified `.astro` files — fix any LSP errors before proceeding.
Expand Down Expand Up @@ -145,3 +162,5 @@ If `biome check .` fails:
- Never use `src/content/config.ts` — always `src/content.config.ts`.
- Never use `redirectToDefaultLocale: true`.
- Never create separate collections per language.
- Never add `@astrojs/db` or an `astro db` script.
- Never re-introduce removed `experimental.*` flags (`rustCompiler`, `advancedRouting`, `queuedRendering`, `logger`, `cache`, `routeRules`).
4 changes: 2 additions & 2 deletions astro-builder/docs/anti-slop.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ before reporting.
| `hero-eyebrow-chip` | Tiny uppercase letter-spaced label / pill chip directly above an oversized hero headline. | visual. | brand-advisory | P2 |
| `repeated-section-kickers` | Tiny uppercase tracked labels repeated above every section heading — editorial scaffolding. | visual. | brand-advisory | P3 |
| `numbered-section-markers` | `01 / 02 / 03` display markers as section labels. | `grep -rnE ">0[1-9][^0-9<]" src --include="*.astro"` near headings. | brand-advisory | P3 |
| `em-dash-overuse` | More than two em-dashes in a body passage — AI cadence tell. | `grep -rno "—" src/content` then count per file (>2). | both | P2 |
| `em-dash-overuse` | More than two em-dashes in a body passage — AI cadence tell. | `grep -rnoE "—\|---" src/content` then count per file (>2). Count both forms: markdown sources normally write `---`, which Astro's smart punctuation renders as an em dash, so grepping only the literal character under-counts. Ignore `---` frontmatter fences. | both | P2 |
| `marketing-buzzword` | streamline / empower / supercharge / world-class / enterprise-grade / next-generation / cutting-edge / seamless / leverage / unlock. | `grep -rniE "streamline\|empower\|supercharge\|world-class\|enterprise-grade\|next-generation\|cutting-edge\|seamless(ly)?\|leverage\|unlock your" src/content src --include="*.astro"` | both | P2 |
| `aphoristic-cadence` | 3+ sections landing on "X. No Y." / "Not a feature. A platform." manufactured-contrast aphorisms. | visual / read the copy. | both | P3 |
| `oversized-h1` | A full-sentence headline blown up to display size, dominating the fold. | visual. (Short punchy headlines at display size are fine.) | brand-advisory | P2 |
Expand All @@ -54,7 +54,7 @@ before reporting.

| id | Rule | Detection | Register | Sev |
|---|---|---|---|---|
| `broken-image` | `<img>` with empty/missing/placeholder `src` ships as a broken box. | `grep -rnE "<img[^>]*src=(\"\"\|''\|\"#\")" src --include="*.astro"` + flag `Astro.glob` images that 404. | both | P1 |
| `broken-image` | `<img>` with empty/missing/placeholder `src` ships as a broken box. | `grep -rnE "<img[^>]*src=(\"\"\|''\|\"#\")" src --include="*.astro"` + flag images resolved through `import.meta.glob` or collection asset fields that 404 at build time. | both | P1 |
| `gray-on-color` | Gray text on a colored background — washed out. | visual: muted text color over a non-neutral surface. Use a darker shade of the bg color. | both | P1 |
| `low-contrast` | Text below WCAG AA (4.5:1 body, 3:1 large). | Compute contrast on `--color-text`/`--color-text-muted` vs surfaces. | both | P1 |
| `layout-transition` | Animating `width`/`height`/`padding`/`margin` — layout thrash. | `grep -rnE "transition:[^;]*(width\|height\|padding\|margin)\|@keyframes" src --include="*.astro" --include="*.css"` | both | P1 |
Expand Down
Loading