repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

extensions/ultra/workflows/feature.json

Raw
{
	"name": "feature",
	"description": "Scout facts, settle and critique a feature plan, gate implementation on readiness, review independently, and report explicit outcomes.",
	"args": { "hint": "<task>", "params": ["task"] },
	"schemas": {
		"Research": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"findings": {
					"type": "string",
					"maxLength": 2400,
					"description": "Observed facts only, not a proposed approach."
				},
				"files": {
					"type": "array",
					"maxItems": 8,
					"items": { "type": "string", "maxLength": 1024 }
				},
				"patterns": {
					"type": "array",
					"maxItems": 8,
					"items": { "type": "string", "maxLength": 1200 }
				},
				"instructions": {
					"type": "array",
					"maxItems": 16,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"evidence_paths": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"blockers": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"gaps": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				}
			},
			"required": [
				"findings",
				"files",
				"patterns",
				"instructions",
				"evidence_paths",
				"blockers",
				"gaps"
			]
		},
		"Plan": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"ready": {
					"type": "boolean",
					"description": "True only for a settled executable plan, with all material constraints resolved and no blockers or gaps."
				},
				"tasks": {
					"type": "array",
					"maxItems": 20,
					"items": { "type": "string", "maxLength": 2000 },
					"description": "Ordered steps with precise file/symbol scope and expected behavior."
				},
				"approach": { "type": "string", "maxLength": 3200 },
				"rationale": { "type": "string", "maxLength": 3200 },
				"resolved_issues": {
					"type": "array",
					"maxItems": 24,
					"items": {
						"type": "object",
						"additionalProperties": false,
						"properties": {
							"source": {
								"type": "string",
								"enum": [
									"research.blockers",
									"research.gaps",
									"plan.blockers",
									"plan.gaps",
									"critique.blocking",
									"critique.gaps"
								]
							},
							"issue": {
								"type": "string",
								"maxLength": 2000,
								"description": "Exact earlier issue text, for mechanical reconciliation by the report."
							},
							"resolution": {
								"type": "string",
								"maxLength": 2400,
								"description": "Settled resolution and supporting evidence paths/locators."
							}
						},
						"required": ["source", "issue", "resolution"]
					}
				},
				"instructions": {
					"type": "array",
					"maxItems": 20,
					"items": { "type": "string", "maxLength": 2000 },
					"description": "Applicable user instructions and repository constraints, with source paths and locators where available."
				},
				"evidence_paths": {
					"type": "array",
					"maxItems": 24,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"completion_checks": {
					"type": "array",
					"maxItems": 16,
					"items": { "type": "string", "maxLength": 2000 }
				},
				"risks": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"blockers": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"gaps": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				}
			},
			"required": [
				"ready",
				"tasks",
				"approach",
				"rationale",
				"resolved_issues",
				"instructions",
				"evidence_paths",
				"completion_checks",
				"risks",
				"blockers",
				"gaps"
			]
		},
		"Critique": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"approved": {
					"type": "boolean",
					"description": "True only if the plan is sound, complete and ready."
				},
				"blocking": {
					"type": "array",
					"maxItems": 16,
					"items": { "type": "string", "maxLength": 2000 }
				},
				"feedback": { "type": "string", "maxLength": 3200 },
				"evidence_paths": {
					"type": "array",
					"maxItems": 16,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"gaps": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				}
			},
			"required": ["approved", "blocking", "feedback", "evidence_paths", "gaps"]
		},
		"Implementation": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"implemented": {
					"type": "boolean",
					"description": "True only when all plan tasks and required checks complete successfully with no blockers or gaps."
				},
				"summary": { "type": "string", "maxLength": 2400 },
				"modified_files": {
					"type": "array",
					"maxItems": 24,
					"items": { "type": "string", "maxLength": 1024 }
				},
				"completed": {
					"type": "array",
					"maxItems": 20,
					"items": { "type": "string", "maxLength": 2000 }
				},
				"checks": {
					"type": "array",
					"maxItems": 16,
					"items": { "type": "string", "maxLength": 2000 }
				},
				"evidence_paths": {
					"type": "array",
					"maxItems": 20,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"blockers": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"gaps": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				}
			},
			"required": [
				"implemented",
				"summary",
				"modified_files",
				"completed",
				"checks",
				"evidence_paths",
				"blockers",
				"gaps"
			]
		},
		"Verdict": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"dimension": { "type": "string", "enum": ["security", "quality"] },
				"passed": { "type": "boolean" },
				"findings": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 2000 }
				},
				"checks": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 2000 }
				},
				"unresolved": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"recommendations": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				}
			},
			"required": [
				"dimension",
				"passed",
				"findings",
				"checks",
				"unresolved",
				"recommendations"
			]
		},
		"FeatureReport": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"status": {
					"type": "string",
					"enum": ["completed", "blocked", "unresolved"]
				},
				"summary": { "type": "string", "maxLength": 2400 },
				"blockers": {
					"type": "array",
					"maxItems": 24,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"unresolved": {
					"type": "array",
					"maxItems": 48,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"checks": {
					"type": "array",
					"maxItems": 40,
					"items": { "type": "string", "maxLength": 2000 }
				},
				"findings": {
					"type": "array",
					"maxItems": 24,
					"items": { "type": "string", "maxLength": 2000 }
				},
				"recommendations": {
					"type": "array",
					"maxItems": 24,
					"items": { "type": "string", "maxLength": 1600 }
				}
			},
			"required": [
				"status",
				"summary",
				"blockers",
				"unresolved",
				"checks",
				"findings",
				"recommendations"
			]
		}
	},
	"phases": [
		{
			"id": "research",
			"kind": "single",
			"step": {
				"summary": "Scout repository facts: {args.task}",
				"prompt": "Scout {args.task} facts only. Read applicable AGENTS.md (cwd, ancestors, inspected subdirs); record user/repo constraints and paths. Inspect entry points plus ≤8 directly matching source/test/config files (instructions excluded); cite observed symbols, conventions and test commands. Do not design, infer constraints, claim exhaustive coverage or edit; planners decide and inspect further. Report ambiguity, inaccessible evidence, overflow and uninspected scope in blockers/gaps. Return Research JSON.",
				"tools": ["read", "grep", "find", "ls", "bash"],
				"model": "small",
				"schema": "Research"
			}
		},
		{
			"id": "plan",
			"kind": "single",
			"step": {
				"summary": "Plan feature: {args.task}",
				"prompt": "Plan {args.task} from scouting {research.results} (failures: {research.failures}); read applicable AGENTS.md. Resolve design/relevance/missing constraints yourself; preserve all instructions with paths. Give ordered file/symbol tasks, behavior, approach/rationale, risks, evidence locators, and pre-code completion checks with contracts, commands and expected outcomes. Wide migration/new route: first task is authorized representative child/tool/schema canary; proof required before expansion. Separate optional work. Reconcile each scouting blocker/gap in resolved_issues using exact source field/text and evidence-backed resolution; unresolved issues remain blockers/gaps. Do not edit or assume. ready=true only executable, settled and gap/blocker-free; otherwise state needed decisions. Report overflow/uninspected scope in gaps. Return Plan JSON.",
				"tools": ["read", "grep", "find", "ls", "bash"],
				"model": "large",
				"schema": "Plan"
			}
		},
		{
			"id": "critique",
			"kind": "single",
			"step": {
				"summary": "Critique feature plan: {args.task}",
				"prompt": "Critique before coding: task {args.task}; plan {plan.results}, failures {plan.failures}; scouting {research.results}. Read applicable AGENTS.md and respect constraints. Independently check evidence, missing instructions, assumptions, acceptance criteria and edge cases. Missing/not-ready plan → approved=false; uncertainty is a gap. Cite evidence; report overflow/uninspected scope in gaps. Do not edit. Return Critique JSON.",
				"tools": ["read", "grep", "find", "ls", "bash"],
				"model": "large",
				"schema": "Critique"
			}
		},
		{
			"id": "refine",
			"kind": "single",
			"step": {
				"summary": "Settle implementation handoff: {args.task}",
				"prompt": "Replace plan for {args.task}, resolving every critique blocker or remaining blocked. Inputs: critique {critique.results} (failures {critique.failures}); plan {plan.results} (failures {plan.failures}); scouting {research.results} (failures {research.failures}). Read applicable AGENTS.md; resolve decisions/missing constraints by inspection, not assumption. Preserve instructions/paths, decisions/rationale, scope, evidence, risks, exact required checks and outcomes in replacement Plan; implementation lacks prior histories. Retain authorized canary-before-expansion and separate optional work. Reconcile every earlier blocker/gap by exact source field/text and evidence-backed resolution; unresolved remain blockers/gaps. Missing evidence/critique or unsettled issue → ready=false. Otherwise ready=true only executable and free of material gaps/blockers. Do not edit; report overflow/uninspected scope in gaps. Return Plan JSON.",
				"tools": ["read", "grep", "find", "ls", "bash"],
				"model": "large",
				"schema": "Plan"
			}
		},
		{
			"id": "implement",
			"kind": "single",
			"when": "{refine.results | where ready}",
			"step": {
				"summary": "Implement feature: {args.task}",
				"prompt": "Implement {args.task} strictly per settled handoff {refine.results}. Read applicable AGENTS.md (including cited paths); preserve constraints/unrelated edits. Execute tasks/checks only; incomplete/contradicted brief or new decision → implemented=false with blockers. For wide migration/new route, prove authorized representative child/tool/schema canary before expansion. Keep optional work separate. Report completed/remaining tasks, changed files, exact commands/outcomes, unrun checks and evidence locators. implemented=true only if all required work/checks pass without blockers/gaps; unrun ≠ pass. Report overflow/missing evidence in gaps. Return Implementation JSON.",
				"tools": ["read", "grep", "find", "ls", "bash", "edit", "write"],
				"model": "medium",
				"schema": "Implementation"
			}
		},
		{
			"id": "review",
			"kind": "fanout",
			"when": "{implement.results | where implemented}",
			"over": ["security", "quality"],
			"step": {
				"summary": "Review implementation from {item} perspective",
				"prompt": "Independently review {args.task} from {item}. Plan/constraints: {refine.results}; implementation evidence: {implement.results}. Read applicable AGENTS.md; inspect tree, diff, callers and completion evidence. No local/remote mutations; do not assume correctness. passed=true only after adequate inspection with no findings/unresolved. Provide claims, scope, locators, observed check outcomes and recommendations; missing evidence, assumptions, unrun required checks or overflow → unresolved. Preserve independent findings; echo dimension. Return Verdict JSON.",
				"tools": ["read", "grep", "find", "ls", "bash"],
				"model": "large",
				"schema": "Verdict"
			}
		},
		{
			"id": "report",
			"kind": "single",
			"step": {
				"summary": "Report feature outcome: {args.task}",
				"prompt": "Assemble FeatureReport for {args.task}. Scouting: {research.results}; failures: {research.failures}. Plan: {plan.results}; failures: {plan.failures}. Critique: {critique.results}; failures: {critique.failures}. Refine: {refine.results}; failures: {refine.failures}. Implementation: {implement.results}; failures: {implement.failures}. Reviews: {review.results}; failures: {review.failures}. Faithfully preserve evidence/instructions; no new investigation or relevance judgment. Blocked if refined plan missing/not ready, implementation missing/not implemented, or prerequisite failure prevented work. Otherwise unresolved for any failure, missing security/quality dimension, failed verdict, finding or outstanding issue; completed only if ready+implemented, both dimensions pass, none remain. Empty/skipped/missing ≠ pass. Mechanically reconcile earlier research/plan/critique blockers/gaps against resolved_issues by exact source field and issue text; only explicit match discharges; otherwise carry unchanged. Include observed commands/outcomes, locators and phase attribution; retain independent findings. Copy recommendations; for skips/failures recommend resolving blocker and rerunning affected/downstream phases. On overflow, identify source field, uncovered scope/count and supplied locators; never silently truncate, fabricate paths or claim unsupported work. Return FeatureReport JSON.",
				"model": "medium",
				"schema": "FeatureReport"
			}
		}
	],
	"return": "{report.results}"
}