Skip to content

Commit 6bb3367

Browse files
docs: version 0.46.0 docs (#1322)
* docs: version 0.46.0 docs and update site data * docs: pin versioned source links to release tags --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 745c175 commit 6bb3367

459 files changed

Lines changed: 26197 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,50 @@ jobs:
592592
- name: Cut versioned docs snapshot
593593
run: npm --prefix website run version:cut -- "${{ steps.version.outputs.version }}"
594594

595+
- name: Pin versioned docs links to the release tag
596+
run: |
597+
set -euo pipefail
598+
VERSION="${{ steps.version.outputs.version }}"
599+
SNAPSHOT="website/versioned_docs/version-${VERSION}"
600+
python3 - "$SNAPSHOT" "$VERSION" <<'PY'
601+
from pathlib import Path
602+
import sys
603+
604+
snapshot = Path(sys.argv[1])
605+
version = sys.argv[2]
606+
replacements = {
607+
"https://github.com/agent-sh/agnix/blob/main/":
608+
f"https://github.com/agent-sh/agnix/blob/v{version}/",
609+
"https://github.com/agent-sh/agnix/tree/main/":
610+
f"https://github.com/agent-sh/agnix/tree/v{version}/",
611+
}
612+
613+
changed = 0
614+
for path in snapshot.rglob("*.md"):
615+
content = path.read_text(encoding="utf-8")
616+
pinned = content
617+
for moving, tagged in replacements.items():
618+
pinned = pinned.replace(moving, tagged)
619+
if pinned != content:
620+
path.write_text(pinned, encoding="utf-8")
621+
changed += 1
622+
623+
remaining = [
624+
str(path)
625+
for path in snapshot.rglob("*.md")
626+
if any(
627+
moving in path.read_text(encoding="utf-8")
628+
for moving in replacements
629+
)
630+
]
631+
if remaining:
632+
raise SystemExit(
633+
"Versioned docs still contain moving repository links: "
634+
+ ", ".join(remaining)
635+
)
636+
print(f"Pinned repository links in {changed} versioned docs files")
637+
PY
638+
595639
- name: Update lastVersion in Docusaurus config
596640
run: |
597641
set -euo pipefail

tests/release_workflow.rs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::fs;
2+
use std::path::PathBuf;
23

34
#[test]
45
fn release_publish_jobs_are_gated_by_tests() {
@@ -105,6 +106,72 @@ fn release_workflow_scopes_attestation_and_release_permissions() {
105106
);
106107
}
107108

109+
#[test]
110+
fn release_workflow_pins_latest_versioned_docs_to_the_release_tag() {
111+
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
112+
let workflow = fs::read_to_string(root.join(".github/workflows/release.yml"))
113+
.expect("failed to read release workflow")
114+
.replace("\r\n", "\n");
115+
116+
assert!(
117+
workflow.contains("- name: Pin versioned docs links to the release tag"),
118+
"release workflow must pin repository links after cutting a docs snapshot"
119+
);
120+
assert!(
121+
workflow.contains("agnix/blob/v{version}/") && workflow.contains("agnix/tree/v{version}/"),
122+
"release workflow must retarget both file and directory links"
123+
);
124+
125+
let versions: Vec<String> = serde_json::from_str(
126+
&fs::read_to_string(root.join("website/versions.json"))
127+
.expect("failed to read docs versions"),
128+
)
129+
.expect("website/versions.json must contain a JSON string array");
130+
let latest = versions
131+
.first()
132+
.expect("docs must contain a latest version");
133+
let snapshot = root.join(format!("website/versioned_docs/version-{latest}"));
134+
let moving_links = [
135+
"https://github.com/agent-sh/agnix/blob/main/",
136+
"https://github.com/agent-sh/agnix/tree/main/",
137+
];
138+
let pinned_links = [
139+
format!("https://github.com/agent-sh/agnix/blob/v{latest}/"),
140+
format!("https://github.com/agent-sh/agnix/tree/v{latest}/"),
141+
];
142+
let mut stack = vec![snapshot];
143+
let mut pinned_link_count = 0;
144+
145+
while let Some(path) = stack.pop() {
146+
for entry in fs::read_dir(&path)
147+
.unwrap_or_else(|error| panic!("failed to read {}: {error}", path.display()))
148+
{
149+
let entry = entry.expect("failed to read versioned docs entry");
150+
let path = entry.path();
151+
if path.is_dir() {
152+
stack.push(path);
153+
} else if path.extension().is_some_and(|extension| extension == "md") {
154+
let content = fs::read_to_string(&path)
155+
.unwrap_or_else(|error| panic!("failed to read {}: {error}", path.display()));
156+
assert!(
157+
moving_links.iter().all(|link| !content.contains(link)),
158+
"{} contains a repository link to moving main",
159+
path.display()
160+
);
161+
pinned_link_count += pinned_links
162+
.iter()
163+
.filter(|link| content.contains(link.as_str()))
164+
.count();
165+
}
166+
}
167+
}
168+
169+
assert!(
170+
pinned_link_count > 0,
171+
"latest versioned docs must contain release-tagged repository links"
172+
);
173+
}
174+
108175
#[test]
109176
fn action_download_script_verifies_release_checksum() {
110177
let root = env!("CARGO_MANIFEST_DIR");

website/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const config = {
8080
sidebarPath: require.resolve('./sidebars.js'),
8181
editUrl: 'https://github.com/agent-sh/agnix/tree/main/website/',
8282
showLastUpdateTime: true,
83-
lastVersion: '0.45.0',
83+
lastVersion: '0.46.0',
8484
...(includedDocVersions ? { onlyIncludeVersions: includedDocVersions } : {}),
8585
versions: {
8686
current: {
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
title: API Reference
3+
description: "agnix CLI flags, output formats, MCP server tools, and LSP capabilities."
4+
---
5+
6+
# API Reference
7+
8+
## CLI
9+
10+
```bash
11+
agnix [OPTIONS] [PATH]
12+
```
13+
14+
### Options
15+
16+
| Flag | Description |
17+
|------|-------------|
18+
| `[PATH]` | Directory or file to validate (default: `.`) |
19+
| `--target <TOOL>` | Single tool focus (`generic`, `claude-code`, `cursor`, `codex`, `kiro`) |
20+
| `--fix` | Apply HIGH and MEDIUM confidence fixes |
21+
| `--dry-run` | Preview fixes without modifying files |
22+
| `--fix-safe` | Apply only HIGH confidence fixes |
23+
| `--fix-unsafe` | Apply all fixes, including LOW confidence fixes |
24+
| `--show-fixes` | Show proposed fix diffs in text output |
25+
| `--format <FMT>` | Output format: `text` (default), `json`, `sarif` |
26+
| `--strict` | Treat warnings as errors (exit code 1) |
27+
| `--config <PATH>` | Config file path (default: `.agnix.toml`) |
28+
| `--watch`, `-w` | Watch mode - re-validate on file changes |
29+
| `--locale <LOCALE>` | Set output locale, e.g. `en`, `es`, `zh-CN` |
30+
| `--list-locales` | List supported locales and exit |
31+
| `--max-files <N>` | Maximum number of files to validate |
32+
| `--verbose`, `-v` | Verbose output |
33+
| `--version` | Print version |
34+
| `--help` | Print help |
35+
36+
### Subcommands
37+
38+
| Command | Description |
39+
|---------|-------------|
40+
| `agnix validate [PATH]` | Validate agent configs explicitly |
41+
| `agnix init` | Initialize a config file |
42+
| `agnix eval <FILE>` | Evaluate rule efficacy against labeled test cases |
43+
| `agnix schema [--output FILE] [--fix]` | Output or regenerate JSON Schema for `.agnix.toml` |
44+
| `agnix tools check` | Check configured tool versions |
45+
| `agnix tools detect` | Detect installed tool versions |
46+
| `agnix telemetry <status\|enable\|disable>` | Manage telemetry settings |
47+
48+
### Output formats
49+
50+
- **text** - Human-readable terminal output with colors
51+
- **json** - Machine-readable JSON object with diagnostics and summary metadata (e.g. version, files_checked, diagnostics, summary, category, rule_severity, applies_to_tool)
52+
- **sarif** - SARIF format for GitHub Code Scanning integration
53+
54+
## MCP server
55+
56+
```bash
57+
cargo install agnix-mcp
58+
agnix-mcp
59+
```
60+
61+
The MCP server exposes these tools:
62+
63+
| Tool | Description |
64+
|------|-------------|
65+
| `validate_file` | Validate a single configuration file |
66+
| `validate_project` | Validate all config files in a project |
67+
| `get_rules` | List all available validation rules |
68+
| `get_rule_docs` | Get documentation for a specific rule |
69+
70+
## LSP server
71+
72+
```bash
73+
cargo install agnix-lsp
74+
agnix-lsp
75+
```
76+
77+
Supported LSP capabilities:
78+
79+
- `textDocument/publishDiagnostics` - real-time validation
80+
- `textDocument/codeAction` - auto-fix suggestions
81+
- `textDocument/hover` - rule documentation on hover
82+
- `workspace/didChangeConfiguration` - runtime config updates
83+
- `workspace/executeCommand` - project-level validation (`agnix.validateProjectRules` command)
84+
85+
## References
86+
87+
- [SPEC.md](https://github.com/agent-sh/agnix/blob/v0.46.0/SPEC.md) - full technical specification
88+
- [MCP Protocol](https://modelcontextprotocol.io) - MCP specification
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Configuration
3+
description: "Configure agnix with .agnix.toml - target tools, disable rules, set output format, and more."
4+
---
5+
6+
# Configuration
7+
8+
agnix works with zero configuration. To customize, add `.agnix.toml` to your project root.
9+
10+
## Example
11+
12+
```toml
13+
target = "ClaudeCode"
14+
tools = ["claude-code"]
15+
max_files_to_validate = 10000
16+
locale = "en"
17+
18+
[rules]
19+
disabled_rules = []
20+
```
21+
22+
## Options
23+
24+
| Option | Type | Default | Description |
25+
|--------|------|---------|-------------|
26+
| `target` | string | `Generic` | Legacy single tool focus: `Generic`, `ClaudeCode`, `Cursor`, `Codex`, `Kiro` |
27+
| `tools` | string[] | `[]` | Multi-tool targeting. Overrides `target`. Use values like `claude-code`, `cursor`, `codex`, `kiro`, `github-copilot`, `cline`, `opencode`, `gemini-cli`, `amp`, `roo-code`, `windsurf`, `generic`. |
28+
| `severity` | string | `Warning` | Minimum severity level: `Warning`, `Error`, or `Info` |
29+
| `max_files_to_validate` | int | `10000` | Maximum files to scan |
30+
| `locale` | string | `"en"` | Output locale |
31+
| `[rules].disabled_rules` | string[] | `[]` | Rule IDs to skip (e.g. `["CC-MEM-005"]`) |
32+
| `[rules].disabled_validators` | string[] | `[]` | Validator names to skip |
33+
| `[files]` | table | default excludes | Include or exclude non-standard files |
34+
| `[[overrides]]` | table array | `[]` | Per-file disabled rule overrides |
35+
36+
## CLI flags
37+
38+
CLI flags override `.agnix.toml` values:
39+
40+
```bash
41+
# Target a specific tool
42+
agnix --target cursor .
43+
44+
# Apply fixes
45+
agnix --fix .
46+
47+
# JSON output for CI
48+
agnix --format json .
49+
50+
# SARIF output for GitHub Code Scanning
51+
agnix --format sarif .
52+
53+
# Strict mode
54+
agnix --strict .
55+
```
56+
57+
`--strict`, `--fix`, `--fix-safe`, `--fix-unsafe`, `--dry-run`, `--show-fixes`, and `--format` are CLI flags, not `.agnix.toml` keys.
58+
59+
## Full reference
60+
61+
For the complete configuration specification, see
62+
[docs/CONFIGURATION.md](https://github.com/agent-sh/agnix/blob/v0.46.0/docs/CONFIGURATION.md)
63+
in the repository.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: Contributing
3+
description: "How to contribute to agnix - report bugs, request rules, improve docs, or write code."
4+
---
5+
6+
# Contributing
7+
8+
Contributions are welcome and appreciated.
9+
10+
## Found something off?
11+
12+
agnix validates against 445 rules, but the agent config ecosystem moves fast. If a rule is wrong, missing, or too noisy, I want to know.
13+
14+
- [Report a bug](https://github.com/agent-sh/agnix/issues/new)
15+
- [Request a rule](https://github.com/agent-sh/agnix/issues/new)
16+
17+
Your real-world configs are the best test suite I could ask for.
18+
19+
## Contribute code
20+
21+
Good first issues are labeled and ready:
22+
[good first issues](https://github.com/agent-sh/agnix/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
23+
24+
Adding a new rule is one of the best ways to get started. Each rule is a self-contained unit with clear inputs, outputs, and test patterns. Find a similar existing rule to use as your template.
25+
26+
## Improve docs
27+
28+
This documentation site is in `website/`. To run locally:
29+
30+
```bash
31+
npm --prefix website ci
32+
npm --prefix website run generate:rules
33+
npm --prefix website start
34+
```
35+
36+
## Where canonical content lives
37+
38+
Long-form source-of-truth docs remain in the repository:
39+
40+
- `README.md`
41+
- `SPEC.md`
42+
- `knowledge-base/`
43+
44+
This website assembles and links that content for navigation and search.
45+
46+
## References
47+
48+
- [CONTRIBUTING.md](https://github.com/agent-sh/agnix/blob/v0.46.0/CONTRIBUTING.md) - full contribution guidelines
49+
- [SECURITY.md](https://github.com/agent-sh/agnix/blob/v0.46.0/SECURITY.md) - security policy

0 commit comments

Comments
 (0)