Update repo documentation and agent-facing guidance such as AGENTS.md, README.md, docs/, specs, plans, and runbooks. Use when code, skill, or infrastructure changes risk doc drift or when documentation needs cleanup or restructuring. Do not use for code review, runtime verification, or `agent-readiness` setup.
98
100%
Does it follow best practices?
Impact
94%
1.00xAverage score across 3 eval scenarios
Passed
No known issues
grok-cli is a command-line tool that parses and pretty-prints structured log files. It was written by a solo developer who crammed everything into a single README.md — install instructions, contributor setup, security contact, architecture notes, and usage examples are all mixed together. Now that the project is gaining traction and accepting outside contributions, the maintainer wants to split the documentation into proper separate files so that users, contributors, and security researchers can each find what they need quickly.
The current README.md is 280 lines and serves too many audiences at once: it explains how to install the tool, walks through the full source architecture, describes how to set up a dev environment, lists every lint rule enforced in CI, and buries the security contact at the very bottom. Contributors complain they can't find the setup steps; users give up before reaching the quickstart.
Your job is to restructure the documentation. The maintainer has no strong opinions about exact formatting — they just want each file to have a clear, single responsibility and for users to be able to get to their first successful grok command as quickly as possible.
Produce the following files:
README.md — restructured for end usersCONTRIBUTING.md — for contributorsSECURITY.md — for vulnerability reportersdoc-changes.md — a brief summary of what moved where and whyDo not delete content — redistribute it. All information from the original README should appear in exactly one of the output files.
The following files are provided as inputs. Extract them before beginning.
=============== FILE: inputs/README.md ===============
grok-cli parses structured log files (JSON, logfmt, CEF) and pretty-prints them with filtering, highlighting, and aggregation support. It works with stdin or file inputs.
# Via Homebrew
brew install grok-cli
# Via npm
npm install -g grok-cli
# Build from source
git clone https://github.com/example/grok-cli.git
cd grok-cli
npm install
npm run build
npm linkParse a JSON log file:
grok parse app.logFilter by level:
grok parse app.log --level errorPipe from stdin:
cat app.log | grok parse -Aggregate by field:
grok stats app.log --group-by serviceOutput formats: --format pretty (default), --format json, --format csv
grok-cli is structured as a pipeline:
Input → Parser → Filter → Formatter → OutputParser layer (src/parsers/): one parser per format (JSON, logfmt, CEF). Each parser implements the Parser interface defined in src/parsers/base.ts. Parsers are selected automatically based on file extension or the --format flag.
Filter layer (src/filters/): composable filter predicates. Filters are combined with AND logic by default. The --or flag switches to OR logic.
Formatter layer (src/formatters/): renders the filtered output. PrettyFormatter uses chalk for colors; JsonFormatter and CsvFormatter are plain serializers.
CLI layer (src/cli/): Commander.js handles argument parsing and routes to the appropriate pipeline.
All errors go through src/errors.ts. The GrokError class carries an exit code so the process exits with the correct code for shell scripting.
Prerequisites: Node.js 18+, npm 9+
Clone the repo:
git clone https://github.com/example/grok-cli.git
cd grok-cliInstall dependencies:
npm installRun in development mode (auto-recompile):
npm run devLink for local testing:
npm link
grok --versionAll code must pass:
npm run lint — ESLint with Airbnb confignpm run type-check — TypeScript strict modenpm run format:check — PrettierRules enforced by CI:
console.log (use the logger in src/logger.ts)any types without a // eslint-disable comment with justificationsrc/**/*.test.ts)src/parsers/base.ts interfaceUnit tests (fast, no I/O):
npm testIntegration tests (reads real log files from fixtures/):
npm run test:integrationFull suite with coverage report:
npm run test:coverageTests must pass before any PR is merged. Coverage must not drop below 80%.
We welcome contributions! Please:
feature/, fix/, or chore/ prefix)npm run test:coveragenpm run lint && npm run type-checkFor significant features, open an issue first to discuss the design before investing implementation effort.
Code review: all PRs need at least one maintainer approval. We aim to review within 3 business days.
Release process: maintainers cut releases by tagging v* — this triggers the publish workflow.
Do not open public GitHub issues for security vulnerabilities.
To report a vulnerability, email security@example.com. Please include:
We aim to acknowledge reports within 48 hours and provide a fix or mitigation timeline within 7 days.
Supported versions: only the latest stable release receives security patches.
MIT License — see LICENSE for details.