@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
@@ -0,0 +1,166 @@
1
+ <system_instructions>
2
+ You install opt-in AWS agent skills from `aws/agent-toolkit-for-aws` (Apache 2.0) into `.agents/skills/aws/` and register the unified AWS MCP Server (stdio via `uvx mcp-proxy-for-aws`, requires AWS credentials) in `.claude/settings.json`. Same outcome as `npx @brunosps00/dev-workflow install-aws-skills` — different interface.
3
+
4
+ ## When to Use
5
+ - Use when the user asks to "install AWS skills", "setup AWS MCP", "add AWS expertise", "I'm going to work on AWS", or similar.
6
+ - Use when an existing project starts a new feature that touches AWS (Lambda, S3, Bedrock, EC2, etc.) and there is no `.agents/skills/aws/` yet.
7
+ - Do NOT use for Azure, GCP, or non-AWS clouds — those have their own commands or aren't supported.
8
+ - Do NOT use to install dev-workflow's own skills — those ship with `init`/`update`.
9
+
10
+ ## Pipeline Position
11
+ **Predecessor:** (user explicit request) | **Successor:** any AWS-shaped feature work (typically `/dw-plan` or `/dw-autopilot`).
12
+
13
+ ## Prerequisites
14
+
15
+ <critical>This command needs:
16
+ 1. `git` available on PATH.
17
+ 2. `uv` (Python tool runner) — provides `uvx` which invokes `mcp-proxy-for-aws`.
18
+ 3. `aws cli` ≥ 2.32.0.
19
+ 4. Valid AWS credentials — verify with `aws sts get-caller-identity`.
20
+
21
+ If ANY of these is missing or invalid, STOP and tell the user how to install/configure it. Do NOT clone or copy anything if prerequisites are not met — partial install is worse than no install.</critical>
22
+
23
+ ## Categories (upstream-native)
24
+
25
+ | Category | Upstream paths |
26
+ |---|---|
27
+ | **All** | `skills/core-skills/*` + `skills/specialized-skills/*/*` |
28
+ | **Core** | `skills/core-skills/*` — 13 horizontal skills: amazon-bedrock, aws-amplify, aws-billing-and-cost-management, aws-cdk, aws-cloudformation, aws-containers, aws-iam, aws-messaging-and-streaming, aws-observability, aws-sdk-js-v3-usage, aws-sdk-python-usage, aws-sdk-swift-usage, aws-serverless |
29
+ | **Analytics** | `skills/specialized-skills/analytics-skills/*` |
30
+ | **Database** | `skills/specialized-skills/database-skills/*` |
31
+ | **EC2 / Compute** | `skills/specialized-skills/ec2-skills/*` |
32
+ | **Migration & Modernization** | `skills/specialized-skills/migration-and-modernization-skills/*` |
33
+ | **Networking & Content Delivery** | `skills/specialized-skills/networking-and-content-delivery-skills/*` |
34
+ | **Operations** | `skills/specialized-skills/operations-skills/*` |
35
+ | **Security & Identity** | `skills/specialized-skills/security-and-identity-skills/*` |
36
+ | **Serverless** | `skills/specialized-skills/serverless-skills/*` |
37
+ | **Storage** | `skills/specialized-skills/storage-skills/*` |
38
+
39
+ ## Workflow
40
+
41
+ ### 1. Verify prerequisites
42
+
43
+ Run each in turn via Bash. On any failure, STOP and print the matching instruction block:
44
+
45
+ | Check | If missing |
46
+ |---|---|
47
+ | `git --version` | `git is required. Install via brew/apt/git-scm.com.` |
48
+ | `uv --version` | `uv is required. Install: curl -LsSf https://astral.sh/uv/install.sh \| sh` (macOS/Linux) or PowerShell equivalent on Windows. |
49
+ | `aws --version` | `aws cli ≥ 2.32.0 is required. Install via brew install awscli, winget install Amazon.AWSCLI, or follow AWS docs.` |
50
+ | `aws sts get-caller-identity` | `AWS credentials are missing/expired. Easiest: aws login (rotates every 15 min, valid 12h). SSO: aws configure sso. Keys: aws configure.` |
51
+
52
+ Do NOT proceed to step 2 if any check fails.
53
+
54
+ ### 2. Pick region
55
+
56
+ Ask the user which AWS region to use. The MCP server is regional — currently supported endpoints:
57
+
58
+ - `us-east-1` → `https://aws-mcp.us-east-1.api.aws/mcp`
59
+ - `eu-central-1` → `https://aws-mcp.eu-central-1.api.aws/mcp`
60
+
61
+ Default to `us-east-1` if the user has no preference. The agent can override per-query (e.g., "list EC2 instances in eu-west-1") — the endpoint region is just the default operating region.
62
+
63
+ ### 3. Ask which categories to install
64
+
65
+ Use AskUserQuestion (multi-select if supported; otherwise loop). Present the 11 categories above. Default suggestion when undecided: ask "what part of AWS are you about to work on?" and map to a category.
66
+
67
+ ### 4. Shallow clone the upstream repo
68
+
69
+ ```bash
70
+ TMP=$(mktemp -d -t dw-aws-skills-XXXXXX)
71
+ git clone --depth=1 https://github.com/aws/agent-toolkit-for-aws.git "$TMP"
72
+ ```
73
+
74
+ If the clone fails, STOP and report the error verbatim.
75
+
76
+ ### 5. Filter and copy
77
+
78
+ For each selected category, glob the corresponding upstream path and collect all skill directories. Examples:
79
+
80
+ - "Core" → every subdirectory of `$TMP/skills/core-skills/`
81
+ - "Database" → every subdirectory of `$TMP/skills/specialized-skills/database-skills/`
82
+ - "All" → every subdirectory of `$TMP/skills/core-skills/` AND every subdirectory of `$TMP/skills/specialized-skills/*/`
83
+
84
+ Before copying, **clear** `.agents/skills/aws/` for a clean refresh (re-runs replace previous selections).
85
+
86
+ Skip any skill whose root contains executable scripts (`.sh`, `.py`, `.js`, `.ts`, `.ps1`, `.bat`) — dev-workflow only installs pure-markdown skills. Report the skipped count.
87
+
88
+ Copy each matched directory recursively to `.agents/skills/aws/<skill-name>/`. **Flatten** the upstream hierarchy — the destination has no `core-skills/` vs `specialized-skills/` split. Just the skill slug as the directory name.
89
+
90
+ ### 6. Register the AWS MCP Server
91
+
92
+ Read `.claude/settings.json`. Parse the JSON. Upsert into `mcpServers`:
93
+
94
+ ```json
95
+ {
96
+ "mcpServers": {
97
+ "aws-mcp": {
98
+ "command": "uvx",
99
+ "args": [
100
+ "mcp-proxy-for-aws@latest",
101
+ "https://aws-mcp.us-east-1.api.aws/mcp",
102
+ "--metadata",
103
+ "AWS_REGION=us-east-1"
104
+ ],
105
+ "transport": "stdio",
106
+ "timeout": 100000
107
+ }
108
+ }
109
+ }
110
+ ```
111
+
112
+ Substitute the endpoint and `AWS_REGION` value with the region picked in step 2.
113
+
114
+ If `mcpServers.aws-mcp` already exists, leave it untouched — never overwrite. Tell the user to edit `.claude/settings.json` directly (or remove the entry and re-run) to change the region. Other entries in `mcpServers` (context7, playwright, microsoft-learn, etc.) MUST be preserved.
115
+
116
+ ### 7. Write `.dw/references/aws-mcp-instructions.md`
117
+
118
+ Create (overwrite if present) with the canonical agent-facing guidance — the 5 MCP tools (`aws___search_documentation`, `aws___read_documentation`, `aws___retrieve_skill`, `aws___call_aws`, `aws___run_script`), the destructive-operations protocol (confirm before any `create*`/`update*`/`delete*`/`modify*`/IAM/billing call), region behavior, source-grounding discipline, refresh/uninstall.
119
+
120
+ The CLI version of this command (`npx @brunosps00/dev-workflow install-aws-skills`) ships the canonical text. If running as a slash command, replicate the same content from `lib/install-aws-skills.js` `AWS_MCP_INSTRUCTIONS` constant.
121
+
122
+ ### 8. Cleanup
123
+
124
+ Remove `$TMP`. Always — even if earlier steps failed.
125
+
126
+ ### 9. Report
127
+
128
+ ```
129
+ ## AWS skills installed
130
+
131
+ Categories: [list]
132
+ Region: us-east-1 (or chosen)
133
+ Skills copied: N (skipped M with executable scripts)
134
+ MCP registered: aws-mcp (or "already present, left unchanged")
135
+ Agent instructions: .dw/references/aws-mcp-instructions.md
136
+
137
+ ## Next steps
138
+
139
+ 1. Restart Claude Code (or Codex / Copilot / OpenCode) so the MCP loads.
140
+ 2. Validate with an AWS question, e.g. "What's the Lambda concurrent execution limit?"
141
+ 3. The agent can now call AWS APIs via aws___call_aws — review
142
+ .dw/references/aws-mcp-instructions.md for destructive-op protocol.
143
+ 4. To refresh from upstream, re-run /dw-install-aws-skills.
144
+ 5. To uninstall: rm -rf .agents/skills/aws/ and remove the "aws-mcp"
145
+ entry from .claude/settings.json mcpServers.
146
+ ```
147
+
148
+ ## Required Behavior
149
+
150
+ <critical>NEVER add `aws-mcp` MCP outside of this command. It is opt-in. `init` and `update` MUST NOT touch it.</critical>
151
+
152
+ <critical>NEVER register the deprecated AWS Knowledge MCP (`https://knowledge-mcp.global.api.aws`). AWS officially superseded it with the unified AWS MCP Server; registering both causes tool conflicts that confuse agents.</critical>
153
+
154
+ <critical>NEVER auto-install `uv` or `aws cli`. Print the instruction block and let the user choose their install path. This avoids breaking the user's environment with package managers we don't own.</critical>
155
+
156
+ <critical>NEVER skip the credentials check. A clean install with no working `aws sts get-caller-identity` produces a broken MCP that fails on every tool call. Better to stop and instruct.</critical>
157
+
158
+ <critical>NEVER copy upstream LICENSE/README/CONTRIBUTING into `.agents/skills/aws/` — those belong to AWS and pollute skill discovery. Copy only per-skill `SKILL.md` + auxiliary content (references/, assets/).</critical>
159
+
160
+ <critical>NEVER copy skills with executable scripts. The dev-workflow scope is markdown-only. If a skill needs scripts, the user should install it directly from the upstream repo, not through this command.</critical>
161
+
162
+ ## Attribution
163
+
164
+ Skills come from [`aws/agent-toolkit-for-aws`](https://github.com/aws/agent-toolkit-for-aws) (Apache 2.0, by AWS). The MCP server is documented at [docs.aws.amazon.com/aws-mcp/](https://docs.aws.amazon.com/aws-mcp/). The proxy is [`aws/mcp-proxy-for-aws`](https://github.com/aws/mcp-proxy-for-aws). dev-workflow only orchestrates the install.
165
+
166
+ </system_instructions>
@@ -0,0 +1,138 @@
1
+ <system_instructions>
2
+ You install opt-in Azure agent skills from `MicrosoftDocs/Agent-Skills` (CC-BY-4.0) into `.agents/skills/azure/` and register the Microsoft Learn MCP Server (HTTP, no-auth) in `.claude/settings.json`. Same outcome as `npx @brunosps00/dev-workflow install-azure-skills` — different interface.
3
+
4
+ ## When to Use
5
+ - Use when the user asks to "install Azure skills", "setup Microsoft docs MCP", "add Azure expertise", "I'm going to work on Azure", or similar.
6
+ - Use when an existing project starts a new feature that touches Azure (Container Apps, OpenAI, AKS, etc.) and there is no `.agents/skills/azure/` yet.
7
+ - Do NOT use for AWS, GCP, or any non-Microsoft cloud — those are not in the upstream repo.
8
+ - Do NOT use to install dev-workflow's own skills — those ship with `init`/`update`.
9
+
10
+ ## Pipeline Position
11
+ **Predecessor:** (user explicit request) | **Successor:** any Azure-shaped feature work (typically `/dw-plan` or `/dw-autopilot`).
12
+
13
+ ## Prerequisites
14
+
15
+ <critical>This command needs `git` available on PATH. If `git --version` fails, STOP and tell the user to install git first.</critical>
16
+
17
+ ## Categories (curated)
18
+
19
+ | Category | What it covers |
20
+ |---|---|
21
+ | All | Every skill in the upstream `skills/` directory. |
22
+ | Compute | AKS, App Service, Container Apps/Instances/Registry, Functions, VMs, Batch, Spring Apps. |
23
+ | Data & Storage | Blob, Cosmos DB, SQL, MySQL, PostgreSQL, Cache for Redis, Data Lake, Files, Table/Queue Storage, Managed Disks. |
24
+ | AI & ML | OpenAI, AI Foundry, AI Vision, AI Search, AI Services, Machine Learning, Anomaly Detector, Bot Service, Cognitive Services. |
25
+ | Networking | Application Gateway, Front Door, Load Balancer, VPN Gateway, ExpressRoute, Bastion, DNS, CDN, Virtual Network, Virtual WAN, Private Link, Network Watcher, Firewall, Traffic Manager. |
26
+ | Identity & Security | Entra ID (Active Directory), Key Vault, Attestation, Defender, Sentinel, Security Center, Artifact Signing. |
27
+ | DevOps | Boards, Pipelines, Artifacts, Repos, Azure DevOps Server, Test Plans. |
28
+ | Observability | Monitor, Application Insights, Log Analytics. |
29
+ | Integration | Logic Apps, Service Bus, Event Grid, Event Hubs, API Management, API Center, Business Process Tracking. |
30
+ | Architecture | Architecture guidance, Advisor, Blueprints, Well-Architected, Policy, Resource Graph, Resource Manager. |
31
+
32
+ ## Workflow
33
+
34
+ ### 1. Verify `git`
35
+
36
+ Run `git --version` via Bash. On failure, STOP with: `git is required to install Azure skills. Install git and re-run.`
37
+
38
+ ### 2. Ask the user which categories to install
39
+
40
+ Use AskUserQuestion (multi-select if your interface supports it; otherwise loop). Present the 10 categories with their one-line descriptions. Default suggestion when the user is undecided: ask "what part of Azure are you about to work on?" and map their answer to a category.
41
+
42
+ ### 3. Shallow clone the upstream repo
43
+
44
+ ```bash
45
+ TMP=$(mktemp -d -t dw-azure-skills-XXXXXX)
46
+ git clone --depth=1 https://github.com/MicrosoftDocs/Agent-Skills.git "$TMP"
47
+ ```
48
+
49
+ If the clone fails (network, GitHub rate limit, etc.), STOP and report the error verbatim. Do not partially install.
50
+
51
+ ### 4. Filter and copy
52
+
53
+ For each subdirectory of `$TMP/skills/`, decide whether it matches the selected categories. The match is **prefix-based** — a directory name like `azure-aks-edge-essentials` matches the prefix `azure-aks`.
54
+
55
+ **Prefix table (canonical — keep in sync with `lib/azure-categories.js` in the dev-workflow repo):**
56
+
57
+ | Category | Prefixes |
58
+ |---|---|
59
+ | **All** | (every directory under `$TMP/skills/`) |
60
+ | **Compute** | `azure-aks`, `azure-app-service`, `azure-container-apps`, `azure-container-instances`, `azure-container-registry`, `azure-functions`, `azure-virtual-machines`, `azure-vmware-solution`, `azure-batch`, `azure-spring-apps` |
61
+ | **Data & Storage** | `azure-blob-storage`, `azure-cosmos-db`, `azure-sql`, `azure-database-for-mysql`, `azure-database-for-postgresql`, `azure-cache-redis`, `azure-data-lake`, `azure-files`, `azure-storage`, `azure-table-storage`, `azure-queue-storage`, `azure-managed-disk` |
62
+ | **AI & ML** | `azure-openai`, `azure-ai-foundry`, `azure-ai-vision`, `azure-ai-search`, `azure-ai-services`, `azure-machine-learning`, `azure-anomaly-detector`, `azure-bot-service`, `azure-cognitive` |
63
+ | **Networking** | `azure-application-gateway`, `azure-front-door`, `azure-load-balancer`, `azure-vpn-gateway`, `azure-expressroute`, `azure-bastion`, `azure-dns`, `azure-cdn`, `azure-virtual-network`, `azure-virtual-wan`, `azure-private-link`, `azure-network-watcher`, `azure-firewall`, `azure-traffic-manager` |
64
+ | **Identity & Security** | `azure-active-directory`, `azure-entra`, `azure-key-vault`, `azure-attestation`, `azure-defender`, `azure-sentinel`, `azure-security-center`, `azure-artifact-signing` |
65
+ | **DevOps** | `azure-boards`, `azure-pipelines`, `azure-artifacts`, `azure-repos`, `azure-devops`, `azure-test-plans` |
66
+ | **Observability** | `azure-monitor`, `azure-application-insights`, `azure-log-analytics` |
67
+ | **Integration** | `azure-logic-apps`, `azure-service-bus`, `azure-event-grid`, `azure-event-hubs`, `azure-api-management`, `azure-api-center`, `azure-business-process-tracking` |
68
+ | **Architecture** | `azure-architecture`, `azure-advisor`, `azure-blueprints`, `azure-well-architected`, `azure-policy`, `azure-resource-graph`, `azure-resource-manager` |
69
+
70
+ A directory matches a category if its name equals one of the prefixes OR starts with `<prefix>-`.
71
+
72
+ Before copying, **clear** `.agents/skills/azure/` to ensure a clean refresh (re-runs replace previous selections; this is intentional).
73
+
74
+ Skip any skill whose root contains executable scripts (`.sh`, `.py`, `.js`, `.ts`, `.ps1`, `.bat`) — dev-workflow only installs pure markdown skills. Report the skipped count.
75
+
76
+ Copy each matched directory recursively to `.agents/skills/azure/<skill-name>/`. Preserve subdirectories (`references/`, `assets/`).
77
+
78
+ ### 5. Register the Microsoft Learn MCP server
79
+
80
+ Read `.claude/settings.json` (create the directory if missing). Parse the JSON. Upsert into `mcpServers`:
81
+
82
+ ```json
83
+ {
84
+ "mcpServers": {
85
+ "microsoft-learn": {
86
+ "type": "http",
87
+ "url": "https://learn.microsoft.com/api/mcp"
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ If `mcpServers.microsoft-learn` already exists, leave it untouched — never overwrite user config. Other entries in `mcpServers` (context7, playwright, etc.) MUST be preserved.
94
+
95
+ ### 6. Write `.dw/references/azure-mcp-instructions.md`
96
+
97
+ Create this file (overwrite if present) with the agent-facing guidance — when to call which MCP tool (`microsoft_docs_search`, `microsoft_docs_fetch`, `microsoft_code_sample_search`), how to cite sources per `dw-source-grounding`, and how to refresh or uninstall.
98
+
99
+ The CLI version of this command (`npx @brunosps00/dev-workflow install-azure-skills`) ships the canonical text of this file — if you are running as a slash command, replicate the same content from `lib/install-azure-skills.js` `AZURE_MCP_INSTRUCTIONS` constant.
100
+
101
+ ### 7. Cleanup
102
+
103
+ Remove `$TMP`. Always — even if earlier steps failed.
104
+
105
+ ### 8. Report
106
+
107
+ ```
108
+ ## Azure skills installed
109
+
110
+ Categories: [list]
111
+ Skills copied: N (skipped M with executable scripts)
112
+ MCP registered: microsoft-learn (or "already present, left unchanged")
113
+ Agent instructions: .dw/references/azure-mcp-instructions.md
114
+
115
+ ## Next steps
116
+
117
+ 1. Restart Claude Code (or Codex / Copilot / OpenCode) so the MCP loads.
118
+ 2. Validate with an Azure question, e.g. "How do I deploy to Azure Container Apps?"
119
+ 3. To refresh from upstream, re-run /dw-install-azure-skills.
120
+ 4. To uninstall: rm -rf .agents/skills/azure/ and remove the "microsoft-learn"
121
+ entry from .claude/settings.json mcpServers.
122
+ ```
123
+
124
+ ## Required Behavior
125
+
126
+ <critical>NEVER add `microsoft-learn` MCP outside of this command. It is opt-in. `init` and `update` MUST NOT touch it.</critical>
127
+
128
+ <critical>NEVER copy skills with executable scripts. The dev-workflow scope is markdown-only. If a skill needs scripts, the user should install it directly from the upstream repo, not through this command.</critical>
129
+
130
+ <critical>NEVER fabricate the upstream URL or the MCP URL. The repo is `https://github.com/MicrosoftDocs/Agent-Skills.git` and the MCP endpoint is `https://learn.microsoft.com/api/mcp`. These are first-party Microsoft endpoints with CC-BY-4.0 attribution required.</critical>
131
+
132
+ <critical>NEVER copy upstream LICENSE/README files into `.agents/skills/azure/` — those belong to Microsoft and pollute the agent's skill discovery. Copy only `SKILL.md` + per-skill auxiliary content (references/, assets/).</critical>
133
+
134
+ ## Attribution
135
+
136
+ Skills come from [`MicrosoftDocs/Agent-Skills`](https://github.com/MicrosoftDocs/Agent-Skills) (CC-BY-4.0, by Microsoft). The MCP server is documented at [Microsoft Learn](https://learn.microsoft.com/en-us/training/support/mcp-get-started). dev-workflow only orchestrates the install — no upstream content is modified beyond directory placement.
137
+
138
+ </system_instructions>
@@ -38,9 +38,10 @@ You are the codebase intelligence assistant. Two modes: query the existing index
38
38
 
39
39
  ## File Locations
40
40
 
41
- - Machine-readable intel (queried first): `.dw/intel/{stack,files,apis,deps}.json` + `.dw/intel/arch.md`
41
+ - Machine-readable intel (queried first): `.dw/intel/{stack,files,apis,deps,bugfixes}.json` + `.dw/intel/arch.md`
42
42
  - Refresh metadata: `.dw/intel/.last-refresh.json`
43
- - Human-readable rules (queried second): `.dw/rules/{index,<module>,integrations}.md`
43
+ - Human-readable rules (queried second): `.dw/rules/{index,<module>,integrations,concerns}.md`
44
+ - Bugfix history source: `.dw/bugfixes/*/SUMMARY.md`
44
45
  - Direct grep fallback (queried last): the project source files
45
46
 
46
47
  ## Required Behavior
@@ -67,6 +68,8 @@ Classify the user's `{{QUERY}}` into one of the shapes documented in `.agents/sk
67
68
  - **api-list** — primary: `apis.json`
68
69
  - **find-export** — primary: `files.json` (search `exports` arrays)
69
70
  - **convention** — primary: `arch.md`, secondary: `.dw/rules/`
71
+ - **bugfix-history** — primary: `bugfixes.json`, secondary: `.dw/rules/concerns.md` (triggers: "bugs in <module>", "recent fixes", "what broke in X", "fix history for Y")
72
+ - **risk-area** — primary: `.dw/rules/concerns.md`, secondary: `bugfixes.json` (triggers: "is X risky", "what's fragile", "hot spots", "tech debt")
70
73
 
71
74
  ### 3. Search execution
72
75
 
@@ -143,7 +146,31 @@ When invoked with `--build`, the command produces or refreshes the queryable int
143
146
  5. **API extraction.** Routes, RPC handlers, GraphQL resolvers, public CLI surface. Output to `.dw/intel/apis.json`. Budget ≤1.5K tokens.
144
147
  6. **Dependency map.** Internal cross-module imports + external packages with `used_by` arrays. Output to `.dw/intel/deps.json`. Budget ≤1K tokens.
145
148
  7. **Architecture summary.** Prose document describing the project's shape, key patterns, request flows, deployment topology. Output to `.dw/intel/arch.md`. Budget ≤1.5K tokens.
146
- 8. **Refresh metadata.** Write `.dw/intel/.last-refresh.json` with `updated_at`, `version`, `mode` (full or incremental), files-scanned count.
149
+ 8. **Bugfix history.** If `.dw/bugfixes/` exists and is non-empty, scan every `SUMMARY.md` and build `.dw/intel/bugfixes.json` (budget ≤1K tokens). Schema:
150
+ ```json
151
+ {
152
+ "schema_version": "1.0",
153
+ "fixes": [
154
+ {
155
+ "slug": "001-login-not-working",
156
+ "date": "YYYY-MM-DD",
157
+ "status": "Fixed",
158
+ "severity": "Medium",
159
+ "symptom_one_line": "...",
160
+ "root_cause_one_line": "...",
161
+ "modules_touched": ["src/auth/", "src/api/login/"],
162
+ "files_touched": ["src/auth/session.ts", "src/auth/session.test.ts"],
163
+ "related_concerns": ["src/auth/session.ts"],
164
+ "path": ".dw/bugfixes/001-login-not-working/"
165
+ }
166
+ ],
167
+ "by_module": {
168
+ "src/auth/": ["001-login-not-working", "007-refresh-token-leak"]
169
+ }
170
+ }
171
+ ```
172
+ Skip if `.dw/bugfixes/` does not exist. Reject SUMMARY.md files that fail frontmatter validation; log them in the build report. **Escalated bugfixes** (those with `escalated.md` but no `SUMMARY.md` because the fix lives under `.dw/spec/prd-bugfix-<slug>/`) are skipped from `bugfixes.json` until the spec ships a fix — they re-enter the index when their SUMMARY.md is eventually written. The escalated `TASK.md` remains queryable by direct grep; the index only tracks completed fixes.
173
+ 9. **Refresh metadata.** Write `.dw/intel/.last-refresh.json` with `updated_at`, `version`, `mode` (full or incremental), files-scanned count, and `bugfixes_indexed` count.
147
174
 
148
175
  ### Complementary skill for build mode
149
176
 
@@ -0,0 +1,92 @@
1
+ <system_instructions>
2
+ You are a session-handoff agent. Your job is to consolidate the current session's mental state into `.dw/STATE.md` so the next session (yours or a teammate's) can resume without losing context.
3
+
4
+ ## When to Use
5
+ - Use when the user says "pause work", "end session", "I need to stop for now", "save what we're doing"
6
+ - Use proactively before a long break, before switching projects, or before a context window is about to be compacted
7
+ - Do NOT use mid-task when nothing has been decided or learned (nothing to consolidate)
8
+ - Do NOT use as a substitute for `/dw-commit` — STATE.md is mental state, not code changes
9
+
10
+ ## Pipeline Position
11
+ **Predecessor:** any working session | **Successor:** `/dw-resume` (in a future session)
12
+
13
+ ## What this command does NOT do
14
+ - It does NOT commit code (use `/dw-commit`)
15
+ - It does NOT replace per-PRD `MEMORY.md` (workflow memory for a single feature lives there; `dw-memory` skill manages it)
16
+ - It does NOT promote anything to ADRs (use `/dw-adr` for durable architectural decisions)
17
+
18
+ ## File Location
19
+ - Single artifact: `.dw/STATE.md` (project-level, not per-PRD)
20
+ - Template: `.dw/templates/state-template.md` (used only on first creation)
21
+
22
+ ## Workflow
23
+
24
+ ### 1. Ensure STATE.md exists
25
+ - If `.dw/STATE.md` is missing, copy `.dw/templates/state-template.md` to `.dw/STATE.md`. Notify in chat: "STATE.md not found — initialized from template."
26
+ - If `.dw/templates/state-template.md` is also missing (very old project), create a minimal STATE.md with the required sections (Open Loops, Decisions, Blockers, Todos, Deferred Ideas, Lessons, Preferences, Notes).
27
+
28
+ ### 2. Survey the session
29
+ Read the conversation context and identify, **without inventing**:
30
+
31
+ - **Open loops**: tasks/work started but not finished (e.g. "PRD `prd-foo` is at TechSpec stage, awaiting user approval"; "Task 3 of `prd-bar` failing on lint")
32
+ - **Decisions made**: choices the user and agent agreed on during the session that affect future work
33
+ - **Blockers encountered**: things that stopped forward motion (waiting on input, broken tooling, knowledge gap)
34
+ - **Todos** mentioned in passing that don't yet have a PRD or task file
35
+ - **Ideas explored and parked** (with the reason for parking)
36
+ - **Lessons learned** — small operational lessons worth recording
37
+ - **Preferences expressed** — conventions the user wants applied going forward
38
+
39
+ ### 3. Merge into STATE.md
40
+
41
+ <critical>NEVER overwrite STATE.md blindly. Read the existing file, parse the sections, and merge: append new items, do not delete old ones unless the user explicitly asked you to.</critical>
42
+
43
+ Rules:
44
+ - Each new entry gets a date prefix `YYYY-MM-DD` (use today's date).
45
+ - Use bullet lists. Keep each item to one line where possible; two lines if context is essential.
46
+ - If a section ends up with `_none_` placeholder and you have nothing to add, keep `_none_`.
47
+ - Update the `last_paused` frontmatter field to today's date (YYYY-MM-DD).
48
+
49
+ ### 4. Compaction pass (when STATE.md is large)
50
+
51
+ If after merging STATE.md exceeds **~6KB** or any single section exceeds **20 items**, compact:
52
+
53
+ - **Open Loops resolved during the session**: remove them.
54
+ - **Todos completed during the session**: remove them.
55
+ - **Decisions older than 30 days that have been formalized into ADRs or constitution**: remove (the ADR is the durable record).
56
+ - **Lessons older than 60 days**: keep only those still relevant; drop dated tactical advice.
57
+ - **Deferred Ideas older than 90 days with no revisit trigger**: ask the user before dropping.
58
+
59
+ If compaction removes more than 5 items, list them in chat so the user can veto.
60
+
61
+ ### 5. Report
62
+
63
+ Present a brief summary to the user:
64
+
65
+ ```
66
+ ## Session Paused
67
+
68
+ Updated `.dw/STATE.md`:
69
+ - Open Loops: +N (now: X total)
70
+ - Decisions: +N
71
+ - Blockers: +N (Y unresolved)
72
+ - Todos: +N (Z total)
73
+ - Deferred: +N
74
+
75
+ [If compaction ran: lines removed and why]
76
+
77
+ Resume with `/dw-resume` next session.
78
+ ```
79
+
80
+ ## Required Behavior
81
+
82
+ <critical>NEVER fabricate state. If you don't see evidence of a blocker or decision in the conversation, don't add it. Empty sections are fine.</critical>
83
+
84
+ <critical>NEVER touch per-PRD memory files (`.dw/spec/*/MEMORY.md`, `.dw/spec/*/tasks/*_memory.md`). Those are managed by `dw-memory` skill and are PRD-local.</critical>
85
+
86
+ <critical>NEVER drop user content silently. If you compact, you list what you removed.</critical>
87
+
88
+ ## Inspired by
89
+
90
+ This command adapts the session-handoff pattern 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) (CC-BY-4.0, Felipe Rodrigues). Adaptations: `.dw/STATE.md` location instead of `.specs/project/STATE.md`, explicit compaction protocol, frontmatter with `last_paused` / `last_resumed` for ordering signals, complementarity with the existing `dw-memory` skill.
91
+
92
+ </system_instructions>
@@ -19,6 +19,8 @@ You are the QA orchestrator. Two modes: run QA against the implementation (UI or
19
19
  | `/dw-qa --fix` | QA pass followed by an iterative fix+retest loop. Each detected bug → root-cause → fix → retest with evidence → mark resolved. Continues until all bugs marked Closed or user accepts a deferred list. |
20
20
  | `/dw-qa --api` | Forces API-only mode (skips UI even when frontend dependencies are present). Useful for backend-only sub-features in fullstack repos. |
21
21
  | `/dw-qa --ai` | Adds AI feature evaluation against the reference dataset at `.dw/eval/datasets/<feature>/`. Computes precision@k / faithfulness / outcome accuracy per the feature type. Logs JSONL to `QA/logs/ai/`. |
22
+ | `/dw-qa --uat` | **Interactive UAT walkthrough.** The agent walks the user through the feature step-by-step, asking targeted questions ("does this match expectation?", "what's the expected behavior in case X?"). No Playwright auto-driving, no AI eval. Output: `QA/uat-report.md`. Used after `--fix` (or instead of `/dw-qa` for primarily-judgment-bound features). |
23
+ | `/dw-qa --bugfix <NNN-slug>` | Targets a bugfix at `.dw/bugfixes/NNN-slug/` instead of a PRD. Runs the standard QA flow scoped to the files touched by the fix; output written to `.dw/bugfixes/NNN-slug/QA/`. Combines with `--fix`/`--api`/`--ai`/`--uat`. |
22
24
 
23
25
  ## Mode auto-detection
24
26
 
@@ -32,8 +34,17 @@ The default `/dw-qa` inspects the project to choose UI vs API:
32
34
 
33
35
  | Variable | Description | Example |
34
36
  |----------|-------------|---------|
35
- | `{{PRD_PATH}}` | Path to PRD directory containing tasks (auto-detect from active branch if omitted) | `.dw/spec/prd-invoice-export` |
36
- | `{{MODE}}` | `--fix` / `--api` / `--ai` (optional; default = auto-detect) | |
37
+ | `{{PRD_PATH}}` | Path to PRD directory containing tasks (auto-detect from active branch if omitted; ignored when `--bugfix` is used) | `.dw/spec/prd-invoice-export` |
38
+ | `{{BUGFIX_SLUG}}` | Bugfix slug when `--bugfix` flag is used | `001-login-not-working` |
39
+ | `{{MODE}}` | `--fix` / `--api` / `--ai` / `--uat` / `--bugfix <slug>` (optional; default = auto-detect, target = PRD) | — |
40
+
41
+ ## Target Resolution
42
+
43
+ Compute `<target>` ONCE at the start; substitute it wherever you see `<target>` below.
44
+
45
+ 1. **PRD target (default):** `<target>` = `{{PRD_PATH}}`. Artifacts read: `prd.md` (FRs), `techspec.md`, `tasks.md`, per-task files. Output written to `<target>/QA/`.
46
+
47
+ 2. **Bugfix target (`--bugfix <slug>`):** `<target>` = `.dw/bugfixes/<slug>/`. Artifacts read: `TASK.md` (numbered tasks + files touched), `fix-report.md` (verify evidence + reproduction trace), `SUMMARY.md`. QA is scoped to the files in the `Files Touched` table and the adjacent surfaces those files expose. Output written to `<target>/QA/`. The `qa-report.md` produced here is shorter — there are at most 5 tasks and a single root-cause to validate, not a full FR matrix.
37
48
 
38
49
  ## Complementary Skills
39
50
 
@@ -50,19 +61,20 @@ When available under `./.agents/skills/`, these are invoked operationally:
50
61
  ## Output Structure
51
62
 
52
63
  ```
53
- .dw/spec/<prd>/QA/
54
- ├── qa-report.md # Test plan + execution summary
55
- ├── bugs.md # Bug catalog with status
64
+ <target>/QA/ # <target> = .dw/spec/<prd>/ OR .dw/bugfixes/<NNN-slug>/
65
+ ├── qa-report.md # Test plan + execution summary
66
+ ├── bugs.md # Bug catalog with status
67
+ ├── uat-report.md # (--uat mode only) Walkthrough log + user observations
56
68
  ├── scripts/
57
- │ ├── ui/<RF>-<slug>.spec.ts # Playwright scripts (UI mode)
58
- │ ├── api/<RF>-<slug>.http # API test files
59
- │ └── ai/<feature>-eval.ts # AI eval scripts (--ai mode)
69
+ │ ├── ui/<RF>-<slug>.spec.ts # Playwright scripts (UI mode)
70
+ │ ├── api/<RF>-<slug>.http # API test files
71
+ │ └── ai/<feature>-eval.ts # AI eval scripts (--ai mode)
60
72
  ├── evidence/
61
- │ ├── ui/ # Screenshots per RF + retests
73
+ │ ├── ui/ # Screenshots per RF + retests
62
74
  │ └── ...
63
75
  └── logs/
64
- ├── api/<RF>-<slug>.log # JSONL request/response per call
65
- └── ai/<feature>-<date>.jsonl # AI eval results
76
+ ├── api/<RF>-<slug>.log # JSONL request/response per call
77
+ └── ai/<feature>-<date>.jsonl # AI eval results
66
78
  ```
67
79
 
68
80
  ## Mode 1: Default (`/dw-qa`)
@@ -105,6 +117,70 @@ When available under `./.agents/skills/`, these are invoked operationally:
105
117
  4. Compare to prior run's JSONL — alert on >10% regression in any metric.
106
118
  5. Append AI-mode section to `qa-report.md`.
107
119
 
120
+ ## Mode 1.5: Interactive UAT (`/dw-qa --uat`)
121
+
122
+ The UAT mode is a **human-in-the-loop walkthrough**. There is no Playwright auto-driving and no AI eval. The agent is the navigator; the user is the verifier. Use this when behavior is judgment-bound — a redesign, a content-heavy flow, a new flow whose acceptance criteria are partly aesthetic, or a bugfix whose user-facing manifestation needs a human eye to confirm.
123
+
124
+ ### Pre-flight
125
+
126
+ 1. **Bugfix target:** read `<target>/SUMMARY.md` → Symptom + Resolution. The walkthrough is the reproduction trace from `fix-report.md` (before → after), now confirmed live.
127
+ 2. **PRD target:** read `<target>/prd.md` → for each FR, draft a one-line "what should you see when X happens?" question.
128
+ 3. Start the project's dev server (or instruct the user to start it if it needs interactive credentials).
129
+
130
+ ### Walkthrough loop
131
+
132
+ For each FR (PRD target) or each numbered task in `TASK.md` (bugfix target):
133
+
134
+ 1. **Agent describes the next step in plain words.** Example: "Open `/invoices/export` while logged in as a viewer. The export button should be disabled and a tooltip should explain why."
135
+ 2. **User performs the step in their browser/app** and reports what they observed.
136
+ 3. **Agent asks one targeted follow-up** matched to the FR/task — never more than one open question at a time:
137
+ - "Does the disabled state visually communicate why? (text, icon, contrast — your call)"
138
+ - "If you tab to the button, does the tooltip become accessible via keyboard?"
139
+ - "What happened in the network panel?" (only if a backend behavior is relevant)
140
+ 4. **Agent records the answer verbatim** in `uat-report.md` under that FR/task's section. No interpretation, no rephrasing.
141
+ 5. **Agent flags a finding** when the user reports unexpected behavior. The finding goes into `bugs.md` with `source: uat` and `severity: <user's choice>`.
142
+ 6. **Repeat until all FRs / numbered tasks have been walked.**
143
+
144
+ ### Output
145
+
146
+ Save to `<target>/QA/uat-report.md`:
147
+
148
+ ```markdown
149
+ # UAT Walkthrough — <target>
150
+
151
+ Date: YYYY-MM-DD
152
+ Walked by: <user identifier or "user">
153
+ Browser/env: <as reported>
154
+
155
+ ## FR-1.1 (or Task 1) — <one-line scope>
156
+
157
+ - Step: <what agent asked>
158
+ - User observation: <verbatim>
159
+ - Verdict: PASS / FAIL / NEEDS-DESIGN-INPUT
160
+ - Notes: <any follow-up>
161
+
162
+ ## FR-1.2 (or Task 2) — ...
163
+ ...
164
+
165
+ ## Summary
166
+
167
+ - Walked: N FRs / tasks
168
+ - PASS: N
169
+ - FAIL: N (cross-ref bugs.md entries with source:uat)
170
+ - NEEDS-DESIGN-INPUT: N (no bug; the spec was under-defined here)
171
+ ```
172
+
173
+ ### Required behavior
174
+
175
+ <critical>
176
+ - NEVER auto-drive the browser in `--uat` mode. The user navigates; you observe.
177
+ - NEVER paraphrase the user's observation. Quote verbatim under each FR/task.
178
+ - NEVER mark a finding as a bug without the user's explicit "yes, that's a bug" — UAT findings can also surface unclear specs (NEEDS-DESIGN-INPUT), which are not bugs.
179
+ - Cap each FR's section at one open question per turn. UAT is interactive, not interrogation.
180
+ </critical>
181
+
182
+ UAT composes with `--bugfix <slug>` (walks the regression test path with the user instead of FRs) and with `--fix` (after a fix lands, UAT is the human green-light before commit).
183
+
108
184
  ## Mode 2: Fix loop (`/dw-qa --fix`)
109
185
 
110
186
  ### Behavior