Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

Commit 273c727

Browse files
author
catlog22
committed
feat: enhance exploration artifact handling in workflow-lite-plan
1 parent 5ae99ea commit 273c727

2 files changed

Lines changed: 51 additions & 4 deletions

File tree

.claude/commands/workflow/analyze-with-file.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,14 @@ const priorContext = `
611611
code_anchors: (conclusions.code_anchors || []).slice(0, 10), // WHERE
612612
key_files: JSON.parse(Read(`${sessionFolder}/exploration-codebase.json`))?.relevant_files?.slice(0, 8) || [],
613613
key_findings: conclusions.key_conclusions?.slice(0, 5) || [],
614-
decision_context: conclusions.decision_trail?.slice(-3) || [] // recent decisions for context
614+
decision_context: conclusions.decision_trail?.slice(-3) || [], // recent decisions for context
615+
exploration_artifacts: {
616+
exploration_codebase: `${sessionFolder}/exploration-codebase.json`,
617+
explorations: file_exists(`${sessionFolder}/explorations.json`) ? `${sessionFolder}/explorations.json` : null,
618+
perspectives: file_exists(`${sessionFolder}/perspectives.json`) ? `${sessionFolder}/perspectives.json` : null,
619+
research: file_exists(`${sessionFolder}/research.json`) ? `${sessionFolder}/research.json` : null,
620+
deep_dives: glob(`${sessionFolder}/explorations/*.json`)
621+
}
615622
}
616623
617624
const handoffBlock = `## Prior Analysis (${sessionId})

.claude/skills/workflow-lite-plan/SKILL.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ if (hasHandoffSpec) {
104104
if (specMatch) {
105105
handoffSpec = JSON.parse(specMatch[1])
106106
// handoffSpec contains: { source, session_id, session_folder, summary,
107-
// implementation_scope[], code_anchors[], key_files[], key_findings[], decision_context[] }
107+
// implementation_scope[], code_anchors[], key_files[], key_findings[], decision_context[],
108+
// exploration_artifacts: { exploration_codebase, explorations, perspectives, research, deep_dives[] } }
108109
// implementation_scope[]: { objective, rationale, priority, target_files[], acceptance_criteria[], change_summary }
109110
console.log(`[Handoff] From ${handoffSpec.source} session ${handoffSpec.session_id}`)
110111
console.log(`[Handoff] ${handoffSpec.implementation_scope.length} scoped items with acceptance criteria`)
@@ -124,8 +125,47 @@ needsExploration = workflowPreferences.forceExplore ? true
124125
task.modifies_existing_code)
125126

126127
if (!needsExploration) {
127-
// manifest absent; LP-Phase 3 loads with safe fallback
128-
// If handoffSpec exists, it provides pre-scoped implementation context
128+
// Bridge: Build manifest from analyze session's exploration artifacts
129+
if (isAnalysisSource && handoffSpec?.exploration_artifacts) {
130+
const artifacts = handoffSpec.exploration_artifacts
131+
const explorationEntries = []
132+
let idx = 1
133+
const artifactMapping = [
134+
{ key: 'exploration_codebase', angle: 'codebase-discovery' },
135+
{ key: 'explorations', angle: 'analysis-findings' },
136+
{ key: 'perspectives', angle: 'multi-perspective' },
137+
{ key: 'research', angle: 'external-research' }
138+
]
139+
artifactMapping.forEach(({ key, angle }) => {
140+
if (artifacts[key] && file_exists(artifacts[key])) {
141+
explorationEntries.push({
142+
angle, file: artifacts[key].split('/').pop(),
143+
path: artifacts[key], source_schema: 'analyze', index: idx++
144+
})
145+
}
146+
})
147+
if (artifacts.deep_dives?.length > 0) {
148+
artifacts.deep_dives.forEach(divePath => {
149+
if (file_exists(divePath)) {
150+
const name = divePath.match(/explorations\/(.+)\.json$/)?.[1] || `deep-dive-${idx}`
151+
explorationEntries.push({
152+
angle: name, file: `${name}.json`,
153+
path: divePath, source_schema: 'analyze', index: idx++
154+
})
155+
}
156+
})
157+
}
158+
if (explorationEntries.length > 0) {
159+
Write(`${sessionFolder}/explorations-manifest.json`, JSON.stringify({
160+
session_id: sessionId, task_description, timestamp: getUtc8ISOString(),
161+
complexity, exploration_count: explorationEntries.length,
162+
source: 'analyze-with-file', source_session: handoffSpec.session_id,
163+
explorations: explorationEntries
164+
}, null, 2))
165+
console.log(`[Analyze Bridge] ${explorationEntries.length} artifacts from ${handoffSpec.session_id}`)
166+
}
167+
}
168+
// If no manifest built; LP-Phase 3 loads with safe fallback
129169
proceed_to_next_phase()
130170
}
131171
```

0 commit comments

Comments
 (0)