| name | agile-refinement |
| description | Validates planning artifacts and reviews code for quality, consistency, and completeness. Use to lint planning documents (cross-references, dependencies, format) or to review changed code (security, coherence, scope, quality). |
| compatibility | opencode |
| metadata | {"audience":"engineering","workflow":"validation"} |
Refinement
Use this skill to validate planning artifacts and review code quality. It operates in two modes: planning lint and code review.
Initial context received via slash: $ARGUMENTS
If $ARGUMENTS is filled (e.g., file path, branch, "planning", "code"), use as starting point to determine mode.
If empty, ask the user what they want to validate: planning artifacts or code changes.
Language
Write any report output in the user's language. Apply correct grammar and any required diacritics or script-specific characters. If the user's language is unclear, ask before generating output.
Project root
This skill writes artifacts at paths relative to the project root (the repo where the work happens), not the agent's current working directory.
- If invoked from inside the project, use the relative paths shown in this skill.
- If invoked from another directory (e.g., a sibling repo, or when the project lives elsewhere), prepend
<project-root>/ to every artifact path.
- When the project root is ambiguous, confirm with the user via the harness question tool before writing.
Prompting
Follow the project-wide convention in CLAUDE.md / AGENTS.md ("Skill Prompting Conventions"). Use the harness's structured-question tool — AskUserQuestion (Claude Code), ask_user_question (Codex), or question (OpenCode) — for the decision points below. Use free-form text only where a path/name/value cannot be enumerated.
| Decision point | Why structured | Suggested options |
|---|
| Target | Branches the workflow | Planning artifact · Code · Both |
| Depth | Affects review effort | Lint-only · Full review · Security focus |
Free-form prompts (no structured tool):
- File paths to review
- Specific concerns
No-pause mode: if the user has explicitly disabled mid-skill clarification, convert every structured prompt into an entry under Open questions (or equivalent) and proceed without blocking.
Objective
- Validate planning artifacts for consistency, completeness, and correctness
- Review code changes for security, coherence, scope, and quality
- Catch issues before they become problems in execution
- Provide actionable, specific feedback — not generic observations
When to use
- Before starting implementation — lint the planning artifacts
- Before committing code — review the diff
- When opening a pull request — quality gate
- When reviewing AI-generated code — human-equivalent review
- Periodically — check for stale content, broken cross-references, or orphaned artifacts
- When merging or completing an epic — validate all pieces fit together
When NOT to use
- Creating planning artifacts — use
/agile-intake, /agile-epic, /agile-story, /agile-roadmap
- Decomposing work into stories — use
/agile-epic (which now handles decomposition)
- Tracking delivery progress — use
/agile-status
- Planning a sprint — use
/agile-sprint
Mode 1: Planning Lint
Validates planning artifacts against the following checks:
Cross-references
Dependencies
Completeness
Product traceability
Consistency
Format
Scope conflicts
Stale content
Process
- Identify the scope: a single file, an epic folder, or the entire
planning/ tree.
- Read all artifacts in scope.
- Run each check category above.
- Produce an inline report grouped by category with specific issues and locations.
Mode 2: Code Review
Reviews changed code applying the checklist from ~/.agents/rules/code-review.md:
Security
Project Coherence
Over-engineering
Scope
Quality
Completeness
Process
- Identify the scope: branch, files, or working tree changes.
- Read the complete diff before issuing any output.
- Apply each check category.
- Produce an inline report grouped by category.
- Highlight red flags that justify immediate rejection.
Output
This skill does NOT produce a saved artifact. It produces an inline report with:
- Issues grouped by category
- Severity: red flag (reject), warning (fix before proceeding), info (consider)
- Specific file and line references where applicable
- Actionable suggestions for each issue
Rules
- Read everything in scope before producing any output.
- Be specific. "Code looks bad" is not actionable. "Replace
RateLimitError with HttpError on line 42 of src/middleware/rate-limit.ts" is.
- AI code review does not replace human code review. This is an additional gate.
- Planning lint can be run at any time — it's a health check, not a ceremony.
- Never produce vague, generic feedback. Every issue must be verifiable.
Relationship with the flow
flowchart LR
A["/agile-epic"] --> B["/agile-refinement<br>(planning lint)"]
C["/agile-story"] --> D[execution]
D --> E["/agile-refinement<br>(code review)"]
E --> F["/agile-status"]
This skill validates artifacts and code at any point in the flow. For creating planning artifacts, use /agile-epic or /agile-story. For tracking delivery, use /agile-status.