Issue

From rajitsaha/100xprism · View interactive version

Issue is an AI agent skill from the GitHub repository rajitsaha/100xprism. You are a senior engineering lead and product architect. Given an observation, bug, or gap, conduct a thorough multi-dimensional investigation, find the root cause, plan the resolution, and create a detailed actionable GitHub issue.

How to use this skill

Skill file

Issue — Investigate & Create Detailed GitHub Issue

Given an observation, bug, or gap: investigate multi-dimensionally, find the root cause, plan the resolution, and create a detailed actionable GitHub issue.

Do NOT ask for permission — investigate thoroughly, then create the issue.


Phase 1 — Codebase Investigation

Understand the problem in full context before forming any opinion.

PROJECT_ROOT=$(git rev-parse --show-toplevel); cd "$PROJECT_ROOT"
git log --oneline -20
git status

# Detect the stack so later steps don't assume GCP/npm (canonical block — source: _lib/reference.md)
INSTRUCTION_FILE=$(for f in CLAUDE.md AGENTS.md .cursorrules; do [ -f "$PROJECT_ROOT/$f" ] && echo "$PROJECT_ROOT/$f" && break; done)
CLOUD=""
if command -v gcloud >/dev/null 2>&1 && gcloud config get-value project >/dev/null 2>&1; then CLOUD=gcp; fi
[ -z "$CLOUD" ] && grep -rqiE "aws_|amazonaws|::aws" "$PROJECT_ROOT"/terraform "$PROJECT_ROOT"/infra "$PROJECT_ROOT"/cdk.json 2>/dev/null && CLOUD=aws
[ -z "$CLOUD" ] && [ -n "$INSTRUCTION_FILE" ] && grep -qiE "gcloud|Cloud Run|Firebase" "$INSTRUCTION_FILE" && CLOUD=gcp
CI_SYSTEM=""; ls "$PROJECT_ROOT"/.github/workflows/*.y*ml >/dev/null 2>&1 && CI_SYSTEM=github-actions
echo "stack: cloud=${CLOUD:-none} ci=${CI_SYSTEM:-none}"
  1. Search for all code relevant to the observation (routes, components, services, DB queries, migrations, tests)
  2. Read the relevant source files — never guess at behavior
  3. Check recent commits in the affected area:

```bash

git log --oneline --since="60 days ago" -- <relevant-paths>

```

  1. Check for existing related issues (only if gh is available). Pull titles **and

bodies*, then match on meaning*, not just a keyword grep — a dupe often uses

different words for the same root cause:

```bash

command -v gh >/dev/null 2>&1 && gh issue list --state all --limit 100 \

--json number,title,body -q '.[] | "#\(.number) \(.title)\n\(.body)\n---"' 2>/dev/null

```

If an existing issue describes the same underlying problem, reference or update it instead of filing a duplicate.

  1. Check current test coverage for the affected code paths
  2. If a production issue and CLOUD=gcp, check Cloud Run logs (resolve the project from gcloud config — never pass a literal placeholder):

```bash

if [ "$CLOUD" = gcp ]; then

PROJECT=$(gcloud config get-value project 2>/dev/null)

gcloud logging read "resource.type=cloud_run_revision AND severity>=ERROR" \

--project="$PROJECT" --limit=20 --format="value(textPayload)" 2>/dev/null || true

fi

```

For other providers, read logs the platform-appropriate way (AWS: aws logs tail; Vercel: vercel logs; or the project's configured log viewer). Skip if not a production issue.


Phase 2 — Multi-Dimensional Impact Analysis

Analyze from ALL FIVE perspectives before planning a resolution.

2.1 Product & Business

2.2 User Experience

2.3 Cloud / Infrastructure

AWS: ECS-Lambda/RDS/S3/SNS-SQS/ElastiCache/Cognito · Azure / Vercel equivalents.) Map to the detected stack.

2.4 Data Architecture

2.5 SaaS / Distributed Systems

provider, the email sender)? Retry/idempotency gap?


Phase 3 — Root Cause Analysis

State the root cause with precision:


Phase 4 — Resolution Plan

Files to change

List every file requiring modification:

src/components/Foo.tsx              — add null check before accessing .property
api/src/routes/bar.ts               — replace string interpolation with parameterized query ($1, $2)
api/src/db/migrations/004_fix.sql   — add index on (user_id, created_at)
src/lib/subscriptionTiers.ts        — add missing feature key

Code changes needed

Be precise:

Architecture / design changes needed

If structural change is required:

Tests to add or update

tests/unit/test_foo.py                    — add: null input, boundary values, error path
api/src/__tests__/unit/bar.test.ts        — update: mock to cover new validation branch
api/src/__tests__/integration/bar.test.ts — add: end-to-end happy path + error case
e2e/tests/05-foo.spec.ts                  — add: user-facing regression test

Phase 5 — Regression Risk Assessment

Assess each risk area. Be honest — do not mark everything as "None".

| Risk Area | Level | Rationale |

|---|---|---|

| Functionality regression | None / Low / Medium / High | Which adjacent features could break? |

| Security regression | None / Low / Medium / High | Auth, permissions, data exposure change? |

| Performance regression | None / Low / Medium / High | Hot path affected? DB query cost change? |

| Data integrity | None / Low / Medium / High | Existing data affected by fix or migration? |

| Third-party integrations | None / Low / Medium / High | Stripe/Firebase/Resend/API contract change? |

| Multi-tenancy isolation | None / Low / Medium / High | Could data leak between tenants? |

Mitigation strategy:


Phase 6 — Effort Estimate

| Category | Estimate |

|---|---|

| Investigation | Xh |

| Implementation | Xh / Xd |

| Tests | Xh |

| Total | X days |

T-shirt size: XS (< 2h) / S (< 1d) / M (1–3d) / L (3–7d) / XL (> 1 week)

Priority: P0 (production down) / P1 (critical UX broken) / P2 (important, not blocking) / P3 (nice to have)


Phase 7 — Create GitHub Issue

Compose and create the issue:

gh issue create \
  --title "<type>(<scope>): <concise title — under 72 chars>" \
  --body "$(cat <<'ISSUEEOF'
## Summary
<!-- One paragraph: what is broken, who is affected, and the proposed fix -->

## Observation
<!-- What was observed — exact symptoms, error messages, steps to reproduce -->

**Steps to reproduce:**
1.
2.
3.

**Expected:**
**Actual:**

## Root Cause
<!-- Specific file:line or config — not "unknown" -->

## Impact Analysis

### Product & Business
<!-- tier/user segment affected, revenue/retention risk, severity -->

### User Experience
<!-- what the user sees, data loss risk, accessibility/perf impact -->

### Cloud / Infrastructure
<!-- which cloud services involved (map to the project's provider), scaling/infra implications -->

### Data Architecture
<!-- tables/queries affected, migration needed, data integrity risk -->

### SaaS / Distributed Systems
<!-- race conditions, multi-tenancy, async/webhook, third-party deps (payment/auth/email) -->

## Resolution Plan

### Files to change
\`\`\`
<file>    — <what changes>
\`\`\`

### Code changes
<!-- Specific logic changes needed -->

### Architecture / design changes
<!-- Schema, infra, API contract changes — or "None" -->

### Tests to add / update
\`\`\`
<test file>    — <what to add/update>
\`\`\`

## Regression Risk

| Risk Area | Level | Notes |
|---|---|---|
| Functionality | None/Low/Medium/High | |
| Security | None/Low/Medium/High | |
| Performance | None/Low/Medium/High | |
| Data Integrity | None/Low/Medium/High | |
| Integrations | None/Low/Medium/High | |
| Multi-tenancy | None/Low/Medium/High | |

**Mitigation:** <!-- rollback plan, feature flag, reversible migration -->

## Effort & Priority
- **Size:** XS / S / M / L / XL
- **Priority:** P0 / P1 / P2 / P3
- **Estimate:** X days

## Acceptance Criteria
- [ ] Root cause fixed
- [ ] Tests added/updated for affected code paths
- [ ] All regression risks mitigated
- [ ] The **gate** workflow passes (≥95% coverage, no vulns, build clean, cloud security clean)
- [ ] Deployed and verified in production
ISSUEEOF
)" \
  --label "bug" \
  --assignee "@me"

Print the created issue URL and number.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.