forgecommandline 0.8.0__py3-none-any.whl

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 (113) hide show
  1. forgecli/__init__.py +2 -0
  2. forgecli/ads.py +322 -0
  3. forgecli/agent.py +1093 -0
  4. forgecli/art.py +574 -0
  5. forgecli/attach.py +246 -0
  6. forgecli/brief.py +215 -0
  7. forgecli/browsercheck.py +99 -0
  8. forgecli/checkpoints.py +81 -0
  9. forgecli/city.py +833 -0
  10. forgecli/cli.py +1668 -0
  11. forgecli/config.py +194 -0
  12. forgecli/courier.py +177 -0
  13. forgecli/courier_data.py +164 -0
  14. forgecli/courier_hd.py +431 -0
  15. forgecli/courier_hd_data.bin +0 -0
  16. forgecli/courier_hd_data.py +19 -0
  17. forgecli/ghlogin.py +76 -0
  18. forgecli/github.py +54 -0
  19. forgecli/guards.py +403 -0
  20. forgecli/hooks.py +50 -0
  21. forgecli/httpapi.py +434 -0
  22. forgecli/images.py +110 -0
  23. forgecli/keys.py +152 -0
  24. forgecli/keyvault.py +320 -0
  25. forgecli/mcp.py +674 -0
  26. forgecli/memory.py +42 -0
  27. forgecli/openapi.py +331 -0
  28. forgecli/parallel.py +308 -0
  29. forgecli/prices.py +72 -0
  30. forgecli/procs.py +144 -0
  31. forgecli/providers.py +758 -0
  32. forgecli/quality.py +192 -0
  33. forgecli/repomap.py +78 -0
  34. forgecli/roster.py +227 -0
  35. forgecli/safety.py +93 -0
  36. forgecli/sandbox.py +83 -0
  37. forgecli/sessions.py +97 -0
  38. forgecli/skills.py +446 -0
  39. forgecli/tools.py +1184 -0
  40. forgecli/ui.py +860 -0
  41. forgecli/worktrees.py +79 -0
  42. forgecommandline-0.8.0.data/data/skills/commit/SKILL.md +14 -0
  43. forgecommandline-0.8.0.data/data/skills/debug/SKILL.md +17 -0
  44. forgecommandline-0.8.0.data/data/skills/explain/SKILL.md +14 -0
  45. forgecommandline-0.8.0.data/data/skills/init/SKILL.md +19 -0
  46. forgecommandline-0.8.0.data/data/skills/library/LICENSES/agent-skills-MIT.txt +21 -0
  47. forgecommandline-0.8.0.data/data/skills/library/LICENSES/wondelai-MIT.txt +23 -0
  48. forgecommandline-0.8.0.data/data/skills/library/README.md +9 -0
  49. forgecommandline-0.8.0.data/data/skills/library/_references/accessibility-checklist.md +160 -0
  50. forgecommandline-0.8.0.data/data/skills/library/_references/definition-of-done.md +67 -0
  51. forgecommandline-0.8.0.data/data/skills/library/_references/observability-checklist.md +92 -0
  52. forgecommandline-0.8.0.data/data/skills/library/_references/orchestration-patterns.md +370 -0
  53. forgecommandline-0.8.0.data/data/skills/library/_references/performance-checklist.md +238 -0
  54. forgecommandline-0.8.0.data/data/skills/library/_references/security-checklist.md +248 -0
  55. forgecommandline-0.8.0.data/data/skills/library/_references/testing-patterns.md +235 -0
  56. forgecommandline-0.8.0.data/data/skills/library/api-and-interface-design/SKILL.md +367 -0
  57. forgecommandline-0.8.0.data/data/skills/library/architecture-optimization/SKILL.md +279 -0
  58. forgecommandline-0.8.0.data/data/skills/library/architecture-optimization/references/artifact-templates.md +157 -0
  59. forgecommandline-0.8.0.data/data/skills/library/architecture-optimization/references/methods.md +87 -0
  60. forgecommandline-0.8.0.data/data/skills/library/awwwards-tier-web-application/SKILL.md +877 -0
  61. forgecommandline-0.8.0.data/data/skills/library/browser-testing-with-devtools/SKILL.md +317 -0
  62. forgecommandline-0.8.0.data/data/skills/library/ci-cd-and-automation/SKILL.md +390 -0
  63. forgecommandline-0.8.0.data/data/skills/library/code-review-and-quality/SKILL.md +398 -0
  64. forgecommandline-0.8.0.data/data/skills/library/code-simplification/SKILL.md +331 -0
  65. forgecommandline-0.8.0.data/data/skills/library/constraint-driven-development/SKILL.md +311 -0
  66. forgecommandline-0.8.0.data/data/skills/library/constraint-driven-development/references/floor-guard.md +182 -0
  67. forgecommandline-0.8.0.data/data/skills/library/context-engineering/SKILL.md +353 -0
  68. forgecommandline-0.8.0.data/data/skills/library/debugging-and-error-recovery/SKILL.md +300 -0
  69. forgecommandline-0.8.0.data/data/skills/library/deprecation-and-migration/SKILL.md +247 -0
  70. forgecommandline-0.8.0.data/data/skills/library/documentation-and-adrs/SKILL.md +297 -0
  71. forgecommandline-0.8.0.data/data/skills/library/doubt-driven-development/SKILL.md +243 -0
  72. forgecommandline-0.8.0.data/data/skills/library/frontend-ui-engineering/SKILL.md +340 -0
  73. forgecommandline-0.8.0.data/data/skills/library/git-workflow-and-versioning/SKILL.md +355 -0
  74. forgecommandline-0.8.0.data/data/skills/library/idea-refine/SKILL.md +193 -0
  75. forgecommandline-0.8.0.data/data/skills/library/idea-refine/examples.md +238 -0
  76. forgecommandline-0.8.0.data/data/skills/library/idea-refine/frameworks.md +99 -0
  77. forgecommandline-0.8.0.data/data/skills/library/idea-refine/refinement-criteria.md +113 -0
  78. forgecommandline-0.8.0.data/data/skills/library/idea-refine/scripts/idea-refine.sh +15 -0
  79. forgecommandline-0.8.0.data/data/skills/library/improve-code-quality/SKILL.md +275 -0
  80. forgecommandline-0.8.0.data/data/skills/library/improve-code-quality/references/artifact-templates.md +101 -0
  81. forgecommandline-0.8.0.data/data/skills/library/incremental-implementation/SKILL.md +249 -0
  82. forgecommandline-0.8.0.data/data/skills/library/interview-me/SKILL.md +235 -0
  83. forgecommandline-0.8.0.data/data/skills/library/observability-and-instrumentation/SKILL.md +238 -0
  84. forgecommandline-0.8.0.data/data/skills/library/performance-optimization/SKILL.md +267 -0
  85. forgecommandline-0.8.0.data/data/skills/library/performance-optimization/references/optimization-patterns.md +250 -0
  86. forgecommandline-0.8.0.data/data/skills/library/planning-and-task-breakdown/SKILL.md +257 -0
  87. forgecommandline-0.8.0.data/data/skills/library/remove-technical-debt/SKILL.md +203 -0
  88. forgecommandline-0.8.0.data/data/skills/library/remove-technical-debt/references/artifact-templates.md +79 -0
  89. forgecommandline-0.8.0.data/data/skills/library/security-and-hardening/SKILL.md +216 -0
  90. forgecommandline-0.8.0.data/data/skills/library/security-and-hardening/references/hardening-patterns.md +324 -0
  91. forgecommandline-0.8.0.data/data/skills/library/shipping-and-launch/SKILL.md +336 -0
  92. forgecommandline-0.8.0.data/data/skills/library/source-driven-development/SKILL.md +216 -0
  93. forgecommandline-0.8.0.data/data/skills/library/spec-driven-development/SKILL.md +259 -0
  94. forgecommandline-0.8.0.data/data/skills/library/system-design/SKILL.md +207 -0
  95. forgecommandline-0.8.0.data/data/skills/library/system-design/references/building-blocks.md +272 -0
  96. forgecommandline-0.8.0.data/data/skills/library/system-design/references/common-designs.md +257 -0
  97. forgecommandline-0.8.0.data/data/skills/library/system-design/references/database-scaling.md +295 -0
  98. forgecommandline-0.8.0.data/data/skills/library/system-design/references/estimation-numbers.md +250 -0
  99. forgecommandline-0.8.0.data/data/skills/library/system-design/references/four-step-process.md +286 -0
  100. forgecommandline-0.8.0.data/data/skills/library/system-design/references/reliability-operations.md +373 -0
  101. forgecommandline-0.8.0.data/data/skills/library/test-driven-development/SKILL.md +398 -0
  102. forgecommandline-0.8.0.data/data/skills/library/using-agent-skills/SKILL.md +192 -0
  103. forgecommandline-0.8.0.data/data/skills/review/SKILL.md +16 -0
  104. forgecommandline-0.8.0.data/data/skills/run/SKILL.md +17 -0
  105. forgecommandline-0.8.0.data/data/skills/security-review/SKILL.md +20 -0
  106. forgecommandline-0.8.0.data/data/skills/simplify/SKILL.md +18 -0
  107. forgecommandline-0.8.0.data/data/skills/test/SKILL.md +16 -0
  108. forgecommandline-0.8.0.data/data/skills/web-build/SKILL.md +25 -0
  109. forgecommandline-0.8.0.dist-info/METADATA +357 -0
  110. forgecommandline-0.8.0.dist-info/RECORD +113 -0
  111. forgecommandline-0.8.0.dist-info/WHEEL +5 -0
  112. forgecommandline-0.8.0.dist-info/entry_points.txt +2 -0
  113. forgecommandline-0.8.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,257 @@
1
+ ---
2
+ name: planning-and-task-breakdown
3
+ description: Breaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.
4
+ ---
5
+
6
+ # Planning and Task Breakdown
7
+
8
+ ## Overview
9
+
10
+ Decompose work into small, verifiable tasks with explicit acceptance criteria. Good task breakdown is the difference between an agent that completes work reliably and one that produces a tangled mess. Every task should be small enough to implement, test, and verify in a single focused session.
11
+
12
+ ## When to Use
13
+
14
+ - You have a spec and need to break it into implementable units
15
+ - A task feels too large or vague to start
16
+ - Work needs to be parallelized across multiple agents or sessions
17
+ - You need to communicate scope to a human
18
+ - The implementation order isn't obvious
19
+
20
+ **When NOT to use:** Single-file changes with obvious scope, or when the spec already contains well-defined tasks.
21
+
22
+ ## The Planning Process
23
+
24
+ ### Step 1: Enter Plan Mode
25
+
26
+ Before writing any code, operate in read-only mode:
27
+
28
+ - Read the spec and relevant codebase sections
29
+ - Identify existing patterns and conventions
30
+ - Map dependencies between components
31
+ - Note risks and unknowns
32
+
33
+ **Do NOT write code during planning.** The output is a plan document saved to `tasks/plan.md` and a task list recorded in the task list target (see Output Files; default `tasks/todo.md`), not implementation.
34
+
35
+ ### Step 2: Identify the Dependency Graph
36
+
37
+ Map what depends on what:
38
+
39
+ ```
40
+ Database schema
41
+ │
42
+ ├── API models/types
43
+ │ │
44
+ │ ├── API endpoints
45
+ │ │ │
46
+ │ │ └── Frontend API client
47
+ │ │ │
48
+ │ │ └── UI components
49
+ │ │
50
+ │ └── Validation logic
51
+ │
52
+ └── Seed data / migrations
53
+ ```
54
+
55
+ Implementation order follows the dependency graph bottom-up: build foundations first.
56
+
57
+ ### Step 3: Slice Vertically
58
+
59
+ Instead of building all the database, then all the API, then all the UI — build one complete feature path at a time:
60
+
61
+ **Bad (horizontal slicing):**
62
+ ```
63
+ Task 1: Build entire database schema
64
+ Task 2: Build all API endpoints
65
+ Task 3: Build all UI components
66
+ Task 4: Connect everything
67
+ ```
68
+
69
+ **Good (vertical slicing):**
70
+ ```
71
+ Task 1: User can create an account (schema + API + UI for registration)
72
+ Task 2: User can log in (auth schema + API + UI for login)
73
+ Task 3: User can create a task (task schema + API + UI for creation)
74
+ Task 4: User can view task list (query + API + UI for list view)
75
+ ```
76
+
77
+ Each vertical slice delivers working, testable functionality.
78
+
79
+ ### Step 4: Write Tasks
80
+
81
+ Each task follows this structure, whether it lands in the markdown task list or as an item in an external tracker (see Output Files):
82
+
83
+ ```markdown
84
+ ## Task [N]: [Short descriptive title]
85
+
86
+ **Description:** One paragraph explaining what this task accomplishes.
87
+
88
+ **Acceptance criteria:**
89
+ - [ ] [Specific, testable condition]
90
+ - [ ] [Specific, testable condition]
91
+
92
+ **Verification:**
93
+ - [ ] Tests pass: [the repository's focused-test command]
94
+ - [ ] Build succeeds: [the repository's build command]
95
+ - [ ] Manual check: [description of what to verify]
96
+
97
+ **Dependencies:** [Task numbers this depends on, or "None"]
98
+
99
+ **Files likely touched:**
100
+ - `src/path/to/file.ts`
101
+ - `tests/path/to/test.ts`
102
+
103
+ **Estimated scope:** [Small: 1-2 files | Medium: 3-5 files | Large: 5+ files]
104
+ ```
105
+
106
+ ### Step 5: Order and Checkpoint
107
+
108
+ Arrange tasks so that:
109
+
110
+ 1. Dependencies are satisfied (build foundation first)
111
+ 2. Each task leaves the system in a working state
112
+ 3. Verification checkpoints occur after every 2-3 tasks
113
+ 4. High-risk tasks are early (fail fast)
114
+
115
+ Add explicit checkpoints to the task list target:
116
+
117
+ ```markdown
118
+ ## Checkpoint: After Tasks 1-3
119
+ - [ ] All tests pass
120
+ - [ ] Application builds without errors
121
+ - [ ] Core user flow works end-to-end
122
+ - [ ] Review with human before proceeding
123
+ ```
124
+
125
+ ## Task Sizing Guidelines
126
+
127
+ | Size | Files | Scope | Example |
128
+ |------|-------|-------|---------|
129
+ | **XS** | 1 | Single function or config change | Add a validation rule |
130
+ | **S** | 1-2 | One component or endpoint | Add a new API endpoint |
131
+ | **M** | 3-5 | One feature slice | User registration flow |
132
+ | **L** | 5-8 | Multi-component feature | Search with filtering and pagination |
133
+ | **XL** | 8+ | **Too large — break it down further** | — |
134
+
135
+ If a task is L or larger, it should be broken into smaller tasks. An agent performs best on S and M tasks.
136
+
137
+ **When to break a task down further:**
138
+ - It would take more than one focused session (roughly 2+ hours of agent work)
139
+ - You cannot describe the acceptance criteria in 3 or fewer bullet points
140
+ - It touches two or more independent subsystems (e.g., auth and billing)
141
+ - You find yourself writing "and" in the task title (a sign it is two tasks)
142
+
143
+ ## Output Files
144
+
145
+ - **Plan document:** Save the implementation plan to `tasks/plan.md`. This is always a markdown file — design decisions, risks, and open questions don't map cleanly onto individual tracker issues.
146
+ - **Task list:** Record each task in the **task list target** (defined below).
147
+
148
+ Create the `tasks/` directory if it does not exist.
149
+
150
+ **Never overwrite an incomplete plan.** Before writing `tasks/plan.md` or `tasks/todo.md`, check whether they already exist and still contain unchecked tasks:
151
+
152
+ - Same work being replanned (the user asked to revise or extend this plan) → update the existing files in place.
153
+ - Different work → **stop and ask.** The unchecked tasks may be mid-build in another session. Do not delete, overwrite, or rename the existing files on your own; present the conflict and let the user decide (finish the old plan first, explicitly discard it, or tell you where the new plan should go).
154
+
155
+ The same rule applies to an external task list target: never bulk-close or delete another plan's open tracker items to make room for new ones.
156
+
157
+ ### Task List Target
158
+
159
+ The task list target is where tasks and checkpoints are recorded. It is defined once, here; every other reference in this skill defers to it.
160
+
161
+ - **Default: a checklist-style markdown file at `tasks/todo.md`.** This is the convention the `/build` command and other downstream tooling expect. Use it unless the project says otherwise.
162
+ - **External tracker:** if the project's agent rules (`CLAUDE.md`, `AGENTS.md`, etc.) or the user designate an issue tracker (e.g. GitHub Issues, Jira, Linear, `bd`/beads), create one tracker item per task instead of writing `tasks/todo.md`. Map the Step 4 structure onto the tracker's fields: acceptance criteria and verification steps in the item body, dependencies via the tracker's linking mechanism (`bd dep add`, "blocked by", etc.). Record Step 5 checkpoints as tracker items too, or as a checklist in the plan document if the tracker has no natural equivalent.
163
+
164
+ When using an external tracker, note it in `tasks/plan.md` (e.g. "Tasks tracked in Linear project FOO") so downstream steps and future sessions know where to look, and keep the plan document's Task List section as an ordered index of tracker item IDs or links rather than a duplicate checklist.
165
+
166
+ ## Plan Document Template
167
+
168
+ ```markdown
169
+ # Implementation Plan: [Feature/Project Name]
170
+
171
+ ## Overview
172
+ [One paragraph summary of what we're building]
173
+
174
+ ## Architecture Decisions
175
+ - [Key decision 1 and rationale]
176
+ - [Key decision 2 and rationale]
177
+
178
+ ## Task List
179
+
180
+ ### Phase 1: Foundation
181
+ - [ ] Task 1: ...
182
+ - [ ] Task 2: ...
183
+
184
+ ### Checkpoint: Foundation
185
+ - [ ] Tests pass, builds clean
186
+
187
+ ### Phase 2: Core Features
188
+ - [ ] Task 3: ...
189
+ - [ ] Task 4: ...
190
+
191
+ ### Checkpoint: Core Features
192
+ - [ ] End-to-end flow works
193
+
194
+ ### Phase 3: Polish
195
+ - [ ] Task 5: ...
196
+ - [ ] Task 6: ...
197
+
198
+ ### Checkpoint: Complete
199
+ - [ ] All acceptance criteria met
200
+ - [ ] Ready for review
201
+
202
+ ## Risks and Mitigations
203
+ | Risk | Impact | Mitigation |
204
+ |------|--------|------------|
205
+ | [Risk] | [High/Med/Low] | [Strategy] |
206
+
207
+ ## Open Questions
208
+ - [Question needing human input]
209
+ ```
210
+
211
+ When tasks live in an external tracker, keep the Task List section above as an ordered index of tracker item IDs or links instead of a duplicate checklist.
212
+
213
+ ## Parallelization Opportunities
214
+
215
+ When multiple agents or sessions are available:
216
+
217
+ - **Safe to parallelize:** Independent feature slices, tests for already-implemented features, documentation
218
+ - **Must be sequential:** Database migrations, shared state changes, dependency chains
219
+ - **Needs coordination:** Features that share an API contract (define the contract first, then parallelize)
220
+
221
+ ## Common Rationalizations
222
+
223
+ | Rationalization | Reality |
224
+ |---|---|
225
+ | "I'll figure it out as I go" | That's how you end up with a tangled mess and rework. 10 minutes of planning saves hours. |
226
+ | "The tasks are obvious" | Write them down anyway. Explicit tasks surface hidden dependencies and forgotten edge cases. |
227
+ | "Planning is overhead" | Planning is the task. Implementation without a plan is just typing. |
228
+ | "I can hold it all in my head" | Context windows are finite. Written plans survive session boundaries and compaction. |
229
+ | "The old `tasks/plan.md` is stale, I'll just replace it" | Unchecked tasks may be mid-build in another session. Overwriting them destroys work state that exists nowhere else. Stop and ask. |
230
+
231
+ ## Red Flags
232
+
233
+ - Starting implementation without a written task list
234
+ - Overwriting a `tasks/plan.md` or `tasks/todo.md` that still has unchecked tasks for different work, without asking
235
+ - Writing `tasks/todo.md` when the project has designated an external tracker (or scattering tasks across both)
236
+ - Tasks that say "implement the feature" without acceptance criteria
237
+ - No verification steps in the plan
238
+ - All tasks are XL-sized
239
+ - No checkpoints between tasks
240
+ - Dependency order isn't considered
241
+
242
+ ## Verification
243
+
244
+ Before starting implementation, confirm:
245
+
246
+ - [ ] Every task has acceptance criteria
247
+ - [ ] Every task has a verification step
248
+ - [ ] Task dependencies are identified and ordered correctly
249
+ - [ ] Tasks are recorded in the task list target (default `tasks/todo.md`)
250
+ - [ ] No pre-existing incomplete plan was overwritten without explicit user confirmation
251
+ - [ ] No task touches more than ~5 files
252
+ - [ ] Checkpoints exist between major phases
253
+ - [ ] The human has reviewed and approved the plan
254
+
255
+ ## See Also
256
+
257
+ Acceptance criteria are per-task and answer "did we build the right thing?". They sit on top of the project-wide Definition of Done, the standing bar every task clears before it counts as done. See `${CLAUDE_SKILL_DIR}/../_references/definition-of-done.md`.
@@ -0,0 +1,203 @@
1
+ ---
2
+ name: remove-technical-debt
3
+ description: 'Guided journey from a large aged codebase everyone fears to touch to one that is safe to change, legible, bounded, and resilient - paid down in place without a rewrite. Orchestrates eight skills phase by phase - working-with-legacy-code, refactoring-patterns, clean-code, software-design-philosophy, clean-architecture, pragmatic-programmer, release-it, domain-driven-design - asking the user questions at every decision point and recording results in the project docs/ folder (TESTING.md, TECH-DEBT.md, REMOVE-TECHNICAL-DEBT-PLAN.md) so the journey resumes across sessions. Use when the user wants to tame a legacy codebase, pay down technical debt safely, avoid a big-bang rewrite, or says ''we are afraid to touch this code''. For a fresh vibe-coded prototype, improve-code-quality; for greenfield structure, design-code-architecture; for a product-and-UX pass, improve-app; to optimize a working codebase for speed, architecture-optimization. For one framework in isolation, invoke that skill directly.'
4
+ license: MIT
5
+ metadata:
6
+ author: wondelai
7
+ version: "1.0.2"
8
+ ---
9
+
10
+ # Remove Technical Debt
11
+
12
+ Take a large, aged, tangled codebase that everyone is afraid to touch and pay its debt down in place — no big-bang rewrite, the old system always shipping. The instinct to rewrite is the one reliable way to turn a struggling-but-shipping product into a struggling-and-not-shipping one; this journey is the alternative. It is interactive and resumable across eight phases: the agent asks before every decision and records the outcome in your project's `docs/` folder, so you can stop after any phase and pick up later. The first phase builds a safety net at your change points; every phase after it is verifiable because that net exists.
13
+
14
+ ## Core Principle
15
+
16
+ **Feedback over fear: cover and modify, never edit and pray — pay debt down in place on the paths you actually walk, and never stop shipping.** This skill sequences the phases, asks the decision questions, and records every choice in `docs/`. The constituent skills carry the method — invoke them rather than improvising their frameworks. You do not pay down a mountain of debt by rebuilding the mountain; you pay it down one safe, tested step at a time along the paths you already change. Skipping ahead — cleaning before the safety net, splitting services before the boundaries are real — is the exact failure mode this ordering exists to prevent.
17
+
18
+ ## Journey Map
19
+
20
+ | Phase | Skill | Question it answers | Artifact |
21
+ |---|---|---|---|
22
+ | 1 | working-with-legacy-code | Can I change this code without breaking it unknowingly, and where do I start? | Creates docs/TESTING.md + docs/TECH-DEBT.md — GATE |
23
+ | 2 | refactoring-patterns | Can I reshape structure without changing behavior? | Extends docs/TECH-DEBT.md |
24
+ | 3 | clean-code | Is what I touch legible to the next reader and agent? | Extends docs/TECH-DEBT.md |
25
+ | 4 | software-design-philosophy | Is complexity hidden behind deep modules? | Extends docs/TECH-DEBT.md |
26
+ | 5 | clean-architecture | Do business rules depend on the framework, or vice versa? | Extends docs/ARCHITECTURE.md |
27
+ | 6 | pragmatic-programmer | What habits stop debt from re-accumulating? | Extends docs/TECH-DEBT.md |
28
+ | 7 | release-it | Will it survive a hostile production? | Extends docs/RELIABILITY.md |
29
+ | 8 | domain-driven-design | How do I carve the monolith into bounded contexts? | Extends docs/ARCHITECTURE.md |
30
+
31
+ ## Operating Rules
32
+
33
+ 1. **Resume first.** Before anything else, read `docs/REMOVE-TECHNICAL-DEBT-PLAN.md` and every artifact in the Journey Map. If the tracker exists, summarize the journey state in 3-5 lines and ask which phase to enter. Done when the user has confirmed an entry point. A journey with a tracker is resumed, never restarted.
34
+ 2. **Intake on first run only.** No tracker: run the Intake below, then create `docs/REMOVE-TECHNICAL-DEBT-PLAN.md` with every phase statused `pending | in-progress | awaiting-evidence | done | deferred: reason | skipped: reason`. Done when the tracker exists and the user has confirmed the phase plan.
35
+ 3. **Phase entry.** Announce: what the phase does, the decision it forces, the artifact it produces, rough effort. Offer proceed / skip / defer — phases marked GATE may be deferred, never skipped. Mark the phase `in-progress` on proceed. Done when the user chose.
36
+ 4. **Skill invocation and fallback.** Load the phase's skill and use it: each phase's Invoke line names the skill by slug — use that skill to run the phase. If it is not available, offer: `npx skills add wondelai/skills/<slug> --global`. If the user declines, run the phase from its Brief — the minimum viable method. State which mode you are in.
37
+ 5. **In-phase decisions.** Ask every question under "Decide with the user" — with concrete options and your recommendation. Record the choice in the tracker's Key Decisions. A decision made silently is a defect.
38
+ 6. **Phase exit.** Present the draft artifact content for sign-off before writing. On approval: write or extend the docs/ files, update the tracker (status, Key Decisions, Next Actions). Done when the files are written and the phase row shows `done`.
39
+ 7. **Artifact discipline.** Read before writing; create a file only if missing, otherwise extend — add or update your sections, preserve everyone else's. Files are UPPERCASE in `docs/`. Every recommendation lands as a checkbox or a table row with owner and priority. See [references/artifact-templates.md](references/artifact-templates.md) when creating a docs/ file for the first time — create it from the full skeleton (all section headings), then fill the sections your phase names.
40
+ 8. **Phase 1 is a GATE, commits stay single-purpose, and found bugs get pinned not fixed.** No transformation touches code absent from the Safety Net Map — pin it first (absent means not listed under Pinned behaviors; entries in the Gaps column are off-limits too). Structural and behavioral changes never share a commit: refactor with tests green in a structure-only commit, then change behavior in its own commit; a red test mid-refactoring means revert, not debug; safety-net test additions and docs/ updates are single-purpose commits of their own. Bugs found while characterizing get pinned and ticketed in the Debt Ledger, never silently fixed — callers may depend on the quirk.
41
+
42
+ ## Intake
43
+
44
+ Ask these before creating the tracker:
45
+
46
+ 1. What does the system do, how large and old is it, and what is the worst thing that happens if it breaks? (frames risk and sets phase priority)
47
+ 2. Which file are you changing next, and which files show up most in `git log` churn or are core domain? (picks the Phase 1 starting module — the three-axis heuristic)
48
+ 3. Does a test suite exist, does it run green in CI today, or was it disabled as flaky? (scopes the Phase 1 safety net)
49
+ 4. What is the stack — framework, ORM, database — and is business logic tangled inside controllers or ORM models? (gates Phase 5 boundary work and Phase 8 context mapping)
50
+ 5. Is it in production with real users, and what outbound dependencies does it call — third-party APIs, payments, email, queues? (gates Phase 7 integration-point audit)
51
+ 6. Is anyone proposing a big-bang rewrite? (surfaces the decision this journey exists to replace with the incremental path)
52
+ 7. How much of the journey do you want now? (Phases 1-3 change the team's relationship with the code fastest; 5-8 as boundaries and decomposition become the bottleneck)
53
+
54
+ Phase-skip heuristics: skip Phase 8 when the codebase is small enough that a single model still fits comfortably. Add optional system-design or ddia-systems only when paydown surfaces real scaling or data-layer limits — start from requirements, not solutions. Phase 7 is not optional once real users exist — timeouts and a circuit breaker are table stakes (it may stay `deferred: reason`, never `skipped`). Never skip Phase 1; it is the gate. Then create the tracker from the template and confirm the plan.
55
+
56
+ Done when `docs/REMOVE-TECHNICAL-DEBT-PLAN.md` exists with every phase statused and the user has confirmed the plan.
57
+
58
+ ## Phases
59
+
60
+ ### Phase 1 — Build the safety net and find where to start (working-with-legacy-code) — GATE
61
+
62
+ **Purpose:** Pin current behavior at your change points and map blast radius, so every later phase is verifiable. No phase may touch code absent from the Safety Net Map.
63
+
64
+ **Brief (fallback):** Legacy code is code without tests — cover and modify, never edit and pray. Run the Legacy Code Change Algorithm: identify change points, find test points, break dependencies with the least-invasive seam (Parameterize Constructor with a production default; Extract Interface), write characterization tests that pin actual behavior (assert something wrong, read the failure, pin the real value), then change. Bound blast radius with an effect sketch; find the pinch point where a few tests cover the most behavior. Urgent change you can't cover in time: Sprout/Wrap and track the untested host as debt.
65
+
66
+ **Invoke:** Use the `working-with-legacy-code` skill with the starting module chosen at intake. Ask for an effect sketch from the entry method, the pinch points, the seams to break, and the smallest characterization-test set that pins current behavior.
67
+
68
+ **Decide with the user:** (1) Confirm the starting module by the three-axis heuristic — changing next, high churn (`git log`), core domain. (2) Bugs found while characterizing: pin the wrong behavior and file it in the Debt Ledger, never silently fix — callers may depend on the quirk. Confirm the user accepts this.
69
+
70
+ **Artifact:** Create docs/TESTING.md with `## Test Strategy`, `## Safety Net Map` (module | pinned behaviors | test files | gaps), and `## Characterization Backlog`; create docs/TECH-DEBT.md with `## Debt Ledger` (item | location | type | risk | effort | priority | status) and `## Sprout / Wrap Register`, registering any sprouted or wrapped code. Record the effect-sketch pinch points under `## Test Strategy`. Update the tracker.
71
+
72
+ **Done when:** the target module's behavior is pinned, the suite runs green, both files exist, and the tracker shows Phase 1 done — only then is Phase 2 unlocked.
73
+
74
+ ### Phase 2 — Restructure with named refactorings (refactoring-patterns)
75
+
76
+ **Purpose:** Turn "clean it up" into named, behavior-preserving transformations applied one small step at a time.
77
+
78
+ **Brief (fallback):** Refactoring is not rewriting: small behavior-preserving transformations, each backed by tests. Each smell maps to a named refactoring — Extract Method is the workhorse (if you'd write a comment to explain a block, extract it and name it after the comment). Also Replace Nested Conditional with Guard Clauses, Replace Conditional with Polymorphism, Introduce Parameter Object, Extract Class. Workflow: tests green, one transformation, tests green, commit; a red test means revert, not debug. Branch by Abstraction migrates large structures in production; Preparatory Refactoring makes the change easy first; Rule of Three guards against premature abstraction.
79
+
80
+ **Invoke:** Use the `refactoring-patterns` skill with a smelly module and the Phase 1 tests. Ask it to name each smell, cite the transformation, and apply one at a time with tests run between each; for a large migration ask for a Branch by Abstraction plan.
81
+
82
+ **Decide with the user:** Scope — which smells this pass; whether an upcoming feature warrants a Preparatory Refactoring at its insertion point first; and whether a big migration should go behind a Branch by Abstraction.
83
+
84
+ **Artifact:** Extend docs/TECH-DEBT.md `## Smell Inventory` (smell | location | refactoring | status): one row per smell with the named refactoring applied and its status. Update the tracker.
85
+
86
+ **Done when:** targeted smells show a named refactoring and `done` / `ticketed` status, tests are green, and every structural change landed in a structure-only commit.
87
+
88
+ ### Phase 3 — Raise legibility where you touch the code (clean-code)
89
+
90
+ **Purpose:** Optimize for the reader — names, small single-purpose functions, safe error handling — on the regions you are already changing.
91
+
92
+ **Brief (fallback):** Code is read far more than written (10:1+). Names reveal intent (`elapsedTimeInDays`, not `d`); booleans read as predicates; one word per concept; functions do one thing at one level of abstraction with 0-2 arguments (a flag argument is two functions). Command-Query Separation: change state or return a value, never both. Error handling is where legacy incidents hide: prefer exceptions to return codes, catch specific types, never return or pass null (empty collection, Optional, Null Object), wrap noisy third-party APIs behind an adapter, put operation + state in every error. Boy Scout Rule: leave code cleaner than you found it.
93
+
94
+ **Invoke:** Use the `clean-code` skill with a target module. Ask for a 0-10 score across the six disciplines, the top ten fixes in priority order, and an error-handling audit (bare catches, null returns, contextless errors, unwrapped third-party SDKs).
95
+
96
+ **Decide with the user:** Which fixes to apply now versus log as debt, and the naming / error-handling conventions the team adopts going forward.
97
+
98
+ **Artifact:** Extend docs/TECH-DEBT.md: add `## Smell Inventory` rows for each name / function / error smell, and record the agreed rules under `## Adopted Conventions`. Update the tracker.
99
+
100
+ **Done when:** the module scores 8+ or every gap below 8 is a Smell Inventory row with a fix, conventions are recorded, and the Phase 1 tests still pass.
101
+
102
+ ### Phase 4 — Reduce complexity with deep modules (software-design-philosophy)
103
+
104
+ **Purpose:** Attack the complexity itself — hide real machinery behind simple interfaces instead of the classitis an unsupervised agent creates.
105
+
106
+ **Brief (fallback):** Complexity is the enemy; judge every change by whether it raises or lowers overall complexity. Symptoms: change amplification, cognitive load, unknown unknowns. Module depth = functionality ÷ interface complexity; deep modules hide machinery behind small interfaces, shallow ones don't (classitis) — merge shallow classes that always travel together. Watch information leakage (one decision reflected across many modules) and temporal decomposition (organizing by order-of-execution, not by knowledge). This is the tactical→strategic flip: invest 10-20% to keep the design clean.
107
+
108
+ **Invoke:** Use the `software-design-philosophy` skill with the module set touched so far. Ask which classes are shallow, where a design decision leaks across modules, and how to consolidate into deeper modules with simpler interfaces — with each change labeled as raising or lowering complexity.
109
+
110
+ **Decide with the user:** Which consolidations to make now versus defer, guarding against over-merging genuinely unrelated concerns.
111
+
112
+ **Artifact:** Extend docs/TECH-DEBT.md `## Smell Inventory` with classitis / shallow-module / information-leakage entries and the consolidation applied. Update the tracker.
113
+
114
+ **Done when:** each shallow-module cluster is consolidated or logged with a fix, interface count did not grow for the sake of "modularity", and tests are green.
115
+
116
+ ### Phase 5 — Draw the dependency boundary (clean-architecture)
117
+
118
+ **Purpose:** Make the framework and database depend on the business rules, module by module — not the reverse.
119
+
120
+ **Brief (fallback):** The Dependency Rule: source dependencies point inward — Entities, Use Cases, Interface Adapters, Frameworks/Drivers; nothing inner names anything outer. Database and web are details, plugins to your rules. Enforce with Dependency Inversion: a Use Case owns a repository interface; the Postgres/Stripe implementation lives in an outer adapter. SOLID are the mid-level tools; Common Closure and Acyclic Dependencies find real boundaries. Microservices sharing one data model are a distributed monolith — apply the rule inside the monolith first.
121
+
122
+ **Invoke:** Use the `clean-architecture` skill with the current module map and the stack from intake. Ask it to map the dependency graph, list every violation where business logic imports the ORM or framework, pick the most-changed module first, and show the extraction to framework-free Use Cases behind owned interfaces.
123
+
124
+ **Decide with the user:** How far to push the boundary this pass; which vendors (payments, storage) to wrap first; and whether any proposed service split is a real boundary or would only add a distributed monolith.
125
+
126
+ **Artifact:** Extend docs/ARCHITECTURE.md: record layers and violations under `## Layer Map & Dependency Rule` (violation | location | fix | status) and the boundary choices under `## Decision Log`. Update the tracker.
127
+
128
+ **Done when:** every Dependency Rule violation is a tracked row with a fix, at least the highest-risk vendor is wrapped, business-rule tests run with no framework, and tests are green.
129
+
130
+ ### Phase 6 — Lock in the habits (pragmatic-programmer)
131
+
132
+ **Purpose:** Set the meta-principles that stop the codebase from silently re-accruing debt after this journey ends.
133
+
134
+ **Brief (fallback):** Broken Window Theory: one unrepaired hack drops the bar for the next — fix immediately or board it up with a tracked ticket, never an untracked `// TODO`. DRY is about knowledge, not text — de-duplicate the same rule in two places (validation on client and server), leave coincidental look-alikes alone. Orthogonality: changing one component shouldn't affect another. Reversibility: wrap vendors behind your own interfaces. Design by Contract + crash early: guard preconditions and invariants at hardened boundaries so an invalid state fails loudly at the source.
135
+
136
+ **Invoke:** Use the `pragmatic-programmer` skill across the codebase. Ask it to flag duplicated knowledge (ignoring coincidental duplication), broken windows and untracked TODOs to board up, and the boundaries that need Design-by-Contract guard clauses.
137
+
138
+ **Decide with the user:** The debt budget per iteration and the broken-windows policy — what gets fixed now versus ticketed.
139
+
140
+ **Artifact:** Extend docs/TECH-DEBT.md: record duplicated-knowledge and broken-window items in `## Debt Ledger`, and the agreed policy under `## Debt Budget & Broken-Windows Policy` and `## Adopted Conventions`. Update the tracker.
141
+
142
+ **Done when:** duplicated-knowledge hits are ledgered or fixed, no untracked hacks remain, and the debt-budget policy is written down.
143
+
144
+ ### Phase 7 — Harden the integration points (release-it)
145
+
146
+ **Purpose:** Make every integration point degrade gracefully so a slow or failing dependency can't take the whole system down.
147
+
148
+ **Brief (fallback):** The software that passes QA is not what survives production. Integration points are the number-one killer — a slow response is worse than none. Non-negotiables: connect + read timeouts on every outbound call; a Circuit Breaker on failing dependencies (trips open, fails fast, half-open recovery); Bulkheads to isolate resource pools; Retry with exponential backoff + jitter; Steady State cleanup of accumulating cruft. Bound every query — unbounded result sets crash at scale, so add LIMITs and pagination. Decouple deploy from release with feature flags and expand-contract migrations; add deep health checks, RED metrics, symptom-based alerts.
149
+
150
+ **Invoke:** Use the `release-it` skill with the outbound dependencies from intake. Ask for an audit of calls with no timeout, unbounded queries and list endpoints, circuit-breaker + bulkhead placement, an expand-contract migration plan for a risky schema, and a deep health check + RED metrics + alert design.
151
+
152
+ **Decide with the user:** Breaker thresholds, which dependencies get dedicated pools, and the alert symptoms and thresholds (error rate, latency).
153
+
154
+ **Artifact:** Extend docs/RELIABILITY.md with `## Integration-Point Audit` (dependency | timeout | circuit breaker | bulkhead | retry policy | status), `## Query & Resource Findings`, `## Health Checks & Metrics`, and `## Deploy vs Release`. Update the tracker.
155
+
156
+ **Done when:** every outbound call has a timeout, critical dependencies have breakers and bulkheads, unbounded queries are bounded, a deep health check + RED metrics + symptom alerts exist, and the audit has no open rows for critical paths.
157
+
158
+ ### Phase 8 — Carve into bounded contexts (domain-driven-design)
159
+
160
+ **Purpose:** Decompose the big ball of mud into contexts the team can own and eventually extract — without a rewrite.
161
+
162
+ **Brief (fallback):** The model is the code. Start with Ubiquitous Language: rename technical-only names (`DataManager`, `Helper`) to domain terms; a concept hard to name signals a wrong model. Map Bounded Contexts (the same word can mean different things in different contexts) starting from what exists, aligned with team boundaries. The Anti-Corruption Layer lets a clean new context talk to the legacy core without the old model leaking in — the foundation of the Strangler Fig. Inside a context: small Aggregates with one root, reference others by ID, immutable Value Objects, past-tense Domain Events. Invest hardest in the Core Domain.
163
+
164
+ **Invoke:** Use the `domain-driven-design` skill with the tangled modules and the boundaries from Phase 5. Ask it to build a ubiquitous language, map current and target bounded contexts, design an anti-corruption layer for a new clean context, and shrink any god aggregate to its true consistency boundary.
165
+
166
+ **Decide with the user:** Which context to carve first (the Core Domain where value lives); which boundaries align with team structure; and whether cross-context calls become Domain Events.
167
+
168
+ **Artifact:** Extend docs/ARCHITECTURE.md: record the map under `## Bounded Contexts & Context Map`, terms under `## Domain Glossary (Ubiquitous Language)`, and the decomposition choices under `## Decision Log`. Update the tracker.
169
+
170
+ **Done when:** the current context map is drawn, the first target context and its anti-corruption layer are defined, key domain terms are in the glossary, and any reshaped aggregate keeps tests green.
171
+
172
+ ## Optional Phases
173
+
174
+ | Skill | Add when | Artifact |
175
+ |---|---|---|
176
+ | system-design | Paydown reveals real scaling limits that need re-architecture | Extends docs/ARCHITECTURE.md (`## System Context`) |
177
+ | ddia-systems | Data-layer decisions (isolation, replication, storage fit) are part of the debt | Extends docs/ARCHITECTURE.md (`## Data & Storage Decisions`) |
178
+ | team-topologies | Debt clusters where team boundaries fight the architecture | Extends docs/OPERATIONS.md (`## Team Structure`) |
179
+
180
+ Optional phases follow the same operating rules — load and use each listed skill exactly as a core phase would; insert where the Add-when condition first becomes true — the scaling and data phases after Phase 5, the team-topology phase alongside Phase 8's context boundaries.
181
+
182
+ ## Common Mistakes
183
+
184
+ | Mistake | Fix |
185
+ |---|---|
186
+ | Proposing the big-bang rewrite | Commit to paying debt down in place; every phase leaves the system better and still shipping, worst case a fast revert. Show one small, fast win first. |
187
+ | Cleaning before writing a single test | Pin behavior with characterization tests in Phase 1 (working-with-legacy-code) first; coverage follows the paths you actually change. |
188
+ | Trying to fix everything at once | Triage by the three-axis heuristic — invest where change is frequent and the Core Domain lives; a one-off spot gets a sprout, not a refactor. |
189
+ | Letting the agent "modularize" into tiny classes | Hold it to software-design-philosophy's deep-module rule — merge shallow classes that travel together; that is classitis, not architecture. |
190
+ | Calling external services with no timeout | In Phase 7 (release-it) add connect + read timeouts on every outbound call, plus a circuit breaker on critical dependencies. |
191
+ | Mistaking microservices for architecture | Apply the Dependency Rule and find real bounded contexts inside the monolith first (clean-architecture, domain-driven-design); services sharing one database are a distributed monolith. |
192
+
193
+ ## Completing the Journey
194
+
195
+ Exit checklist — every box tied to an artifact:
196
+
197
+ - [ ] Changed modules have characterization tests that run green (TESTING.md Safety Net Map complete for the paths you touched).
198
+ - [ ] Every outbound call has a timeout and critical dependencies have circuit breakers and bulkheads (RELIABILITY.md Integration-Point Audit clear).
199
+ - [ ] The Dependency Rule holds for reworked modules — business logic imports no framework or ORM (ARCHITECTURE.md Layer Map, violations closed).
200
+ - [ ] The monolith has a current context map and at least one clean context behind an anti-corruption layer (ARCHITECTURE.md Bounded Contexts & Context Map).
201
+ - [ ] No untracked hacks remain; the debt budget and broken-windows policy are written down (TECH-DEBT.md Debt Budget & Broken-Windows Policy).
202
+
203
+ Close the tracker: every phase `done` or `skipped: reason`, with remaining Next Actions carried into the TECH-DEBT.md Debt Ledger so nothing is lost. Then route forward: when the starting point was a younger prototype and you want the production-readiness variant of this journey, continue with the `improve-code-quality` skill; when code health is restored and the product experience is next, continue with the `improve-app` skill.
@@ -0,0 +1,79 @@
1
+ # Artifact Templates — remove-technical-debt
2
+
3
+ Skeletons this metaskill creates in the user's docs/ folder. Extend-only artifacts (ARCHITECTURE.md, RELIABILITY.md) are governed by the section headings named in each phase, not skeletons duplicated here.
4
+
5
+ ## Tracker: docs/REMOVE-TECHNICAL-DEBT-PLAN.md
6
+
7
+ Created on first run (Operating Rule 2). One per journey, never shared. Phase Status is pre-filled with this journey's real phases.
8
+
9
+ ```markdown
10
+ # Remove Technical Debt Plan
11
+
12
+ ## Context
13
+ Intake answers, date started, project specifics.
14
+
15
+ ## Phase Status
16
+ | Phase | Skill | Status | Artifact | Date |
17
+ |---|---|---|---|---|
18
+ | 1 | working-with-legacy-code | pending | TESTING.md + TECH-DEBT.md | |
19
+ | 2 | refactoring-patterns | pending | TECH-DEBT.md | |
20
+ | 3 | clean-code | pending | TECH-DEBT.md | |
21
+ | 4 | software-design-philosophy | pending | TECH-DEBT.md | |
22
+ | 5 | clean-architecture | pending | ARCHITECTURE.md | |
23
+ | 6 | pragmatic-programmer | pending | TECH-DEBT.md | |
24
+ | 7 | release-it | pending | RELIABILITY.md | |
25
+ | 8 | domain-driven-design | pending | ARCHITECTURE.md | |
26
+ Statuses: pending · in-progress · awaiting-evidence · done · deferred: <reason> · skipped: <reason>
27
+ Optional phases (system-design, ddia-systems, team-topologies) are added as rows here when their Add-when condition becomes true.
28
+
29
+ ## Key Decisions
30
+ | Date | Phase | Decision | Rationale |
31
+ |---|---|---|---|
32
+
33
+ ## Next Actions
34
+ - [ ] action (owner, due)
35
+ ```
36
+
37
+ ## docs/TESTING.md
38
+
39
+ Created in Phase 1. The safety net — what behavior is pinned, where the gaps are.
40
+
41
+ ```markdown
42
+ # Testing
43
+
44
+ ## Test Strategy
45
+ Pyramid, tooling, what "green" gates.
46
+
47
+ ## Safety Net Map
48
+ | Module | Pinned behaviors | Test files | Gaps |
49
+ |---|---|---|---|
50
+
51
+ ## Characterization Backlog
52
+ - [ ] module (risk, priority)
53
+
54
+ ## CI Gates
55
+ ```
56
+
57
+ ## docs/TECH-DEBT.md
58
+
59
+ Created in Phase 1, extended by Phases 2, 3, 4, 6. The debt ledger — single queue for all code journeys.
60
+
61
+ ```markdown
62
+ # Technical Debt
63
+
64
+ ## Debt Ledger
65
+ | Item | Location | Type | Risk | Effort | Priority | Status |
66
+ |---|---|---|---|---|---|---|
67
+
68
+ ## Smell Inventory
69
+ | Smell | Location | Refactoring | Status |
70
+ |---|---|---|---|
71
+
72
+ ## Sprout / Wrap Register
73
+ Code added beside legacy (to fold back in later).
74
+
75
+ ## Debt Budget & Broken-Windows Policy
76
+ Time per iteration; what gets fixed now vs boarded up with a ticket.
77
+
78
+ ## Adopted Conventions
79
+ ```