skills/swe-symbol-index/SKILL.md
Generate a tabular symbol index of all linked docs for a feature, inserted into the FEATURE_[KEY] memory
npx skillsauth add earthmanweb/serena-workflow-engine swe-symbol-indexInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
If starting a new session, first read workflow initialization:
mcp__plugin_swe_serena__read_memory("wf/WF_INIT")
Follow WF_INIT instructions before executing this skill.
Generate a tabular view of all symbols found in a feature's linked documentation memories, and insert it into the feature's main FEATURE_[KEY] memory as a "Related Docs" section after "Feature Overview".
/swe-symbol-index CALENDAR # Index all CALENDAR linked docs
/swe-symbol-index BLOCKS # Index all BLOCKS linked docs
/swe-symbol-index THEME_DISTRICT # Index all THEME_DISTRICT linked docs
Verify feature exists:
mcp__plugin_swe_serena__read_memory("index/INDEX_FEATURES")
Check: Feature key exists in registered features table.
If not found:
> Feature [KEY] not registered. Use /swe-feature-onboard [KEY] to register it first.
Exit skill with needs_clarification status.
mcp__plugin_swe_serena__read_memory("feature/FEATURE_[KEY]")
Extract the "Related Memories" section (typically a table at the bottom of the feature memory). This contains the list of linked doc names (e.g., DOM_CALENDAR_DISTRICT, SYS_CALENDAR_ICS).
Build linked docs list from:
Related Memories table in FEATURE_[KEY] (Memory column values)Quick Lookup row for this KEY in INDEX_FEATURES (INDEX Memory column)Deduplicate the combined list. These are all the memory files to index.
For each linked memory file, use Serena's symbolic tools with depth=1 to capture nested headings:
mcp__plugin_swe_serena__get_symbols_overview({
relative_path: ".serena/memory/[memory_subdir]/[MEMORY_NAME].md",
depth: 1
})
| depth | Returns |
|-------|---------|
| 0 (default) | Top-level symbols only |
| 1 | Top-level + immediate children (recommended for indexes) |
| 2+ | Deeper nesting — rarely needed for memory docs |
Memory subdirectory mapping:
| Prefix | Subdirectory |
| ---------- | ------------ |
| DOM_ | dom/ |
| SYS_ | sys/ |
| REF_ | ref/ |
| ARCH_ | arch/ |
| INDEX_ | index/ |
| SPEC_ | spec/ |
| MAP_ | map/ |
| FEATURE_ | feature/ |
| WF_ | wf/ |
If get_symbols_overview fails for a memory (file not in .serena/memory/), try the plugin path:
mcp__plugin_swe_serena__get_symbols_overview({
relative_path: "$SWE_PLUGIN_ROOT/memories/[subdir]/[MEMORY_NAME].md"
})
Collect from each file:
## and H3 ### level)Construct a markdown table with the following format:
## Related Docs
| Memory | Key Sections | Description |
| ---------------------------------------------- | ------------------------------------------------ | ----------------------------------- |
| [DOM_CALENDAR_DISTRICT](DOM_CALENDAR_DISTRICT) | Board Meetings, School Year Dates, URL Routes | District-specific calendar behavior |
| [SYS_CALENDAR_ICS](SYS_CALENDAR_ICS) | ICS Feed Generation, Rewrite Rules, School Dates | ICS feed system documentation |
| ... | ... | ... |
Rules for building the table:
[NAME](NAME) (Serena memory ref format)Target location: First section after ## Feature Overview (or after the first table following the feature overview heading).
Check if "## Related Docs" already exists in FEATURE_[KEY]:
mcp__plugin_swe_serena__edit_memory("FEATURE_[KEY]", {
needle: "## Related Docs\\n\\n\\|.*?(?=\\n## |\\Z)",
repl: "<new Related Docs section>",
mode: "regex"
})
Find the insertion point: after ## Feature Overview section's content (after the metadata table that follows it), before the next ## heading.
mcp__plugin_swe_serena__edit_memory("FEATURE_[KEY]", {
needle: "<end of Feature Overview section content>",
repl: "<end of Feature Overview section content>\n\n## Related Docs\n\n<table content>",
mode: "literal"
})
Use edit_memory with literal mode when possible for precision. Use regex mode only when the exact text is uncertain.
Output to user:
## Symbol Index Complete: [KEY]
### Indexed Memories
| Memory | Symbols Found |
| ------ | ------------- |
| [name] | [count] |
| ... | ... |
### Related Docs Table
[Show the generated table]
### Inserted Into
- `FEATURE_[KEY]` — after "Feature Overview" section
## Skill Return
- **Skill**: swe-symbol-index
- **Status**: success
- **Feature Key**: [KEY]
- **Memories Indexed**: [count]
- **Symbols Found**: [total count]
- **Next Step Hint**: WF_START
> **Skill /swe-symbol-index complete** - Related Docs table inserted into FEATURE_[KEY]
Feature [KEY] is not registered in INDEX_FEATURES.
Run: /swe-feature-onboard [KEY]
FEATURE_[KEY] has no Related Memories section. Cannot determine linked docs.
Consider running /swe-feature-update [KEY] first.
search_for_pattern as fallback to find heading patterns: ^##Not all language servers expose symbols equally. Known limitations:
| File Type | Symbol Quality | Fallback |
|-----------|---------------|----------|
| PHP | Excellent | — |
| Python/TS/JS | Good | Named exports work; jQuery wrappers may be empty |
| SCSS/CSS | Poor | Use search_for_pattern with ^\\.classname or ^\\$variable |
| Markdown | Limited | Headings only (H2/H3) |
| JSON/Config | None | Use Read or search_for_pattern |
When indexing code files (not memory docs), use depth=1 on get_symbols_overview and find_symbol to capture class methods and nested symbols. Fall back to search_for_pattern for SCSS/CSS assets.
> No heading symbols found in any linked docs for [KEY]. Table not inserted.
Exit with success status (no symbols is a valid result).
testing
Verify implementation against requirements and standards
development
Code exploration and research without making changes
development
Test-driven debugging for failing tests or bugs
tools
Review architecture compliance before execution