Skip to content

feat: dev-workflows v2 — multi-file compilation, .agents/ distribution, global scope, visual overhaul, registry#57

Merged
gpolanco merged 18 commits intomainfrom
feat/v2-bridge-refactor
Apr 12, 2026
Merged

feat: dev-workflows v2 — multi-file compilation, .agents/ distribution, global scope, visual overhaul, registry#57
gpolanco merged 18 commits intomainfrom
feat/v2-bridge-refactor

Conversation

@gpolanco
Copy link
Copy Markdown
Owner

Summary

Major evolution of dev-workflows from a monolithic rule compiler to a multi-file distribution system with professional CLI experience.

Phase 1: Multi-File Compilation

  • DirectoryBridge | MarkerBridge discriminated union replacing flat Bridge interface
  • Claude, Cursor, Windsurf generate one file per scope (dwf-{scope}.md/mdc) with native frontmatter (paths:, globs:, trigger:)
  • Gemini and Copilot stay as MarkerBridge (inline markers)
  • Automatic stale file cleanup and legacy migration from v0.6

Phase 2: .agents/ Distribution

  • Canonical output in .agents/rules/devw/ (pure markdown, no editor frontmatter)
  • Each bridge also writes to its native directory with editor-specific format
  • Extended devw doctor with canonical sync, legacy migration, and frontmatter checks

Phase 3: Global Scope

  • ~/.dwf/ for global rules, merged at compile time (project wins on conflicts)
  • devw init asks project/global in interactive flow, --global flag for non-interactive
  • global: false in config.yml to opt out
  • Global compile distributes to ~/.claude/rules/, ~/.cursor/rules/, etc.

Phase 4: CLI Visual Overhaul

  • chalkpicocolors, @inquirer/prompts@clack/prompts
  • ASCII banner, manual ANSI tables for compile summaries
  • Prompt wrappers (intro/outro/spinner/note) with non-TTY/CI guards
  • All commands migrated to Clack flow

Phase 5: Registry Phase 1

  • registry.json manifest generated in CI (GitHub Action)
  • ETag-based caching replacing 1h TTL
  • devw add --search <term> and --tag <tag> filtering
  • Version detection with update prompt on devw add

Stats

  • 60 files changed (+5826 / -849)
  • 465 tests, 0 failures
  • Phase 6 (federated registry) deferred to post-v2.0

Test plan

  • pnpm build && pnpm test — all 465 tests pass
  • devw init — verify project/global flow
  • devw compile — verify multi-file output in .claude/rules/, .cursor/rules/, .agents/rules/devw/
  • devw compile --dry-run — lists all files without writing
  • devw doctor — verify new checks (canonical sync, legacy, frontmatter)
  • devw add --list — verify registry manifest fetch
  • devw add --search typescript — verify search
  • devw explain — verify multi-file output paths

🤖 Generated with Claude Code

gpolanco added 17 commits April 12, 2026 13:57
…onfig.global

Add ScopeMetadata interface with optional globs, paths, and trigger fields.
Add optional metadata field to Rule interface for scope targeting.
Add optional global field to ProjectConfig (defaults to true semantically).
…riminated union

Replace monolithic Bridge interface with discriminated union:
- DirectoryBridge (kind: 'directory'): claude, cursor, windsurf
- MarkerBridge (kind: 'marker'): gemini, copilot

Add isDirectoryBridge/isMarkerBridge type guards and getBridgeOutputPaths
helper. Update all bridge implementations and consumer code to use the
new union. Update tests for new bridge shapes.
scopeToFilename converts scope names to filenames by replacing colons
with hyphens (e.g., team:payments -> dwf-team-payments.md).

cleanStaleFiles removes orphaned dwf-* files from a directory that are
not in the current expected set, for cleanup after compilation.

Includes comprehensive tests for both functions covering built-in scopes,
custom scopes with colons, stale file removal, and edge cases.
Create cleanup.ts with detectLegacyFiles(), migrateLegacyFiles(), and
removeLegacyMarkerBlock() for v0.5/v0.6 migration. Detects legacy
.cursor/rules/devworkflows.mdc, .windsurf/rules/devworkflows.md, and
CLAUDE.md with markers. Idempotent — skips missing files silently.

Includes 17 tests covering detection, migration, marker removal,
idempotency, and edge cases.
…tput

Each DirectoryBridge now generates one file per scope instead of a
single monolithic file. Keys follow the pattern
{outputDir}/dwf-{scope}.{ext}.

- Claude: paths frontmatter when metadata.paths set, no frontmatter
  for global scope
- Cursor: description + globs/alwaysApply frontmatter per scope
- Windsurf: trigger frontmatter (default: always), globs when
  trigger=glob. Char limit warning now applies per-file.

Includes comprehensive tests for each bridge covering multi-file
output, frontmatter variants, custom scopes with colons, and
metadata handling.
Add type guard assertions (isMarkerBridge/isDirectoryBridge) to
existing Copilot tests. Create full Gemini test suite verifying
MarkerBridge type, output paths, markers, scope sorting, and
filtering.
Update compile, e2e, and output format tests to expect the new
multi-file paths (.claude/rules/dwf-{scope}.md) instead of the
old single-file CLAUDE.md output.
…ures

The ProjectConfig interface gained a required `global` field in task 1.1
but existing test fixtures were not updated, causing TypeScript compilation
failures in the test tsconfig.
Add validation that rejects unsupported config versions (only 0.1/0.2
accepted). Import VALID_CONFIG_VERSIONS into parser for validation.
Scope metadata parsing was already implemented in tasks 1.1-1.9.
…tale cleanup and legacy migration

Rewrite executePipeline to discriminate between DirectoryBridge and
MarkerBridge flows. DirectoryBridges write one file per scope then
run cleanStaleFiles to remove orphaned dwf-* files. MarkerBridges
continue using marker-based merge. Legacy migration runs once before
writing new files. Dry-run shows summary of what would be generated.
…output

Show per-scope file listing for DirectoryBridges with output directory
pattern. Show single output file for MarkerBridges. Update mode label
from 'full file' to 'multi-file (one per scope)'. Windsurf char limit
check now reports per-file max instead of total.
The parser always provides a default value for global (true), so the
type should reflect that it is always present after parsing.
- Parser tests: scope metadata parsing (top-level, nested, backward compat,
  invalid trigger/globs rejection, metadata propagation to rules)
- Config tests: v0.1/v0.2 version handling, global field, version validation
- Schema tests: validateScopeMetadata, isValidTrigger, VALID_CONFIG_VERSIONS
- Compile integration tests: DirectoryBridge multi-file output, MarkerBridge
  output, mixed bridges, stale file cleanup, legacy migration, dry-run mode
- Explain tests: multi-file mode label, per-scope file listing
- E2E tests: multi-file compile, dry-run, explain multi-file paths
- Output tests: updated mode label assertion
…ion detection

- Add registry.json manifest generation script and GitHub Action
- Replace 1h TTL cache with ETag-based conditional requests
- Add searchRegistry() and filterRegistryByTag() utilities
- Add --search and --tag flags to devw add --list
- Add version detection with update prompt on devw add
- Update banner with user-customized ASCII art
- Fix remove E2E test for non-TTY guard behavior
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
landing Ready Ready Preview, Comment Apr 12, 2026 4:55pm

Match skills.sh style: ANSI 256-color grays (252→240) instead of
cyan-to-magenta rainbow (45→201).
@gpolanco gpolanco merged commit be4913d into main Apr 12, 2026
2 of 4 checks passed
@gpolanco gpolanco deleted the feat/v2-bridge-refactor branch April 12, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant