@brunosps00/dev-workflow 1.0.1 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +33 -16
  2. package/bin/dev-workflow.js +24 -7
  3. package/lib/aws-categories.js +80 -0
  4. package/lib/azure-categories.js +168 -0
  5. package/lib/constants.js +14 -6
  6. package/lib/init.js +28 -0
  7. package/lib/install-aws-skills.js +345 -0
  8. package/lib/install-azure-skills.js +231 -0
  9. package/lib/mcp.js +32 -21
  10. package/lib/prompts.js +38 -1
  11. package/package.json +1 -1
  12. package/scaffold/en/agent-instructions.md +23 -0
  13. package/scaffold/en/commands/dw-analyze-project.md +64 -0
  14. package/scaffold/en/commands/dw-autopilot.md +64 -5
  15. package/scaffold/en/commands/dw-bugfix.md +124 -26
  16. package/scaffold/en/commands/dw-install-aws-skills.md +166 -0
  17. package/scaffold/en/commands/dw-install-azure-skills.md +138 -0
  18. package/scaffold/en/commands/dw-intel.md +30 -3
  19. package/scaffold/en/commands/dw-pause.md +92 -0
  20. package/scaffold/en/commands/dw-qa.md +87 -11
  21. package/scaffold/en/commands/dw-resume.md +90 -0
  22. package/scaffold/en/commands/dw-review.md +22 -12
  23. package/scaffold/en/templates/bugfix-summary-template.md +66 -0
  24. package/scaffold/en/templates/concerns-template.md +59 -0
  25. package/scaffold/en/templates/state-template.md +59 -0
  26. package/scaffold/pt-br/agent-instructions.md +23 -0
  27. package/scaffold/pt-br/commands/dw-analyze-project.md +64 -0
  28. package/scaffold/pt-br/commands/dw-autopilot.md +64 -5
  29. package/scaffold/pt-br/commands/dw-bugfix.md +134 -18
  30. package/scaffold/pt-br/commands/dw-install-aws-skills.md +166 -0
  31. package/scaffold/pt-br/commands/dw-install-azure-skills.md +138 -0
  32. package/scaffold/pt-br/commands/dw-intel.md +30 -3
  33. package/scaffold/pt-br/commands/dw-pause.md +92 -0
  34. package/scaffold/pt-br/commands/dw-qa.md +87 -11
  35. package/scaffold/pt-br/commands/dw-resume.md +90 -0
  36. package/scaffold/pt-br/commands/dw-review.md +22 -12
  37. package/scaffold/pt-br/templates/bugfix-summary-template.md +66 -0
  38. package/scaffold/pt-br/templates/concerns-template.md +59 -0
  39. package/scaffold/pt-br/templates/state-template.md +59 -0
  40. package/scaffold/skills/dw-codebase-intel/SKILL.md +9 -5
  41. package/scaffold/skills/dw-codebase-intel/references/query-patterns.md +52 -0
  42. package/scaffold/skills/dw-memory/SKILL.md +26 -1
  43. package/scaffold/skills/dw-memory/references/context-budget.md +63 -0
package/README.md CHANGED
@@ -26,13 +26,13 @@ npx @brunosps00/dev-workflow install-deps
26
26
 
27
27
  ## Commands
28
28
 
29
- dev-workflow v1.0.0 ships **20 commands** organized into four tiers. Most users only invoke Tier 1 + Tier 2.
29
+ dev-workflow v1.0.4 ships **24 commands** organized into four tiers. Most users only invoke Tier 1 + Tier 2.
30
30
 
31
31
  ### Tier 1 — Gateway (3)
32
32
 
33
33
  | Command | When |
34
34
  |---------|------|
35
- | **`/dw-autopilot "wish"`** | Default entry point. Full pipeline (PRD → TechSpec → Tasks → Run → QA → Review → Commit → PR) with 3 approval gates. |
35
+ | **`/dw-autopilot "wish"`** | Default entry point. Full pipeline (PRD → TechSpec → Tasks → Run → QA → Review → Commit → PR) with 3 approval gates. Use `--from-prd <slug>` to resume from an existing PRD (e.g., after a `/dw-bugfix` safety-valve escalation): skips Steps 1–4 and starts at GATE 1. |
36
36
  | **`/dw-bugfix "description"`** | A bug report or pasted error. Triages bug-vs-feature-vs-scope, surgical fix or routes to a PRD. |
37
37
  | **`/dw-help [keyword]`** | Discover commands. Pass a keyword for shortcuts; `--advanced` reveals internal commands. |
38
38
 
@@ -45,8 +45,10 @@ Use these when you want step-by-step control instead of `/dw-autopilot`.
45
45
  | **`/dw-brainstorm "idea"`** | Refine an idea before PRD. Flags: `--onepager` (durable artifact), `--council` (multi-advisor debate), `--research` (multi-source cited research), `--refactor` (Fowler code-smell catalog). |
46
46
  | **`/dw-plan "feature"`** | PRD → TechSpec → Tasks sequentially with checkpoints. Stages: `prd`, `techspec`, `tasks`. Mandatory clarification questions, source-grounding, constitution gate, final consistency check. |
47
47
  | **`/dw-run [task-id]`** | Execute tasks. Default: all pending in dependency order with wave-based parallel dispatch. Single-task: pass an ID. `--resume` continues an interrupted plan. |
48
- | **`/dw-review`** | Level 2 (PRD coverage mapping) + Level 3 (code quality). Hard gates on dw-verify PASS, secure-audit, constitution violations. Flags: `--coverage-only`, `--code-only`. |
49
- | **`/dw-qa`** | Mode-aware QA. Auto-detects UI vs API. Flags: `--fix` (iterative QA + fix-retest loop), `--api`, `--ai` (run AI eval against reference dataset). |
48
+ | **`/dw-review`** | Level 2 (PRD coverage mapping) + Level 3 (code quality). Hard gates on dw-verify PASS, secure-audit, constitution violations. Flags: `--coverage-only`, `--code-only`, `--bugfix <slug>` (review a bugfix at `.dw/bugfixes/<slug>/`). |
49
+ | **`/dw-qa`** | Mode-aware QA. Auto-detects UI vs API. Flags: `--fix` (iterative QA + fix-retest loop), `--api`, `--ai` (AI eval against reference dataset), `--uat` (human-in-the-loop walkthrough), `--bugfix <slug>` (QA a bugfix). |
50
+ | **`/dw-pause`** | Consolidate the current session's mental state into `.dw/STATE.md` (Decisions, Blockers, Todos, Deferred, Lessons, Open Loops). Used before long breaks or context-window compactions. |
51
+ | **`/dw-resume`** | Read `.dw/STATE.md`, present a TLDR of where work left off, and suggest the next `dw-*` command. Never auto-executes. |
50
52
  | **`/dw-commit`** | Atomic Conventional Commits for pending changes. Applies `dw-git-discipline` (one intent per commit, lint+tests+build green before). |
51
53
  | **`/dw-generate-pr [target]`** | Push the branch, draft a PR body with summary + test plan, open the browser. Hard gates: dw-verify PASS + secure-audit. |
52
54
 
@@ -54,11 +56,13 @@ Use these when you want step-by-step control instead of `/dw-autopilot`.
54
56
 
55
57
  | Command | What |
56
58
  |---------|------|
57
- | **`/dw-analyze-project`** | Scans the repo, writes `.dw/rules/` (per-module conventions, anti-patterns, naming). Step 8 offers to generate `.dw/constitution.md` (declarative principles the team commits to). Run once per project; refresh after major refactors. |
59
+ | **`/dw-analyze-project`** | Scans the repo, writes `.dw/rules/` (per-module conventions, anti-patterns, naming). Step 8 offers to generate `.dw/constitution.md` (declarative principles the team commits to). Step 9 generates `.dw/rules/concerns.md` (risk map: hot spots, fragile integrations, hostile code, bug history). Run once per project; refresh after major refactors. |
58
60
  | **`/dw-redesign-ui "target"`** | Audits a frontend page, runs the `dw-ui-discipline` 4-question grounding, proposes 2-3 design directions, ships the redesign. WCAG 2.2 AA accessibility floor is non-negotiable. |
59
61
  | **`/dw-functional-doc`** | Maps screens + user flows into a functional doc, validated end-to-end with Playwright. |
60
62
  | **`/dw-new-project`** | Bootstrap a new project from empty directory. Stack interview, wraps official `create-*` tools, composes docker-compose for dev, seeds `.env`, scripts, CI, `.dw/rules/`. |
61
63
  | **`/dw-dockerize`** | Reads existing project, detects stack + runtime deps, proposes Dockerfile + docker-compose for dev/prod with explicit trade-offs (Conservative/Balanced/Bold). |
64
+ | **`/dw-install-azure-skills`** | **Opt-in.** Clones curated Azure skills from [`MicrosoftDocs/Agent-Skills`](https://github.com/MicrosoftDocs/Agent-Skills) (CC-BY-4.0) into `.agents/skills/azure/` and registers the [Microsoft Learn MCP Server](https://learn.microsoft.com/en-us/training/support/mcp-get-started) (HTTP, no-auth). Interactive category selection (Compute / Data & Storage / AI & ML / Networking / Identity & Security / DevOps / Observability / Integration / Architecture / All). Re-run to refresh from upstream. Also available as CLI: `npx @brunosps00/dev-workflow install-azure-skills`. |
65
+ | **`/dw-install-aws-skills`** | **Opt-in.** Clones curated AWS skills from [`aws/agent-toolkit-for-aws`](https://github.com/aws/agent-toolkit-for-aws) (Apache 2.0) into `.agents/skills/aws/` and registers the unified [AWS MCP Server](https://docs.aws.amazon.com/aws-mcp/) (stdio via `uvx mcp-proxy-for-aws@latest`). **Requires `uv`, `aws cli ≥ 2.32.0`, and AWS credentials.** Interactive category selection (Core / Analytics / Database / EC2 / Migration / Networking / Operations / Security / Serverless / Storage / All). The agent gains `aws___call_aws` (executes 15,000+ AWS APIs) and `aws___run_script` (Python sandboxed) — review `.dw/references/aws-mcp-instructions.md` for the destructive-operations protocol. Also available as CLI: `npx @brunosps00/dev-workflow install-aws-skills [--region=<aws-region>]`. |
62
66
 
63
67
  ### Tier 4 — Hidden/Internal (5)
64
68
 
@@ -163,15 +167,18 @@ All wrappers point to `.dw/commands/` as the single source of truth.
163
167
  ```
164
168
  your-project/
165
169
  ├── .dw/
166
- │ ├── commands/ # 20 workflow command files (v1.0.0)
167
- │ ├── templates/ # Document templates (PRD, TechSpec, etc.)
170
+ │ ├── commands/ # 22 workflow command files (v1.0.2)
171
+ │ ├── templates/ # Document templates (PRD, TechSpec, state, concerns, bugfix-summary, etc.)
168
172
  │ │ └── overrides/ # Project-local template customizations (override > core)
169
173
  │ ├── rules/ # Project-specific rules (run /dw-analyze-project)
174
+ │ │ └── concerns.md # Risk map: hot spots, fragile integrations, bug history (Step 9 of /dw-analyze-project)
170
175
  │ ├── constitution.md # Declarative principles (auto-installed when missing)
171
176
  │ ├── references/ # Reference documentation
172
177
  │ ├── scripts/ # Utility scripts
173
- └── spec/ # PRD directories — each contains tasks-validation.md
174
- ├── CLAUDE.md # Auto-trigger decision tree for Claude Code (merge-aware)
178
+ ├── spec/ # PRD directories — each contains tasks-validation.md
179
+ ├── bugfixes/ # Persistent bugfix records: NNN-<slug>/{TASK.md, SUMMARY.md, fix-report.md} + review/, QA/
180
+ │ └── STATE.md # Session state: Decisions, Blockers, Todos, Open Loops, Deferred Ideas, Lessons, Preferences (managed by /dw-pause + /dw-resume)
181
+ ├── CLAUDE.md # Auto-trigger decision tree for Claude Code (merge-aware, includes Auto-Sizing Matrix)
175
182
  ├── AGENTS.md # Same content for Codex / Copilot / OpenCode
176
183
  ├── .claude/
177
184
  │ ├── skills/ # Claude Code wrappers
@@ -229,13 +236,17 @@ Installed via `npx @brunosps00/dev-workflow install-deps`:
229
236
  ## Options
230
237
 
231
238
  ```bash
232
- npx @brunosps00/dev-workflow init # Interactive language selection
233
- npx @brunosps00/dev-workflow init --lang=en # English, skip prompt
234
- npx @brunosps00/dev-workflow init --lang=pt-br # Portuguese, skip prompt
235
- npx @brunosps00/dev-workflow init --force # Overwrite existing files
236
- npx @brunosps00/dev-workflow update # Update commands/templates only
237
- npx @brunosps00/dev-workflow install-deps # Install Playwright, react-doctor; check Trivy, Docker
238
- npx @brunosps00/dev-workflow help # Show help
239
+ npx @brunosps00/dev-workflow init # Interactive language selection
240
+ npx @brunosps00/dev-workflow init --lang=en # English, skip prompt
241
+ npx @brunosps00/dev-workflow init --lang=pt-br # Portuguese, skip prompt
242
+ npx @brunosps00/dev-workflow init --force # Overwrite existing files
243
+ npx @brunosps00/dev-workflow update # Update commands/templates only
244
+ npx @brunosps00/dev-workflow install-deps # Install Playwright, react-doctor; check Trivy, Docker
245
+ npx @brunosps00/dev-workflow install-azure-skills # Opt-in: Azure skills + Microsoft Learn MCP
246
+ npx @brunosps00/dev-workflow install-azure-skills --products=azure-aks,azure-openai # Subset override
247
+ npx @brunosps00/dev-workflow install-aws-skills # Opt-in: AWS skills + AWS MCP Server (needs uv + aws cli + creds)
248
+ npx @brunosps00/dev-workflow install-aws-skills --region=eu-central-1 # Region override
249
+ npx @brunosps00/dev-workflow help # Show help
239
250
  ```
240
251
 
241
252
  ## Getting Started
@@ -262,6 +273,12 @@ Incident response (`dw-incident-response`) adapted from [`wilsto/claude-code-sta
262
273
 
263
274
  LLM evaluation (`dw-llm-eval`) trajectory-match modes (strict / unordered / subset / superset) and tool-argument matching strategies adapted from [`langchain-ai/agentevals`](https://github.com/langchain-ai/agentevals) (MIT). The broader oracle-ladder framing, judge-calibration discipline, and reference-dataset principle are distilled from the open evaluations literature (OpenAI evals cookbook, Anthropic evals guidance, the academic eval-of-LLM body of work) and rewritten in our voice.
264
275
 
276
+ Optional AWS integration (v1.0.4). The `/dw-install-aws-skills` command and `npx @brunosps00/dev-workflow install-aws-skills` CLI pull curated agent skills from [`aws/agent-toolkit-for-aws`](https://github.com/aws/agent-toolkit-for-aws) (Apache 2.0, by AWS) into `.agents/skills/aws/` and register the unified [AWS MCP Server](https://docs.aws.amazon.com/aws-mcp/) via [`mcp-proxy-for-aws`](https://github.com/aws/mcp-proxy-for-aws) (stdio transport with SigV4 authentication). Unlike the Azure equivalent, the AWS MCP Server requires `uv`, `aws cli ≥ 2.32.0`, and valid AWS credentials configured via `aws login` or an IAM profile — the command detects each prerequisite and prints OS-specific install instructions if missing (without auto-installing anything). Capability includes `aws___search_documentation`, `aws___read_documentation`, `aws___retrieve_skill`, plus `aws___call_aws` (executes any of 15,000+ AWS APIs with the user's IAM permissions) and `aws___run_script` (Python sandboxed). `.dw/references/aws-mcp-instructions.md` encodes the destructive-operations protocol — agents must confirm before any `create*`/`update*`/`delete*`/`modify*` call, IAM change, or billing-affecting operation. The AWS Knowledge MCP (HTTP, no-auth) was considered for symmetry with Microsoft Learn MCP but is officially deprecated by AWS in favor of the unified server, which AWS explicitly recommends against running alongside the legacy endpoint ("tool conflicts that confuse AI agents"). Default endpoint is `us-east-1` with `eu-central-1` available; region overridable via `--region=<aws-region>` or by editing `.claude/settings.json` directly. Not installed by default; user explicitly invokes the command. Re-run refreshes from upstream; `dev-workflow update` deliberately does not touch `.agents/skills/aws/`.
277
+
278
+ Optional Azure integration (v1.0.3). The `/dw-install-azure-skills` command and `npx @brunosps00/dev-workflow install-azure-skills` CLI pull curated agent skills from [`MicrosoftDocs/Agent-Skills`](https://github.com/MicrosoftDocs/Agent-Skills) (CC-BY-4.0, by Microsoft) into `.agents/skills/azure/` and register the [Microsoft Learn MCP Server](https://learn.microsoft.com/en-us/training/support/mcp-get-started) (HTTP endpoint, no authentication required) into `.claude/settings.json`. The MCP server exposes three tools — `microsoft_docs_search`, `microsoft_docs_fetch`, `microsoft_code_sample_search` — that give the agent live access to Microsoft Learn documentation. **Not installed by default**: `init` and `update` do not touch `.agents/skills/azure/` or register the MCP. Users explicitly invoke the command when they begin Azure-focused work. The 10 categories (Compute, Data & Storage, AI & ML, Networking, Identity & Security, DevOps, Observability, Integration, Architecture, All) are dev-workflow's curated grouping over the 200+ skills in the upstream repo; the `--products=<csv>` flag lets advanced users pick individual services. Re-running the command refreshes from upstream; `dev-workflow update` deliberately does not touch these external skills so the Microsoft upstream release cadence is decoupled from the dev-workflow npm release cadence. Skills are copied verbatim from the upstream repo (CC-BY-4.0 permits this with attribution); the agent-facing `.dw/references/azure-mcp-instructions.md` is a clean-room adaptation of Microsoft's "Set instructions" guidance.
279
+
280
+ Session continuity and adaptive routing patterns adapted from [`tech-leads-club/agent-skills/tlc-spec-driven`](https://github.com/tech-leads-club/agent-skills/tree/main/packages/skills-catalog/skills/(development)/tlc-spec-driven) by Felipe Rodrigues (CC-BY-4.0, v1.0.2). Eight patterns were absorbed selectively after a comparative analysis confirmed that the majority of the skill duplicates existing dev-workflow capabilities (PRD/TechSpec/Tasks pipeline, constitution discipline, source-grounding, two-tier memory, verify-before-complete, brownfield mapping, sub-agent delegation, atomic commits). Patterns adopted: (1) `STATE.md` cross-session working memory at `.dw/STATE.md` + new `/dw-pause` and `/dw-resume` commands; (2) Auto-Sizing Matrix (Small/Medium/Large/Complex) formalized in `CLAUDE.md`/`AGENTS.md` above the Trigger Map; (3) Concerns Map (`.dw/rules/concerns.md`) generated by a new Step 9 in `/dw-analyze-project` and consumed on-demand by `/dw-plan`, `/dw-run`, and `/dw-bugfix`; (4) Context Budget discipline as a new section in `dw-memory` with reference `dw-memory/references/context-budget.md`; (5) Interactive UAT walkthrough as `/dw-qa --uat`; (6) Quick-mode persistence — bugfixes now land in `.dw/bugfixes/NNN-<slug>/{TASK.md, SUMMARY.md, fix-report.md}` and remain queryable via `/dw-intel`; (7) Safety valve in `/dw-bugfix` Step 5.0 that forces escalation to `/dw-plan` when scope exceeds 5 tasks or has cross-dependencies; (8) Cross-skill awareness — `/dw-intel --build` now indexes `.dw/bugfixes/*/SUMMARY.md` into `bugfixes.json`, and `dw-codebase-intel` documents the new `bugfix-history` and `risk-area` query shapes. Patterns explicitly REJECTED: `.specs/` directory structure (dev-workflow uses `.dw/`), Knowledge Verification Chain (already covered by `dw-source-grounding`), Specify/Design/Tasks/Execute naming (dev-workflow keeps PRD/TechSpec/Tasks/Run), Skill Integrations pattern with mermaid-studio/codenavi delegation, and literal text copying (everything is clean-room reimplementation from the conceptual patterns; CC-BY-4.0 attribution is for derivative ideas, not borrowed prose).
281
+
265
282
  Four patterns from [`mattpocock/skills`](https://github.com/mattpocock/skills) by Matt Pocock (MIT) were integrated **without adding new commands or skills** — instead they fold into the existing surface as internal modes and inline guidance: (1) **grill-with-docs** → `/dw-brainstorm` `grill` mode (interview discipline that stress-tests plan vocabulary against `.dw/rules/`); (2) **prototype** → `/dw-brainstorm` `prototype` mode (LOGIC terminal app or UI variant dispatch); (3) **improve-codebase-architecture** → `dw-simplification/references/deep-modules.md` (deletion test, locality, leverage, seam, adapter diagnostic invoked by the `refactor-audit` mode); (4) **zoom-out** → one-paragraph guidance in `agent-instructions.md`. The same release also collapses `/dw-brainstorm`'s six legacy flags into a single full-flow entry point that auto-dispatches modes based on project signals.
266
283
 
267
284
  ## Migration from v0.x (1.0.0 is a consolidation release)
@@ -2,6 +2,8 @@
2
2
 
3
3
  const { run } = require('../lib/init');
4
4
  const installDeps = require('../lib/install-deps');
5
+ const installAzureSkills = require('../lib/install-azure-skills');
6
+ const installAwsSkills = require('../lib/install-aws-skills');
5
7
  const uninstall = require('../lib/uninstall');
6
8
 
7
9
  const args = process.argv.slice(2);
@@ -22,16 +24,25 @@ const HELP_TEXT = `
22
24
  npx dev-workflow init [--force] [--lang=en|pt-br]
23
25
  npx dev-workflow update [--lang=en|pt-br]
24
26
  npx dev-workflow install-deps
27
+ npx dev-workflow install-azure-skills [--products=<csv>]
28
+ npx dev-workflow install-aws-skills [--region=<aws-region>]
25
29
  npx dev-workflow help
26
30
 
27
31
  Commands:
28
- init Scaffold .dw/ (commands, templates, references, scripts, skills, rules, MCPs)
29
- update Update managed files (commands, templates, references, scripts, skills, wrappers, MCPs)
30
- Preserves: .dw/rules/, .dw/spec/, user data
31
- install-deps Install system dependencies (Playwright browsers, MCP servers)
32
- uninstall Remove all managed files (commands, templates, wrappers, skills, MCPs)
33
- Preserves: .dw/rules/, .dw/spec/, .dw/intel/ (user data)
34
- help Show this help message
32
+ init Scaffold .dw/ (commands, templates, references, scripts, skills, rules, MCPs)
33
+ update Update managed files (commands, templates, references, scripts, skills, wrappers, MCPs)
34
+ Preserves: .dw/rules/, .dw/spec/, .dw/bugfixes/, .dw/STATE.md, .agents/skills/azure/, user data
35
+ install-deps Install system dependencies (Playwright browsers, MCP servers)
36
+ install-azure-skills Opt-in: clone curated Azure skills from MicrosoftDocs/Agent-Skills
37
+ into .agents/skills/azure/ and register the Microsoft Learn MCP
38
+ server (HTTP, no-auth). Interactive category selection.
39
+ install-aws-skills Opt-in: clone curated AWS skills from aws/agent-toolkit-for-aws
40
+ into .agents/skills/aws/ and register the unified AWS MCP Server
41
+ (stdio via mcp-proxy-for-aws). Requires uv, aws cli, and AWS
42
+ credentials. Interactive category selection.
43
+ uninstall Remove all managed files (commands, templates, wrappers, skills, MCPs)
44
+ Preserves: .dw/rules/, .dw/spec/, .dw/intel/ (user data)
45
+ help Show this help message
35
46
 
36
47
  Options:
37
48
  --force Overwrite existing files (init only; update always overwrites managed files)
@@ -58,6 +69,12 @@ async function main() {
58
69
  case 'install-deps':
59
70
  installDeps.run();
60
71
  break;
72
+ case 'install-azure-skills':
73
+ await installAzureSkills.run();
74
+ break;
75
+ case 'install-aws-skills':
76
+ await installAwsSkills.run();
77
+ break;
61
78
  case 'uninstall':
62
79
  uninstall.run();
63
80
  break;
@@ -0,0 +1,80 @@
1
+ // Upstream-native categories for the AWS skills repo (aws/agent-toolkit-for-aws,
2
+ // Apache 2.0). Microsoft's Azure repo is service-oriented and required us to invent
3
+ // 10 human categories; AWS organizes skills task-oriented under skills/core-skills/
4
+ // (13 horizontal) and skills/specialized-skills/<category>/ (9 verticals × N tasks).
5
+ // This file mirrors that structure 1:1 — no artificial mapping.
6
+ //
7
+ // Update this file when the upstream adds, renames, or removes top-level directories.
8
+
9
+ const CATEGORIES = {
10
+ All: {
11
+ description: 'Every skill in the upstream repo (core + specialized).',
12
+ dirs: '__ALL__',
13
+ },
14
+ Core: {
15
+ description:
16
+ 'All 13 horizontal core skills (Bedrock, Amplify, Billing, CDK, CloudFormation, Containers, IAM, Messaging, Observability, SDK JS/Python/Swift, Serverless).',
17
+ dirs: ['core-skills/*'],
18
+ },
19
+ Analytics: {
20
+ description: 'Athena, Glue, Kinesis, EMR, Redshift, OpenSearch, QuickSight, etc.',
21
+ dirs: ['specialized-skills/analytics-skills/*'],
22
+ },
23
+ Database: {
24
+ description: 'DynamoDB, RDS/Aurora, DocumentDB, ElastiCache, Neptune, etc.',
25
+ dirs: ['specialized-skills/database-skills/*'],
26
+ },
27
+ 'EC2 / Compute': {
28
+ description: 'EC2 launch, AMI, instance profiles, image builder, etc.',
29
+ dirs: ['specialized-skills/ec2-skills/*'],
30
+ },
31
+ 'Migration & Modernization': {
32
+ description: 'DMS, MGN, App2Container, modernization patterns.',
33
+ dirs: ['specialized-skills/migration-and-modernization-skills/*'],
34
+ },
35
+ 'Networking & Content Delivery': {
36
+ description: 'VPC, Route 53, CloudFront, API Gateway, ELB, Transit Gateway, etc.',
37
+ dirs: ['specialized-skills/networking-and-content-delivery-skills/*'],
38
+ },
39
+ Operations: {
40
+ description: 'CloudWatch, Systems Manager, OpsWorks, Config, Trusted Advisor.',
41
+ dirs: ['specialized-skills/operations-skills/*'],
42
+ },
43
+ 'Security & Identity': {
44
+ description: 'IAM patterns, KMS, Secrets Manager, GuardDuty, WAF, Security Hub.',
45
+ dirs: ['specialized-skills/security-and-identity-skills/*'],
46
+ },
47
+ Serverless: {
48
+ description: 'Lambda, Step Functions, EventBridge, SAM patterns.',
49
+ dirs: ['specialized-skills/serverless-skills/*'],
50
+ },
51
+ Storage: {
52
+ description: 'S3, EBS, EFS, FSx, Storage Gateway, data lake tables.',
53
+ dirs: ['specialized-skills/storage-skills/*'],
54
+ },
55
+ };
56
+
57
+ function listCategories() {
58
+ return Object.keys(CATEGORIES);
59
+ }
60
+
61
+ // Resolve selected category names → list of upstream relative paths to scan for skills.
62
+ // Each entry is a directory pattern under `skills/`. The caller globs each pattern.
63
+ // Special-cases "All" → returns the sentinel string '__ALL__' meaning every dir
64
+ // under skills/core-skills/ and skills/specialized-skills/<*>/.
65
+ function resolveDirs(selectedCategories) {
66
+ if (selectedCategories.includes('All')) {
67
+ return '__ALL__';
68
+ }
69
+ const dirs = new Set();
70
+ for (const cat of selectedCategories) {
71
+ const entry = CATEGORIES[cat];
72
+ if (!entry || !Array.isArray(entry.dirs)) continue;
73
+ for (const d of entry.dirs) {
74
+ dirs.add(d);
75
+ }
76
+ }
77
+ return Array.from(dirs);
78
+ }
79
+
80
+ module.exports = { CATEGORIES, listCategories, resolveDirs };
@@ -0,0 +1,168 @@
1
+ // Curated categories mapping human-readable groups to upstream Azure skill slugs
2
+ // from MicrosoftDocs/Agent-Skills (CC-BY-4.0). Match is prefix-based: a slug in the
3
+ // list matches any directory whose name starts with that slug. "all" is a sentinel
4
+ // meaning every directory under skills/.
5
+ //
6
+ // This file is the single source of truth. When Microsoft adds, renames, or removes
7
+ // services, update the prefixes here — install-azure-skills.js does not embed slugs.
8
+
9
+ const CATEGORIES = {
10
+ All: { description: 'Every skill in the upstream repo (skills/ and non-overlapping products/).' },
11
+ Compute: {
12
+ description: 'AKS, App Service, Container Apps/Instances/Registry, Functions, VMs, Batch.',
13
+ prefixes: [
14
+ 'azure-aks',
15
+ 'azure-app-service',
16
+ 'azure-container-apps',
17
+ 'azure-container-instances',
18
+ 'azure-container-registry',
19
+ 'azure-functions',
20
+ 'azure-virtual-machines',
21
+ 'azure-vmware-solution',
22
+ 'azure-batch',
23
+ 'azure-spring-apps',
24
+ ],
25
+ },
26
+ 'Data & Storage': {
27
+ description: 'Blob, Cosmos DB, SQL, MySQL, PostgreSQL, Cache for Redis, Data Lake, Files.',
28
+ prefixes: [
29
+ 'azure-blob-storage',
30
+ 'azure-cosmos-db',
31
+ 'azure-sql',
32
+ 'azure-database-for-mysql',
33
+ 'azure-database-for-postgresql',
34
+ 'azure-cache-redis',
35
+ 'azure-data-lake',
36
+ 'azure-files',
37
+ 'azure-storage',
38
+ 'azure-table-storage',
39
+ 'azure-queue-storage',
40
+ 'azure-managed-disk',
41
+ ],
42
+ },
43
+ 'AI & ML': {
44
+ description: 'OpenAI, AI Foundry, AI Vision, AI Search, Machine Learning, Anomaly Detector, Bot Service.',
45
+ prefixes: [
46
+ 'azure-openai',
47
+ 'azure-ai-foundry',
48
+ 'azure-ai-vision',
49
+ 'azure-ai-search',
50
+ 'azure-ai-services',
51
+ 'azure-machine-learning',
52
+ 'azure-anomaly-detector',
53
+ 'azure-bot-service',
54
+ 'azure-cognitive',
55
+ ],
56
+ },
57
+ Networking: {
58
+ description: 'Application Gateway, Front Door, Load Balancer, VPN Gateway, ExpressRoute, Bastion, DNS, CDN.',
59
+ prefixes: [
60
+ 'azure-application-gateway',
61
+ 'azure-front-door',
62
+ 'azure-load-balancer',
63
+ 'azure-vpn-gateway',
64
+ 'azure-expressroute',
65
+ 'azure-bastion',
66
+ 'azure-dns',
67
+ 'azure-cdn',
68
+ 'azure-virtual-network',
69
+ 'azure-virtual-wan',
70
+ 'azure-private-link',
71
+ 'azure-network-watcher',
72
+ 'azure-firewall',
73
+ 'azure-traffic-manager',
74
+ ],
75
+ },
76
+ 'Identity & Security': {
77
+ description: 'Entra ID (Active Directory), Key Vault, Attestation, Defender, Sentinel.',
78
+ prefixes: [
79
+ 'azure-active-directory',
80
+ 'azure-entra',
81
+ 'azure-key-vault',
82
+ 'azure-attestation',
83
+ 'azure-defender',
84
+ 'azure-sentinel',
85
+ 'azure-security-center',
86
+ 'azure-artifact-signing',
87
+ ],
88
+ },
89
+ DevOps: {
90
+ description: 'Azure DevOps (Boards, Pipelines, Artifacts, Repos), Azure DevOps Server, GitHub integration.',
91
+ prefixes: [
92
+ 'azure-boards',
93
+ 'azure-pipelines',
94
+ 'azure-artifacts',
95
+ 'azure-repos',
96
+ 'azure-devops',
97
+ 'azure-test-plans',
98
+ ],
99
+ },
100
+ Observability: {
101
+ description: 'Monitor, Application Insights, Log Analytics.',
102
+ prefixes: [
103
+ 'azure-monitor',
104
+ 'azure-application-insights',
105
+ 'azure-log-analytics',
106
+ ],
107
+ },
108
+ Integration: {
109
+ description: 'Logic Apps, Service Bus, Event Grid, Event Hubs, API Management, API Center.',
110
+ prefixes: [
111
+ 'azure-logic-apps',
112
+ 'azure-service-bus',
113
+ 'azure-event-grid',
114
+ 'azure-event-hubs',
115
+ 'azure-api-management',
116
+ 'azure-api-center',
117
+ 'azure-business-process-tracking',
118
+ ],
119
+ },
120
+ Architecture: {
121
+ description: 'Architecture guidance, Advisor, Blueprints, Well-Architected.',
122
+ prefixes: [
123
+ 'azure-architecture',
124
+ 'azure-advisor',
125
+ 'azure-blueprints',
126
+ 'azure-well-architected',
127
+ 'azure-policy',
128
+ 'azure-resource-graph',
129
+ 'azure-resource-manager',
130
+ ],
131
+ },
132
+ };
133
+
134
+ // Return the list of category names in the canonical display order.
135
+ function listCategories() {
136
+ return Object.keys(CATEGORIES);
137
+ }
138
+
139
+ // Resolve selected category names → flat set of slug prefixes to match against
140
+ // upstream skill directory names. Special-cases "All".
141
+ function resolvePrefixes(selectedCategories) {
142
+ if (selectedCategories.includes('All')) {
143
+ return null; // null = match every directory
144
+ }
145
+ const prefixes = new Set();
146
+ for (const cat of selectedCategories) {
147
+ const entry = CATEGORIES[cat];
148
+ if (!entry || !entry.prefixes) continue;
149
+ for (const prefix of entry.prefixes) {
150
+ prefixes.add(prefix);
151
+ }
152
+ }
153
+ return Array.from(prefixes);
154
+ }
155
+
156
+ // True when a directory name should be installed given the resolved prefix set.
157
+ // null prefix set means install everything.
158
+ function matchesPrefixes(dirName, prefixes) {
159
+ if (prefixes === null) return true;
160
+ for (const prefix of prefixes) {
161
+ if (dirName === prefix || dirName.startsWith(`${prefix}-`)) {
162
+ return true;
163
+ }
164
+ }
165
+ return false;
166
+ }
167
+
168
+ module.exports = { CATEGORIES, listCategories, resolvePrefixes, matchesPrefixes };
package/lib/constants.js CHANGED
@@ -2,7 +2,7 @@ const COMMANDS = {
2
2
  en: [
3
3
  { name: 'dw-adr', description: 'Records an architectural decision and the trade-offs accepted, before they get lost.' },
4
4
  { name: 'dw-analyze-project', description: 'Scans the repo to learn its stack and conventions, then writes the rules other commands rely on.' },
5
- { name: 'dw-autopilot', description: 'Trigger when user asks to implement, build, create, or add a feature non-trivially. Runs full PRD-to-PR pipeline with three gates.' },
5
+ { name: 'dw-autopilot', description: 'Trigger when user asks to implement, build, create, or add a feature non-trivially. Runs full PRD-to-PR pipeline with three gates. Use --from-prd <slug> to resume from an existing PRD (e.g., after a /dw-bugfix safety-valve escalation), skipping Steps 1-4 and starting at GATE 1.' },
6
6
  { name: 'dw-brainstorm', description: 'Refine an idea against the product\'s existing features. Modes: default ideation, --research (multi-source cited research), --refactor (Fowler code-smell catalog), --onepager, --council.' },
7
7
  { name: 'dw-bugfix', description: 'Trigger when user reports a bug, pastes an error, or describes broken behavior. Triages with three questions, then fixes or routes to PRD.' },
8
8
  { name: 'dw-commit', description: 'Trigger when implementation is complete and pending changes need to be committed. Atomic commits with Conventional Commits messages.' },
@@ -11,12 +11,16 @@ const COMMANDS = {
11
11
  { name: 'dw-functional-doc', description: 'Maps screens and user flows into a functional doc, validated end-to-end with Playwright.' },
12
12
  { name: 'dw-generate-pr', description: 'Trigger when commits are ready and the branch needs a PR. Pushes branch and opens PR with summary + test plan + hard verify gate.' },
13
13
  { name: 'dw-help', description: 'Lists primary commands and the flows that connect them. Pass --advanced to see internal/hidden commands.' },
14
+ { name: 'dw-install-aws-skills', description: 'Trigger when user asks to install AWS expertise, setup AWS MCP server, or add AWS agent skills. Opt-in: clones curated skills from aws/agent-toolkit-for-aws into .agents/skills/aws/ and registers the unified AWS MCP Server (stdio via mcp-proxy-for-aws). Requires uv, aws cli, and AWS credentials.' },
15
+ { name: 'dw-install-azure-skills', description: 'Trigger when user asks to install Azure expertise, setup Microsoft docs MCP, or add Azure agent skills. Opt-in: clones curated skills from MicrosoftDocs/Agent-Skills into .agents/skills/azure/ and registers the Microsoft Learn MCP server.' },
14
16
  { name: 'dw-intel', description: 'Codebase intelligence: query mode (default) answers questions citing .dw/intel/ + .dw/rules/; --build mode (re)builds the index.' },
15
17
  { name: 'dw-new-project', description: 'Interviews you about stack and infra, then scaffolds a working monorepo with docker-compose for dev, .env, scripts, CI, and seeded rules.' },
18
+ { name: 'dw-pause', description: 'Trigger when user says "pause work", "end session", or "save where we are". Consolidates open loops, decisions, blockers, and todos into .dw/STATE.md so the next session can resume.' },
16
19
  { name: 'dw-plan', description: 'Trigger when user has a feature idea and needs spec + architecture + tasks. Runs PRD → TechSpec → Tasks sequentially. Stages: prd / techspec / tasks; --from techspec; --council.' },
17
- { name: 'dw-qa', description: 'Trigger when user wants to validate behavior beyond unit tests. Mode-aware (UI / API / --ai). --fix enters the iterative QA + fix-retest loop.' },
20
+ { name: 'dw-qa', description: 'Trigger when user wants to validate behavior beyond unit tests. Mode-aware (UI / API / --ai / --uat). --fix enters the iterative QA + fix-retest loop. --bugfix <slug> targets a .dw/bugfixes/ entry.' },
18
21
  { name: 'dw-redesign-ui', description: 'Audits a frontend page, proposes design directions you choose from, then ships the redesign.' },
19
- { name: 'dw-review', description: 'Trigger when user asks to review code, check quality, or verify PR readiness. Default runs L2 (PRD coverage) + L3 (code quality). Flags --coverage-only / --code-only.' },
22
+ { name: 'dw-resume', description: 'Trigger when user says "resume work", "where did we stop?", or starts a session in a project with an existing .dw/STATE.md. Reads STATE.md, presents a TLDR, and suggests the next dw-* command.' },
23
+ { name: 'dw-review', description: 'Trigger when user asks to review code, check quality, or verify PR readiness. Default runs L2 (PRD coverage) + L3 (code quality). Flags --coverage-only / --code-only / --bugfix <slug>.' },
20
24
  { name: 'dw-run', description: 'Trigger when user wants to execute tasks. Default runs all pending in dependency order; \'run <task-id>\' runs one; \'run --resume\' continues an interrupted plan.' },
21
25
  { name: 'dw-secure-audit', description: 'Unified security audit: OWASP + Trivy SCA/secret/IaC + lockfile + supply-chain compromise check. Hidden; auto-invoked by /dw-review and /dw-generate-pr.' },
22
26
  { name: 'dw-update', description: 'Updates dev-workflow to the latest npm release in-place, with a snapshot you can roll back to.' },
@@ -24,7 +28,7 @@ const COMMANDS = {
24
28
  'pt-br': [
25
29
  { name: 'dw-adr', description: 'Registra uma decisao arquitetural e os trade-offs aceitos, antes que se percam.' },
26
30
  { name: 'dw-analyze-project', description: 'Escaneia o repo para aprender stack e convencoes, e escreve as regras que os outros commands usam.' },
27
- { name: 'dw-autopilot', description: 'Trigger quando usuario pede pra implementar, criar ou adicionar uma feature nao-trivial. Roda pipeline completo PRD-ao-PR com tres gates.' },
31
+ { name: 'dw-autopilot', description: 'Trigger quando usuario pede pra implementar, criar ou adicionar uma feature nao-trivial. Roda pipeline completo PRD-ao-PR com tres gates. Use --from-prd <slug> para retomar de um PRD existente (ex: apos escalacao do safety valve do /dw-bugfix), pulando Etapas 1-4 e comecando no GATE 1.' },
28
32
  { name: 'dw-brainstorm', description: 'Refina uma ideia contra features existentes do produto. Modos: ideacao default, --research (research multi-fonte citada), --refactor (catalogo de code smells Fowler), --onepager, --council.' },
29
33
  { name: 'dw-bugfix', description: 'Trigger quando usuario reporta bug, cola erro ou descreve comportamento quebrado. Tria com tres perguntas, depois corrige ou roteia pra PRD.' },
30
34
  { name: 'dw-commit', description: 'Trigger quando implementacao esta completa e ha mudancas pendentes pra commit. Commits atomicos com mensagens Conventional Commits.' },
@@ -33,12 +37,16 @@ const COMMANDS = {
33
37
  { name: 'dw-functional-doc', description: 'Mapeia telas e fluxos em um dossie funcional, validado E2E com Playwright.' },
34
38
  { name: 'dw-generate-pr', description: 'Trigger quando commits estao prontos e branch precisa de PR. Push da branch e abre PR com summary + test plan + hard verify gate.' },
35
39
  { name: 'dw-help', description: 'Lista comandos primarios e fluxos que os conectam. Passe --advanced para ver comandos internos/escondidos.' },
40
+ { name: 'dw-install-aws-skills', description: 'Trigger quando usuario pede pra instalar expertise AWS, configurar MCP da AWS, ou adicionar agent skills AWS. Opt-in: clona skills curadas de aws/agent-toolkit-for-aws para .agents/skills/aws/ e registra o AWS MCP Server unificado (stdio via mcp-proxy-for-aws). Requer uv, aws cli e credenciais AWS.' },
41
+ { name: 'dw-install-azure-skills', description: 'Trigger quando usuario pede pra instalar expertise Azure, configurar MCP do Microsoft docs, ou adicionar agent skills Azure. Opt-in: clona skills curadas de MicrosoftDocs/Agent-Skills para .agents/skills/azure/ e registra o Microsoft Learn MCP server.' },
36
42
  { name: 'dw-intel', description: 'Inteligencia do codebase: modo query (default) responde citando .dw/intel/ + .dw/rules/; modo --build (re)constroi indice.' },
37
43
  { name: 'dw-new-project', description: 'Entrevista voce sobre stack e infra, depois faz scaffold de um monorepo com docker-compose para dev, .env, scripts, CI e rules seed.' },
44
+ { name: 'dw-pause', description: 'Trigger quando usuario diz "pausa o trabalho", "encerra a sessao" ou "salva onde paramos". Consolida pontas soltas, decisoes, bloqueios e todos em .dw/STATE.md para a proxima sessao retomar.' },
38
45
  { name: 'dw-plan', description: 'Trigger quando usuario tem ideia de feature e precisa spec + arquitetura + tasks. Roda PRD → TechSpec → Tasks sequencial. Stages: prd / techspec / tasks; --from techspec; --council.' },
39
- { name: 'dw-qa', description: 'Trigger quando usuario quer validar comportamento alem de unit tests. Mode-aware (UI / API / --ai). --fix entra no loop iterativo QA + fix-retest.' },
46
+ { name: 'dw-qa', description: 'Trigger quando usuario quer validar comportamento alem de unit tests. Mode-aware (UI / API / --ai / --uat). --fix entra no loop iterativo QA + fix-retest. --bugfix <slug> aponta para uma entrada em .dw/bugfixes/.' },
40
47
  { name: 'dw-redesign-ui', description: 'Audita uma pagina frontend, propoe direcoes de design que voce escolhe, e entrega o redesign.' },
41
- { name: 'dw-review', description: 'Trigger quando usuario pede pra revisar codigo, checar qualidade ou validar prontidao pra PR. Default roda L2 (cobertura PRD) + L3 (qualidade). Flags --coverage-only / --code-only.' },
48
+ { name: 'dw-resume', description: 'Trigger quando usuario diz "retoma", "onde paramos?" ou comeca sessao num projeto com .dw/STATE.md existente. Le STATE.md, apresenta TLDR e sugere proximo comando dw-*.' },
49
+ { name: 'dw-review', description: 'Trigger quando usuario pede pra revisar codigo, checar qualidade ou validar prontidao pra PR. Default roda L2 (cobertura PRD) + L3 (qualidade). Flags --coverage-only / --code-only / --bugfix <slug>.' },
42
50
  { name: 'dw-run', description: 'Trigger quando usuario quer executar tasks. Default roda todas pendentes em ordem de dependencia; \'run <task-id>\' roda uma; \'run --resume\' continua plan interrompido.' },
43
51
  { name: 'dw-secure-audit', description: 'Audit unificado de seguranca: OWASP + Trivy SCA/secret/IaC + lockfile + supply-chain compromise. Hidden; auto-invocado por /dw-review e /dw-generate-pr.' },
44
52
  { name: 'dw-update', description: 'Atualiza o dev-workflow para o release mais recente no npm, com snapshot para rollback.' },
package/lib/init.js CHANGED
@@ -132,6 +132,34 @@ async function run({ force = false, lang = null, mode = 'init' }) {
132
132
  ensureDir(path.join(projectRoot, '.dw', 'spec'));
133
133
  }
134
134
 
135
+ // 5.1. Seed .dw/STATE.md from template (init only; never overwritten on update)
136
+ if (!isUpdate) {
137
+ console.log(' Session state:');
138
+ const stateTemplatePath = path.join(langDir, 'templates', 'state-template.md');
139
+ const stateDestPath = path.join(projectRoot, '.dw', 'STATE.md');
140
+ if (require('fs').existsSync(stateTemplatePath)) {
141
+ const stateStatus = writeFile(
142
+ stateDestPath,
143
+ require('fs').readFileSync(stateTemplatePath, 'utf-8'),
144
+ false
145
+ );
146
+ log(stateStatus, stateDestPath);
147
+ if (stateStatus === 'created') totalCreated++;
148
+ else totalSkipped++;
149
+ }
150
+ console.log();
151
+ }
152
+
153
+ // 5.2. Create .dw/bugfixes/ with .gitkeep (init only; preserved on update)
154
+ if (!isUpdate) {
155
+ const bugfixesDir = path.join(projectRoot, '.dw', 'bugfixes');
156
+ ensureDir(bugfixesDir);
157
+ const gitkeepPath = path.join(bugfixesDir, '.gitkeep');
158
+ const gitkeepStatus = writeFile(gitkeepPath, '', false);
159
+ if (gitkeepStatus === 'created') totalCreated++;
160
+ else totalSkipped++;
161
+ }
162
+
135
163
  // 5.5. Copy bundled skills to .agents/skills/
136
164
  const skillsSrcDir = path.join(SCAFFOLD_DIR, 'skills');
137
165
  if (require('fs').existsSync(skillsSrcDir)) {