{"id":29306545,"url":"https://github.com/patrickgramatowski/doc_guard","last_synced_at":"2026-01-20T16:58:18.496Z","repository":{"id":302780938,"uuid":"1010098485","full_name":"patrickgramatowski/doc_guard","owner":"patrickgramatowski","description":"A tool to track and assess the relevance of your documentation by linking docs with the actual source files they describe. Helps ensure your docs stay up-to-date with your codebase.","archived":false,"fork":false,"pushed_at":"2025-07-03T18:55:05.000Z","size":342,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-04T07:41:08.472Z","etag":null,"topics":["doc-guard","docguard","documentation","documentation-tool","ruby","ruby-gem","up-to-date","up-to-date-documentation"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickgramatowski.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-28T10:41:17.000Z","updated_at":"2025-07-04T07:20:47.000Z","dependencies_parsed_at":"2025-07-04T07:41:16.164Z","dependency_job_id":"c58f64d0-5fce-4bde-a2cf-b3bb9e1c8caa","html_url":"https://github.com/patrickgramatowski/doc_guard","commit_stats":null,"previous_names":["patrickgramatowski/doc_guard"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patrickgramatowski/doc_guard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickgramatowski%2Fdoc_guard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickgramatowski%2Fdoc_guard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickgramatowski%2Fdoc_guard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickgramatowski%2Fdoc_guard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickgramatowski","download_url":"https://codeload.github.com/patrickgramatowski/doc_guard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickgramatowski%2Fdoc_guard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263868043,"owners_count":23522305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["doc-guard","docguard","documentation","documentation-tool","ruby","ruby-gem","up-to-date","up-to-date-documentation"],"created_at":"2025-07-07T06:15:55.891Z","updated_at":"2026-01-20T16:58:18.470Z","avatar_url":"https://github.com/patrickgramatowski.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"doc_guard-logo.png\" alt=\"doc_guard logo\" width=\"250\" style=\"display: block; margin: 0 auto\"/\u003e\n\n---\n\n### 🛡️ Keep your documentation up-to-date with your code\n\n**DocGuard** is a lightweight, extensible Ruby gem that helps **ensure your documentation remains accurate** as your code evolves. It **tracks** source files referenced in documentation and **warns** when changes occur.\n\n---\n\n### 🚀 Features\n\n- **Automatic File Tracking:**  \n  Easily annotate your documentation files with the source code files they reference. DocGuard automatically detects which files your docs depend on, eliminating manual tracking.\n\n- **Digest Calculation \u0026 Change Detection:**  \n  DocGuard computes SHA256 digests (hashes) of tracked files and compares them with previously stored digests to detect any changes. This helps identify when code changes may impact your documentation.\n\n- **Real-time Relevance Assessment:**  \n  Quickly determine if your documentation is still relevant based on the current state of your code. Get instant feedback when your docs might be outdated.\n\n- **Clear and Actionable Reporting:**  \n  Receive concise CLI reports highlighting which files caused potential documentation mismatches, helping you prioritize documentation updates.\n\n- **Fail-safe Exit Codes:**  \n  Integrate DocGuard seamlessly into CI/CD pipelines, it exits with meaningful statuses:\n  - `0` when docs are up to date,\n  - `1` when documentation may be outdated,\n  - `2` on unexpected errors.\n\n- **Flexible CLI (built on [Thor](https://github.com/rails/thor)):**  \n  Easy-to-use commands to assess relevance and extend with future commands for recording or other workflows.\n\n- **Lightweight \u0026 Framework Agnostic:**  \n  Works well in Rails projects but designed to be framework-independent and lightweight enough to fit any Ruby codebase.\n\n- **JSON-based Digest Storage:**  \n  Stores digests in a human-readable JSON file, making it easy to audit or manage outside the tool if needed.\n\n\n### 💿 Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n```bash\nbundle add doc_guard\n```\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n```bash\ngem install doc_guard\n```\n\nor add this line to your application's Gemfile:\n\n```ruby\ngem \"doc_guard\"\n```\n\n### ⚙️ Usage\n\n#### 1. Annotate Documentation with Tracked Files 📝\n\nTo enable DocGuard to track which source files your documentation depends on, add a special HTML comment in your markdown files (e.g., `README.md` or any `.md` files inside a `docs/` folder).\n\n##### How to annotate:\nInsert the following comment at the top (or anywhere relevant) in your markdown file:\n\n```md\n\u003c!-- doc_guard files: [app/models/user.rb, app/services/authenticator.rb] --\u003e\nYour amazing and very important documentation related to the user model and authentication service is here.\n```\n\n#### 2. Record the current state of the relationship between your documentation and your code 💾\n\n```bash\n$ doc_guard record\n```\n\nThis stores the current digests of referenced files in `.doc_guard_digests.json.`\n\n#### 3. Assess documentation relevance 🚦\n\n```bash\n$ doc_guard assess\n```\n\nExample output:\n```bash\n‼️ Documentation may be outdated!\n\n📄 docs/user.md\n- app/models/user.rb\n- app/services/authenticator.rb\n\n📄 docs/admin.md\n- app/models/admin.rb\n```\n\n### 🔧 Configuration\n\nDocGuard can be configured in multiple flexible ways to suit different environments (e.g., local development, CI/CD pipelines, GitHub Actions).\n\nConfiguration values are resolved using the following priority:\n1. CLI flags\n2. Environment variables\n3. YAML config file (`.doc_guard.yml`)\n4. Internal defaults\n\n#### 🗂️ Available Configuration Options\n\n| Setting                      | CLI Flag                          | ENV Variable                         | YAML Config Key                        | Default Value                 |\n|-----------------------------|------------------------------------|--------------------------------------|----------------------------------------|-------------------------------|\n| Documentation path          | `--documentation-path`            | `DOC_GUARD_DOCUMENTATION_PATH`       | `documentation_path`                  | `\"docs\"`                      |\n| Digests store file path     | `--digests-store-file-path`       | `DOC_GUARD_DIGESTS_STORE_FILE_PATH`  | `digests_store_file_path`             | `\".doc_guard_digests.json\"`   |\n| Config file path (for YAML) | `--config-file-path`              | `DOC_GUARD_CONFIG_FILE_PATH`         | *(Not loaded from YAML)*              | `\".doc_guard.yml\"`            |\n\n*Note: The `config_file_path` is used only to load other settings from a YAML file. It cannot itself be configured via YAML.*\n\n#### 📁 Config File Example\n```yaml\n# .doc_guard.yml\n\ndocumentation_path: custom_docs\ndigests_store_file_path: tmp/doc_guard_state.json\n```\n*Note: Place this file in your project root.*\n\nThis configuration approach supports usage in CI/CD pipelines, local development, or scripts, **without any dependency** on Rails or other frameworks.\n\n### 🛣️ Roadmap\n\nThe following features are being considered or are actively planned for future releases:\n\n- **External documentation integrations**  \n  Support for syncing and validating documentation that lives outside the main codebase, e.g., Confluence, GitHub Wikis, or other remote documentation tools.\n\n- **Custom digest strategies**  \n  Allow users to define custom strategies for calculating file \"change relevance\", e.g., ignore comments or whitespace, or weigh different parts of the code differently.\n\n- **AI-assisted relevance analysis**  \n  In the future, integrate with AI systems to help assess whether documentation should be updated based on the semantic nature of recent code changes (e.g., if a developer introduces a new feature but forgets to update corresponding docs).\n\n- **Advanced code–documentation annotation system**  \n  Improve how source code is linked to documentation, potentially with fine-grained annotations (e.g., per method, class, or even logic block), offering a more accurate mapping between code changes and relevant documentation sections.\n\nHave an idea or need a feature? Feel free to [open an issue](https://github.com/patrickgramatowski/doc_guard/issues) or contribute!\n\n### 🧑‍💻 Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n### 🤝 Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/patrickgramatowski/doc_guard. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/patrickgramatowski/doc_guard/blob/master/CODE_OF_CONDUCT.md).\n\n### 📄 License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n### 📜 Code of Conduct\n\nEveryone interacting in the DocGuard project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/patrickgramatowski/doc_guard/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickgramatowski%2Fdoc_guard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickgramatowski%2Fdoc_guard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickgramatowski%2Fdoc_guard/lists"}