Skip to content

chore: Updated for AI readiness for this repo.#38

Open
dlabaj wants to merge 2 commits intopatternfly:mainfrom
dlabaj:ai-updates
Open

chore: Updated for AI readiness for this repo.#38
dlabaj wants to merge 2 commits intopatternfly:mainfrom
dlabaj:ai-updates

Conversation

@dlabaj
Copy link
Copy Markdown
Contributor

@dlabaj dlabaj commented Apr 27, 2026

Updated repo so it now has missing features and structure to support agentic code development better. Repo is now scoring above 80%.

Summary by CodeRabbit

  • Chores
    • Added structured GitHub issue and pull request templates with guided prompts for submissions
    • Implemented automated code linting and quality checks integrated into continuous integration workflows
    • Updated project configuration, development guidelines, and repository documentation standards

@dlabaj dlabaj requested review from a team and cdcabrera and removed request for a team April 27, 2026 19:30
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Walkthrough

This PR reorganizes test infrastructure by moving tests from src/__tests__/ to a tests/ directory at the repository root, adds GitHub issue/PR templates and automated linting workflows, introduces markdown linting configuration, and updates npm scripts and project documentation accordingly.

Changes

Cohort / File(s) Summary
GitHub Templates and Configuration
.github/ISSUE_TEMPLATE/bug_report.md, .github/ISSUE_TEMPLATE/feature_request.md, .github/ISSUE_TEMPLATE/config.yml, .github/pull_request_template.md
Introduces structured GitHub issue templates for bug reports and feature requests, PR template with change categorization and contributor checklist, and configuration enabling blank issues with external community links.
CI/Linting Workflows
.github/workflows/actionlint.yml, .github/workflows/markdownlint.yml
Adds GitHub Actions workflows to validate workflow YAML syntax via actionlint and enforce Markdown formatting via markdownlint on pull requests and pushes to main.
Markdown and Git Configuration
.markdownlint.json, .markdownlintignore, .gitignore
Configures markdownlint rules (ATX headings, 120 character line length, 2-space indentation) and exclusions; adds .agentready artifact to gitignore.
Project Documentation
CLAUDE.md, .github/LINTING.md, README.md
Adds Claude Code interaction guide documenting project architecture and workflow; introduces linting documentation; reformats README with improved line wrapping.
Build Configuration
package.json, tsconfig.json
Refactors lint scripts to run separate lint:js and lint:md targets; adds markdownlint-cli dependency; updates Jest test pattern from **/__tests__/**/*.test.ts to **/tests/**/*.test.ts; adjusts TypeScript exclusions to match new test directory.
Test File Import Updates
tests/cli.test.ts, tests/create.test.ts, tests/gh-pages.test.ts, tests/git-user-config.test.ts, tests/github.test.ts, tests/load.test.ts, tests/read-package-version.test.ts, tests/save.test.ts
Updates module imports and mock paths from root-level and src/__tests__/fixtures to align with new src/ directory structure; redirects fixture references to tests/fixtures.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~18 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'chore: Updated for AI readiness for this repo' is vague and does not clearly convey the specific changes made. It uses non-descriptive language that fails to highlight the main changes (adding GitHub templates, linting configuration, workflow automation, documentation, and test restructuring). Provide a more specific title such as 'chore: Add GitHub templates, linting config, and CI workflows for AI readiness' to better summarize the multiple categories of changes introduced.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
.github/workflows/markdownlint.yml (1)

3-11: Broaden the trigger paths for markdownlint.

Only Markdown file changes will run this job, so edits to .markdownlint.json, .markdownlintignore, or this workflow itself can change lint behavior without any CI validation. Consider adding those files to the filter.

Suggested path filter
 on:
   pull_request:
     paths:
-      - '**.md'
+      - '**.md'
+      - '.markdownlint.json'
+      - '.markdownlintignore'
+      - '.github/workflows/markdownlint.yml'
   push:
     branches:
       - main
     paths:
-      - '**.md'
+      - '**.md'
+      - '.markdownlint.json'
+      - '.markdownlintignore'
+      - '.github/workflows/markdownlint.yml'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/markdownlint.yml around lines 3 - 11, Update the workflow
trigger paths so the markdownlint job also runs when config or workflow files
that affect linting change: modify the pull_request and push paths arrays (the
"pull_request: paths" and "push: paths" entries shown in the diff) to include
patterns for .markdownlint.json, .markdownlintignore, and the workflow file
itself (e.g., add '**/.markdownlint.json', '**/.markdownlintignore', and
'.github/workflows/markdownlint.yml' or equivalent globs) so changes to those
files will trigger the job.
package.json (1)

21-23: Keep the relocated tests under ESLint coverage.

lint:js still only runs on src, so the new tests/**/*.test.ts tree is no longer linted. If repo-wide TypeScript linting is the goal, extend this target or add a dedicated test lint script.

♻️ Suggested fix
-    "lint:js": "eslint src",
-    "lint:js:fix": "eslint src --fix",
+    "lint:js": "eslint src tests",
+    "lint:js:fix": "eslint src tests --fix",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 21 - 23, The "lint:js" npm script currently only
targets "src" and therefore omits the relocated tests; update the "lint:js"
script (and optionally create a new "lint:tests" script) so ESLint runs against
both source and tests (e.g., include "tests/**/*.test.ts" or a broader pattern
like "{src,tests}/**/*.{ts,tsx,js,jsx}") by changing the "lint:js" script (and
adding "lint:tests" if you prefer separate linting) so test files are covered by
ESLint.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/pull_request_template.md:
- Around line 36-39: Replace the incomplete checklist entry "- [ ] Manually
tested locally (`npm run build && npm install -g`)" with a concrete or neutral
placeholder global install command; for example change it to "- [ ] Manually
tested locally (`npm run build && npm install -g <package-name>`)” or "- [ ]
Manually tested locally (`npm run build && npm install -g .`)" so the
instruction is copy-pasteable and unambiguous.

In `@CLAUDE.md`:
- Around line 42-46: The local install example is incorrect: replace the
incomplete `npm install -g` instruction with a working command such as `npm
install -g .` or instruct to run `npm link` so the package is actually installed
globally; update the block showing the three commands (the lines containing `npm
run build` and the global install) to use one of these correct install options
so `'patternfly-cli'`/`'pf'` runs the local build.

In `@tests/cli.test.ts`:
- Line 6: The current fixturesDir uses process.cwd(), coupling tests to the
working directory; change it to resolve relative to the test file using
__dirname (e.g. const fixturesDir = path.join(__dirname, 'fixtures') or
path.resolve(__dirname, 'fixtures')) so fixtures load reliably in CI/editors,
and make the same change in the other occurrence in tests/create.test.ts (update
the fixturesDir variable there as well).

---

Nitpick comments:
In @.github/workflows/markdownlint.yml:
- Around line 3-11: Update the workflow trigger paths so the markdownlint job
also runs when config or workflow files that affect linting change: modify the
pull_request and push paths arrays (the "pull_request: paths" and "push: paths"
entries shown in the diff) to include patterns for .markdownlint.json,
.markdownlintignore, and the workflow file itself (e.g., add
'**/.markdownlint.json', '**/.markdownlintignore', and
'.github/workflows/markdownlint.yml' or equivalent globs) so changes to those
files will trigger the job.

In `@package.json`:
- Around line 21-23: The "lint:js" npm script currently only targets "src" and
therefore omits the relocated tests; update the "lint:js" script (and optionally
create a new "lint:tests" script) so ESLint runs against both source and tests
(e.g., include "tests/**/*.test.ts" or a broader pattern like
"{src,tests}/**/*.{ts,tsx,js,jsx}") by changing the "lint:js" script (and adding
"lint:tests" if you prefer separate linting) so test files are covered by
ESLint.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f4bf83ff-4a6d-4263-9bd8-954d27856f73

📥 Commits

Reviewing files that changed from the base of the PR and between c92030e and 2af717c.

⛔ Files ignored due to path filters (2)
  • .DS_Store is excluded by !**/.DS_Store
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (26)
  • .github/ISSUE_TEMPLATE/bug_report.md
  • .github/ISSUE_TEMPLATE/config.yml
  • .github/ISSUE_TEMPLATE/feature_request.md
  • .github/LINTING.md
  • .github/pull_request_template.md
  • .github/workflows/actionlint.yml
  • .github/workflows/markdownlint.yml
  • .gitignore
  • .markdownlint.json
  • .markdownlintignore
  • CLAUDE.md
  • README.md
  • package.json
  • tests/cli.test.ts
  • tests/create.test.ts
  • tests/fixtures/invalid-template-bad-options.json
  • tests/fixtures/invalid-template-missing-name.json
  • tests/fixtures/not-array.json
  • tests/fixtures/valid-templates.json
  • tests/gh-pages.test.ts
  • tests/git-user-config.test.ts
  • tests/github.test.ts
  • tests/load.test.ts
  • tests/read-package-version.test.ts
  • tests/save.test.ts
  • tsconfig.json

Comment on lines +36 to +39
- [ ] Existing tests pass (`npm test`)
- [ ] Added new tests for changes
- [ ] Manually tested locally (`npm run build && npm install -g`)
- [ ] Linting passes (`npm run lint`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Complete the example install command.

npm install -g is incomplete as written and can be copied into a PR without working. If you want to show a global install check, use a concrete package path or replace it with a neutral placeholder.

Possible fix
-- [ ] Manually tested locally (`npm run build && npm install -g`)
+- [ ] Manually tested locally (`npm run build && npm install -g .`)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- [ ] Existing tests pass (`npm test`)
- [ ] Added new tests for changes
- [ ] Manually tested locally (`npm run build && npm install -g`)
- [ ] Linting passes (`npm run lint`)
- [ ] Existing tests pass (`npm test`)
- [ ] Added new tests for changes
- [ ] Manually tested locally (`npm run build && npm install -g .`)
- [ ] Linting passes (`npm run lint`)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/pull_request_template.md around lines 36 - 39, Replace the
incomplete checklist entry "- [ ] Manually tested locally (`npm run build && npm
install -g`)" with a concrete or neutral placeholder global install command; for
example change it to "- [ ] Manually tested locally (`npm run build && npm
install -g <package-name>`)” or "- [ ] Manually tested locally (`npm run build
&& npm install -g .`)" so the instruction is copy-pasteable and unambiguous.

Comment thread CLAUDE.md
Comment on lines +42 to +46
```bash
npm run build
npm install -g
# Now 'patternfly-cli' or 'pf' runs your local build
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix the local install example.

npm install -g is incomplete on its own and does not install this package. Use npm install -g . or npm link so the documented command actually works.

♻️ Suggested fix
- npm install -g
+ npm install -g .
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```bash
npm run build
npm install -g
# Now 'patternfly-cli' or 'pf' runs your local build
```
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CLAUDE.md` around lines 42 - 46, The local install example is incorrect:
replace the incomplete `npm install -g` instruction with a working command such
as `npm install -g .` or instruct to run `npm link` so the package is actually
installed globally; update the block showing the three commands (the lines
containing `npm run build` and the global install) to use one of these correct
install options so `'patternfly-cli'`/`'pf'` runs the local build.

Comment thread tests/cli.test.ts
import templates from '../src/templates.js';

const fixturesDir = path.join(process.cwd(), 'src', '__tests__', 'fixtures');
const fixturesDir = path.join(process.cwd(), 'tests', 'fixtures');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Avoid coupling fixture lookup to process.cwd().

This makes the suite depend on where Jest was launched from. Use a path relative to the test file so the fixtures resolve reliably in CI and from editors/other entrypoints. The same repo-root assumption also shows up in tests/create.test.ts.

Suggested fix
-const fixturesDir = path.join(process.cwd(), 'tests', 'fixtures');
+const fixturesDir = path.resolve(__dirname, 'fixtures');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/cli.test.ts` at line 6, The current fixturesDir uses process.cwd(),
coupling tests to the working directory; change it to resolve relative to the
test file using __dirname (e.g. const fixturesDir = path.join(__dirname,
'fixtures') or path.resolve(__dirname, 'fixtures')) so fixtures load reliably in
CI/editors, and make the same change in the other occurrence in
tests/create.test.ts (update the fixturesDir variable there as well).

Copy link
Copy Markdown
Member

@cdcabrera cdcabrera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question:

The tests you moved under "tests" I generally associate with unit tests, so having them under ./src/__tests__ was acceptable from every past codebase we've worked in.

Generally under the root "tests" directory we've placed more e2e focused testing. This typically involves not necessarily mocking anything except maybe network requests.

Did you make this change because the "agent ready" tool indicated these tests needed to be moved?

I would indicate we should consider not following "agent ready" (for this facet) since the tool isn't tailored towards node.js repos and then we can actively come up with e2e tests in subsequent work.

Dropping the tests refactor from this PR could be one solution.

Comment thread README.md
# Patternfly CLI

Patternfly CLI is a command-line tool designed for scaffolding projects, performing code modifications, and running project-related tasks. It aims to streamline development workflows and improve productivity.
Patternfly CLI is a command-line tool designed for scaffolding projects, performing code modifications, and
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patternfly should be PatternFly, looks like the title should get the change too. Might need to search/replace to find other instances.

Comment thread package.json
{
"name": "@patternfly/patternfly-cli",
"version": "1.0.0-prerelease.1",
"description": "Patternfly cli for scaffolding projects, performing code mods, and running project related tasks",
Copy link
Copy Markdown
Member

@cdcabrera cdcabrera Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patternfly cli should be PatternFly CLI might also consider project related with a hyphen project-related since its done in the README too

Comment thread .gitignore

# AI analysis
.agentready

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're having issues with the .DS_Store you could consider adding in a

# os
.DS_Store

on:
pull_request:
paths:
- '**.md'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debating on this **.md vs **/*.md? Might need to confirm if you ever decide to drop Markdown underneath a directory

branches:
- main
paths:
- '**.md'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same **.md vs **/*.md note

Comment thread .github/LINTING.md

## Configuration Files

- [.eslintrc](../.eslintrc) - ESLint configuration (if exists)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So a couple of things.

  1. wrong eslint config... [eslint.config.js](../eslint.config.js) and well, it exists =)

  2. I've never seen a LINTING.md underneath a .github directory in the wild, not saying it isn't a thing, but if "agentready" is recommending this I'd say maybe we should consider a rethink since it's non-standard something. Plus a similar path could be achieved with an old skool CONTRIBUTING.md maybe even something like a DEVELOPMENT.md. I also couldn't find LINTING.md in any documentation searches ... its unique.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add in that if we're just trying to bump a score on the tool the score comes across as meaningless we'll only ever attempt to hit a made up metric thats constantly evolving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants