T-PKKV-setup-planning-drop-back-compat-helpers
Status: closed/done · Impact: low · Complexity: small
Auto-generated from a /sdlc:task-work post-mortem. Review and
promote to open/ready before picking up.
The implementation of T-G834-move-plugin-runtime-state-to-sdlc-dir
extended plugin/skills/setup/setup_planning.ts to manage a
parallel _GITIGNORE_SDLC_BLOCK (the .sdlc/* ignore + un-ignore
lines). The original Claude-Code-only helpers
(_find_claude_block_span, _block_contains_hooks_lines,
_patch_block_with_hooks) became thin back-compat wrappers around
the new generic block-management code. If no external caller imports
those names, they can be deleted in a future tidy. This task does
the audit and the deletion.
| Location | Role today |
|---|---|
The original _find_claude_block_span, _block_contains_hooks_lines, | <migrated from v2 — no role recorded> |
Proposed
Section titled “Proposed”Either:
- Delete the wrappers if a
grep -rn '_find_claude_block_span\|_block_contains_hooks_lines\|_patch_block_with_hooks'acrossplugin/and the consuming repo turns up zero external callers (i.e. only the wrapper definitions themselves match). - Keep but document if any caller exists, with a deprecation comment naming the generic replacement.
The internal call sites inside setup_planning.py itself should
switch to the generic functions regardless — back-compat wrappers
exist for consumers, not the file’s own code.
Approach
Section titled “Approach”grep -rn '_find_claude_block_span\|_block_contains_hooks_lines\|_patch_block_with_hooks'acrossplugin/,site/, and the repo’s.claude/to enumerate callers.- If only the definitions in
setup_planning.tsmatch: delete the three wrapper functions, fix any internal references insidesetup_planning.tsto call the generic functions directly, and re-runplugin/skills/setup/tests/setup.test.tsto confirm nothing regresses. - If external callers exist: add a one-line
# DEPRECATED: use _find_block_span(content, CLAUDE_BLOCK_HEADER)comment above each wrapper and surface the survey result in this task’s acceptance notes for human review.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/skills/setup/setup_planning.ts | modify | delete the three |
plugin/skills/setup/tests/setup.test.ts | modify | should continue to |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: A grep for the three wrapper-helper names across
plugin/returns either (a) zero hits (full deletion completed) or (b) only the definitions plus an enumerated, justified set of external callers. - AC-2:
plugin/skills/setup/tests/setup.test.tspasses (6/6 cases as of the originating PR).
Out of scope
Section titled “Out of scope”- Refactoring the generic block-management implementation itself.
- Renaming
_GITIGNORE_SDLC_BLOCKor_GITIGNORE_CLAUDE_BLOCK.
Dependencies
Section titled “Dependencies”- none (the originating migration is a prerequisite but already shipped)
Discovery context
Section titled “Discovery context”Spawned by /sdlc:task-work post-mortem of T-G834-move-plugin-runtime-state-to-sdlc-dir on 2026-05-22.
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: setup_planning.py previously did not manage the .sdlc/* block at all - the writer only seeded the Claude Code block, with the repo .gitignore carrying the SDLC block by hand. AC-6 forced adding parallel _GITIGNORE_SDLC_BLOCK management. The original helpers (_find_claude_block_span, _block_contains_hooks_lines, _patch_block_with_hooks) are now thin back-compat wrappers; if no external caller imports them, they can be deleted in a future tidy. Keywords searched: block_contains_hooks_lines, find_claude_block_span, patch_block_with_hooks, gitignore_sdlc_block, setup_planning, back-compat, previously, management Excluded: 2026-05-22-move-plugin-runtime-state-to-sdlc-dir Top candidates (score / status / headline):
- 16 / closed/done / 2026-05-19-co-locate-skill-specific-scripts — Co-locate skill-specific scripts under their skill dir; promote when shared
- 15 / closed/done / 2026-05-20-pluralize-recognizes-backlog-as-plural — pluralize() should treat ‘backlog’ as already-plural
- 11 / closed/done / 2026-05-20-regen-walks-skill-co-located-scripts — regen.mjs walks
plugin/skills/
/*.py for script reference pages - 10 / planning/draft / 2026-05-21-promote-pluralize-to-shared-helper — Promote pluralize() + IRREGULAR_PLURALS to a shared helper
- 7 / closed/done / 2026-05-19-add-obsidian-bases-setup-flag — Add —obsidian flag to /sdlc:setup that generates Obsidian Bases files per entity Decision: SPAWNED