docs(rules): fix contradictions, update technical rules, enforce rule structure
CI / CI configuration security checks (pull_request) Successful in 2s
CI / Capabilities and shell quality (pull_request) Successful in 15s
CI / Python tests and compilation (pull_request) Successful in 36s
CI / QMD unit tests (pull_request) Successful in 7s
CI / Build and inspect generated packages (pull_request) Successful in 16s
CI / Bash integration and installation guards (pull_request) Failing after 51s
CI / PowerShell tests on Ubuntu (pull_request) Failing after 1m45s
CI / Installed client configuration smoke tests (pull_request) Canceled after 1m24s
CI / CI configuration security checks (pull_request) Successful in 2s
CI / Capabilities and shell quality (pull_request) Successful in 15s
CI / Python tests and compilation (pull_request) Successful in 36s
CI / QMD unit tests (pull_request) Successful in 7s
CI / Build and inspect generated packages (pull_request) Successful in 16s
CI / Bash integration and installation guards (pull_request) Failing after 51s
CI / PowerShell tests on Ubuntu (pull_request) Failing after 1m45s
CI / Installed client configuration smoke tests (pull_request) Canceled after 1m24s
- Resolve contradictions: authorization is never a skipped "boundary check"; one browser token policy (BFF/HttpOnly cookies first, RFC 10017); one sanitizer-bypass rule; Angular responses are unknown until validated. - Add security rules for AI/LLM integration and Java XXE, concrete crypto and password-hashing parameters, and RFC 8725 JWT validation. - Update version-dependent guidance after checking official sources: Angular 22, TypeScript 6/7, Node 24+, .NET 10/C# 14, JDK 21-25, Spring Boot 4; add a Spring Boot and Spring Security topic. - Give every rule a unique level-1 title and scope line, keep language security files to language specifics, and fix routing for inbound vs outbound HTTP, XML parsing, and WPF/Angular parent rules. - Validate rule structure and routing in validate-config.py, with tests. - Fix CI issues found by a local run: shellcheck directive order, pinned ruff rule set, Invoke-Python test mock, CRLF-tolerant package checks, Windows-only credential test, and refreshed prompt-budget baselines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
79694fbaa2
commit
6159c6373c
62 files changed
+453
-300
No files matched your search
@@ -4,6 +4,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
@@ -89,6 +90,43 @@ def validate_agent_tools(package: Path) -> None:
|
||||
fail(f"{path}: unknown Claude tool name(s): {', '.join(unknown)}")
|
||||
|
||||
|
||||
RULE_PATH = re.compile(r"`(rules/[A-Za-z0-9_./-]+\.md)`")
|
||||
RULE_SKILL = re.compile(r"`(rules-[a-z0-9-]+)`")
|
||||
REFERENCE_LINK = re.compile(r"`(references/[A-Za-z0-9_./-]+\.md)`")
|
||||
|
||||
|
||||
def validate_rule_tree(codex_package: Path) -> None:
|
||||
"""Keep the rule catalog routable: unique H1 titles, complete indexes, and no dangling links."""
|
||||
rules = codex_package / "rules"
|
||||
titles: dict[str, Path] = {}
|
||||
for path in sorted(rules.rglob("*.md")):
|
||||
first = next((line for line in path.read_text(encoding="utf-8-sig").splitlines() if line.strip()), "")
|
||||
if not first.startswith("# "):
|
||||
fail(f"{path}: a rule must start with a level-1 heading; it becomes the Claude skill description")
|
||||
title = first[2:].strip().lower()
|
||||
if title in titles:
|
||||
fail(f"{path}: title duplicates {titles[title]}; rule titles must be unique")
|
||||
titles[title] = path
|
||||
for index in sorted(rules.rglob("index.md")):
|
||||
linked = set(REFERENCE_LINK.findall(index.read_text(encoding="utf-8-sig")))
|
||||
for link in linked:
|
||||
if not (index.parent / link).is_file():
|
||||
fail(f"{index}: links missing rule {link}")
|
||||
for reference in sorted((index.parent / "references").glob("*.md")):
|
||||
if f"references/{reference.name}" not in linked:
|
||||
fail(f"{reference}: not linked from {index}")
|
||||
for link in RULE_PATH.findall((codex_package / "AGENTS.md").read_text(encoding="utf-8-sig")):
|
||||
if not (codex_package / link).is_file():
|
||||
fail(f"{codex_package / 'AGENTS.md'}: routes to missing rule {link}")
|
||||
|
||||
|
||||
def validate_rule_routing(claude_package: Path) -> None:
|
||||
instructions = claude_package / "CLAUDE.md"
|
||||
for skill in set(RULE_SKILL.findall(instructions.read_text(encoding="utf-8-sig"))):
|
||||
if not (claude_package / "skills" / skill / "SKILL.md").is_file():
|
||||
fail(f"{instructions}: routes to missing skill {skill}")
|
||||
|
||||
|
||||
def main() -> int:
|
||||
if len(sys.argv) != 3:
|
||||
print("usage: validate-config.py <codex-toml> <claude-json>", file=sys.stderr)
|
||||
@@ -97,6 +135,8 @@ def main() -> int:
|
||||
validate_claude(Path(sys.argv[2]))
|
||||
validate_rule_skills(Path(sys.argv[2]).parent)
|
||||
validate_agent_tools(Path(sys.argv[2]).parent)
|
||||
validate_rule_tree(Path(sys.argv[1]).parent)
|
||||
validate_rule_routing(Path(sys.argv[2]).parent)
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user