refine-scope

$npx mdskill add Fr-e-d/GAAI-framework/refine-scope

Refines incomplete or ambiguous discovery artefacts using feedback.

  • Solves unclear or missing acceptance criteria in plans, epics, and stories.
  • Depends on discovery action plan, artefacts, memory, and human feedback.
  • Identifies gaps and applies each feedback item to the relevant artefact field.
  • Outputs refined discovery plan and updated artefacts for the agent.

SKILL.md

.github/skills/refine-scopeView on GitHub ↗
---
name: refine-scope
description: Iteratively refine Discovery artefacts (plans, epics, stories) when feedback, ambiguity, or uncertainty is detected. Activate when artefacts are incomplete, acceptance criteria are missing, or human feedback highlights gaps.
license: ELv2
compatibility: Works with any filesystem-based AI coding agent
metadata:
  author: gaai-framework
  version: "1.0"
  category: discovery
  track: discovery
  id: SKILL-REFINE-SCOPE-001
  updated_at: 2026-01-28
  status: stable
inputs:
  - discovery_action_plan
  - contexts/artefacts/**  (partially completed)
  - contexts/memory/**  (selective)
  - human_feedback: numbered list of feedback items provided by the Discovery Agent, sourced from human input in the current session
outputs:
  - refined_discovery_plan
  - refined artefacts
---

# Refine Scope

## Purpose / When to Activate

Activate when:
- Artefacts are ambiguous or incomplete
- Acceptance criteria are missing or unclear
- Human or peer feedback highlights gaps
- New information alters original intent
- Discovery action plan indicates unresolved risks

This skill is **not** for first-draft creation — it deepens clarity and reduces uncertainty in existing artefacts.

---

## Process

1. Load relevant context (artefacts + partial plan + memory)
2. Identify gaps, contradictions, or missing acceptance criteria
3. For each numbered feedback item: (a) identify the target artefact field or section, (b) apply the feedback as a direct modification to that field, (c) record what was changed and why in the refinement log.
4. Adjust scope, acceptance criteria, or artefact structure
5. Produce a refined Discovery plan or refined artefacts
6. Verify that all modified fields still comply with the Quality Checks below. If a field fails, mark it for re-refinement in the next iteration. Do NOT invoke `validate-artefacts` — that is the agent's responsibility after this skill completes.
7. Stop when all feedback items from Step 3 have been applied and all modified fields pass the Quality Checks. If any feedback item cannot be applied without changing product intent, flag it as requiring human escalation.

---

## Outputs

**Written outputs:**
- `contexts/artefacts/` — refined artefacts written back to their original locations

**Inline outputs:**
- `refined_discovery_plan` — returned inline to the invoking agent

```
Refined Discovery Action Plan

Goal:
<clarified objective based on feedback>

Steps:
1. <updated skill step> — improved focus
2. <updated skill step> — adjusted checkpoint

Artefact Updates:
- <Epic ID> — updated outcome wording
- <Story ID> — acceptance criteria strengthened

Validation:
- all gates passed: yes | no
- blockers: <if any>
```

---

## Quality Checks

- Acceptance criteria are present and testable
- Artefact scope is clear and bounded
- Cross-dependencies are explicit
- Risks and assumptions are documented
- All governance rules are satisfied

---

## Non-Goals

This skill must NOT:
- Invent new product direction
- Override human intent
- Generate completely new artefacts unconnected to context
- Bypass governance rules

**It enhances, not replaces, existing outputs. Quality drives clarity — refinement reduces ambiguity before execution.**

More from Fr-e-d/GAAI-framework

SkillDescription
abort-safe-handlerOrchestrator-level Stage 4 entry gate for /gaai:bootstrap. Presents a pre-loop "Skip Q&A entirely" option, delegates to qa-loop-ui when the user proceeds, and returns a unified abort_safe_result with telemetry on every path. Guarantees no partial state on skip or abort.
ambiguity-detectorTakes surface scan results, optional LLM synthesis open-question entries, and optional tree-sitter AST signals to score project ambiguities (1-10). Outputs structured ambiguity_feed for smart-question-generator. Pure heuristic — no LLM calls. Designed for Stage 3.5 of the /gaai:bootstrap pipeline (between LLM synthesis and Q&A).
approach-evaluationResearch industry standards and best practices, identify viable approaches for a given technical or architectural problem, and produce a structured factual comparison against project-specific constraints. Reports options — does not decide.
architecture-extractConvert raw project structure into clear architectural understanding — module boundaries, data flows, service relationships, and architectural patterns. Activate after codebase-scan during Bootstrap.
bootstrap-llm-synthesisConstruct the LLM synthesis prompt from project surface scan + optional tree-sitter context + optional Q&A answers. Call the LLM. Parse and validate the response into 6-8 structured memory entries with clarity tags and source traceability. Used as Stage 3 of the /gaai:bootstrap pipeline.
bootstrap-memory-ingest-cloudWrite structured memory entries to the Cloud workspace via gaai_memory.store MCP tool with source='bootstrap'. Loops over entries from bootstrap-llm-synthesis, calls the tool per entry, collects success/fail counts. Used as Stage 5 of the /gaai:bootstrap pipeline (Cloud path only).
browser-journey-testValidate user stories by simulating real user journeys in a live browser against deployed application. Activate after implementation to verify actual user experience against acceptance criteria, not just code logic.
build-agents-indexScan all agent and sub-agent definition files in .gaai/core/agents/, extract YAML frontmatter, merge with specialists.registry.yaml, and generate a derived agents-index.yaml at .gaai/core/agents/agents-index.yaml. Activate after adding, modifying, or removing any agent, sub-agent, or specialist entry.
build-skills-indexScan SKILL.md files in .gaai/core/skills/ and .gaai/project/skills/, extract YAML frontmatter, and regenerate separate skills indices for each layer. Core index ships with the OSS framework; project index is project-specific.
ci-watch-and-fixWatch GitHub Actions CI after PR creation, detect failures, extract logs, apply minimal fixes, and re-push — keeping the delivery session alive until CI resolves or escalating after 3 cycles. Activate immediately after gh pr create and before marking the story done.