agents-md-kit 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +148 -2
- package/bin/agent-kit.js +6 -0
- package/core/files/.claude/settings.json +16 -0
- package/core/files/.claude/skills/agent-memory-protocol/SKILL.md +117 -0
- package/core/files/.claude/skills/api-design-rest/SKILL.md +126 -0
- package/core/files/.claude/skills/backend-architecture-principles/SKILL.md +116 -0
- package/core/files/.claude/skills/backend-security/SKILL.md +117 -0
- package/core/files/.claude/skills/changelog-and-versioning/SKILL.md +169 -0
- package/core/files/.claude/skills/database-best-practices/SKILL.md +104 -0
- package/core/files/.claude/skills/git-commit-and-workflow/SKILL.md +140 -0
- package/core/files/.claude/skills/project-management-workflow/SKILL.md +181 -0
- package/core/files/CLAUDE.md +1 -0
- package/core/files/MEMORY.md +77 -0
- package/core/files/docs/adr/0000-template.md +21 -0
- package/core/fragments/agents-core.md +61 -0
- package/core/manifest.txt +21 -0
- package/docs/monorepo.md +72 -0
- package/package.json +50 -4
- package/packs/github/files/.github/ISSUE_TEMPLATE/bug_report.md +22 -0
- package/packs/github/files/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/packs/github/files/.github/pull_request_template.md +24 -0
- package/packs/github/files/.github/workflows/pr-title.yml +37 -0
- package/packs/github/manifest.txt +6 -0
- package/packs/web/files/.claude/skills/html-syntax-and-semantics/SKILL.md +127 -0
- package/packs/web/files/.claude/skills/seo-best-practices/SKILL.md +158 -0
- package/packs/web/fragments/agents-web.md +11 -0
- package/packs/web/manifest.txt +5 -0
- package/presets/node-backend/docs/node-backend.md +60 -0
- package/presets/node-backend/files/.editorconfig +12 -0
- package/presets/node-backend/files/.husky/commit-msg +1 -0
- package/presets/node-backend/files/.husky/pre-commit +1 -0
- package/presets/node-backend/files/.lintstagedrc.json +4 -0
- package/presets/node-backend/files/.prettierrc.json +7 -0
- package/presets/node-backend/files/.release-please-manifest.json +3 -0
- package/presets/node-backend/files/CHANGELOG.md +5 -0
- package/presets/node-backend/files/commitlint.config.mjs +12 -0
- package/presets/node-backend/files/eslint.config.mjs +38 -0
- package/presets/node-backend/files/release-please-config.json +25 -0
- package/presets/node-backend/fragments/agents-node-backend-github.md +7 -0
- package/presets/node-backend/fragments/agents-node-backend.md +13 -0
- package/presets/node-backend/fragments/gitignore.txt +19 -0
- package/presets/node-backend/fragments/prettierignore.txt +16 -0
- package/presets/node-backend/github/dependabot.yml +21 -0
- package/presets/node-backend/github/workflows/ci.yml +38 -0
- package/presets/node-backend/github/workflows/release-please.yml +21 -0
- package/presets/node-backend/manifest.txt +30 -0
- package/presets/python/docs/python.md +66 -0
- package/presets/python/files/.editorconfig +15 -0
- package/presets/python/files/.pre-commit-config.yaml +32 -0
- package/presets/python/files/.release-please-manifest.json +3 -0
- package/presets/python/files/CHANGELOG.md +5 -0
- package/presets/python/files/mypy.ini +5 -0
- package/presets/python/files/pytest.ini +6 -0
- package/presets/python/files/release-please-config.json +25 -0
- package/presets/python/files/ruff.toml +17 -0
- package/presets/python/fragments/agents-python-github.md +7 -0
- package/presets/python/fragments/agents-python.md +14 -0
- package/presets/python/fragments/gitignore.txt +25 -0
- package/presets/python/github/dependabot.yml +18 -0
- package/presets/python/github/workflows/ci.yml +37 -0
- package/presets/python/github/workflows/release-please.yml +21 -0
- package/presets/python/manifest.txt +25 -0
- package/presets/react-typescript/docs/react-typescript.md +71 -0
- package/presets/react-typescript/files/.claude/skills/react-principles/SKILL.md +264 -0
- package/presets/react-typescript/files/.editorconfig +12 -0
- package/presets/react-typescript/files/.husky/commit-msg +1 -0
- package/presets/react-typescript/files/.husky/pre-commit +1 -0
- package/presets/react-typescript/files/.lintstagedrc.json +4 -0
- package/presets/react-typescript/files/.prettierrc.json +7 -0
- package/presets/react-typescript/files/.release-please-manifest.json +3 -0
- package/presets/react-typescript/files/CHANGELOG.md +5 -0
- package/presets/react-typescript/files/commitlint.config.mjs +12 -0
- package/presets/react-typescript/files/eslint.config.mjs +55 -0
- package/presets/react-typescript/files/release-please-config.json +25 -0
- package/presets/react-typescript/fragments/agents-react-typescript-github.md +7 -0
- package/presets/react-typescript/fragments/agents-react-typescript.md +17 -0
- package/presets/react-typescript/fragments/gitignore.txt +22 -0
- package/presets/react-typescript/fragments/prettierignore.txt +17 -0
- package/presets/react-typescript/github/dependabot.yml +21 -0
- package/presets/react-typescript/github/workflows/ci.yml +38 -0
- package/presets/react-typescript/github/workflows/release-please.yml +21 -0
- package/presets/react-typescript/manifest.txt +32 -0
- package/src/blocks.js +132 -0
- package/src/cli.js +159 -0
- package/src/fsutil.js +123 -0
- package/src/install.js +223 -0
- package/src/manifest.js +187 -0
- package/src/validate.js +324 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: html-syntax-and-semantics
|
|
3
|
+
description: Rules for writing valid, semantic, accessible HTML. Use when writing or reviewing any HTML, JSX markup, templates or email-less web pages, including document structure, element choice, forms, images, links, tables and accessibility basics.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# HTML Syntax, Semantics and Accessibility
|
|
7
|
+
|
|
8
|
+
Good HTML is the foundation for accessibility, SEO and maintainable CSS. In component frameworks (for example React/JSX, Vue or Svelte templates) the same rules apply to the rendered output.
|
|
9
|
+
|
|
10
|
+
## 1. Document Skeleton
|
|
11
|
+
|
|
12
|
+
Every page needs:
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<!doctype html>
|
|
16
|
+
<html lang="en">
|
|
17
|
+
<head>
|
|
18
|
+
<meta charset="utf-8">
|
|
19
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
20
|
+
<title>Page Title | Brand</title>
|
|
21
|
+
</head>
|
|
22
|
+
<body>...</body>
|
|
23
|
+
</html>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- `<!doctype html>` first, to avoid quirks mode.
|
|
27
|
+
- `lang` on `<html>` (and on any inline foreign-language content).
|
|
28
|
+
- `charset` as UTF-8, within the first 1024 bytes of the document.
|
|
29
|
+
- A viewport meta tag. Never disable zoom (`user-scalable=no`, `maximum-scale=1`).
|
|
30
|
+
- One unique, descriptive `<title>` per page.
|
|
31
|
+
|
|
32
|
+
## 2. Syntax Rules
|
|
33
|
+
|
|
34
|
+
- Lowercase element and attribute names.
|
|
35
|
+
- Always quote attribute values with double quotes.
|
|
36
|
+
- Close all non-void elements. Void elements (`img`, `input`, `br`, `meta`, `link`, `hr`) take no closing tag.
|
|
37
|
+
- Nest correctly: no block elements inside `<p>`, no `<a>` inside `<a>`, no interactive elements inside `<button>` or `<a>`.
|
|
38
|
+
- `id` values are unique per page. Don't duplicate them.
|
|
39
|
+
- Use boolean attributes without values (`disabled`, `required`, `checked`).
|
|
40
|
+
- Don't use obsolete or presentational elements (`<center>`, `<font>`, `<b>` for emphasis). Style belongs in CSS.
|
|
41
|
+
- Validate with the W3C validator or an HTML linter in CI.
|
|
42
|
+
|
|
43
|
+
## 3. Semantic Elements
|
|
44
|
+
|
|
45
|
+
Pick the element for its meaning, not its looks.
|
|
46
|
+
|
|
47
|
+
| Need | Use | Not |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| Site/section header | `<header>` | `<div class="header">` |
|
|
50
|
+
| Primary navigation | `<nav>` | `<div class="nav">` |
|
|
51
|
+
| Unique main content (once per page) | `<main>` | `<div id="main">` |
|
|
52
|
+
| Self-contained content (post, card) | `<article>` | `<div>` |
|
|
53
|
+
| Thematic grouping with a heading | `<section>` | `<div>` |
|
|
54
|
+
| Tangential content | `<aside>` | `<div>` |
|
|
55
|
+
| Footer | `<footer>` | `<div>` |
|
|
56
|
+
| Figure with caption | `<figure>` + `<figcaption>` | `<div>` + `<p>` |
|
|
57
|
+
| Lists | `<ul>`, `<ol>`, `<dl>` | repeated `<div>`/`<br>` |
|
|
58
|
+
| Emphasis / importance | `<em>` / `<strong>` | `<i>` / `<b>` for meaning |
|
|
59
|
+
| Dates | `<time datetime="2026-11-11">` | plain text |
|
|
60
|
+
| Actions | `<button type="button">` | `<div onclick>` |
|
|
61
|
+
| Navigation to another URL | `<a href>` | `<button>` or `<span onclick>` |
|
|
62
|
+
|
|
63
|
+
Use `<div>` and `<span>` only when no semantic element fits.
|
|
64
|
+
|
|
65
|
+
## 4. Headings
|
|
66
|
+
|
|
67
|
+
- Exactly one `<h1>` per page, describing the page.
|
|
68
|
+
- Don't skip levels (`h1` → `h2` → `h3`).
|
|
69
|
+
- Choose heading level by document outline, never by font size. Size it with CSS.
|
|
70
|
+
|
|
71
|
+
## 5. Links and Buttons
|
|
72
|
+
|
|
73
|
+
- Link text must make sense out of context. Avoid "click here" and "read more" alone.
|
|
74
|
+
- External links opened in a new tab: `target="_blank" rel="noopener noreferrer"`. Prefer not to force new tabs.
|
|
75
|
+
- `<button>` triggers an action. Always set `type` (`button`, `submit`, `reset`) explicitly.
|
|
76
|
+
- Never remove the focus outline without a visible replacement (`:focus-visible`).
|
|
77
|
+
|
|
78
|
+
## 6. Images and Media
|
|
79
|
+
|
|
80
|
+
- Every `<img>` has an `alt`. Informative image: describe its purpose. Decorative image: `alt=""`.
|
|
81
|
+
- Always set `width` and `height` (or CSS `aspect-ratio`) to prevent layout shift.
|
|
82
|
+
- Below-the-fold images: `loading="lazy"`. The main above-the-fold (LCP) image: don't lazy-load, and consider `fetchpriority="high"`.
|
|
83
|
+
- Use `srcset` and `sizes` (or `<picture>`) for responsive images. Prefer modern formats (AVIF, WebP) with fallback.
|
|
84
|
+
- Video: provide captions (`<track kind="captions">`) and avoid autoplay with sound.
|
|
85
|
+
- Icons that carry meaning need accessible names. Decorative SVGs get `aria-hidden="true"`.
|
|
86
|
+
|
|
87
|
+
## 7. Forms
|
|
88
|
+
|
|
89
|
+
- Every control has a visible `<label for="id">` (or wraps the input). Placeholder is not a label.
|
|
90
|
+
- Use the right `type` (`email`, `tel`, `url`, `number`, `date`, `password`) and `autocomplete` tokens (`email`, `given-name`, `current-password`, `new-password`, `one-time-code`).
|
|
91
|
+
- Group related controls with `<fieldset>` and `<legend>`.
|
|
92
|
+
- Use `required`, `min`, `max`, `pattern` for client hints, but always validate on the server too.
|
|
93
|
+
- Show errors in text next to the field, linked via `aria-describedby`, and mark invalid fields with `aria-invalid="true"`. Don't rely on color alone.
|
|
94
|
+
- Submit with a real `<button type="submit">` inside a `<form>`.
|
|
95
|
+
|
|
96
|
+
## 8. Tables
|
|
97
|
+
|
|
98
|
+
- Use tables only for tabular data, never for layout.
|
|
99
|
+
- Include `<caption>`, `<thead>`, `<tbody>`, and `<th scope="col|row">`.
|
|
100
|
+
|
|
101
|
+
## 9. Accessibility Essentials
|
|
102
|
+
|
|
103
|
+
- Prefer native elements over ARIA. First rule of ARIA: don't use it if a native element does the job.
|
|
104
|
+
- All functionality works with keyboard only. Logical tab order, no positive `tabindex`.
|
|
105
|
+
- Skip link as the first focusable element: `<a href="#main" class="skip">Skip to content</a>`.
|
|
106
|
+
- Text contrast of at least 4.5:1 (3:1 for large text and UI components), per WCAG 2.2 AA.
|
|
107
|
+
- Don't convey information by color alone.
|
|
108
|
+
- Landmarks (`header`, `nav`, `main`, `footer`) give screen readers navigation points. Label duplicates (`<nav aria-label="Footer">`).
|
|
109
|
+
- Dynamic updates: use `aria-live` regions for status messages. Manage focus for modals and route changes.
|
|
110
|
+
- Respect `prefers-reduced-motion`.
|
|
111
|
+
- Target size for touch/click: at least 24x24 CSS px (aim for 44x44).
|
|
112
|
+
|
|
113
|
+
## 10. Component Framework Notes (JSX shown as an example)
|
|
114
|
+
|
|
115
|
+
- Use `className`, `htmlFor`, and self-close void elements (`<img />`).
|
|
116
|
+
- Lists need stable `key`s, never array indexes for reorderable data.
|
|
117
|
+
- Keep the rendered HTML semantic. A `<div onClick>` in JSX is still wrong.
|
|
118
|
+
|
|
119
|
+
## Review Checklist
|
|
120
|
+
|
|
121
|
+
- [ ] Valid doctype, `lang`, charset, viewport, unique `<title>`
|
|
122
|
+
- [ ] Semantic elements; one `<h1>`; heading levels don't skip
|
|
123
|
+
- [ ] All images have `alt` and dimensions
|
|
124
|
+
- [ ] All form controls have labels and correct `type`/`autocomplete`
|
|
125
|
+
- [ ] Buttons vs links used correctly; `type` set on buttons
|
|
126
|
+
- [ ] Keyboard-operable with visible focus
|
|
127
|
+
- [ ] No duplicate `id`s; passes an HTML validator and an accessibility check (axe/Lighthouse)
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: seo-best-practices
|
|
3
|
+
description: Technical and on-page SEO rules for web applications. Use when building or reviewing pages, routing, metadata, structured data, sitemaps, rendering strategy (SSR/SSG/CSR), performance (Core Web Vitals), international sites, or when a page must rank in search.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SEO Implementation Best Practices
|
|
7
|
+
|
|
8
|
+
SEO is mostly good engineering: crawlable, fast, semantic pages with unique, useful content. Follow these rules when implementing pages. Verify current guidance against Google Search Central when in doubt, as recommendations change.
|
|
9
|
+
|
|
10
|
+
## 1. Rendering Strategy (Crawlability)
|
|
11
|
+
|
|
12
|
+
- Content that must rank must be in the initial HTML response. Prefer **SSG** (static) or **SSR** for public, indexable pages. Use client-side rendering (CSR) only for authenticated or non-indexable areas.
|
|
13
|
+
- With a client-side framework (React, Vue, Svelte, etc.), render public pages with SSR/SSG (for example Next.js, Nuxt, SvelteKit, Astro).
|
|
14
|
+
- Don't hide primary content behind clicks, tabs that require JS fetches, or infinite scroll without paginated URLs.
|
|
15
|
+
- Use real `<a href>` links for navigation, not `onClick` handlers. Crawlers follow `href`.
|
|
16
|
+
- Each distinct view has its own URL (no `#` fragment routing for indexable content). Use the History API / framework routing.
|
|
17
|
+
- Return correct HTTP status codes: `200` OK, `301`/`308` permanent redirect, `404` for missing pages, `410` for permanently removed, `5xx` only for real errors. Never return `200` for a "not found" page (soft 404).
|
|
18
|
+
|
|
19
|
+
## 2. URLs
|
|
20
|
+
|
|
21
|
+
- Short, lowercase, hyphen-separated, descriptive: `/guides/react-solid-principles`.
|
|
22
|
+
- No session IDs or unnecessary parameters in indexable URLs.
|
|
23
|
+
- Pick one canonical form (trailing slash or not, `www` or not, HTTPS) and 301 the others to it.
|
|
24
|
+
- Keep URLs stable. When they change, 301 redirect old to new (avoid redirect chains).
|
|
25
|
+
|
|
26
|
+
## 3. Title and Meta Tags
|
|
27
|
+
|
|
28
|
+
Per page, unique and written for humans:
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<title>Primary Keyword – Secondary | Brand</title>
|
|
32
|
+
<meta name="description" content="One or two sentences that summarise the page and encourage a click.">
|
|
33
|
+
<link rel="canonical" href="https://example.com/guides/react-solid-principles">
|
|
34
|
+
<meta name="robots" content="index,follow">
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- **Title:** unique per page, roughly 50–60 characters, key topic first, brand last.
|
|
38
|
+
- **Meta description:** unique, roughly 120–160 characters. It doesn't directly affect ranking but influences click-through. Search engines may rewrite it.
|
|
39
|
+
- **Canonical:** every indexable page has a self-referencing absolute canonical URL. Use it to consolidate duplicates (filters, tracking parameters).
|
|
40
|
+
- **Robots:** `noindex` for thin, duplicate, internal-search, staging and account pages. Don't combine `noindex` with a `robots.txt` block, because the crawler must be able to fetch the page to see the tag.
|
|
41
|
+
- `meta keywords` is ignored. Don't bother.
|
|
42
|
+
|
|
43
|
+
## 4. Open Graph and Social Cards
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<meta property="og:type" content="article">
|
|
47
|
+
<meta property="og:title" content="...">
|
|
48
|
+
<meta property="og:description" content="...">
|
|
49
|
+
<meta property="og:url" content="https://example.com/...">
|
|
50
|
+
<meta property="og:image" content="https://example.com/og/page.png">
|
|
51
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- Absolute URLs, image about 1200×630.
|
|
55
|
+
- Not a ranking factor, but controls how links look when shared.
|
|
56
|
+
|
|
57
|
+
## 5. Content Structure
|
|
58
|
+
|
|
59
|
+
- One `<h1>` that matches the page's main topic. Logical `h2`/`h3` hierarchy (see `html-syntax-and-semantics`).
|
|
60
|
+
- Content must be original, useful and satisfy search intent. No keyword stuffing, hidden text or doorway pages.
|
|
61
|
+
- Descriptive link anchor text; link related pages together (internal linking). Every important page is reachable within a few clicks from the home page.
|
|
62
|
+
- Image `alt` text that describes the image, descriptive filenames (`react-hooks-diagram.png`).
|
|
63
|
+
- Use breadcrumbs (visible and in structured data) for hierarchical sites.
|
|
64
|
+
|
|
65
|
+
## 6. Structured Data (JSON-LD)
|
|
66
|
+
|
|
67
|
+
Add JSON-LD matching the visible content. Never mark up content that isn't on the page.
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<script type="application/ld+json">
|
|
71
|
+
{
|
|
72
|
+
"@context": "https://schema.org",
|
|
73
|
+
"@type": "Article",
|
|
74
|
+
"headline": "The SOLID Principles in React",
|
|
75
|
+
"author": { "@type": "Person", "name": "Jane Doe" },
|
|
76
|
+
"datePublished": "2026-11-11",
|
|
77
|
+
"image": "https://example.com/og/solid.png"
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- Common types: `Organization`, `WebSite`, `Article`/`BlogPosting`, `BreadcrumbList`, `Product` (+ `Offer`, `AggregateRating` only with real reviews), `FAQPage`, `LocalBusiness`, `Event`, `JobPosting`.
|
|
83
|
+
- Check eligibility for rich results in Google's docs, since some types are restricted.
|
|
84
|
+
- Validate with Google's Rich Results Test and the Schema Markup Validator.
|
|
85
|
+
|
|
86
|
+
## 7. Performance and Core Web Vitals
|
|
87
|
+
|
|
88
|
+
Page experience metrics influence ranking and conversions. Targets (at the 75th percentile of real users):
|
|
89
|
+
|
|
90
|
+
| Metric | Good |
|
|
91
|
+
|---|---|
|
|
92
|
+
| LCP (Largest Contentful Paint) | ≤ 2.5 s |
|
|
93
|
+
| INP (Interaction to Next Paint) | ≤ 200 ms |
|
|
94
|
+
| CLS (Cumulative Layout Shift) | ≤ 0.1 |
|
|
95
|
+
|
|
96
|
+
How to hit them:
|
|
97
|
+
- **LCP:** optimize and preload the hero image, use `fetchpriority="high"`, serve via CDN, use SSR/SSG, minimize render-blocking CSS/JS, compress (Brotli/gzip), cache aggressively.
|
|
98
|
+
- **INP:** break up long JS tasks, defer non-critical scripts, avoid heavy synchronous work in handlers, code-split.
|
|
99
|
+
- **CLS:** set image/video dimensions, reserve space for ads/embeds, avoid inserting content above existing content, use `font-display: swap` with size-adjusted fallback fonts.
|
|
100
|
+
- Use modern image formats, responsive `srcset`, lazy loading below the fold.
|
|
101
|
+
- Measure with real-user data (CrUX, `web-vitals` library) and Lighthouse/PageSpeed Insights. Lab results alone are not enough.
|
|
102
|
+
|
|
103
|
+
## 8. Mobile and Security
|
|
104
|
+
|
|
105
|
+
- Responsive design and the viewport meta tag. Google indexes the mobile version first, so mobile content must equal desktop content.
|
|
106
|
+
- HTTPS everywhere with HSTS. No mixed content.
|
|
107
|
+
- Fix intrusive interstitials.
|
|
108
|
+
|
|
109
|
+
## 9. Crawl Control
|
|
110
|
+
|
|
111
|
+
**robots.txt** (at the site root):
|
|
112
|
+
```
|
|
113
|
+
User-agent: *
|
|
114
|
+
Disallow: /admin/
|
|
115
|
+
Disallow: /api/
|
|
116
|
+
Sitemap: https://example.com/sitemap.xml
|
|
117
|
+
```
|
|
118
|
+
- `robots.txt` controls crawling, not indexing. Use `noindex` (meta or `X-Robots-Tag`) to keep pages out of results.
|
|
119
|
+
- Don't block CSS/JS/images that are needed to render pages.
|
|
120
|
+
|
|
121
|
+
**XML sitemap:**
|
|
122
|
+
- List only canonical, indexable, `200` URLs. Include accurate `<lastmod>`. Max 50,000 URLs or 50 MB per file; use a sitemap index beyond that.
|
|
123
|
+
- Generate it automatically at build or request time. Reference it in `robots.txt` and submit it in Google Search Console and Bing Webmaster Tools.
|
|
124
|
+
|
|
125
|
+
## 10. Pagination, Filters and Duplicates
|
|
126
|
+
|
|
127
|
+
- Paginated lists use crawlable links (`?page=2` or `/page/2`) with self-canonical URLs. Don't canonicalize page 2+ to page 1.
|
|
128
|
+
- Faceted/filter URLs that create near-infinite combinations: canonicalize to the main category, or `noindex`/disallow low-value combinations.
|
|
129
|
+
- Avoid duplicate content across `http/https`, `www`, trailing slash, and uppercase/lowercase variants.
|
|
130
|
+
|
|
131
|
+
## 11. International SEO
|
|
132
|
+
|
|
133
|
+
- Use `hreflang` annotations (HTML `<link>`, HTTP header or sitemap), bidirectional and including `x-default`:
|
|
134
|
+
```html
|
|
135
|
+
<link rel="alternate" hreflang="en" href="https://example.com/en/">
|
|
136
|
+
<link rel="alternate" hreflang="pt-PT" href="https://example.com/pt/">
|
|
137
|
+
<link rel="alternate" hreflang="x-default" href="https://example.com/">
|
|
138
|
+
```
|
|
139
|
+
- Distinct URLs per language (subdirectory, subdomain or ccTLD). Don't auto-redirect users based on IP without letting crawlers reach every version.
|
|
140
|
+
- Set `<html lang>` correctly.
|
|
141
|
+
|
|
142
|
+
## 12. Site Migrations and Maintenance
|
|
143
|
+
|
|
144
|
+
- Before changing URLs or domains: map every old URL to a new one with 301 redirects, keep the sitemap updated, and monitor Search Console for coverage errors.
|
|
145
|
+
- Regularly fix broken links, redirect chains, soft 404s and slow pages.
|
|
146
|
+
- Monitor indexing and queries in Google Search Console. Track Core Web Vitals field data.
|
|
147
|
+
|
|
148
|
+
## Review Checklist
|
|
149
|
+
|
|
150
|
+
- [ ] Indexable content is present in server-rendered/static HTML
|
|
151
|
+
- [ ] Unique `<title>`, meta description, self-referencing canonical on each page
|
|
152
|
+
- [ ] One `<h1>`, semantic headings, descriptive links, image `alt`
|
|
153
|
+
- [ ] Correct status codes and 301s; no soft 404s or redirect chains
|
|
154
|
+
- [ ] `robots.txt` and XML sitemap present, accurate and submitted
|
|
155
|
+
- [ ] JSON-LD that matches visible content and validates
|
|
156
|
+
- [ ] Core Web Vitals meet targets in field data
|
|
157
|
+
- [ ] `hreflang` set up (if multilingual); mobile parity; HTTPS only
|
|
158
|
+
- [ ] Non-public pages (admin, staging, search, cart) are `noindex` or protected
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## Web Skills
|
|
2
|
+
|
|
3
|
+
| Area | Skill | Load when |
|
|
4
|
+
|---|---|---|
|
|
5
|
+
| HTML & accessibility | `html-syntax-and-semantics` | Writing any markup or component templates (JSX etc.), forms, images, a11y |
|
|
6
|
+
| SEO | `seo-best-practices` | Public pages, metadata, routing, rendering mode, performance |
|
|
7
|
+
|
|
8
|
+
Definition of Done additions for user-facing pages:
|
|
9
|
+
|
|
10
|
+
- [ ] Accessible (keyboard, labels, contrast), checked against `html-syntax-and-semantics`
|
|
11
|
+
- [ ] Discoverable and performant (metadata, Core Web Vitals) where relevant, checked against `seo-best-practices`
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# node-backend preset: setup
|
|
2
|
+
|
|
3
|
+
Installed by agent-kit. This preset adds tooling for a Node.js + TypeScript backend: ESLint (typescript-eslint, Node globals), Prettier, EditorConfig, and commitlint + husky + lint-staged. With `--pack github` it also adds CI, release-please and Dependabot. It adds no skills of its own: the core skills (`backend-architecture-principles`, `api-design-rest`, `backend-security`, `database-best-practices`) already cover backend work.
|
|
4
|
+
|
|
5
|
+
The installer never edits `package.json`. Run the commands below yourself.
|
|
6
|
+
|
|
7
|
+
## 1. Install the tooling
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -D \
|
|
11
|
+
eslint @eslint/js typescript typescript-eslint globals eslint-config-prettier \
|
|
12
|
+
prettier husky lint-staged @commitlint/cli @commitlint/config-conventional
|
|
13
|
+
|
|
14
|
+
npm pkg set scripts.prepare="husky"
|
|
15
|
+
npm pkg set scripts.lint="eslint ."
|
|
16
|
+
npm pkg set scripts.format="prettier --write ."
|
|
17
|
+
npm pkg set scripts.format:check="prettier --check ."
|
|
18
|
+
npm pkg set scripts.typecheck="tsc --noEmit"
|
|
19
|
+
|
|
20
|
+
npm run prepare # activates the git hooks in .husky/ (sets core.hooksPath)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Verified on 2026-11-11 with npm 11: this resolves ESLint 10 and TypeScript 6.0.x. `typescript-eslint` 8.x supports ESLint 10 but only TypeScript below 6.1, and npm picks a compatible TypeScript automatically. If you pin TypeScript yourself, stay on 6.0.x until `typescript-eslint` supports TypeScript 7 (`npm view typescript-eslint peerDependencies`).
|
|
24
|
+
|
|
25
|
+
Add `tsconfig.json`, a test runner (`node:test`, Vitest or Jest) and `test` / `build` scripts for your project. They are intentionally not included.
|
|
26
|
+
|
|
27
|
+
Using pnpm or yarn? Swap the install commands, replace `npm ci` / `npm audit` in `.github/workflows/ci.yml`, and change `npx` in `.husky/*` to `pnpm exec` / `yarn`.
|
|
28
|
+
|
|
29
|
+
## 2. Check it works
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
echo "feat(api): add order export" | npx commitlint # passes
|
|
33
|
+
echo "Added stuff." | npx commitlint # fails
|
|
34
|
+
npm run lint
|
|
35
|
+
npx prettier --check .
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Husky v9 hook files have no shebang and need the exec bit on macOS/Linux (the installer sets it there). On Windows, run `git update-index --chmod=+x .husky/pre-commit .husky/commit-msg` before committing them.
|
|
39
|
+
|
|
40
|
+
## 3. GitHub repository settings (only with `--pack github`)
|
|
41
|
+
|
|
42
|
+
1. **Pull requests: allow squash merging only**, with *Default to pull request title* as the commit message. This makes the PR title the release note.
|
|
43
|
+
2. **Branch protection on `main`**: require a pull request, require the `checks` and `pr-title` status checks, block force pushes.
|
|
44
|
+
3. **Actions > General > Workflow permissions**: *Read and write*, and tick **Allow GitHub Actions to create and approve pull requests** (needed by release-please).
|
|
45
|
+
4. Optional: add a `RELEASE_PLEASE_TOKEN` secret (PAT or GitHub App token) and pass it in `.github/workflows/release-please.yml`. PRs opened with the default `GITHUB_TOKEN` do not trigger other workflows, so without it CI does not run on the release PR.
|
|
46
|
+
|
|
47
|
+
CI (`.github/workflows/ci.yml`) runs `npm ci`, then lint, format check, typecheck, test and build (each with `--if-present`; remove the flag once the script exists so a missing script fails the build), and `npm audit --omit=dev --audit-level=high`. Set `node-version` to the version you deploy on.
|
|
48
|
+
|
|
49
|
+
## 4. How releases work (only with `--pack github`)
|
|
50
|
+
|
|
51
|
+
release-please uses `release-type: node`: it bumps `version` in `package.json`, writes `CHANGELOG.md` and tags `vX.Y.Z` when you merge its release PR. The first release starts from `0.0.0` in `.release-please-manifest.json`. `feat` is Added, `fix` is Fixed, `perf` and `revert` are Changed; other types are hidden. Below 1.0.0, breaking changes bump minor.
|
|
52
|
+
|
|
53
|
+
Without the github pack, release-please files are not installed and the `changelog-and-versioning` skill uses manual mode.
|
|
54
|
+
|
|
55
|
+
## 5. Customize
|
|
56
|
+
|
|
57
|
+
- **Scopes:** uncomment `scope-enum` in `commitlint.config.mjs`.
|
|
58
|
+
- **Type-aware lint rules:** switch to `tseslint.configs.recommendedTypeChecked` and add `languageOptions.parserOptions.projectService: true` once `tsconfig.json` exists (slower, catches floating promises and unsafe `any`).
|
|
59
|
+
- **Ignore lists:** add your own lines to `.gitignore` / `.prettierignore` outside the `agent-kit` markers.
|
|
60
|
+
- **Not using release-please?** Delete `release-please-config.json`, `.release-please-manifest.json` and `.github/workflows/release-please.yml`; the `changelog-and-versioning` skill switches to manual mode.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx --no -- commitlint --edit "$1"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx lint-staged
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Enforces Conventional Commits. See the git-commit-and-workflow skill.
|
|
2
|
+
export default {
|
|
3
|
+
extends: ['@commitlint/config-conventional'],
|
|
4
|
+
rules: {
|
|
5
|
+
// Subject line (header) at most 72 characters.
|
|
6
|
+
'header-max-length': [2, 'always', 72],
|
|
7
|
+
// Body lines: warn above 100 chars (URLs and stack traces can be long).
|
|
8
|
+
'body-max-line-length': [1, 'always', 100],
|
|
9
|
+
// Uncomment to restrict scopes to your project's modules:
|
|
10
|
+
// 'scope-enum': [2, 'always', ['auth', 'checkout', 'api', 'db', 'ui', 'deps', 'release']],
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// ESLint flat config for a Node.js + TypeScript backend.
|
|
2
|
+
// Rules here back up the backend-architecture-principles and backend-security skills.
|
|
3
|
+
import js from '@eslint/js';
|
|
4
|
+
import globals from 'globals';
|
|
5
|
+
import tseslint from 'typescript-eslint';
|
|
6
|
+
import prettier from 'eslint-config-prettier';
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
{ ignores: ['dist', 'build', 'coverage', 'node_modules', 'CHANGELOG.md'] },
|
|
10
|
+
|
|
11
|
+
js.configs.recommended,
|
|
12
|
+
...tseslint.configs.recommended,
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
files: ['**/*.{js,mjs,cjs,ts,mts,cts}'],
|
|
16
|
+
languageOptions: {
|
|
17
|
+
globals: { ...globals.node },
|
|
18
|
+
},
|
|
19
|
+
rules: {
|
|
20
|
+
// TypeScript
|
|
21
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
22
|
+
'@typescript-eslint/no-unused-vars': [
|
|
23
|
+
'error',
|
|
24
|
+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
|
25
|
+
],
|
|
26
|
+
|
|
27
|
+
// General
|
|
28
|
+
eqeqeq: ['error', 'always'],
|
|
29
|
+
'no-console': ['warn', { allow: ['warn', 'error'] }], // use the app logger
|
|
30
|
+
'no-eval': 'error',
|
|
31
|
+
'no-implied-eval': 'error',
|
|
32
|
+
'no-new-func': 'error',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Must stay last: turns off rules that conflict with Prettier.
|
|
37
|
+
prettier,
|
|
38
|
+
];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
|
|
3
|
+
"release-type": "node",
|
|
4
|
+
"include-component-in-tag": false,
|
|
5
|
+
"bump-minor-pre-major": true,
|
|
6
|
+
"bump-patch-for-minor-pre-major": false,
|
|
7
|
+
"packages": {
|
|
8
|
+
".": {
|
|
9
|
+
"changelog-path": "CHANGELOG.md"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"changelog-sections": [
|
|
13
|
+
{ "type": "feat", "section": "Added" },
|
|
14
|
+
{ "type": "fix", "section": "Fixed" },
|
|
15
|
+
{ "type": "perf", "section": "Changed" },
|
|
16
|
+
{ "type": "revert", "section": "Changed" },
|
|
17
|
+
{ "type": "docs", "section": "Documentation", "hidden": true },
|
|
18
|
+
{ "type": "style", "section": "Styles", "hidden": true },
|
|
19
|
+
{ "type": "refactor", "section": "Refactoring", "hidden": true },
|
|
20
|
+
{ "type": "test", "section": "Tests", "hidden": true },
|
|
21
|
+
{ "type": "build", "section": "Build", "hidden": true },
|
|
22
|
+
{ "type": "ci", "section": "CI", "hidden": true },
|
|
23
|
+
{ "type": "chore", "section": "Chores", "hidden": true }
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
### GitHub automation (node-backend preset + github pack)
|
|
2
|
+
|
|
3
|
+
| Tool | Config | Enforces |
|
|
4
|
+
|---|---|---|
|
|
5
|
+
| CI | `.github/workflows/ci.yml` | Lint, format check, typecheck, test, build, dependency audit |
|
|
6
|
+
| release-please | `release-please-config.json`, `.release-please-manifest.json`, `.github/workflows/release-please.yml` | Version bumps, `CHANGELOG.md`, tags. Don't hand-edit `CHANGELOG.md` or version fields |
|
|
7
|
+
| Dependabot | `.github/dependabot.yml` | Weekly npm and GitHub Actions updates with Conventional Commit messages |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## Node.js backend (TypeScript)
|
|
2
|
+
|
|
3
|
+
### Tooling (installed by the node-backend preset; don't work around it)
|
|
4
|
+
|
|
5
|
+
| Tool | Config | Enforces |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| commitlint + husky `commit-msg` | `commitlint.config.mjs`, `.husky/commit-msg` | Conventional Commit format on every commit |
|
|
8
|
+
| lint-staged + husky `pre-commit` | `.lintstagedrc.json`, `.husky/pre-commit` | ESLint and Prettier on staged files |
|
|
9
|
+
| ESLint | `eslint.config.mjs` | TypeScript rules, Node globals, no `eval`, no stray `console` |
|
|
10
|
+
| Prettier | `.prettierrc.json`, `.prettierignore` | Formatting |
|
|
11
|
+
| EditorConfig | `.editorconfig` | Charset, line endings, indentation |
|
|
12
|
+
|
|
13
|
+
Never bypass these (`--no-verify`, disabling rules to make a check pass). Fix the underlying issue. Setup and versions: `docs/agent-kit/node-backend.md`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Build output
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
coverage/
|
|
8
|
+
|
|
9
|
+
# Environment and secrets (keep .env.example)
|
|
10
|
+
.env
|
|
11
|
+
.env.*
|
|
12
|
+
!.env.example
|
|
13
|
+
|
|
14
|
+
# Logs and OS/editor files
|
|
15
|
+
*.log
|
|
16
|
+
.DS_Store
|
|
17
|
+
.idea/
|
|
18
|
+
.vscode/*
|
|
19
|
+
!.vscode/extensions.json
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
node_modules
|
|
2
|
+
dist
|
|
3
|
+
build
|
|
4
|
+
coverage
|
|
5
|
+
package-lock.json
|
|
6
|
+
pnpm-lock.yaml
|
|
7
|
+
yarn.lock
|
|
8
|
+
CHANGELOG.md
|
|
9
|
+
.release-please-manifest.json
|
|
10
|
+
# Files agent-kit owns and compares on every install (formatting them would cause .new conflicts)
|
|
11
|
+
AGENTS.md
|
|
12
|
+
CLAUDE.md
|
|
13
|
+
.claude/
|
|
14
|
+
docs/agent-kit/
|
|
15
|
+
.github/ISSUE_TEMPLATE/
|
|
16
|
+
.github/pull_request_template.md
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: npm
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
open-pull-requests-limit: 5
|
|
8
|
+
commit-message:
|
|
9
|
+
prefix: build
|
|
10
|
+
include: scope # produces "build(deps): bump ..."
|
|
11
|
+
groups:
|
|
12
|
+
dev-dependencies:
|
|
13
|
+
dependency-type: development
|
|
14
|
+
|
|
15
|
+
- package-ecosystem: github-actions
|
|
16
|
+
directory: /
|
|
17
|
+
schedule:
|
|
18
|
+
interval: weekly
|
|
19
|
+
commit-message:
|
|
20
|
+
prefix: ci
|
|
21
|
+
include: scope
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ci-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
checks:
|
|
17
|
+
name: checks
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: 24 # adjust to your project's supported Node version
|
|
25
|
+
cache: npm
|
|
26
|
+
|
|
27
|
+
- run: npm ci
|
|
28
|
+
|
|
29
|
+
# Scripts are skipped if not defined (--if-present). Remove the flag once
|
|
30
|
+
# your project defines them, so a missing script fails the build.
|
|
31
|
+
- run: npm run lint --if-present
|
|
32
|
+
- run: npm run format:check --if-present
|
|
33
|
+
- run: npm run typecheck --if-present
|
|
34
|
+
- run: npm test --if-present
|
|
35
|
+
- run: npm run build --if-present
|
|
36
|
+
|
|
37
|
+
- name: Audit production dependencies
|
|
38
|
+
run: npm audit --omit=dev --audit-level=high
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: release-please
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
pull-requests: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
release-please:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: googleapis/release-please-action@v4
|
|
16
|
+
with:
|
|
17
|
+
config-file: release-please-config.json
|
|
18
|
+
manifest-file: .release-please-manifest.json
|
|
19
|
+
# PRs opened with the default GITHUB_TOKEN do not trigger other workflows (e.g. CI).
|
|
20
|
+
# If you want CI to run on the release PR, create a PAT or GitHub App token
|
|
21
|
+
# and pass it here: token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|