- Module:
agentskill.main - Published console script:
agentskill = "agentskill.main:main" - Primary callable:
main(argv: list[str] | None = None) -> int
agentskill.main is the source of truth for the installed CLI. It owns global
argument parsing, subcommand registration, and dispatch into analyzer,
generation, and update workflows.
agentskill analyze <repo> [<repo2> ...]Runs the full analyzer stack and emits merged JSON.agentskill scan|measure|config|git|graph|symbols|tests <repo>Runs one analyzer and emits that analyzer's JSON payload.agentskill generate <repo>Renders a freshAGENTS.mddocument to stdout or--out.agentskill update <repo>Regenerates sections and merges them into an existingAGENTS.md, or creates one when missing.
cmd_analyze(args)callsagentskill.lib.runner.run_manyand writes public JSON throughagentskill.lib.output.write_output._single_script_cmd(command_name, args)routes analyzer subcommands through theCOMMANDSregistry inagentskill.lib.runner.cmd_generate(args)delegates toagentskill.lib.generate_runner.generate_agents.cmd_update(args)delegates toagentskill.lib.update_runner.update_agents.
--prettyapplies to JSON-producing analyzer flows only.--outwrites JSON or markdown to a file instead of stdout.--referenceis supported byanalyzeandgenerate.--interactiveis supported bygenerateonly.--profileis supported bygenerateandupdate. Accepted values areconcise(default) andcomprehensive.conciseemits operational rules and key facts only; representative code snippets and secondary explanatory bullets are suppressed.comprehensiveincludes everything from concise plus representative snippets, annotation measurements, and expanded rationale bullets.- All profiles are deterministic from the same analyzer results and preserve the same section order and headings.
- When
--layout splitis active, the--profileflag is ignored: the primary file is always concise and the companion is always comprehensive. - When
--layout multifileis active,--profilecontrols the density of content in each section file. The default profile for multifile iscomprehensive.
--layoutis supported bygenerate. Accepted values aresingle(default),split, andmultifile.singlewrites one complete markdown file. Without--out, prints to stdout.splitwrites two files: a concise primary document and anAGENTS.reference.mdcompanion with comprehensive content. The primary file contains a relative link to the companion. Without--out, split writes into the target repo using<repo>/AGENTS.mdas the primary path.multifilewrites a root index file plus per-section markdown files in a.agentskill/directory beside the primary output. Section filenames follow a stable numbering scheme:01_OVERVIEW.md,02_REPOSITORY_STRUCTURE.md,05_COMMANDS_AND_WORKFLOWS.md,06_CODE_FORMATTING.md,07_NAMING_CONVENTIONS.md,08_TYPE_ANNOTATIONS.md,09_IMPORTS.md,10_ERROR_HANDLING.md,11_COMMENTS_AND_DOCSTRINGS.md,12_TESTING.md,13_GIT.md,14_DEPENDENCIES_AND_TOOLING.md,15_RED_LINES.md. Each section file contains a backlink to the root. Without--out, multifile writes into the target repo using<repo>/AGENTS.mdas the root path.update --layoutis not yet supported forsplitormultifileand is explicitly rejected.
--section,--exclude-section, and--forceare supported byupdate.
Release-grade CLI contract tests live in tests/test_cli_contract.py.