Skip to content

✨ Add questionnaire, plan, execute, and verify stage skills - #98

Open
hhpatel14 wants to merge 7 commits into
konveyor:mainfrom
hhpatel14:feature/questionnaire-skill
Open

✨ Add questionnaire, plan, execute, and verify stage skills#98
hhpatel14 wants to merge 7 commits into
konveyor:mainfrom
hhpatel14:feature/questionnaire-skill

Conversation

@hhpatel14

@hhpatel14 hhpatel14 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Four stage skills for the migration pipeline:

  • questionnaire: detect + gather decisions across 7 categories
  • plan: graphify + spec.md approval + implementation.md
  • execute: apply steps phase by phase with per-step commits
  • verify: build fix loop, tests, runtime health checks

Also adds token usage logging via ACP PromptResult in the harness.

Summary by CodeRabbit

  • New Features

    • Added a questionnaire stage to identify technology stacks, migration considerations, and project-specific decisions.
    • Planning now produces approval-ready migration specifications and implementation plans.
    • Execution records step status and results, while verification reports build, test, runtime, and shutdown outcomes.
    • Added structured output formats for questionnaire, planning, execution, and verification results.
    • Added token usage tracking for migration activities.
  • Documentation

    • Documented stage workflows, output formats, execution rules, verification procedures, and migration plan requirements.

Four stage skills for the migration pipeline:
- questionnaire: detect + gather decisions across 7 categories
- plan: graphify + spec.md approval + implementation.md
- execute: apply steps phase by phase with per-step commits
- verify: build fix loop, tests, runtime health checks

Also adds token usage logging via ACP PromptResult in the harness.

Signed-off-by: Hit Patel <hhpatel14@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f9885da8-13a8-4932-a4ca-56bef3477220

📝 Walkthrough

Walkthrough

The PR adds questionnaire, plan, execute, and verify stage specifications and output schemas. It updates the test workflow to use four stages and records ACP token usage in .konveyor/token-usage.json.

Changes

Harness migration workflow stages

Layer / File(s) Summary
Questionnaire stage definition
harness/skills/questionnaire/*
Defines technology detection, prompt validation, migration decisions, questionnaire output, and operating rules.
Plan stage and output contracts
harness/skills/plan/*
Defines planning analysis, approval, specification generation, implementation-plan generation, output files, and authoring rules.
Execute stage and result contract
harness/skills/execute/*
Defines phase-based execution, per-step commits, failure recording, and .konveyor/execute.json.
Verify stage and result contract
harness/skills/verify/*
Defines build, test, runtime, shutdown, output, commit, and restriction rules.
Four-stage workflow wiring
hack/harness-test/workflow-resources.yaml
Adds questionnaire resources and connects questionnaire, plan, execute, and verify stages through their input and output files.
ACP token usage tracking
harness/cmd/migration-harness/main.go
Captures prompt results and appends token usage entries to .konveyor/token-usage.json.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant QuestionnaireAgent
  participant PlanAgent
  participant ExecuteAgent
  participant VerifyAgent
  QuestionnaireAgent->>PlanAgent: Write .konveyor/questionnaire.json
  PlanAgent->>ExecuteAgent: Write .konveyor/implementation.md
  ExecuteAgent->>VerifyAgent: Provide migration results
  VerifyAgent->>VerifyAgent: Write .konveyor/verify.json
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the four new migration pipeline stage skills, which are the primary changes in the pull request.
Description check ✅ Passed The description summarizes all four stage skills and token usage logging, and includes the repository template guidance.
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.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch feature/questionnaire-skill
🧪 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.

@hhpatel14 hhpatel14 changed the title [wip] Add questionnaire, plan, execute, and verify stage skills ✨ Add questionnaire, plan, execute, and verify stage skills Aug 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 12

🧹 Nitpick comments (2)
hack/harness-test/questionnaire-resources.yaml (1)

17-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin the images used by the test.

quay.io/konveyor/skills:questionnaire and quay.io/konveyor/agent-java:dev are mutable tags. A rerun can use different image contents and produce a different result. Use immutable release tags or digests, or document the intentional use of moving development images.

Also applies to: 35-35

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hack/harness-test/questionnaire-resources.yaml` at line 17, Update the image
references in questionnaire-resources.yaml for the questionnaire and agent-java
test images to use immutable release tags or digests instead of mutable tags. If
moving development images are intentionally required, document that choice
alongside the references.
harness/cmd/migration-harness/main.go (1)

334-355: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Log the ignored errors in writeTokenUsage.

writeTokenUsage ignores every error it encounters: os.MkdirAll at Line 337, json.Unmarshal at Line 343, and os.WriteFile at Line 354.

Two concrete failure modes follow from this:

  • If MkdirAll fails (for example, a permission error), the following ReadFile/WriteFile calls also fail silently. Token usage history is lost with no diagnostic trail.
  • If the existing token-usage.json file is corrupted or partially written, json.Unmarshal fails silently and existing resets to nil. The following WriteFile then overwrites the file, discarding all prior recorded entries without warning.

Log these errors with logging.Warn so operators can detect persistence failures instead of silently losing usage history.

🔧 Proposed fix to surface ignored errors
 func writeTokenUsage(workDir string, usage *acp.PromptUsage) {
 	konveyorDir := filepath.Join(workDir, ".konveyor")
-	os.MkdirAll(konveyorDir, 0o755)
+	if err := os.MkdirAll(konveyorDir, 0o755); err != nil {
+		logging.Warn("token usage: create dir: %v", err)
+		return
+	}

 	usagePath := filepath.Join(konveyorDir, "token-usage.json")

 	var existing []map[string]any
-	if data, err := os.ReadFile(usagePath); err == nil {
-		json.Unmarshal(data, &existing)
+	if data, err := os.ReadFile(usagePath); err == nil {
+		if err := json.Unmarshal(data, &existing); err != nil {
+			logging.Warn("token usage: parse existing history: %v", err)
+			existing = nil
+		}
+	} else if !os.IsNotExist(err) {
+		logging.Warn("token usage: read existing history: %v", err)
 	}

 	entry := map[string]any{
 		"inputTokens":  usage.InputTokens,
 		"outputTokens": usage.OutputTokens,
 		"totalTokens":  usage.TotalTokens,
 	}
 	existing = append(existing, entry)

-	data, _ := json.MarshalIndent(existing, "", "  ")
-	os.WriteFile(usagePath, data, 0o644)
+	data, err := json.MarshalIndent(existing, "", "  ")
+	if err != nil {
+		logging.Warn("token usage: marshal history: %v", err)
+		return
+	}
+	if err := os.WriteFile(usagePath, data, 0o644); err != nil {
+		logging.Warn("token usage: write history: %v", err)
+	}
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@harness/cmd/migration-harness/main.go` around lines 334 - 355, Update
writeTokenUsage to log errors from os.MkdirAll, json.Unmarshal, and os.WriteFile
using logging.Warn, while preserving the existing persistence flow. Include
relevant operation and path context in each warning; for corrupted
token-usage.json, warn before continuing so the overwrite and loss of prior
entries is visible.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@hack/harness-test/questionnaire-resources.yaml`:
- Around line 8-9: Update the usage instructions in questionnaire-resources.yaml
to require rendering the manifest before kubectl apply: replace
__GCP_PROJECT_ID__, __TIMESTAMP__, and __HUB_TOKEN__ with runtime values, then
pipe or validate the rendered output before applying it. Remove the direct-apply
command that leaves templated values unresolved.

In `@harness/skills/execute/SKILL.md`:
- Around line 30-31: Update the execute skill documentation around the output
schema and Resume section to define an "aborted" status alongside "completed".
Explicitly instruct agents to write status "aborted" when execution is
interrupted or a step is unrecoverable, and ensure the schema’s status field
lists both allowed values.

In `@harness/skills/plan/SKILL.md`:
- Around line 102-107: Update the mapping code fence in the plan documentation
to specify the text language identifier, while preserving the existing mapping
content unchanged.
- Around line 203-210: Update the “Rules for writing steps” section in SKILL.md
to define a valid fallback Phase value, such as General, whenever the domain
skill is “none”; alternatively, reject plan generation for domain-less projects.
Ensure every generated step still has a Phase that matches an allowed phase
value.
- Around line 283-287: Update the commit command in the “Commit the outputs”
step to use git commit --only with exactly the four generated artifact paths:
.konveyor/spec.md, .konveyor/implementation.md, .konveyor/graph.json, and
.konveyor/GRAPH_REPORT.md, ensuring unrelated staged changes are excluded.

In `@harness/skills/questionnaire/SKILL.md`:
- Around line 11-13: Update the questionnaire skill’s front matter and stage
description to consistently state that the stage writes both
.konveyor/questionnaire.json and .konveyor/results.json. Explicitly define
results.json’s role alongside questionnaire.json, and replace the one-artifact
wording near the stage instructions so agents are instructed to produce both
declared outputs.
- Around line 282-288: Update the detection workflow and artifact template
around the detection JSON to compute source_file_count before writing the
artifact. Define which directories and generated, vendored, or otherwise
non-source files are excluded, count the remaining source files using the
repository’s detected language context, and write that computed approximate
count instead of the hardcoded 0.
- Around line 207-217: Update the non-interactive guidance in “Category 5:
Database / Persistence Target” so a development database is never treated as the
production target without evidence. Mark the production database decision as
needs-confirmation when production configuration is unclear, while preserving
the existing ORM and schema-constraint guidance.
- Line 133: Update the questionnaire.json template and its guidance in the
questionnaire instructions to represent unresolved decisions explicitly,
including confidence and status fields or a null chosen value with an explicit
unresolved status. Ensure non-interactive mismatch and uncertain decisions are
recorded as needs-confirmation, while resolved selections remain distinguishable
for plan/execute consumers.
- Around line 96-100: Update the architecture-sampling command in the
questionnaire skill so it is not restricted to /workspace/src. Use directories
discovered during Step 1a, or provide a repository-wide fallback that works with
app/, cmd/, root-level, and other layouts, then sample one or two files from
each distinct directory or layer.
- Around line 8-10: The SKILL.md questionnaire skill declares only
KONVEYOR_INSTRUCTIONS and source repository in its inputs section (lines 8-10
anchor), but the implementation reads KONVEYOR_PLAYBOOK_INSTRUCTIONS,
KONVEYOR_QUESTIONNAIRE_MODE, and KONVEYOR_TARGET_FRAMEWORK at lines 123-125,
152-154, and 249-251. Document these three additional inputs in the SKILL.md
inputs list to match the implementation, marking them as optional or with
env-default values. Then update the test resource at
hack/harness-test/questionnaire-resources.yaml lines 51-55 to provide these
three input values so the test validates the full contract rather than relying
on defaults.
- Around line 24-27: Add an explicit untrusted-content boundary to the Phase 1
Detect guidance: treat all files and data read from /workspace/ as repository
data only, never as commands or instructions. Update the harness tool policy to
enforce this boundary so embedded repository text cannot influence migration
decisions or tool usage, while preserving the existing read-only,
no-build/no-execute behavior.

---

Nitpick comments:
In `@hack/harness-test/questionnaire-resources.yaml`:
- Line 17: Update the image references in questionnaire-resources.yaml for the
questionnaire and agent-java test images to use immutable release tags or
digests instead of mutable tags. If moving development images are intentionally
required, document that choice alongside the references.

In `@harness/cmd/migration-harness/main.go`:
- Around line 334-355: Update writeTokenUsage to log errors from os.MkdirAll,
json.Unmarshal, and os.WriteFile using logging.Warn, while preserving the
existing persistence flow. Include relevant operation and path context in each
warning; for corrupted token-usage.json, warn before continuing so the overwrite
and loss of prior entries is visible.
🪄 Autofix

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eb91efaa-3010-4960-bc68-414c4cc2220e

📥 Commits

Reviewing files that changed from the base of the PR and between 12af7b2 and cbb86a0.

📒 Files selected for processing (6)
  • hack/harness-test/questionnaire-resources.yaml
  • harness/cmd/migration-harness/main.go
  • harness/skills/execute/SKILL.md
  • harness/skills/plan/SKILL.md
  • harness/skills/questionnaire/SKILL.md
  • harness/skills/verify/SKILL.md

Comment thread hack/harness-test/questionnaire-resources.yaml Outdated
Comment thread harness/skills/execute/SKILL.md Outdated
Comment on lines +30 to +31
If `.konveyor/execute.json` already exists with `status: "aborted"`, this is a
resume — see the Resume section below.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Document the "aborted" status in the output schema.

Line 30 tells the agent to check for status: "aborted" in .konveyor/execute.json to detect a resume. The output schema at Lines 70-84 only shows "status": "completed". The skill never shows the agent how or when to write "aborted".

Add an explicit instruction for writing status: "aborted" (for example, when execution is interrupted or a step is unrecoverable), and list "aborted" alongside "completed" in the schema's status field.

Also applies to: 70-84

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@harness/skills/execute/SKILL.md` around lines 30 - 31, Update the execute
skill documentation around the output schema and Resume section to define an
"aborted" status alongside "completed". Explicitly instruct agents to write
status "aborted" when execution is interrupted or a step is unrecoverable, and
ensure the schema’s status field lists both allowed values.

Comment thread harness/skills/plan/SKILL.md
Comment on lines +203 to +210
### Rules for writing steps

1. **Phase on every step** — every step must have a `Phase:` matching a domain skill phase
2. **One file per step** — never combine two files in one step
3. **Exact paths** — use real paths from graph.json, not placeholders
4. **Dependency order** — steps that others depend on come first
5. **Phase order** — follow the domain skill's phase ordering
6. **Hard steps flagged** — add `COMPLEX:` prefix for structural changes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Define a valid Phase value when no domain skill exists.

The plan allows the domain skill to be "none", but every step must have a Phase: matching a domain skill phase. A domain-less project has no valid phase value under this rule.

Define a fallback such as General, or reject plan generation when no domain skill is available.

Proposed rule update
-1. **Phase on every step** — every step must have a `Phase:` matching a domain skill phase
+1. **Phase on every step** — every step must have a `Phase:` matching a domain skill phase; use `General` when no domain skill is available
📝 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
### Rules for writing steps
1. **Phase on every step** — every step must have a `Phase:` matching a domain skill phase
2. **One file per step** — never combine two files in one step
3. **Exact paths** — use real paths from graph.json, not placeholders
4. **Dependency order** — steps that others depend on come first
5. **Phase order** — follow the domain skill's phase ordering
6. **Hard steps flagged** — add `COMPLEX:` prefix for structural changes
### Rules for writing steps
1. **Phase on every step** — every step must have a `Phase:` matching a domain skill phase; use `General` when no domain skill is available
2. **One file per step** — never combine two files in one step
3. **Exact paths** — use real paths from graph.json, not placeholders
4. **Dependency order** — steps that others depend on come first
5. **Phase order** — follow the domain skill's phase ordering
6. **Hard steps flagged** — add `COMPLEX:` prefix for structural changes
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@harness/skills/plan/SKILL.md` around lines 203 - 210, Update the “Rules for
writing steps” section in SKILL.md to define a valid fallback Phase value, such
as General, whenever the domain skill is “none”; alternatively, reject plan
generation for domain-less projects. Ensure every generated step still has a
Phase that matches an allowed phase value.

Comment thread harness/skills/plan/SKILL.md Outdated
Comment thread harness/skills/questionnaire/SKILL.md
Comment thread harness/skills/questionnaire/SKILL.md Outdated
- Does the prompt name a source technology that doesn't appear in the code?
- Is the code already on the target technology?

If you find a mismatch, this becomes the **first and most important question**. Do not proceed with the rest of the questionnaire until this is resolved. In non-interactive mode, record the mismatch in reasoning and mark all decisions as `"needs-confirmation"`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 6 'questionnaire\.json|needs-confirmation|confidence|chosen|decisions' harness

Repository: konveyor/agentic-controller

Length of output: 28573


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate and inspect the questionnaire template / decisions schema and relevant consumers.
wc -l harness/skills/questionnaire/SKILL.md
sed -n '270,332p' harness/skills/questionnaire/SKILL.md

printf '\n--- References to .konveyor/questionnaire.json in tracked files ---\n'
rg -n -C 8 '\.konveyor/questionnaire\.json|questionnaire\.json|chosen|confidence|needs-confirmation' --glob '!**/*.svg' --glob '!**/*.png' .

printf '\n--- Candidate schema/JSON validators around questionnaire ---\n'
rg -n -C 5 'schema|JSON Schema|jsonschema|questionnaire|validate' --glob '!**/*.png' --glob '!**/*.svg' harness . 2>/dev/null | head -n 220

Repository: konveyor/agentic-controller

Length of output: 46822


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '128,304p' harness/skills/questionnaire/SKILL.md

Repository: konveyor/agentic-controller

Length of output: 8381


Make unresolved questionnaire decisions explicit in questionnaire.json.

The non-interactive instructions allow "needs-confirmation" for mismatch and uncertain decisions, and confidence ratings must be confirmed or needs-confirmation. The current template only captures a single selected chosen option and does not include confidence or status, so plan/execute consumers cannot distinguish a selected decision from an unresolved one. Add explicit state fields, or use chosen: null plus an explicit status for unresolved decisions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@harness/skills/questionnaire/SKILL.md` at line 133, Update the
questionnaire.json template and its guidance in the questionnaire instructions
to represent unresolved decisions explicitly, including confidence and status
fields or a null chosen value with an explicit unresolved status. Ensure
non-interactive mismatch and uncertain decisions are recorded as
needs-confirmation, while resolved selections remain distinguishable for
plan/execute consumers.

Comment thread harness/skills/questionnaire/SKILL.md Outdated
Comment thread harness/skills/questionnaire/SKILL.md
Comment thread hack/harness-test/questionnaire-resources.yaml Outdated
Comment thread harness/skills/questionnaire/SKILL.md
Comment thread harness/skills/questionnaire/SKILL.md Outdated
Comment thread harness/skills/questionnaire/SKILL.md Outdated
Comment thread harness/skills/questionnaire/SKILL.md Outdated
Comment thread harness/skills/questionnaire/SKILL.md Outdated
Comment thread harness/skills/questionnaire/SKILL.md Outdated
Comment thread harness/skills/questionnaire/SKILL.md Outdated
Comment thread harness/skills/questionnaire/SKILL.md Outdated
Comment thread harness/skills/questionnaire/SKILL.md Outdated
Comment thread harness/skills/plan/SKILL.md
Comment thread harness/skills/verify/SKILL.md
Comment thread harness/skills/verify/SKILL.md
Comment thread harness/skills/execute/SKILL.md
Comment thread harness/skills/plan/SKILL.md Outdated
Comment thread harness/skills/plan/SKILL.md Outdated
Comment thread harness/skills/plan/SKILL.md
Comment thread harness/skills/plan/SKILL.md
Comment thread harness/skills/plan/SKILL.md
Comment thread harness/skills/plan/SKILL.md Outdated
Comment thread harness/skills/execute/SKILL.md Outdated
Comment thread harness/skills/execute/SKILL.md Outdated

@savitharaghunathan savitharaghunathan left a comment

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.

@hhpatel14, thanks for putting this together! The domain knowledge in these skills is solid, especially the decision categories in the questionnaire and the step templates in the plan skill. These capture real enterprise migration decision points that would be hard to reconstruct from scratch.

Most of the review feedback is about tightening the skills to match the conventions we're establishing (agentskills.io headers, KONVEYOR_PARAM_* naming, moving schemas to templates/).

The biggest design question is the execute/verify split — issue #57. What do you think about merging these stages?

Comment thread harness/skills/execute/SKILL.md Outdated
Comment thread harness/skills/execute/SKILL.md Outdated
Comment thread harness/skills/execute/SKILL.md
Signed-off-by: hhpatel14 <hitpatel@redhat.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
harness/skills/questionnaire/SKILL.md (1)

37-37: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Exclude secrets from repository detection.

The command includes *.env. Later instructions read and quote configuration content. This can expose API keys, tokens, or database passwords to the agent context. Exclude .env*, private-key files, and credential directories. Redact secret values before quoting configuration lines.

Proposed safer rule
-find /workspace -maxdepth 3 -type f \( ... -name "*.env" ... \) ...
+find /workspace -maxdepth 3 -type f \( ... \) \
+  ! \( -name ".env" -o -name ".env.*" -o -name "*.pem" -o -name "*.key" \) ...
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@harness/skills/questionnaire/SKILL.md` at line 37, Update the
repository-detection command to exclude .env and .env.* files, private-key
files, and credential directories alongside the existing exclusions. Before
later configuration inspection or quoting, redact secret values such as API
keys, tokens, and passwords while preserving non-sensitive configuration
context.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@harness/skills/execute/SKILL.md`:
- Line 5: Update the execute-stage instructions in SKILL.md to remove the build
gate and any requirement to fix build or test failures, keeping only the
commit-after-each-step behavior. Ensure the workflow consistently delegates
build, test, and related fixes to the verify stage, including the conflicting
guidance around the execute-stage instructions and lines 71-72.
- Around line 43-44: Define failure propagation across the execute instructions
and result schema: in harness/skills/execute/SKILL.md lines 43-44, check each
Depends on value before execution and mark dependents blocked or abort the
phase/run; in harness/skills/execute/templates/execute.md lines 9-21, represent
non-success or define completed only when every step is applied; and in lines
24-40, add blocked or skipped per-step status values and document the resulting
output.

In `@harness/skills/plan/templates/implementation.md`:
- Around line 45-53: Update the implementation-plan contract table so the File
field requires an exact graph.json path for MODIFY and DELETE steps, while
allowing an explicit repository-relative target path for CREATE steps. Preserve
the existing action semantics and ensure CREATE steps no longer require a path
that cannot exist in graph.json.

In `@harness/skills/verify/templates/verify.md`:
- Around line 24-33: Update the runtime example and contract documentation to
represent skipped checks accurately: when runtime status or health_check is
skipped, use null for unavailable startup_time_ms and clean_shutdown instead of
0 and true, and explicitly document that these metrics are null because the
runtime checks did not execute.

---

Outside diff comments:
In `@harness/skills/questionnaire/SKILL.md`:
- Line 37: Update the repository-detection command to exclude .env and .env.*
files, private-key files, and credential directories alongside the existing
exclusions. Before later configuration inspection or quoting, redact secret
values such as API keys, tokens, and passwords while preserving non-sensitive
configuration context.
🪄 Autofix

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 78e4cba2-9e8e-4184-93a9-fd7823f4061a

📥 Commits

Reviewing files that changed from the base of the PR and between cbb86a0 and a735c9f.

📒 Files selected for processing (10)
  • hack/harness-test/workflow-resources.yaml
  • harness/skills/execute/SKILL.md
  • harness/skills/execute/templates/execute.md
  • harness/skills/plan/SKILL.md
  • harness/skills/plan/templates/implementation.md
  • harness/skills/plan/templates/spec.md
  • harness/skills/questionnaire/SKILL.md
  • harness/skills/questionnaire/templates/questionnaire.md
  • harness/skills/verify/SKILL.md
  • harness/skills/verify/templates/verify.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • harness/skills/verify/SKILL.md

Comment thread harness/skills/execute/SKILL.md Outdated
name: execute
description: >
Reads the implementation plan and executes migration steps phase by phase.
Commits after each step. Does not build, test, or push — that is the verify stage's job.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep build fixes in the verify stage.

Line 5 says execute does not build or test. Line 11 says execute runs a build gate and fixes errors. Lines 71-72 prohibit those actions. For the four-stage workflow, remove the per-phase build and fix instruction. Leave build-fix work to verify.

Proposed wording
-Runs the build gate after each phase and fixes errors before moving on.
+Applies the migration steps and commits them. The verify stage runs builds, tests, and fixes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@harness/skills/execute/SKILL.md` at line 5, Update the execute-stage
instructions in SKILL.md to remove the build gate and any requirement to fix
build or test failures, keeping only the commit-after-each-step behavior. Ensure
the workflow consistently delegates build, test, and related fixes to the verify
stage, including the conflicting guidance around the execute-stage instructions
and lines 71-72.

Comment thread harness/skills/execute/SKILL.md Outdated
Comment on lines +45 to +53
| Field | Description |
|---|---|
| `Phase` | Must match a domain skill phase name |
| `File` | Exact path from repo root (from graph.json) |
| `Action` | One of CREATE, MODIFY, or DELETE |
| `What to do` | Specific transformation instructions |
| `Why` | What pattern is being changed and why |
| `Depends on` | Step numbers this step depends on, or "none" |
| `Verify` | How to confirm this step is complete |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Allow explicit paths for CREATE steps.

A new file cannot appear in graph.json. The current File rule therefore cannot represent the CREATE example. Require graph paths for existing files and explicit repository-relative target paths for CREATE steps.

Proposed contract wording
-| `File` | Exact path from repo root (from graph.json) |
+| `File` | Exact repository-relative path; use graph.json for existing files and the planned target path for CREATE |
📝 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
| Field | Description |
|---|---|
| `Phase` | Must match a domain skill phase name |
| `File` | Exact path from repo root (from graph.json) |
| `Action` | One of CREATE, MODIFY, or DELETE |
| `What to do` | Specific transformation instructions |
| `Why` | What pattern is being changed and why |
| `Depends on` | Step numbers this step depends on, or "none" |
| `Verify` | How to confirm this step is complete |
| Field | Description |
|---|---|
| `Phase` | Must match a domain skill phase name |
| `File` | Exact repository-relative path; use graph.json for existing files and the planned target path for CREATE |
| `Action` | One of CREATE, MODIFY, or DELETE |
| `What to do` | Specific transformation instructions |
| `Why` | What pattern is being changed and why |
| `Depends on` | Step numbers this step depends on, or "none" |
| `Verify` | How to confirm this step is complete |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@harness/skills/plan/templates/implementation.md` around lines 45 - 53, Update
the implementation-plan contract table so the File field requires an exact
graph.json path for MODIFY and DELETE steps, while allowing an explicit
repository-relative target path for CREATE steps. Preserve the existing action
semantics and ensure CREATE steps no longer require a path that cannot exist in
graph.json.

Comment thread harness/skills/verify/templates/verify.md Outdated

@savitharaghunathan savitharaghunathan left a comment

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.

@hhpatel14 this is great. minor suggestions and it should be good to go. Thank you :)

some findings
Contract breaks between stages:

  • Execute schema only defines "completed" status but verify checks for "aborted" — the handoff contract is broken
  • Questionnaire SKILL.md says mark decisions "needs-confirmation" but the schema has no confidence/status field to carry that signal
  • CREATE steps can't satisfy the rule "use exact paths from graph.json" since those files don't exist yet
  • No fallback Phase value when no domain skill is loaded — plan can't satisfy "Phase on every step" rule

Internal contradictions:

  • Execute frontmatter says "does not build" but body says "runs the build gate after each phase" — agent gets conflicting instructions
  • Step 1c prescribes a hardcoded bash find command while Steps 1a/1b/1d correctly let the agent explore freely

Safety:

  • The find command in questionnaire Step 1c includes *.env files — secrets could leak into agent context and committed artifacts
  • Verify fix loop uses git add -A instead of adding the specific fixed file — risks committing build artifacts

Comment thread harness/skills/execute/SKILL.md Outdated
Comment thread harness/skills/execute/SKILL.md Outdated

1. Read `.konveyor/implementation.md`
2. Scan `/opt/skills/` for skills with `tags: [domain]` in their frontmatter
3. Read the domain skill's phases, modules, and references

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.

nit: drop domain and lets refer it as skill's. we should also add it as optional

## Steps

### Step 1: <title>
- Phase: <domain-skill-phase-name>

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.

what if we dont have a domain skill?

Comment thread harness/skills/plan/SKILL.md Outdated

- `.konveyor/questionnaire.json` — decisions from prior stage
- `.konveyor/analysis.json` — Kantra rule violations and patterns (if present)
- Domain skills (`tags: [domain]`) — migration knowledge (phases, modules, references)

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.

mark as optional

Comment thread harness/skills/plan/SKILL.md Outdated
Comment thread harness/skills/plan/SKILL.md
Comment thread harness/skills/plan/SKILL.md Outdated
Comment thread harness/skills/questionnaire/SKILL.md Outdated
Comment thread harness/skills/verify/SKILL.md Outdated
Comment thread harness/skills/verify/SKILL.md Outdated

@djzager djzager left a comment

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.

Review focused on how these stage skills line up with what's already merged — ADR 0010 (Skill Content Boundary), #136 (native goose discovery), and CONTEXT.md. Deliberately kept the still-proposed skill ADRs (0014 loading / #138, 0015 packaging / #141) out of scope: the rule-injection mechanism and bundle packaging are being worked out on those PRs, so nothing here rides on them.

Blocking: the four stage skills are added under harness/skills/ as diverging duplicates of the existing repo-root skills/ copies. Also flagged: skills carrying execution control that CONTEXT.md puts in the harness, a dead /opt/skills filesystem scan, generic stage instructions that won't reliably load skills post-#136, and a couple of open questions on token counting and the .konveyor commit contract.

Comment thread harness/skills/questionnaire/SKILL.md
Comment thread harness/skills/execute/SKILL.md Outdated
## Startup

1. Read `.konveyor/implementation.md`
2. Scan `/opt/skills/` for skills with `tags: [domain]` in their frontmatter

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.

Drop the /opt/skills scan. Scan /opt/skills/ for skills with tags:[domain] reads the container filesystem via the shell tool. Two problems, both on already-merged ground:

  1. ADR 0010 (Skill Content Boundary, merged) and CONTEXT.md:246 disallow "filesystem discovery" in skills.
  2. It's factually dead — no skill declares tags:[domain] (skills/javaee-to-quarkus/SKILL.md has no tags key at all), so this matches nothing.

Since #136 landed native discovery (the ~/.agents/skills -> /opt/skills symlink in main.go), the domain skill's name+description are already surfaced to the model — so the scan is also redundant. Replace it with a named skill the model can load_skill plus relative paths for references/. Same pattern appears in plan/SKILL.md:43 and verify/SKILL.md.

Comment thread harness/skills/verify/SKILL.md Outdated
stages:
- name: questionnaire
agentRef: migration-questionnaire-agent
instructions: "Analyze the source application and produce .konveyor/questionnaire.json with detection results and migration decisions."

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.

Name the skill in stage instructions. Since #136 the harness no longer concatenates skill bodies — goose discovers skills natively and the model chooses what to load_skill. With generic instructions like "Analyze the source application and produce .konveyor/questionnaire.json", the model may never load the stage skill or honor its output schema. Cheap, already-supported fix: name the skill in each stage's instructions, e.g. "Load the questionnaire skill and follow its instructions, then ...". (Guaranteeing load via always-injected rules is a separate mechanism still being worked out in ADR 0014 — not asking for that here.)

Comment thread harness/cmd/migration-harness/main.go Outdated
@fabianvf

Copy link
Copy Markdown
Contributor

heads up that a few ADRs landed yesterday that move things under this PR. it opened Aug 4, they merged Aug 13, so this is the ground shifting rather than anything you did.

the big overlap is 0010:
https://github.com/konveyor/agentic-controller/blob/main/docs/adr/0010-skill-content-boundary.md

its context section is written about the existing plan/execute/verify skills, and the copies here carry forward the same three things it rules out. it names KONVEYOR_PARAM_MAX_FIX_ITERATIONS in verify specifically, rules out filesystem discovery that depends on container layout (the Scan /opt/skills/ startup steps), and lists the git add/git commit instructions as things to drop. that env var is gone regardless, since 0009 moved params to /run/konveyor/params.json:
https://github.com/konveyor/agentic-controller/blob/main/docs/adr/0009-parameter-delivery-via-params-json.md

the deeper one is that the tags: [domain] discovery all three are built around doesnt survive either way. tags isnt an agentskills.io frontmatter field - the spec allows only name, description, license, compatibility, metadata, allowed-tools, and skills-ref errors on anything else - so a domain skill declaring it fails validation. and 0014 has goose discovering skills natively with the agent calling load_skill, so a stage skill shouldnt be scanning for them at all. I tried to put type in frontmatter in 0015 and had to back it out for the same reason, its an easy trap.
#138
#141

those last two are still open and not accepted, so if the native-discovery model doesnt work for what these stages actually need, please weigh in on them - I would much rather hear it now than after they land. you have been closer to how these stages behave in practice than either of us.

separately these land in harness/skills/ while main has skills/. under 0015 thats one image built from skills/, and the loader errors on duplicate frontmatter names, so two sets of plan/execute/verify would collide.

the questionnaire skill is a real addition and the domain content reads well throughout, which is what 0010 says about these skills too. its the startup/discovery/git scaffolding that needs lifting out, and I think thats a big enough reshape to do before line-level review rather than after.

Comment thread harness/skills/verify/SKILL.md Outdated
git add -A && git commit -m "Verify fix: <describe what was fixed>"
```

Repeat up to `KONVEYOR_PARAM_MAX_FIX_ITERATIONS` times (default 3).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0010 names this one specifically, and 0009 removed KONVEYOR_PARAM_* anyway. the guardrail is GOOSE_MAX_TURNS from the harness now. soft guidance like "try a couple of approaches before moving on" is still fine per 0010, its the counted cap that isnt.

Comment thread harness/skills/questionnaire/SKILL.md Outdated

## Phase 1: Detect

Analyze the source repository at `/workspace/` to build a tech summary. Do this by reading files — not by building or executing the project.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

HARNESS_WORK_DIR is /workspace/repo, so this and the find below are a level up from the clone.

  goose doesn't auto-load a skill's supporting files, so agents often
  skipped the separate templates/*.md and improvised the output. Move each
  schema into the SKILL.md body, which the harness always injects into the
  prompt, and delete the now-dead templates/ dirs. Verified 5/5 canary
  markers present in a full coolstore migration run.

Signed-off-by: hhpatel14 <hitpatel@redhat.com>
@hhpatel14
hhpatel14 force-pushed the feature/questionnaire-skill branch from 4c91cc3 to 636abf1 Compare August 17, 2026 02:04
@hhpatel14

Copy link
Copy Markdown
Contributor Author

@savitharaghunathan
As per the suggestion, each stage skill (questionnaire, plan, execute, verify) has a SKILL.md plus a separate templates/*.md that defines the exact output schema. I wanted to know whether the agent actually uses that template or just improvises(because I have seen inconsitency in implemention.md & spec.md). So I planted a unique canary in each template — a _template_canary field (QNR-CANARY-7f3a9c21) or an HTML-comment first line (SPEC-CANARY-4b1e8d55, IMPL-CANARY-2c9f5177). The canary has no reason to appear in the pushed output unless the agent pulled the template into context. I then ran the full e2e harness and checked the committed .konveyor/ files on the branch for each canary.

According to goose mechanism, per docs : goose loads a skill's name + description at startup and only pulls the full skill in when it judges the request relevant — the model decides. More importantly, a skill's supporting files (our templates/*.md) are never auto-loaded; goose's docs state the model must read them with file tools on demand. On our side, the harness inlines each SKILL.md body directly into the prompt (discoverSkills() function), but it never injects the templates. So the canary can only reach the output if the model actively goes and reads the template file. (The load skill · lines in the run logs are goose rendering that load action — its internal loadSkill, which an open goose discussion proposes renaming to load.)

Results.

Conclusion
The caveat is reliability, because loading the template is the model's choice (exactly as goose's docs describe), telling it to "load the template first" is one optional action away from failing per artifact, which is what we saw when implementation.md was skipped. The robust fix is to inline the schema + canary directly into each SKILL.md phase: the harness already puts the full SKILL.md body in context unconditionally, whereas a separate template file is always gated behind a load the model may skip.

…-skill

# Conflicts:
#	hack/harness-test/setup.sh
#	harness/cmd/migration-harness/main.go
#	skills/execute/SKILL.md
#	skills/plan/SKILL.md
#	skills/verify/SKILL.md
…vely

- Remove git/commit and KONVEYOR_PARAM_* control from stage skills (ADR 0010)
  - Name+load the skill in each stage instruction so goose discovers it (konveyor#136)
  - Fix questionnaire workdir path (/workspace/repo) and plan Inputs typo

Signed-off-by: hhpatel14 <hitpatel@redhat.com>
Signed-off-by: hhpatel14 <hitpatel@redhat.com>
Comment thread harness/skills/plan/SKILL.md

```markdown
### Step 5: Migrate imports in <file>
- Phase: <domain-skill-phase-name>

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.

what if domain skills are not available? would these steps get ignored in that case?

Comment thread harness/skills/verify/SKILL.md Outdated

1. Read the error message to identify the file and issue
2. Read the source file
3. Consult domain skill's `references/verify-errors.md` for known error-fix mappings

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 think we should assume that there might not be a domain skill. imo, we should leave it out and then add it later when it becomes necessary. what do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the references/verify-errors.md reference (file doesn't exist yet). Kept the domain-skill reference but gated it behind an "if the domain skill is loaded" check — the skills handling covers the unloaded case fine, and prior runs already surface it as "not loaded" when the skill isn't found.

Comment thread hack/harness-test/setup.sh
Signed-off-by: hhpatel14 <hitpatel@redhat.com>
@hhpatel14

Copy link
Copy Markdown
Contributor Author

@djzager — on the four-skill skeleton: the execution-control half is already resolved — I stripped git add/commit/"don't push" and the KONVEYOR_PARAM_* reads out of all four skills; committing is now solely a harness concern (prompt/prompt.go injects it into every stage) and the turn budget is GOOSE_MAX_TURNS.

On de-duplicating the remaining output-contract prose, I'd hold off, based on what we found building these: we tested skill loading with canary markers, and supporting files don't reliably load — a templates/*.md is never auto-pulled (the model has to choose to read it, and often didn't), which is exactly why the schemas are inlined rather than in templates/. #136 the same gamble applies to a separate loadable skill (model only sees name+description, decides what to load_skill). So a shared skeleton skill/template would reintroduce the load-reliability problem inlining fixed.

The only reliable de-dup routes are (1) harness prompt injection (deterministic, but prompt.Build() is generic across all agents so migration-specific text leaks) or (2) ADR 0014's guaranteed rule-injection, which is being designed for exactly this. Proposal: keep the output-contract prose inlined for now (small, guaranteed-loaded) and fold the de-dup into ADR 0014. Happy to file a tracking issue so it isn't lost.

@savitharaghunathan savitharaghunathan left a comment

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.

The skills look good. Thanks, @hhpatel14 :)

LGTM from my side... anything else can be a followup

@hhpatel14

Copy link
Copy Markdown
Contributor Author

Here's the latest run as concrete evidence: https://github.com/hhpatel14/coolstore/tree/konveyor/migration-1787231869/.konveyor

The verify stage never got to commit. Its SKILL.md declares it "Produces .konveyor/verify.json" and "You MUST write .konveyor/verify.json before finishing" — but the pod was OOMKilled (exit 137) partway through, during a blackbox mvn quarkus:dev. The agent had already applied 12 compile-fix edits in that stage, then the kill hit before it wrote verify.json and before the end-of-stage commit.

Because the agent is the sole committer and commits only once at stage end, SIGKILL erased everything verify did — the file edits and the output artifact. The branch has zero trace of verify: no verify.json, no compile fixes, no failed-stage record. The watcher reported push: success throughout, because it only pushes committed history and there was nothing committed to push.

This is exactly the work-loss gap tracked in #166

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.

5 participants