Luigit
repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by admin

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": "Perform bounded factual scouting for: {args.task}. First locate and read applicable AGENTS.md files in the working directory, ancestors and inspected subdirectories. Preserve applicable user instructions and repository constraints with source paths in instructions. Inspect the repository entry points and at most 8 directly matching source/test/config files; instruction files do not count against that limit. Report observed symbols, existing conventions and test commands with precise evidence_paths. Do not decide the implementation approach, choose a design, infer unstated constraints, or claim exhaustive coverage: planners own those decisions and further inspection. Do not modify files. Stop at the scouting boundary; list ambiguity, inaccessible evidence, overflow and uninspected scope in blockers/gaps rather than guessing or silently dropping them. Return JSON matching Research.",
				"tools": ["read", "grep", "find", "ls", "bash"],
				"model": "small",
				"schema": "Research"
			}
		},
		{
			"id": "plan",
			"kind": "single",
			"step": {
				"summary": "Plan feature: {args.task}",
				"prompt": "Produce a settled implementation plan for: {args.task}. Factual scouting, not an authoritative design: {research.results}. Scouting failures: {research.failures}. First read applicable AGENTS.md files in ancestors and relevant subdirectories. You own approach decisions, relevance judgments and missing constraints: inspect further to resolve them, do not transfer ambiguity to implementation. Preserve all applicable user instructions and repository constraints with source paths in instructions. Supply ordered tasks with file/symbol scope and expected behavior, approach, rationale for decisions, risks, retrievable evidence_paths, and completion_checks with commands and acceptance criteria. Record resolved scouting blockers/gaps in resolved_issues with the exact source field, original issue text and evidence-backed resolution; leave unresolved issues in blockers/gaps. Do not modify files or make unsupported assumptions. Set ready=true only for an executable settled plan with no blockers or material gaps; otherwise ready=false with exact reasons and decisions needed. Report overflow or uninspected scope in gaps with retrieval locators, never silently omit instructions or evidence to fit bounds. Return JSON matching Plan.",
				"tools": ["read", "grep", "find", "ls", "bash"],
				"model": "large",
				"schema": "Plan"
			}
		},
		{
			"id": "critique",
			"kind": "single",
			"step": {
				"summary": "Critique feature plan: {args.task}",
				"prompt": "Adversarially critique this plan BEFORE code is written. Task: {args.task}. Plan: {plan.results}. Plan failures: {plan.failures}. Scouting: {research.results}. First read applicable AGENTS.md files in ancestors and relevant subdirectories; respect applicable user instructions and constraints. Independently inspect the evidence and hunt for missing instructions, wrong assumptions, incomplete test criteria and unhandled edge cases. Set approved=false and list blocking issues when the plan is missing or not ready; uncertainty is a gap, not approval. Include precise evidence_paths and report overflow/uninspected scope in gaps, not silent omission. Do not modify files. Return JSON matching Critique.",
				"tools": ["read", "grep", "find", "ls", "bash"],
				"model": "large",
				"schema": "Critique"
			}
		},
		{
			"id": "refine",
			"kind": "single",
			"step": {
				"summary": "Settle implementation handoff: {args.task}",
				"prompt": "Strengthen the implementation plan for: {args.task}. Produce a complete replacement that resolves EVERY blocking item from critique or explicitly remains blocked. Critique: {critique.results}. Critique failures: {critique.failures}. Original plan: {plan.results}. Plan failures: {plan.failures}. Scouting: {research.results}. Scouting failures: {research.failures}. First read applicable AGENTS.md files in ancestors and relevant subdirectories. You own remaining design decisions and missing constraints: inspect further rather than making unsupported assumptions. Preserve applicable user instructions/constraints, their source paths, settled decisions and rationale, precise task scope, evidence_paths, risks and completion_checks in the replacement Plan; implementation does not see earlier child histories. Preserve and complete resolved_issues for every resolved earlier blocker/gap, using the exact source field and original issue text plus settled resolution and evidence locators. Unresolved issues remain in blockers/gaps. If required prior evidence or critique is absent, or any issue cannot be settled, set ready=false and list blockers. Set ready=true only with no blockers or material gaps and an executable brief. Do not modify files. Use references for bulk evidence and report overflow or uninspected scope in gaps rather than silently losing constraints. Return JSON matching Plan.",
				"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 the feature: {args.task}. Authoritative settled handoff: {refine.results}. First read applicable AGENTS.md files, including the plan's instruction paths and applicable ancestors/subdirectories. Follow all applicable user instructions and constraints and preserve unrelated edits. Execute the specified tasks and completion_checks; do not choose a new approach. If the brief is incomplete, evidence contradicts it or a new decision is needed, stop with implemented=false and explicit blockers rather than guessing. Use edit/write for actual changes and run required focused checks. Return completed tasks, changed files, commands with observed outcomes and evidence_paths. Set implemented=true only when all required tasks and checks succeed with no blockers or gaps; unrun checks are not passes. Report overflow or missing evidence in gaps with retrieval locators, not silent omission. Return JSON matching Implementation.",
				"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 the implementation of {args.task} from the {item} perspective. Settled plan and applicable constraints: {refine.results}. Implementation evidence: {implement.results}. First read applicable AGENTS.md files in ancestors and relevant subdirectories and respect applicable user instructions. Inspect the working tree, diff, callers and completion evidence; do not modify files or remote systems. Do not assume the plan or implementation is correct. Set passed=true only with adequate inspection and no findings or unresolved issues. Give precise claims, scope and evidence locators for findings, observed outcomes for checks, and concrete recommendations. Missing evidence, unsupported assumptions, unrun required checks and overflow belong in unresolved, not a clean pass. Preserve independent findings even where dimensions overlap. Echo dimension as {item}. Return JSON matching Verdict.",
				"tools": ["read", "grep", "find", "ls", "bash"],
				"model": "large",
				"schema": "Verdict"
			}
		},
		{
			"id": "report",
			"kind": "single",
			"step": {
				"summary": "Report feature outcome: {args.task}",
				"prompt": "Assemble the final status for feature: {args.task}. Scouting: {research.results}. Scouting failures: {research.failures}. Plan: {plan.results}. Plan failures: {plan.failures}. Critique: {critique.results}. Critique failures: {critique.failures}. Settled handoff: {refine.results}. Refinement failures: {refine.failures}. Implementation: {implement.results}. Implementation failures: {implement.failures}. Reviews: {review.results}. Review failures: {review.failures}. This is faithful assembly from settled structured evidence, not new investigation or relevance judgment. Preserve applicable instructions and qualifications. Status rules in precedence order: blocked if the refined plan is missing or not ready, implementation is missing or not implemented, or a prerequisite failure prevented work; give exact blockers and explain downstream skips. Otherwise unresolved if any phase failure, missing review dimension (expected security and quality), passed=false verdict, finding, outstanding blocker, gap or unresolved issue remains. Mechanically reconcile earlier research/plan/critique blockers and gaps by exact source field and issue text against the refined Plan's resolved_issues. Only a matching explicit resolution discharges an earlier issue; otherwise carry it forward unchanged. Do not judge resolution adequacy anew or infer resolution from omission. Completed only with ready and implemented true, both dimensions passed, and no remaining issues. Empty/skipped/missing results are never passes. Carry observed commands/outcomes into checks and all outstanding findings and unresolved issues with phase/dimension and evidence locators; never silently deduplicate independent findings. Copy supplied recommendations; for failures/skips recommend resolving the named blocker and rerunning the affected phase and downstream checks, not an invented fix. Within schema bounds, reserve an unresolved entry for any overflow, naming source phase/field and exact uncovered scope or count with supplied retrieval paths; mark unresolved (or retain blocked), never silently truncate or fabricate paths. Do not claim checks ran or problems were resolved without evidence. Return JSON matching FeatureReport.",
				"model": "medium",
				"schema": "FeatureReport"
			}
		}
	],
	"return": "{report.results}"
}