Skip to content

docs: instruct agents to never run 'make -C docs' - #636

Merged
bepri merged 7 commits into
canonical:mainfrom
dangertoaster:docs/agents-never-make-c-docs
Oct 19, 2026
Merged

bepri merged 7 commits into
canonical:mainfrom
dangertoaster:docs/agents-never-make-c-docs

Conversation

@dangertoaster

@dangertoaster dangertoaster commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🤖 GENERATED BY A TOASTER -- kimi-k3

Agents will often attempt make -C docs, which misses the redefinition of DOCS_VENVDIR in common.mk and creates a secondary venv that confuses much of our tooling.

Co-authored-by: Imani Pelton <imani.pelton@canonical.com>
@bepri
bepri marked this pull request as ready for review October 16, 2026 20:11
@bepri
bepri self-requested a review as a code owner October 16, 2026 20:11
Copilot AI lite review requested due to automatic review settings October 16, 2026 20:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No blocking issues were identified; remaining feedback is limited to minor command-naming clarification.

3 open findings
What changed in this PR

Updates agent guidance to avoid make -C docs, preventing creation of a conflicting documentation virtual environment.

Changes:

  • Warns against direct documentation subdirectory builds.
  • Directs agents to top-level documentation targets.
  • Applies guidance across all agent instruction files.
File Summary
AGENTS.md Updated documentation build guidance
AGENTS.lib.md Updated library agent guidance
AGENTS.app.md Updated application agent guidance

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread AGENTS.app.md Outdated
Comment thread AGENTS.lib.md Outdated
Comment thread AGENTS.md Outdated
@LoweRAM

LoweRAM commented Oct 16, 2026

Copy link
Copy Markdown

Review notes on the new agent instruction:

  1. The phrase "Never run make -C docs directly" can still be read as banning only the exact command. make -C docs html, make -C ./docs, or cd docs && make bypass it. Suggest wording such as: do not pass -C docs to Make and do not run Make from inside docs/.

  2. The examples stop at make docs. An agent needing targets such as linkcheck, spelling, or woke may not know the corresponding top-level wrappers and fall back to direct make -C docs. Adding examples like make docs-linkcheck, make docs-spelling, and make docs-woke would make the intended pattern clearer.

  3. docs/_dev/.pre-commit-config.yaml still invokes make -C docs spelling, make -C docs linkcheck, and make -C docs woke. It is unclear whether that file is an intentional exception. Either document that the rule applies to agent commands only, or migrate those hooks to the top-level make docs-* wrappers.

- Refer to top-level documentation targets rather than the docs-*
  pattern, and include setup-docs and docs (Copilot)
- Forbid running make from within docs/ as well as -C docs (LoweRAM)
- Add docs-linkcheck, docs-spelling, and docs-woke examples (LoweRAM)
- Note the rule applies to agent-run commands only (LoweRAM)

Co-authored-by: Imani Pelton <imani.pelton@canonical.com>
@dangertoaster

Copy link
Copy Markdown
Contributor Author

🤖 [GENERATED BY A TOASTER -- kimi-k3]

Thanks for the review — all three points addressed in dbf19af:

  1. Reworded to forbid invoking Make inside docs/ in any form: no -C docs, no running make from within the docs/ directory.
  2. Added make docs-linkcheck, make docs-spelling, and make docs-woke to the examples so agents can discover the passthrough wrappers.
  3. The new guidance now opens with "When running documentation builds or checks yourself", making it explicit that the rule applies to agent-run commands. docs/_dev/.pre-commit-config.yaml is invoked by pre-commit, not by the agent directly, and the dev-only hooks there intentionally exercise the docs sub-Makefile — migrating them to the top-level wrappers is a separate concern from this PR.

Avoids maintaining an explicit list of documentation targets in the
agent instructions, which would drift out of sync with the Makefile.

Co-authored-by: Imani Pelton <imani.pelton@canonical.com>
@dangertoaster

Copy link
Copy Markdown
Contributor Author

🤖 [GENERATED BY A TOASTER -- kimi-k3]

Replaced the explicit target list with a pointer to make help in 242177e — it enumerates the documented top-level documentation targets (docs, docs-auto, docs-clean, docs-help, docs-install, docs-lint, setup-docs), and make docs-help lists the full docs subproject commands. This avoids the maintenance burden of keeping a hardcoded list in sync with the Makefile.

Comment thread AGENTS.app.md Outdated
dangertoaster and others added 2 commits October 16, 2026 20:25
'make help' omits pattern-rule passthroughs like docs-linkcheck, and
'make docs-help' lists the unprefixed subproject commands. Note the
docs- prefix mapping so agents don't fall back to running Make inside
docs/.

Co-authored-by: Imani Pelton <imani.pelton@canonical.com>
Co-authored-by: Imani Pelton <imani.pelton@canonical.com>
@canonical canonical deleted a comment from LoweRAM Oct 16, 2026
@canonical canonical deleted a comment from LoweRAM Oct 16, 2026
@LoweRAM

LoweRAM commented Oct 16, 2026

Copy link
Copy Markdown

Potential agent misinterpretations:

  1. Rule scope: Agent might only ban the exact command make -C docs.
  2. Target discovery: make help omits specific pattern-rule passthroughs (e.g., make docs-linkcheck).
  3. Scope confusion: Agent might apply the rule to developer-initiated commands (like those in .pre-commit-config.yaml) instead of only agent-run tasks.

@canonical canonical deleted a comment from LoweRAM Oct 16, 2026
The AGENTS.md rule now bans running the docs Makefile directly in any
form, states why, and notes the carve-out for the repo's own targets
and hooks. The docs-help footer no longer instructs readers to run
make from inside docs/, which contradicted the rule and the purpose of
the docs-% passthrough introduced in e94f190.

Co-authored-by: Imani Pelton <imani.pelton@canonical.com>
@lengau
lengau requested a review from mr-cal October 19, 2026 18:04
Comment thread AGENTS.app.md Outdated
Co-authored-by: Imani Pelton <imani.pelton@canonical.com>

@mr-cal mr-cal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

As an aside, I hold almost no value in agent opnions on the contents of an agents file.

@bepri
bepri merged commit d7affc9 into canonical:main Oct 19, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants