--- name: cobol-index description: Bulk-index PAISY COBOL analysis docs into BigMind. Pulls latest paisy-ai repo, scans all .md files in analysis/, extracts summaries, and stores them as BigMind facts (category paisy-cobol). Use when asked to index, refresh, or rebuild the COBOL knowledge base. --- # Skill: cobol-index Bulk-index PAISY COBOL analysis docs from paisy-ai into BigMind. ## When to use - User asks to "index COBOL docs", "refresh COBOL knowledge", or "rebuild COBOL index" - After new analysis docs are added to paisy-ai - When `cobol-lookup` reports missing or stale BigMind facts - Periodic maintenance to keep BigMind up to date ## When NOT to use - For looking up a single program or file → use `cobol-lookup` instead - For Java domain questions → use `domain-lookup` - For non-COBOL documentation tasks → use other skills ## Required Inputs | Input | Source | Example | |-------|--------|---------| | `SCOPE` | What to index (optional, default: all) | `"all"`, `"programs"`, `"datamodel"`, `"api"`, `"batch"`, `"isam-tools"` | ## Output - BigMind facts created/updated (`category: "paisy-cobol"`) - Summary report: total files scanned, new facts stored, skipped (already indexed) ## Steps ### 1. Pull latest paisy-ai ```bash git -C /Users/pplate/git/paisy-ai pull ``` If the repo doesn't exist, inform the user it needs to be cloned first. ### 2. List target files based on scope | Scope | Path pattern | |-------|-------------| | `all` | `analysis/**/*.md` | | `programs` | `analysis/PAI*.md` | | `datamodel` | `analysis/datamodel/DAI*.md` | | `api` | `analysis/api/api-PAI*.md` | | `batch` | `analysis/batch-client/*.md` | | `isam-tools` | `analysis/isam-tools/*.md` | | `architecture` | `analysis/cobol-architecture.md`, `analysis/cokz-system.md`, `analysis/codebase-size.md` | | `wiki-crosscheck` | `analysis/wiki-crosscheck-*.md` | ```bash # Example for all: find /Users/pplate/git/paisy-ai/analysis -name "*.md" -type f | sort ``` ### 3. Check existing BigMind index ```python memory_search_facts("paisy-cobol") ``` Note which files are already indexed to avoid duplicate storage. ### 4. For each file, extract summary Read the first ~30 lines of each file to extract: - The title/heading (first `#` line) - A one-line purpose summary - Key identifiers (program name, file name, Sachgebiet codes) ```bash head -30 /Users/pplate/git/paisy-ai/analysis/.md ``` ### 5. Store as BigMind fact ```python memory_store_fact( category="paisy-cobol", fact=" (): . Path: analysis/.md" ) ``` Fact format by type: | Type | Fact format | |------|------------| | PAI program | `"PAI (program): . Sachgebiete: . Path: analysis/PAI.md"` | | DAI file | `"DAI (datamodel): . Key fields: . Path: analysis/datamodel/DAI.md"` | | API interface | `"api-PAI (api): . Path: analysis/api/api-PAI.md"` | | Batch doc | `" (batch): . Path: analysis/batch-client/.md"` | | ISAM tool | `" (isam-tool): . Path: analysis/isam-tools/.md"` | | Architecture | `" (architecture): . Path: analysis/.md"` | | Wiki cross-check | `" (wiki-crosscheck): . Path: analysis/.md"` | ### 6. Report results Present a summary: ``` ## COBOL Index Results | Category | Files scanned | New facts | Skipped (existing) | |----------|--------------|-----------|-------------------| | PAI programs | | | | | DAI datamodel | | | | | API interfaces | | | | | Batch framework | | | | | ISAM tools | | | | | Architecture | | | | | Wiki cross-checks | | | | | **Total** | **** | **** | **** | ``` ## Error Handling | Error | Resolution | |-------|------------| | paisy-ai repo not found | Inform user: `git clone /Users/pplate/git/paisy-ai` needed | | `git pull` fails | Warn user, proceed with existing local files | | Empty/stub .md file | Skip, note in report as "empty" | | BigMind store fails | Retry once, then skip and note in report | | Too many files (>200) | Process in batches of 50, report progress between batches | ## Language - BigMind facts: English (BigMind convention) - Report: match user's language - Program names, field names: preserve as-is