You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9eeb17d
Browse filesBrowse the repository at this point in the historyBrowse files
fix: strengthen agent rules to prevent broken links and wrong URLs
Adds three new verification rules to the content authoring workflow:
- Internal link verification: agents must confirm target files exist
- External URL verification: agents must not guess/generalize crate URLs
- Self-consistency check: frontmatter and body must not contradict
Also expands linking rules table with ic-stable-structures and candid
crate URLs, and adds a "never" rule against linking to non-existent pages.
Motivated by review of PRs #2-#5 where agents linked to plausible but
non-existent paths (reference/certified-variables.md, guides/backends/
stable-memory.md) and used wrong crate URLs (docs.rs/ic-cdk for
ic-stable-structures).
Copy file name to clipboardExpand all lines: AGENTS.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,6 +209,7 @@ Add enough context in the notes so the next agent (or human) understands the blo
209
209
- Modify the rationale or context of existing decisions in `.docs-plan/decisions.md` — you may remove entries that are fully reflected in the current codebase (renames, file moves, cleanup) but never alter the reasoning behind active decisions
210
210
- Add `Co-Authored-By` or any AI attribution to commits or PR descriptions
211
211
- Link to `internetcomputer.org/docs/` or `docs.internetcomputer.org` — the old docs site is being replaced by this project and those URLs will break. Link to pages in this site (relative paths, even stubs), Learn Hub, or explain inline. If a needed topic has no page, create a page proposal issue.
212
+
- Link to internal pages that don't exist — every `[text](path.md)` must resolve to an actual file. Agents have repeatedly linked to plausible-sounding paths (e.g., `reference/certified-variables.md`, `guides/backends/stable-memory.md`) that don't exist. Always `ls` the target before linking. If the page doesn't exist, find the correct existing page or file a page proposal issue.
212
213
213
214
## Key directories
214
215
@@ -309,6 +310,9 @@ When drafting a new docs page:
309
310
- Follow the content brief in the stub
310
311
- Use icp-cli commands (never dfx)
311
312
-**Verify all CLI commands and flags** against `.sources/icp-cli/docs/reference/cli.md` — never guess command syntax
313
+
-**Verify all internal links** — every `[text](path.md)` must point to a file that exists. Run `ls <target-path>` before submitting. If the target page doesn't exist, either link to an existing page that covers the topic, or file a page proposal issue and note the missing link in your PR description. Never link to a path that doesn't exist.
314
+
-**Verify all external URLs** — use the linking rules table below for known resources. For any URL not in the table (crate docs, npm packages, GitHub repos), verify it is correct. Do not guess or generalize from similar URLs (e.g., `docs.rs/ic-cdk` is NOT the same as `docs.rs/ic-stable-structures`).
315
+
-**Self-consistency check** — before submitting, re-read your frontmatter description and body opening paragraph. They must not contradict each other (e.g., different time estimates, different scope claims).
312
316
- Use plain markdown (never JSX/MDX)
313
317
- Ensure complete frontmatter (see CONTRIBUTING.md)
314
318
- Code examples: <30 lines inline, >30 lines link to `dfinity/examples`
@@ -348,11 +352,15 @@ When drafting a new docs page:
> **Important:** Each Rust crate has its own `docs.rs` URL. Do NOT substitute one crate URL for another — `docs.rs/ic-cdk` is NOT the same as `docs.rs/ic-stable-structures`. If you need to link a crate not in this table, construct the URL as `https://docs.rs/<crate-name>/latest/<crate_name>/` (note: hyphens in crate name become underscores in the path).
363
+
356
364
## External docs (don't duplicate these)
357
365
358
366
| Resource | URL |
@@ -362,7 +370,8 @@ When drafting a new docs page:
362
370
| icskills |https://skills.internetcomputer.org|
363
371
| Learn Hub |https://learn.internetcomputer.org|
364
372
| Motoko core library |https://mops.one/core/docs (supersedes base; migration guide is synced from Motoko repo) |
365
-
| Rust CDK API |https://docs.rs/ic-cdk/latest/ic_cdk/|
373
+
| Rust CDK API (`ic-cdk`) |https://docs.rs/ic-cdk/latest/ic_cdk/|
0 commit comments