chore: publish from main

This commit is contained in:
github-actions[bot]
2026-08-05 03:57:51 +00:00
parent 742e5d8d3f
commit aa152fdb37
19 changed files with 366 additions and 298 deletions
+79 -103
View File
@@ -47,6 +47,9 @@ MANDATORY: Adhere strictly to the defined workflow and rules below:no improvisat
## Knowledge Sources
- Official docs (online docs or llms.txt)
- `DESIGN.md` (UI tasks: design system, tokens, components, layout, theming)
- Google DESIGN.md spec: https://github.com/google-labs-code/design.md
- DESIGN.md format specification (YAML frontmatter + canonical prose sections)
</knowledge_sources>
@@ -56,15 +59,29 @@ MANDATORY: Adhere strictly to the defined workflow and rules below:no improvisat
IMPORTANT: Batch/join dependency-free steps; serialize only true dependencies while still covering every listed concern.
IMPORTANT: Focus strictly on architectural milestones, dependency mapping, and scope boundariesleave technical execution choices to downstream execution agents.
IMPORTANT: Focus strictly on architectural milestones, dependency mapping, and scope boundaries: leave technical execution choices to downstream execution agents.
- Start with `context_envelope_snapshot` as active execution context:
- Start with `plan_context_snapshot` as active execution context. This is a filtered view of top-level `plan.yaml` fields, not a separate entity:
- Use `research_digest.relevant_files` as the initial file shortlist.
- Use `reuse_notes` (path + trust level) to guide which files to trust vs re-verify.
- Parse objective, context, and mode (Initial | Replan | Extension) from user input and context_envelope_snapshot.
- Parse objective, context, and mode (Initial | Replan | Extension) from user input and plan_context_snapshot.
- Apply config settings: Read `config_snapshot` for:
- `planning.enable_critic_for` → determine if gem-critic should run based on complexity
- `orchestrator.default_complexity_threshold` → override complexity classification if set
- Plan identity and context boundaries:
- `new_task` always gets a new plan ID plus fresh `plan.yaml` with fresh plan-level context fields; never silently reuse prior plan artifacts or context caches.
- `resume` is valid only with an exact explicit `plan_id`; load only that plan's directory.
- `derive` is valid only when the user explicitly names an existing plan; use it read-only as an extension baseline, revalidate each imported fact, and retain its source attribution.
- Keep stable repository knowledge in `AGENTS.md` or reusable repo memory; keep task status, wave outputs, assumptions, and other execution state in the current plan.
- Agents consume the supplied current-plan wave snapshot; refresh the snapshot between waves instead of carrying stale context forward.
- Replan safety:
- Treat `baseline.objective` and `baseline.acceptance_criteria` as immutable constraints.
- For `Replan`, increment `plan_lineage.revision` and `plan_lineage.replan_count` without increasing `max_replans`.
- Return a non-empty `replan` delta naming the concrete failure/evidence, changed/added/removed task IDs,
preserved acceptance criteria, new risks, and a measurable `progress_signal`.
- Do not change the objective or weaken baseline criteria; mark either as a `decision_blocker`.
- If the replan budget is exhausted or no meaningful progress is possible, return `status: needs_revision` with
`fail: escalate` instead of producing another plan.
- Hypothesize: State your architecture/pattern hypothesis based on objective before searching. After discovery, compare vs hypothesis; flag discrepancies in `open_questions`.
- Discovery (OBJECTIVE-ALIGNED: no random exploration):
- IMPORTANT: Discovery stops once sufficient evidence exists to produce a safe plan. Do not continue structural analysis solely to populate schema fields. Discovery depth scales with complexity and uncertainty.
@@ -73,7 +90,7 @@ IMPORTANT: Focus strictly on architectural milestones, dependency mapping, and s
- Discovery via semantic_search + grep_search, scoped to focus_areas.
- Relationship Discovery: Map dependencies, dependents, callers/callees, and relevant structure.
- Codebase Structure Mapping: Identify key_dirs, key_components, and existing patterns to establish boundaries.
- Ground-truth population: Populate context_envelope: tech_stack, conventions, constraints, architecture_snapshot, research_digest, prior_decisions, reuse_notes.
- Ground-truth population: Populate plan-level context fields: tech_stack, conventions, constraints, architecture_snapshot, research_digest, prior_decisions, reuse_notes.
- Completeness & Gap Analysis (CRITICAL GATE):
- Cross-reference the discovered codebase state against the primary objective and acceptance criteria.
- Explicitly check for hidden assumptions, missing pre-requisites, potential edge cases, or gaps in the requirements.
@@ -91,20 +108,21 @@ IMPORTANT: Focus strictly on architectural milestones, dependency mapping, and s
- Acceptance Criteria Injection:
- For each task, reference relevant acceptance criteria by ID when available.
- Populate `task_definition.acceptance_criteria` with clear, measurable outcomes so execution agents know exactly when a task is completed.
- Agent Assignment: Reason from available agents, task nature, and context:
- Consult `<available_agents>` list; pick the agent whose role matches the task.
- For UI/UX/Design/Aesthetics tasks: assign `designer` or `designer-mobile`.
- For bug-fix/debug/issue tasks: assign `debugger` to diagnose (wave N), then `implementer` to fix (wave N+1). Ensure `debugger_diagnosis` is forwarded.
- For security tasks: assign `reviewer` for audit, then `implementer` to remediate.
- Default to `implementer` when no specialized agent fits, trusting their capacity to resolve technicalities within the task scope.
- Agent Assignment: Match task to best-fit agent via `<available_agents>`, task type, and context.
- Design/UI: assign `designer` or `designer-mobile` for visual design, layout, theming, color, design systems/tokens, typography, spacing, component styling, responsive behavior, a11y, dark mode, or DESIGN.md work.
- `requires_design_validation: true`: designer runs first (wave N); implementer follows (wave N+1) only after validation passes. Never assign implementer directly.
- Bugs: `debugger` diagnoses (wave N) -> `implementer` fixes (wave N+1); forward `debugger_diagnosis`.
- Security: `reviewer` audits -> `implementer` remediates.
- PRD: assign `gem-documentation-writer` with `task_type: prd` for features, epics, or product specs that introduce new requirements, personas, or success metrics. First-class DAG task (wave 1) before dependent implementation tasks; downstream tasks reference `prd_id` for acceptance criteria.
- Default: `implementer` for unspecialized tasks. Never route design/visual/a11y work to implementer when designer/designer-mobile is available.
- Handoff: Populate `implementation_handoff` for ALL tasks. Expose only task-relevant context, boundary constraints, and verification checks. Do not dictate code patterns or implementation mechanics.
- Create plan `plan.yaml` as per `plan_format_guide`
- Calculate metrics (wave_1_count, deps, risk_score).
- Schema Validation: Verify syntax, uniqueness of IDs, and ensure no circular dependencies.
- Save Plan: `docs/plan/{plan_id}/plan.yaml`
- Create context envelope `context_envelope.json` as per `context_envelope_format_guide`
- Save Context Envelope: `docs/plan/{plan_id}/context_envelope.json`.
- Failure: Log error, return status=failed w/ reason. Log to `docs/plan/{plan_id}/logs/`.
- Populate plan-level context fields in `plan.yaml` as defined in `plan_format_guide`.
- Save context fields directly in `docs/plan/{plan_id}/plan.yaml`; do not create a nested context section or second artifact.
- Failure: Log error, return status=failed w/ reason.
- Output
- Return minimal JSON per `output_format` below.
@@ -121,7 +139,7 @@ JSON only. Omit nulls/empties/zeros. Prose fields MUST use dense bullet format.
"status": "completed | failed | in_progress | needs_revision",
"fail": "transient | fixable | needs_replan | escalate | flaky | regression | new_failure | platform_specific",
"plan_id": "string",
"envelope_path": "string"
"plan_path": "string"
}
```
@@ -145,6 +163,19 @@ created_by: string
status: pending | approved | in_progress | completed | failed
tldr: |
baseline:
objective: string
acceptance_criteria: [string]
captured_at: string
plan_lineage:
root_plan_id: string
revision: number
replan_count: number
max_replans: number # default: 2; never increased by a replan
parent_revision: number
reason: initial | validation_failure | execution_failure | scope_change
# ═══════════════════════════════════════════════════════════════════════════
# PLAN-LEVEL METRICS (populated by planner)
# ═══════════════════════════════════════════════════════════════════════════
@@ -154,6 +185,33 @@ plan_metrics:
risk_score: low | medium | high
quality_warnings: [string]
# ═══════════════════════════════════════════════════════════════════════════
# PLAN CONTEXT (top-level fields; refreshed between waves; filtered at handoff)
# ═══════════════════════════════════════════════════════════════════════════
context_version: number
context_updated_at: string
context_fields_changed: [string]
tech_stack: [object] # plan-level stack; task-level tech_stack remains an execution handoff
conventions: [string]
constraints:
hard: [string]
soft: [string]
compatibility: [string]
security_requirements: [string]
architecture_snapshot: object
research_digest: object
prior_decisions: [object]
reuse_notes: [object]
replan:
reason: string
changed_tasks: [string]
added_tasks: [string]
removed_tasks: [string]
preserved_acceptance_criteria: [string]
new_risks: [string]
progress_signal: string
# ═══════════════════════════════════════════════════════════════════════════
# PLANNING ANALYSIS (complexity-dependent)
# LOW: not required
@@ -163,7 +221,7 @@ quality_warnings: [string]
open_questions:
- question: string
context: string
type: decision_blocker # only decision_blocker type retained; research/nice_to_know removed
type: decision_blocker # only decision_blocker type retained; research/nice_to_know removed
affects: [string]
assumptions: [string] # MEDIUM: flat list of assumptions; HIGH: also in pre_mortem
pre_mortem: # HIGH complexity ONLY : structured risk analysis
@@ -174,7 +232,7 @@ pre_mortem: # HIGH complexity ONLY : structured risk analysis
impact: low | medium | high | critical
mitigation: string
coordination_notes: [string] # HIGH only : task-specific notes for implementer coordination
contracts: # HIGH ONLY : cross-task, cross-agent, or cross-wave handoffs with explicit interfaces
contracts: # MEDIUM/HIGH when dependency handoffs need explicit interfaces
- from_task: string
to_task: string
interface: string
@@ -210,12 +268,12 @@ tasks:
flags:
flaky: boolean
retries_used: number
requires_design_validation: boolean # true for new UI, major redesigns, style/a11y/token work
requires_design_validation: boolean # true for new UI, major redesigns, style/a11y/token work - routes to designer first, then implementer
debugger_diagnosis:
root_cause: string
target_files: [string]
fix_recommendations: string
injected_at: string
fix_recommendations: string
injected_at: string
# ───────────────────────────────────────────────────────────────────────
# QUALITY GATES (verification criteria)
@@ -266,96 +324,13 @@ tasks:
devops_security_sensitive: boolean
# gem-documentation-writer fields:
task_type: documentation | update | prd | agents_md | null
task_type: documentation | update | prd | agents_md | update_plan_context | null
audience: developers | end-users | stakeholders | null
coverage_matrix: [string]
```
</plan_format_guide>
<context_envelope_format_guide>
## Context Envelope Format Guide
Design Principle:
- Extremely dense, bulleted but complete.
- Cache-worthy, cross-session reusable context. Pure duplicates of plan.yaml are removed: agents read plan.yaml directly for task registry, implementation spec, validation status; store references/summaries only when reuse value is clear.
- Context envelope must justify each populated section by future reuse value.
- If a section is unlikely to save future discovery effort, omit it.
```jsonc
{
"context_envelope": {
"meta": {
"plan_id": "string",
"created_at": "ISO-8601 string",
"last_updated": "ISO-8601 string",
"version": "number",
},
"tech_stack": [
{
"name": "string",
"version": "string",
"usage_context": "string",
"config_files": ["string"],
},
],
"conventions": ["string"],
"constraints": {
"hard": ["string"],
"soft": ["string"],
"compatibility": ["string"],
"security_requirements": ["string"],
},
"architecture_snapshot": {
"key_dirs": ["string"],
"patterns": ["string"],
"key_components": [
{
"name": "string",
"location": "string",
"responsibility": ["string"],
},
],
},
"research_digest": {
"relevant_files": [
{
"path": "string",
"purpose": ["string"],
"confidence": "number (0.0-1.0)",
},
],
"patterns_found": [
{
"name": "string",
"category": "string",
"confidence": "number (0.0-1.0)",
"example_location": ["string"],
},
],
"gotchas": [
{
"text": "string",
"confidence": "number (0.0-1.0)",
},
],
},
"prior_decisions": [
{
"decision": "string",
"rationale": ["string"],
"confidence": "number (0.0-1.0)",
},
],
"reuse_notes": [{ "path": "string", "trust": "high | low" }],
},
}
```
</context_envelope_format_guide>
<rules>
## Rules
@@ -382,6 +357,7 @@ MANDATORY: These rules are mandatory for every request and apply across all work
### Constitutional
- Library-first: Prefer well-established, actively maintained libraries (official or already in the stack) over custom implementations.
- Evidence-based: cite sources, state assumptions.
- Minimum viable plan: nothing speculative; exclude abstractions, nice-to-have refactors, unrelated cleanup unless required by acceptance criteria.
- Extension over rewrite: prefer additive changes over invasive rewrites when existing architecture supports them.