Skip to content

Commit 786c21c

Browse files
committed
refactor: consolidate into single RHDH-aware agent-ready skill
- Remove init-agents-md as a standalone skill; AGENTS.md generation is now inline within agent-ready, using assessment context (detected languages, CI commands, tech stack) rather than re-scanning from scratch - Add RHDH detection: reads rhdh-repos.md from the rhdh skill to match repo remote URLs; pre-fills AGENTS.md and skips inapplicable findings when a match is found; degrades gracefully if rhdh skill is not installed - Add batch mode: when invoked with no path, offers to assess all RHDH repos in a local directory, producing a summary table with scores and offering to drill into any individual repo - Update README to reflect consolidated skill Assisted-by: Claude Sonnet 4.6
1 parent 3172988 commit 786c21c

3 files changed

Lines changed: 119 additions & 204 deletions

File tree

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ Track work across the four RHDH Jira projects.
7373

7474
### Repository Readiness
7575

76-
Prepare any git repository for effective AI agent use.
77-
78-
- **[agent-ready](./skills/agent-ready/SKILL.md)** — Assess a repository against agentready criteria, then walk through and address each gap interactively. Runs the [agentready](https://github.com/ambient-code/agentready) CLI, presents failing findings by tier, and delegates AGENTS.md creation to `init-agents-md`.
79-
- **[init-agents-md](./skills/init-agents-md/SKILL.md)** — Bootstrap `AGENTS.md` and `CLAUDE.md` for any repository. Detects build/test commands from config files and CI, asks 3 targeted questions, and writes a minimal draft for human review.
76+
- **[agent-ready](./skills/agent-ready/SKILL.md)** — Assess RHDH repositories against agentready criteria and address each gap. RHDH-aware: detects the repo from its remote URL, uses `rhdh-repos.md` context to pre-fill `AGENTS.md` and skip inapplicable findings. Supports single-repo and batch modes (assess all RHDH repos in one pass).
8077

8178
### Meta
8279

skills/agent-ready/SKILL.md

Lines changed: 118 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: agent-ready
33
description: |
4-
Assesses a git repository's readiness for use by AI coding agents using the agentready CLI, then walks through and addresses each gap. Use when asked to "assess agent readiness", "run agentready", "check how agent-ready this repo is", "make this repo agent-ready", "improve our agent readiness score", "run the agent ready CLI", "assess this repo for AI agents", or "what's our agentready score".
4+
Assesses a git repository's readiness for use by AI coding agents using the agentready CLI, then walks through and addresses each gap. RHDH-aware: detects RHDH repositories and uses rhdh-repos.md context to pre-fill AGENTS.md and skip inapplicable findings. Use when asked to "assess agent readiness", "run agentready", "check how agent-ready this repo is", "make this repo agent-ready", "improve agent readiness score", "assess all RHDH repos", "batch agent readiness", or "onboard this repo for agents".
55
---
66

77
## Prerequisites
@@ -14,123 +14,171 @@ uvx --version
1414

1515
If missing, stop: "`uvx` is required. Install via `pip install uv` or see [uv installation](https://docs.astral.sh/uv/getting-started/installation/)."
1616

17-
## Step 1: Setup
17+
## Step 1: Mode selection
1818

19-
**Path:** Default to the current working directory. If the user provided a path, use that instead. Validate it is a git repository:
19+
If no path was provided, present a structured choice:
20+
21+
- **Single repo** — assess the current working directory (default)
22+
- **Batch** — assess all RHDH repositories (see Batch mode below)
23+
24+
If a path was provided, skip this and proceed to Step 2.
25+
26+
## Step 2: Setup
27+
28+
**Path:** Use the provided path, or `.` for the current directory. Validate it is a git repository:
2029

2130
```bash
22-
git -C . rev-parse --is-inside-work-tree # replace . with the user-provided path if one was given
31+
git -C . rev-parse --is-inside-work-tree # replace . with path if provided
2332
```
2433

2534
If not a git repository, stop and tell the user.
2635

27-
**Config file:** Only use a config file if the user explicitly provided one. Do not ask. If a path was given, verify it exists before proceeding.
36+
**RHDH detection:** Check the repo's git remote URL:
37+
38+
```bash
39+
git -C <path> remote get-url origin 2>/dev/null
40+
```
41+
42+
Attempt to read `~/.claude/skills/rhdh/references/rhdh-repos.md`. If the file does not exist, skip RHDH detection and proceed with generic assessment — do not stop or warn the user. If found, check whether the remote URL matches any repo's upstream URL. If matched, note the repo name, tech stack, key paths, and conventions — these inform AGENTS.md generation and finding triage. Store as `rhdh_context`.
2843

29-
## Step 2: Run the assessment
44+
**Config file:** Only use a config file if the user explicitly provided one. Do not ask.
3045

31-
Create a temp directory and run the assessment:
46+
## Step 3: Run the assessment
3247

3348
```bash
3449
REPORT_DIR=$(mktemp -d) # on Windows: use %TEMP% or Python tempfile
3550
uvx --from git+https://github.com/ambient-code/agentready agentready -- assess \
3651
-o "$REPORT_DIR" \
37-
. # replace . with the user-provided path if one was given
52+
<path>
3853
```
3954

40-
Append `-c <config-path>` to the command if the user provided a config file.
55+
Append `-c <config-path>` if the user provided a config file.
4156

42-
Note the value of `$REPORT_DIR` — shell variables do not persist across tool calls and Step 5 will need it.
57+
Note the value of `$REPORT_DIR` — shell variables do not persist across tool calls.
4358

4459
Parse `$REPORT_DIR/assessment-latest.json`. Extract:
4560
- `overall_score`, `certification_level`
4661
- `findings` — each with `attribute.id`, `attribute.tier`, `attribute.default_weight`, `attribute.name`, `status`, `score`, `evidence`, `remediation`
4762

48-
## Step 3: Present summary
49-
50-
Show a brief summary before diving into findings:
63+
## Step 4: Present summary
5164

5265
```
5366
Score: <overall_score>/100 — <certification_level>
5467
Failing: <N> findings (<N1> Tier 1, <N2> Tier 2, ...)
5568
```
5669

57-
If there are no failing findings, congratulate the user and stop — do not ask to work through anything.
70+
If no failing findings, congratulate the user and stop.
5871

5972
Otherwise ask:
6073

6174
> "Fix applicable findings automatically, or review each one individually?
6275
> **auto** (default) — apply self-contained fixes immediately; prompt only when input is needed
6376
> **review** — prompt yes/skip/defer/quit for every finding"
6477
65-
Default to **auto** if the user just says yes, presses Enter, or says "fix everything".
78+
Default to **auto** if the user says yes, presses Enter, or says "fix everything".
79+
80+
## Step 5: Work through findings
6681

67-
## Step 4: Work through findings
82+
Work only through `status == "fail"` findings. Skip `not_applicable` and `pass` silently.
6883

69-
Work only through findings where `status == "fail"`. Skip `not_applicable` and `pass` findings silently.
84+
**Sort order:** ascending tier, then descending `attribute.default_weight` within each tier.
7085

71-
**Sort order:** ascending tier (Tier 1 first), then descending `attribute.default_weight` within each tier.
86+
If `rhdh_context` is set, skip findings that clearly don't apply to the detected tech stack (e.g., lock file checks for a Bash-only repo, `src/` layout for a GitOps YAML repo) — note them in the summary.
7287

7388
### Auto mode
7489

75-
Apply each fix without prompting **unless** any of the following are true — in which case, pause and prompt:
90+
Apply each fix without prompting **unless**:
7691

77-
- The fix requires project-specific input (CI platform, package ecosystem, project name, language)
78-
- The finding might not apply to this repo type (e.g., `src/` layout for a GitOps YAML repo, lock files for a repo with no package dependencies) — present it and ask whether to apply or skip
79-
- It is the `agent_instructions` finding — always delegate to `init-agents-md` interactively
92+
- The fix requires project-specific input (CI platform, package ecosystem)
93+
- The finding might not apply to this repo type — present it and ask whether to apply or skip
8094

81-
**Skip without prompting** findings that require human rationale to be meaningful — ADRs, design intent, and architecture decisions. These cannot be generated without fabricating context the agent doesn't have.
95+
**Skip without prompting:** ADRs, design intent, architecture decisions — these require human rationale. Note them in the final summary.
8296

83-
After processing all findings, list what was applied, what was prompted, and what was skipped, then proceed to Step 5.
97+
For the `agent_instructions` finding, follow the inline AGENTS.md generation in the `agent_instructions` section below — this applies in both auto and review modes.
98+
99+
After processing, list what was applied, prompted, and skipped, then proceed to Step 6.
84100

85101
### Review mode
86102

87-
For each finding, present:
103+
For each finding:
88104

89105
```
90106
[Tier <N>] <attribute.name> — <score>/100
91-
Evidence: <evidence items, one per line>
107+
Evidence: <evidence items>
92108
93109
Remediation: <remediation.summary>
94110
95111
Apply this fix? [yes / skip / defer / quit]
96112
```
97113

98-
**yes** — apply the fix (see special cases below), then move to the next finding.
99-
**skip** — move on; do not revisit. Use this if the finding doesn't apply to this repo.
100-
**defer** — note it; present again after the re-run.
114+
**yes** — apply the fix, then move to the next finding.
115+
**skip** — move on; do not revisit. Use this if the finding doesn't apply to this repo.
116+
**defer** — note it; surface again after re-run.
101117
**quit** — stop immediately.
102118

103-
**ADR and design intent findings in review mode:** Do not present the JSON remediation. Instead ask:
119+
**ADR and design intent findings:** Do not use JSON remediation. Ask instead:
120+
121+
> "Do you have any architectural decisions worth capturing? Describe the decision and rationale — I'll write the ADR. Skip to add manually later."
122+
123+
Write only if the user provides input. Never invent rationale.
124+
125+
### `agent_instructions` finding (both modes)
126+
127+
Generate `AGENTS.md` and `CLAUDE.md` inline — do not delegate to another skill.
104128

105-
> "Do you have any architectural decisions worth capturing here? If so, describe the decision and why it was made — I'll write the ADR. Skip if you'd prefer to add these manually later."
129+
**Scan the repo for commands:**
130+
- `package.json``scripts` entries (build, test, lint, typecheck, dev)
131+
- `Makefile` / `GNUmakefile` → targets
132+
- `pyproject.toml``[tool.pytest]`, `[tool.ruff]`, `[tool.mypy]`, `[project.scripts]`
133+
- `.github/workflows/*.yml``run:` steps containing test/lint/build/typecheck keywords
106134

107-
If the user provides input, write the ADR or design doc using their rationale. If they skip, move on.
135+
**If `rhdh_context` is set:** pull key paths, tech stack, conventions, and branching model directly from the matched `rhdh-repos.md` entry — use these to pre-fill AGENTS.md sections and skip generic questions where RHDH context already answers them.
108136

109-
### Special case: `agent_instructions` finding (both modes)
137+
**If not RHDH (or RHDH context doesn't cover it):** ask these three questions one at a time:
138+
1. "What are 2-3 conventions an agent couldn't discover by reading the code? Skip if none."
139+
2. "Any non-obvious architectural decisions or places where things live unexpectedly? Skip if obvious."
140+
3. "Any commit format, CI checks, or PR conventions agents should know? Skip if standard."
110141

111-
Do not apply the JSON remediation. Instead, invoke the `init-agents-md` skill:
142+
Write `AGENTS.md`:
112143

113-
> "Invoking the `init-agents-md` skill to create AGENTS.md for this repository."
144+
```markdown
145+
# <repo-name>
114146

115-
Use the Skill tool: `init-agents-md`. After it completes, return to this skill and continue with the next finding.
147+
## Build & Test Commands
148+
- Build: `<command>`
149+
- Test all: `<command>`
150+
- Test single file: `<command>`
151+
- Lint: `<command>`
152+
- Type check: `<command>`
116153

117-
### Applying fixes (auto and review modes)
154+
## Key Conventions
155+
<from scan + questions/rhdh_context>
118156

119-
Use the `remediation.steps`, `remediation.commands`, and `remediation.examples` from the JSON as the implementation guide. Do not invent steps beyond what the JSON provides.
157+
## Architecture
158+
<from questions/rhdh_context — omit if nothing to say>
120159

121-
## Step 5: Re-run and present results
160+
## PR Conventions
161+
- Agent-assisted commits should include an `Assisted-by: <model>` footer
162+
<from questions>
163+
```
164+
165+
Write `CLAUDE.md` with exactly: `@AGENTS.md`
166+
167+
Omit any section — including its header — where there is nothing to say. Do not invent content.
168+
169+
### Applying other fixes (both modes)
122170

123-
Re-run the assessment (shell variables from Step 2 do not persist — create a new temp dir):
171+
Use `remediation.steps`, `remediation.commands`, and `remediation.examples` from the JSON. Do not invent steps beyond what the JSON provides.
172+
173+
## Step 6: Re-run and present results
124174

125175
```bash
126176
REPORT_DIR=$(mktemp -d) # on Windows: use %TEMP% or Python tempfile
127177
uvx --from git+https://github.com/ambient-code/agentready agentready -- assess \
128178
-o "$REPORT_DIR" \
129-
. # or user-provided path
179+
<path>
130180
```
131181

132-
Include `-c <config-path>` if the user provided a config file.
133-
134182
Show before/after:
135183

136184
```
@@ -140,16 +188,37 @@ After: <new_score>/100 (<new_certification_level>)
140188
Remaining failures: <N> findings
141189
```
142190

143-
If there are remaining failures (including deferred ones), ask:
191+
If remaining failures (including deferred), ask: "Would you like to continue addressing the remaining findings?" If yes, repeat Step 5.
192+
193+
## Batch mode
194+
195+
When the user selects batch assessment:
144196

145-
> "Would you like to continue addressing the remaining findings?"
197+
1. Ask: "What directory are your RHDH repos cloned into? (e.g. `~/git`)"
198+
2. Find subdirectories that are git repos:
199+
200+
```bash
201+
find <dir> -maxdepth 2 -name ".git" -type d | sed 's|/.git||'
202+
```
203+
204+
3. For each, check if the remote URL matches a repo in `rhdh-repos.md`. Assess only matching repos.
205+
4. Run the assessment on each matched repo (Step 3) and collect results.
206+
5. Present a summary table:
207+
208+
```
209+
Repo Score Level Failing
210+
rhdh 72/100 Bronze 4
211+
rhdh-operator 45/100 Needs Improvement 11
212+
rhdh-plugins 88/100 Silver 1
213+
```
146214

147-
If yes, repeat Step 4 with the remaining failures. If no, stop.
215+
6. Ask: "Would you like to address findings for any of these repos?" If yes, the user picks one — run Step 3 (assessment) on that repo to get fresh findings, then run Steps 4–6 for it.
148216

149217
## Gotchas
150218

151-
- The first `uvx` run fetches and builds agentready from GitHub — this can take 30–60 seconds. Subsequent runs use the cache and are much faster. If the fetch fails (network error, build error), tell the user and stop — do not attempt to proceed without a valid report.
219+
- The first `uvx` run fetches and builds agentready from GitHub — this can take 30–60 seconds. Subsequent runs use the cache. If the fetch fails, stop — do not proceed without a valid report.
152220
- Do not output the report to the repository directory — use the temp dir to avoid polluting the working tree.
153221
- `not_applicable` findings reflect the detected language stack; do not mention them unless the user asks.
154-
- Deferred findings are not lost — they surface again after the re-run.
155-
- Never invent rationale for ADRs, design docs, or architecture decisions — these require human context the agent doesn't have. In auto mode, skip them. In review mode, ask the user for the rationale before writing anything.
222+
- Deferred findings surface again after the re-run.
223+
- Never invent rationale for ADRs or design docs. In auto mode, skip them. In review mode, ask for rationale before writing anything.
224+
- In batch mode, only assess repos whose remote URL matches `rhdh-repos.md` — do not assess unrelated repos in the same directory.

0 commit comments

Comments
 (0)