From 7077c752a1f6c4496b3591614261b194b2bac5ee Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Wed, 4 Nov 2026 10:19:53 -0500 Subject: [PATCH] refactor(gitea-plan): enforce bidirectional artifact consistency, project boards, and independent reproducibility audit - add bidirectional artifact reconciliation detecting semantic conflicts - integrate project board policy with deterministic header - implement independent zero-context reproducibility audit protocol - modernize milestone and entity creation using gt CLI - deprecate tea-cli.md in favor of gt-usage Closes #10 --- skills/gitea-plan/SKILL.md | 54 ++++----- .../references/decomposition-tiers.md | 77 +++++++++---- skills/gitea-plan/references/tea-cli.md | 103 +++--------------- 3 files changed, 98 insertions(+), 136 deletions(-) diff --git a/skills/gitea-plan/SKILL.md b/skills/gitea-plan/SKILL.md index 91c8d72..bbb112f 100644 --- a/skills/gitea-plan/SKILL.md +++ b/skills/gitea-plan/SKILL.md @@ -2,7 +2,7 @@ name: gitea-plan description: >- Translate technical goals, user requests, and architecture plans into Gitea planning - primitives (issues, milestones, labels, dependencies) with tiered complexity scaling. + primitives (issues, milestones, project boards) with tiered complexity scaling. Use when decomposing work, creating or updating Gitea issues, or establishing planning milestones. Not for managing pull requests: use gitea-pr. --- @@ -11,44 +11,44 @@ description: >- ## Use when - Decomposing a project, feature request, or technical plan into trackable Gitea units. -- Creating or editing milestones and issues with falsifiable acceptance criteria. +- Creating or editing milestones, project boards, and issues with falsifiable criteria. - Setting rolling planning horizons for multi-phase epics. - Not for orchestrating slice implementation across subagents: use `implement-slice`. - Not for branch or worktree management: use `git-manager`. - Not for pull request lifecycle or review tracking: use `gitea-pr`. ## Steps -1. **Assess scope and select tier.** Inspect repository context, documentation plans, or user - request to assign a planning tier (`Small`, `Medium`, or `Large`) per - [references/decomposition-tiers.md](references/decomposition-tiers.md). Enforce minimum - ceremony: small tasks never get milestones or board overhead. -2. **Decompose into deliverable outcome slices.** Map work items into verifiable issues. - Ensure each issue represents an independently deliverable outcome with a defined testing - seam, rather than a micro-commit. For large projects, decompose only the active milestone - and leave future horizons coarse. -3. **Draft falsifiable acceptance criteria.** For each planned issue, formulate: - - Context and problem: what motivates the change. - - Proposed solution and scope: boundary of what is in and out of scope. - - Acceptance criteria: numbered, observable pass/fail conditions. -4. **Present decomposition for approval.** Present the proposed milestone and issues for human - review following the operational checkpoint rules in `profile/AGENTS.md`. Stop for approval - before creating any Gitea entities. -5. **Execute Gitea operations via `tea` CLI.** Use verified commands from - [references/tea-cli.md](references/tea-cli.md) (`tea milestones create`, `tea issues create`). - Pass multi-line descriptions via `--description-file -` to preserve formatting. -6. **Verify created state.** Inspect `tea issues list` or `tea milestones list` to confirm index - numbers and report the created entities to the user. +1. **Reconcile artifacts bidirectionally.** Check specs, roadmaps, assets, and Gitea + state for contradictions. Flag zombie in-progress, premature done, or horizon + divergence conflicts before planning new work. See + [references/decomposition-tiers.md](references/decomposition-tiers.md). +2. **Assess scope and select tier.** Assign `Small`, `Medium`, or `Large`. + Emit explicit `### Project Board Policy: (Rationale)`. +3. **Decompose into deliverable outcome slices.** Map work into verifiable issues + with test seams and falsifiable acceptance criteria (Context, Solution, Criteria). +4. **Run independent reproducibility audit.** Spawn clean-room subagent with raw + input manifest (commit SHA, specs, proposed issue markdown). Review 5-section + evaluation to resolve material ambiguities before human gate. +5. **Present decomposition for approval.** Present proposed milestone, board, and + issues with audit disposition. Stop for approval before creating Gitea entities. +6. **Execute Gitea operations via `gt` CLI.** Use verified commands from `gt-usage`: + - Milestones: `gt milestone create "" -d "<desc>" --json id,url`. + - Projects: `gt project create "<title>" --template basic_kanban --json id,url`. + - Issues: `gt issue create -t "<title>" -F <file> -m <id> -p <id> --json number,url`. + Extract server IDs directly; never guess sequence numbers or construct `/milestone/1`. +7. **Verify created state.** Inspect `gt issue list` and `gt milestone list` to + confirm server IDs, board cards, and non-hallucinated canonical URLs. ## Your call - **Planning tier selection**: confirm Small vs. Medium vs. Large ceremony level. -- **Issue decomposition boundaries**: approve or revise the proposed issue slices. -- **Batch issue creation**: approve structured batch issue creation per `profile/AGENTS.md`. +- **Issue decomposition boundaries**: approve or revise proposed issue slices. +- **Batch entity creation**: approve structured batch creation per `profile/AGENTS.md`. ## Done when -- Target milestone and issues are created in Gitea with verifiable index numbers and falsifiable - acceptance criteria. +- Target milestone, board, and issues exist on Gitea with verified server IDs, + canonical URLs, and falsifiable acceptance criteria. ## Hands off to - `implement-slice`: to orchestrate end-to-end delivery of an approved issue or slice. -- `git-manager`: to create dedicated branches or worktrees for the decomposed issues. +- `git-manager`: to create dedicated branches or worktrees for decomposed issues. - `gitea-pr`: to link, review, and close issues via pull requests. diff --git a/skills/gitea-plan/references/decomposition-tiers.md b/skills/gitea-plan/references/decomposition-tiers.md index 5cca8c1..62e3a89 100644 --- a/skills/gitea-plan/references/decomposition-tiers.md +++ b/skills/gitea-plan/references/decomposition-tiers.md @@ -1,8 +1,8 @@ -# Project Sizing and Task Decomposition Tiers +# Project Sizing, Ceremony Tiers, and Artifact Contracts -Reference for `gitea-plan`. Guidelines for scaling planning ceremony to risk and scope, preserving momentum while keeping architecture traceable. +Reference for `gitea-plan`. Guidelines for scaling planning ceremony to risk and scope, preserving momentum while keeping architecture traceable and reproducible. -## Core Axiom: Issues vs. Commits +## 1. Core Axiom: Issues vs. Commits - An **Issue** represents an **independently deliverable outcome** (what is built, verified, and closed by a pull request). It defines falsifiable acceptance criteria and expected behavior. - A **Commit** represents an **atomic, reversible implementation checkpoint** (a step within that issue's branch). Commits must compile and pass tests, but do not need to represent an entire closed issue on their own. @@ -10,25 +10,64 @@ Reference for `gitea-plan`. Guidelines for scaling planning ceremony to risk and --- -## Planning Ceremony Tiers +## 2. Entity Semantics: Issues, Boards, and Milestones -| Tier | Typical Work | Planning Primitives Used | Decomposition Rule | -| :--- | :--- | :--- | :--- | -| **Small** | Single-step bugfix, documentation tweak, dependency bump, routine chore | 1 Gitea Issue directly linked to 1 PR | Zero milestones. Zero project boards. Keep issue description concise (Context, Solution, Acceptance Criteria). | -| **Medium** | New user-facing feature, vertical slice, multi-step refactor, performance spike | 1 Milestone + 2 to 5 Deliverable Issues | Each issue has its own branch and PR. Every issue includes explicit numbered acceptance criteria and verification notes. | -| **Large** | Architectural redesign, multi-service cutover, major platform evolution | Repository Plan Document + Rolling Gitea Milestones | Technical source of truth remains in repository documentation (`ARCHITECTURE.md`, `docs/plans/`, or ADRs). Gitea coordinates rolling execution horizons. | +Each Gitea planning primitive tracks a distinct dimension of engineering reality: +- **Issue State (`Open` vs. `Closed`)**: Deliverable completion on `main`. +- **Board State (Columns: *Backlog*, *Ready*, *In Progress*, *Review*, *Done*)**: Spatial workflow stage in the active pipeline. +- **Milestone**: Strategic delivery horizon (capacity-driven or time-bounded release boundary). + +### Meaningful Conflict Reconciliation +Never mechanically mirror or silently mutate state. Instead, detect and report semantic conflicts: +- **Zombie In-Progress**: Issue is closed on Gitea, but its card still sits in *Backlog*, *Ready*, or *In Progress* on the board. +- **Premature Done**: Card is moved to *Done*, but the issue remains open or lacks a merged PR / commit on `main`. +- **Review Orphan**: Card sits in *Review*, but no active PR or static review packet exists. +- **Horizon Divergence**: Open issue is assigned to a milestone that is closed or diverges from the active milestone in `ROADMAP.md`. --- -## Rolling Horizons for Large Projects +## 3. Planning Ceremony Tiers & Project Board Policy + +| Tier | Typical Work | Gitea Primitives | Project Board Policy | Decomposition Rule | +| :--- | :--- | :--- | :--- | :--- | +| **Small** | Single-step bugfix, documentation tweak, dependency bump, routine chore | 1 Issue linked directly to 1 PR / Commit | **Omitted by Policy** (issue tracker suffices) | Zero milestones. Zero project boards. Keep description concise (Context, Solution, Acceptance Criteria). | +| **Medium** | Vertical feature slice, multi-step refactor, performance spike (2 to 5 issues) | 1 Milestone + 2 to 5 Issues | **Recommended** (Basic Kanban: *Backlog*, *Ready*, *In Progress*, *Review*, *Done*) | Each issue has its own branch and PR. All issues include explicit numbered acceptance criteria and test seams. | +| **Large** | Architectural epic, platform cutover, multi-service evolution | Roadmap Doc + Rolling Milestones + Deliverable Issues | **Required** (Board coordinates rolling horizons) | Source of truth remains in repo docs (`ARCHITECTURE.md`, `ROADMAP.md`, ADRs). Gitea coordinates rolling execution. | + +**Deterministic Output Header**: Every planning proposal must explicitly state: +```markdown +### Project Board Policy: <Omitted|Recommended|Required> (Rationale) +``` + +--- + +## 4. Independent Zero-Context Reproducibility Audit + +Before finalizing decomposition for approval, run a clean-room audit subagent to verify plan reproducibility without conversational context: + +### Input Manifest (Strict Clean-Room) +The auditor receives strictly raw artifacts and pinned repository state: +1. Pinned repository root and commit SHA. +2. Canonical specifications (`docs/specs/*.md`) and `ROADMAP.md`. +3. Proposed raw issue titles, descriptions, and acceptance criteria markdown. +4. Proposed milestone and board specifications. +5. Declared asset paths and prerequisite environment variables. + +### Auditor Report Schema +The auditor reports across five explicit sections: +1. **Reconstructed from Source Artifacts**: Scope and sequence directly supported by source text. +2. **Inferred Requirements**: Deductions made from titles or conventions lacking explicit spec text. +3. **Undetermined Seams**: Gaps or ambiguities that could not be resolved without guessing. +4. **Materiality Classification**: + - *Material*: Forces an implementer to guess about scope, behavior, acceptance, or prerequisites. + - *Non-Material*: Cosmetic or self-evident convention. +5. **Concrete Remediation Plan**: Specific edits to specs, assets, or criteria to resolve material ambiguities. + +--- + +## 5. Rolling Horizons for Large Projects When planning large epics, avoid waterfall decomposition where every future task is pre-created as an issue weeks before implementation: - -1. **Active Milestone (Immediate Horizon)**: - - Decomposed into 2 to 5 concrete deliverable issues with falsifiable acceptance criteria. - - Actively assigned, scheduled, and implemented via dedicated branches. -2. **Future Milestones (Deferred Horizons)**: - - Represented as high-level milestones or single coarse placeholder issues in Gitea. - - Decomposed into concrete issues only when the active milestone is completed and its lessons are verified. -3. **Architecture Synchronization**: - - As decisions are made during active implementation, update repository docs (`reconcile-docs`) before decomposing the next rolling milestone. +1. **Active Milestone (Immediate Horizon)**: Decomposed into 2 to 5 concrete deliverable issues with falsifiable acceptance criteria. +2. **Future Milestones (Deferred Horizons)**: Represented as high-level milestones or single coarse placeholder issues in Gitea. +3. **Architecture Synchronization**: Update repository docs (`reconcile-docs`) before decomposing the next rolling milestone. diff --git a/skills/gitea-plan/references/tea-cli.md b/skills/gitea-plan/references/tea-cli.md index a6614e4..1681029 100644 --- a/skills/gitea-plan/references/tea-cli.md +++ b/skills/gitea-plan/references/tea-cli.md @@ -1,103 +1,26 @@ -# Verified Tea CLI Subroutines +# [DEPRECATED] Tea CLI Subroutines -Reference for `gitea-plan` and `gitea-pr`. Canonical, verified syntax for coordinating Gitea operations via the `tea` CLI. +> **Notice**: Upstream `tea` CLI is archived and officially deprecated in favor of `gt` (`gitea/cli`). +> For verified command patterns, JSON extraction discipline, and sovereign instance conventions, use the official skill: +> **`skills/gt-usage/`** and its reference manual **`skills/gt-usage/references/commands.md`**. -## Repository Context - -`tea` automatically discovers the target repository and authenticated login from the active Git remote (`origin`). To verify or override: -- Check current login: `tea logins list` -- Override target repo explicitly if running outside the repository root: `-r <owner>/<repo>` +This document is preserved for historical reference and legacy instance migrations only. --- -## 1. Issue Management +## Legacy Commands Reference (Archived) -### Create an Issue -- Simple description: - ```sh - tea issues create --title "<title>" --description "<description>" [--milestone "<milestone>"] [--labels "<label1,label2>"] - ``` -- Multi-line description via heredoc (preferred for structured acceptance criteria): - ```sh - tea issues create --title "<title>" --milestone "<milestone>" --description-file - <<'EOF' - ## Context & Problem - ... - - ## Proposed Solution - ... - - ## Acceptance Criteria - 1. ... - 2. ... - EOF - ``` - -### List and Inspect Issues -- List open issues: - ```sh - tea issues list - ``` -- Filter by milestone: - ```sh - tea issues list --milestone "<milestone-title>" - ``` -- View specific issue details: - ```sh - tea issues <index> - ``` - -### Edit and Close Issues -- Update title, description, or milestone: - ```sh - tea issues edit <index> --title "<new-title>" --milestone "<new-milestone>" - ``` -- Close issue: - ```sh - tea issues close <index> - ``` - ---- - -## 2. Milestone Management - -### Create a Milestone +### 1. Issue Management (Legacy) ```sh -tea milestones create --title "<milestone-title>" --description "<overview-of-goals>" +tea issues create --title "<title>" --description "<description>" +tea issues list +tea issues edit <index> --title "<new-title>" +tea issues close <index> ``` -### List and Inspect Milestones +### 2. Milestone Management (Legacy) ```sh +tea milestones create --title "<milestone-title>" --description "<overview>" tea milestones list -``` - -### Close a Milestone -```sh tea milestones close "<milestone-title>" ``` - ---- - -## 3. Comments and Discussion - -### Add a Comment -- Use canonical positional syntax: - ```sh - tea comment <index> "<comment-body>" - ``` -- Or explicit command syntax: - ```sh - tea comments add <index> "<comment-body>" - ``` -- **Syntax Trap**: Never use `tea comment create`. It fails with `strconv.ParseInt: parsing "create": invalid syntax`. - ---- - -## 4. Labels -- List available labels: - ```sh - tea labels list - ``` -- Create repository label if missing: - ```sh - tea labels create --name "<name>" --color "<hex-color>" --description "<description>" - ```