lewibs/dark-factory/embed-absolute-output-path-in-handoff
Claude Code and agent skill by lewibs/dark-factory
- community
Checking that the SKILL.md file is still in the repository.
When a parent agent discovers items and dispatches sub-agents (via Task tool) to write files, always embed the absolute output file path in the handoff struct rather than letting the sub-agent reconstruct it from parts.
Install
npx vskill@latest install lewibs/dark-factory/embed-absolute-output-path-in-handoffSKILL.md
The same SKILL.md was published earlier as lewibs/dark-factory/embed-absolute-output-path-in-handoff.
When to use
When you are designing or modifying an agent that:
- Discovers a list of items (systems, flows, components, etc.) at runtime, and
- Invokes a sub-agent via the Task tool for each item to write a file to disk.
The sub-agent will not have access to the same runtime context (project_path, naming conventions, output directory) unless you explicitly pass it. Embed the resolved absolute path in the struct you hand off.
Steps
- In the parent agent's discovery step, resolve the full absolute output path for each item as soon as its name is known.
- Pattern:
outputPath = "<project_path>/docs/docs/<item-slug>.md"(constructed by the parent).
- Include
outputPathas a field in the handoff struct (e.g.,FlowInfo,SystemInfo, or equivalent). - In the Task-tool prompt to the sub-agent, reference
outputPathdirectly:
`` Write your documentation to '<item.outputPath>'. Return the path to the file you wrote. ``
- Do NOT instruct the sub-agent to derive the output path itself from a base directory and slug — it will not reliably reproduce the parent's naming logic.
- Collect the returned path to confirm what was written; add it to the parent's
docs_written(or equivalent) list.
Notes
- The root cause of path mismatches in multi-agent pipelines is that sub-agents reconstruct paths independently and may use different slugging or casing logic. Pre-computing and embedding the path in the parent eliminates this class of bug entirely.
- This pattern applies generally to any orchestrator-worker split where the parent discovers items and dispatches a sub-agent per item: the parent sets
outputPathas an absolute path in the handoff struct so each sub-agent invocation knows exactly where to write without needing to reconstructproject_pathor the item-name slug. - If the output directory may not exist yet, the parent should
mkdir -pit before dispatching any sub-agent calls — do not rely on sub-agents to create directories.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/embed-absolute-output-path-in-handoff/SKILL.md
Popularity
- Repository forks
- 1
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lewibs/dark-factory/embed-absolute-output-path-in-handoff)