diff --git a/CLAUDE.md b/CLAUDE.md index 13adf5e2..0ec53ec6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -62,7 +62,7 @@ devflow/ └── .memory/ # Working memory files — per-project ``` -**Install paths**: Commands → `~/.claude/commands/devflow/`, Agents → `~/.claude/agents/devflow/`, Skills → `~/.claude/skills/` (flat), Scripts → `~/.devflow/scripts/` +**Install paths**: Commands → `~/.claude/commands/devflow/`, Agents → `~/.claude/agents/devflow/`, Skills → `~/.claude/skills/devflow:*/` (namespaced), Scripts → `~/.devflow/scripts/` ## Development Loop @@ -128,7 +128,7 @@ Working memory files live in a dedicated `.memory/` directory: **Coder Handoff Artifact**: Sequential Coder phases write `.docs/handoff.md` after each phase. Survives context compaction (unlike PRIOR_PHASE_SUMMARY). Every Coder reads it on startup. Deleted by implementation-orchestration after pipeline completes. -**Universal Skill Installation**: All skills from all plugins are always installed, regardless of plugin selection. Skills are tiny markdown files. This ensures orchestration skills (review-orchestration, resolve-orchestration) can spawn agents that depend on skills from other plugins. Only commands and agents remain plugin-specific. +**Universal Skill Installation**: All skills from all plugins are always installed, regardless of plugin selection. Skills are tiny markdown files installed as `~/.claude/skills/devflow:{name}/` (namespaced to avoid collisions with other plugin ecosystems). Source directories in `shared/skills/` stay unprefixed — the `devflow:` prefix is applied at install-time only. Shadow overrides live at `~/.devflow/skills/{name}/` (unprefixed); when shadowed, the installer copies the user's version to the prefixed install target. Only commands and agents remain plugin-specific. **Model Strategy**: Explicit model assignments in agent frontmatter override the user's session model. Opus for analysis agents (reviewer, scrutinizer, shepherd), Sonnet for execution agents (coder, simplifier, resolver, skimmer), Haiku for I/O agents (git, synthesizer, validator). diff --git a/README.md b/README.md index b796e9b1..be727e13 100644 --- a/README.md +++ b/README.md @@ -311,14 +311,14 @@ Session context is saved and restored automatically via Working Memory hooks — ### Skill Shadowing -Override any DevFlow skill with your own version. Shadowed skills survive `devflow init` — they won't be overwritten on reinstall or upgrade. +Override any DevFlow skill with your own version. Shadowed skills survive `devflow init` — your version is copied to the install target on each init instead of DevFlow's. ```bash # Create a personal override (copies current version as reference) npx devflow-kit skills shadow core-patterns # Edit your override -vim ~/.claude/skills/core-patterns/SKILL.md +vim ~/.devflow/skills/core-patterns/SKILL.md # List all overrides npx devflow-kit skills list-shadowed diff --git a/docs/reference/file-organization.md b/docs/reference/file-organization.md index 21bc4185..491202d9 100644 --- a/docs/reference/file-organization.md +++ b/docs/reference/file-organization.md @@ -104,7 +104,7 @@ The `skills` and `agents` arrays declare which shared assets this plugin needs. |-------|------|-------| | Commands | `~/.claude/commands/devflow/` | Namespaced | | Agents | `~/.claude/agents/devflow/` | Namespaced | -| Skills | `~/.claude/skills/` | Flat (auto-discovery) | +| Skills | `~/.claude/skills/devflow:*/` | Namespaced (`devflow:` prefix) | | Scripts | `~/.devflow/scripts/` | Helper scripts | | Hooks | `~/.devflow/scripts/hooks/` | Working Memory hooks | | Settings | `~/.claude/settings.json` | DevFlow configuration | diff --git a/plugins/devflow-code-review/commands/code-review-teams.md b/plugins/devflow-code-review/commands/code-review-teams.md index aabace72..786cc298 100644 --- a/plugins/devflow-code-review/commands/code-review-teams.md +++ b/plugins/devflow-code-review/commands/code-review-teams.md @@ -21,9 +21,9 @@ Run a comprehensive code review of the current branch by spawning a review team #### Step 0a: Discover Worktrees -1. **Discover reviewable worktrees** using the `worktree-support` skill discovery algorithm: +1. **Discover reviewable worktrees** using the `devflow:worktree-support` skill discovery algorithm: - Run `git worktree list --porcelain` → parse, filter (skip protected/detached/mid-rebase), dedup by branch, sort by recent commit - - See `~/.claude/skills/worktree-support/SKILL.md` for the full 7-step algorithm and canonical protected branch list + - See `~/.claude/skills/devflow:worktree-support/SKILL.md` for the full 7-step algorithm and canonical protected branch list 2. **If `--path` flag provided:** use only that worktree, skip discovery **`--path` validation**: Before proceeding, verify the path exists as a directory and appears in `git worktree list` output. If not: report error and stop. 3. **If only 1 reviewable worktree** (the common case): proceed as single-worktree flow — zero behavior change @@ -80,7 +80,7 @@ Per worktree, detect file types in diff using `DIFF_RANGE` to determine conditio | Dependency files changed | dependencies | | Docs or significant code | documentation | -**Skill availability check**: Language/ecosystem reviews (typescript, react, accessibility, frontend-design, go, java, python, rust) require their optional skill plugin to be installed. Before adding a conditional perspective, use Read to check if `~/.claude/skills/{focus}/SKILL.md` exists. If Read returns an error (file not found), **skip that perspective** — the language plugin isn't installed. Non-language reviews (database, dependencies, documentation) use skills bundled with this plugin and are always available. +**Skill availability check**: Language/ecosystem reviews (typescript, react, accessibility, frontend-design, go, java, python, rust) require their optional skill plugin to be installed. Before adding a conditional perspective, use Read to check if `~/.claude/skills/devflow:{focus}/SKILL.md` exists. If Read returns an error (file not found), **skip that perspective** — the language plugin isn't installed. Non-language reviews (database, dependencies, documentation) use skills bundled with this plugin and are always available. ### Phase 2: Spawn Review Team @@ -116,11 +116,11 @@ Spawn review teammates with self-contained prompts: Prompt: | You are reviewing PR #{pr_number} on branch {branch} (base: {base_branch}). WORKTREE_PATH: {worktree_path} (omit if cwd) - 1. Read your skill: `Read ~/.claude/skills/security-patterns/SKILL.md` - 2. Read review methodology: `Read ~/.claude/skills/review-methodology/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:security-patterns/SKILL.md` + 2. Read review methodology: `Read ~/.claude/skills/devflow:review-methodology/SKILL.md` 3. Read `.memory/knowledge/pitfalls.md` if it exists. Check for known pitfall patterns in the diff. 4. Get the diff: `git -C {WORKTREE_PATH} diff {DIFF_RANGE}` - 5. Apply the 6-step review process from review-methodology + 5. Apply the 6-step review process from devflow:review-methodology 6. Focus: injection, auth bypass, crypto misuse, OWASP vulnerabilities 7. Classify each finding: 🔴 BLOCKING / ⚠️ SHOULD-FIX / ℹ️ PRE-EXISTING 8. Include file:line references for every finding @@ -131,11 +131,11 @@ Spawn review teammates with self-contained prompts: Prompt: | You are reviewing PR #{pr_number} on branch {branch} (base: {base_branch}). WORKTREE_PATH: {worktree_path} (omit if cwd) - 1. Read your skill: `Read ~/.claude/skills/architecture-patterns/SKILL.md` - 2. Read review methodology: `Read ~/.claude/skills/review-methodology/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:architecture-patterns/SKILL.md` + 2. Read review methodology: `Read ~/.claude/skills/devflow:review-methodology/SKILL.md` 3. Read `.memory/knowledge/pitfalls.md` if it exists. Check for known pitfall patterns in the diff. 4. Get the diff: `git -C {WORKTREE_PATH} diff {DIFF_RANGE}` - 5. Apply the 6-step review process from review-methodology + 5. Apply the 6-step review process from devflow:review-methodology 6. Focus: SOLID violations, coupling, layering issues, modularity problems 7. Classify each finding: 🔴 BLOCKING / ⚠️ SHOULD-FIX / ℹ️ PRE-EXISTING 8. Include file:line references for every finding @@ -146,11 +146,11 @@ Spawn review teammates with self-contained prompts: Prompt: | You are reviewing PR #{pr_number} on branch {branch} (base: {base_branch}). WORKTREE_PATH: {worktree_path} (omit if cwd) - 1. Read your skill: `Read ~/.claude/skills/performance-patterns/SKILL.md` - 2. Read review methodology: `Read ~/.claude/skills/review-methodology/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:performance-patterns/SKILL.md` + 2. Read review methodology: `Read ~/.claude/skills/devflow:review-methodology/SKILL.md` 3. Read `.memory/knowledge/pitfalls.md` if it exists. Check for known pitfall patterns in the diff. 4. Get the diff: `git -C {WORKTREE_PATH} diff {DIFF_RANGE}` - 5. Apply the 6-step review process from review-methodology + 5. Apply the 6-step review process from devflow:review-methodology 6. Focus: N+1 queries, memory leaks, algorithm issues, I/O bottlenecks 7. Classify each finding: 🔴 BLOCKING / ⚠️ SHOULD-FIX / ℹ️ PRE-EXISTING 8. Include file:line references for every finding @@ -162,14 +162,14 @@ Spawn review teammates with self-contained prompts: You are reviewing PR #{pr_number} on branch {branch} (base: {base_branch}). WORKTREE_PATH: {worktree_path} (omit if cwd) 1. Read your skills: - - `Read ~/.claude/skills/complexity-patterns/SKILL.md` - - `Read ~/.claude/skills/consistency-patterns/SKILL.md` - - `Read ~/.claude/skills/test-patterns/SKILL.md` - - `Read ~/.claude/skills/regression-patterns/SKILL.md` - 2. Read review methodology: `Read ~/.claude/skills/review-methodology/SKILL.md` + - `Read ~/.claude/skills/devflow:complexity-patterns/SKILL.md` + - `Read ~/.claude/skills/devflow:consistency-patterns/SKILL.md` + - `Read ~/.claude/skills/devflow:test-patterns/SKILL.md` + - `Read ~/.claude/skills/devflow:regression-patterns/SKILL.md` + 2. Read review methodology: `Read ~/.claude/skills/devflow:review-methodology/SKILL.md` 3. Read `.memory/knowledge/pitfalls.md` if it exists. Check for known pitfall patterns in the diff. 4. Get the diff: `git -C {WORKTREE_PATH} diff {DIFF_RANGE}` - 5. Apply the 6-step review process from review-methodology + 5. Apply the 6-step review process from devflow:review-methodology 6. Focus: complexity, test gaps, pattern violations, regressions, naming 7. Classify each finding: 🔴 BLOCKING / ⚠️ SHOULD-FIX / ℹ️ PRE-EXISTING 8. Include file:line references for every finding @@ -264,7 +264,7 @@ Per worktree, after successful completion: **IMPORTANT**: Run sequentially across all worktrees (not in parallel) to avoid GitHub API conflicts. Per worktree, if the review summary contains CRITICAL or HIGH blocking issues: -1. Read `~/.claude/skills/knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` +1. Read `~/.claude/skills/devflow:knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` 2. Source field: `/code-review {branch}` 3. Skip entirely if no CRITICAL/HIGH blocking issues diff --git a/plugins/devflow-code-review/commands/code-review.md b/plugins/devflow-code-review/commands/code-review.md index 52dd7597..1c8a774c 100644 --- a/plugins/devflow-code-review/commands/code-review.md +++ b/plugins/devflow-code-review/commands/code-review.md @@ -21,9 +21,9 @@ Run a comprehensive code review of the current branch by spawning parallel revie #### Step 0a: Discover Worktrees -1. **Discover reviewable worktrees** using the `worktree-support` skill discovery algorithm: +1. **Discover reviewable worktrees** using the `devflow:worktree-support` skill discovery algorithm: - Run `git worktree list --porcelain` → parse, filter (skip protected/detached/mid-rebase), dedup by branch, sort by recent commit - - See `~/.claude/skills/worktree-support/SKILL.md` for the full 7-step algorithm and canonical protected branch list + - See `~/.claude/skills/devflow:worktree-support/SKILL.md` for the full 7-step algorithm and canonical protected branch list 2. **If `--path` flag provided:** use only that worktree, skip discovery **`--path` validation**: Before proceeding, verify the path exists as a directory and appears in `git worktree list` output. If not: report error and stop. 3. **If only 1 reviewable worktree** (the common case): proceed as single-worktree flow — zero behavior change @@ -80,7 +80,7 @@ Per worktree, detect file types in diff using `DIFF_RANGE` to determine conditio | Dependency files changed | dependencies | | Docs or significant code | documentation | -**Skill availability check**: Language/ecosystem reviews (typescript, react, accessibility, frontend-design, go, java, python, rust) require their optional skill plugin to be installed. Before spawning a conditional Reviewer for these focuses, use Read to check if `~/.claude/skills/{focus}/SKILL.md` exists. If Read returns an error (file not found), **skip that review** — the language plugin isn't installed. Non-language reviews (database, dependencies, documentation) use skills bundled with this plugin and are always available. +**Skill availability check**: Language/ecosystem reviews (typescript, react, accessibility, frontend-design, go, java, python, rust) require their optional skill plugin to be installed. Before spawning a conditional Reviewer for these focuses, use Read to check if `~/.claude/skills/devflow:{focus}/SKILL.md` exists. If Read returns an error (file not found), **skip that review** — the language plugin isn't installed. Non-language reviews (database, dependencies, documentation) use skills bundled with this plugin and are always available. ### Phase 2: Run Reviews (Parallel) @@ -88,30 +88,30 @@ Spawn Reviewer agents **in a single message**. Always run 7 core reviews; condit | Focus | Always | Pattern Skill | |-------|--------|---------------| -| security | ✓ | security-patterns | -| architecture | ✓ | architecture-patterns | -| performance | ✓ | performance-patterns | -| complexity | ✓ | complexity-patterns | -| consistency | ✓ | consistency-patterns | -| regression | ✓ | regression-patterns | -| tests | ✓ | test-patterns | -| typescript | conditional | typescript | -| react | conditional | react | -| accessibility | conditional | accessibility | -| frontend-design | conditional | frontend-design | -| go | conditional | go | -| java | conditional | java | -| python | conditional | python | -| rust | conditional | rust | -| database | conditional | database-patterns | -| dependencies | conditional | dependencies-patterns | -| documentation | conditional | documentation-patterns | +| security | ✓ | devflow:security-patterns | +| architecture | ✓ | devflow:architecture-patterns | +| performance | ✓ | devflow:performance-patterns | +| complexity | ✓ | devflow:complexity-patterns | +| consistency | ✓ | devflow:consistency-patterns | +| regression | ✓ | devflow:regression-patterns | +| tests | ✓ | devflow:test-patterns | +| typescript | conditional | devflow:typescript | +| react | conditional | devflow:react | +| accessibility | conditional | devflow:accessibility | +| frontend-design | conditional | devflow:frontend-design | +| go | conditional | devflow:go | +| java | conditional | devflow:java | +| python | conditional | devflow:python | +| rust | conditional | devflow:rust | +| database | conditional | devflow:database-patterns | +| dependencies | conditional | devflow:dependencies-patterns | +| documentation | conditional | devflow:documentation-patterns | Each Reviewer invocation (all in one message, **NOT background**): ``` Task(subagent_type="Reviewer", run_in_background=false): -"Review focusing on {focus}. Apply {focus}-patterns. -Follow 6-step process from review-methodology. +"Review focusing on {focus}. Apply devflow:{focus}-patterns. +Follow 6-step process from devflow:review-methodology. PR: #{pr_number}, Base: {base_branch} WORKTREE_PATH: {worktree_path} (omit if cwd) DIFF_COMMAND: git -C {WORKTREE_PATH} diff {DIFF_RANGE} (omit -C flag if no WORKTREE_PATH) @@ -165,7 +165,7 @@ In multi-worktree mode, report results per worktree. **IMPORTANT**: Run sequentially across all worktrees (not in parallel) to avoid GitHub API conflicts. Per worktree, if the review summary contains CRITICAL or HIGH blocking issues: -1. Read `~/.claude/skills/knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` +1. Read `~/.claude/skills/devflow:knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` 2. Source field: `/code-review {branch}` 3. Skip entirely if no CRITICAL/HIGH blocking issues diff --git a/plugins/devflow-debug/commands/debug-teams.md b/plugins/devflow-debug/commands/debug-teams.md index 916acc0d..efd67411 100644 --- a/plugins/devflow-debug/commands/debug-teams.md +++ b/plugins/devflow-debug/commands/debug-teams.md @@ -196,7 +196,7 @@ Lead produces final report: ### Phase 9: Record Pitfall (if root cause found) If root cause was identified with HIGH or MEDIUM confidence: -1. Read `~/.claude/skills/knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` +1. Read `~/.claude/skills/devflow:knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` 2. Source field: `/debug {bug description}` ## Architecture diff --git a/plugins/devflow-debug/commands/debug.md b/plugins/devflow-debug/commands/debug.md index 27f4ee53..ac3b65c5 100644 --- a/plugins/devflow-debug/commands/debug.md +++ b/plugins/devflow-debug/commands/debug.md @@ -136,7 +136,7 @@ Produce the final report: ### Phase 6: Record Pitfall (if root cause found) If root cause was identified with HIGH or MEDIUM confidence: -1. Read `~/.claude/skills/knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` +1. Read `~/.claude/skills/devflow:knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` 2. Source field: `/debug {bug description}` ## Architecture diff --git a/plugins/devflow-implement/commands/implement-teams.md b/plugins/devflow-implement/commands/implement-teams.md index 924828d0..bbd9aea9 100644 --- a/plugins/devflow-implement/commands/implement-teams.md +++ b/plugins/devflow-implement/commands/implement-teams.md @@ -68,7 +68,7 @@ Spawn exploration teammates with self-contained prompts: - Name: "architecture-explorer" Prompt: | You are exploring a codebase for task: {task description} - 1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:implementation-patterns/SKILL.md` 2. Read `.memory/knowledge/decisions.md` and `.memory/knowledge/pitfalls.md` if they exist. Consider prior decisions and known pitfalls relevant to this task. 3. Skimmer context (files/patterns already identified): @@ -82,7 +82,7 @@ Spawn exploration teammates with self-contained prompts: - Name: "integration-explorer" Prompt: | You are exploring a codebase for task: {task description} - 1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:implementation-patterns/SKILL.md` 2. Read `.memory/knowledge/decisions.md` and `.memory/knowledge/pitfalls.md` if they exist. Consider prior decisions and known pitfalls relevant to this task. 3. Skimmer context (files/patterns already identified): @@ -96,7 +96,7 @@ Spawn exploration teammates with self-contained prompts: - Name: "reusable-code-explorer" Prompt: | You are exploring a codebase for task: {task description} - 1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:implementation-patterns/SKILL.md` 2. Read `.memory/knowledge/decisions.md` and `.memory/knowledge/pitfalls.md` if they exist. Consider prior decisions and known pitfalls relevant to this task. 3. Skimmer context (files/patterns already identified): @@ -110,7 +110,7 @@ Spawn exploration teammates with self-contained prompts: - Name: "edge-case-explorer" Prompt: | You are exploring a codebase for task: {task description} - 1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:implementation-patterns/SKILL.md` 2. Read `.memory/knowledge/decisions.md` and `.memory/knowledge/pitfalls.md` if they exist. Consider prior decisions and known pitfalls relevant to this task. 3. Skimmer context (files/patterns already identified): @@ -175,7 +175,7 @@ Spawn planning teammates with self-contained prompts: - Name: "implementation-planner" Prompt: | You are planning implementation for task: {task description} - 1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:implementation-patterns/SKILL.md` 2. Exploration synthesis (what we know about the codebase): {synthesis output from Phase 4} 3. Your deliverable: Step-by-step coding approach with specific files @@ -186,7 +186,7 @@ Spawn planning teammates with self-contained prompts: - Name: "testing-planner" Prompt: | You are planning the test strategy for task: {task description} - 1. Read your skill: `Read ~/.claude/skills/test-patterns/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:test-patterns/SKILL.md` 2. Exploration synthesis (what we know about the codebase): {synthesis output from Phase 4} 3. Your deliverable: Test strategy — unit tests, integration tests, @@ -197,7 +197,7 @@ Spawn planning teammates with self-contained prompts: - Name: "risk-planner" Prompt: | You are assessing risk and execution strategy for task: {task description} - 1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:implementation-patterns/SKILL.md` 2. Exploration synthesis (what we know about the codebase): {synthesis output from Phase 4} 3. Your deliverable: Risk assessment, rollback strategy, and execution @@ -523,7 +523,7 @@ Step 3: GATE — Verify TeamDelete succeeded ### Phase 13: Create PR -**For SEQUENTIAL_CODERS or PARALLEL_CODERS**: The last sequential Coder (with CREATE_PR: true) handles PR creation. For parallel coders, create unified PR using `git-workflow` skill patterns. Push branch and run `gh pr create` with comprehensive description, targeting `BASE_BRANCH`. +**For SEQUENTIAL_CODERS or PARALLEL_CODERS**: The last sequential Coder (with CREATE_PR: true) handles PR creation. For parallel coders, create unified PR using `devflow:git-workflow` skill patterns. Push branch and run `gh pr create` with comprehensive description, targeting `BASE_BRANCH`. **For SINGLE_CODER**: PR is created by the Coder agent (CREATE_PR: true). @@ -534,7 +534,7 @@ Display completion summary with phase status, PR info, and next steps. ### Phase 15: Record Decisions (if any) If the Coder's report includes Key Decisions with architectural significance: -1. Read `~/.claude/skills/knowledge-persistence/SKILL.md` and follow its extraction procedure to record decisions to `.memory/knowledge/decisions.md` +1. Read `~/.claude/skills/devflow:knowledge-persistence/SKILL.md` and follow its extraction procedure to record decisions to `.memory/knowledge/decisions.md` 2. Source field: `/implement {TASK_ID}` 3. Skip entirely if no architectural decisions were made diff --git a/plugins/devflow-implement/commands/implement.md b/plugins/devflow-implement/commands/implement.md index 4403f97e..f3784c84 100644 --- a/plugins/devflow-implement/commands/implement.md +++ b/plugins/devflow-implement/commands/implement.md @@ -336,7 +336,7 @@ Validate alignment with request and plan. Report ALIGNED or MISALIGNED with deta ### Phase 13: Create PR -**For SEQUENTIAL_CODERS or PARALLEL_CODERS**: The last sequential Coder (with CREATE_PR: true) handles PR creation. For parallel coders, create unified PR using `git-workflow` skill patterns. Push branch and run `gh pr create` with comprehensive description, targeting `BASE_BRANCH`. +**For SEQUENTIAL_CODERS or PARALLEL_CODERS**: The last sequential Coder (with CREATE_PR: true) handles PR creation. For parallel coders, create unified PR using `devflow:git-workflow` skill patterns. Push branch and run `gh pr create` with comprehensive description, targeting `BASE_BRANCH`. **For SINGLE_CODER**: PR is created by the Coder agent (CREATE_PR: true). @@ -347,7 +347,7 @@ Display completion summary with phase status, PR info, and next steps. ### Phase 15: Record Decisions (if any) If the Coder's report includes Key Decisions with architectural significance: -1. Read `~/.claude/skills/knowledge-persistence/SKILL.md` and follow its extraction procedure to record decisions to `.memory/knowledge/decisions.md` +1. Read `~/.claude/skills/devflow:knowledge-persistence/SKILL.md` and follow its extraction procedure to record decisions to `.memory/knowledge/decisions.md` 2. Source field: `/implement {TASK_ID}` 3. Skip entirely if no architectural decisions were made diff --git a/plugins/devflow-resolve/commands/resolve-teams.md b/plugins/devflow-resolve/commands/resolve-teams.md index 13d207a5..3108d11f 100644 --- a/plugins/devflow-resolve/commands/resolve-teams.md +++ b/plugins/devflow-resolve/commands/resolve-teams.md @@ -21,9 +21,9 @@ Process issues from code review reports: validate them (false positive check), a #### Step 0a: Discover Worktrees -1. **Discover resolvable worktrees** using the `worktree-support` skill discovery algorithm: +1. **Discover resolvable worktrees** using the `devflow:worktree-support` skill discovery algorithm: - Run `git worktree list --porcelain` → parse, filter (skip protected/detached/mid-rebase), dedup by branch, sort by recent commit - - See `~/.claude/skills/worktree-support/SKILL.md` for the full 7-step algorithm and canonical protected branch list + - See `~/.claude/skills/devflow:worktree-support/SKILL.md` for the full 7-step algorithm and canonical protected branch list - Additional filter: must have unresolved reviews (latest review directory has no `resolution-summary.md`) 2. **If `--path` flag provided:** use only that worktree, skip discovery **`--path` validation**: Before proceeding, verify the path exists as a directory and appears in `git worktree list` output. If not: report error and stop. @@ -119,7 +119,7 @@ Spawn resolver teammates with self-contained prompts (one per independent batch) Prompt: | You are resolving review issues on branch {branch} (PR #{pr_number}). WORKTREE_PATH: {worktree_path} (omit if cwd) - 1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:implementation-patterns/SKILL.md` 2. Your issues to resolve: {batch 1 issues — full structured list with id, file, line, severity, type, description, suggested_fix} 3. For each issue: @@ -136,7 +136,7 @@ Spawn resolver teammates with self-contained prompts (one per independent batch) Prompt: | You are resolving review issues on branch {branch} (PR #{pr_number}). WORKTREE_PATH: {worktree_path} (omit if cwd) - 1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md` + 1. Read your skill: `Read ~/.claude/skills/devflow:implementation-patterns/SKILL.md` 2. Your issues to resolve: {batch 2 issues — full structured list with id, file, line, severity, type, description, suggested_fix} 3. For each issue: @@ -193,7 +193,7 @@ Aggregate from all Resolvers: **IMPORTANT**: Run sequentially across all worktrees (not in parallel) to avoid GitHub API conflicts. For each issue deferred as TECH_DEBT: -1. Read `~/.claude/skills/knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` +1. Read `~/.claude/skills/devflow:knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` 2. Source field: `/resolve {branch}` 3. Skip entirely if no TECH_DEBT deferrals diff --git a/plugins/devflow-resolve/commands/resolve.md b/plugins/devflow-resolve/commands/resolve.md index b4e75e0e..72dd6cb8 100644 --- a/plugins/devflow-resolve/commands/resolve.md +++ b/plugins/devflow-resolve/commands/resolve.md @@ -21,9 +21,9 @@ Process issues from code review reports: validate them (false positive check), a #### Step 0a: Discover Worktrees -1. **Discover resolvable worktrees** using the `worktree-support` skill discovery algorithm: +1. **Discover resolvable worktrees** using the `devflow:worktree-support` skill discovery algorithm: - Run `git worktree list --porcelain` → parse, filter (skip protected/detached/mid-rebase), dedup by branch, sort by recent commit - - See `~/.claude/skills/worktree-support/SKILL.md` for the full 7-step algorithm and canonical protected branch list + - See `~/.claude/skills/devflow:worktree-support/SKILL.md` for the full 7-step algorithm and canonical protected branch list - Additional filter: must have unresolved reviews (latest review directory has no `resolution-summary.md`) 2. **If `--path` flag provided:** use only that worktree, skip discovery **`--path` validation**: Before proceeding, verify the path exists as a directory and appears in `git worktree list` output. If not: report error and stop. @@ -130,7 +130,7 @@ Aggregate from all Resolvers: **IMPORTANT**: Run sequentially across all worktrees (not in parallel) to avoid GitHub API conflicts. For each issue deferred as TECH_DEBT: -1. Read `~/.claude/skills/knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` +1. Read `~/.claude/skills/devflow:knowledge-persistence/SKILL.md` and follow its extraction procedure to record pitfalls to `.memory/knowledge/pitfalls.md` 2. Source field: `/resolve {branch}` 3. Skip entirely if no TECH_DEBT deferrals diff --git a/plugins/devflow-resolve/skills/security-patterns/SKILL.md b/plugins/devflow-resolve/skills/security-patterns/SKILL.md index 3b93f2a7..da1f7c0e 100644 --- a/plugins/devflow-resolve/skills/security-patterns/SKILL.md +++ b/plugins/devflow-resolve/skills/security-patterns/SKILL.md @@ -7,7 +7,7 @@ allowed-tools: Read, Grep, Glob # Security Patterns -Domain expertise for security vulnerability detection. Use alongside `review-methodology` for complete security reviews. +Domain expertise for security vulnerability detection. Use alongside `devflow:review-methodology` for complete security reviews. ## Iron Law diff --git a/scripts/hooks/ambient-prompt b/scripts/hooks/ambient-prompt index dd9d1a1a..1acd3c09 100755 --- a/scripts/hooks/ambient-prompt +++ b/scripts/hooks/ambient-prompt @@ -41,15 +41,15 @@ REVIEW depth: continuation-aware (match prior IMPLEMENT depth) or signal-word ba RESOLVE: always ORCHESTRATED. PIPELINE (end-to-end/implement and review): always ORCHESTRATED. MULTI_WORKTREE: all worktrees/branches, each worktree, review everything, resolve all → ORCHESTRATED. Follow code-review/resolve command flow (auto-discovers worktrees). GUIDED/ORCHESTRATED: Call Skill tool for ALL skills listed for intent — one Skill call per skill, before ANY text. -IMPLEMENT → test-driven-development, implementation-patterns, search-first -DEBUG → core-patterns, test-patterns -REVIEW/GUIDED → self-review, core-patterns -REVIEW/ORCHESTRATED → review-orchestration -RESOLVE → resolve-orchestration, core-patterns -PIPELINE → pipeline-orchestration, implementation-patterns -PLAN → implementation-patterns, core-patterns -Also add if file type matches: typescript, react, go, java, python, rust, input-validation, security-patterns, frontend-design -ORCHESTRATED also add: implementation-orchestration / debug-orchestration / plan-orchestration / review-orchestration / resolve-orchestration / pipeline-orchestration +IMPLEMENT → devflow:test-driven-development, devflow:implementation-patterns, devflow:search-first +DEBUG → devflow:core-patterns, devflow:test-patterns +REVIEW/GUIDED → devflow:self-review, devflow:core-patterns +REVIEW/ORCHESTRATED → devflow:review-orchestration +RESOLVE → devflow:resolve-orchestration, devflow:core-patterns +PIPELINE → devflow:pipeline-orchestration, devflow:implementation-patterns +PLAN → devflow:implementation-patterns, devflow:core-patterns +Also add if file type matches: devflow:typescript, devflow:react, devflow:go, devflow:java, devflow:python, devflow:rust, devflow:input-validation, devflow:security-patterns, devflow:frontend-design +ORCHESTRATED also add: devflow:implementation-orchestration / devflow:debug-orchestration / devflow:plan-orchestration / devflow:review-orchestration / devflow:resolve-orchestration / devflow:pipeline-orchestration State: Ambient: INTENT/DEPTH. Loading: skills. Then proceed." json_prompt_output "$PREAMBLE" diff --git a/scripts/hooks/session-start-memory b/scripts/hooks/session-start-memory index 75eaf97e..4d300cc1 100644 --- a/scripts/hooks/session-start-memory +++ b/scripts/hooks/session-start-memory @@ -205,8 +205,8 @@ fi # Inject ambient-router SKILL.md directly into context so Claude doesn't need a Read call. # Only injects when ambient mode is enabled (UserPromptSubmit hook present in settings). -AMBIENT_SKILL_PATH="$HOME/.claude/skills/ambient-router/SKILL.md" -[ ! -f "$AMBIENT_SKILL_PATH" ] && AMBIENT_SKILL_PATH="$CWD/.claude/skills/ambient-router/SKILL.md" +AMBIENT_SKILL_PATH="$HOME/.claude/skills/devflow:ambient-router/SKILL.md" +[ ! -f "$AMBIENT_SKILL_PATH" ] && AMBIENT_SKILL_PATH="$CWD/.claude/skills/devflow:ambient-router/SKILL.md" SETTINGS_FILE="$HOME/.claude/settings.json" if [ -f "$AMBIENT_SKILL_PATH" ] && [ -f "$SETTINGS_FILE" ] && grep -q "ambient-prompt" "$SETTINGS_FILE" 2>/dev/null; then diff --git a/shared/agents/coder.md b/shared/agents/coder.md index 5a7474b5..36fa3334 100644 --- a/shared/agents/coder.md +++ b/shared/agents/coder.md @@ -2,7 +2,7 @@ name: Coder description: Autonomous task implementation on feature branch. Implements, tests, and commits. model: sonnet -skills: core-patterns, git-safety, implementation-patterns, git-workflow, test-patterns, test-driven-development, search-first, input-validation, worktree-support +skills: devflow:core-patterns, devflow:git-safety, devflow:implementation-patterns, devflow:git-workflow, devflow:test-patterns, devflow:test-driven-development, devflow:search-first, devflow:input-validation, devflow:worktree-support --- # Coder Agent @@ -22,7 +22,7 @@ You receive from orchestrator: **Domain hint** (optional): - **DOMAIN**: `backend` | `frontend` | `tests` | `fullstack` - Load/apply relevant domain skills -**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `worktree-support` skill for path resolution. If omitted, use cwd. +**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd. **Sequential execution context** (when part of multi-Coder chain): - **PRIOR_PHASE_SUMMARY**: Implementation summary from previous Coder (see format below) @@ -42,13 +42,13 @@ You receive from orchestrator: - If `.docs/handoff.md` exists, read it for prior phase context. Cross-reference against actual code — code is authoritative, handoff is supplementary. 2. **Load domain skills**: Based on DOMAIN hint and files in scope, dynamically load relevant language/ecosystem skills by reading their SKILL.md. Only load skills that are installed: - - `backend` (TypeScript): Read `~/.claude/skills/typescript/SKILL.md`, `~/.claude/skills/input-validation/SKILL.md` - - `backend` (Go): Read `~/.claude/skills/go/SKILL.md` - - `backend` (Java): Read `~/.claude/skills/java/SKILL.md` - - `backend` (Python): Read `~/.claude/skills/python/SKILL.md` - - `backend` (Rust): Read `~/.claude/skills/rust/SKILL.md` - - `frontend`: Read `~/.claude/skills/react/SKILL.md`, `~/.claude/skills/typescript/SKILL.md`, `~/.claude/skills/accessibility/SKILL.md`, `~/.claude/skills/frontend-design/SKILL.md` - - `tests`: Read `~/.claude/skills/test-patterns/SKILL.md`, `~/.claude/skills/typescript/SKILL.md` + - `backend` (TypeScript): Read `~/.claude/skills/devflow:typescript/SKILL.md`, `~/.claude/skills/devflow:input-validation/SKILL.md` + - `backend` (Go): Read `~/.claude/skills/devflow:go/SKILL.md` + - `backend` (Java): Read `~/.claude/skills/devflow:java/SKILL.md` + - `backend` (Python): Read `~/.claude/skills/devflow:python/SKILL.md` + - `backend` (Rust): Read `~/.claude/skills/devflow:rust/SKILL.md` + - `frontend`: Read `~/.claude/skills/devflow:react/SKILL.md`, `~/.claude/skills/devflow:typescript/SKILL.md`, `~/.claude/skills/devflow:accessibility/SKILL.md`, `~/.claude/skills/devflow:frontend-design/SKILL.md` + - `tests`: Read `~/.claude/skills/devflow:test-patterns/SKILL.md`, `~/.claude/skills/devflow:typescript/SKILL.md` - `fullstack`: Combine backend + frontend skills - If a Read fails (skill not installed), skip it silently and continue. diff --git a/shared/agents/git.md b/shared/agents/git.md index 0c30662a..e744a589 100644 --- a/shared/agents/git.md +++ b/shared/agents/git.md @@ -2,7 +2,7 @@ name: Git description: Unified agent for all git/GitHub operations - issues, PR comments, tech debt, releases model: haiku -skills: github-patterns, git-safety, git-workflow, worktree-support +skills: devflow:github-patterns, devflow:git-safety, devflow:git-workflow, devflow:worktree-support --- # Git Agent @@ -15,7 +15,7 @@ The orchestrator provides: - **OPERATION**: Which task to perform - **Operation-specific parameters**: See each operation below -**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `worktree-support` skill for path resolution. If omitted, use cwd. +**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd. ## Operations @@ -39,9 +39,9 @@ Pre-flight checks and fixes for `/code-review`. Ensures branch is ready for code **Process:** 1. Verify on feature branch (not main/master/develop/release/*/staging/production) - error if not -2. Check for uncommitted changes - if any, create atomic commit using `git-workflow` patterns +2. Check for uncommitted changes - if any, create atomic commit using `devflow:git-workflow` patterns 3. Check if branch pushed to remote - if not, push with `-u` flag -4. Check if PR exists - if not, create PR using `git-workflow` patterns +4. Check if PR exists - if not, create PR using `devflow:git-workflow` patterns 5. Get base branch from PR 6. Derive branch-slug (replace `/` with `-`) @@ -210,7 +210,7 @@ Update tech debt backlog with pre-existing issues from code review. **Process:** 1. Find or create "Tech Debt Backlog" issue with `tech-debt` label -2. Check issue body size; archive if > 60000 chars (per github-patterns) +2. Check issue body size; archive if > 60000 chars (per devflow:github-patterns) 3. Extract pre-existing issues (Category 3) from review reports 4. Deduplicate against existing items using semantic matching 5. Remove items that have been fixed (verify in codebase) diff --git a/shared/agents/resolver.md b/shared/agents/resolver.md index 04e3431a..44df2cd4 100644 --- a/shared/agents/resolver.md +++ b/shared/agents/resolver.md @@ -2,7 +2,7 @@ name: Resolver description: Validates review issues, implements fixes with risk-proportional care. Tech debt only for architectural overhauls. model: sonnet -skills: core-patterns, git-safety, implementation-patterns, git-workflow, worktree-support +skills: devflow:core-patterns, devflow:git-safety, devflow:implementation-patterns, devflow:git-workflow, devflow:worktree-support --- # Resolver Agent @@ -16,7 +16,7 @@ You receive from orchestrator: - **BRANCH**: Current branch slug - **BATCH_ID**: Identifier for this batch of issues -**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `worktree-support` skill for path resolution. If omitted, use cwd. +**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd. ## Responsibilities diff --git a/shared/agents/reviewer.md b/shared/agents/reviewer.md index 4beb8465..7a793351 100644 --- a/shared/agents/reviewer.md +++ b/shared/agents/reviewer.md @@ -2,12 +2,12 @@ name: Reviewer description: Universal code review agent with parameterized focus. Dynamically loads pattern skill for assigned focus area. model: opus -skills: review-methodology, worktree-support +skills: devflow:review-methodology, devflow:worktree-support --- # Reviewer Agent -You are a universal code review agent. Your focus area is specified in the prompt. You dynamically load the pattern skill for your focus area, then apply the 6-step review process from `review-methodology`. +You are a universal code review agent. Your focus area is specified in the prompt. You dynamically load the pattern skill for your focus area, then apply the 6-step review process from `devflow:review-methodology`. ## Input @@ -17,30 +17,30 @@ The orchestrator provides: - **Output path**: Where to save findings (e.g., `.docs/reviews/{branch}/{timestamp}/{focus}.md`) - **DIFF_COMMAND** (optional): Specific diff command to use (e.g., `git diff {sha}...HEAD` for incremental reviews). If not provided, default to `git diff {base_branch}...HEAD`. -**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `worktree-support` skill for path resolution. If omitted, use cwd. +**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd. ## Focus Areas | Focus | Pattern Skill File (Read this first) | |-------|--------------------------------------| -| `security` | `~/.claude/skills/security-patterns/SKILL.md` | -| `architecture` | `~/.claude/skills/architecture-patterns/SKILL.md` | -| `performance` | `~/.claude/skills/performance-patterns/SKILL.md` | -| `complexity` | `~/.claude/skills/complexity-patterns/SKILL.md` | -| `consistency` | `~/.claude/skills/consistency-patterns/SKILL.md` | -| `regression` | `~/.claude/skills/regression-patterns/SKILL.md` | -| `tests` | `~/.claude/skills/test-patterns/SKILL.md` | -| `typescript` | `~/.claude/skills/typescript/SKILL.md` | -| `database` | `~/.claude/skills/database-patterns/SKILL.md` | -| `dependencies` | `~/.claude/skills/dependencies-patterns/SKILL.md` | -| `documentation` | `~/.claude/skills/documentation-patterns/SKILL.md` | -| `react` | `~/.claude/skills/react/SKILL.md` | -| `accessibility` | `~/.claude/skills/accessibility/SKILL.md` | -| `frontend-design` | `~/.claude/skills/frontend-design/SKILL.md` | -| `go` | `~/.claude/skills/go/SKILL.md` | -| `java` | `~/.claude/skills/java/SKILL.md` | -| `python` | `~/.claude/skills/python/SKILL.md` | -| `rust` | `~/.claude/skills/rust/SKILL.md` | +| `security` | `~/.claude/skills/devflow:security-patterns/SKILL.md` | +| `architecture` | `~/.claude/skills/devflow:architecture-patterns/SKILL.md` | +| `performance` | `~/.claude/skills/devflow:performance-patterns/SKILL.md` | +| `complexity` | `~/.claude/skills/devflow:complexity-patterns/SKILL.md` | +| `consistency` | `~/.claude/skills/devflow:consistency-patterns/SKILL.md` | +| `regression` | `~/.claude/skills/devflow:regression-patterns/SKILL.md` | +| `tests` | `~/.claude/skills/devflow:test-patterns/SKILL.md` | +| `typescript` | `~/.claude/skills/devflow:typescript/SKILL.md` | +| `database` | `~/.claude/skills/devflow:database-patterns/SKILL.md` | +| `dependencies` | `~/.claude/skills/devflow:dependencies-patterns/SKILL.md` | +| `documentation` | `~/.claude/skills/devflow:documentation-patterns/SKILL.md` | +| `react` | `~/.claude/skills/devflow:react/SKILL.md` | +| `accessibility` | `~/.claude/skills/devflow:accessibility/SKILL.md` | +| `frontend-design` | `~/.claude/skills/devflow:frontend-design/SKILL.md` | +| `go` | `~/.claude/skills/devflow:go/SKILL.md` | +| `java` | `~/.claude/skills/devflow:java/SKILL.md` | +| `python` | `~/.claude/skills/devflow:python/SKILL.md` | +| `rust` | `~/.claude/skills/devflow:rust/SKILL.md` | ## Responsibilities @@ -78,7 +78,7 @@ Before writing your report, apply these noise reduction rules: 2. **Skip stylistic preferences** — Do not flag formatting, naming style, or code organization choices unless they violate explicit project conventions found in CLAUDE.md, .editorconfig, or linter configs 3. **Skip issues in unchanged code** — Pre-existing issues in lines you did NOT change should only be reported if CRITICAL severity (security vulnerabilities, data loss risks) -## Issue Categories (from review-methodology) +## Issue Categories (from devflow:review-methodology) | Category | Description | Priority | |----------|-------------|----------| diff --git a/shared/agents/scrutinizer.md b/shared/agents/scrutinizer.md index 79925a58..c67f728f 100644 --- a/shared/agents/scrutinizer.md +++ b/shared/agents/scrutinizer.md @@ -2,7 +2,7 @@ name: Scrutinizer description: Self-review agent that evaluates and fixes implementation issues using 9-pillar framework. Runs in fresh context after Coder completes. model: opus -skills: self-review, core-patterns, worktree-support +skills: devflow:self-review, devflow:core-patterns, devflow:worktree-support --- # Scrutinizer Agent @@ -15,7 +15,7 @@ You receive from orchestrator: - **TASK_DESCRIPTION**: What was implemented - **FILES_CHANGED**: List of modified files from Coder output -**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `worktree-support` skill for path resolution. If omitted, use cwd. +**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd. ## Responsibilities diff --git a/shared/agents/shepherd.md b/shared/agents/shepherd.md index 6f17c379..17c1a3fa 100644 --- a/shared/agents/shepherd.md +++ b/shared/agents/shepherd.md @@ -2,7 +2,7 @@ name: Shepherd description: Validates implementation aligns with original request and plan. Catches missed requirements, scope creep, and intent drift. Reports misalignments for Coder to fix. model: opus -skills: core-patterns, worktree-support +skills: devflow:core-patterns, devflow:worktree-support --- # Shepherd Agent @@ -17,7 +17,7 @@ You receive from orchestrator: - **FILES_CHANGED**: List of modified files from Coder output - **ACCEPTANCE_CRITERIA**: Extracted acceptance criteria (if any) -**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `worktree-support` skill for path resolution. If omitted, use cwd. +**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd. ## Responsibilities diff --git a/shared/agents/simplifier.md b/shared/agents/simplifier.md index 8fefdc3d..d5850a45 100644 --- a/shared/agents/simplifier.md +++ b/shared/agents/simplifier.md @@ -1,7 +1,7 @@ --- name: Simplifier description: Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise. -skills: core-patterns, worktree-support +skills: devflow:core-patterns, devflow:worktree-support model: sonnet --- @@ -15,7 +15,7 @@ You receive from orchestrator: - **TASK_DESCRIPTION**: What was implemented - **FILES_CHANGED**: List of modified files from Coder output (optional) -**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `worktree-support` skill for path resolution. If omitted, use cwd. +**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd. ## Responsibilities diff --git a/shared/agents/skimmer.md b/shared/agents/skimmer.md index a80800d5..5d65d3f9 100644 --- a/shared/agents/skimmer.md +++ b/shared/agents/skimmer.md @@ -2,7 +2,7 @@ name: Skimmer description: Codebase orientation using rskim to identify relevant files, functions, and patterns for a feature or task tools: ["Bash", "Read"] -skills: knowledge-persistence, worktree-support +skills: devflow:knowledge-persistence, devflow:worktree-support model: sonnet --- @@ -15,7 +15,7 @@ You are a codebase orientation specialist. You use `npx rskim` exclusively for c You receive from orchestrator: - **TASK_DESCRIPTION**: What feature/task needs to be implemented or understood -**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `worktree-support` skill for path resolution. If omitted, use cwd. +**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd. ## Workflow diff --git a/shared/agents/synthesizer.md b/shared/agents/synthesizer.md index 56f4b573..d2f94105 100644 --- a/shared/agents/synthesizer.md +++ b/shared/agents/synthesizer.md @@ -2,7 +2,7 @@ name: Synthesizer description: Combines outputs from multiple agents into actionable summaries (modes: exploration, planning, review) model: haiku -skills: review-methodology, docs-framework, worktree-support +skills: devflow:review-methodology, devflow:docs-framework, devflow:worktree-support --- # Synthesizer Agent @@ -16,7 +16,7 @@ The orchestrator provides: - **Agent outputs**: Results from parallel agents to synthesize - **Output path**: Where to save synthesis (if applicable) -**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `worktree-support` skill for path resolution. If omitted, use cwd. +**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd. --- @@ -135,7 +135,7 @@ Synthesize outputs from multiple Reviewer agents. Apply strict merge rules. 3. Apply confidence-aware aggregation: when multiple reviewers flag the same file:line, boost confidence by 10% per additional reviewer (cap at 100%) 4. Maintain ≥80% confidence threshold in final output -5. Categorize issues into 3 buckets (from review-methodology) +5. Categorize issues into 3 buckets (from devflow:review-methodology) 6. Count by severity (CRITICAL, HIGH, MEDIUM, LOW) 7. Determine merge recommendation based on blocking issues diff --git a/shared/agents/validator.md b/shared/agents/validator.md index 6072021f..09b33083 100644 --- a/shared/agents/validator.md +++ b/shared/agents/validator.md @@ -2,7 +2,7 @@ name: Validator description: Dedicated agent for running validation commands (build, typecheck, lint, test). Reports pass/fail with structured failure details - never fixes. model: haiku -skills: test-patterns, worktree-support +skills: devflow:test-patterns, devflow:worktree-support --- # Validator Agent @@ -15,7 +15,7 @@ You receive from orchestrator: - **FILES_CHANGED**: List of modified files - **VALIDATION_SCOPE**: `full` | `changed-only` (hints for test filtering if supported) -**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `worktree-support` skill for path resolution. If omitted, use cwd. +**Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd. ## Responsibilities diff --git a/shared/skills/ambient-router/SKILL.md b/shared/skills/ambient-router/SKILL.md index 5851cc9e..fec08dc6 100644 --- a/shared/skills/ambient-router/SKILL.md +++ b/shared/skills/ambient-router/SKILL.md @@ -73,23 +73,23 @@ Based on classified intent and depth, invoke each selected skill using the Skill | Intent | Primary Skills | Secondary (if file type matches) | |--------|---------------|----------------------------------| -| **IMPLEMENT** | test-driven-development, implementation-patterns, search-first | typescript (.ts), react (.tsx/.jsx), go (.go), java (.java), python (.py), rust (.rs), frontend-design (CSS/UI), input-validation (forms/API), security-patterns (auth/crypto) | -| **DEBUG** | core-patterns, test-patterns | git-safety (if git operations involved) | -| **PLAN** | implementation-patterns, core-patterns | — | -| **REVIEW** | self-review, core-patterns | test-patterns | +| **IMPLEMENT** | devflow:test-driven-development, devflow:implementation-patterns, devflow:search-first | devflow:typescript (.ts), devflow:react (.tsx/.jsx), devflow:go (.go), devflow:java (.java), devflow:python (.py), devflow:rust (.rs), devflow:frontend-design (CSS/UI), devflow:input-validation (forms/API), devflow:security-patterns (auth/crypto) | +| **DEBUG** | devflow:core-patterns, devflow:test-patterns | devflow:git-safety (if git operations involved) | +| **PLAN** | devflow:implementation-patterns, devflow:core-patterns | — | +| **REVIEW** | devflow:self-review, devflow:core-patterns | devflow:test-patterns | ### ORCHESTRATED-depth skills | Intent | Primary Skills | Secondary (if file type matches) | |--------|---------------|----------------------------------| -| **IMPLEMENT** | implementation-orchestration, implementation-patterns | typescript (.ts), react (.tsx/.jsx), go (.go), java (.java), python (.py), rust (.rs), frontend-design (CSS/UI), input-validation (forms/API), security-patterns (auth/crypto) | -| **DEBUG** | debug-orchestration, core-patterns | git-safety (if git operations involved) | -| **PLAN** | plan-orchestration, implementation-patterns, core-patterns | — | -| **REVIEW** | review-orchestration | — (reviewers load their own pattern skills) | -| **RESOLVE** | resolve-orchestration, core-patterns | — | -| **PIPELINE** | pipeline-orchestration, implementation-patterns | — | +| **IMPLEMENT** | devflow:implementation-orchestration, devflow:implementation-patterns | devflow:typescript (.ts), devflow:react (.tsx/.jsx), devflow:go (.go), devflow:java (.java), devflow:python (.py), devflow:rust (.rs), devflow:frontend-design (CSS/UI), devflow:input-validation (forms/API), devflow:security-patterns (auth/crypto) | +| **DEBUG** | devflow:debug-orchestration, devflow:core-patterns | devflow:git-safety (if git operations involved) | +| **PLAN** | devflow:plan-orchestration, devflow:implementation-patterns, devflow:core-patterns | — | +| **REVIEW** | devflow:review-orchestration | — (reviewers load their own pattern skills) | +| **RESOLVE** | devflow:resolve-orchestration, devflow:core-patterns | — | +| **PIPELINE** | devflow:pipeline-orchestration, devflow:implementation-patterns | — | -**Excluded from ambient loading** (loaded by agents internally): review-methodology, complexity-patterns, consistency-patterns, database-patterns, dependencies-patterns, documentation-patterns, regression-patterns, architecture-patterns, accessibility, performance-patterns. These skills are always installed (universal skill installation) but loaded by Reviewer agents at runtime, not by the router. +**Excluded from ambient loading** (loaded by agents internally): devflow:review-methodology, devflow:complexity-patterns, devflow:consistency-patterns, devflow:database-patterns, devflow:dependencies-patterns, devflow:documentation-patterns, devflow:regression-patterns, devflow:architecture-patterns, devflow:accessibility, devflow:performance-patterns. These skills are always installed (universal skill installation) but loaded by Reviewer agents at runtime, not by the router. See `references/skill-catalog.md` for the full skill-to-intent mapping with file pattern triggers. @@ -108,8 +108,8 @@ to all tools (Edit, Write, Bash, Agent, etc.) for implementation work. - **QUICK:** Respond directly. No preamble, no classification statement. -- **GUIDED:** First, invoke each selected skill using the Skill tool. After all Skill tools return, state classification briefly: `Ambient: IMPLEMENT/GUIDED. Loading: implementation-patterns, search-first.` Then work directly in main session. After code changes, spawn Simplifier on changed files. -- **ORCHESTRATED:** First, invoke each selected skill using the Skill tool. After all Skill tools return, state classification briefly: `Ambient: IMPLEMENT/ORCHESTRATED. Loading: implementation-orchestration, implementation-patterns.` Then follow Step 5 for agent orchestration. +- **GUIDED:** First, invoke each selected skill using the Skill tool. After all Skill tools return, state classification briefly: `Ambient: IMPLEMENT/GUIDED. Loading: devflow:implementation-patterns, devflow:search-first.` Then work directly in main session. After code changes, spawn Simplifier on changed files. +- **ORCHESTRATED:** First, invoke each selected skill using the Skill tool. After all Skill tools return, state classification briefly: `Ambient: IMPLEMENT/ORCHESTRATED. Loading: devflow:implementation-orchestration, devflow:implementation-patterns.` Then follow Step 5 for agent orchestration. ### GUIDED Behavior by Intent @@ -126,12 +126,12 @@ After loading skills via Step 3-4, execute the agent pipeline for the classified | Intent | Pipeline | |--------|----------| -| **IMPLEMENT** | Follow implementation-orchestration skill pipeline: pre-flight → plan synthesis → Coder → quality gates | -| **DEBUG** | Follow debug-orchestration skill pipeline: hypotheses → parallel Explores → convergence → report → offer fix | -| **PLAN** | Follow plan-orchestration skill pipeline: Skimmer → Explores → Plan agent → gap validation | -| **REVIEW** | Follow review-orchestration skill pipeline: pre-flight → incremental detection → parallel reviewers → synthesis | -| **RESOLVE** | Follow resolve-orchestration skill pipeline: find review → parse issues → batch → parallel resolvers → simplify | -| **PIPELINE** | Follow pipeline-orchestration skill pipeline: implement → gate → review → gate → resolve | +| **IMPLEMENT** | Follow devflow:implementation-orchestration skill pipeline: pre-flight → plan synthesis → Coder → quality gates | +| **DEBUG** | Follow devflow:debug-orchestration skill pipeline: hypotheses → parallel Explores → convergence → report → offer fix | +| **PLAN** | Follow devflow:plan-orchestration skill pipeline: Skimmer → Explores → Plan agent → gap validation | +| **REVIEW** | Follow devflow:review-orchestration skill pipeline: pre-flight → incremental detection → parallel reviewers → synthesis | +| **RESOLVE** | Follow devflow:resolve-orchestration skill pipeline: find review → parse issues → batch → parallel resolvers → simplify | +| **PIPELINE** | Follow devflow:pipeline-orchestration skill pipeline: implement → gate → review → gate → resolve | | **MULTI_WORKTREE + REVIEW** | Follow `devflow:code-review` command flow (auto-discovers worktrees natively) | | **MULTI_WORKTREE + RESOLVE** | Follow `devflow:resolve` command flow (auto-discovers worktrees natively) | | **EXPLORE** | No agents — respond in main session | diff --git a/shared/skills/ambient-router/references/skill-catalog.md b/shared/skills/ambient-router/references/skill-catalog.md index 39abb7b7..a2e0f93d 100644 --- a/shared/skills/ambient-router/references/skill-catalog.md +++ b/shared/skills/ambient-router/references/skill-catalog.md @@ -10,37 +10,37 @@ These skills may be loaded during GUIDED and ORCHESTRATED-depth ambient routing. | Skill | When to Load | Depth | File Patterns | |-------|-------------|-------|---------------| -| implementation-orchestration | ORCHESTRATED only | ORCHESTRATED | Any — orchestrates agent pipeline | -| test-driven-development | Always for IMPLEMENT | GUIDED + ORCHESTRATED | Any code file — enforces RED-GREEN-REFACTOR | -| implementation-patterns | Always for IMPLEMENT | GUIDED + ORCHESTRATED | Any code file | -| search-first | Always for IMPLEMENT | GUIDED + ORCHESTRATED | Any — enforces research before building | -| typescript | TypeScript files in scope | GUIDED + ORCHESTRATED | `*.ts`, `*.tsx` | -| react | React components in scope | GUIDED + ORCHESTRATED | `*.tsx`, `*.jsx` | -| frontend-design | UI/styling work | GUIDED + ORCHESTRATED | `*.css`, `*.scss`, `*.tsx` with styling keywords | -| input-validation | Forms, APIs, user input | GUIDED + ORCHESTRATED | Files with form/input/validation keywords | -| go | Go files in scope | GUIDED + ORCHESTRATED | `*.go` | -| java | Java files in scope | GUIDED + ORCHESTRATED | `*.java` | -| python | Python files in scope | GUIDED + ORCHESTRATED | `*.py` | -| rust | Rust files in scope | GUIDED + ORCHESTRATED | `*.rs` | -| security-patterns | Auth, crypto, secrets | GUIDED + ORCHESTRATED | Files with auth/token/crypto/password keywords | +| devflow:implementation-orchestration | ORCHESTRATED only | ORCHESTRATED | Any — orchestrates agent pipeline | +| devflow:test-driven-development | Always for IMPLEMENT | GUIDED + ORCHESTRATED | Any code file — enforces RED-GREEN-REFACTOR | +| devflow:implementation-patterns | Always for IMPLEMENT | GUIDED + ORCHESTRATED | Any code file | +| devflow:search-first | Always for IMPLEMENT | GUIDED + ORCHESTRATED | Any — enforces research before building | +| devflow:typescript | TypeScript files in scope | GUIDED + ORCHESTRATED | `*.ts`, `*.tsx` | +| devflow:react | React components in scope | GUIDED + ORCHESTRATED | `*.tsx`, `*.jsx` | +| devflow:frontend-design | UI/styling work | GUIDED + ORCHESTRATED | `*.css`, `*.scss`, `*.tsx` with styling keywords | +| devflow:input-validation | Forms, APIs, user input | GUIDED + ORCHESTRATED | Files with form/input/validation keywords | +| devflow:go | Go files in scope | GUIDED + ORCHESTRATED | `*.go` | +| devflow:java | Java files in scope | GUIDED + ORCHESTRATED | `*.java` | +| devflow:python | Python files in scope | GUIDED + ORCHESTRATED | `*.py` | +| devflow:rust | Rust files in scope | GUIDED + ORCHESTRATED | `*.rs` | +| devflow:security-patterns | Auth, crypto, secrets | GUIDED + ORCHESTRATED | Files with auth/token/crypto/password keywords | ### DEBUG Intent | Skill | When to Load | Depth | File Patterns | |-------|-------------|-------|---------------| -| debug-orchestration | ORCHESTRATED only | ORCHESTRATED | Any — orchestrates investigation pipeline | -| core-patterns | Always for DEBUG | GUIDED + ORCHESTRATED | Any code file | -| test-patterns | Always for DEBUG (GUIDED) | GUIDED | Any code file | -| git-safety | Git operations involved | GUIDED + ORCHESTRATED | User mentions git, rebase, merge, etc. | +| devflow:debug-orchestration | ORCHESTRATED only | ORCHESTRATED | Any — orchestrates investigation pipeline | +| devflow:core-patterns | Always for DEBUG | GUIDED + ORCHESTRATED | Any code file | +| devflow:test-patterns | Always for DEBUG (GUIDED) | GUIDED | Any code file | +| devflow:git-safety | Git operations involved | GUIDED + ORCHESTRATED | User mentions git, rebase, merge, etc. | ### REVIEW Intent | Skill | When to Load | Depth | File Patterns | |-------|-------------|-------|---------------| -| self-review | Always for REVIEW | GUIDED | Any code file | -| core-patterns | Always for REVIEW | GUIDED | Any code file | -| test-patterns | Test files in scope | GUIDED | `*.test.*`, `*.spec.*` | -| review-orchestration | ORCHESTRATED only | ORCHESTRATED | Any — orchestrates multi-agent review pipeline | +| devflow:self-review | Always for REVIEW | GUIDED | Any code file | +| devflow:core-patterns | Always for REVIEW | GUIDED | Any code file | +| devflow:test-patterns | Test files in scope | GUIDED | `*.test.*`, `*.spec.*` | +| devflow:review-orchestration | ORCHESTRATED only | ORCHESTRATED | Any — orchestrates multi-agent review pipeline | **REVIEW depth is continuation-aware**: If the prior classification in the same conversation was IMPLEMENT/GUIDED → REVIEW stays GUIDED. If prior was IMPLEMENT/ORCHESTRATED → REVIEW becomes ORCHESTRATED. Standalone REVIEW uses signal words: "full review"/"branch review"/"PR review" → ORCHESTRATED, "check this"/"review this file" → GUIDED. Ambiguous → GUIDED. @@ -48,8 +48,8 @@ These skills may be loaded during GUIDED and ORCHESTRATED-depth ambient routing. | Skill | When to Load | Depth | File Patterns | |-------|-------------|-------|---------------| -| resolve-orchestration | Always for RESOLVE | ORCHESTRATED | Any — orchestrates issue resolution pipeline | -| core-patterns | Always for RESOLVE | ORCHESTRATED | Any code file | +| devflow:resolve-orchestration | Always for RESOLVE | ORCHESTRATED | Any — orchestrates issue resolution pipeline | +| devflow:core-patterns | Always for RESOLVE | ORCHESTRATED | Any code file | RESOLVE is always ORCHESTRATED — it requires multi-agent resolution with Resolver agents and Simplifier. @@ -57,8 +57,8 @@ RESOLVE is always ORCHESTRATED — it requires multi-agent resolution with Resol | Skill | When to Load | Depth | File Patterns | |-------|-------------|-------|---------------| -| pipeline-orchestration | Always for PIPELINE | ORCHESTRATED | Any — meta-orchestrator for implement → review → resolve | -| implementation-patterns | Always for PIPELINE | ORCHESTRATED | Any code file | +| devflow:pipeline-orchestration | Always for PIPELINE | ORCHESTRATED | Any — meta-orchestrator for implement → review → resolve | +| devflow:implementation-patterns | Always for PIPELINE | ORCHESTRATED | Any code file | PIPELINE is always ORCHESTRATED — it chains multiple orchestration stages with user gates. @@ -66,24 +66,24 @@ PIPELINE is always ORCHESTRATED — it chains multiple orchestration stages with | Skill | When to Load | Depth | File Patterns | |-------|-------------|-------|---------------| -| plan-orchestration | ORCHESTRATED only | ORCHESTRATED | Any — orchestrates design pipeline | -| implementation-patterns | Always for PLAN | GUIDED + ORCHESTRATED | Any planning context | -| core-patterns | Always for PLAN | GUIDED + ORCHESTRATED | System design discussions | +| devflow:plan-orchestration | ORCHESTRATED only | ORCHESTRATED | Any — orchestrates design pipeline | +| devflow:implementation-patterns | Always for PLAN | GUIDED + ORCHESTRATED | Any planning context | +| devflow:core-patterns | Always for PLAN | GUIDED + ORCHESTRATED | System design discussions | ## Skills Excluded from Ambient Router Loading These skills are always installed (universal skill installation) but loaded by agents internally at runtime, not by the ambient router. Reviewer agents load their pattern skill based on their focus area: -- review-methodology — Full review process (6-step, 3-category classification) -- complexity-patterns — Cyclomatic complexity, deep nesting analysis -- consistency-patterns — Naming convention, pattern deviation detection -- database-patterns — Index analysis, query optimization, migration safety -- dependencies-patterns — CVE detection, license audit, outdated packages -- documentation-patterns — Doc drift, stale comments, missing API docs -- regression-patterns — Lost functionality, broken exports, behavioral changes -- architecture-patterns — SOLID analysis, coupling detection, layering issues -- accessibility — WCAG compliance, ARIA roles, keyboard navigation -- performance-patterns — N+1 queries, memory leaks, caching opportunities +- devflow:review-methodology — Full review process (6-step, 3-category classification) +- devflow:complexity-patterns — Cyclomatic complexity, deep nesting analysis +- devflow:consistency-patterns — Naming convention, pattern deviation detection +- devflow:database-patterns — Index analysis, query optimization, migration safety +- devflow:dependencies-patterns — CVE detection, license audit, outdated packages +- devflow:documentation-patterns — Doc drift, stale comments, missing API docs +- devflow:regression-patterns — Lost functionality, broken exports, behavioral changes +- devflow:architecture-patterns — SOLID analysis, coupling detection, layering issues +- devflow:accessibility — WCAG compliance, ARIA roles, keyboard navigation +- devflow:performance-patterns — N+1 queries, memory leaks, caching opportunities ## Multi-Worktree Detection @@ -101,7 +101,7 @@ No additional skills needed — the code-review and resolve commands handle all ## Selection Limits - **Maximum 3 knowledge skills** per ambient response (primary + up to 2 secondary) -- **Orchestration skills** (implementation-orchestration, debug-orchestration, plan-orchestration, review-orchestration, resolve-orchestration, pipeline-orchestration) are loaded only at ORCHESTRATED depth — they don't count toward the knowledge skill limit +- **Orchestration skills** (devflow:implementation-orchestration, devflow:debug-orchestration, devflow:plan-orchestration, devflow:review-orchestration, devflow:resolve-orchestration, devflow:pipeline-orchestration) are loaded only at ORCHESTRATED depth — they don't count toward the knowledge skill limit - **Primary skills** are always loaded for the classified intent at both GUIDED and ORCHESTRATED depth - **Secondary skills** are loaded only when file patterns match conversation context - **GUIDED depth** loads knowledge skills only (no orchestration skills) — main session works directly diff --git a/shared/skills/architecture-patterns/SKILL.md b/shared/skills/architecture-patterns/SKILL.md index 6a74ae57..dd518367 100644 --- a/shared/skills/architecture-patterns/SKILL.md +++ b/shared/skills/architecture-patterns/SKILL.md @@ -7,7 +7,7 @@ allowed-tools: Read, Grep, Glob # Architecture Patterns -Domain expertise for software architecture and design pattern analysis. Use alongside `review-methodology` for complete architecture reviews. +Domain expertise for software architecture and design pattern analysis. Use alongside `devflow:review-methodology` for complete architecture reviews. ## Iron Law diff --git a/shared/skills/complexity-patterns/SKILL.md b/shared/skills/complexity-patterns/SKILL.md index e3a0fec1..f0695329 100644 --- a/shared/skills/complexity-patterns/SKILL.md +++ b/shared/skills/complexity-patterns/SKILL.md @@ -7,7 +7,7 @@ allowed-tools: Read, Grep, Glob # Complexity Patterns -Domain expertise for code complexity and maintainability analysis. Use alongside `review-methodology` for complete complexity reviews. +Domain expertise for code complexity and maintainability analysis. Use alongside `devflow:review-methodology` for complete complexity reviews. ## Iron Law diff --git a/shared/skills/consistency-patterns/SKILL.md b/shared/skills/consistency-patterns/SKILL.md index b1a8ea86..86fe6257 100644 --- a/shared/skills/consistency-patterns/SKILL.md +++ b/shared/skills/consistency-patterns/SKILL.md @@ -7,7 +7,7 @@ allowed-tools: Read, Grep, Glob # Consistency Patterns -Domain expertise for code consistency and unnecessary simplification detection. Use alongside `review-methodology` for complete consistency reviews. +Domain expertise for code consistency and unnecessary simplification detection. Use alongside `devflow:review-methodology` for complete consistency reviews. ## Iron Law diff --git a/shared/skills/database-patterns/SKILL.md b/shared/skills/database-patterns/SKILL.md index 8b9c80f4..b5895dea 100644 --- a/shared/skills/database-patterns/SKILL.md +++ b/shared/skills/database-patterns/SKILL.md @@ -7,7 +7,7 @@ allowed-tools: Read, Grep, Glob # Database Patterns -Domain expertise for database design and optimization. Use alongside `review-methodology` for complete database reviews. +Domain expertise for database design and optimization. Use alongside `devflow:review-methodology` for complete database reviews. ## Iron Law diff --git a/shared/skills/debug-orchestration/SKILL.md b/shared/skills/debug-orchestration/SKILL.md index a47e8102..079fe65c 100644 --- a/shared/skills/debug-orchestration/SKILL.md +++ b/shared/skills/debug-orchestration/SKILL.md @@ -64,7 +64,7 @@ Present root cause analysis: Ask user via AskUserQuestion: "Want me to implement this fix?" -- **YES** → Implement the fix directly in main session using GUIDED approach: load implementation-patterns, search-first, and test-driven-development skills, then code the fix. Spawn `Task(subagent_type="Simplifier")` on changed files after. +- **YES** → Implement the fix directly in main session using GUIDED approach: load devflow:implementation-patterns, devflow:search-first, and devflow:test-driven-development skills, then code the fix. Spawn `Task(subagent_type="Simplifier")` on changed files after. - **NO** → Done. Report stands as documentation. ## Error Handling diff --git a/shared/skills/dependencies-patterns/SKILL.md b/shared/skills/dependencies-patterns/SKILL.md index b7ddb7bb..977ebedf 100644 --- a/shared/skills/dependencies-patterns/SKILL.md +++ b/shared/skills/dependencies-patterns/SKILL.md @@ -7,7 +7,7 @@ allowed-tools: Read, Grep, Glob # Dependencies Patterns -Domain expertise for dependency management and security analysis. Use alongside `review-methodology` for complete dependency reviews. +Domain expertise for dependency management and security analysis. Use alongside `devflow:review-methodology` for complete dependency reviews. ## Iron Law diff --git a/shared/skills/documentation-patterns/SKILL.md b/shared/skills/documentation-patterns/SKILL.md index 42bdbea8..95142f00 100644 --- a/shared/skills/documentation-patterns/SKILL.md +++ b/shared/skills/documentation-patterns/SKILL.md @@ -7,7 +7,7 @@ allowed-tools: Read, Grep, Glob # Documentation Patterns -Domain expertise for documentation quality and alignment. Use alongside `review-methodology` for complete documentation reviews. +Domain expertise for documentation quality and alignment. Use alongside `devflow:review-methodology` for complete documentation reviews. ## Iron Law diff --git a/shared/skills/git-safety/SKILL.md b/shared/skills/git-safety/SKILL.md index 6fa03037..ee36b104 100644 --- a/shared/skills/git-safety/SKILL.md +++ b/shared/skills/git-safety/SKILL.md @@ -112,9 +112,8 @@ See `references/commands.md` for extended recovery and stash workflows. | Skill | Use For | |-------|---------| -| `commit` | Commit message format, atomic grouping | -| `pull-request` | PR descriptions, size assessment | -| `github-patterns` | GitHub API, rate limits, releases | +| `devflow:git-workflow` | Commit messages, atomic grouping, PR descriptions | +| `devflow:github-patterns` | GitHub API, rate limits, releases | ## Extended References diff --git a/shared/skills/git-workflow/SKILL.md b/shared/skills/git-workflow/SKILL.md index 59b5cca3..32a2c586 100644 --- a/shared/skills/git-workflow/SKILL.md +++ b/shared/skills/git-workflow/SKILL.md @@ -7,7 +7,7 @@ allowed-tools: Bash, Read, Grep, Glob # Git Workflow -Atomic commits and honest PR descriptions. Complements git-safety with commit and PR-specific patterns. +Atomic commits and honest PR descriptions. Complements devflow:git-safety with commit and PR-specific patterns. ## Iron Law @@ -116,7 +116,7 @@ Every PR description MUST include these sections: ## Safety Checks -Before staging files, apply sensitive file detection and content scanning patterns from `git-safety` skill. +Before staging files, apply sensitive file detection and content scanning patterns from `devflow:git-safety` skill. ## Pre-Commit Checklist @@ -154,5 +154,5 @@ For extended examples and templates: | Skill | Use For | |-------|---------| -| `git-safety` | Lock handling, sequential ops, sensitive file detection | -| `github-patterns` | GitHub API, rate limits, PR comments, releases | +| `devflow:git-safety` | Lock handling, sequential ops, sensitive file detection | +| `devflow:github-patterns` | GitHub API, rate limits, PR comments, releases | diff --git a/shared/skills/input-validation/references/detection.md b/shared/skills/input-validation/references/detection.md index 8c3b6452..fa82d62b 100644 --- a/shared/skills/input-validation/references/detection.md +++ b/shared/skills/input-validation/references/detection.md @@ -278,6 +278,6 @@ const validation = schema.safeParse(input); This skill works with: -- **core-patterns**: Ensures validation uses Result types, catches fake/incomplete validation -- **test-patterns**: Validates boundary tests exist -- **security-patterns**: Broader security review context +- **devflow:core-patterns**: Ensures validation uses Result types, catches fake/incomplete validation +- **devflow:test-patterns**: Validates boundary tests exist +- **devflow:security-patterns**: Broader security review context diff --git a/shared/skills/performance-patterns/SKILL.md b/shared/skills/performance-patterns/SKILL.md index 49f835ce..7e393c8d 100644 --- a/shared/skills/performance-patterns/SKILL.md +++ b/shared/skills/performance-patterns/SKILL.md @@ -7,7 +7,7 @@ allowed-tools: Read, Grep, Glob # Performance Patterns -Domain expertise for performance optimization and bottleneck detection. Use alongside `review-methodology` for complete performance reviews. +Domain expertise for performance optimization and bottleneck detection. Use alongside `devflow:review-methodology` for complete performance reviews. ## Iron Law diff --git a/shared/skills/pipeline-orchestration/SKILL.md b/shared/skills/pipeline-orchestration/SKILL.md index 1e22d8ad..23852bb1 100644 --- a/shared/skills/pipeline-orchestration/SKILL.md +++ b/shared/skills/pipeline-orchestration/SKILL.md @@ -25,7 +25,7 @@ Classification statement must warn about scope: ## Phase 1: Implement -Follow implementation-orchestration pipeline (Phases 1-6). +Follow devflow:implementation-orchestration pipeline (Phases 1-6). If implementation returns **BLOCKED**: halt entire pipeline, report blocker. @@ -41,7 +41,7 @@ Use AskUserQuestion: ## Phase 3: Review -Follow review-orchestration pipeline (Phases 1-6). +Follow devflow:review-orchestration pipeline (Phases 1-6). Report review results (merge recommendation, issue counts). @@ -58,7 +58,7 @@ If **no blocking issues**: ## Phase 5: Resolve -Follow resolve-orchestration pipeline (Phases 1-6). +Follow devflow:resolve-orchestration pipeline (Phases 1-6). ## Phase 6: Summary diff --git a/shared/skills/regression-patterns/SKILL.md b/shared/skills/regression-patterns/SKILL.md index 179fd91f..da5c125c 100644 --- a/shared/skills/regression-patterns/SKILL.md +++ b/shared/skills/regression-patterns/SKILL.md @@ -7,7 +7,7 @@ allowed-tools: Read, Grep, Glob # Regression Patterns -Domain expertise for detecting functionality regressions and validating implementation intent. Use alongside `review-methodology` for complete regression reviews. +Domain expertise for detecting functionality regressions and validating implementation intent. Use alongside `devflow:review-methodology` for complete regression reviews. ## Iron Law diff --git a/shared/skills/review-methodology/SKILL.md b/shared/skills/review-methodology/SKILL.md index 1a6ee316..6a49ee45 100644 --- a/shared/skills/review-methodology/SKILL.md +++ b/shared/skills/review-methodology/SKILL.md @@ -104,16 +104,16 @@ This methodology is used by the **Reviewer** agent with different focus areas: | Focus | Pattern Skill | |-------|---------------| -| `security` | security-patterns | -| `performance` | performance-patterns | -| `architecture` | architecture-patterns | -| `tests` | test-patterns | -| `consistency` | consistency-patterns | -| `complexity` | complexity-patterns | -| `regression` | regression-patterns | -| `dependencies` | dependencies-patterns | -| `documentation` | documentation-patterns | -| `typescript` | typescript | -| `database` | database-patterns | +| `security` | devflow:security-patterns | +| `performance` | devflow:performance-patterns | +| `architecture` | devflow:architecture-patterns | +| `tests` | devflow:test-patterns | +| `consistency` | devflow:consistency-patterns | +| `complexity` | devflow:complexity-patterns | +| `regression` | devflow:regression-patterns | +| `dependencies` | devflow:dependencies-patterns | +| `documentation` | devflow:documentation-patterns | +| `typescript` | devflow:typescript | +| `database` | devflow:database-patterns | The Reviewer agent loads all pattern skills and applies the relevant one based on the focus area specified in its invocation prompt. diff --git a/shared/skills/security-patterns/SKILL.md b/shared/skills/security-patterns/SKILL.md index 3b93f2a7..da1f7c0e 100644 --- a/shared/skills/security-patterns/SKILL.md +++ b/shared/skills/security-patterns/SKILL.md @@ -7,7 +7,7 @@ allowed-tools: Read, Grep, Glob # Security Patterns -Domain expertise for security vulnerability detection. Use alongside `review-methodology` for complete security reviews. +Domain expertise for security vulnerability detection. Use alongside `devflow:review-methodology` for complete security reviews. ## Iron Law diff --git a/shared/skills/test-driven-development/SKILL.md b/shared/skills/test-driven-development/SKILL.md index f21b9e8e..19fed6e9 100644 --- a/shared/skills/test-driven-development/SKILL.md +++ b/shared/skills/test-driven-development/SKILL.md @@ -122,7 +122,7 @@ When implementing any feature under ambient IMPLEMENT/GUIDED or IMPLEMENT/ORCHES - **QUICK depth** — Ambient classified as QUICK (chat, exploration, trivial edits) - **Non-code tasks** — Documentation, configuration, CI changes - **Exploratory prototyping** — User explicitly says "just spike this" or "prototype" -- **Existing test suite changes** — Modifying tests themselves (test-patterns skill applies instead) +- **Existing test suite changes** — Modifying tests themselves (devflow:test-patterns skill applies instead) When skipping TDD, never rationalize. State clearly: "Skipping TDD because: [specific reason from list above]." diff --git a/src/cli/commands/init.ts b/src/cli/commands/init.ts index 5f00ce42..995ac039 100644 --- a/src/cli/commands/init.ts +++ b/src/cli/commands/init.ts @@ -911,12 +911,12 @@ export const initCommand = new Command('init') // Managed settings (last install step — sudo may prompt for password) if (securityMode === 'managed' && managedSettingsConfirmed) { - s.stop('Installing managed settings (may prompt for password)'); + s.stop('Configuring managed settings (may prompt for sudo password)...'); const managed = await installManagedSettings(rootDir, verbose); if (!managed) { p.log.warn('Managed settings write failed — falling back to user settings'); } - s.start('Finalizing'); + s.start('Finalizing installation...'); } s.stop('Installation complete'); diff --git a/src/cli/commands/skills.ts b/src/cli/commands/skills.ts index 270ec6ed..6c9eb2a2 100644 --- a/src/cli/commands/skills.ts +++ b/src/cli/commands/skills.ts @@ -4,7 +4,7 @@ import * as path from 'path'; import * as p from '@clack/prompts'; import color from 'picocolors'; import { getClaudeDirectory, getDevFlowDirectory } from '../utils/paths.js'; -import { getAllSkillNames } from '../plugins.js'; +import { getAllSkillNames, prefixSkillName, unprefixSkillName } from '../plugins.js'; import { copyDirectory } from '../utils/installer.js'; /** @@ -23,7 +23,7 @@ async function dirExists(dirPath: string): Promise { * Get the shadow directory for a skill. */ function getShadowDir(devflowDir: string, skillName: string): string { - return path.join(devflowDir, 'skills', skillName); + return path.join(devflowDir, 'skills', unprefixSkillName(skillName)); } /** @@ -65,45 +65,51 @@ export const skillsCommand = new Command('skills') process.exit(1); } - if (!allSkills.includes(name)) { - p.log.error(`Unknown skill: ${name}`); + // Accept both bare and prefixed input + const bareName = unprefixSkillName(name); + + if (!allSkills.includes(bareName)) { + p.log.error(`Unknown skill: ${bareName}`); p.log.info(`Available skills: ${allSkills.join(', ')}`); process.exit(1); } - const installedSkillDir = path.join(claudeDir, 'skills', name); + const prefixedName = prefixSkillName(bareName); + const installedSkillDir = path.join(claudeDir, 'skills', prefixedName); if (!await dirExists(installedSkillDir)) { - p.log.error(`Skill not installed: ${name}. Run devflow init first.`); + p.log.error(`Skill not installed: ${prefixedName}. Run devflow init first.`); process.exit(1); } - const shadowDir = getShadowDir(devflowDir, name); + const shadowDir = getShadowDir(devflowDir, bareName); if (await dirExists(shadowDir)) { - p.log.info(`${name} is already shadowed`); + p.log.info(`${bareName} is already shadowed`); return; } - // Create shadow directory and copy original as reference backup + // Create shadow directory (unprefixed) and copy original as reference backup await fs.mkdir(path.join(devflowDir, 'skills'), { recursive: true }); await copyDirectory(installedSkillDir, shadowDir); - p.log.success(`Shadowed ${color.cyan(name)}`); - p.log.info(`Edit ${color.dim(path.join(claudeDir, 'skills', name, 'SKILL.md'))} — it won't be overwritten on next init.`); + p.log.success(`Shadowed ${color.cyan(bareName)}`); + p.log.info(`Edit ${color.dim(path.join(shadowDir, 'SKILL.md'))} then run devflow init to apply.`); } else if (action === 'unshadow') { if (!name) { p.log.error('Skill name required. Usage: devflow skills unshadow '); process.exit(1); } - const shadowDir = getShadowDir(devflowDir, name); + // Accept both bare and prefixed input + const bareName = unprefixSkillName(name); + const shadowDir = getShadowDir(devflowDir, bareName); if (!await dirExists(shadowDir)) { - p.log.info(`${name} is not shadowed`); + p.log.info(`${bareName} is not shadowed`); return; } await fs.rm(shadowDir, { recursive: true, force: true }); - p.log.success(`Unshadowed ${color.cyan(name)}`); + p.log.success(`Unshadowed ${color.cyan(bareName)}`); p.log.info('Run devflow init to restore DevFlow\'s version.'); } else if (action === 'list-shadowed') { const shadowed = await listShadowed(devflowDir); diff --git a/src/cli/commands/uninstall.ts b/src/cli/commands/uninstall.ts index 5170fafd..3005e095 100644 --- a/src/cli/commands/uninstall.ts +++ b/src/cli/commands/uninstall.ts @@ -8,7 +8,7 @@ import color from 'picocolors'; import { getInstallationPaths, getClaudeDirectory, getDevFlowDirectory, getManagedSettingsPath } from '../utils/paths.js'; import { getGitRoot } from '../utils/git.js'; import { isClaudeCliAvailable } from '../utils/cli.js'; -import { DEVFLOW_PLUGINS, getAllSkillNames, LEGACY_SKILL_NAMES, type PluginDefinition } from '../plugins.js'; +import { DEVFLOW_PLUGINS, getAllSkillNames, LEGACY_SKILL_NAMES, prefixSkillName, type PluginDefinition } from '../plugins.js'; import { removeAmbientHook } from './ambient.js'; import { removeMemoryHooks } from './memory.js'; import { removeLearningHook } from './learn.js'; @@ -529,23 +529,30 @@ async function removeAllDevFlow( } } - // Remove all DevFlow skills (current + legacy) - const allSkillNames = [...getAllSkillNames(), ...LEGACY_SKILL_NAMES]; + // Remove all DevFlow skills: prefixed (devflow:name), unprefixed (name), and legacy (devflow-name) + const allSkillNames = new Set([...getAllSkillNames(), ...LEGACY_SKILL_NAMES]); const skillsDir = path.join(claudeDir, 'skills'); let skillsRemoved = 0; for (const skillName of allSkillNames) { + // Remove prefixed variant (devflow:name) — current naming + const prefixedPath = path.join(skillsDir, prefixSkillName(skillName)); try { - const skillPath = path.join(skillsDir, skillName); - await fs.rm(skillPath, { recursive: true, force: true }); + await fs.stat(prefixedPath); + await fs.rm(prefixedPath, { recursive: true, force: true }); skillsRemoved++; - } catch { - // Skill might not exist - } + } catch { /* Skill doesn't exist */ } + // Remove unprefixed/legacy variant (name or devflow-name) + const barePath = path.join(skillsDir, skillName); + try { + await fs.stat(barePath); + await fs.rm(barePath, { recursive: true, force: true }); + skillsRemoved++; + } catch { /* Skill doesn't exist */ } } if (skillsRemoved > 0 && verbose) { - p.log.success(`Removed ${skillsRemoved} DevFlow skills`); + p.log.success(`Removed ${skillsRemoved} DevFlow skill directories`); } // Also remove old nested skills structure if it exists @@ -595,13 +602,19 @@ async function removeSelectedPlugins( const skillsDir = path.join(claudeDir, 'skills'); for (const skill of skills) { - try { - await fs.rm(path.join(skillsDir, skill), { recursive: true, force: true }); - if (verbose) { - p.log.success(`Removed skill ${skill}`); - } - } catch { - // Skill might not exist + // Remove all naming variants: prefixed (devflow:name), unprefixed (name), and legacy (devflow-name) + const variants = [ + prefixSkillName(skill), + skill, + `devflow-${skill}`, + ]; + for (const variant of variants) { + try { + await fs.rm(path.join(skillsDir, variant), { recursive: true, force: true }); + } catch { /* Skill might not exist */ } + } + if (verbose) { + p.log.success(`Removed skill ${skill}`); } } } diff --git a/src/cli/plugins.ts b/src/cli/plugins.ts index c93ebf37..94729a06 100644 --- a/src/cli/plugins.ts +++ b/src/cli/plugins.ts @@ -2,6 +2,29 @@ * Shared plugin registry — single source of truth for all CLI commands. */ +/** + * Namespace prefix for DevFlow skills installed to ~/.claude/skills/. + * Skills are installed as `devflow:{skill-name}` to avoid collisions with + * other plugin ecosystems. Source dirs in shared/skills/ stay unprefixed. + */ +export const SKILL_NAMESPACE = 'devflow:'; + +/** + * Add the `devflow:` namespace prefix to a bare skill name. + * No-op if already prefixed. + */ +export function prefixSkillName(name: string): string { + return name.startsWith(SKILL_NAMESPACE) ? name : `${SKILL_NAMESPACE}${name}`; +} + +/** + * Strip the `devflow:` namespace prefix from a skill name. + * No-op if not prefixed. + */ +export function unprefixSkillName(name: string): string { + return name.startsWith(SKILL_NAMESPACE) ? name.slice(SKILL_NAMESPACE.length) : name; +} + /** * Plugin definition with metadata */ @@ -222,6 +245,46 @@ export const LEGACY_SKILL_NAMES: string[] = [ 'commit', 'pull-request', 'tests-patterns', + // v2.0.0 namespace migration: bare names from pre-namespace installs + 'core-patterns', + 'docs-framework', + 'git-safety', + 'git-workflow', + 'github-patterns', + 'input-validation', + 'search-first', + 'test-driven-development', + 'test-patterns', + 'agent-teams', + 'implementation-patterns', + 'knowledge-persistence', + 'self-review', + 'worktree-support', + 'architecture-patterns', + 'complexity-patterns', + 'consistency-patterns', + 'database-patterns', + 'dependencies-patterns', + 'documentation-patterns', + 'performance-patterns', + 'regression-patterns', + 'review-methodology', + 'security-patterns', + 'ambient-router', + 'implementation-orchestration', + 'debug-orchestration', + 'plan-orchestration', + 'review-orchestration', + 'resolve-orchestration', + 'pipeline-orchestration', + 'typescript', + 'react', + 'accessibility', + 'frontend-design', + 'go', + 'java', + 'python', + 'rust', ]; /** diff --git a/src/cli/utils/installer.ts b/src/cli/utils/installer.ts index b1ad1833..28090bf3 100644 --- a/src/cli/utils/installer.ts +++ b/src/cli/utils/installer.ts @@ -2,7 +2,7 @@ import { promises as fs } from 'fs'; import * as path from 'path'; import { execSync } from 'child_process'; import type { PluginDefinition } from '../plugins.js'; -import { DEVFLOW_PLUGINS } from '../plugins.js'; +import { DEVFLOW_PLUGINS, prefixSkillName } from '../plugins.js'; /** * Minimal spinner interface matching @clack/prompts spinner(). @@ -130,8 +130,10 @@ export async function installViaFileCopy(options: FileCopyOptions): Promise(); - for (const plugin of DEVFLOW_PLUGINS) { - for (const skill of plugin.skills) { - allSkills.add(skill); - } - } - for (const skill of allSkills) { - // Skip cleanup for shadowed skills — user has a personal override - const shadowDir = path.join(devflowDir, 'skills', skill); - try { - const stat = await fs.stat(shadowDir); - if (stat.isDirectory()) continue; - } catch { /* no shadow — proceed with cleanup */ } - try { - await fs.rm(path.join(claudeDir, 'skills', skill), { recursive: true, force: true }); - } catch { /* ignore */ } + // Skills are universally installed — always clean both naming variants + // to prevent duplicates (bare + prefixed) on upgrade or partial install + const allSkills = new Set(); + for (const plugin of DEVFLOW_PLUGINS) { + for (const skill of plugin.skills) { + allSkills.add(skill); } } + for (const skill of allSkills) { + // Remove legacy unprefixed directory + try { + await fs.rm(path.join(claudeDir, 'skills', skill), { recursive: true, force: true }); + } catch { /* ignore */ } + // Remove prefixed directory (will be re-created during install phase) + try { + await fs.rm(path.join(claudeDir, 'skills', prefixSkillName(skill)), { recursive: true, force: true }); + } catch { /* ignore */ } + } // Install commands and agents from selected plugins (with deduplication) + spinner.message('Installing commands and agents...'); for (const plugin of plugins) { const pluginSourceDir = path.join(pluginsDir, plugin.name); @@ -210,6 +214,7 @@ export async function installViaFileCopy(options: FileCopyOptions): Promise 0; + } + } catch { /* no shadow */ } - const skillTarget = path.join(claudeDir, 'skills', skillName); - await copyDirectory(skillSource, skillTarget); + if (isShadowed) { + await copyDirectory(shadowDir, skillTarget); + } else { + await copyDirectory(skillSource, skillTarget); + } } // Install scripts (always from root scripts/ directory) + spinner.message('Installing scripts...'); const scriptsSource = path.join(rootDir, 'scripts'); const scriptsTarget = path.join(devflowDir, 'scripts'); try { diff --git a/tests/ambient.test.ts b/tests/ambient.test.ts index 7bd8890a..e3b74628 100644 --- a/tests/ambient.test.ts +++ b/tests/ambient.test.ts @@ -185,8 +185,8 @@ describe('hasAmbientHook', () => { describe('classification helpers', () => { it('detects classification marker', () => { - expect(hasClassification('Ambient: IMPLEMENT/GUIDED. Loading: core-patterns.')).toBe(true); - expect(hasClassification('Ambient: DEBUG/ORCHESTRATED. Loading: debug-orchestration.')).toBe(true); + expect(hasClassification('Ambient: IMPLEMENT/GUIDED. Loading: devflow:core-patterns.')).toBe(true); + expect(hasClassification('Ambient: DEBUG/ORCHESTRATED. Loading: devflow:debug-orchestration.')).toBe(true); }); it('returns false when no classification', () => { @@ -200,17 +200,17 @@ describe('classification helpers', () => { }); it('extracts intent', () => { - expect(extractIntent('Ambient: IMPLEMENT/GUIDED. Loading: core-patterns.')).toBe('IMPLEMENT'); - expect(extractIntent('Ambient: DEBUG/ORCHESTRATED. Loading: debug-orchestration.')).toBe('DEBUG'); - expect(extractIntent('Ambient: REVIEW/GUIDED. Loading: self-review.')).toBe('REVIEW'); - expect(extractIntent('Ambient: PLAN/GUIDED. Loading: core-patterns.')).toBe('PLAN'); + expect(extractIntent('Ambient: IMPLEMENT/GUIDED. Loading: devflow:core-patterns.')).toBe('IMPLEMENT'); + expect(extractIntent('Ambient: DEBUG/ORCHESTRATED. Loading: devflow:debug-orchestration.')).toBe('DEBUG'); + expect(extractIntent('Ambient: REVIEW/GUIDED. Loading: devflow:self-review.')).toBe('REVIEW'); + expect(extractIntent('Ambient: PLAN/GUIDED. Loading: devflow:core-patterns.')).toBe('PLAN'); expect(extractIntent('Ambient: EXPLORE/QUICK')).toBe('EXPLORE'); expect(extractIntent('Ambient: CHAT/QUICK')).toBe('CHAT'); }); it('extracts depth', () => { - expect(extractDepth('Ambient: IMPLEMENT/GUIDED. Loading: core-patterns.')).toBe('GUIDED'); - expect(extractDepth('Ambient: DEBUG/ORCHESTRATED. Loading: debug-orchestration.')).toBe('ORCHESTRATED'); + expect(extractDepth('Ambient: IMPLEMENT/GUIDED. Loading: devflow:core-patterns.')).toBe('GUIDED'); + expect(extractDepth('Ambient: DEBUG/ORCHESTRATED. Loading: devflow:debug-orchestration.')).toBe('ORCHESTRATED'); }); it('returns null for missing classification', () => { @@ -221,8 +221,8 @@ describe('classification helpers', () => { describe('skill loading helpers', () => { it('detects Loading marker', () => { - expect(hasSkillLoading('Ambient: IMPLEMENT/GUIDED. Loading: implementation-patterns, search-first.')).toBe(true); - expect(hasSkillLoading('Loading: core-patterns')).toBe(true); + expect(hasSkillLoading('Ambient: IMPLEMENT/GUIDED. Loading: devflow:implementation-patterns, devflow:search-first.')).toBe(true); + expect(hasSkillLoading('Loading: devflow:core-patterns')).toBe(true); }); it('returns false when no Loading marker', () => { @@ -231,14 +231,14 @@ describe('skill loading helpers', () => { }); it('extracts single skill', () => { - expect(extractLoadedSkills('Loading: core-patterns')).toEqual(['core-patterns']); + expect(extractLoadedSkills('Loading: devflow:core-patterns')).toEqual(['devflow:core-patterns']); }); it('extracts multiple skills', () => { - expect(extractLoadedSkills('Ambient: IMPLEMENT/GUIDED. Loading: implementation-patterns, search-first, typescript.')).toEqual([ - 'implementation-patterns', - 'search-first', - 'typescript', + expect(extractLoadedSkills('Ambient: IMPLEMENT/GUIDED. Loading: devflow:implementation-patterns, devflow:search-first, devflow:typescript.')).toEqual([ + 'devflow:implementation-patterns', + 'devflow:search-first', + 'devflow:typescript', ]); }); @@ -277,20 +277,20 @@ describe('preamble drift detection', () => { // Must contain multi-worktree awareness expect(shellPreamble).toContain('MULTI_WORKTREE'); - // Must reference core skills by name - expect(shellPreamble).toContain('implementation-patterns'); - expect(shellPreamble).toContain('test-driven-development'); - expect(shellPreamble).toContain('core-patterns'); - expect(shellPreamble).toContain('self-review'); - expect(shellPreamble).toContain('search-first'); - - // Must reference all 6 orchestration skills - expect(shellPreamble).toContain('implementation-orchestration'); - expect(shellPreamble).toContain('debug-orchestration'); - expect(shellPreamble).toContain('plan-orchestration'); - expect(shellPreamble).toContain('review-orchestration'); - expect(shellPreamble).toContain('resolve-orchestration'); - expect(shellPreamble).toContain('pipeline-orchestration'); + // Must reference core skills with devflow: namespace prefix + expect(shellPreamble).toContain('devflow:implementation-patterns'); + expect(shellPreamble).toContain('devflow:test-driven-development'); + expect(shellPreamble).toContain('devflow:core-patterns'); + expect(shellPreamble).toContain('devflow:self-review'); + expect(shellPreamble).toContain('devflow:search-first'); + + // Must reference all 6 orchestration skills with namespace prefix + expect(shellPreamble).toContain('devflow:implementation-orchestration'); + expect(shellPreamble).toContain('devflow:debug-orchestration'); + expect(shellPreamble).toContain('devflow:plan-orchestration'); + expect(shellPreamble).toContain('devflow:review-orchestration'); + expect(shellPreamble).toContain('devflow:resolve-orchestration'); + expect(shellPreamble).toContain('devflow:pipeline-orchestration'); // Must instruct Skill tool invocation expect(shellPreamble).toContain('Skill tool'); diff --git a/tests/integration/helpers.ts b/tests/integration/helpers.ts index 6c250af5..7d3688d8 100644 --- a/tests/integration/helpers.ts +++ b/tests/integration/helpers.ts @@ -1,7 +1,7 @@ import { execSync, execFileSync } from 'child_process'; const CLASSIFICATION_PATTERN = /ambient:\s*(IMPLEMENT|DEBUG|REVIEW|PLAN|EXPLORE|CHAT)\s*\/\s*(QUICK|GUIDED|ORCHESTRATED)/i; -const LOADING_PATTERN = /loading:\s*[\w-]+(?:,\s*[\w-]+)*/i; +const LOADING_PATTERN = /loading:\s*[\w:-]+(?:,\s*[\w:-]+)*/i; /** * Check if the `claude` CLI is available on this machine. @@ -19,12 +19,12 @@ export function isClaudeAvailable(): boolean { const AMBIENT_PREAMBLE = `AMBIENT MODE: Classify depth then act. QUICK=chat/explore/git/config/trivial: respond normally. GUIDED=implement(1-2 files)/debug(clear error)/plan(focused)/review: load skills. ORCHESTRATED=implement(3+ files)/debug(vague)/architecture: load skills+agents. Prefer GUIDED for code changes. GUIDED/ORCHESTRATED: Call Skill tool for ALL skills listed for intent — one Skill call per skill, before ANY text. -IMPLEMENT → test-driven-development, implementation-patterns, search-first -DEBUG → core-patterns, test-patterns -REVIEW → self-review, core-patterns -PLAN → implementation-patterns, core-patterns -Also add if file type matches: typescript, react, go, java, python, rust, input-validation, security-patterns, frontend-design -ORCHESTRATED also add: implementation-orchestration / debug-orchestration / plan-orchestration +IMPLEMENT → devflow:test-driven-development, devflow:implementation-patterns, devflow:search-first +DEBUG → devflow:core-patterns, devflow:test-patterns +REVIEW → devflow:self-review, devflow:core-patterns +PLAN → devflow:implementation-patterns, devflow:core-patterns +Also add if file type matches: devflow:typescript, devflow:react, devflow:go, devflow:java, devflow:python, devflow:rust, devflow:input-validation, devflow:security-patterns, devflow:frontend-design +ORCHESTRATED also add: devflow:implementation-orchestration / devflow:debug-orchestration / devflow:plan-orchestration State: Ambient: INTENT/DEPTH. Loading: skills. Then proceed.`; /** Structured result from a claude -p invocation */ diff --git a/tests/skill-namespace.test.ts b/tests/skill-namespace.test.ts new file mode 100644 index 00000000..1ac8f63d --- /dev/null +++ b/tests/skill-namespace.test.ts @@ -0,0 +1,287 @@ +import { describe, it, expect, beforeEach, afterEach } from 'vitest'; +import { promises as fs } from 'fs'; +import * as path from 'path'; +import * as os from 'os'; +import { + SKILL_NAMESPACE, + prefixSkillName, + unprefixSkillName, + getAllSkillNames, + LEGACY_SKILL_NAMES, +} from '../src/cli/plugins.js'; +import { installViaFileCopy, type Spinner } from '../src/cli/utils/installer.js'; +import { hasShadow } from '../src/cli/commands/skills.js'; + +/** No-op spinner for tests */ +const noopSpinner: Spinner = { + start() {}, + stop() {}, + message() {}, +}; + +describe('SKILL_NAMESPACE', () => { + it('is devflow:', () => { + expect(SKILL_NAMESPACE).toBe('devflow:'); + }); +}); + +describe('prefixSkillName', () => { + it('adds devflow: prefix to bare name', () => { + expect(prefixSkillName('core-patterns')).toBe('devflow:core-patterns'); + expect(prefixSkillName('typescript')).toBe('devflow:typescript'); + expect(prefixSkillName('go')).toBe('devflow:go'); + }); + + it('is a no-op for already-prefixed names', () => { + expect(prefixSkillName('devflow:core-patterns')).toBe('devflow:core-patterns'); + expect(prefixSkillName('devflow:go')).toBe('devflow:go'); + }); + + it('handles empty string', () => { + expect(prefixSkillName('')).toBe('devflow:'); + }); +}); + +describe('unprefixSkillName', () => { + it('strips devflow: prefix', () => { + expect(unprefixSkillName('devflow:core-patterns')).toBe('core-patterns'); + expect(unprefixSkillName('devflow:typescript')).toBe('typescript'); + }); + + it('is a no-op for bare names', () => { + expect(unprefixSkillName('core-patterns')).toBe('core-patterns'); + expect(unprefixSkillName('go')).toBe('go'); + }); + + it('handles empty string', () => { + expect(unprefixSkillName('')).toBe(''); + }); + + it('handles bare prefix string', () => { + expect(unprefixSkillName('devflow:')).toBe(''); + }); + + it('roundtrips with prefixSkillName', () => { + const names = ['core-patterns', 'security-patterns', 'go', 'react']; + for (const name of names) { + expect(unprefixSkillName(prefixSkillName(name))).toBe(name); + } + }); +}); + +describe('LEGACY_SKILL_NAMES includes all current bare names for migration', () => { + it('every current skill name has a legacy entry for cleanup', () => { + const currentSkills = getAllSkillNames(); + for (const skill of currentSkills) { + expect(LEGACY_SKILL_NAMES, `LEGACY_SKILL_NAMES should include '${skill}' for migration cleanup`).toContain(skill); + } + }); +}); + +describe('hasShadow normalizes prefixed names', () => { + let tmpDir: string; + + beforeEach(async () => { + tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'devflow-shadow-')); + }); + + afterEach(async () => { + await fs.rm(tmpDir, { recursive: true, force: true }); + }); + + it('detects shadow with bare name', async () => { + await fs.mkdir(path.join(tmpDir, 'skills', 'core-patterns'), { recursive: true }); + expect(await hasShadow('core-patterns', tmpDir)).toBe(true); + }); + + it('detects shadow with prefixed name', async () => { + await fs.mkdir(path.join(tmpDir, 'skills', 'core-patterns'), { recursive: true }); + expect(await hasShadow('devflow:core-patterns', tmpDir)).toBe(true); + }); + + it('returns false when no shadow exists', async () => { + await fs.mkdir(path.join(tmpDir, 'skills'), { recursive: true }); + expect(await hasShadow('nonexistent', tmpDir)).toBe(false); + }); +}); + +describe('installViaFileCopy skill lifecycle', () => { + let claudeDir: string; + let devflowDir: string; + let pluginsDir: string; + let rootDir: string; + const testSkillName = 'test-skill'; + + /** Seed a minimal plugin with one skill in the build output directory */ + async function seedPlugin(skillName: string, content: string): Promise { + const pluginName = 'devflow-test-plugin'; + const skillDir = path.join(pluginsDir, pluginName, 'skills', skillName); + await fs.mkdir(skillDir, { recursive: true }); + await fs.writeFile(path.join(skillDir, 'SKILL.md'), content); + } + + /** Run installViaFileCopy with a single test skill */ + async function runInstall(opts?: { isPartialInstall?: boolean }): Promise { + const pluginDef = { + name: 'devflow-test-plugin', + description: 'test', + commands: [], + agents: [], + skills: [testSkillName], + }; + await installViaFileCopy({ + plugins: [pluginDef], + claudeDir, + pluginsDir, + rootDir, + devflowDir, + skillsMap: new Map([[testSkillName, 'devflow-test-plugin']]), + agentsMap: new Map(), + isPartialInstall: opts?.isPartialInstall ?? false, + teamsEnabled: false, + spinner: noopSpinner, + }); + } + + beforeEach(async () => { + claudeDir = await fs.mkdtemp(path.join(os.tmpdir(), 'devflow-claude-')); + devflowDir = await fs.mkdtemp(path.join(os.tmpdir(), 'devflow-home-')); + pluginsDir = await fs.mkdtemp(path.join(os.tmpdir(), 'devflow-plugins-')); + rootDir = await fs.mkdtemp(path.join(os.tmpdir(), 'devflow-root-')); + }); + + afterEach(async () => { + await fs.rm(claudeDir, { recursive: true, force: true }); + await fs.rm(devflowDir, { recursive: true, force: true }); + await fs.rm(pluginsDir, { recursive: true, force: true }); + await fs.rm(rootDir, { recursive: true, force: true }); + }); + + it('installs skill to prefixed path', async () => { + await seedPlugin(testSkillName, 'source content'); + await runInstall(); + + const installed = path.join(claudeDir, 'skills', `devflow:${testSkillName}`, 'SKILL.md'); + const content = await fs.readFile(installed, 'utf-8'); + expect(content).toBe('source content'); + }); + + it('removes legacy unprefixed dir during cleanup', async () => { + // Use a real skill name from DEVFLOW_PLUGINS so cleanup loop finds it + const realSkill = 'core-patterns'; + const legacyDir = path.join(claudeDir, 'skills', realSkill); + await fs.mkdir(legacyDir, { recursive: true }); + await fs.writeFile(path.join(legacyDir, 'SKILL.md'), 'legacy'); + + await seedPlugin(testSkillName, 'new content'); + await runInstall(); + + // Legacy dir for real skill should be gone (cleaned by DEVFLOW_PLUGINS loop) + await expect(fs.stat(legacyDir)).rejects.toThrow(); + }); + + it('cleanup removes stale prefixed dir and reinstalls fresh', async () => { + // Use a real skill name so the cleanup loop processes it + const realSkill = 'core-patterns'; + const oldPrefixed = path.join(claudeDir, 'skills', `devflow:${realSkill}`); + await fs.mkdir(oldPrefixed, { recursive: true }); + await fs.writeFile(path.join(oldPrefixed, 'SKILL.md'), 'old'); + await fs.writeFile(path.join(oldPrefixed, 'stale-file.md'), 'should be removed'); + + await seedPlugin(testSkillName, 'test content'); + await runInstall(); + + // Cleanup should have wiped the old prefixed dir for real skill + // (it gets reinstalled by the real plugin if available, but in our temp pluginsDir + // the real plugin doesn't exist, so no reinstall — dir should be gone) + await expect(fs.stat(path.join(oldPrefixed, 'stale-file.md'))).rejects.toThrow(); + }); + + it('shadowed skill installs shadow content to prefixed path', async () => { + await seedPlugin(testSkillName, 'source content'); + + // Create shadow override at ~/.devflow/skills/{bare-name}/ + const shadowDir = path.join(devflowDir, 'skills', testSkillName); + await fs.mkdir(shadowDir, { recursive: true }); + await fs.writeFile(path.join(shadowDir, 'SKILL.md'), 'shadow override'); + + await runInstall(); + + const installed = path.join(claudeDir, 'skills', `devflow:${testSkillName}`, 'SKILL.md'); + const content = await fs.readFile(installed, 'utf-8'); + expect(content).toBe('shadow override'); + }); + + it('empty shadow dir falls back to source', async () => { + await seedPlugin(testSkillName, 'source content'); + + // Create empty shadow directory + const shadowDir = path.join(devflowDir, 'skills', testSkillName); + await fs.mkdir(shadowDir, { recursive: true }); + + await runInstall(); + + const installed = path.join(claudeDir, 'skills', `devflow:${testSkillName}`, 'SKILL.md'); + const content = await fs.readFile(installed, 'utf-8'); + expect(content).toBe('source content'); + }); + + it('partial install still cleans skill dirs (skills are universal)', async () => { + // Use a real skill name so cleanup loop finds it + const realSkill = 'core-patterns'; + const legacyDir = path.join(claudeDir, 'skills', realSkill); + await fs.mkdir(legacyDir, { recursive: true }); + await fs.writeFile(path.join(legacyDir, 'SKILL.md'), 'legacy'); + + await seedPlugin(testSkillName, 'new content'); + await runInstall({ isPartialInstall: true }); + + // Legacy bare-named dir should be gone (skill cleanup always runs) + await expect(fs.stat(legacyDir)).rejects.toThrow(); + // Prefixed dir for test skill should be installed + const installed = path.join(claudeDir, 'skills', `devflow:${testSkillName}`, 'SKILL.md'); + expect(await fs.readFile(installed, 'utf-8')).toBe('new content'); + }); + + it('partial install preserves commands and agents dirs', async () => { + // Seed existing command dir + const commandsDir = path.join(claudeDir, 'commands', 'devflow'); + await fs.mkdir(commandsDir, { recursive: true }); + await fs.writeFile(path.join(commandsDir, 'existing.md'), 'keep me'); + + await seedPlugin(testSkillName, 'content'); + await runInstall({ isPartialInstall: true }); + + // Commands dir should still exist (only wiped on full install) + const content = await fs.readFile(path.join(commandsDir, 'existing.md'), 'utf-8'); + expect(content).toBe('keep me'); + }); + + it('full shadow cycle: install → shadow → reinstall uses shadow', async () => { + await seedPlugin(testSkillName, 'v1 source'); + + // First install: source content + await runInstall(); + const installed = path.join(claudeDir, 'skills', `devflow:${testSkillName}`, 'SKILL.md'); + expect(await fs.readFile(installed, 'utf-8')).toBe('v1 source'); + + // User creates shadow override + const shadowDir = path.join(devflowDir, 'skills', testSkillName); + await fs.mkdir(shadowDir, { recursive: true }); + await fs.writeFile(path.join(shadowDir, 'SKILL.md'), 'user customization'); + + // Source gets updated + await seedPlugin(testSkillName, 'v2 source'); + + // Second install: shadow wins over updated source + await runInstall(); + expect(await fs.readFile(installed, 'utf-8')).toBe('user customization'); + + // User removes shadow + await fs.rm(shadowDir, { recursive: true, force: true }); + + // Third install: falls back to latest source + await runInstall(); + expect(await fs.readFile(installed, 'utf-8')).toBe('v2 source'); + }); +});