docopslab-dev 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.adoc +904 -0
  4. data/assets/config-packs/actionlint/base.yml +13 -0
  5. data/assets/config-packs/actionlint/project.yml +13 -0
  6. data/assets/config-packs/htmlproofer/base.yml +27 -0
  7. data/assets/config-packs/htmlproofer/project.yml +25 -0
  8. data/assets/config-packs/rubocop/base.yml +130 -0
  9. data/assets/config-packs/rubocop/project.yml +8 -0
  10. data/assets/config-packs/shellcheck/base.shellcheckrc +14 -0
  11. data/assets/config-packs/subtxt/ai-asciidoc-antipatterns.sub.txt +11 -0
  12. data/assets/config-packs/vale/asciidoc/ExplicitSectionIDs.yml +8 -0
  13. data/assets/config-packs/vale/asciidoc/ExtraLineBeforeLevel1.yml +7 -0
  14. data/assets/config-packs/vale/asciidoc/OneSentencePerLine.yml +8 -0
  15. data/assets/config-packs/vale/asciidoc/PreferSourceBlocks.yml +8 -0
  16. data/assets/config-packs/vale/asciidoc/ProperAdmonitions.yml +8 -0
  17. data/assets/config-packs/vale/asciidoc/ProperDLs.yml +7 -0
  18. data/assets/config-packs/vale/asciidoc/UncleanListStart.yml +8 -0
  19. data/assets/config-packs/vale/authoring/ButParagraph.yml +8 -0
  20. data/assets/config-packs/vale/authoring/ExNotEg.yml +8 -0
  21. data/assets/config-packs/vale/authoring/LiteralTerms.yml +20 -0
  22. data/assets/config-packs/vale/authoring/Spelling.yml +679 -0
  23. data/assets/config-packs/vale/base.ini +38 -0
  24. data/assets/config-packs/vale/config/scripts/ExplicitSectionIDs.tengo +56 -0
  25. data/assets/config-packs/vale/config/scripts/ExtraLineBeforeLevel1.tengo +121 -0
  26. data/assets/config-packs/vale/config/scripts/OneSentencePerLine.tengo +53 -0
  27. data/assets/config-packs/vale/project.ini +5 -0
  28. data/assets/hooks/pre-commit +63 -0
  29. data/assets/hooks/pre-push +72 -0
  30. data/assets/scripts/adoc_section_ids.rb +50 -0
  31. data/assets/scripts/build-common.sh +193 -0
  32. data/assets/scripts/build-docker.sh +64 -0
  33. data/assets/scripts/build.sh +56 -0
  34. data/assets/scripts/parse_jekyll_asciidoc_logs.rb +467 -0
  35. data/assets/templates/Gemfile +7 -0
  36. data/assets/templates/Rakefile +3 -0
  37. data/assets/templates/gitignore +69 -0
  38. data/assets/templates/jekyll-asciidoc-fix.prompt.yml +17 -0
  39. data/assets/templates/spellcheck.prompt.yml +16 -0
  40. data/docopslab-dev.gemspec +56 -0
  41. data/docs/agent/AGENTS.md +229 -0
  42. data/docs/agent/index.md +80 -0
  43. data/docs/agent/missions/conduct-release.md +224 -0
  44. data/docs/agent/missions/setup-new-project.md +250 -0
  45. data/docs/agent/roles/devops-release-engineer.md +152 -0
  46. data/docs/agent/roles/docops-engineer.md +193 -0
  47. data/docs/agent/roles/planner-architect.md +74 -0
  48. data/docs/agent/roles/product-engineer.md +153 -0
  49. data/docs/agent/roles/product-manager.md +130 -0
  50. data/docs/agent/roles/project-manager.md +139 -0
  51. data/docs/agent/roles/qa-testing-engineer.md +115 -0
  52. data/docs/agent/roles/tech-docs-manager.md +143 -0
  53. data/docs/agent/roles/tech-writer.md +163 -0
  54. data/docs/agent/skills/asciidoc.md +609 -0
  55. data/docs/agent/skills/code-commenting.md +347 -0
  56. data/docs/agent/skills/fix-broken-links.md +309 -0
  57. data/docs/agent/skills/fix-jekyll-asciidoc-build-errors.md +23 -0
  58. data/docs/agent/skills/fix-spelling-issues.md +13 -0
  59. data/docs/agent/skills/git.md +170 -0
  60. data/docs/agent/skills/github-issues.md +135 -0
  61. data/docs/agent/skills/product-release-rollback-and-patching.md +71 -0
  62. data/docs/agent/skills/rake-cli-dev.md +57 -0
  63. data/docs/agent/skills/readme-driven-dev.md +13 -0
  64. data/docs/agent/skills/release-history.md +29 -0
  65. data/docs/agent/skills/ruby.md +192 -0
  66. data/docs/agent/skills/schemagraphy-sgyml.md +18 -0
  67. data/docs/agent/skills/tests-running.md +25 -0
  68. data/docs/agent/skills/tests-writing.md +45 -0
  69. data/docs/agent/skills/write-the-docs.md +54 -0
  70. data/docs/agent/topics/common-project-paths.md +117 -0
  71. data/docs/agent/topics/dev-tooling-usage.md +202 -0
  72. data/docs/agent/topics/devops-ci-cd.md +55 -0
  73. data/docs/agent/topics/product-docs-deployment.md +25 -0
  74. data/lib/docopslab/dev/auto_fix_asciidoc.rb +46 -0
  75. data/lib/docopslab/dev/checkers.rb +108 -0
  76. data/lib/docopslab/dev/config_manager.rb +241 -0
  77. data/lib/docopslab/dev/file_utils.rb +140 -0
  78. data/lib/docopslab/dev/git_hooks.rb +140 -0
  79. data/lib/docopslab/dev/help.rb +121 -0
  80. data/lib/docopslab/dev/initializer.rb +95 -0
  81. data/lib/docopslab/dev/linters.rb +451 -0
  82. data/lib/docopslab/dev/log_parser.rb +31 -0
  83. data/lib/docopslab/dev/paths.rb +46 -0
  84. data/lib/docopslab/dev/script_manager.rb +136 -0
  85. data/lib/docopslab/dev/spell_check.rb +194 -0
  86. data/lib/docopslab/dev/sync_ops.rb +468 -0
  87. data/lib/docopslab/dev/tasks.rb +440 -0
  88. data/lib/docopslab/dev/tool_execution.rb +68 -0
  89. data/lib/docopslab/dev/version.rb +8 -0
  90. data/lib/docopslab/dev.rb +392 -0
  91. data/specs/data/default-manifest.yml +64 -0
  92. data/specs/data/manifest-schema.yaml +63 -0
  93. data/specs/data/tasks-def.yml +321 -0
  94. data/specs/data/tools.yml +60 -0
  95. metadata +362 -0
@@ -0,0 +1,25 @@
1
+ # Running Tests in DocOps Lab Projects
2
+
3
+ This document is intended for AI agents operating within a DocOps Lab environment.
4
+
5
+ As an AI agent, you can help DocOps Lab developers run tests effectively using standard Rake tasks.
6
+
7
+ All Ruby gem projects with tests should implement these standard Rake tasks in their `Rakefile`:
8
+
9
+ **`bundle exec rake rspec`** :
10
+ Run RSpec test suite using the standard pattern matcher.
11
+
12
+ **`bundle exec rake cli_test`** :
13
+ Validate command-line interface functionality. May test basic CLI loading, help output, version information.
14
+
15
+ **`bundle exec rake yaml_test`** :
16
+ Validate YAML configuration files and data structures. Should test all project YAML files for syntax correctness.
17
+
18
+ **`bundle exec rake pr_test`** :
19
+ Comprehensive test suite for pre-commit and pull request validation. Typically includes: RSpec tests, CLI tests, YAML validation.
20
+
21
+ **`bundle exec rake install_local`** :
22
+ Build and install the project locally for testing.
23
+
24
+ Note that non-gem projects may have some or all of these tasks, as applicable.
25
+
@@ -0,0 +1,45 @@
1
+ # Writing Tests for DocOps Lab Projects
2
+
3
+ This document is intended for AI agents operating within a DocOps Lab environment.
4
+
5
+ As an AI agent, you can help DocOps Lab developers write comprehensive tests following established patterns and categories.
6
+
7
+ Tests should be organized into these categories:
8
+
9
+ **Unit Tests** :
10
+ - Module loading and initialization
11
+ - Class structure validation
12
+ - Basic functionality verification
13
+ - Individual method testing
14
+
15
+ **Integration Tests** :
16
+ - Data processing workflows
17
+ - Template rendering operations
18
+ - Configuration loading scenarios
19
+ - API client functionality (where applicable)
20
+
21
+ **Validation Tests** :
22
+ - File format compliance (YAML, JSON)
23
+ - Configuration schema validation
24
+ - Template syntax verification
25
+ - Command-line option parsing
26
+
27
+ All Ruby gem projects with tests should implement these standard Rake tasks in their `Rakefile`:
28
+
29
+ **`bundle exec rake rspec`** :
30
+ Run RSpec test suite using the standard pattern matcher.
31
+
32
+ **`bundle exec rake cli_test`** :
33
+ Validate command-line interface functionality. May test basic CLI loading, help output, version information.
34
+
35
+ **`bundle exec rake yaml_test`** :
36
+ Validate YAML configuration files and data structures. Should test all project YAML files for syntax correctness.
37
+
38
+ **`bundle exec rake pr_test`** :
39
+ Comprehensive test suite for pre-commit and pull request validation. Typically includes: RSpec tests, CLI tests, YAML validation.
40
+
41
+ **`bundle exec rake install_local`** :
42
+ Build and install the project locally for testing.
43
+
44
+ Note that non-gem projects may have some or all of these tasks, as applicable.
45
+
@@ -0,0 +1,54 @@
1
+ # Documenting Product Changes
2
+
3
+ This document is intended for AI agents operating within a DocOps Lab environment.
4
+
5
+ Original sources for this document include:
6
+
7
+ <!-- detect the origin url based on the slug (origin) -->
8
+ - [Product Change Tracking and Documentation](/docs/product-change-docs/)
9
+
10
+ Each contributor of product code or docs changes is responsible for preparing that change to be included in release documentation, _when applicable_.
11
+
12
+ Table of Contents
13
+
14
+ - GitHub Issues Labels
15
+ - Change Documentation
16
+ - Release Note Entry
17
+
18
+ ## GitHub Issues Labels
19
+
20
+ GitHub Issues are use specific labels to indicate documentation expectations.
21
+
22
+ **`needs:docs`** :
23
+ The issue requires documentation updates as part of its resolution. Documentation updates will likely be in a sub-issue with a `documentation` label.
24
+
25
+ **`needs:note`** :
26
+ The issue requires a note in the release history when resolved. Release notes are appended to the description body under `## Release Note`.
27
+
28
+ **`changelog`** :
29
+ The issue summary should be included in the changelog for the next release, even if no release note is included.
30
+
31
+ Issues labeled `changelog` will automatically appear in the Changelog section of the Release History document. Release notes must be manually entered.
32
+
33
+ ## Change Documentation
34
+
35
+ When a change to the product affects user-facing functionality, the documentation needs to change.
36
+
37
+ For early product versions, most documentation appears in the root `README.adoc` file. When a product has a `docs/content/` path, documentation changes usually have a home in an AsciiDoc (`.adoc`) file in a subdirectory.
38
+
39
+ Reference matter should be documented where it is defined, such as in `specs/data/*.yml` files.
40
+
41
+ ## Release Note Entry
42
+
43
+ User-facing product changes that deserve explanation (not just notice) require a release note.
44
+
45
+ Add a release note for a given issue by appending it to the issue body following a `## Release Note` heading.
46
+
47
+ Example
48
+
49
+ ```markdown
50
+ ## Release Note
51
+
52
+ The content of the release note goes here, in Markdown format. Try to keep it to one paragraph with minimal formatting.
53
+ ```
54
+
@@ -0,0 +1,117 @@
1
+ # Overview of Common Paths/Files in DocOps Lab Projects
2
+
3
+ This document is intended for AI agents operating within a DocOps Lab environment.
4
+
5
+ _If you are creating a new DocOPs Lab project_, use this guide to establish initial files. This also applies to adding major facilities or features to an existing project.
6
+
7
+ _If you are just getting to know a DocOps Lab codebase_, favor the project’s `README.adoc` file over this guide.
8
+
9
+ DocOps Lab projects tend to contain many of the same files across codebases. Documentation of these files in particular will be added when possible, but for now this basic guide will have to suffice.
10
+
11
+ Table of Contents
12
+
13
+ - Documentation Paths
14
+ - Configuration
15
+ - Containerization
16
+ - Ruby Files
17
+ - Automation Paths
18
+ - Quality Assurance Paths
19
+ - Generative AI Paths
20
+
21
+ ## Documentation Paths
22
+
23
+ Only two files are required in _every_ DocOps Lab project, though most projects should contain most of these files, depending on the nature of the codebase. A `docs/` or `_docs/` directory is close to the third universal requirement, necessary by the time a project reaches version 1.0.0.
24
+
25
+ **`README.adoc`** :
26
+ Project documentation in AsciiDoc format, providing an overview and instructions. DocOps Lab READMEs typically include single-sourcing data for the product as AsciiDoc attributes. See the Sourcerer project.
27
+
28
+ **`LICENSE`** :
29
+ The project’s license file, specifying the terms under which the code can be used and distributed. Almost always **MIT License**.
30
+
31
+ **`docs/` / `_docs/`** :
32
+ Directory for additional documentation, guides, and related materials. Typically `docs/` for product _user_ documentation, whereas `_docs/` is for (a) repos that are mainly for websites or (b) _internal engineering_ documentation files (more often found at `docs/_docs/`). Both might be present in the case of a website that hosts docs and _has its own_ docs.
33
+
34
+ A `docs/` directory will typically have its own `Gemfile`, configs, and assets for Jekyll, Yard, and other generators. A `_docs/` directory is usually a content-only subordinate to the main project and its content, and may not have separate configs or assets.
35
+
36
+ ## Configuration
37
+
38
+ **`.config/`** :
39
+ Configuration files for tooling used in development, building, or QA/testing. Not always used.
40
+
41
+ **`.config/releasehx.yml`** :
42
+ Configuration file for ReleaseHx, a tool for generating release notes and changelogs.
43
+
44
+ **`.config/jekyll.yml`** :
45
+ Configuration file for Jekyll docs publication. For Jekyll extensions (themes and plugins), this file is typically `./_config.yml` to conform to Jekyll defaults.
46
+
47
+ **`.config/vale.ini`** :
48
+ Configuration file for Vale, a linter for prose, defining linting rules and styles.
49
+
50
+ **`.config/.vendor/`** :
51
+ Directory for upstream configuration files, mostly or entirely managed by `docopsab-dev` gem. These files are not tracked in Git but are synced with upstream sources and maintained by DocOps Lab.
52
+
53
+ ## Containerization
54
+
55
+ **`Dockerfile`** :
56
+ Dockerfile for building the project’s Docker image, defining the environment and dependencies.
57
+
58
+ **`.dockerignore`** :
59
+ Specifies files and directories to ignore when building the Docker image.
60
+
61
+ **`docker-compose.yml`** :
62
+ Defines and runs multi-container Docker applications, _if applicable_.
63
+
64
+ ## Ruby Files
65
+
66
+ These files are common to Ruby-based DocOps Lab projects. The `Gemfile` and `Gemfile.lock` may be present in non-Ruby codebases that use Ruby development dependencies, such as ReleaseHx.
67
+
68
+ **`Gemfile`** :
69
+ Ruby Bundler file, specifying gem dependencies for the project.
70
+
71
+ **`Gemfile.lock`** :
72
+ Generated by Bundler, this file locks the gem versions used in the project.
73
+
74
+ **`.ruby-version`** :
75
+ Specifies the Ruby version used in the project.
76
+
77
+ **`<gemname>.gemspec`** :
78
+ Ruby gem specification file, defining the gem’s metadata and dependencies.
79
+
80
+ ## Automation Paths
81
+
82
+ **`Rakefile`** :
83
+ Ruby Rakefile for defining tasks and automation scripts.
84
+
85
+ **`scripts/`** :
86
+ Custom scripts for automating tasks related to development, testing, and deployment. See [scripts] below.
87
+
88
+ **`.github/workflows/`** :
89
+ GitHub Actions workflows for CI/CD, defining automated build, test, and deployment processes.
90
+
91
+ ## Quality Assurance Paths
92
+
93
+ Any files containing _requirements_, _specifications_, _definitions_, _schemas_, or _tests_ should be stored in the `specs/` directory, as detailed in [DocOps Lab Testing & Specifications](/docs/testing/).
94
+
95
+ **`specs/`** :
96
+ General directory for content that specifies, defines, or tests elements of the product. See [DocOps Lab Testing & Specifications](/docs/testing/).
97
+
98
+ **`specs/data/`** :
99
+ Definition and schema files.
100
+
101
+ **`specs/tests/rspec/`** :
102
+ RSpec tests for Ruby codebases.
103
+
104
+ **`../<product-slug>-demo/`** :
105
+ Major products typically have a sibling repo that serves as a proving grounds and/or for demonstrative purposes.
106
+
107
+ ## Generative AI Paths
108
+
109
+ **`.github/copilot-instructions.md`** :
110
+ Instructions for GitHub Copilot, providing guidance on how any cloud-based GH Copilot assistance should be oriented toward a given codebase.
111
+
112
+ **`AGENTS.md`** :
113
+ General for _local_ coding agents. May duplicate `.github/copilot-instructions.md` or provide additional context.
114
+
115
+ **`.agent/`** :
116
+ A directory for temporary/scratch files used by local coding agents.
117
+
@@ -0,0 +1,202 @@
1
+ # AI Agent Instructions for In-house Dev-Tooling Usage
2
+
3
+ This document is intended for AI agents operating within a DocOps Lab environment.
4
+
5
+ This guide pertains to the `docopslab-dev` environment. For complete documentation, see the [project’s README](https://github.com/DocOps/lab/blob/main/gems/docopslab-dev/README.adoc).
6
+
7
+ > **IMPORTANT:** The environment described and provided here is _not_ optimized for DocOps Lab _applications_ used in third-party projects. For your own applications of DocOps Labs products like ReleaseHx and Issuer, see [DocOps Box](https://github.com/DocOps/box) for a full-featured docs-focused workspace, runtime, and production environment.
8
+
9
+ This gem mainly supplies rake tasks for performing common development operations across unified configurations and sub-libraries.
10
+
11
+ Table of Contents
12
+
13
+ - Standard Usage
14
+ - Override Commands
15
+ - More Example Commands
16
+ - Tasks and Workflow
17
+ - Typical Workflow
18
+ - Customization
19
+ - Local Overrides
20
+
21
+ ## Standard Usage
22
+
23
+ Run all linters
24
+
25
+ ```
26
+ bundle exec rake labdev:lint:all
27
+ ```
28
+
29
+ Auto-fix safe issues
30
+
31
+ ```
32
+ bundle exec rake labdev:heal
33
+ ```
34
+
35
+ ## Override Commands
36
+
37
+ Most executions of the packaged tools are handled through Rake tasks, but you can always run them directly, especially to pass arguments not built into the tasks.
38
+
39
+ **RuboCop** :
40
+ ```
41
+ bundle exec rubocop --config .config/rubocop.yml [options]
42
+ bundle exec rubocop --config .config/rubocop.yml --auto-correct-all
43
+ bundle exec rubocop --config .config/rubocop.yml --only Style/StringLiterals
44
+ ```
45
+
46
+ **Vale** :
47
+ ```
48
+ vale --config=.config/vale.ini [options] [files]
49
+ vale --config=.config/vale.ini README.adoc
50
+ vale --config=.config/vale.ini --minAlertLevel=error .
51
+ ```
52
+
53
+ **HTMLProofer** :
54
+ ```
55
+ bundle exec htmlproofer --ignore-urls "/www.github.com/,/foo.com/" ./_site
56
+ ```
57
+
58
+ ## More Example Commands
59
+
60
+ Lint specific Ruby file with specific rule
61
+
62
+ ```
63
+ bundle exec rake 'labdev:lint:ruby[lib/myfile.rb,Style/StringLiterals]'
64
+ ```
65
+
66
+ Lint all AsciiDoc files for a specific Vale rule
67
+
68
+ ```
69
+ bundle exec rake 'labdev:lint:adoc[,DocOpsLab-Authoring.ExNotEg]'
70
+ ```
71
+
72
+ Lint specific shell script
73
+
74
+ ```
75
+ bundle exec rake 'labdev:lint:bash[scripts/docksh]'
76
+ ```
77
+
78
+ Lint specific file with Vale (text mode)
79
+
80
+ ```
81
+ bundle exec rake 'labdev:lint:text[_docs/myfile.adoc]'
82
+ ```
83
+
84
+ Show a specific lint rule profile
85
+
86
+ ```
87
+ bundle exec rake 'labdev:show:rule[vale,RedHat]'
88
+ ```
89
+
90
+ ## Tasks and Workflow
91
+
92
+ ```
93
+ bundle exec rake --tasks | grep labdev:
94
+ ```
95
+
96
+ > **TIP:** To hide the `labdev:` tasks from the standard `rake --tasks` output for an integrated project, use:
97
+ >
98
+ >
99
+ >
100
+ >
101
+ >
102
+ > ```
103
+ > bundle exec rake --tasks | grep -v labdev:
104
+ > ```
105
+
106
+ ### Typical Workflow
107
+
108
+ This tool is for working on DocOps Lab projects or possibly unrelated projects that wish to follow our methodology. A typical workflow might look as follows.
109
+
110
+ Normal development
111
+
112
+ ```
113
+ git add .
114
+ git commit -m "Add new feature"
115
+ ```
116
+
117
+ + This should yield warnings and errors if active linters find issues.
118
+
119
+ 1. Auto-fix what you can.
120
+
121
+ ```
122
+ bundle exec rake labdev:heal
123
+ ```
124
+ 2. Review the changes.
125
+
126
+ ```
127
+ git diff
128
+ ```
129
+ 3. Commit the fixes.
130
+
131
+ ```
132
+ git add -A
133
+ git commit -m "Auto-fix linting issues"
134
+ ```
135
+ 4. Handle any remaining manual fixes.
136
+
137
+ ```
138
+ bundle exec rake labdev:lint:all
139
+ ```
140
+ 5. Fix remaining issues manually.
141
+
142
+ ```
143
+ git add -A
144
+ git commit -m "Fix remaining linting issues"
145
+ ```
146
+ 6. Try pushing.
147
+
148
+ ```
149
+ git push
150
+ ```
151
+
152
+ If all blocking issues are cleared, the push should succeed. Otherwise, more cleanup is needed.
153
+
154
+ > **TIP:** Bypass the pre-push gates (usually to test or demo the failure at origin):
155
+ >
156
+ >
157
+ >
158
+ >
159
+ >
160
+ > ```
161
+ > git push --no-verify
162
+ > ```
163
+
164
+ ## Customization
165
+
166
+ Override settings by editing the project configs:
167
+
168
+ - `.config/docopslab-dev.yml`
169
+ - `.config/rubocop.yml`
170
+ - `.config/vale.ini`
171
+ - `.config/htmlproofer.yml`
172
+ - `.config/actionlint.yml`
173
+ - `.config/shellcheckrc`
174
+
175
+ Your configurations will inherit from the base configurations and source libraries as sourced in the Git-ignored `.config/.vendor/docopslab/` path.
176
+
177
+ ### Local Overrides
178
+
179
+ Projects using `docopslab-dev` will have a configuration structure like the following:
180
+
181
+ ```tree
182
+ config/
183
+ ├── docopslab-dev.yml # Project manifest (tracked)
184
+ ├── actionlint.yml # Project config (tracked; inherits from base)
185
+ ├── htmlproofer.local.yml # Project config (tracked; inherits from base)
186
+ ├── htmlproofer.yml # Generated config (untracked)
187
+ ├── rubocop.yml # Project config (tracked; inherits from base)
188
+ ├── shellcheckrc # ShellCheck config (tracked)
189
+ ├── vale.ini # Generated active config (untracked)
190
+ ├── vale.local.ini # Project config (tracked; inherits from base)
191
+ ├── .vendor/ # Base configs (untracked; synced)
192
+ │ └── docopslab/
193
+ │ ├── htmlproofer.yml # Centrally managed base
194
+ │ ├── rubocop.yml # Centrally managed base
195
+ │ └── vale.ini # Centrally managed base
196
+ scripts/ # Project override scripts
197
+ └── .vendor/ # Centrally managed scripts
198
+ .github/workflows/ # CI/CD workflows (tracked)
199
+ env.docopslab # Environment variables (git tracked)
200
+ env.private # Environment variables (git ignored)
201
+ ```
202
+
@@ -0,0 +1,55 @@
1
+ # AI Agent Orientation to DocOps Lab DevOps/CI/CD Practices
2
+
3
+ This document is intended for AI agents operating within a DocOps Lab environment.
4
+
5
+ DocOps Lab is in a very nascent stage of establishing shared (cross-repo) tools, workflows, and protocols to for automating development, integration, build, and deployment processes.
6
+
7
+ DocOps Lab uses GitHub Actions and Docker as primary platforms for integration and deployment automation.
8
+
9
+ For now you can get a good idea for getting started with automation by checking the standard paths in the current project (`Dockerfile`, `docker-compose.yml`, `.github/workflos/`, `Rakefile`, `scripts/`) as well as looking at similar DocOps Lab projects that have more established CI/CD workflows.
10
+
11
+ The rest of this document is snippets from various relevant internal documentation.
12
+
13
+ Table of Contents
14
+
15
+ - Common Automation Scripts
16
+ - Docker Usage
17
+ - Application Dockerfiles and Images
18
+ - See Also
19
+
20
+ ## Common Automation Scripts
21
+
22
+ Some DocOps Lab projects include highly customized automation scripts, but most contain or employ some common scripts that are primarily stored in this repository and/or deployed as Docker images for universal access during development, testing, and deployment.
23
+
24
+ These procedures can always be invoked by way of local scripts located in `scripts/`. These include:
25
+
26
+ - `build.sh`
27
+ - `publish.sh`
28
+
29
+ Common scripts are managed through the lnk:/docs/lab-dev-setup/[`docopslab-dev` gem].
30
+
31
+ Ruby projects will generally include a `Rakefile` (in the base directory), which automates various Ruby tasks.
32
+
33
+ ## Docker Usage
34
+
35
+ DocOps Lab projects make extensive use of Docker.
36
+
37
+ All runtime projects provide have their own Docker image hosted on Docker Hub and sourced in their own repo’s `Dockerfile`. This way a reliable executable is available across all platforms and environments.
38
+
39
+ Some of our CI/CD pipelines will be “Dockerized” to provide consistent builds and tests across numerous repos.
40
+
41
+ The DocOps Box project maintains an elaborate Dockerfile and image/container management script (`docksh`) that can help manage multiple environments. This is most advantageous for non-Ruby/non-programmer users building a complex documentation codebase in the Ruby/DocOps Lab ecosystem or using multiple DocOps Lab or similar tools across numerous multiple codebases.
42
+
43
+ ### Application Dockerfiles and Images
44
+
45
+ Each runtime application project has its own `Dockerfile` in the root of its repository.
46
+
47
+ This Dockerfile defines the image that will be built and pushed to Docker Hub for use by anyone needing to run the application.
48
+
49
+ > **NOTE:** Some Dockerfiles combine multiple applications, such as the [issuer-rhx image](https://github.com/DocOps), which combines both the Issuer and ReleaseHx applications.
50
+
51
+ ## See Also
52
+
53
+ - `./dev-tooling-usage.md`
54
+ - `../skills/git.md`
55
+
@@ -0,0 +1,25 @@
1
+ # Product Documentation Deployment
2
+
3
+ This document is intended for AI agents operating within a DocOps Lab environment.
4
+
5
+ Most DocOps Lab projects have their own documentation sites, also built with Jekyll and AsciiDoc, often including YARD for Ruby API reference generation.
6
+
7
+ For less-formalized projects, documentation is restricted to `README.adoc` and other `*.adoc` files. These are hosted as GitHub Pages sites from their respective repositories, but using a consistent URL structure centered on the `docopslab.org` domain hosted here.
8
+
9
+ The URL structure is as follows:
10
+
11
+ **Project landing page** :
12
+ `https://<project>.docopslab.org/`
13
+
14
+ At a minimum, this should be a subset of the `README.adoc` file.
15
+
16
+ **Product user docs** :
17
+ `https://<project>.docopslab.org/docs/`
18
+
19
+ **Product developer docs** :
20
+ `https://<project>.docopslab.org/docs/api/(<apiname>/)`
21
+
22
+ The final `<apiname>` directory is only applicable when the product contains multiple distinct APIs.
23
+
24
+ GH Pages configuration for these sites enables deployment by way of a clean `gh-pages` branch containing only generated documentation artifacts and the `CNAME` file.
25
+
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ # File to be called by DocOpsLab::Dev to auto-fix AsciiDoc files
4
+ module DocOpsLab
5
+ module Dev
6
+ module AutoFixAsciidoc
7
+ class << self
8
+ def fix_asciidoc_files _context, path: nil
9
+ # use the find_asciidoc_files method if no path is passed
10
+ adoc_files = if path
11
+ if File.directory?(path)
12
+ Dir.glob(File.join(path, '**', '*.adoc'))
13
+ elsif File.file?(path) && File.extname(path) == '.adoc'
14
+ [path]
15
+ else
16
+ puts "❌ Invalid path specified for AsciiDoc auto-fix: #{path}"
17
+ return false
18
+ end
19
+ else
20
+ Dev.find_asciidoc_files
21
+ end
22
+
23
+ if adoc_files.empty?
24
+ puts '✅ No AsciiDoc files found for auto-fix'
25
+ return true
26
+ end
27
+
28
+ fixed_count = 0
29
+
30
+ adoc_files.each do |file_path|
31
+ File.read(file_path)
32
+ Dev.run_script('adoc_section_ids.rb', [file_path])
33
+ end
34
+
35
+ if fixed_count.positive?
36
+ puts "✅ AsciiDoc auto-fix complete; #{fixed_count} files modified"
37
+ else
38
+ puts '✅ All AsciiDoc files are already compliant'
39
+ end
40
+
41
+ true
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,108 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DocOpsLab
4
+ module Dev
5
+ module Checkers
6
+ class << self
7
+ def lab_dev_mode?
8
+ # Detect if we are running inside the DocOps/lab monorepo
9
+ Dir.exist?('gems/docopslab-dev')
10
+ end
11
+
12
+ def gem_sourced_locally?
13
+ # Check if the gem is being used via a path dependency (development mode)
14
+ # This is true when running from issuer, releasehx, etc. with path: '../lab/gems/docopslab-dev'
15
+ # The GEM_ROOT will point to a local filesystem path rather than a gem installation
16
+ !GEM_ROOT.include?('/gems/') || GEM_ROOT.include?('/lab/gems/docopslab-dev')
17
+ end
18
+
19
+ def check_ruby_version
20
+ expected_version = RUBY_TARGET
21
+ current_version = RUBY_VERSION
22
+
23
+ puts "Ruby version: #{current_version}"
24
+
25
+ if current_version == expected_version
26
+ puts "✅ Ruby version matches DocOps Lab standard (#{expected_version})"
27
+ else
28
+ puts "⚠️ Ruby version differs from DocOps Lab standard (#{expected_version})"
29
+ end
30
+
31
+ if File.exist?('.ruby-version')
32
+ file_version = File.read('.ruby-version').strip
33
+ puts "📄 .ruby-version file specifies: #{file_version}"
34
+
35
+ if file_version == expected_version
36
+ puts '✅ .ruby-version matches DocOps Lab standard'
37
+ else
38
+ puts '⚠️ .ruby-version differs from DocOps Lab standard'
39
+ end
40
+ else
41
+ puts 'ℹ️ No .ruby-version file found'
42
+ end
43
+ end
44
+
45
+ def check_config_structure context
46
+ puts "\n📋 Configuration Status:"
47
+
48
+ manifest = context.load_manifest
49
+
50
+ if manifest
51
+ puts '✅ Manifest found: .config/docopslab-dev.yml'
52
+ else
53
+ puts "❌ No manifest found; run 'labdev:init:all' to create one"
54
+ return
55
+ end
56
+
57
+ # Check configs for each tool in manifest
58
+ manifest['tools']&.each do |tool_entry|
59
+ tool_slug = tool_entry['tool']
60
+ tool_meta = context.get_tool_metadata(tool_slug)
61
+ tool_name = tool_meta ? tool_meta['name'] : tool_slug
62
+ tool_enabled = tool_entry.fetch('enabled', true)
63
+
64
+ unless tool_enabled
65
+ puts "⏭️ #{tool_name}: disabled in manifest"
66
+ next
67
+ end
68
+
69
+ files = context.get_tool_files(tool_slug)
70
+
71
+ unless files[:project]
72
+ puts "⚠️ #{tool_name}: no project config defined in manifest"
73
+ next
74
+ end
75
+
76
+ project_path = files[:project][:local]
77
+ unless project_path && File.exist?(project_path)
78
+ puts "❌ No #{tool_name} project config found; run 'labdev:init:all' to create one"
79
+ next
80
+ end
81
+
82
+ # Check for base config if tool uses vendor base
83
+ if files[:base] && tool_meta && tool_meta['config']['uses_vendor_base']
84
+ base_status = File.exist?(files[:base][:local]) ? '✅' : '❌'
85
+ puts "✅ #{tool_name} project config: #{project_path} (base: #{base_status})"
86
+ else
87
+ puts "✅ #{tool_name} project config: #{project_path}"
88
+ end
89
+ end
90
+ end
91
+
92
+ def check_standard_rake_tasks
93
+ # Checks local Rakefile for presence of standard (non-labdev) tasks
94
+ standard_tasks = %w[rspec cli_test yaml_test pr_test install_local]
95
+ missing_tasks = []
96
+ standard_tasks.each do |task_name|
97
+ missing_tasks << task_name unless Rake::Task.task_defined?(task_name)
98
+ end
99
+ if missing_tasks.empty?
100
+ puts '✅ All standard Rake tasks are present'
101
+ else
102
+ puts "❌ Missing standard Rake tasks: #{missing_tasks.join(', ')}"
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
108
+ end