From plan-workflow
Create shared context documentation for a feature by orchestrating parallel research agents, writing research artifacts, and synthesizing verified architecture, patterns, integrations, and docs into shared.md. Use as Step 1 before parallel-plan when preparing implementation context.
How this skill is triggered — by the user, by Claude, or both
Slash command
/plan-workflow:shared-contextThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**THIS SKILL ONLY CREATES RESEARCH CONTEXT FILES. IT NEVER PLANS OR IMPLEMENTS.**
THIS SKILL ONLY CREATES RESEARCH CONTEXT FILES. IT NEVER PLANS OR IMPLEMENTS.
Outputs:
${PLANS_DIR}/[feature-name]/research-architecture.md${PLANS_DIR}/[feature-name]/research-patterns.md${PLANS_DIR}/[feature-name]/research-integration.md${PLANS_DIR}/[feature-name]/research-docs.md${PLANS_DIR}/[feature-name]/shared.mdAfter creating the shared context files and displaying the summary, STOP COMPLETELY.
Create planning context for a feature by orchestrating parallel research agents, persisting workstream reports, and synthesizing shared.md.
shared-context (this skill) -> parallel-plan -> implement-plan
This skill ends after research files and shared.md are created and validated.
Target: $ARGUMENTS
Parse arguments:
${PLANS_DIR})If no feature name provided, abort with usage instructions:
Usage: /shared-context [feature-name] [--dry-run]
Examples:
/shared-context user-authentication
/shared-context payment-integration --dry-run
Extract the feature name from $ARGUMENTS (first non-flag argument).
Validate the feature name:
Use the shared resolver to determine the correct plans directory:
source ${CLAUDE_PLUGIN_ROOT}/skills/_shared/scripts/resolve-plans-dir.sh
feature_dir="$(get_feature_plan_dir "[feature-name]")"
This handles monorepo detection, .plans-config files, and git root resolution automatically.
mkdir -p "$feature_dir"
If the directory already has .md files:
--dry-runIf --dry-run is present in $ARGUMENTS:
Display:
# Dry Run: Shared Context for [feature-name]
## Directory
- ${PLANS_DIR}/[feature-name]/
## Research Agents That Would Run
1. Architecture Researcher - System structure and components
2. Pattern Researcher - Existing patterns to follow
3. Integration Researcher - APIs, databases, external systems
4. Documentation Researcher - Relevant docs and guides
## Files That Would Be Created
- ${PLANS_DIR}/[feature-name]/research-architecture.md
- ${PLANS_DIR}/[feature-name]/research-patterns.md
- ${PLANS_DIR}/[feature-name]/research-integration.md
- ${PLANS_DIR}/[feature-name]/research-docs.md
- ${PLANS_DIR}/[feature-name]/shared.md
## Execution Model
- Deploy one `codebase-research-analyst` agent per workstream
- Wait for all workstreams to complete
- Persist each workstream as a research artifact
- Synthesize results into shared.md
- Validate shared.md
## Next Steps
Remove --dry-run flag to execute research.
STOP HERE - do not create files or deploy agents.
Read the research prompts template:
cat ${CLAUDE_PLUGIN_ROOT}/skills/shared-context/templates/research-prompts.md
CRITICAL: Deploy all 4 agents in a SINGLE message with MULTIPLE Task tool calls.
Each agent MUST write its findings to the specified output file. The orchestrator MUST verify file persistence after agents complete.
| Agent | Subagent Type | Output File | Focus |
|---|---|---|---|
| Architecture Researcher | codebase-research-analyst | research-architecture.md | System structure, components, data flow |
| Pattern Researcher | codebase-research-analyst | research-patterns.md | Existing patterns, conventions, examples |
| Integration Researcher | codebase-research-analyst | research-integration.md | APIs, databases, external systems |
| Documentation Researcher | codebase-research-analyst | research-docs.md | Relevant documentation files |
Each agent writes findings to ${feature_dir}/[output-file].
Use the prompts from research-prompts.md with variables substituted:
{{FEATURE_NAME}} - The feature directory name{{FEATURE_DIR}} - Full output directory path (${feature_dir}, resolved in Step 2)After agents complete, validate all research files:
${CLAUDE_PLUGIN_ROOT}/skills/shared-context/scripts/validate-research-artifacts.sh "${feature_dir}"
If validation fails: identify which files are missing or invalid from the script output, re-deploy ONLY the failed agents with their original prompts, wait for corrected outputs, then rerun validation until pass.
Do not proceed to synthesis until validation passes.
Read all research files:
${feature_dir}/research-architecture.md${feature_dir}/research-patterns.md${feature_dir}/research-integration.md${feature_dir}/research-docs.mdRead the shared structure template:
cat ${CLAUDE_PLUGIN_ROOT}/skills/shared-context/templates/shared-structure.md
Create ${feature_dir}/shared.md following the template exactly.
Quality rules:
Run the validation script:
${CLAUDE_PLUGIN_ROOT}/skills/shared-context/scripts/validate-shared.sh "${feature_dir}/shared.md"
Fix any issues reported, then re-run until validation passes or only warnings remain.
Provide completion summary:
# Shared Context Created
## Location
${feature_dir}/shared.md
## Research Files
- ${feature_dir}/research-architecture.md
- ${feature_dir}/research-patterns.md
- ${feature_dir}/research-integration.md
- ${feature_dir}/research-docs.md
## Summary
- Relevant Files: [count]
- Relevant Tables: [count]
- Relevant Patterns: [count]
- Relevant Docs: [count]
## Next Step (User Triggered)
/parallel-plan [feature-name]
STOP: Do not execute parallel-plan. Do not write any more files. Do not modify any code. This skill is complete.
All files are written to ${feature_dir}/ (resolved via resolve-plans-dir.sh).
| File | Producer | Required Before |
|---|---|---|
research-architecture.md | Architecture Researcher agent | shared.md synthesis |
research-patterns.md | Pattern Researcher agent | shared.md synthesis |
research-integration.md | Integration Researcher agent | shared.md synthesis |
research-docs.md | Documentation Researcher agent | shared.md synthesis |
shared.md | Orchestrator (this skill) | Skill completion |
Contract Rules:
validate-research-artifacts.sh before generating shared.mdUse .plans-config via resolve-plans-dir.sh.
Default behavior:
docs/plans/Optional local scope in .plans-config:
plans_dir: docs/plans
scope: local
validate-research-artifacts.sh after agents completenpx claudepluginhub yandy-r/claude-pluginsAutonomously researches feature requests or architecture documents, explores codebase patterns, identifies ambiguities and gaps, produces feature-context.md for orchestrator without making technical decisions.
Orchestrates a full research-plan-implement pipeline using parallel subagents, each in its own context window, with file artifacts as the communication channel between phases.
Guides software development through six-phase workflow: Research, Plan, Iterate Plan, Experiment, Implement, Validate. Generates structured markdown docs via slash commands for auditable trails.