summaryrefslogtreecommitdiff
path: root/.github/copilot-instructions.md
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-04-10 21:50:31 +0300
committerGitHub <noreply@github.com>2026-04-10 19:50:31 +0100
commitce3bb378d3e58c7023088d92ef9042e5a2d61235 (patch)
treeee86d92accbb4e9b1fb7306f900c122bbe9a0817 /.github/copilot-instructions.md
parent3fab910622ef60a8fd68d5552ad104f46608df35 (diff)
downloadvyos-documentation-ce3bb378d3e58c7023088d92ef9042e5a2d61235.tar.gz
vyos-documentation-ce3bb378d3e58c7023088d92ef9042e5a2d61235.zip
ci: add CLAUDE.md and Copilot custom instructions (#1830)
* ci: add CLAUDE.md and GitHub Copilot custom instructions Add AI assistant instructions to improve automated review quality: - CLAUDE.md: project conventions, RST rules, linter details - .github/copilot-instructions.md: repo-wide Copilot context - .github/instructions/rst-linter.instructions.md: linter rules for RST files (address space, line length, suppression syntax) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: fix build commands, code-block exemption, and address space heading - Fix Docker build/run commands to match README (vyos/vyos-documentation image, /vyos mount, /vyos/docs workdir) - Fix local build to run from docs/ directory - Clarify code-block lines are exempt from 80-char limit - Expand address space heading to reference docs/documentation.rst - Fix confusing 0.0.0.0/0 entry in common mistakes - Simplify inline code backtick example Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: expand Copilot instructions to reduce false positive reviews Add guidance for common false positives observed in automated reviews: - Only flag issues introduced by the PR, not pre-existing - Column-0 linter markers are the repo convention, not a bug - Code-block lines are exempt from 80-char limit - RFC 1918 and other private IPs are allowed without suppression - TODO markers can be intentionally added for tracking - YAML in code blocks uses RST-relative indentation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: fix backtick rendering and linter marker indentation guidance - CLAUDE.md: use fenced code span to show RST double-backtick syntax - copilot-instructions.md: markers match surrounding indentation inside directives, column 0 at top level (both patterns exist in repo) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to '.github/copilot-instructions.md')
-rw-r--r--.github/copilot-instructions.md68
1 files changed, 68 insertions, 0 deletions
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
new file mode 100644
index 00000000..dd18e7e6
--- /dev/null
+++ b/.github/copilot-instructions.md
@@ -0,0 +1,68 @@
+## VyOS Documentation Project
+
+This is VyOS user documentation written in reStructuredText (RST) and built with Sphinx.
+
+### Review Scope
+
+When reviewing pull requests, only flag issues **introduced by the PR's changes**. Do not flag pre-existing issues in unchanged lines. Compare against the base branch to determine what was actually changed.
+
+### RST Heading Hierarchy
+
+All files must use this heading order:
+
+```
+##### (Title — one per file, with overline)
+***** (Chapters)
+===== (Sections)
+----- (Subsections)
+^^^^^ (Subsubsections)
+""""" (Paragraphs)
+```
+
+### Line Length
+
+Maximum 80 characters per line. Exception: content inside `.. code-block::` directives is **exempt** — they render with `<pre>` tags and preserve source formatting. Do not flag long lines inside code blocks.
+
+### Linter Suppression Markers
+
+`.. stop_vyoslinter` and `.. start_vyoslinter` are RST comments used to suppress CI linter checks. Key conventions:
+
+- When used **inside an indented directive** (`.. cfgcmd::`, `.. opcmd::`, list items), markers should match the surrounding indentation to stay within the block.
+- When used **at top level** (outside any directive), markers are placed at column 0.
+- Both patterns exist in this repo. Do not flag either placement as incorrect.
+- They must always appear in pairs (stop then start). A missing `start_vyoslinter` is a real issue.
+- A `stop_vyoslinter` that covers a large section is acceptable when the content requires it (e.g., files full of real debug output with production IPs).
+
+### IP Address Rules
+
+The CI linter checks IP addresses. These are **allowed without suppression** — do not flag them:
+
+- RFC 5737 documentation addresses: `192.0.2.0/24`, `198.51.100.0/24`, `203.0.113.0/24`
+- RFC 3849 documentation IPv6: `2001:db8::/32`
+- RFC 1918 private ranges: `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`
+- Loopback (`127.0.0.0/8`), link-local (`169.254.0.0/16`), `0.0.0.0/0`
+
+Real public IPs (e.g., `8.8.8.8`) require `stop/start_vyoslinter` suppression. Do not suggest replacing them with documentation addresses if the example intentionally uses real IPs.
+
+### TODO Markers
+
+`.. TODO::` directives serve two purposes in this repo:
+
+1. **Tracking markers** on pages that need `cfgcmd`/`opcmd` conversion (these are intentionally added).
+2. **Stale markers** on pages that already have full content (these should be removed).
+
+A PR that removes some TODOs and adds others is not contradictory — the intent matters.
+
+### VyOS Directives
+
+- `.. cfgcmd::` for configuration mode commands
+- `.. opcmd::` for operational mode commands
+- Do not convert these to plain `.. code-block::` — they are tracked for command coverage.
+
+### YAML in Code Blocks
+
+Ansible playbook examples in `.. code-block::` use RST indentation (typically 4 spaces from the directive). The YAML indentation within the block may differ from standalone YAML files. Verify carefully before flagging YAML as invalid — count spaces from the code-block's own indentation base, not from column 0.
+
+### Page Structure
+
+Configuration pages follow this order: Theory, Configuration (cfgcmd), Examples, Known Issues, Debugging.