Feature Context: Enhance skill-research-process for Complete CLI Tool Skill Production
Document Metadata
- Generated: 2026-02-27
- Input Type: assessment_gaps (skill comparison against reference benchmark)
- Source: Session observation comparing skill-research-process output against uv skill; Issue #197
- Status: DISCOVERY_COMPLETE
- Priority: P1
Original Request
The skill-research-process skill has sound research orchestration but lacks output specification for producing complete CLI tool skills. Five gaps identified via assessment against the uv skill:
- No local directory input -- passing a path like
.claude/worktrees/ty/docs/ is treated as a tool name, triggering web searches instead of reading local docs
- No CLI reference file templates -- no structural anchor ensuring standard reference types (
cli_reference.md, configuration.md, migration-guide.md, quick-reference.md, troubleshooting.md)
- No
assets/ directory production
- No sync/release-tracking script production
- Output uses
references/{category}/index.md (subdirectory) instead of flat references/{slug}.md layout
Core Intent Analysis
WHO (Target Users)
- Skill authors using
/skill-research-process to build new skills for CLI tools, frameworks, and libraries
- Orchestrator agents delegating research work to parallel sub-agents
- End users consuming the produced skills (who benefit from consistent structure)
WHAT (Desired Outcome)
- The skill-research-process accepts local documentation directories as input alongside tool names
- Research output conforms to the proven reference layout observed in production-quality skills (uv, clang-format, gitlab-skill)
- Produced skills include
assets/ directory with templates, scripts/ with sync scripts, and flat references/*.md files
- A single invocation of
/skill-research-process produces a skill structure that passes plugin_validator.py without post-hoc restructuring
WHEN (Trigger Conditions)
- User invokes
/skill-research-process <path-to-local-docs> (local directory input)
- User invokes
/skill-research-process <tool-name> (web-based research, existing flow)
- Research agents complete Stage 2 and produce reference files (output layout enforcement)
- Integration agent runs Stage 3 (assets/ and scripts/ production)
WHY (Problem Being Solved)
- Local docs (cloned repos, worktrees, downloaded archives) are a high-fidelity source that the current skill ignores, forcing unnecessary web searches
- Without structural templates, each research run produces ad-hoc reference layouts that require manual restructuring to match repository conventions
- Missing
assets/ and scripts/ means the produced skill is incomplete compared to the repository's quality benchmark (uv skill)
- Subdirectory layout (
references/{category}/index.md) diverges from the flat layout (references/{slug}.md) used by every production skill in the repository
Codebase Research
Similar Patterns Found
Pattern 1: Local path input handling — external-pattern-integrator
Location: .claude/skills/external-pattern-integrator/SKILL.md:68-72
Code:
**If URL**: Use WebFetch or curl to download to `/tmp/external-pattern-{slug}.md`
**If local file**: Read directly
Relevance: Demonstrates argument-level branching between URL and local file input within a skill
Reusable: The argument-hint: <url-or-file> [url-or-file...] pattern and the if-URL/if-local branching logic
Pattern 2: Flat references/ layout — uv skill (benchmark)
- Location:
plugins/python3-development/skills/uv/references/
- Files:
cli_reference.md
configuration.md
migration-guide.md
quick-reference.md
troubleshooting.md
- Relevance: Production-quality CLI tool skill uses flat
references/{slug}.md -- no subdirectories, no index.md files
- Reusable: File naming convention and standard reference types for CLI tools
Pattern 3: Flat references/ layout — brainstorming-skill
- Location:
plugins/brainstorming-skill/skills/brainstorming-skill/SKILL.md:73-108
- Code: References 14+ files all as
./references/{slug}.md (flat layout)
- Relevance: Non-CLI skill also uses flat layout, confirming this is the repository-wide convention
- Reusable: Confirms the pattern is not CLI-specific
Pattern 4: Flat references/ layout — agent-browser skill
- Location:
.claude/skills/agent-browser/SKILL.md:393-399
- Code:
references/commands.md, references/snapshot-refs.md, references/session-management.md, etc.
- Relevance: Another production skill using flat references
- Reusable: Confirms flat layout as universal standard
Pattern 5: assets/ directory with categorized subdirectories — uv skill
- Location:
plugins/python3-development/skills/uv/assets/
- Files:
pyproject_templates/basic.toml, advanced.toml, gitlab.toml
script_examples/data_analysis.py
docker_examples/Dockerfile.simple, Dockerfile.multi-stage
github_actions/ci.yml
- Relevance: Assets organized by purpose subdirectory, providing copy-paste templates for users
- Reusable: Asset category structure (templates, examples, configs)
Pattern 6: assets/ directory with categorized subdirectories — clang-format skill
- Location:
plugins/clang-format/skills/clang-format/assets/
- Files:
configs/ (7 .clang-format configuration files)
integrations/ (emacs, vim, pre-commit integrations)
- Relevance: Another production skill with meaningful assets
- Reusable: Config templates and integration examples as asset categories
Pattern 7: Sync/release-tracking script — uv skill
- Location:
plugins/python3-development/skills/uv/scripts/sync_uv_releases.py
- Functionality: Fetches GitHub releases, categorizes changes (breaking, features, deprecations), updates SKILL.md Version Information section, includes cooldown with lock file
- Relevance: Directly demonstrates the sync script pattern missing from skill-research-process output
- Reusable: Script structure (PEP 723 metadata, typer CLI, cooldown logic, lock file, section replacement in SKILL.md)
Pattern 8: Sync script — gitlab-skill
- Location:
plugins/gitlab-skill/skills/gitlab-skill/scripts/sync_gitlab_docs.py
- Functionality: Downloads documentation archive, extracts, grooms markdown (link transforms, Hugo shortcode removal), generates file tree index, atomic replacement
- Relevance: Alternative sync pattern (archive download vs API) for documentation-heavy skills
- Reusable: Archive-based sync for tools with static documentation sites
Pattern 9: Add-doc-updater orchestration — skill-creator plugin
- Location:
plugins/plugin-creator/skills/add-doc-updater/SKILL.md
- Functionality: 5-phase workflow to add documentation sync pipeline to any skill; collects 6 template variables; delegates to
@python-cli-architect agent
- Relevance: Provides existing infrastructure for adding sync scripts to skills -- skill-research-process could invoke this as a Stage 3 step
- Reusable: The
/add-doc-updater skill itself; no need to reinvent sync script generation
Pattern 10: Skill scaffolding with all three directories — init_skill.py
- Location:
plugins/plugin-creator/skills/skill-creator/scripts/init_skill.py:259-307
- Code: Creates
scripts/example.py, references/api_reference.md, assets/example_asset.txt
- Relevance: The scaffolding script already creates all three directories; skill-research-process should populate them instead of leaving assets/ and scripts/ empty
- Reusable: Directory creation pattern and placeholder structure
Existing Infrastructure
| Component |
Path |
Role |
| skill-research-process |
.claude/skills/skill-research-process/SKILL.md |
Current skill (target of enhancement) |
| Agent prompts |
.claude/skills/skill-research-process/references/agent-prompts.md |
Research/categorization/integration agent templates |
| Gaps analysis |
.claude/skills/skill-research-process/references/gaps-analysis.md |
Known gaps (9 items, but none cover the 5 gaps in this request) |
| MCP tools guide |
.claude/skills/skill-research-process/references/mcp-tools.md |
Tool selection reference |
| init_skill.py |
plugins/plugin-creator/skills/skill-creator/scripts/init_skill.py |
Skill scaffolding |
| add-doc-updater |
plugins/plugin-creator/skills/add-doc-updater/SKILL.md |
Sync script generator |
| plugin_validator.py |
plugins/plugin-creator/scripts/plugin_validator.py |
Structural validation |
Code References
.claude/skills/skill-research-process/SKILL.md:2 -- argument-hint: <tool-or-library-name> (current: tool name only, no path)
.claude/skills/skill-research-process/SKILL.md:21 -- Stage 2: Research → Parallel agents populate references/{category}/ (subdirectory layout)
.claude/skills/skill-research-process/SKILL.md:75 -- Each agent outputs to ./references/{category}/ (subdirectory layout)
.claude/skills/skill-research-process/references/agent-prompts.md:64 -- Create files in: ./{skill-name}/references/{category}/ (subdirectory layout in agent prompt)
.claude/skills/skill-research-process/references/agent-prompts.md:65 -- Create index.md (lowercase) in that directory (index.md pattern)
.claude/skills/skill-research-process/SKILL.md:112 -- Update ./SKILL.md with links to each category's index.md (integration references index.md)
plugins/python3-development/skills/uv/references/ -- 5 flat .md files, zero subdirectories (benchmark)
plugins/python3-development/skills/uv/assets/ -- 4 subdirectories with 7 template files (benchmark)
plugins/python3-development/skills/uv/scripts/sync_uv_releases.py -- 587-line sync script (benchmark)
Use Scenarios
Scenario 1: Building a skill from cloned repository docs
Actor: Skill author who has cloned astral-sh/ty and wants to create a /ty skill
Trigger: /skill-research-process .claude/worktrees/ty/docs/
Goal: Research agents read local markdown files instead of web-searching "ty"
Expected Outcome: Categorization agent scans the local docs directory structure, creates categories from directory layout, research agents read local files with Read tool
Current State: The argument .claude/worktrees/ty/docs/ is interpreted as a tool name. Categorization agent web-searches for "ty docs" -- returning unrelated results or nothing useful.
Scenario 2: Building a CLI tool skill with complete output
Actor: Skill author building a /kubectl skill
Trigger: /skill-research-process kubectl
Goal: Produce a skill with flat references (cli_reference.md, configuration.md, troubleshooting.md), assets (YAML templates), and a sync script
Expected Outcome: Stage 2 produces references/cli_reference.md, references/configuration.md, references/quick-reference.md, references/troubleshooting.md; Stage 3 produces assets/ with example configs and scripts/sync_kubectl_releases.py
Current State: Stage 2 produces references/installation/index.md, references/commands/index.md, etc. (subdirectory layout). No assets/ or scripts/ are produced. Manual restructuring required post-research.
Scenario 3: Hybrid input -- local docs plus web enrichment
Actor: Skill author with partial local documentation wanting to supplement from web
Trigger: /skill-research-process --local .claude/worktrees/ty/docs/ --name ty
Goal: Research agents prioritize local files, fall back to web for topics not covered locally
Expected Outcome: Categorization scans local docs first, identifies gaps, research agents use local files where available and web sources where not
Current State: No mechanism to combine local and web sources. Must choose one or the other (and local is not supported at all).
Gap Analysis
Identified Gaps
| # |
Category |
Gap Description |
Impact |
Benchmark Reference |
| 1 |
Input |
No local directory path input -- argument treated as tool name |
High-fidelity local docs cannot be used; forces unnecessary web searches with lower accuracy |
external-pattern-integrator SKILL.md:68-72 handles URL-vs-file branching |
| 2 |
Output Structure |
No CLI reference file templates -- no guarantee of standard files like cli_reference.md, configuration.md |
Each research run produces different file names; manual post-hoc rename required |
uv skill: 5 named reference files at references/*.md |
| 3 |
Output Structure |
No assets/ directory production |
Produced skill lacks templates, example configs, CI workflows that users copy-paste |
uv skill: 7 asset files across 4 subdirectories |
| 4 |
Output Structure |
No sync/release-tracking script production |
Skill documentation becomes stale; no automated refresh mechanism |
uv skill: scripts/sync_uv_releases.py (587 lines); existing /add-doc-updater skill |
| 5 |
Output Structure |
Subdirectory layout (references/{category}/index.md) instead of flat (references/{slug}.md) |
Diverges from every production skill in the repository; requires restructuring before merge |
All production skills: uv, clang-format, agent-browser, brainstorming-skill use flat layout |
| 6 |
Agent Prompts |
Research agent prompt (agent-prompts.md:64-65) hardcodes subdirectory + index.md pattern |
Agents produce wrong layout; orchestrator cannot simply change SKILL.md without also updating prompts |
agent-prompts.md lines 64-68 |
| 7 |
Agent Prompts |
Categorization agent prompt has no local-docs scanning path |
Even if input parsing is fixed, the categorization agent does not know how to scan a directory |
agent-prompts.md lines 10-42 |
| 8 |
Integration |
Stage 3 integration agent prompt (agent-prompts.md:134) references references/{category}/index.md |
Integration step wires wrong paths into SKILL.md |
agent-prompts.md line 134 |
Questions Requiring Resolution
Q1: How should local path vs. tool name be distinguished in the argument?
- Category: Input
- Gap: #1
- Question: Should the skill detect paths by checking if the argument is an existing directory, or require an explicit flag like
--local?
- Options:
- A) Auto-detect: If
$ARGUMENTS resolves to an existing directory, treat as local docs path; otherwise treat as tool name
- B) Explicit flag:
--local <path> for local docs, bare argument for tool name
- C) Both: Auto-detect with optional
--local override for disambiguation
- Why It Matters: Auto-detect is simpler but may misfire on tool names that coincidentally match directory names. Explicit flag is unambiguous but adds syntax.
- Recommendation: Option A (auto-detect) with fallback documentation. The
external-pattern-integrator uses auto-detect (URL vs file) and this has worked reliably. A simple Path($ARGUMENTS).is_dir() check in the skill body or a pre-step Bash command suffices.
- Resolution: pending
Q2: Should the standard reference file set be hardcoded or configurable per tool type?
- Category: Output Structure
- Gap: #2
- Question: Should the skill always produce the same 5-6 reference files, or should the categorization agent determine which files to produce?
- Options:
- A) Hardcoded template: Always produce
cli_reference.md, configuration.md, migration-guide.md, quick-reference.md, troubleshooting.md
- B) Configurable: Categorization agent proposes files; quality gate verifies minimum set
- C) Hybrid: Required minimum set (cli_reference, configuration, troubleshooting) + agent-proposed additions
- Why It Matters: Hardcoded ensures consistency but may not fit all tools (e.g., a library may not have CLI reference). Configurable preserves flexibility but risks inconsistency.
- Recommendation: Option C. Require a minimum set for CLI tools, allow the categorization agent to add domain-specific files. The quality gate at Stage 1 should verify the minimum set is present.
- Resolution: pending
Q3: Should assets/ production be part of skill-research-process or delegated to a follow-up skill?
- Category: Output Structure
- Gap: #3
- Question: Should research agents produce assets, or should assets be created in a separate post-research step?
- Options:
- A) Inline: Research agents produce assets alongside references during Stage 2
- B) Post-research: A dedicated Stage 3.5 produces assets from the researched content
- C) Delegated: Invoke
/add-doc-updater or similar after research completes
- Why It Matters: Research agents focus on documentation extraction; asset creation requires different judgment (what templates are useful, what configs to include). Mixing concerns may reduce quality.
- Recommendation: Option B. Add a post-research asset generation step in Stage 3 (Integration) where the integration agent identifies template-worthy content from references and creates assets. This keeps research agents focused.
- Resolution: pending
Q4: Should sync script production be integrated or delegated to /add-doc-updater?
- Category: Output Structure
- Gap: #4
- Question: Should skill-research-process generate sync scripts directly, or invoke the existing
/add-doc-updater skill?
- Options:
- A) Integrated: Skill-research-process generates the sync script as part of Stage 3
- B) Delegated: Stage 3 invokes
/add-doc-updater <produced-skill-path> as a final step
- C) Optional: Stage 3 asks user if sync script is needed (not all tools have release APIs)
- Why It Matters:
/add-doc-updater already has a 5-phase workflow with quality gates for sync script creation. Reimplementing this inside skill-research-process duplicates effort and misses existing quality gates.
- Recommendation: Option B. The
/add-doc-updater skill at plugins/plugin-creator/skills/add-doc-updater/SKILL.md already handles this with a complete 5-phase pipeline. Stage 3 should note "invoke /add-doc-updater as follow-up" rather than reimplementing.
- Resolution: pending
Q5: Should the flat layout migration update the existing gaps-analysis.md or replace it?
- Category: Documentation
- Gap: #5, #6, #7, #8
- Question: The existing
references/gaps-analysis.md documents 9 gaps. This feature adds 5 more. Should they be merged?
- Options:
- A) Merge: Add the 5 new gaps to the existing gaps-analysis.md
- B) Replace: Supersede with a new version that includes all gaps
- C) Separate: Keep gaps-analysis.md for original gaps; add a new file for output-structure gaps
- Why It Matters: A single source of truth for gaps is easier to track. However, the original 9 gaps are about process quality (verification, citations, hallucination checks) while the new 5 are about output structure. Different concerns.
- Recommendation: Option A. Merge into a single gaps-analysis.md with two sections: "Process Quality Gaps" (original 9) and "Output Structure Gaps" (new 5). This keeps one file as the canonical gap tracker.
- Resolution: pending
Goals (Pending Resolution)
These goals will be finalized after questions are resolved.
- Update argument handling in
SKILL.md frontmatter and Stage 1 to detect and branch on local directory paths vs. tool names
- Update categorization agent prompt in
references/agent-prompts.md to support local directory scanning with Read/Glob tools instead of web search
- Replace subdirectory layout (
references/{category}/index.md) with flat layout (references/{slug}.md) across all three agent prompts and SKILL.md Stage 2/Stage 3 references
- Add CLI reference file template set as a quality gate in Stage 1 -- categorization agent must include minimum reference types for CLI tools
- Add assets/ production step in Stage 3 (Integration) where integration agent extracts template-worthy content into
assets/ subdirectories
- Add sync script delegation in Stage 3 -- note to invoke
/add-doc-updater as follow-up step for tools with release APIs or updatable documentation
- Update gaps-analysis.md to include the 5 output-structure gaps alongside the 9 existing process-quality gaps
- Validate produced skill structure passes
plugin_validator.py without warnings related to layout
Next Steps
After questions are resolved:
- Update "Resolution" fields in Questions section
- Finalize Goals section with accepted options
- Proceed to architecture design (modifications to SKILL.md, agent-prompts.md, and potentially gaps-analysis.md)
- Create task decomposition with file-level edit targets
- Execute implementation
1---2name: 425-feature-context-enhance-skill-research-process-1aaf8e093description: Feature Context: Enhance skill-research-process for Complete CLI Tool Skill Production4---5# Feature Context: Enhance skill-research-process for Complete CLI Tool Skill Production67## Document Metadata89- **Generated**: 2026-02-2710- **Input Type**: assessment_gaps (skill comparison against reference benchmark)11- **Source**: Session observation comparing skill-research-process output against uv skill; Issue #19712- **Status**: DISCOVERY_COMPLETE13- **Priority**: P11415---1617## Original Request1819The skill-research-process skill has sound research orchestration but lacks output specification for producing complete CLI tool skills. Five gaps identified via assessment against the uv skill:20211. No local directory input -- passing a path like `.claude/worktrees/ty/docs/` is treated as a tool name, triggering web searches instead of reading local docs222. No CLI reference file templates -- no structural anchor ensuring standard reference types (`cli_reference.md`, `configuration.md`, `migration-guide.md`, `quick-reference.md`, `troubleshooting.md`)233. No `assets/` directory production244. No sync/release-tracking script production255. Output uses `references/{category}/index.md` (subdirectory) instead of flat `references/{slug}.md` layout2627---2829## Core Intent Analysis3031### WHO (Target Users)3233- Skill authors using `/skill-research-process` to build new skills for CLI tools, frameworks, and libraries34- Orchestrator agents delegating research work to parallel sub-agents35- End users consuming the produced skills (who benefit from consistent structure)3637### WHAT (Desired Outcome)3839- The skill-research-process accepts local documentation directories as input alongside tool names40- Research output conforms to the proven reference layout observed in production-quality skills (uv, clang-format, gitlab-skill)41- Produced skills include `assets/` directory with templates, `scripts/` with sync scripts, and flat `references/*.md` files42- A single invocation of `/skill-research-process` produces a skill structure that passes `plugin_validator.py` without post-hoc restructuring4344### WHEN (Trigger Conditions)4546- User invokes `/skill-research-process <path-to-local-docs>` (local directory input)47- User invokes `/skill-research-process <tool-name>` (web-based research, existing flow)48- Research agents complete Stage 2 and produce reference files (output layout enforcement)49- Integration agent runs Stage 3 (assets/ and scripts/ production)5051### WHY (Problem Being Solved)5253- Local docs (cloned repos, worktrees, downloaded archives) are a high-fidelity source that the current skill ignores, forcing unnecessary web searches54- Without structural templates, each research run produces ad-hoc reference layouts that require manual restructuring to match repository conventions55- Missing `assets/` and `scripts/` means the produced skill is incomplete compared to the repository's quality benchmark (uv skill)56- Subdirectory layout (`references/{category}/index.md`) diverges from the flat layout (`references/{slug}.md`) used by every production skill in the repository5758---5960## Codebase Research6162### Similar Patterns Found6364#### Pattern 1: Local path input handling — external-pattern-integrator6566- **Location**: `.claude/skills/external-pattern-integrator/SKILL.md:68-72`67- **Code**:6869 ```text70 **If URL**: Use WebFetch or curl to download to `/tmp/external-pattern-{slug}.md`71 **If local file**: Read directly72 ```7374- **Relevance**: Demonstrates argument-level branching between URL and local file input within a skill75- **Reusable**: The `argument-hint: <url-or-file> [url-or-file...]` pattern and the if-URL/if-local branching logic7677#### Pattern 2: Flat references/ layout — uv skill (benchmark)7879- **Location**: `plugins/python3-development/skills/uv/references/`80- **Files**:81 - `cli_reference.md`82 - `configuration.md`83 - `migration-guide.md`84 - `quick-reference.md`85 - `troubleshooting.md`86- **Relevance**: Production-quality CLI tool skill uses flat `references/{slug}.md` -- no subdirectories, no `index.md` files87- **Reusable**: File naming convention and standard reference types for CLI tools8889#### Pattern 3: Flat references/ layout — brainstorming-skill9091- **Location**: `plugins/brainstorming-skill/skills/brainstorming-skill/SKILL.md:73-108`92- **Code**: References 14+ files all as `./references/{slug}.md` (flat layout)93- **Relevance**: Non-CLI skill also uses flat layout, confirming this is the repository-wide convention94- **Reusable**: Confirms the pattern is not CLI-specific9596#### Pattern 4: Flat references/ layout — agent-browser skill9798- **Location**: `.claude/skills/agent-browser/SKILL.md:393-399`99- **Code**: `references/commands.md`, `references/snapshot-refs.md`, `references/session-management.md`, etc.100- **Relevance**: Another production skill using flat references101- **Reusable**: Confirms flat layout as universal standard102103#### Pattern 5: assets/ directory with categorized subdirectories — uv skill104105- **Location**: `plugins/python3-development/skills/uv/assets/`106- **Files**:107 - `pyproject_templates/basic.toml`, `advanced.toml`, `gitlab.toml`108 - `script_examples/data_analysis.py`109 - `docker_examples/Dockerfile.simple`, `Dockerfile.multi-stage`110 - `github_actions/ci.yml`111- **Relevance**: Assets organized by purpose subdirectory, providing copy-paste templates for users112- **Reusable**: Asset category structure (templates, examples, configs)113114#### Pattern 6: assets/ directory with categorized subdirectories — clang-format skill115116- **Location**: `plugins/clang-format/skills/clang-format/assets/`117- **Files**:118 - `configs/` (7 `.clang-format` configuration files)119 - `integrations/` (emacs, vim, pre-commit integrations)120- **Relevance**: Another production skill with meaningful assets121- **Reusable**: Config templates and integration examples as asset categories122123#### Pattern 7: Sync/release-tracking script — uv skill124125- **Location**: `plugins/python3-development/skills/uv/scripts/sync_uv_releases.py`126- **Functionality**: Fetches GitHub releases, categorizes changes (breaking, features, deprecations), updates SKILL.md Version Information section, includes cooldown with lock file127- **Relevance**: Directly demonstrates the sync script pattern missing from skill-research-process output128- **Reusable**: Script structure (PEP 723 metadata, typer CLI, cooldown logic, lock file, section replacement in SKILL.md)129130#### Pattern 8: Sync script — gitlab-skill131132- **Location**: `plugins/gitlab-skill/skills/gitlab-skill/scripts/sync_gitlab_docs.py`133- **Functionality**: Downloads documentation archive, extracts, grooms markdown (link transforms, Hugo shortcode removal), generates file tree index, atomic replacement134- **Relevance**: Alternative sync pattern (archive download vs API) for documentation-heavy skills135- **Reusable**: Archive-based sync for tools with static documentation sites136137#### Pattern 9: Add-doc-updater orchestration — skill-creator plugin138139- **Location**: `plugins/plugin-creator/skills/add-doc-updater/SKILL.md`140- **Functionality**: 5-phase workflow to add documentation sync pipeline to any skill; collects 6 template variables; delegates to `@python-cli-architect` agent141- **Relevance**: Provides existing infrastructure for adding sync scripts to skills -- skill-research-process could invoke this as a Stage 3 step142- **Reusable**: The `/add-doc-updater` skill itself; no need to reinvent sync script generation143144#### Pattern 10: Skill scaffolding with all three directories — init_skill.py145146- **Location**: `plugins/plugin-creator/skills/skill-creator/scripts/init_skill.py:259-307`147- **Code**: Creates `scripts/example.py`, `references/api_reference.md`, `assets/example_asset.txt`148- **Relevance**: The scaffolding script already creates all three directories; skill-research-process should populate them instead of leaving assets/ and scripts/ empty149- **Reusable**: Directory creation pattern and placeholder structure150151### Existing Infrastructure152153| Component | Path | Role |154|-----------|------|------|155| skill-research-process | `.claude/skills/skill-research-process/SKILL.md` | Current skill (target of enhancement) |156| Agent prompts | `.claude/skills/skill-research-process/references/agent-prompts.md` | Research/categorization/integration agent templates |157| Gaps analysis | `.claude/skills/skill-research-process/references/gaps-analysis.md` | Known gaps (9 items, but none cover the 5 gaps in this request) |158| MCP tools guide | `.claude/skills/skill-research-process/references/mcp-tools.md` | Tool selection reference |159| init_skill.py | `plugins/plugin-creator/skills/skill-creator/scripts/init_skill.py` | Skill scaffolding |160| add-doc-updater | `plugins/plugin-creator/skills/add-doc-updater/SKILL.md` | Sync script generator |161| plugin_validator.py | `plugins/plugin-creator/scripts/plugin_validator.py` | Structural validation |162163### Code References164165- `.claude/skills/skill-research-process/SKILL.md:2` -- `argument-hint: <tool-or-library-name>` (current: tool name only, no path)166- `.claude/skills/skill-research-process/SKILL.md:21` -- `Stage 2: Research → Parallel agents populate references/{category}/` (subdirectory layout)167- `.claude/skills/skill-research-process/SKILL.md:75` -- `Each agent outputs to ./references/{category}/` (subdirectory layout)168- `.claude/skills/skill-research-process/references/agent-prompts.md:64` -- `Create files in: ./{skill-name}/references/{category}/` (subdirectory layout in agent prompt)169- `.claude/skills/skill-research-process/references/agent-prompts.md:65` -- `Create index.md (lowercase) in that directory` (index.md pattern)170- `.claude/skills/skill-research-process/SKILL.md:112` -- `Update ./SKILL.md with links to each category's index.md` (integration references index.md)171- `plugins/python3-development/skills/uv/references/` -- 5 flat `.md` files, zero subdirectories (benchmark)172- `plugins/python3-development/skills/uv/assets/` -- 4 subdirectories with 7 template files (benchmark)173- `plugins/python3-development/skills/uv/scripts/sync_uv_releases.py` -- 587-line sync script (benchmark)174175---176177## Use Scenarios178179### Scenario 1: Building a skill from cloned repository docs180181**Actor**: Skill author who has cloned `astral-sh/ty` and wants to create a `/ty` skill182**Trigger**: `/skill-research-process .claude/worktrees/ty/docs/`183**Goal**: Research agents read local markdown files instead of web-searching "ty"184**Expected Outcome**: Categorization agent scans the local docs directory structure, creates categories from directory layout, research agents read local files with `Read` tool185**Current State**: The argument `.claude/worktrees/ty/docs/` is interpreted as a tool name. Categorization agent web-searches for "ty docs" -- returning unrelated results or nothing useful.186187### Scenario 2: Building a CLI tool skill with complete output188189**Actor**: Skill author building a `/kubectl` skill190**Trigger**: `/skill-research-process kubectl`191**Goal**: Produce a skill with flat references (`cli_reference.md`, `configuration.md`, `troubleshooting.md`), assets (YAML templates), and a sync script192**Expected Outcome**: Stage 2 produces `references/cli_reference.md`, `references/configuration.md`, `references/quick-reference.md`, `references/troubleshooting.md`; Stage 3 produces `assets/` with example configs and `scripts/sync_kubectl_releases.py`193**Current State**: Stage 2 produces `references/installation/index.md`, `references/commands/index.md`, etc. (subdirectory layout). No assets/ or scripts/ are produced. Manual restructuring required post-research.194195### Scenario 3: Hybrid input -- local docs plus web enrichment196197**Actor**: Skill author with partial local documentation wanting to supplement from web198**Trigger**: `/skill-research-process --local .claude/worktrees/ty/docs/ --name ty`199**Goal**: Research agents prioritize local files, fall back to web for topics not covered locally200**Expected Outcome**: Categorization scans local docs first, identifies gaps, research agents use local files where available and web sources where not201**Current State**: No mechanism to combine local and web sources. Must choose one or the other (and local is not supported at all).202203---204205## Gap Analysis206207### Identified Gaps208209| # | Category | Gap Description | Impact | Benchmark Reference |210|---|----------|-----------------|--------|---------------------|211| 1 | Input | No local directory path input -- argument treated as tool name | High-fidelity local docs cannot be used; forces unnecessary web searches with lower accuracy | `external-pattern-integrator` SKILL.md:68-72 handles URL-vs-file branching |212| 2 | Output Structure | No CLI reference file templates -- no guarantee of standard files like `cli_reference.md`, `configuration.md` | Each research run produces different file names; manual post-hoc rename required | uv skill: 5 named reference files at `references/*.md` |213| 3 | Output Structure | No `assets/` directory production | Produced skill lacks templates, example configs, CI workflows that users copy-paste | uv skill: 7 asset files across 4 subdirectories |214| 4 | Output Structure | No sync/release-tracking script production | Skill documentation becomes stale; no automated refresh mechanism | uv skill: `scripts/sync_uv_releases.py` (587 lines); existing `/add-doc-updater` skill |215| 5 | Output Structure | Subdirectory layout (`references/{category}/index.md`) instead of flat (`references/{slug}.md`) | Diverges from every production skill in the repository; requires restructuring before merge | All production skills: uv, clang-format, agent-browser, brainstorming-skill use flat layout |216| 6 | Agent Prompts | Research agent prompt (agent-prompts.md:64-65) hardcodes subdirectory + index.md pattern | Agents produce wrong layout; orchestrator cannot simply change SKILL.md without also updating prompts | agent-prompts.md lines 64-68 |217| 7 | Agent Prompts | Categorization agent prompt has no local-docs scanning path | Even if input parsing is fixed, the categorization agent does not know how to scan a directory | agent-prompts.md lines 10-42 |218| 8 | Integration | Stage 3 integration agent prompt (agent-prompts.md:134) references `references/{category}/index.md` | Integration step wires wrong paths into SKILL.md | agent-prompts.md line 134 |219220---221222## Questions Requiring Resolution223224### Q1: How should local path vs. tool name be distinguished in the argument?225226- **Category**: Input227- **Gap**: #1228- **Question**: Should the skill detect paths by checking if the argument is an existing directory, or require an explicit flag like `--local`?229- **Options**:230 - A) Auto-detect: If `$ARGUMENTS` resolves to an existing directory, treat as local docs path; otherwise treat as tool name231 - B) Explicit flag: `--local <path>` for local docs, bare argument for tool name232 - C) Both: Auto-detect with optional `--local` override for disambiguation233- **Why It Matters**: Auto-detect is simpler but may misfire on tool names that coincidentally match directory names. Explicit flag is unambiguous but adds syntax.234- **Recommendation**: Option A (auto-detect) with fallback documentation. The `external-pattern-integrator` uses auto-detect (URL vs file) and this has worked reliably. A simple `Path($ARGUMENTS).is_dir()` check in the skill body or a pre-step Bash command suffices.235- **Resolution**: _pending_236237### Q2: Should the standard reference file set be hardcoded or configurable per tool type?238239- **Category**: Output Structure240- **Gap**: #2241- **Question**: Should the skill always produce the same 5-6 reference files, or should the categorization agent determine which files to produce?242- **Options**:243 - A) Hardcoded template: Always produce `cli_reference.md`, `configuration.md`, `migration-guide.md`, `quick-reference.md`, `troubleshooting.md`244 - B) Configurable: Categorization agent proposes files; quality gate verifies minimum set245 - C) Hybrid: Required minimum set (cli_reference, configuration, troubleshooting) + agent-proposed additions246- **Why It Matters**: Hardcoded ensures consistency but may not fit all tools (e.g., a library may not have CLI reference). Configurable preserves flexibility but risks inconsistency.247- **Recommendation**: Option C. Require a minimum set for CLI tools, allow the categorization agent to add domain-specific files. The quality gate at Stage 1 should verify the minimum set is present.248- **Resolution**: _pending_249250### Q3: Should assets/ production be part of skill-research-process or delegated to a follow-up skill?251252- **Category**: Output Structure253- **Gap**: #3254- **Question**: Should research agents produce assets, or should assets be created in a separate post-research step?255- **Options**:256 - A) Inline: Research agents produce assets alongside references during Stage 2257 - B) Post-research: A dedicated Stage 3.5 produces assets from the researched content258 - C) Delegated: Invoke `/add-doc-updater` or similar after research completes259- **Why It Matters**: Research agents focus on documentation extraction; asset creation requires different judgment (what templates are useful, what configs to include). Mixing concerns may reduce quality.260- **Recommendation**: Option B. Add a post-research asset generation step in Stage 3 (Integration) where the integration agent identifies template-worthy content from references and creates assets. This keeps research agents focused.261- **Resolution**: _pending_262263### Q4: Should sync script production be integrated or delegated to /add-doc-updater?264265- **Category**: Output Structure266- **Gap**: #4267- **Question**: Should skill-research-process generate sync scripts directly, or invoke the existing `/add-doc-updater` skill?268- **Options**:269 - A) Integrated: Skill-research-process generates the sync script as part of Stage 3270 - B) Delegated: Stage 3 invokes `/add-doc-updater <produced-skill-path>` as a final step271 - C) Optional: Stage 3 asks user if sync script is needed (not all tools have release APIs)272- **Why It Matters**: `/add-doc-updater` already has a 5-phase workflow with quality gates for sync script creation. Reimplementing this inside skill-research-process duplicates effort and misses existing quality gates.273- **Recommendation**: Option B. The `/add-doc-updater` skill at `plugins/plugin-creator/skills/add-doc-updater/SKILL.md` already handles this with a complete 5-phase pipeline. Stage 3 should note "invoke `/add-doc-updater` as follow-up" rather than reimplementing.274- **Resolution**: _pending_275276### Q5: Should the flat layout migration update the existing gaps-analysis.md or replace it?277278- **Category**: Documentation279- **Gap**: #5, #6, #7, #8280- **Question**: The existing `references/gaps-analysis.md` documents 9 gaps. This feature adds 5 more. Should they be merged?281- **Options**:282 - A) Merge: Add the 5 new gaps to the existing gaps-analysis.md283 - B) Replace: Supersede with a new version that includes all gaps284 - C) Separate: Keep gaps-analysis.md for original gaps; add a new file for output-structure gaps285- **Why It Matters**: A single source of truth for gaps is easier to track. However, the original 9 gaps are about process quality (verification, citations, hallucination checks) while the new 5 are about output structure. Different concerns.286- **Recommendation**: Option A. Merge into a single gaps-analysis.md with two sections: "Process Quality Gaps" (original 9) and "Output Structure Gaps" (new 5). This keeps one file as the canonical gap tracker.287- **Resolution**: _pending_288289---290291## Goals (Pending Resolution)292293_These goals will be finalized after questions are resolved._2942951. **Update argument handling** in `SKILL.md` frontmatter and Stage 1 to detect and branch on local directory paths vs. tool names2962. **Update categorization agent prompt** in `references/agent-prompts.md` to support local directory scanning with `Read`/`Glob` tools instead of web search2973. **Replace subdirectory layout** (`references/{category}/index.md`) with flat layout (`references/{slug}.md`) across all three agent prompts and SKILL.md Stage 2/Stage 3 references2984. **Add CLI reference file template set** as a quality gate in Stage 1 -- categorization agent must include minimum reference types for CLI tools2995. **Add assets/ production step** in Stage 3 (Integration) where integration agent extracts template-worthy content into `assets/` subdirectories3006. **Add sync script delegation** in Stage 3 -- note to invoke `/add-doc-updater` as follow-up step for tools with release APIs or updatable documentation3017. **Update gaps-analysis.md** to include the 5 output-structure gaps alongside the 9 existing process-quality gaps3028. **Validate** produced skill structure passes `plugin_validator.py` without warnings related to layout303304---305306## Next Steps307308After questions are resolved:3093101. Update "Resolution" fields in Questions section3112. Finalize Goals section with accepted options3123. Proceed to architecture design (modifications to SKILL.md, agent-prompts.md, and potentially gaps-analysis.md)3134. Create task decomposition with file-level edit targets3145. Execute implementation