reporails-cli 0.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- reporails_cli-0.0.2/.claude/rules/backbone.md +7 -0
- reporails_cli-0.0.2/.claude/rules/checks-readonly.md +12 -0
- reporails_cli-0.0.2/.claude/rules/documentation.md +15 -0
- reporails_cli-0.0.2/.claude/rules/instruction-file-style.md +13 -0
- reporails_cli-0.0.2/.claude/rules/specs.md +13 -0
- reporails_cli-0.0.2/.claude/rules/writing-rules.md +29 -0
- reporails_cli-0.0.2/.claude/settings.local.json +66 -0
- reporails_cli-0.0.2/.claudeignore +33 -0
- reporails_cli-0.0.2/.gitignore +20 -0
- reporails_cli-0.0.2/.mcp.json.example +8 -0
- reporails_cli-0.0.2/.reporails/backbone.yml +46 -0
- reporails_cli-0.0.2/CLAUDE.md +89 -0
- reporails_cli-0.0.2/LICENSE +201 -0
- reporails_cli-0.0.2/PKG-INFO +108 -0
- reporails_cli-0.0.2/README.md +73 -0
- reporails_cli-0.0.2/docs/specs/arch.md +381 -0
- reporails_cli-0.0.2/docs/specs/caching.md +301 -0
- reporails_cli-0.0.2/docs/specs/models.md +424 -0
- reporails_cli-0.0.2/docs/specs/modules.md +746 -0
- reporails_cli-0.0.2/docs/specs/principles.md +65 -0
- reporails_cli-0.0.2/docs/specs/scoring.md +414 -0
- reporails_cli-0.0.2/docs/specs/testing.md +386 -0
- reporails_cli-0.0.2/pyproject.toml +101 -0
- reporails_cli-0.0.2/scripts/link-rules.sh +73 -0
- reporails_cli-0.0.2/src/__init__.py +5 -0
- reporails_cli-0.0.2/src/reporails_cli/.env.example +1 -0
- reporails_cli-0.0.2/src/reporails_cli/__init__.py +24 -0
- reporails_cli-0.0.2/src/reporails_cli/bundled/.semgrepignore +51 -0
- reporails_cli-0.0.2/src/reporails_cli/bundled/__init__.py +31 -0
- reporails_cli-0.0.2/src/reporails_cli/bundled/capability-patterns.yml +54 -0
- reporails_cli-0.0.2/src/reporails_cli/bundled/levels.yml +99 -0
- reporails_cli-0.0.2/src/reporails_cli/core/__init__.py +35 -0
- reporails_cli-0.0.2/src/reporails_cli/core/agents.py +147 -0
- reporails_cli-0.0.2/src/reporails_cli/core/applicability.py +150 -0
- reporails_cli-0.0.2/src/reporails_cli/core/bootstrap.py +147 -0
- reporails_cli-0.0.2/src/reporails_cli/core/cache.py +352 -0
- reporails_cli-0.0.2/src/reporails_cli/core/capability.py +245 -0
- reporails_cli-0.0.2/src/reporails_cli/core/discover.py +362 -0
- reporails_cli-0.0.2/src/reporails_cli/core/engine.py +177 -0
- reporails_cli-0.0.2/src/reporails_cli/core/init.py +309 -0
- reporails_cli-0.0.2/src/reporails_cli/core/levels.py +177 -0
- reporails_cli-0.0.2/src/reporails_cli/core/models.py +329 -0
- reporails_cli-0.0.2/src/reporails_cli/core/opengrep/__init__.py +34 -0
- reporails_cli-0.0.2/src/reporails_cli/core/opengrep/runner.py +203 -0
- reporails_cli-0.0.2/src/reporails_cli/core/opengrep/semgrepignore.py +39 -0
- reporails_cli-0.0.2/src/reporails_cli/core/opengrep/templates.py +138 -0
- reporails_cli-0.0.2/src/reporails_cli/core/registry.py +155 -0
- reporails_cli-0.0.2/src/reporails_cli/core/sarif.py +181 -0
- reporails_cli-0.0.2/src/reporails_cli/core/scorer.py +178 -0
- reporails_cli-0.0.2/src/reporails_cli/core/semantic.py +193 -0
- reporails_cli-0.0.2/src/reporails_cli/core/utils.py +139 -0
- reporails_cli-0.0.2/src/reporails_cli/formatters/__init__.py +19 -0
- reporails_cli-0.0.2/src/reporails_cli/formatters/json.py +137 -0
- reporails_cli-0.0.2/src/reporails_cli/formatters/mcp.py +68 -0
- reporails_cli-0.0.2/src/reporails_cli/formatters/text/__init__.py +32 -0
- reporails_cli-0.0.2/src/reporails_cli/formatters/text/box.py +89 -0
- reporails_cli-0.0.2/src/reporails_cli/formatters/text/chars.py +42 -0
- reporails_cli-0.0.2/src/reporails_cli/formatters/text/compact.py +119 -0
- reporails_cli-0.0.2/src/reporails_cli/formatters/text/components.py +117 -0
- reporails_cli-0.0.2/src/reporails_cli/formatters/text/full.py +135 -0
- reporails_cli-0.0.2/src/reporails_cli/formatters/text/rules.py +50 -0
- reporails_cli-0.0.2/src/reporails_cli/formatters/text/violations.py +92 -0
- reporails_cli-0.0.2/src/reporails_cli/interfaces/__init__.py +1 -0
- reporails_cli-0.0.2/src/reporails_cli/interfaces/cli/__init__.py +7 -0
- reporails_cli-0.0.2/src/reporails_cli/interfaces/cli/main.py +352 -0
- reporails_cli-0.0.2/src/reporails_cli/interfaces/mcp/__init__.py +5 -0
- reporails_cli-0.0.2/src/reporails_cli/interfaces/mcp/server.py +194 -0
- reporails_cli-0.0.2/src/reporails_cli/interfaces/mcp/tools.py +136 -0
- reporails_cli-0.0.2/src/reporails_cli/py.typed +0 -0
- reporails_cli-0.0.2/src/reporails_cli/templates/__init__.py +65 -0
- reporails_cli-0.0.2/src/reporails_cli/templates/cli_box.txt +10 -0
- reporails_cli-0.0.2/src/reporails_cli/templates/cli_cta.txt +4 -0
- reporails_cli-0.0.2/src/reporails_cli/templates/cli_delta.txt +1 -0
- reporails_cli-0.0.2/src/reporails_cli/templates/cli_file_header.txt +1 -0
- reporails_cli-0.0.2/src/reporails_cli/templates/cli_legend.txt +1 -0
- reporails_cli-0.0.2/src/reporails_cli/templates/cli_pending.txt +3 -0
- reporails_cli-0.0.2/src/reporails_cli/templates/cli_violation.txt +1 -0
- reporails_cli-0.0.2/src/reporails_cli/templates/cli_working.txt +2 -0
- reporails_cli-0.0.2/tests/__init__.py +1 -0
- reporails_cli-0.0.2/tests/conftest.py +305 -0
- reporails_cli-0.0.2/tests/fixtures/.gitkeep +0 -0
- reporails_cli-0.0.2/tests/integration/__init__.py +1 -0
- reporails_cli-0.0.2/tests/integration/test_capability_detection.py +283 -0
- reporails_cli-0.0.2/tests/integration/test_exit_codes.py +390 -0
- reporails_cli-0.0.2/tests/integration/test_rule_validation.py +368 -0
- reporails_cli-0.0.2/tests/integration/test_scoring.py +64 -0
- reporails_cli-0.0.2/tests/integration/test_template_resolution.py +305 -0
- reporails_cli-0.0.2/tests/unit/__init__.py +1 -0
- reporails_cli-0.0.2/tests/unit/test_delta.py +419 -0
- reporails_cli-0.0.2/tests/unit/test_scoring.py +311 -0
- reporails_cli-0.0.2/tests/unit/test_templates.py +383 -0
- reporails_cli-0.0.2/uv.lock +1233 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths: ["src/reporails_cli/bundled/**"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Bundled Config Files
|
|
6
|
+
|
|
7
|
+
NEVER modify bundled config files without explicit human instruction.
|
|
8
|
+
|
|
9
|
+
- `levels.yml` — Level definitions and rule-to-level mapping
|
|
10
|
+
- `capability-patterns.yml` — OpenGrep patterns for capability detection
|
|
11
|
+
|
|
12
|
+
These are CLI-owned orchestration logic, not framework rules.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths: ["docs/*.md", "README.md"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# User-Facing Documentation
|
|
6
|
+
|
|
7
|
+
These files are read by people, not coding agents.
|
|
8
|
+
|
|
9
|
+
- These files are for user-facing documentation, not AI agent instructions
|
|
10
|
+
- Commands must be copy-pasteable and working (`ails check .`, not `reporails check .`)
|
|
11
|
+
- Examples must reflect actual CLI behavior
|
|
12
|
+
- Don't document features that don't exist yet
|
|
13
|
+
- Keep installation/usage sections current with pyproject.toml
|
|
14
|
+
- Use consistent terminology: "rules" not "checks" in user-facing text
|
|
15
|
+
- When fixing errors, make targeted edits — don't rewrite sections and lose valid content
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths: ["CLAUDE.md", ".claude/rules/**"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Instruction File Style
|
|
6
|
+
|
|
7
|
+
When writing or editing CLAUDE.md or .claude/rules/*.md files:
|
|
8
|
+
|
|
9
|
+
- These files are for AI agent behavior, not user-facing documentation
|
|
10
|
+
- State facts, commands, rules only
|
|
11
|
+
- No meta-commentary ("this section explains...", "as mentioned above...")
|
|
12
|
+
- Every line MUST be actionable or informative
|
|
13
|
+
- Avoid redundant context that wastes tokens
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths: ["docs/specs/**"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Specification Files
|
|
6
|
+
|
|
7
|
+
Specs must accurately reflect the implementation.
|
|
8
|
+
|
|
9
|
+
- Update specs when changing code behavior
|
|
10
|
+
- Function signatures, return types, and interfaces must match code
|
|
11
|
+
- Remove features from specs when removing from code
|
|
12
|
+
- Add features to specs when adding to code
|
|
13
|
+
- No aspirational content - document what exists, not what might exist
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths: [".claude/rules/**"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Writing Rule Files
|
|
6
|
+
|
|
7
|
+
Rule files in `.claude/rules/` are loaded into Claude's context.
|
|
8
|
+
|
|
9
|
+
## Format
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
---
|
|
13
|
+
paths: ["src/**/*.py"] # Optional: scope to specific files
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Rule Title
|
|
17
|
+
|
|
18
|
+
- Actionable instruction
|
|
19
|
+
- Another instruction
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Guidelines
|
|
23
|
+
|
|
24
|
+
- One concern per file (security separate from styling)
|
|
25
|
+
- Keep under 500 lines - everything consumes tokens
|
|
26
|
+
- Use descriptive filenames (`api-validation.md` not `rules1.md`)
|
|
27
|
+
- Add `paths` frontmatter to reduce noise when not relevant
|
|
28
|
+
- No paths = loads globally for all files
|
|
29
|
+
- Content MUST be actionable, not explanatory
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(uv run ruff check:*)",
|
|
5
|
+
"Bash(uv run poe:*)",
|
|
6
|
+
"Bash(uv run python:*)",
|
|
7
|
+
"Bash(uv pip install:*)",
|
|
8
|
+
"Bash(uv run mypy:*)",
|
|
9
|
+
"Bash(uv run pytest:*)",
|
|
10
|
+
"Bash(uv run:*)",
|
|
11
|
+
"Bash(grep:*)",
|
|
12
|
+
"Bash(~/.local/share/reporails/opengrep scan:*)",
|
|
13
|
+
"Bash(ls:*)",
|
|
14
|
+
"Bash(~/.reporails/bin/opengrep scan:*)",
|
|
15
|
+
"Bash(fi)",
|
|
16
|
+
"Bash(done)",
|
|
17
|
+
"WebSearch",
|
|
18
|
+
"Bash(uv pip list:*)",
|
|
19
|
+
"Bash(uv sync:*)",
|
|
20
|
+
"Bash(git -C /home/cleverhoods/Projects/ai/reporail/cli status --short)",
|
|
21
|
+
"Bash(git -C /home/cleverhoods/Projects/ai/reporail/cli diff HEAD -- src/reporails_cli/core/cache.py .gitignore)",
|
|
22
|
+
"Bash(find:*)",
|
|
23
|
+
"Bash(python3:*)",
|
|
24
|
+
"WebFetch(domain:claudefa.st)",
|
|
25
|
+
"WebFetch(domain:www.anthropic.com)",
|
|
26
|
+
"Bash(gh api:*)",
|
|
27
|
+
"WebFetch(domain:claudelog.com)",
|
|
28
|
+
"Bash(xargs -I{} sh -c 'echo \"\"=== {} ===\"\" && grep severity {}')",
|
|
29
|
+
"Bash(echo:*)",
|
|
30
|
+
"Bash(gh repo view:*)",
|
|
31
|
+
"Bash(uv build:*)",
|
|
32
|
+
"Bash(unzip:*)",
|
|
33
|
+
"Bash(./scripts/link-rules.sh:*)",
|
|
34
|
+
"Bash(bash:*)",
|
|
35
|
+
"Bash(ln:*)",
|
|
36
|
+
"Bash(for f in checks/*/*.md)",
|
|
37
|
+
"Bash(do if [[ -L \"$f\" ]])",
|
|
38
|
+
"Bash(then echo \"=== $f ===\" head -20 \"$f\")",
|
|
39
|
+
"Bash(git -C /home/cleverhoods/Projects/ai/reporail/cli diff --stat HEAD)",
|
|
40
|
+
"Bash(python:*)",
|
|
41
|
+
"Bash(wc:*)",
|
|
42
|
+
"Bash(claude mcp list)",
|
|
43
|
+
"Bash(claude mcp list:*)",
|
|
44
|
+
"mcp__reporails__score",
|
|
45
|
+
"mcp__reporails__validate",
|
|
46
|
+
"Bash(git log:*)",
|
|
47
|
+
"Bash(~/.reporails/bin/opengrep:*)",
|
|
48
|
+
"Bash(PYTHONPATH=src python3:*)",
|
|
49
|
+
"Bash(1 --verbose)",
|
|
50
|
+
"Bash(__NEW_LINE_70733a4bdee3013b__ echo \"=== Without --no-git-ignore \\(git-tracked only\\) ===\")",
|
|
51
|
+
"Bash(head:*)",
|
|
52
|
+
"Bash(for f in ~/.reporails/rules/agents/claude/rules/*.yml)",
|
|
53
|
+
"Bash(do)",
|
|
54
|
+
"Bash(if ! grep -q \"paths:\" \"$f\")",
|
|
55
|
+
"Bash(then)",
|
|
56
|
+
"Bash(cat:*)",
|
|
57
|
+
"Bash(# Test scaling with rules that actually work echo \"\"=== 1 rule ===\"\" time ~/.reporails/bin/opengrep scan --sarif --config ~/.reporails/rules/agents/claude/rules/CLAUDE_M5-auto-generated-content-review.yml .)",
|
|
58
|
+
"Bash(# Test with --include to limit files echo \"\"=== 6 rules + whole directory ===\"\" time ~/.reporails/bin/opengrep scan --sarif \\\\ --config ~/.reporails/rules/agents/claude/rules/CLAUDE_M5-auto-generated-content-review.yml \\\\ --config ~/.reporails/rules/agents/claude/rules/CLAUDE_M7-rule-snippet-length.yml \\\\ --config ~/.reporails/rules/agents/claude/rules/CLAUDE_S4-hierarchical-memory.yml \\\\ --config ~/.reporails/rules/agents/claude/rules/CLAUDE_S5-path-scoped-rules.yml \\\\ .)",
|
|
59
|
+
"Bash(npx @modelcontextprotocol/inspector uv run ails-mcp)"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"enableAllProjectMcpServers": true,
|
|
63
|
+
"enabledMcpjsonServers": [
|
|
64
|
+
"reporails"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Claude Code Ignore Patterns
|
|
2
|
+
# Never read these files/directories.
|
|
3
|
+
|
|
4
|
+
# Lock file
|
|
5
|
+
uv.lock
|
|
6
|
+
|
|
7
|
+
# Python cache & virtual environments
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.pyc
|
|
10
|
+
*.pyo
|
|
11
|
+
*.pyd
|
|
12
|
+
.venv/
|
|
13
|
+
|
|
14
|
+
# Build artifacts & caches
|
|
15
|
+
.cache/
|
|
16
|
+
.langgraph_api/
|
|
17
|
+
.pytest_cache/
|
|
18
|
+
.mypy_cache/
|
|
19
|
+
.ruff_cache/
|
|
20
|
+
*.egg-info/
|
|
21
|
+
dist/
|
|
22
|
+
build/
|
|
23
|
+
|
|
24
|
+
# Version control
|
|
25
|
+
.git/
|
|
26
|
+
|
|
27
|
+
# IDE & editor
|
|
28
|
+
.idea/
|
|
29
|
+
|
|
30
|
+
# Environment & secrets
|
|
31
|
+
.env
|
|
32
|
+
.env.local
|
|
33
|
+
.env.*.local
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.idea
|
|
2
|
+
.venv
|
|
3
|
+
__pycache__
|
|
4
|
+
|
|
5
|
+
# Framework docs (symlinked from framework repo)
|
|
6
|
+
checks/*/*.md
|
|
7
|
+
docs/capability-levels.md
|
|
8
|
+
|
|
9
|
+
docs/research
|
|
10
|
+
|
|
11
|
+
# Reporails caches (backbone.yml is committed, caches are not)
|
|
12
|
+
.reporails/.cache/
|
|
13
|
+
# Prevent stray .reporails in subdirectories
|
|
14
|
+
*/.reporails/
|
|
15
|
+
|
|
16
|
+
.env
|
|
17
|
+
|
|
18
|
+
# Claude Code MCP config (machine-specific paths)
|
|
19
|
+
.claude/mcp.json
|
|
20
|
+
.mcp.json
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
generated_at: '2026-01-25T17:43:08.682362+00:00'
|
|
3
|
+
generator: ails discover
|
|
4
|
+
target: /home/cleverhoods/Projects/ai/reporail/cli
|
|
5
|
+
agents:
|
|
6
|
+
claude:
|
|
7
|
+
name: Claude (Anthropic)
|
|
8
|
+
instruction_files:
|
|
9
|
+
- CLAUDE.md
|
|
10
|
+
config_files:
|
|
11
|
+
- .claude/mcp.json
|
|
12
|
+
rule_files:
|
|
13
|
+
- .claude/rules/backbone.md
|
|
14
|
+
- .claude/rules/checks-readonly.md
|
|
15
|
+
- .claude/rules/documentation.md
|
|
16
|
+
- .claude/rules/instruction-file-style.md
|
|
17
|
+
- .claude/rules/specs.md
|
|
18
|
+
- .claude/rules/writing-rules.md
|
|
19
|
+
components:
|
|
20
|
+
.claude.rules:
|
|
21
|
+
root: .claude/rules
|
|
22
|
+
instruction_files:
|
|
23
|
+
- .claude/rules/backbone.md
|
|
24
|
+
- .claude/rules/checks-readonly.md
|
|
25
|
+
- .claude/rules/documentation.md
|
|
26
|
+
- .claude/rules/instruction-file-style.md
|
|
27
|
+
- .claude/rules/specs.md
|
|
28
|
+
- .claude/rules/writing-rules.md
|
|
29
|
+
content_hash: sha256:bb2584d1cb25003d
|
|
30
|
+
imports:
|
|
31
|
+
- .reporails/backbone.yml
|
|
32
|
+
root:
|
|
33
|
+
root: .
|
|
34
|
+
instruction_files:
|
|
35
|
+
- CLAUDE.md
|
|
36
|
+
content_hash: sha256:ed36169e31ea423e
|
|
37
|
+
imports:
|
|
38
|
+
- .reporails/backbone.yml
|
|
39
|
+
- docs/specs/arch.md
|
|
40
|
+
- docs/specs/modules.md
|
|
41
|
+
shared:
|
|
42
|
+
- .reporails/backbone.yml
|
|
43
|
+
stats:
|
|
44
|
+
total_instruction_files: 7
|
|
45
|
+
total_components: 2
|
|
46
|
+
total_references: 4
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Reporails CLI
|
|
2
|
+
|
|
3
|
+
AI instruction linter. Validates instruction files against community-maintained rules.
|
|
4
|
+
|
|
5
|
+
**repoRAILS** = **Repo** **R**ecursive **AI** **L**inting**S**
|
|
6
|
+
|
|
7
|
+
## Development Context
|
|
8
|
+
|
|
9
|
+
You are developing the reporails CLI, not an end user.
|
|
10
|
+
|
|
11
|
+
- **You**: modify source, run tests, read specs
|
|
12
|
+
- **CLI end users**: install package, run `ails check`
|
|
13
|
+
- **MCP end users**: use reporails via Claude Code
|
|
14
|
+
|
|
15
|
+
Don't conflate these when discussing features, delivery, or documentation.
|
|
16
|
+
|
|
17
|
+
## Session Start
|
|
18
|
+
|
|
19
|
+
1. Read `.reporails/backbone.yml` for project structure
|
|
20
|
+
2. Read `docs/specs/arch.md` for architecture decisions
|
|
21
|
+
3. Read `docs/specs/modules.md` before modifying core modules
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
```bash
|
|
25
|
+
uv sync # Install dependencies
|
|
26
|
+
uv run ails check . # Validate (auto-downloads OpenGrep + framework)
|
|
27
|
+
uv run ails map . --save # Save backbone.yml
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Commands
|
|
31
|
+
|
|
32
|
+
| Command | Purpose |
|
|
33
|
+
|---------|---------|
|
|
34
|
+
| `ails check [PATH]` | Validate instruction files |
|
|
35
|
+
| `ails check --refresh` | Force re-scan, ignore cache |
|
|
36
|
+
| `ails check --quiet-semantic` | Suppress semantic rules message |
|
|
37
|
+
| `ails check -f json` | JSON output (for scripts/MCP) |
|
|
38
|
+
| `ails map [PATH]` | Discover project structure |
|
|
39
|
+
| `ails map --save` | Save backbone.yml to .reporails/ |
|
|
40
|
+
| `ails explain RULE_ID` | Show rule details |
|
|
41
|
+
| `ails update` | Update framework to latest |
|
|
42
|
+
| `ails version` | Show CLI and framework versions |
|
|
43
|
+
|
|
44
|
+
## Project Structure
|
|
45
|
+
```
|
|
46
|
+
src/reporails_cli/
|
|
47
|
+
├── core/ # Domain logic
|
|
48
|
+
├── bundled/ # CLI-owned config (levels.yml, capability-patterns.yml)
|
|
49
|
+
├── interfaces/ # CLI and MCP entry points
|
|
50
|
+
└── formatters/ # Output adapters
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
See `docs/specs/arch.md` for full architecture.
|
|
54
|
+
|
|
55
|
+
## Framework vs CLI
|
|
56
|
+
|
|
57
|
+
| Component | Location | Purpose |
|
|
58
|
+
|-----------|----------|---------|
|
|
59
|
+
| Rules | Downloaded to `~/.reporails/rules/` | What to check |
|
|
60
|
+
| Levels | Bundled in `src/bundled/levels.yml` | How to score |
|
|
61
|
+
| OpenGrep | Downloaded to `~/.reporails/bin/` | Pattern matching |
|
|
62
|
+
|
|
63
|
+
## QA Commands
|
|
64
|
+
|
|
65
|
+
| Command | Purpose |
|
|
66
|
+
|---------|---------|
|
|
67
|
+
| `uv run poe qa_fast` | Lint, type check, unit tests (pre-commit) |
|
|
68
|
+
| `uv run poe qa` | Full QA including integration tests |
|
|
69
|
+
| `uv run poe lint` | Ruff linter |
|
|
70
|
+
| `uv run poe format` | Format code |
|
|
71
|
+
| `uv run poe type` | Mypy type checking |
|
|
72
|
+
| `uv run poe test_unit` | Unit tests only (fast, no OpenGrep) |
|
|
73
|
+
| `uv run poe test_integration` | Integration tests (requires OpenGrep) |
|
|
74
|
+
|
|
75
|
+
## Test Structure
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
tests/
|
|
79
|
+
├── unit/ # Fast tests, no external dependencies
|
|
80
|
+
└── integration/ # Requires OpenGrep binary
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Architecture
|
|
84
|
+
|
|
85
|
+
- **Agent-Agnostic**: Detects Claude, Cursor, Windsurf, Copilot, Aider
|
|
86
|
+
- **Claude Rules v0.0.1**: Linting rules currently for Claude only
|
|
87
|
+
- **OpenGrep-Powered**: Deterministic pattern matching
|
|
88
|
+
- **Two-Phase Detection**: Filesystem + content analysis for capability scoring
|
|
89
|
+
- **Framework Separation**: CLI orchestrates, framework defines rules
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 [Gábor Mészáros]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: reporails-cli
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: Lint and score CLAUDE.md files — MCP-first AI context governance
|
|
5
|
+
Project-URL: Homepage, https://github.com/reporails/cli
|
|
6
|
+
Project-URL: Documentation, https://reporails.dev/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/reporails/cli
|
|
8
|
+
Project-URL: Issues, https://github.com/reporails/cli/issues
|
|
9
|
+
Author: Reporails Team
|
|
10
|
+
License: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: ai,claude,claude-code,context,lint,mcp
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Requires-Dist: httpx>=0.27.0
|
|
22
|
+
Requires-Dist: mcp>=1.0.0
|
|
23
|
+
Requires-Dist: pydantic>=2.0.0
|
|
24
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
25
|
+
Requires-Dist: rich>=13.0.0
|
|
26
|
+
Requires-Dist: typer>=0.12.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: mypy>=1.8.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: poethepoet>=0.25.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: ruff>=0.3.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: types-pyyaml>=6.0.0; extra == 'dev'
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# Reporails CLI
|
|
37
|
+
|
|
38
|
+
Score your CLAUDE.md files. See what's missing. Improve your AI coding setup.
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
```bash
|
|
42
|
+
# Check your setup (auto-installs OpenGrep + rules on first run)
|
|
43
|
+
uvx reporails-cli check .
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
That's it. You'll see:
|
|
47
|
+
```
|
|
48
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
49
|
+
║ SCORE: 8.1 / 10 (partial) | CAPABILITY: Governed (L5) ║
|
|
50
|
+
║ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░ ║
|
|
51
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
52
|
+
|
|
53
|
+
Violations:
|
|
54
|
+
CLAUDE.md (7 issues)
|
|
55
|
+
○ MED C4.no-antipatterns :1 No NEVER or AVOID statements found
|
|
56
|
+
· LOW C12.no-version :1 No version or date marker found
|
|
57
|
+
...
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Fix the issues, run again, watch your score improve.
|
|
61
|
+
|
|
62
|
+
## What It Checks
|
|
63
|
+
|
|
64
|
+
- **Structure** — File organization, size limits
|
|
65
|
+
- **Content** — Clarity, completeness, anti-patterns
|
|
66
|
+
- **Efficiency** — Token usage, context management
|
|
67
|
+
- **Maintenance** — Versioning, review processes
|
|
68
|
+
- **Governance** — Ownership, security policies
|
|
69
|
+
|
|
70
|
+
## Capability Levels
|
|
71
|
+
|
|
72
|
+
| Level | Name | What it means |
|
|
73
|
+
|-------|------|---------------|
|
|
74
|
+
| L1 | Absent | No instruction file |
|
|
75
|
+
| L2 | Basic | Has CLAUDE.md |
|
|
76
|
+
| L3 | Structured | Sections, imports |
|
|
77
|
+
| L4 | Abstracted | .claude/rules/ directory |
|
|
78
|
+
| L5 | Governed | Shared files, 3+ components |
|
|
79
|
+
| L6 | Adaptive | Backbone + full governance |
|
|
80
|
+
|
|
81
|
+
## MCP Integration (for Claude Code)
|
|
82
|
+
|
|
83
|
+
For full semantic analysis, add the MCP server:
|
|
84
|
+
```bash
|
|
85
|
+
claude mcp add reporails -- uvx reporails-cli ails-mcp
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Then ask Claude: "What ails claude?"
|
|
89
|
+
|
|
90
|
+
## Commands
|
|
91
|
+
```bash
|
|
92
|
+
ails check . # Score your setup
|
|
93
|
+
ails check . -f json # JSON output (for CI)
|
|
94
|
+
ails check . --strict # Exit 1 if violations (for CI)
|
|
95
|
+
ails map . # Show project structure
|
|
96
|
+
ails map . --save # Generate backbone.yml
|
|
97
|
+
ails explain S1 # Explain a rule
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Rules
|
|
101
|
+
|
|
102
|
+
Rules are maintained separately at [reporails/rules](https://github.com/reporails/rules).
|
|
103
|
+
|
|
104
|
+
Want to add or improve rules? Contribute there.
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
Apache 2.0
|