Skip to content
Merged
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
8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
name: agentnative
binary: anc
description: Agent-native CLI linter that checks whether a CLI follows the 8 agent-readiness principles. Bundle covers operator-facing usage, project structure, and the check catalog.
homepage: https://anc.dev
repository: https://github.com/brettdavies/agentnative-cli
---

# AGENTS.md

## Running anc
Expand Down
179 changes: 90 additions & 89 deletions README.md

Large diffs are not rendered by default.

38 changes: 36 additions & 2 deletions completions/anc.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ _anc() {
anc,help)
cmd="anc__help"
;;
anc,schema)
cmd="anc__schema"
;;
anc,skill)
cmd="anc__skill"
;;
Expand Down Expand Up @@ -55,6 +58,9 @@ _anc() {
anc__help,help)
cmd="anc__help__help"
;;
anc__help,schema)
cmd="anc__help__schema"
;;
anc__help,skill)
cmd="anc__help__skill"
;;
Expand Down Expand Up @@ -83,7 +89,7 @@ _anc() {

case "${cmd}" in
anc)
opts="-q -h -V --quiet --json --help --version check completions generate skill help"
opts="-q -h -V --quiet --json --help --version check completions generate skill schema help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
Expand Down Expand Up @@ -219,7 +225,7 @@ _anc() {
return 0
;;
anc__help)
opts="check completions generate skill help"
opts="check completions generate skill schema help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
Expand Down Expand Up @@ -302,6 +308,20 @@ _anc() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
anc__help__schema)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
anc__help__skill)
opts="install"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
Expand Down Expand Up @@ -330,6 +350,20 @@ _anc() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
anc__schema)
opts="-q -h --quiet --json --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
anc__skill)
opts="-q -h --quiet --json --help install help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
Expand Down
13 changes: 12 additions & 1 deletion completions/anc.elvish
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ set edit:completion:arg-completer[anc] = {|@words|
cand completions 'Generate shell completions'
cand generate 'Generate build artifacts (coverage matrix, etc.)'
cand skill 'Install or manage the agentnative skill bundle'
cand schema 'Print the scorecard JSON Schema to stdout'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'anc;check'= {
cand --command 'Resolve a command from PATH and run behavioral checks against it'
cand --principle 'Filter checks by principle number (1-7)'
cand --principle 'Filter checks by principle number (1-8)'
cand --output 'Output format'
cand --audit-profile 'Exemption category for the target. Suppresses checks that do not apply to this class of tool — e.g., TUI apps legitimately intercept the TTY, so `--audit-profile human-tui` skips the interactive-prompt MUSTs. Suppressed checks emit `Skip` with structured evidence so readers see what was excluded'
cand --binary 'Run only behavioral checks (skip source analysis)'
Expand Down Expand Up @@ -105,11 +106,19 @@ set edit:completion:arg-completer[anc] = {|@words|
}
&'anc;skill;help;help'= {
}
&'anc;schema'= {
cand -q 'Suppress non-essential output'
cand --quiet 'Suppress non-essential output'
cand --json 'Emit JSON output. Short alias for `--output json` on subcommands that support it. Per the agent-native convention (`p2-should-json-aliases`), the short form works alongside the canonical `--output` enum'
cand -h 'Print help (see more with ''--help'')'
cand --help 'Print help (see more with ''--help'')'
}
&'anc;help'= {
cand check 'Check a CLI project or binary for agent-readiness'
cand completions 'Generate shell completions'
cand generate 'Generate build artifacts (coverage matrix, etc.)'
cand skill 'Install or manage the agentnative skill bundle'
cand schema 'Print the scorecard JSON Schema to stdout'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'anc;help;check'= {
Expand All @@ -126,6 +135,8 @@ set edit:completion:arg-completer[anc] = {|@words|
}
&'anc;help;skill;install'= {
}
&'anc;help;schema'= {
}
&'anc;help;help'= {
}
]
Expand Down
17 changes: 11 additions & 6 deletions completions/anc.fish
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ complete -c anc -n "__fish_anc_needs_command" -f -a "check" -d 'Check a CLI proj
complete -c anc -n "__fish_anc_needs_command" -f -a "completions" -d 'Generate shell completions'
complete -c anc -n "__fish_anc_needs_command" -f -a "generate" -d 'Generate build artifacts (coverage matrix, etc.)'
complete -c anc -n "__fish_anc_needs_command" -f -a "skill" -d 'Install or manage the agentnative skill bundle'
complete -c anc -n "__fish_anc_needs_command" -f -a "schema" -d 'Print the scorecard JSON Schema to stdout'
complete -c anc -n "__fish_anc_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c anc -n "__fish_anc_using_subcommand check" -l command -d 'Resolve a command from PATH and run behavioral checks against it' -r -f -a "(__fish_complete_command)"
complete -c anc -n "__fish_anc_using_subcommand check" -l principle -d 'Filter checks by principle number (1-7)' -r
complete -c anc -n "__fish_anc_using_subcommand check" -l principle -d 'Filter checks by principle number (1-8)' -r
complete -c anc -n "__fish_anc_using_subcommand check" -l output -d 'Output format' -r -f -a "text\t''
json\t''"
complete -c anc -n "__fish_anc_using_subcommand check" -l audit-profile -d 'Exemption category for the target. Suppresses checks that do not apply to this class of tool — e.g., TUI apps legitimately intercept the TTY, so `--audit-profile human-tui` skips the interactive-prompt MUSTs. Suppressed checks emit `Skip` with structured evidence so readers see what was excluded' -r -f -a "human-tui\t'TUI-by-design tools (lazygit, k9s, btop). Suppresses interactive-prompt MUSTs and SIGPIPE — their contract is the TTY'
Expand Down Expand Up @@ -76,10 +77,14 @@ complete -c anc -n "__fish_anc_using_subcommand skill; and __fish_seen_subcomman
complete -c anc -n "__fish_anc_using_subcommand skill; and __fish_seen_subcommand_from install" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c anc -n "__fish_anc_using_subcommand skill; and __fish_seen_subcommand_from help" -f -a "install" -d 'Install the skill bundle into a host\'s canonical skills directory'
complete -c anc -n "__fish_anc_using_subcommand skill; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c anc -n "__fish_anc_using_subcommand help; and not __fish_seen_subcommand_from check completions generate skill help" -f -a "check" -d 'Check a CLI project or binary for agent-readiness'
complete -c anc -n "__fish_anc_using_subcommand help; and not __fish_seen_subcommand_from check completions generate skill help" -f -a "completions" -d 'Generate shell completions'
complete -c anc -n "__fish_anc_using_subcommand help; and not __fish_seen_subcommand_from check completions generate skill help" -f -a "generate" -d 'Generate build artifacts (coverage matrix, etc.)'
complete -c anc -n "__fish_anc_using_subcommand help; and not __fish_seen_subcommand_from check completions generate skill help" -f -a "skill" -d 'Install or manage the agentnative skill bundle'
complete -c anc -n "__fish_anc_using_subcommand help; and not __fish_seen_subcommand_from check completions generate skill help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c anc -n "__fish_anc_using_subcommand schema" -s q -l quiet -d 'Suppress non-essential output'
complete -c anc -n "__fish_anc_using_subcommand schema" -l json -d 'Emit JSON output. Short alias for `--output json` on subcommands that support it. Per the agent-native convention (`p2-should-json-aliases`), the short form works alongside the canonical `--output` enum'
complete -c anc -n "__fish_anc_using_subcommand schema" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c anc -n "__fish_anc_using_subcommand help; and not __fish_seen_subcommand_from check completions generate skill schema help" -f -a "check" -d 'Check a CLI project or binary for agent-readiness'
complete -c anc -n "__fish_anc_using_subcommand help; and not __fish_seen_subcommand_from check completions generate skill schema help" -f -a "completions" -d 'Generate shell completions'
complete -c anc -n "__fish_anc_using_subcommand help; and not __fish_seen_subcommand_from check completions generate skill schema help" -f -a "generate" -d 'Generate build artifacts (coverage matrix, etc.)'
complete -c anc -n "__fish_anc_using_subcommand help; and not __fish_seen_subcommand_from check completions generate skill schema help" -f -a "skill" -d 'Install or manage the agentnative skill bundle'
complete -c anc -n "__fish_anc_using_subcommand help; and not __fish_seen_subcommand_from check completions generate skill schema help" -f -a "schema" -d 'Print the scorecard JSON Schema to stdout'
complete -c anc -n "__fish_anc_using_subcommand help; and not __fish_seen_subcommand_from check completions generate skill schema help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c anc -n "__fish_anc_using_subcommand help; and __fish_seen_subcommand_from generate" -f -a "coverage-matrix" -d 'Render the spec coverage matrix (registry → checks → artifact)'
complete -c anc -n "__fish_anc_using_subcommand help; and __fish_seen_subcommand_from skill" -f -a "install" -d 'Install the skill bundle into a host\'s canonical skills directory'
15 changes: 14 additions & 1 deletion completions/anc.powershell
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ Register-ArgumentCompleter -Native -CommandName 'anc' -ScriptBlock {
[CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate shell completions')
[CompletionResult]::new('generate', 'generate', [CompletionResultType]::ParameterValue, 'Generate build artifacts (coverage matrix, etc.)')
[CompletionResult]::new('skill', 'skill', [CompletionResultType]::ParameterValue, 'Install or manage the agentnative skill bundle')
[CompletionResult]::new('schema', 'schema', [CompletionResultType]::ParameterValue, 'Print the scorecard JSON Schema to stdout')
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
break
}
'anc;check' {
[CompletionResult]::new('--command', '--command', [CompletionResultType]::ParameterName, 'Resolve a command from PATH and run behavioral checks against it')
[CompletionResult]::new('--principle', '--principle', [CompletionResultType]::ParameterName, 'Filter checks by principle number (1-7)')
[CompletionResult]::new('--principle', '--principle', [CompletionResultType]::ParameterName, 'Filter checks by principle number (1-8)')
[CompletionResult]::new('--output', '--output', [CompletionResultType]::ParameterName, 'Output format')
[CompletionResult]::new('--audit-profile', '--audit-profile', [CompletionResultType]::ParameterName, 'Exemption category for the target. Suppresses checks that do not apply to this class of tool — e.g., TUI apps legitimately intercept the TTY, so `--audit-profile human-tui` skips the interactive-prompt MUSTs. Suppressed checks emit `Skip` with structured evidence so readers see what was excluded')
[CompletionResult]::new('--binary', '--binary', [CompletionResultType]::ParameterName, 'Run only behavioral checks (skip source analysis)')
Expand Down Expand Up @@ -121,11 +122,20 @@ Register-ArgumentCompleter -Native -CommandName 'anc' -ScriptBlock {
'anc;skill;help;help' {
break
}
'anc;schema' {
[CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'Suppress non-essential output')
[CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Suppress non-essential output')
[CompletionResult]::new('--json', '--json', [CompletionResultType]::ParameterName, 'Emit JSON output. Short alias for `--output json` on subcommands that support it. Per the agent-native convention (`p2-should-json-aliases`), the short form works alongside the canonical `--output` enum')
[CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
[CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
break
}
'anc;help' {
[CompletionResult]::new('check', 'check', [CompletionResultType]::ParameterValue, 'Check a CLI project or binary for agent-readiness')
[CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate shell completions')
[CompletionResult]::new('generate', 'generate', [CompletionResultType]::ParameterValue, 'Generate build artifacts (coverage matrix, etc.)')
[CompletionResult]::new('skill', 'skill', [CompletionResultType]::ParameterValue, 'Install or manage the agentnative skill bundle')
[CompletionResult]::new('schema', 'schema', [CompletionResultType]::ParameterValue, 'Print the scorecard JSON Schema to stdout')
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
break
}
Expand All @@ -149,6 +159,9 @@ Register-ArgumentCompleter -Native -CommandName 'anc' -ScriptBlock {
'anc;help;skill;install' {
break
}
'anc;help;schema' {
break
}
'anc;help;help' {
break
}
Expand Down
27 changes: 26 additions & 1 deletion completions/anc.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ _anc() {
(check)
_arguments "${_arguments_options[@]}" : \
'(--source)--command=[Resolve a command from PATH and run behavioral checks against it]:NAME:_command_names -e' \
'--principle=[Filter checks by principle number (1-7)]:PRINCIPLE:_default' \
'--principle=[Filter checks by principle number (1-8)]:PRINCIPLE:_default' \
'--output=[Output format]:OUTPUT:(text json)' \
'--audit-profile=[Exemption category for the target. Suppresses checks that do not apply to this class of tool — e.g., TUI apps legitimately intercept the TTY, so \`--audit-profile human-tui\` skips the interactive-prompt MUSTs. Suppressed checks emit \`Skip\` with structured evidence so readers see what was excluded]:CATEGORY:((human-tui\:"TUI-by-design tools (lazygit, k9s, btop). Suppresses interactive-prompt MUSTs and SIGPIPE — their contract is the TTY"
file-traversal\:"File-traversal utilities (fd, find). Reserved for subcommand-structure relaxations as those checks land"
Expand Down Expand Up @@ -175,6 +175,15 @@ esac
;;
esac
;;
(schema)
_arguments "${_arguments_options[@]}" : \
'-q[Suppress non-essential output]' \
'--quiet[Suppress non-essential output]' \
'--json[Emit JSON output. Short alias for \`--output json\` on subcommands that support it. Per the agent-native convention (\`p2-should-json-aliases\`), the short form works alongside the canonical \`--output\` enum]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_anc__help_commands" \
Expand Down Expand Up @@ -235,6 +244,10 @@ _arguments "${_arguments_options[@]}" : \
;;
esac
;;
(schema)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
Expand All @@ -255,6 +268,7 @@ _anc_commands() {
'completions:Generate shell completions' \
'generate:Generate build artifacts (coverage matrix, etc.)' \
'skill:Install or manage the agentnative skill bundle' \
'schema:Print the scorecard JSON Schema to stdout' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'anc commands' commands "$@"
Expand Down Expand Up @@ -307,6 +321,7 @@ _anc__help_commands() {
'completions:Generate shell completions' \
'generate:Generate build artifacts (coverage matrix, etc.)' \
'skill:Install or manage the agentnative skill bundle' \
'schema:Print the scorecard JSON Schema to stdout' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'anc help commands' commands "$@"
Expand Down Expand Up @@ -338,6 +353,11 @@ _anc__help__help_commands() {
local commands; commands=()
_describe -t commands 'anc help help commands' commands "$@"
}
(( $+functions[_anc__help__schema_commands] )) ||
_anc__help__schema_commands() {
local commands; commands=()
_describe -t commands 'anc help schema commands' commands "$@"
}
(( $+functions[_anc__help__skill_commands] )) ||
_anc__help__skill_commands() {
local commands; commands=(
Expand All @@ -350,6 +370,11 @@ _anc__help__skill__install_commands() {
local commands; commands=()
_describe -t commands 'anc help skill install commands' commands "$@"
}
(( $+functions[_anc__schema_commands] )) ||
_anc__schema_commands() {
local commands; commands=()
_describe -t commands 'anc schema commands' commands "$@"
}
(( $+functions[_anc__skill_commands] )) ||
_anc__skill_commands() {
local commands; commands=(
Expand Down
Loading
Loading