From cappy-toolkit
Phase 0-1 investigation initialization for CAPPY — handles case directory setup, SF case context extraction, evidence inventory, and environment detection.
npx claudepluginhub thelightarchitect/cappy-toolkit --plugin cappy-toolkitThis skill uses the workspace's default tool permissions.
<!-- Copyright (C) 2025-2026 Kevin Francis Tan (github.com/theLightArchitect) | SPDX-License-Identifier: AGPL-3.0-or-later -->
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Version: 3.0.0 Component: Investigation Initialization Purpose: Guidance for Phase 0-1 — SF case context (manual via Vision Direct), directory setup, evidence extraction, environment detection Updated: 2026-04-08
Phase 0-1 is executed entirely by Main Claude. No Task agent. No MCP server — SF case context is gathered manually from the user via Vision Direct.
Flow:
Output: Fully initialized case directory with inv_context.json, confirmed product/version, evidence inventory ready for CAPPY spawn.
No MCP case lookup available. Prompt the user:
Please open: http://vision.paloaltonetworks.local:3002/tacopilot/{case_number}
Paste the following when ready:
- Customer name
- Product (XSOAR / XSIAM / XDR)
- Version and build
- Symptom description (what the customer reported)
- Severity (P1 / P2 / P3 / P4)
Record user-provided values in inv_context.json under case. Set sf_context_method: "manual".
Do NOT proceed until product, version, and symptom are confirmed.
Set up investigation environment, record case context from user, extract bundles, detect product/version. Main Claude executes all steps directly.
Create the following directory hierarchy:
/case/SF-XXXXXXX/
├── evidence/ # Raw evidence files from customer
├── extracted/ # Extracted/parsed content from bundles
├── analysis/ # Claude's investigation analysis
├── deliverables/ # Final RCA, customer response, JIRA updates
└── inv_context.json # Authoritative investigation state
Why This Matters: Central location for all case files ensures consistency and enables distributed team access (P-003 GCS streaming).
When evidence contains log bundles (.tar.gz, .zip, .gzip):
extracted/ directoryenv.log → environment informationdemisto.log, access.log, etc. → application logs*.har → network traffic (HTTP Archive)*.json, *.xml, *.yaml → configuration filesCritical Files to Locate:
env.log - MUST HAVE for environment detectionParse env.log to extract:
{
"product": "XSOAR|XSIAM|XDR|Firewall|Panorama|Unknown",
"version": "8.9.0-2464525",
"build": "2464525",
"hostname": "xsoar.example.com",
"architecture": "standalone|cluster|docker",
"detected_at": "2026-02-05T14:30:00Z",
"detection_method": "env_log_parsing",
"confirmed_by_human": false
}
Why env.log First: Wrong version = wrong troubleshooting patterns. This is the single most critical piece of information for the investigation.
Detection Patterns:
# XSOAR/Demisto
grep -i "product.*demisto\|demisto.*version" env.log
# XSIAM
grep -i "xsiam\|security analytics" env.log
# XDR
grep -i "xdr\|endpoint detection" env.log
# Version/Build
grep -i "version.*8\.\|build.*[0-9]" env.log
Create the authoritative investigation state file with pre-populated fields:
{
"investigation_id": "SF-03896040",
"created_at": "2026-02-05T14:30:00Z",
"status": "INITIALIZING",
"symptom": {
"user_provided": "XSOAR integration timeout",
"user_provided_product": "XSOAR (optional)"
},
"environment": {
"product": "XSOAR",
"version": "8.9.0-2464525",
"build": "2464525",
"hostname": "xsoar.example.com",
"architecture": "standalone",
"detected_at": "2026-02-05T14:30:00Z",
"detection_method": "env_log_parsing",
"confirmed_by_human": false
},
"evidence_files": [
{
"path": "evidence/bundle.tar.gz",
"type": "LOG_BUNDLE",
"size_bytes": 5242880,
"extracted": true,
"files_found": 23,
"extracted_at": "2026-02-05T14:30:30Z"
},
{
"path": "evidence/file.har",
"type": "HAR",
"size_bytes": 1048576,
"entries_count": 267,
"date_start": "2026-01-15T10:30:00Z",
"date_end": "2026-01-15T10:45:00Z",
"user_classification": "API request trace during timeout"
}
],
"claims": [],
"verification": {
"enabled": true,
"depth": "DEEP",
"verifiers": ["CAPPY"],
"citation_format": "file:line|file:entry|timestamp",
"threshold": 0.90
},
"phases": {
"phase_0": {
"status": "COMPLETE",
"started_at": "2026-02-05T14:30:00Z",
"completed_at": "2026-02-05T14:35:00Z",
"bundles_extracted": 1,
"files_found": 23,
"env_detected": true,
"env_confidence": 0.95
},
"phase_1": {
"status": "COMPLETE",
"user_discoveries": [
{
"file": "bundle.tar.gz",
"classification": "demisto logs from production",
"selected_for_analysis": true
},
{
"file": "file.har",
"classification": "API request trace during integration test",
"selected_for_analysis": true
}
]
}
},
"timeline": [],
"lock": {},
"workflow_issues": [],
"metadata": {
"investigator": "Main Claude",
"start_time": "2026-02-05T14:30:00Z",
"last_updated": "2026-02-05T14:35:00Z"
}
}
Fields Explanation:
investigation_id: Case number from userenvironment: Auto-detected from env.log (MUST be verified by user)evidence_files: List of all files found, including user's classificationclaims: Empty at Phase 0-1 (filled during Phases 2-7)phases: Tracks completion status of each phaseverification: Quality gate thresholds (90% citations required)After extracting and detecting, ask user about each evidence file:
For Each File:
{filename} ({size}, {type}). What is this file?"inv_context.jsonExample Conversation:
Agent: "I found bundle.tar.gz (5.2 MB) - appears to be a log bundle. What is this?"
User: "That's the demisto logs from production when the integration timeout occurred"
Agent: "Include in analysis?"
User: "Yes"
Agent: "✓ Recorded. Next file..."
Agent: "I found file.har (1.0 MB) - HTTP Archive. What is this?"
User: "That's the API request trace from our integration test"
Agent: "Include in analysis?"
User: "Yes"
Why Interactive: Users often have context about their evidence that machines can't detect. This ensures we analyze the RIGHT files for the RIGHT reasons.
CAPPY (master orchestrator) will:
tar -xzf {bundle} -C {case_dir}/extracted/When to Use Bash:
tar -xzf {bundle} -C {case_dir}/extracted/${CLAUDE_PLUGIN_ROOT}/databases/cappy-cache_latest.json (see skills/triage/SKILL.md)When to Use Human-in-the-Loop:
When to Use Skill Knowledge:
Phase 0-1 is COMPLETE when:
✅ Directory Structure: All 4 subdirectories created ✅ Bundle Extraction: All files extracted, listed, and typed ✅ Environment Detected: Product/version/build/hostname identified from env.log with >85% confidence ✅ User Confirmed: User confirmed environment is correct ✅ inv_context.json Created: Valid JSON with all required sections ✅ Evidence Catalogued: All evidence files listed with user classifications ✅ Evidence Selected: User selected which files to analyze ✅ Ready for Phase 2: Main Claude can proceed with full context
Return to Main Claude:
Phase 0-1 COMPLETE ✓
Environment Detected:
Product: XSOAR
Version: 8.9.0-2464525
Build: 2464525
Hostname: xsoar.example.com
Evidence Files (3 found, 2 selected):
✓ bundle.tar.gz (5.2 MB) - 23 files extracted
✓ file.har (1.0 MB) - 267 HTTP entries
✗ config.xml (ignored)
Case Directory: /case/SF-03896040/
inv_context.json: Ready
Ready for Phase 2 triage.
Agent Decision:
environment.detection_method = "user_provided"environment.confirmed_by_human = trueWhy This Matters: Some customers might not have env.log, but they know their environment. Don't block initialization.
Agent Decision:
Why This Matters: Don't let bundle extraction failure block the investigation. We can still analyze individual files.
Agent Decision:
# Extract bundle
tar -xzf "/case/SF-03896040/evidence/bundle.tar.gz" -C "/case/SF-03896040/extracted/"
# List extracted files
find "/case/SF-03896040/extracted" -type f | sort
Returns:
{
files_found: 23,
file_types: {
logs: 15,
configs: 5,
other: 3
},
env_log_found: true,
extraction_time_ms: 1250
}
Pattern matching is delegated to SP-1 (Phase 2 Triage). Phase 0-1 focuses on setup — evidence inventory, directory structure, inv_context.json initialization — not analysis. Do NOT call any pattern matching tools here.
Once CAPPY completes Phase 0-1:
Skill Version: 2.0.0 Last Updated: 2026-02-13 Status: Ready for CAPPY orchestration (simplified architecture)