@a2f0/agent-tool 0.1.68 → 0.1.70
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/README.md +4 -3
- package/package.json +1 -1
- package/skills/app-store-readiness/SKILL.md +148 -0
- package/skills/app-store-readiness/agents/openai.yaml +4 -0
- package/skills/app-store-readiness/references/android.md +53 -0
- package/skills/app-store-readiness/references/ios.md +82 -0
- package/skills/app-store-readiness/references/web.md +38 -0
- package/skills/audit-trails/SKILL.md +129 -0
- package/skills/audit-trails/agents/openai.yaml +4 -0
- package/skills/audit-trails/references/report-template.md +78 -0
- package/skills/audit-trails/references/usage-receipts.md +196 -0
- package/skills/seo-optimization/SKILL.md +162 -0
- package/skills/seo-optimization/agents/openai.yaml +4 -0
- package/skills/seo-optimization/references/cloudflare-workers.md +211 -0
- package/skills/seo-optimization/references/frameworks.md +144 -0
- package/skills/seo-optimization/references/standard.md +219 -0
- package/src/cli.ts +3 -0
- package/src/config.ts +3 -2
- package/src/doctor.ts +2 -1
- package/src/permissions/catalog.ts +1 -0
- package/src/review/solicitOpencodeReview.ts +64 -27
- package/src/seo/html.ts +138 -0
- package/src/seo/http.ts +124 -0
- package/src/seo/probe.ts +250 -0
- package/src/skills/bundled.ts +22 -2
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Framework notes
|
|
2
|
+
|
|
3
|
+
## Astro
|
|
4
|
+
|
|
5
|
+
- Inject the tier with `vite.define` on an `import.meta.env.PUBLIC_*` value,
|
|
6
|
+
so `astro.config.*` and the pages agree on it. Astro integrations do not
|
|
7
|
+
receive `--mode`; record it from a Vite plugin's `configResolved` hook, and
|
|
8
|
+
throw when it is missing.
|
|
9
|
+
- Write JSON-LD with
|
|
10
|
+
`<script is:inline type="application/ld+json" set:html={json}>` and escape
|
|
11
|
+
`<` as `\u003c` in the serialized JSON.
|
|
12
|
+
- When conditional tags go into a named slot, wrap them as
|
|
13
|
+
`<Fragment slot="head">{condition && …}</Fragment>` rather than putting the
|
|
14
|
+
condition around an element that carries `slot=`. Test that the output
|
|
15
|
+
lands inside `<head>`.
|
|
16
|
+
- In `astro:build:done`, page pathnames look like `""`, `"privacy/"`, and
|
|
17
|
+
`"404/"`. Filter error pages out of the sitemap. `@astrojs/sitemap` works,
|
|
18
|
+
or a small integration can write `sitemap.xml` and `robots.txt` from the
|
|
19
|
+
built pages.
|
|
20
|
+
- Knip treats `astro.config.*` as plugin configuration, so a new integration
|
|
21
|
+
file it imports may need to be listed as a production entry.
|
|
22
|
+
|
|
23
|
+
## Next.js static export
|
|
24
|
+
|
|
25
|
+
- A page that renders only on the client (`autoExport` with an empty
|
|
26
|
+
`<div id="__next">`) gives crawlers nothing. `next/head` tags in a
|
|
27
|
+
statically exported page do reach the HTML; the main copy needs build-time
|
|
28
|
+
rendering, which is content work.
|
|
29
|
+
- With the pages router, put tier-wide tags such as the staging robots meta
|
|
30
|
+
in `_document.tsx`, so `404.html` gets them too. Inline the tier through
|
|
31
|
+
`next.config` `env` so the browser hydrates with the same tags; otherwise
|
|
32
|
+
`next/head` can add or drop them on the client.
|
|
33
|
+
- Do not import relative TypeScript into `next.config.ts`.
|
|
34
|
+
- Add an explicit `pages/404.tsx` so the error page's head (noindex, no
|
|
35
|
+
canonical, no `og:url`) is under the app's control, and pair it with
|
|
36
|
+
`not_found_handling: "404-page"` when missing paths should get it.
|
|
37
|
+
- When two `next/head` instances emit the same tag, whichever re-rendered
|
|
38
|
+
last wins, even with matching `key`s. Keep one owner for a dynamic tag such
|
|
39
|
+
as `theme-color`. When the theme provider renders on the client below
|
|
40
|
+
`<Head>`, read the attribute it stamps on `<html>` instead.
|
|
41
|
+
- `next build` clears `out/`, so write `robots.txt`, `sitemap.xml`, and
|
|
42
|
+
`_headers` after it. With a single-page fallback on the host, a missing
|
|
43
|
+
file is answered with HTML.
|
|
44
|
+
|
|
45
|
+
## Monorepo tooling
|
|
46
|
+
|
|
47
|
+
- Turborepo strict environment mode drops undeclared variables, so declare a
|
|
48
|
+
tier variable in `turbo.json` `env`. Declaring it also keeps the two tiers'
|
|
49
|
+
caches apart.
|
|
50
|
+
- In a package script, `VAR=x a && b` sets the variable for `a` only.
|
|
51
|
+
- A broad ignore pattern such as `build/` can also match a new
|
|
52
|
+
`scripts/build/` file, so `git add -A` silently skips it. Run
|
|
53
|
+
`git check-ignore` on new files.
|
|
54
|
+
- A production check of "no noindex anywhere" fails when a site copies
|
|
55
|
+
deliberately noindexed pages from a package. Check the header rules and the
|
|
56
|
+
pages the site owns.
|
|
57
|
+
- When a package's pages are copied into another site, give them absolute
|
|
58
|
+
canonical, `og:url`, and JSON-LD URLs on their own production host, never
|
|
59
|
+
derived from the request host, so the copies point back to the original.
|
|
60
|
+
Keep robots.txt, the sitemap, the preview image, and the 404 page out of
|
|
61
|
+
the package; they belong at the deployment root. Any change to files in
|
|
62
|
+
the published tarball follows the repository's versioning policy, and the
|
|
63
|
+
report names the release a consuming site needs.
|
|
64
|
+
- Tests that fetch every `src` and `href` in a page will fetch an absolute
|
|
65
|
+
canonical from the live network; filter them to relative references.
|
|
66
|
+
|
|
67
|
+
## Theme-color with a theme switch
|
|
68
|
+
|
|
69
|
+
Keep one owner for the tag. The simplest owner is the script that applies the
|
|
70
|
+
saved theme before first paint: let it write `theme-color` and watch the
|
|
71
|
+
theme attribute it sets (for example `data-theme` on `<html>`), so framework
|
|
72
|
+
components never write the tag.
|
|
73
|
+
|
|
74
|
+
## Runtime titles
|
|
75
|
+
|
|
76
|
+
Code that sets `document.title` after load, such as the name of an open
|
|
77
|
+
document, replaces the static title that crawlers which run JavaScript index.
|
|
78
|
+
Search for `document.title` before writing a static title. When the product
|
|
79
|
+
behavior must stay, use the form `<document> · <what the page is> · <brand>`;
|
|
80
|
+
the brand alone is not descriptive. Check whether the title callback is part
|
|
81
|
+
of a published API before changing it, and read the rendered title in a
|
|
82
|
+
headless browser after the app mounts, not at the load event.
|
|
83
|
+
|
|
84
|
+
## Vite single-page apps
|
|
85
|
+
|
|
86
|
+
- Put static tags in `index.html`. For tier-conditional tags, use a plugin
|
|
87
|
+
hook such as `transformIndexHtml`, or `vite-plugin-html`'s `inject.tags`.
|
|
88
|
+
EJS scriptlets in `index.html` can break linters that parse HTML, such as
|
|
89
|
+
Biome.
|
|
90
|
+
- The public directory is copied before `writeBundle`, so a plugin can edit
|
|
91
|
+
the built `_headers` there. Insert into the existing `/*` rule.
|
|
92
|
+
- An extensionless relative import in `vite.config.ts` can trigger Vite's
|
|
93
|
+
native config loader warning; keep small plugins inline or use an explicit
|
|
94
|
+
extension.
|
|
95
|
+
- To give a client-routed site per-route metadata without a framework
|
|
96
|
+
change, list the routes once and write one copy of the app shell per route
|
|
97
|
+
(for example `company.html`) with that route's tags. Then switch the host to
|
|
98
|
+
a 404 page that is the same shell, so client routing still works. Every
|
|
99
|
+
routed path needs its own document, including flag-gated and nested routes,
|
|
100
|
+
or a reload of that path returns 404.
|
|
101
|
+
- Model the head tags once, render them at build time, and reapply them on
|
|
102
|
+
client navigation. Updating only `document.title` leaves a stale canonical,
|
|
103
|
+
description, and robots tag; reviewers rate that as a major finding.
|
|
104
|
+
|
|
105
|
+
## Bun's HTML bundler
|
|
106
|
+
|
|
107
|
+
It leaves absolute canonical and Open Graph URLs and JSON-LD blocks
|
|
108
|
+
untouched, so static tags in the source HTML survive the build.
|
|
109
|
+
|
|
110
|
+
## react-native-web
|
|
111
|
+
|
|
112
|
+
- The page is empty until the bundle runs; record that as a recommendation
|
|
113
|
+
when you cannot prerender a static summary.
|
|
114
|
+
- `accessibilityRole="header"` renders an `<h1>` with no visual change and
|
|
115
|
+
marks the heading for native screen readers.
|
|
116
|
+
|
|
117
|
+
## Service workers
|
|
118
|
+
|
|
119
|
+
Apply tier-specific tags after the build but before the precache manifest
|
|
120
|
+
is generated, so the cached shell matches its tier.
|
|
121
|
+
|
|
122
|
+
## Preview images with agent-tool
|
|
123
|
+
|
|
124
|
+
Render `og-image.png` with `agent-tool images` from `assets/brand/` sources:
|
|
125
|
+
an output with `"size": [1200, 630]`, a background or fill layer, and the logo
|
|
126
|
+
layer. The renderer loads no fonts, so the image cannot contain text unless
|
|
127
|
+
it is converted to paths. Choosing the target:
|
|
128
|
+
|
|
129
|
+
- Default to a separate target, such as `social`, beside `favicons`, and
|
|
130
|
+
follow `dir` targets when the repository already uses them.
|
|
131
|
+
- Extending an existing target is fine when only one package uses it and no
|
|
132
|
+
test ties it to the linked icons; a target shared by several packages
|
|
133
|
+
through `--out` would put the image in every package's build.
|
|
134
|
+
- Check service worker precache globs: a PNG in a precached `public/` folder
|
|
135
|
+
bloats the offline cache.
|
|
136
|
+
- `build --out <dir>` takes exactly one target and an absolute or
|
|
137
|
+
repository-relative directory. Repositories that ban committed binaries
|
|
138
|
+
render the image during the build, production only if it is tier-specific.
|
|
139
|
+
|
|
140
|
+
Sources must meet agent-tool's rules in its `docs/images.md`: `<title>`,
|
|
141
|
+
`<desc>`, and `<metadata>` are allowed, while `<style>`, `style` attributes,
|
|
142
|
+
text, and elements from editor namespaces are not. The practical test is
|
|
143
|
+
whether `agent-tool images build` succeeds. When the only logo is an editor
|
|
144
|
+
export that fails, record the needed plain SVG instead of rendering from it.
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Standard by host class
|
|
2
|
+
|
|
3
|
+
Read "Every host" and the sections for the host classes you found. Sources
|
|
4
|
+
worth opening when a rule matters:
|
|
5
|
+
[Google Search Central](https://developers.google.com/search/docs),
|
|
6
|
+
[robots meta and X-Robots-Tag](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag),
|
|
7
|
+
[canonical URLs](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls),
|
|
8
|
+
[sitemaps](https://www.sitemaps.org/protocol.html),
|
|
9
|
+
[structured data policies](https://developers.google.com/search/docs/appearance/structured-data/sd-policies),
|
|
10
|
+
and [the Open Graph protocol](https://ogp.me/).
|
|
11
|
+
|
|
12
|
+
## Every host
|
|
13
|
+
|
|
14
|
+
- Every HTML page carries one `theme-color` that matches its top chrome, or
|
|
15
|
+
its background when it has no header, in each theme. When views differ, use
|
|
16
|
+
the first view a visitor sees, such as the sign-in page.
|
|
17
|
+
- When an in-app appearance toggle changes that color, the tag must follow it
|
|
18
|
+
at runtime, not only through `prefers-color-scheme` variants, and exactly
|
|
19
|
+
one piece of code may own it. This is browser chrome, not ranking: when
|
|
20
|
+
following an app's own theme system needs app UI work, record it as a
|
|
21
|
+
recommendation instead.
|
|
22
|
+
- Hosts that this repository's infrastructure binds but another repository
|
|
23
|
+
builds and deploys belong to that repository's pass.
|
|
24
|
+
|
|
25
|
+
## Non-production tiers
|
|
26
|
+
|
|
27
|
+
A repository with only a production tier skips this section, but still
|
|
28
|
+
checks the platform's duplicate hosts, such as `*.workers.dev`.
|
|
29
|
+
|
|
30
|
+
- Send `X-Robots-Tag: noindex, nofollow` on every response, including assets,
|
|
31
|
+
fallbacks, error pages, redirects, and robots.txt. A non-production API host
|
|
32
|
+
that answers only JSON follows the API rule under
|
|
33
|
+
[Internal hosts](#internal-hosts).
|
|
34
|
+
- Put `<meta name="robots" content="noindex, nofollow">` in every HTML
|
|
35
|
+
document, so a copied or cached page still carries it.
|
|
36
|
+
- Keep robots.txt crawlable. A missing file or a comments-only managed file
|
|
37
|
+
already is; add or change a file only to remove a `Disallow`. A
|
|
38
|
+
`Disallow: /` stops crawlers from fetching pages, so they never see the
|
|
39
|
+
noindex and can still index a linked URL without its content.
|
|
40
|
+
- Emit no `<link rel="canonical">`, `og:url`, sitemap, or Sitemap line; those
|
|
41
|
+
tell crawlers which URL to index. Other preview tags and structured data may
|
|
42
|
+
stay, including `og:image` at the tier's own host or at production, so that
|
|
43
|
+
shared staging links still preview.
|
|
44
|
+
- A zone-level redirect, such as HTTP to HTTPS, is answered before the
|
|
45
|
+
application and cannot carry the header. Record it; the target carries the
|
|
46
|
+
header.
|
|
47
|
+
- Derive the tier from the mechanism the repository already uses, such as a
|
|
48
|
+
wrangler `env`, a build mode, or a release tier variable. Make the
|
|
49
|
+
production build the explicit choice, fail on an unknown tier, and test
|
|
50
|
+
both outcomes. When one artifact is promoted between tiers, apply the tier
|
|
51
|
+
at deploy time, for example by writing `_headers` per environment, rather
|
|
52
|
+
than breaking promotion.
|
|
53
|
+
- Leave an already-compliant tier unchanged after verifying it.
|
|
54
|
+
|
|
55
|
+
## Content hosts
|
|
56
|
+
|
|
57
|
+
1. **Static head.** The HTML served before JavaScript runs carries:
|
|
58
|
+
- a unique `<title>` that names what the page is, with the brand (the
|
|
59
|
+
product, or the person or site name on a personal site) last, kept under
|
|
60
|
+
about 60 characters;
|
|
61
|
+
- `<meta name="description">` of up to about 160 characters, written from
|
|
62
|
+
the page's own copy;
|
|
63
|
+
- `<link rel="canonical">` with the absolute production URL in the exact
|
|
64
|
+
form the host serves without redirecting (trailing slash or not);
|
|
65
|
+
- `<html lang>`, the viewport tag, and `theme-color`.
|
|
66
|
+
|
|
67
|
+
The lengths are limits on what search results show, not targets: a short
|
|
68
|
+
title that names a person or a page is fine, and padding with invented
|
|
69
|
+
copy is not. Shortening an over-long description by choosing from its own
|
|
70
|
+
sentences is a metadata edit; when it would need new wording, record it. A
|
|
71
|
+
page that sets its title only from JavaScript needs static or prerendered
|
|
72
|
+
metadata. When the app localizes text in the browser, localize a
|
|
73
|
+
descriptive `document.title` too.
|
|
74
|
+
2. **Previews.** Add `og:type`, `og:site_name`, `og:title`,
|
|
75
|
+
`og:description`, `og:url` (equal to the canonical), `og:image` (an
|
|
76
|
+
absolute URL to a 1200×630 PNG), `og:image:width`, `og:image:height`,
|
|
77
|
+
`og:image:alt`, and `twitter:card` = `summary_large_image`. Twitter falls
|
|
78
|
+
back to the Open Graph title and description. Without a usable image, omit
|
|
79
|
+
`og:image` and use `twitter:card` = `summary`.
|
|
80
|
+
3. **Structured data.** Add JSON-LD in `<script type="application/ld+json">`:
|
|
81
|
+
- `WebSite` on every content host's home page, and `Organization` when the
|
|
82
|
+
site names its publisher;
|
|
83
|
+
- `SoftwareApplication` or `WebApplication` for a product, with
|
|
84
|
+
`operatingSystem` listing only platforms a visitor can use today and
|
|
85
|
+
`offers` only for prices the site already states;
|
|
86
|
+
- `Person` for a resume, using only facts on the page.
|
|
87
|
+
|
|
88
|
+
Escape `<` inside the JSON, and parse it in a test. Never add ratings or
|
|
89
|
+
reviews that are not on the page.
|
|
90
|
+
4. **robots.txt.** Serve a real `text/plain` file with `User-agent: *`,
|
|
91
|
+
`Allow: /`, any deliberate existing rules, and
|
|
92
|
+
`Sitemap: https://<host>/sitemap.xml`. Keep earlier directives that had an
|
|
93
|
+
effect, such as AI-crawler rules or `Content-Signal` lines, unless the user
|
|
94
|
+
decides otherwise.
|
|
95
|
+
5. **Sitemap.** List the absolute canonical URL of every indexable page and
|
|
96
|
+
nothing else: no error pages, redirects, placeholder pages, or
|
|
97
|
+
non-production hosts. Generating it from the canonical links in the built
|
|
98
|
+
HTML keeps the two from drifting.
|
|
99
|
+
6. **Status codes.** An unknown path returns 404 with a helpful page when the
|
|
100
|
+
platform allows it; an empty 404 body is a gap. Do not remove a fallback
|
|
101
|
+
that client-side routing or old-link redirects depend on; record the soft
|
|
102
|
+
404 instead. The site should redirect `http://` to `https://`; when that is
|
|
103
|
+
a CDN or zone setting, record it.
|
|
104
|
+
7. **Error page.** The same error page is served at any depth, so its links
|
|
105
|
+
and assets need root-relative paths. Hosts often answer its own path (such
|
|
106
|
+
as `/404`) with 200, so give it a robots noindex and no canonical, `og:url`,
|
|
107
|
+
or sitemap entry; it is the one production page that carries noindex.
|
|
108
|
+
Leave analytics off it when it can answer under paths with stricter privacy
|
|
109
|
+
promises (a zone may still inject its own), and make the local development
|
|
110
|
+
server answer missing paths the same way.
|
|
111
|
+
8. **Internal links.** Every link to the site's own pages uses the canonical
|
|
112
|
+
form, so following it answers 200 without a redirect;
|
|
113
|
+
`agent-tool seo probe --links` finds the others. Add a build test that
|
|
114
|
+
fails on a link that would redirect or miss, generating any gitignored
|
|
115
|
+
build assets it reads first.
|
|
116
|
+
Changing link forms can break code that compares links with the current
|
|
117
|
+
path, such as an active-page marker. Shared link constants in other
|
|
118
|
+
packages count too, and changing them can require those packages' version
|
|
119
|
+
bumps.
|
|
120
|
+
9. **Hygiene on touched pages.** One `<h1>` that names the page (not one
|
|
121
|
+
shared by a whole gallery), meaningful `alt` text on content images, and
|
|
122
|
+
descriptive link text. On image-heavy pages, keep only the likely Largest
|
|
123
|
+
Contentful Paint image eager, with `fetchpriority="high"`, and lazy-load
|
|
124
|
+
the rest with explicit `width` and `height`.
|
|
125
|
+
10. **Manifest.** Where a web app manifest exists, make the name, short name,
|
|
126
|
+
description, icons, colors, `start_url`, and `display` accurate. Add
|
|
127
|
+
`related_applications` only after the store listings exist.
|
|
128
|
+
11. **Copied pages.** When a site serves copies of another project's pages,
|
|
129
|
+
for example from a package's asset folder, the copies should canonicalize
|
|
130
|
+
to the original host. That is the producer's change: absolute canonical
|
|
131
|
+
and `og:url` values in the pages it ships. On the consuming side, upgrade
|
|
132
|
+
to a release whose tarball you have checked for the change, and review
|
|
133
|
+
the API between the old and new versions first. Copies of pages that are
|
|
134
|
+
deliberately kept out of search keep the producer's robots rules, but
|
|
135
|
+
their assets can still be indexed: add a path-scoped `X-Robots-Tag` rule
|
|
136
|
+
for the copied directory in production, where no `/*` rule already sends
|
|
137
|
+
it, and respect any deploy guard the consumer has. Probe asset paths under
|
|
138
|
+
the copy, not only its pages.
|
|
139
|
+
|
|
140
|
+
Paths on a content host that are not meant for search, such as review or
|
|
141
|
+
preview pages, get the internal-host treatment: the header, the robots meta,
|
|
142
|
+
and no sitemap entry. Placeholder pages without real copy do too, through a
|
|
143
|
+
flag on the page, so a page becomes indexable and joins the sitemap as soon
|
|
144
|
+
as it gets content.
|
|
145
|
+
|
|
146
|
+
When several sites belong to one company, give them the same `Organization`
|
|
147
|
+
node, with the same `@id`, name, legal name, URL, and logo, and point
|
|
148
|
+
`publisher` or `provider` at that `@id`.
|
|
149
|
+
|
|
150
|
+
## App hosts
|
|
151
|
+
|
|
152
|
+
- Replace a generic shell title such as "App" with the product name and what
|
|
153
|
+
it is, for example "Tearleads – Encrypted notes, contacts, and files". Add a
|
|
154
|
+
description and Open Graph tags.
|
|
155
|
+
- Reuse the product's preview image by pointing `og:image` at the content
|
|
156
|
+
host's absolute URL rather than rendering a second copy, and deploy the
|
|
157
|
+
content host first when the image changes. Requesting the image path on the
|
|
158
|
+
app host itself may return the shell; check the URL the page names.
|
|
159
|
+
- Serve a real `text/plain` robots.txt. A single-page fallback otherwise
|
|
160
|
+
answers it with HTML.
|
|
161
|
+
- Add a canonical pointing at the app root only when every route shows the
|
|
162
|
+
same shell. When the app has distinct public, shareable routes, such as user
|
|
163
|
+
pages or published documents, a root canonical marks them as duplicates.
|
|
164
|
+
Omit the canonical and record whether those routes should be indexable. That
|
|
165
|
+
is a product and privacy decision, because sharing by link is not consent to
|
|
166
|
+
search listing.
|
|
167
|
+
- A host that serves a duplicate of another host's app, such as a demo build,
|
|
168
|
+
canonicalizes to the primary app root.
|
|
169
|
+
- Once the product owner decides that public user-content routes stay out
|
|
170
|
+
of search, noindex them with a path rule. If those routes cannot be told
|
|
171
|
+
apart from app routes by URL pattern (for example `/:user` and `/admin`),
|
|
172
|
+
send the header on every path below the root, detach it on built files,
|
|
173
|
+
and keep the root indexable; say so in the report, because it also covers
|
|
174
|
+
app routes. Add the robots meta in the view as well, never twice. Without
|
|
175
|
+
that decision, record the question instead of noindexing anything.
|
|
176
|
+
- Private links that work without an account, such as signing or sharing
|
|
177
|
+
URLs with a token, get `X-Robots-Tag: noindex, nofollow` through a path
|
|
178
|
+
rule, while the rest of the app keeps its canonical. Files those pages link
|
|
179
|
+
to on an API host, such as PDF downloads, should carry the header too.
|
|
180
|
+
- The content-host rule for localized titles applies to app hosts that
|
|
181
|
+
localize in the browser.
|
|
182
|
+
|
|
183
|
+
## Internal hosts
|
|
184
|
+
|
|
185
|
+
Admin dashboards, galleries, package viewer sites, and other HTML surfaces
|
|
186
|
+
that are not meant for search follow every non-production rule above: the
|
|
187
|
+
header (`noindex, nofollow`) on every response, including server-generated
|
|
188
|
+
redirects and sign-in pages; the robots meta in the HTML; a crawlable
|
|
189
|
+
robots.txt; and no canonical, `og:url`, or sitemap. Empty preview and
|
|
190
|
+
structured-data results are expected on these hosts.
|
|
191
|
+
|
|
192
|
+
- API hosts that answer only JSON need nothing unless adding the header is
|
|
193
|
+
trivial and leaves CORS and other behavior unchanged. On any tier, files
|
|
194
|
+
they serve behind private links do need it.
|
|
195
|
+
- An existing `noindex` robots meta can stay as it is; the header carries
|
|
196
|
+
`nofollow`. Do not change meta tags in pages that a package ships for other
|
|
197
|
+
sites to copy, because the copies take them along. Keep host-only files such
|
|
198
|
+
as `_headers` out of the package.
|
|
199
|
+
- A host with one tier has no tier switch to test. Test that every page has
|
|
200
|
+
the robots meta and no canonical, and that the header is present: the rule
|
|
201
|
+
in the deployed build for static assets, or a unit test of the wrapper when
|
|
202
|
+
a Worker sets it in code. In a repository that also publishes the pages as
|
|
203
|
+
a package, test that the package leaves the host-only header file out.
|
|
204
|
+
- When the repository has a verification script or a documented post-deploy
|
|
205
|
+
check for the site, add the live header check there. Do not add SEO checks
|
|
206
|
+
to gates for other releases, such as a package publishing gate.
|
|
207
|
+
|
|
208
|
+
## Apps that will ship to stores
|
|
209
|
+
|
|
210
|
+
Until the store listings are live, list only `Web` in `operatingSystem`, and
|
|
211
|
+
do not add smart app banners, `related_applications`, or new links to store
|
|
212
|
+
pages that answer 404. Existing store links may reflect an owner's decision,
|
|
213
|
+
so search the PR history and record a conflict rather than removing them.
|
|
214
|
+
|
|
215
|
+
Record what the launch needs: the App Store ID for `apple-itunes-app`, the
|
|
216
|
+
Play package for `related_applications`, store links in static HTML, offers
|
|
217
|
+
that match the listing, and, only if deep links are wanted,
|
|
218
|
+
`apple-app-site-association` (Team ID and bundle ID) and `assetlinks.json`
|
|
219
|
+
(the Play app signing certificate's SHA-256).
|
package/src/cli.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { checkTerraformPlan } from "./dependencies/terraformPlan";
|
|
|
6
6
|
import { dependencyDiff } from "./dependencies/diff";
|
|
7
7
|
import { checkGraph } from "./graph/check";
|
|
8
8
|
import { stateMachinesCommand } from "./stateMachines/command";
|
|
9
|
+
import { seoCommand } from "./seo/probe";
|
|
9
10
|
import { buildScreenshots, describeScreenshots } from "./screenshots/build";
|
|
10
11
|
import { review } from "./harnesses";
|
|
11
12
|
import { carryReviewCommand } from "./review/carry";
|
|
@@ -93,6 +94,7 @@ Usage: agent-tool [--repo <directory>] [--config <file>] <command>
|
|
|
93
94
|
screenshots build [target...] [--out <dir>] [--json] Stage guarded captures and a gallery manifest
|
|
94
95
|
graph check Import cycles and layer violations per agent-tool.json
|
|
95
96
|
state-machines [path...] [--limit N] [--min-score N] [--json] Rank files that look like implicit state machines
|
|
97
|
+
seo probe [--page|--headers|--links|--sitemap] <host> [path...] Live search and preview metadata of a site
|
|
96
98
|
init Create agent-tool.json without overwriting
|
|
97
99
|
config show
|
|
98
100
|
doctor JSON versions and supported review flags
|
|
@@ -191,6 +193,7 @@ export function main(argv = process.argv.slice(2)): number | Promise<number> {
|
|
|
191
193
|
output(report); return report.ok ? 0 : 1;
|
|
192
194
|
}
|
|
193
195
|
if (command === "state-machines") return stateMachinesCommand(args, process.cwd(), undefined, invoked);
|
|
196
|
+
if (command === "seo") return seoCommand(args);
|
|
194
197
|
if (command === "skills") {
|
|
195
198
|
const action = args.shift();
|
|
196
199
|
if (action === "list") { usage(args.length === 0, "Usage: agent-tool skills list"); output(Object.keys(BUNDLED_SKILLS)); return 0; }
|
package/src/config.ts
CHANGED
|
@@ -135,8 +135,9 @@ export function parseConfig(source: string): AgentToolConfig {
|
|
|
135
135
|
}
|
|
136
136
|
const variants = object(result.review.opencodeVariants, "review.opencodeVariants");
|
|
137
137
|
keys(variants, ["low", "medium", "high", "xhigh", "max"], "review.opencodeVariants");
|
|
138
|
-
|
|
139
|
-
if (typeof
|
|
138
|
+
// OpenCode 2 takes the model as provider/model#variant, so neither part may contain '#'.
|
|
139
|
+
for (const value of Object.values(variants)) if (typeof value !== "string" || !/^[^\s#]+$/.test(value)) invalid("review.opencodeVariants");
|
|
140
|
+
if (typeof result.review.opencodeModel !== "string" || !/^[^\s/#]+\/[^\s#]+$/.test(result.review.opencodeModel)) invalid("review.opencodeModel");
|
|
140
141
|
if (!Number.isSafeInteger(result.review.timeoutMs) || result.review.timeoutMs < 1000 || result.review.timeoutMs > 3_600_000) invalid("review.timeoutMs");
|
|
141
142
|
const packageDirs = (dirs: unknown): boolean => strings(dirs) && !dirs.some(dir => dir !== "." && (path.isAbsolute(dir) || dir.includes("\\") || dir.split("/").some(part => !part || part === "." || part === "..")));
|
|
142
143
|
if (result.versions.packages !== null && !packageDirs(result.versions.packages)) invalid("versions.packages");
|
package/src/doctor.ts
CHANGED
|
@@ -6,7 +6,8 @@ const specifications = [
|
|
|
6
6
|
{ name: "gh", help: ["pr", "checks", "--help"], flags: ["--json"] },
|
|
7
7
|
{ name: "claude", help: ["--help"], flags: ["--safe-mode", "--permission-mode", "--effort"] },
|
|
8
8
|
{ name: "codex", help: ["exec", "--help"], flags: ["--ignore-user-config", "--ignore-rules", "--strict-config", "--ephemeral", "--output-last-message"] },
|
|
9
|
-
|
|
9
|
+
// OpenCode 2: the variant rides in --model as provider/model#variant, and --standalone runs a private server.
|
|
10
|
+
{ name: "opencode", help: ["run", "--help"], flags: ["--standalone", "--agent", "--archived", "provider/model#variant"] },
|
|
10
11
|
];
|
|
11
12
|
|
|
12
13
|
/** Probe only local versions and flags; never launch a model or print credentials. */
|
|
@@ -41,6 +41,7 @@ export const CATALOG: CatalogEntry[] = [
|
|
|
41
41
|
{ command: "openPr", class: "share" },
|
|
42
42
|
];
|
|
43
43
|
// `run`, `run-group`, `push-gate run` and `proc start` execute arbitrary commands, so they stay unclassified and keep the harness default.
|
|
44
|
+
// `seo probe` requests whatever hosts its arguments and fetched pages name, like curl, so it keeps the harness default too.
|
|
44
45
|
// `bun x` runs only executables that `permissions.executables` classifies; project.ts adds those.
|
|
45
46
|
// Package scripts are not classified, so `bun run` keeps the harness default.
|
|
46
47
|
|
|
@@ -37,7 +37,7 @@ const OPENCODE_MODEL = DEFAULT_CONFIG.review.opencodeModel;
|
|
|
37
37
|
const OPENCODE_REVIEW_AGENT = "agent-tool-review";
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Map the shared effort vocabulary to a
|
|
40
|
+
* Map the shared effort vocabulary to a variant deepseek-v4-pro accepts.
|
|
41
41
|
* The skill's levels are `low | medium | high | xhigh | max`; this model's
|
|
42
42
|
* variants are `low | medium | high | max`, so `xhigh` collapses onto `max`.
|
|
43
43
|
*/
|
|
@@ -67,6 +67,12 @@ export function resolveOpencodeVariant(
|
|
|
67
67
|
* resolves it, because on macOS the temp dir is a symlink (`/var` →
|
|
68
68
|
* `/private/var`) and the model may pass either spelling; a denied spelling
|
|
69
69
|
* only costs the model a retry, but both spellings allowed costs nothing.
|
|
70
|
+
*
|
|
71
|
+
* OpenCode 2 normalizes this `permission` map into its ordered `permissions`
|
|
72
|
+
* rules, renaming `bash` to `shell` and `task` to `subagent` and keeping the
|
|
73
|
+
* order, so the default deny still precedes the allows; tools it added since,
|
|
74
|
+
* such as `browser`, fall under the default deny. `opencode debug agents
|
|
75
|
+
* --standalone` with the review's environment shows the effective rules.
|
|
70
76
|
*/
|
|
71
77
|
export function buildOpencodeInlineConfig(snapshotRoot: string, model = OPENCODE_MODEL): string {
|
|
72
78
|
const normalized = path.resolve(snapshotRoot).replaceAll("\\", "/");
|
|
@@ -105,27 +111,61 @@ export function buildOpencodeInlineConfig(snapshotRoot: string, model = OPENCODE
|
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
/**
|
|
108
|
-
* Build the `opencode run` argv for a non-interactive review. The
|
|
109
|
-
* over stdin (opencode reads stdin when no message positional is
|
|
110
|
-
* large diff never hits argv limits
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* `--
|
|
114
|
-
*
|
|
114
|
+
* Build the OpenCode 2 `opencode run` argv for a non-interactive review. The
|
|
115
|
+
* prompt goes over stdin (opencode reads stdin when no message positional is
|
|
116
|
+
* given), so a large diff never hits argv limits, and the variant rides in the
|
|
117
|
+
* model as `provider/model#variant`, OpenCode 2's replacement for `--variant`.
|
|
118
|
+
*
|
|
119
|
+
* `--standalone` is what keeps the confinement in force. By default `run`
|
|
120
|
+
* attaches to the shared background service, a server started earlier with its
|
|
121
|
+
* own environment and the user's global config, which never sees the inline
|
|
122
|
+
* config below: the reviewer agent would not exist there, or would not be
|
|
123
|
+
* confined. A standalone server is a private child that inherits this run's
|
|
124
|
+
* environment and working directory and exits with it. It also stands in for
|
|
125
|
+
* OpenCode 1's `--pure`: plugins load only from config, and the empty config
|
|
126
|
+
* directory with project config off leaves none to load. `--archived` keeps
|
|
127
|
+
* review sessions out of the user's session lists. Opencode has no per-run
|
|
128
|
+
* flag for permissions, and `--auto` would only *add* authority, never remove it.
|
|
115
129
|
*/
|
|
116
130
|
export function buildOpencodeReviewArgs(variant: string, model = OPENCODE_MODEL): string[] {
|
|
117
131
|
return [
|
|
118
132
|
"run",
|
|
119
133
|
"--model",
|
|
120
|
-
model
|
|
121
|
-
"--variant",
|
|
122
|
-
variant,
|
|
134
|
+
`${model}#${variant}`,
|
|
123
135
|
"--agent",
|
|
124
136
|
OPENCODE_REVIEW_AGENT,
|
|
125
|
-
"--
|
|
137
|
+
"--standalone",
|
|
138
|
+
"--archived",
|
|
126
139
|
];
|
|
127
140
|
}
|
|
128
141
|
|
|
142
|
+
/**
|
|
143
|
+
* The reviewer's environment: the caller's, with the inline config and
|
|
144
|
+
* OpenCode's outside configuration turned off. `directory` is the empty,
|
|
145
|
+
* non-repository directory the reviewer runs in. OpenCode 2 takes a session's
|
|
146
|
+
* directory from `PWD` before its working directory, and an inherited `PWD`
|
|
147
|
+
* names the checkout agent-tool runs from, so `PWD` is pinned too. The same
|
|
148
|
+
* directory is the config directory, which in OpenCode 2 replaces the global
|
|
149
|
+
* `~/.config/opencode` (its config, plugins, and MCP servers) outright.
|
|
150
|
+
* Project config and Claude Code compatibility (`~/.claude` skills, config,
|
|
151
|
+
* and CLAUDE.md instructions) are off, both spellings of the project switch
|
|
152
|
+
* are set because the newer one takes precedence, and an inherited
|
|
153
|
+
* `OPENCODE_CONFIG`, which would load one more config file, is dropped.
|
|
154
|
+
*/
|
|
155
|
+
export function buildOpencodeReviewEnv(env: ReviewerEnv, snapshotRoot: string, directory: string, model = OPENCODE_MODEL): ReviewerEnv {
|
|
156
|
+
const reviewEnv: ReviewerEnv = {
|
|
157
|
+
...env,
|
|
158
|
+
PWD: directory,
|
|
159
|
+
OPENCODE_CONFIG_CONTENT: buildOpencodeInlineConfig(snapshotRoot, model),
|
|
160
|
+
OPENCODE_CONFIG_DIR: directory,
|
|
161
|
+
OPENCODE_CONFIG_PROJECT_DISABLE: "1",
|
|
162
|
+
OPENCODE_DISABLE_PROJECT_CONFIG: "1",
|
|
163
|
+
OPENCODE_DISABLE_CLAUDE_CODE: "1",
|
|
164
|
+
};
|
|
165
|
+
delete reviewEnv.OPENCODE_CONFIG;
|
|
166
|
+
return reviewEnv;
|
|
167
|
+
}
|
|
168
|
+
|
|
129
169
|
/**
|
|
130
170
|
* Run `opencode run` over an already-built review prompt and relay whatever it
|
|
131
171
|
* prints to stdout — the final message alone, since run mode keeps its TUI
|
|
@@ -139,16 +179,17 @@ export function buildOpencodeReviewArgs(variant: string, model = OPENCODE_MODEL)
|
|
|
139
179
|
* stderr tail is relayed so the error is still diagnosable (the Codex path
|
|
140
180
|
* makes the same trade-off).
|
|
141
181
|
*
|
|
142
|
-
* The reviewer runs from a fresh, empty,
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* live in its data
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
182
|
+
* The reviewer runs on a private standalone server from a fresh, empty,
|
|
183
|
+
* non-repository directory (`buildOpencodeReviewEnv`), so nothing
|
|
184
|
+
* branch-controlled loads: not the snapshot's or checkout's `AGENTS.md` or
|
|
185
|
+
* `opencode.json`, and not a `.opencode/` directory. `OPENCODE_CONFIG_DIR`
|
|
186
|
+
* points at that same empty directory, so no user-defined agents, commands,
|
|
187
|
+
* plugins, or MCP servers from `~/.config/opencode` ride along either. That
|
|
188
|
+
* directory is *config* only: opencode's credentials live in its data
|
|
189
|
+
* directory (`~/.local/share/opencode/auth.json` on macOS), which
|
|
190
|
+
* `OPENCODE_CONFIG_DIR` does not touch, so the provider auth the review needs
|
|
191
|
+
* still resolves. Skills in `~/.agents/skills` are still discovered, but the
|
|
192
|
+
* inline config denies the skill tool and every read outside the snapshot.
|
|
152
193
|
*/
|
|
153
194
|
export async function spawnOpencodeReview(
|
|
154
195
|
prompt: string,
|
|
@@ -176,11 +217,7 @@ export async function spawnOpencodeReview(
|
|
|
176
217
|
// Neutral cwd: opencode would otherwise load the snapshot's
|
|
177
218
|
// branch-controlled config and instructions into the reviewer.
|
|
178
219
|
cwd: outDir,
|
|
179
|
-
env:
|
|
180
|
-
...env,
|
|
181
|
-
OPENCODE_CONFIG_CONTENT: buildOpencodeInlineConfig(snapshotRoot, model),
|
|
182
|
-
OPENCODE_CONFIG_DIR: outDir,
|
|
183
|
-
},
|
|
220
|
+
env: buildOpencodeReviewEnv(env, snapshotRoot, outDir, model),
|
|
184
221
|
},
|
|
185
222
|
));
|
|
186
223
|
const exitCode = spawnExitCode("opencode", result);
|