بنقرة واحدة
generate-backlog
Scan codebase to generate MEGA backlog tickets (20-40 pts each). Maintains 400+ pts stock on Linear.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Scan codebase to generate MEGA backlog tickets (20-40 pts each). Maintains 400+ pts stock on Linear.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Force a full-file rewrite (Write) instead of patch (Edit) when Edit keeps failing or diff is large. Context rot mitigation — use when Edit has failed ≥2× on same file, or when estimated diff >30% of file size.
STOA PR Guardian — advisory three-axis review (ADR compliance, security, AI code smell) with binary GO/NO-GO verdict + confidence. Never approves, never blocks merge.
Analyze cycle capacity gap and propose backlog items to fill the sprint to ~80% of proven velocity.
Visual roadmap snapshot — theme progress, milestones, velocity. Zero new infra (Linear MCP + velocity.json).
Cycle-aware bidirectional sync between plan.md and Linear. Discovers all cycle tickets, detects drift, updates markers.
Debug GitHub Actions CI pipeline failures. Analyse les logs de workflow, identifie la cause racine et propose un fix.
| name | generate-backlog |
| description | Scan codebase to generate MEGA backlog tickets (20-40 pts each). Maintains 400+ pts stock on Linear. |
| argument-hint | [--scan | --create | --theme <name> | empty for --scan] |
Scan the codebase and roadmap files, GROUP findings by component/theme into MEGA tickets (20-40 pts each, with phases and binary DoD), deduplicate against Linear, and optionally batch-create to maintain a 400+ pt backlog stock.
Philosophy: 10 MEGA tickets at 30 pts > 100 micro-tickets at 3 pts. Each ticket = a meaningful feature or improvement arc, not a single file fix.
Target: $ARGUMENTS
| Entity | ID |
|---|---|
| Team (CAB-ING) | <LINEAR_TEAM_ID> |
| Project (STOA Platform) | <LINEAR_PROJECT_ID> |
| Assignee (<PRIMARY_ASSIGNEE>) | <LINEAR_ASSIGNEE_ID> |
| Label | ID |
|---|---|
roadmap (parent — NOT assignable) | <LABEL_ID_ROADMAP> |
roadmap:gateway | <LABEL_ID_ROADMAP_GATEWAY> |
roadmap:dx | <LABEL_ID_ROADMAP_DX> |
roadmap:platform | <LABEL_ID_ROADMAP_PLATFORM> |
roadmap:community | <LABEL_ID_ROADMAP_COMMUNITY> |
roadmap:observability | <LABEL_ID_ROADMAP_OBSERVABILITY> |
| Label | ID | Components |
|---|---|---|
instance:backend | <LABEL_ID_INSTANCE_BACKEND> | cp-api, operator, infra, docs |
instance:frontend | <LABEL_ID_INSTANCE_FRONTEND> | cp-ui, portal, shared |
instance:auth | <LABEL_ID_INSTANCE_AUTH> | keycloak, IAM |
instance:mcp | <LABEL_ID_INSTANCE_MCP> | stoa-gateway |
instance:qa | <LABEL_ID_INSTANCE_QA> | e2e, tests |
| Argument | Mode | Description |
|---|---|---|
(empty) / --scan | Scan | Read-only report, 0 Linear writes |
--create | Create | Batch-create MEGA tickets on Linear (8-15 writes) |
--theme <name> | Themed scan | Filter candidates by roadmap theme |
Default is --scan (safe, CI-compatible).
Fetch all backlog issues (no cycle) from Linear:
linear.list_issues(
team: "<LINEAR_TEAM_ID>",
first: 100
)
Filter for issues where:
cycle is null (not in any cycle)state is "Backlog" or "Todo"Compute:
backlog_count = number of backlog issuesbacklog_pts = sum of estimates (count unpointed separately)backlog_unpointed = count of issues with no estimateReport: "Current backlog: X issues, Y pts pointed, Z unpointed"
Run all 6 scanners to collect raw findings. These are NOT tickets yet — they are raw material that will be GROUPED into MEGAs in Step 3.
Search for actionable code annotations:
grep -rn "TODO\|FIXME\|HACK" \
--include="*.py" --include="*.ts" --include="*.tsx" --include="*.rs" \
control-plane-api/ control-plane-ui/ portal/ stoa-gateway/ cli/ e2e/
Exclude: archive/, node_modules/, target/, dist/, *.test.*, *.spec.*
Tag each finding with its component (api, gateway, portal, ui, cli, e2e).
Identify untested modules by comparing source files to test files:
Python (control-plane-api):
control-plane-api/src/routers/*.py vs tests/test_*.pycontrol-plane-api/src/services/*.py vs tests/test_*.pyTypeScript (control-plane-ui / portal):
*.test.tsxRust (stoa-gateway):
#[cfg(test)] block presenceTag each gap with its component.
Parse BACKLOG.md, docs/CAPACITY-PLANNING.md, plan.md backlog sections.
Extract CAB-XXXX IDs, titles, sections. Map to roadmap themes.
Check for missing READMEs, .env.example, @wip E2E features, K8s HPA/PDB/NetworkPolicy gaps. Tag each gap with its component.
Find # noqa, eslint-disable, #[allow( clusters. Tag by component.
Only if stoa-docs sibling or PLAN-SEO.md accessible. Parse unclaimed topics.
Skip silently if not available.
This is the key step. DO NOT create one ticket per finding. Instead, GROUP all raw findings into 8-15 MEGA tickets by component + theme.
Group findings into MEGAs using this matrix:
| Component | Theme | MEGA Title Pattern | Target Estimate | Instance |
|---|---|---|---|---|
control-plane-api | platform | "API Test Coverage & Quality MEGA" | 21-34 pts | instance:backend |
control-plane-api | platform | "API Feature Completion MEGA" (from TODOs) | 21-34 pts | instance:backend |
stoa-gateway | gateway | "Gateway Test Coverage & Quality MEGA" | 21-34 pts | instance:mcp |
stoa-gateway | gateway | "Gateway Feature Completion MEGA" (from TODOs) | 21-34 pts | instance:mcp |
portal | dx | "Portal Test Coverage & UX Completion MEGA" | 21-34 pts | instance:frontend |
control-plane-ui | dx | "Console Test Coverage & UX Completion MEGA" | 21-34 pts | instance:frontend |
e2e | dx | "E2E Test Expansion — Unblock @wip Features MEGA" | 13-21 pts | instance:qa |
k8s/charts | platform | "K8s Production Hardening MEGA" (HPA, PDB, NetworkPolicy) | 13-21 pts | instance:backend |
all | dx | "Developer Experience MEGA" (READMEs, .env, DX tooling) | 13-21 pts | (lead component) |
docs | community | "Documentation & Content MEGA" | 13-21 pts | instance:backend |
all | platform | "Tech Debt Cleanup MEGA" (lint suppressions, refactoring) | 13-21 pts | (lead component) |
| roadmap items | varies | "Roadmap: MEGA" | 21-55 pts | (lead component) |
Instance tagging rule: Every MEGA gets an instance:* label based on its primary component.
For multi-component MEGAs (marked "lead component"), use the component with the most LOC impact.
/decompose later)api = 1 MEGA, not 29 ticketsEstimate each MEGA based on the aggregate scope of its grouped findings:
| MEGA Type | Base | Per-Finding Adjustment | Range |
|---|---|---|---|
| Test Coverage MEGA | 13 pts | +2 per untested module, +3 if auth-related | 13-34 |
| Feature Completion MEGA | 13 pts | +3 per multi-file TODO, +5 if cross-component | 13-34 |
| DX MEGA | 13 pts | +3 per missing README, +5 per @wip E2E feature | 13-21 |
| K8s Hardening MEGA | 13 pts | +3 per missing HPA, +2 per missing PDB | 13-21 |
| Tech Debt MEGA | 13 pts | +2 per lint cluster | 13-21 |
| Content MEGA | 13 pts | +5 per tutorial, +3 per comparison article | 13-34 |
| Roadmap MEGA | existing estimate | from BACKLOG.md/CAPACITY-PLANNING.md | 21-55 |
Cap: 55 pts max per MEGA. Larger = needs /council + /decompose.
For each MEGA from Step 3:
CAB-XXXX items, check they aren't already active on Linear[DUP] and excludeReport: "X MEGAs built, Y duplicates removed, Z net new"
Present MEGAs grouped by roadmap theme:
Backlog Generation Report (MEGA Mode)
=======================================
Current backlog: XX issues, YYY pts | Target: 400 pts
Gap: ZZZ pts needed | MEGAs proposed: NN
By Theme:
---------
gateway (XX pts, N MEGAs):
1. [34 pts] Gateway Test Coverage & Quality MEGA
Scope: 27 untested modules (proxy, oauth, guardrails, federation...)
Phases: P1 core modules (13 pts) → P2 security modules (8 pts) → P3 edge cases (13 pts)
2. [21 pts] Gateway Feature Completion MEGA
Scope: 15 TODOs (OTel init, MCP resource listing, shadow capture...)
Phases: P1 observability (8 pts) → P2 MCP features (8 pts) → P3 cleanup (5 pts)
platform (XX pts, N MEGAs):
1. [34 pts] API Test Coverage & Quality MEGA
Scope: 29 untested routers, 23 untested services
Phases: P1 auth routers (13 pts) → P2 core services (13 pts) → P3 adapters (8 pts)
2. [21 pts] K8s Production Hardening MEGA
Scope: missing HPA (5), PDB (5), NetworkPolicy (3)
Phases: P1 HPA all components (8 pts) → P2 PDB + NetworkPolicy (8 pts) → P3 docs (5 pts)
dx (XX pts, N MEGAs):
1. [21 pts] Portal Test & UX Completion MEGA
Scope: 37 untested components, 3 key TODOs
Phases: P1 auth components (8 pts) → P2 tools components (8 pts) → P3 integration (5 pts)
2. [13 pts] Developer Experience MEGA
Scope: 5 missing READMEs, 3 missing .env.example
Phases: P1 READMEs (5 pts) → P2 .env.example (3 pts) → P3 onboarding guide (5 pts)
observability (XX pts, N MEGAs):
...
community (XX pts, N MEGAs):
...
Summary:
Total MEGAs: NN | Total points: XXX pts
After creation, backlog would be: YYY pts (target: 400)
Duplicates removed: DD
Scanners skipped: [list or "none"]
--scan, default)Display the report from Step 5. No Linear writes. Exit.
--create)For each MEGA (up to 15):
linear.create_issue(
title: "[MEGA] <Theme>: <Description>",
description: <see template below>,
team: "<LINEAR_TEAM_ID>",
project: "<LINEAR_PROJECT_ID>",
assignee: "<LINEAR_ASSIGNEE_ID>",
estimate: <pts from Step 3>,
priority: 3,
labels: ["roadmap:<theme>", "instance:<lead-instance>"],
state: "Backlog"
)
MEGA ticket description template:
## Context
Auto-generated by `/generate-backlog` MEGA pipeline.
Theme: {theme} | Component(s): {components}
Findings grouped: {count} items from {scanner_names}
## Scope
{2-3 sentences describing what this MEGA covers and why it matters}
### Included Findings
{Bulleted list of all grouped raw findings with file:line references}
## Implementation Phases
### Phase 1: {name} (~{pts} pts)
- {specific deliverable 1}
- {specific deliverable 2}
- **Verification**: {command that proves Phase 1 is done}
### Phase 2: {name} (~{pts} pts)
- {specific deliverable 1}
- {specific deliverable 2}
- **Verification**: {command that proves Phase 2 is done}
### Phase 3: {name} (~{pts} pts)
- {specific deliverable 1}
- {specific deliverable 2}
- **Verification**: {command that proves Phase 3 is done}
## Binary DoD
- [ ] Phase 1 complete — verification passes
- [ ] Phase 2 complete — verification passes
- [ ] Phase 3 complete — verification passes
- [ ] All modified files have tests
- [ ] CI green (component quality gate)
- [ ] No new lint suppressions introduced
- [ ] State files updated (memory.md, plan.md)
## Estimate Rationale
{MEGA type}: {base} pts + {per-finding adjustments} = {total} pts
Findings: {count} items across {files_count} files in {component}
---
_Auto-generated by STOA AI Factory `/generate-backlog` MEGA pipeline — {date}_
--theme <name>)Same as --scan but filter MEGAs to only those matching the specified theme
(gateway, dx, platform, community, observability).
Backlog Generation Complete (MEGA Mode)
=========================================
Mode: {scan|create|themed}
Scanners run: 6 (or list skipped)
Raw findings: XXX items across 6 scanners
MEGAs built: NN (grouped from raw findings)
Duplicates removed: DD
{if --create}
Created: NN MEGAs on Linear (total: XXX pts)
Backlog after: YYY pts (target: 400 pts)
{/if}
{if --scan}
Recommended: run `/generate-backlog --create` to create NN MEGAs (XXX pts)
{/if}
Top 5 MEGAs by impact:
1. [MEGA] Gateway Test Coverage & Quality (34 pts)
2. [MEGA] API Test Coverage & Quality (34 pts)
3. ...
Append to ~/.claude/projects/-Users-torpedo-hlfh-repos-stoa/memory/operations.log:
STEP-DONE | step=generate-backlog task=backlog-pipeline megas_created=N total_pts=X backlog_depth=Y
| Call | Purpose | Mode |
|---|---|---|
list_issues(no cycle) | Inventory current backlog | All |
create_issue x N | Batch create MEGAs | --create only |
| Total read | 1 call | |
| Total write | 0 (scan) / 8-15 (create) |
--scan is default — never auto-create without explicit --createroadmap:<theme> label/fill-cycle promotes themarchive/, node_modules/, target/, dist/