3.1 KiB
Wiki List Columns Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Add a template-driven topdata wiki option for splitting provider-backed lists into configured columns with a fixed item count and optional forced empty columns.
Architecture: The toolkit wiki renderer gains a generic columns data-provider source that wraps another provider and exposes one row per rendered column. Each column row exposes Items, Index, and count metadata so page templates own markup while YAML owns row selection and chunking behavior. The module class page uses this provider for ClassSkills.
Tech Stack: Go sow-toolkit, YAML topdata wiki config, local HTML templates, Go tests.
Task 1: Renderer Provider
Files:
-
Modify:
toolkit/internal/topdata/wiki_data_providers.go -
Modify:
toolkit/internal/topdata/wiki_template.go -
Test:
toolkit/internal/topdata/wiki_native_test.go -
Write failing tests for a
columnsprovider that chunksClassSkillsinto rows with nestedItems, including forced empty columns. -
Run
go test ./internal/topdata -run 'TestWikiTemplate.*Column|TestBuildNativeWikiRendersClassSkillColumns'and confirm the new assertions fail becausecolumnsis not supported. -
Add
provider,columns,items_per_column, andforce_columnsfields towikiDataProviderDefinition. -
Validate that
columnsproviders name an existing provider, use positive integercolumnsanditems_per_column, and do not point at themselves. -
Allow nested
{{#each Items}}loops by teaching template#eachto iterate an array field from the current row before falling back to named providers. -
Implement deterministic chunking: each column receives up to
items_per_column; extra source items continue into additional overflow columns;force_columns: trueemits empty configured columns when there are fewer items.
Task 2: Module Template
Files:
-
Modify:
module/topdata/wiki/data.yaml -
Modify:
module/topdata/wiki/templates/pages/classes.html -
Modify:
module/topdata/wiki/README.md -
Add
ClassSkillColumnsusingsource: columns,provider: ClassSkills,columns: 3,items_per_column: 12, andforce_columns: true. -
Replace the flat class skill
<ul>with a.wiki-list-columns .wiki-list-columns--3wrapper and nested{{#each Items}}loops. -
Document the generic
columnsprovider fields for template authors.
Task 3: Verification
Files:
-
Verify:
toolkit/internal/topdata/... -
Verify:
module/topdata/wiki/... -
Run
go test ./internal/topdata -run 'TestWikiTemplate|TestBuildNativeWiki'. -
Run
./build-tool.shfromtoolkit/. -
Run
SOW_TOOLS_DEV_BINARY=../toolkit/tools/sow-toolkit ./build-wiki.sh --forcefrommodule/. -
Inspect generated class HTML for
wiki-list-columns--3, three configured class-skill lists for shorter classes, and overflow columns for long lists.