@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.
- package/README.md +33 -16
- package/bin/dev-workflow.js +24 -7
- package/lib/aws-categories.js +80 -0
- package/lib/azure-categories.js +168 -0
- package/lib/constants.js +14 -6
- package/lib/init.js +28 -0
- package/lib/install-aws-skills.js +345 -0
- package/lib/install-azure-skills.js +231 -0
- package/lib/mcp.js +32 -21
- package/lib/prompts.js +38 -1
- package/package.json +1 -1
- package/scaffold/en/agent-instructions.md +23 -0
- package/scaffold/en/commands/dw-analyze-project.md +64 -0
- package/scaffold/en/commands/dw-autopilot.md +64 -5
- package/scaffold/en/commands/dw-bugfix.md +124 -26
- package/scaffold/en/commands/dw-install-aws-skills.md +166 -0
- package/scaffold/en/commands/dw-install-azure-skills.md +138 -0
- package/scaffold/en/commands/dw-intel.md +30 -3
- package/scaffold/en/commands/dw-pause.md +92 -0
- package/scaffold/en/commands/dw-qa.md +87 -11
- package/scaffold/en/commands/dw-resume.md +90 -0
- package/scaffold/en/commands/dw-review.md +22 -12
- package/scaffold/en/templates/bugfix-summary-template.md +66 -0
- package/scaffold/en/templates/concerns-template.md +59 -0
- package/scaffold/en/templates/state-template.md +59 -0
- package/scaffold/pt-br/agent-instructions.md +23 -0
- package/scaffold/pt-br/commands/dw-analyze-project.md +64 -0
- package/scaffold/pt-br/commands/dw-autopilot.md +64 -5
- package/scaffold/pt-br/commands/dw-bugfix.md +134 -18
- package/scaffold/pt-br/commands/dw-install-aws-skills.md +166 -0
- package/scaffold/pt-br/commands/dw-install-azure-skills.md +138 -0
- package/scaffold/pt-br/commands/dw-intel.md +30 -3
- package/scaffold/pt-br/commands/dw-pause.md +92 -0
- package/scaffold/pt-br/commands/dw-qa.md +87 -11
- package/scaffold/pt-br/commands/dw-resume.md +90 -0
- package/scaffold/pt-br/commands/dw-review.md +22 -12
- package/scaffold/pt-br/templates/bugfix-summary-template.md +66 -0
- package/scaffold/pt-br/templates/concerns-template.md +59 -0
- package/scaffold/pt-br/templates/state-template.md +59 -0
- package/scaffold/skills/dw-codebase-intel/SKILL.md +9 -5
- package/scaffold/skills/dw-codebase-intel/references/query-patterns.md +52 -0
- package/scaffold/skills/dw-memory/SKILL.md +26 -1
- package/scaffold/skills/dw-memory/references/context-budget.md +63 -0
|
@@ -16,6 +16,8 @@ The command classifies the query into one of these shapes before searching:
|
|
|
16
16
|
| **api-list** | "list endpoints", "what routes exist?" | `apis.json` | — |
|
|
17
17
|
| **find-export** | "where is `createServer` exported from?", "find the `userSchema` symbol" | `files.json` (search `exports` arrays) | grep fallback |
|
|
18
18
|
| **convention** | "what's the file naming convention?", "are tests co-located?" | `arch.md` | `.dw/rules/` if available |
|
|
19
|
+
| **bugfix-history** | "bugs in `src/auth/`?", "recent fixes touching login?", "what broke in payments?", "fix history for the export feature" | `bugfixes.json` | `.dw/rules/concerns.md`, `.dw/bugfixes/<NNN-slug>/SUMMARY.md` for top hits |
|
|
20
|
+
| **risk-area** | "is `src/auth/session.ts` risky?", "what's fragile here?", "where are the hot spots?", "tech debt in payments?" | `.dw/rules/concerns.md` | `bugfixes.json` (cross-ref bug history for the same module) |
|
|
19
21
|
|
|
20
22
|
## Match algorithm
|
|
21
23
|
|
|
@@ -122,6 +124,56 @@ Users (5)
|
|
|
122
124
|
Orders (5) ...
|
|
123
125
|
```
|
|
124
126
|
|
|
127
|
+
### Query: "bugs in src/auth/?"
|
|
128
|
+
|
|
129
|
+
**Shape:** bugfix-history
|
|
130
|
+
|
|
131
|
+
**Process:**
|
|
132
|
+
1. Read `bugfixes.json`, look up `by_module["src/auth/"]`.
|
|
133
|
+
2. For each slug returned, fetch the matching `fixes[]` entry (one-line symptom + root cause + date).
|
|
134
|
+
3. Cross-reference `.dw/rules/concerns.md` — if `src/auth/` appears under Hot Spots or Known Bug History, surface that callout.
|
|
135
|
+
4. Return chronological list with paths to the full SUMMARY.md for the top 3.
|
|
136
|
+
|
|
137
|
+
**Output:**
|
|
138
|
+
```
|
|
139
|
+
3 historical fixes touched src/auth/ (concerns.md flags it as a Hot Spot — 4 fixes in 60d):
|
|
140
|
+
|
|
141
|
+
- 007-refresh-token-leak (2026-03-12, Fixed, High)
|
|
142
|
+
Symptom: refresh token survived sign-out
|
|
143
|
+
Root cause: session map keyed by user id, not session id
|
|
144
|
+
→ .dw/bugfixes/007-refresh-token-leak/SUMMARY.md
|
|
145
|
+
|
|
146
|
+
- 003-mfa-skip-on-redirect (2026-02-04, Fixed, Medium)
|
|
147
|
+
Symptom: redirect chain bypassed MFA check
|
|
148
|
+
→ .dw/bugfixes/003-mfa-skip-on-redirect/SUMMARY.md
|
|
149
|
+
|
|
150
|
+
- 001-login-not-working (2026-01-20, Fixed, Medium)
|
|
151
|
+
Symptom: 500 on POST /login when email casing varied
|
|
152
|
+
→ .dw/bugfixes/001-login-not-working/SUMMARY.md
|
|
153
|
+
|
|
154
|
+
Consider adding a regression-test guard before further changes here.
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Query: "what's fragile in payments?"
|
|
158
|
+
|
|
159
|
+
**Shape:** risk-area
|
|
160
|
+
|
|
161
|
+
**Process:**
|
|
162
|
+
1. Read `.dw/rules/concerns.md`. Search each section (Hot Spots, Fragile Integrations, Hostile Code, Known Bug History, Tech Debt) for `payments`.
|
|
163
|
+
2. For Known Bug History matches, cross-reference `bugfixes.json` `by_module["src/payments/"]` to enumerate recent slugs.
|
|
164
|
+
3. Return one paragraph per concerns.md section that matched, with cross-ref to the bugfix slugs.
|
|
165
|
+
|
|
166
|
+
**Output:**
|
|
167
|
+
```
|
|
168
|
+
Three risk signals for src/payments/:
|
|
169
|
+
|
|
170
|
+
Hot Spot: 5 commits in last 30 days; 2 historical bugfixes (refund-rounding, stripe-webhook-retry).
|
|
171
|
+
Fragile Integration: Stripe webhook delivery — concerns.md notes "silent 200 OK when signature header is absent".
|
|
172
|
+
Hostile Code: src/payments/parseInvoice.ts:parseLine — 900-char regex, no comments; original author flagged "rewrite if it breaks".
|
|
173
|
+
|
|
174
|
+
See: .dw/rules/concerns.md, .dw/bugfixes/{002-stripe-webhook-retry,007-refund-rounding}/SUMMARY.md
|
|
175
|
+
```
|
|
176
|
+
|
|
125
177
|
## Stale-index handling
|
|
126
178
|
|
|
127
179
|
Before answering, check `.dw/intel/.last-refresh.json`:
|
|
@@ -145,6 +145,29 @@ When flagged for compaction, apply inline:
|
|
|
145
145
|
4. **Rewrite** retained items as short factual bullets. No narrative logs, no chronological play-by-play.
|
|
146
146
|
5. Keep the default section headings intact. Remove empty sections only if truly unused.
|
|
147
147
|
|
|
148
|
+
## Context Budget
|
|
149
|
+
|
|
150
|
+
Memory is part of a broader **context budget** the agent must respect during execution. A blown budget degrades reasoning before any output is produced — the model starts missing requirements, drops constraints, and reverts to averaged-over-training answers. Full guidance: [`references/context-budget.md`](references/context-budget.md).
|
|
151
|
+
|
|
152
|
+
**Targets:**
|
|
153
|
+
|
|
154
|
+
- **Total active context:** under **40k tokens** (rough working budget across PRD + TechSpec + tasks + MEMORY.md + per-task memory + open files).
|
|
155
|
+
- **Reserve:** at least **120k tokens** of headroom for actual reasoning, tool output, and the model's response stream.
|
|
156
|
+
- **Hard ceiling per memory file:** `MEMORY.md` ≤ 6KB; `<N>_memory.md` ≤ 3KB. Past those, compact instead of growing.
|
|
157
|
+
|
|
158
|
+
**Anti-co-load rules** (apply on every load):
|
|
159
|
+
|
|
160
|
+
1. Never load two PRD specs in the same context. If switching PRDs, drop the previous PRD's spec/techspec/tasks references from the active set.
|
|
161
|
+
2. Never load multiple archived `.dw/bugfixes/` SUMMARY.md files together — load only what's needed for the active fix or query.
|
|
162
|
+
3. Never load `.dw/intel/files.json` and `.dw/intel/deps.json` simultaneously when answering a single question — pick the primary per query shape (see `dw-codebase-intel/references/query-patterns.md`).
|
|
163
|
+
4. Never load a design proposal AND the prior design's full text — if comparing, summarize the prior into 5-10 lines.
|
|
164
|
+
|
|
165
|
+
**Monitoring signal:**
|
|
166
|
+
|
|
167
|
+
If the agent finds itself reading large files repeatedly or summarizing the same fact across multiple turns, that's a budget signal. Compact memory and explicitly drop unrelated loaded context before proceeding. Note this in `MEMORY.md` under Handoff Notes so the next task starts lean.
|
|
168
|
+
|
|
169
|
+
This budget is doctrine, not a hard gate. No command currently rejects work for exceeding 40k. The discipline lives here because future sessions read this skill first.
|
|
170
|
+
|
|
148
171
|
## Error Handling
|
|
149
172
|
|
|
150
173
|
- If any caller-provided memory path is missing, stop and report the mismatch instead of guessing another path.
|
|
@@ -165,6 +188,8 @@ Ported from Compozy's `cy-workflow-memory` skill (`/tmp/compozy/.agents/skills/c
|
|
|
165
188
|
|
|
166
189
|
- Paths are `.dw/spec/<prd-slug>/` instead of `.compozy/tasks/<name>/`.
|
|
167
190
|
- Task-local file is `<N>_memory.md` next to `<N>_task.md` (mirrors the existing dev-workflow task layout).
|
|
168
|
-
- Inline Compaction Rules (Compozy keeps them in `references/memory-guidelines.md`);
|
|
191
|
+
- Inline Compaction Rules (Compozy keeps them in `references/memory-guidelines.md`); the budget discipline was extracted to `references/context-budget.md` because it's about model behavior, not file management.
|
|
169
192
|
|
|
170
193
|
Credit: Compozy project (https://github.com/compozy/compozy).
|
|
194
|
+
|
|
195
|
+
The Context Budget section adapts the context-loading discipline 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). The target, the anti-co-load rules, and the "monitoring signal" framing come from there; the integration with two-tier memory and the specific file ceilings are dev-workflow-specific.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Context Budget — Discipline
|
|
2
|
+
|
|
3
|
+
A working context window is finite. Past about 40k tokens of active content, model output quality degrades — the model starts to miss requirements, lose constraints, blur details across sources, and revert to training-set averages. This file codifies the discipline that keeps active context lean across a long dev-workflow session.
|
|
4
|
+
|
|
5
|
+
## The numbers
|
|
6
|
+
|
|
7
|
+
- **Target active load:** under **40k tokens** total — PRD, TechSpec, tasks, MEMORY.md, per-task memory, all open files together.
|
|
8
|
+
- **Reasoning reserve:** **120k+ tokens** of headroom for tool output, model thinking, and response generation.
|
|
9
|
+
- **Soft alert:** when active load crosses **30k tokens**, plan to compact before the next major task.
|
|
10
|
+
- **Compaction threshold for `MEMORY.md`:** ≤ 6KB on disk.
|
|
11
|
+
- **Compaction threshold for `<N>_memory.md`:** ≤ 3KB on disk.
|
|
12
|
+
|
|
13
|
+
These are doctrine, not enforced by any hard gate. The cost of breaking them is degraded output, not a command failure. Catch it yourself; the framework can't.
|
|
14
|
+
|
|
15
|
+
## The anti-co-load rules
|
|
16
|
+
|
|
17
|
+
Each is a "do not load both simultaneously" pairing. Pick one; if you must consult the other, summarize it to 5–10 lines first and drop the full version.
|
|
18
|
+
|
|
19
|
+
1. **Two PRDs at once.** Working on `prd-foo`, then user asks about `prd-bar`? Finish `prd-foo`'s active turn first, drop its spec/techspec/tasks from active context, then load `prd-bar`. Never carry both spec sets.
|
|
20
|
+
|
|
21
|
+
2. **Multiple archived bugfix SUMMARY.md files.** Bugfix history queries should go through `.dw/intel/bugfixes.json` (compact, indexed), not by reading 20 SUMMARY.md files. Read individual SUMMARY.md only when the user is acting on that specific fix.
|
|
22
|
+
|
|
23
|
+
3. **Files.json + deps.json simultaneously.** They overlap. Each query has a primary file per `dw-codebase-intel/references/query-patterns.md`. Pick the primary; consult the secondary only if the primary returns nothing.
|
|
24
|
+
|
|
25
|
+
4. **A design proposal AND its predecessor's full text.** When comparing two designs, summarize the older one to 5–10 lines (the deltas the new one addresses) and reference it that way. Don't carry both in full.
|
|
26
|
+
|
|
27
|
+
5. **Per-task memories from non-adjacent tasks.** Only the current task's `<N>_memory.md` and the immediately-previous one (for handoff) belong in active context. Older `<N>_memory.md` files are durable storage — read them when explicitly handing back to an old task, not as part of routine loading.
|
|
28
|
+
|
|
29
|
+
## The monitoring signal
|
|
30
|
+
|
|
31
|
+
You will not see a token counter. You can't measure your own budget directly. But these are observable proxies that mean **you are over budget**:
|
|
32
|
+
|
|
33
|
+
- You are reading the same file twice in the same session without it having changed.
|
|
34
|
+
- You are summarizing the same fact across multiple turns to keep it in scope.
|
|
35
|
+
- You are answering questions by re-deriving from the repo what a memory file would tell you in one line.
|
|
36
|
+
- You are confusing details between two PRDs, tasks, or designs.
|
|
37
|
+
- Your turn outputs are getting longer to compensate for context that is silently slipping out of the model's attention.
|
|
38
|
+
|
|
39
|
+
When you notice any of these, stop:
|
|
40
|
+
|
|
41
|
+
1. Compact `MEMORY.md` and the active `<N>_memory.md` per the Compaction Rules in `SKILL.md`.
|
|
42
|
+
2. Explicitly state in chat what you are dropping from active context.
|
|
43
|
+
3. Note the budget event in `MEMORY.md` under Handoff Notes ("compacted at task N — see this section for what was dropped").
|
|
44
|
+
4. Resume the turn.
|
|
45
|
+
|
|
46
|
+
## What is NOT a budget problem
|
|
47
|
+
|
|
48
|
+
These look like budget problems but aren't — don't compact for them:
|
|
49
|
+
|
|
50
|
+
- **A genuinely complex task.** Some features legitimately need many files. Read what you need; the alternative (working from partial context) is worse.
|
|
51
|
+
- **A long verification report.** Verify output can be long. Don't summarize it before logging it to disk; truncate the chat surface, not the artifact.
|
|
52
|
+
- **A long user message.** The user wrote what they wrote. Don't compact to shave their words.
|
|
53
|
+
- **The first PRD load of a new feature.** First-load is fine; second-load of the same PRD in the same turn is the signal.
|
|
54
|
+
|
|
55
|
+
## Integration with other skills
|
|
56
|
+
|
|
57
|
+
- **`dw-memory` (this skill)**: compaction is the lever for memory files; this file describes when and why.
|
|
58
|
+
- **`dw-codebase-intel`**: `query-patterns.md` defines the primary-vs-secondary rule that anti-co-load rule #3 references.
|
|
59
|
+
- **`dw-verify`**: a budget-related degradation may show up as a verify regression. If verify keeps failing on facts the PRD already states, suspect budget before suspecting code.
|
|
60
|
+
|
|
61
|
+
## Source
|
|
62
|
+
|
|
63
|
+
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) (CC-BY-4.0, Felipe Rodrigues). The 40k target, the anti-co-load principle, and the monitoring-signal framing come from there. The specific anti-co-load pairings, file-size ceilings, and the integration with `dw-memory`/`dw-codebase-intel` are dev-workflow-specific.
|