Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ Data sources: [ecosyste.ms](https://ecosyste.ms) for published package metadata,

## Resources

Alongside the toolchain, brief picks up the conventional documents that describe how a project is run. README, changelog, roadmap, and license (with detected SPDX identifier) are reported at the top level. Everything else is grouped: legal covers copyright, NOTICE, DCO, and CLA files; community covers contributing guides, code of conduct, support, governance, maintainers, authors, CODEOWNERS, and DEI statements; security covers the security policy, threat model, and audit reports; metadata covers machine-readable files like FUNDING, CITATION.cff, publiccode.yml, codemeta.json, and .zenodo.json; agents covers AI coding tool instruction files including AGENTS.md, CLAUDE.md, GEMINI.md, .cursorrules, .windsurfrules, .github/copilot-instructions.md, .aider.conf.yml, .clinerules, .rules, .junie/guidelines.md, replit.md, .continuerules, .augment-guidelines, and .roorules.
Alongside the toolchain, brief picks up the conventional documents that describe how a project is run. README, changelog, roadmap, and license (with detected SPDX identifier) are reported at the top level. Everything else is grouped: legal covers copyright, NOTICE, DCO, and CLA files; community covers accessibility statements, contributing guides, code of conduct, support, governance, maintainers, authors, CODEOWNERS, and DEI statements; security covers the security policy, threat model, and audit reports; metadata covers machine-readable files like FUNDING, CITATION.cff, publiccode.yml, codemeta.json, and .zenodo.json; agents covers AI coding tool instruction files including AGENTS.md, CLAUDE.md, GEMINI.md, .cursorrules, .windsurfrules, .github/copilot-instructions.md, .aider.conf.yml, .clinerules, .rules, .junie/guidelines.md, replit.md, .continuerules, .augment-guidelines, and .roorules.

Matching is case-insensitive and checks the repo root first, then `docs/`, `.github/`, and `.gitlab/`. Paths in the output are repo-relative, so a funding file found under `.github/` is reported as `.github/FUNDING.yml` rather than just the basename. In JSON the groups appear as nested objects under `resources.legal`, `resources.community`, `resources.security`, `resources.metadata`, and `resources.agents`.
Matching is case-insensitive and checks the repo root first, then each resource's configured directories, usually `docs/`, `.github/`, and `.gitlab/`. Accessibility documents are checked in the root, `.github/`, `docs/`, and `.gitlab/`, in that order, and reported as `resources.community.accessibility`. Supported names are `ACCESSIBILITY`, `ACCESSIBILITY.md`, `ACCESSIBILITY.txt`, `ACCESSIBILITY.rst`, and `ACCESSIBILITY.adoc`. Paths in the output are repo-relative, so a funding file found under `.github/` is reported as `.github/FUNDING.yml` rather than just the basename. In JSON the groups appear as nested objects under `resources.legal`, `resources.community`, `resources.security`, `resources.metadata`, and `resources.agents`.

Issue and pull request templates are reported under `resources.templates` so that contributors and coding agents can find and follow them. Unlike the single-path resources above this is a list: every template file found is included, split into `issue` and `pull_request` arrays plus a `config` path for the issue chooser. Detection covers the locations recognised by GitHub, GitLab, Gitea, and Forgejo, which means the repo root, `docs/`, `.github/`, `.gitea/`, `.forgejo/`, and `.gitlab/`, in both single-file form (`PULL_REQUEST_TEMPLATE.md`, `issue_template.md`) and directory form (`ISSUE_TEMPLATE/`, `PULL_REQUEST_TEMPLATE/`, GitLab's `issue_templates/` and `merge_request_templates/`). Merge request templates are reported under `pull_request` rather than getting their own field.

Expand Down
63 changes: 63 additions & 0 deletions cmd/brief/accessibility_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package main

import (
"encoding/json"
"os"
"os/exec"
"testing"

"github.com/git-pkgs/brief"
)

func TestScanAccessibility(t *testing.T) {
const helperEnv = "BRIEF_ACCESSIBILITY_HELPER_ROOT"
if root := os.Getenv(helperEnv); root != "" {
cmdScan([]string{"-json", root})
return
}
for _, tt := range []struct {
name string
files []string
want string
}{
{"root", []string{"ACCESSIBILITY.md"}, "ACCESSIBILITY.md"},
{"github", []string{".github/ACCESSIBILITY.md"}, ".github/ACCESSIBILITY.md"},
{"docs", []string{"docs/ACCESSIBILITY.md"}, "docs/ACCESSIBILITY.md"},
{"gitlab", []string{".gitlab/ACCESSIBILITY.md"}, ".gitlab/ACCESSIBILITY.md"},
{"no extension", []string{"ACCESSIBILITY"}, "ACCESSIBILITY"},
{"text", []string{".github/ACCESSIBILITY.txt"}, ".github/ACCESSIBILITY.txt"},
{"restructuredtext", []string{"docs/ACCESSIBILITY.rst"}, "docs/ACCESSIBILITY.rst"},
{"asciidoc", []string{".gitlab/ACCESSIBILITY.adoc"}, ".gitlab/ACCESSIBILITY.adoc"},
{"mixed case", []string{"docs/Accessibility.MD"}, "docs/Accessibility.MD"},
{"root precedence", []string{"ACCESSIBILITY.md", ".github/ACCESSIBILITY.md", "docs/ACCESSIBILITY.md"}, "ACCESSIBILITY.md"},
{"github precedence", []string{".github/ACCESSIBILITY.md", "docs/ACCESSIBILITY.md"}, ".github/ACCESSIBILITY.md"},
{"docs precedence", []string{"docs/ACCESSIBILITY.md", ".gitlab/ACCESSIBILITY.md"}, "docs/ACCESSIBILITY.md"},
{"similar names", []string{"ACCESSIBILITY.md.bak", "docs/Accessibility-Testing.md"}, ""},
{"unrelated directory", []string{"src/ACCESSIBILITY.md"}, ""},
{"absent", nil, ""},
} {
t.Run(tt.name, func(t *testing.T) {
root := t.TempDir()
writeScanFixture(t, root, "README.md", "# Example project\n")
for _, path := range tt.files {
writeScanFixture(t, root, path, "# Accessibility\n\nReport accessibility barriers through the issue tracker.\n")
}
cmd := exec.Command(os.Args[0], "-test.run=^TestScanAccessibility$")
cmd.Env = append(os.Environ(), helperEnv+"="+root, "PATH=")
out, err := cmd.Output()
if err != nil {
t.Fatalf("scan failed: %v", err)
}
var report brief.Report
if err := json.Unmarshal(out, &report); err != nil {
t.Fatalf("parsing scan output: %v\n%s", err, out)
}
if report.Resources == nil {
t.Fatal("expected resources")
}
if got := report.Resources.Community["accessibility"]; got != tt.want {
t.Errorf("community.accessibility = %q, want %q", got, tt.want)
}
})
}
}
8 changes: 8 additions & 0 deletions knowledge/_shared/_resources.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ dirs = ["docs", ".github", ".gitlab"]

# Community

[[resources]]
[resources.resource]
name = "Accessibility"
field = "accessibility"
group = "community"
patterns = ["accessibility", "accessibility.md", "accessibility.txt", "accessibility.rst", "accessibility.adoc"]
dirs = [".github", "docs", ".gitlab"]

[[resources]]
[resources.resource]
name = "Contributing"
Expand Down
Loading