hoomanjs 1.40.1 → 1.40.2

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 (64) hide show
  1. package/dist/acp/acp-agent.js +0 -5
  2. package/dist/acp/acp-agent.js.map +1 -1
  3. package/dist/acp/utils/tool-kind.js +0 -1
  4. package/dist/acp/utils/tool-kind.js.map +1 -1
  5. package/dist/chat/app.js +0 -7
  6. package/dist/chat/app.js.map +1 -1
  7. package/dist/chat/index.d.ts +0 -1
  8. package/dist/chat/index.js +0 -2
  9. package/dist/chat/index.js.map +1 -1
  10. package/dist/cli.js +4 -10
  11. package/dist/cli.js.map +1 -1
  12. package/dist/core/agent/index.js +1 -2
  13. package/dist/core/agent/index.js.map +1 -1
  14. package/dist/core/modes/definitions.js +0 -2
  15. package/dist/core/modes/definitions.js.map +1 -1
  16. package/dist/core/prompts/harness/behaviour.md +3 -15
  17. package/dist/core/prompts/harness/communication.md +3 -16
  18. package/dist/core/prompts/harness/execution.md +6 -13
  19. package/dist/core/prompts/harness/guardrails.md +6 -12
  20. package/dist/core/prompts/static/daemon.md +4 -18
  21. package/dist/core/prompts/static/environment.md +2 -7
  22. package/dist/core/prompts/static/fetch.md +4 -30
  23. package/dist/core/prompts/static/identity.md +4 -19
  24. package/dist/core/prompts/static/planning.md +1 -9
  25. package/dist/core/prompts/static/subagents.md +4 -29
  26. package/dist/core/prompts/static/thinking.md +4 -24
  27. package/dist/core/prompts/static/todo.md +6 -32
  28. package/dist/core/prompts/system.js +0 -4
  29. package/dist/core/prompts/system.js.map +1 -1
  30. package/dist/core/sessions/lazy-session-manager.js +0 -2
  31. package/dist/core/sessions/lazy-session-manager.js.map +1 -1
  32. package/dist/core/skills/built-in/hooman-channels/SKILL.md +11 -148
  33. package/dist/core/skills/built-in/hooman-channels/channels.md +117 -0
  34. package/dist/core/skills/built-in/hooman-coding/SKILL.md +49 -44
  35. package/dist/core/skills/built-in/hooman-coding/debugging.md +26 -0
  36. package/dist/core/skills/built-in/hooman-coding/new-project.md +23 -0
  37. package/dist/core/skills/built-in/hooman-config/SKILL.md +19 -257
  38. package/dist/core/skills/built-in/hooman-config/providers.md +154 -0
  39. package/dist/core/skills/built-in/hooman-config/search.md +39 -0
  40. package/dist/core/skills/built-in/hooman-mcp/SKILL.md +22 -153
  41. package/dist/core/skills/built-in/hooman-skills/SKILL.md +10 -146
  42. package/dist/core/skills/built-in/hooman-skills/authoring.md +80 -0
  43. package/dist/core/state/tool-approvals.js +0 -2
  44. package/dist/core/state/tool-approvals.js.map +1 -1
  45. package/dist/core/tools/index.d.ts +0 -1
  46. package/dist/core/tools/index.js +0 -1
  47. package/dist/core/tools/index.js.map +1 -1
  48. package/dist/core/tools/sleep.js +1 -1
  49. package/dist/core/tools/sleep.js.map +1 -1
  50. package/dist/daemon/index.d.ts +1 -1
  51. package/dist/daemon/index.js +1 -11
  52. package/dist/daemon/index.js.map +1 -1
  53. package/dist/index.d.ts +1 -2
  54. package/dist/index.js +1 -2
  55. package/dist/index.js.map +1 -1
  56. package/package.json +1 -1
  57. package/dist/core/prompts/static/bye.md +0 -15
  58. package/dist/core/prompts/static/sleep.md +0 -20
  59. package/dist/core/state/exit-request.d.ts +0 -14
  60. package/dist/core/state/exit-request.js +0 -16
  61. package/dist/core/state/exit-request.js.map +0 -1
  62. package/dist/core/tools/bye.d.ts +0 -4
  63. package/dist/core/tools/bye.js +0 -23
  64. package/dist/core/tools/bye.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: hooman-channels
3
- description: Add and configure Hooman channel MCP servers for cron, Slack, Telegram, WhatsApp, and Jira. Use when the user asks to connect event-driven channels, schedulers, messaging apps, or Jira webhooks to a Hooman agent or daemon.
3
+ description: Add and configure Hooman channel MCP servers for cron, Slack, Telegram, WhatsApp, and Jira in ~/.hooman/mcp.json. Use when the user asks for scheduled or recurring prompts, cron jobs, messaging-app or chatbot integration, inbound webhooks, daemon automation, or connecting any event-driven channel to a Hooman agent or daemon. For ordinary (non-channel) MCP server edits use hooman-mcp.
4
4
  ---
5
5
 
6
6
  # Hooman Channels
@@ -9,18 +9,19 @@ Use this skill when the user asks to add channel-driven MCP integrations to Hoom
9
9
 
10
10
  ## Source Of Truth
11
11
 
12
- - MCP servers live in `~/.hooman/mcp.json` under top-level `mcpServers`.
12
+ - MCP servers live in `~/.hooman/mcp.json` under top-level `mcpServers` (minimal shape: `{"mcpServers": {}}`).
13
13
  - Restart the running Hooman session or daemon after changing `mcp.json`.
14
- - Run the long-lived listener with `hooman daemon --channels`.
15
- - Use `hooman daemon --channels --yolo` only when the user explicitly accepts automatic tool approval risk.
14
+ - Run the long-lived listener with `hooman daemon --channels`. Use `--yolo` only when the user explicitly accepts automatic tool approval risk.
16
15
 
17
- Minimal `mcp.json` shape:
16
+ ## Reference File
18
17
 
19
- ```json
20
- {
21
- "mcpServers": {}
22
- }
23
- ```
18
+ Read `channels.md` (next to this SKILL.md) for the exact `mcpServers` JSON entry, requirements, configure steps, allowlists, metadata shape, and webhook/credential details of each channel before adding or troubleshooting it. Supported channels and packages:
19
+
20
+ - `cron` — `cronmcp` (scheduler)
21
+ - `slack` — `slackxmcp`
22
+ - `telegram` — `tgfmcp`
23
+ - `whatsapp` — `wappmcp`
24
+ - `jira` — `jiraxmcp` (webhooks; credentials via server `env`)
24
25
 
25
26
  ## Operating Rules
26
27
 
@@ -33,144 +34,6 @@ Minimal `mcp.json` shape:
33
34
  7. For Slack, Telegram, and WhatsApp, run each package's `configure` command first when local credentials or allowlists are not already configured.
34
35
  8. For Jira, place credentials in the server `env` map or ensure the daemon's shell environment provides them.
35
36
 
36
- ## Common Channel Server Entries
37
-
38
- Add any requested entries under `mcpServers`.
39
-
40
- Cron scheduler:
41
-
42
- ```json
43
- {
44
- "cron": {
45
- "type": "stdio",
46
- "command": "npx",
47
- "args": ["-y", "cronmcp", "mcp", "--channels"]
48
- }
49
- }
50
- ```
51
-
52
- Slack:
53
-
54
- ```json
55
- {
56
- "slack": {
57
- "type": "stdio",
58
- "command": "npx",
59
- "args": ["-y", "slackxmcp", "mcp", "--channels"]
60
- }
61
- }
62
- ```
63
-
64
- Telegram:
65
-
66
- ```json
67
- {
68
- "telegram": {
69
- "type": "stdio",
70
- "command": "npx",
71
- "args": ["-y", "tgfmcp", "mcp", "--channels"]
72
- }
73
- }
74
- ```
75
-
76
- WhatsApp:
77
-
78
- ```json
79
- {
80
- "whatsapp": {
81
- "type": "stdio",
82
- "command": "npx",
83
- "args": ["-y", "wappmcp", "mcp", "--channels"]
84
- }
85
- }
86
- ```
87
-
88
- Jira:
89
-
90
- ```json
91
- {
92
- "jira": {
93
- "type": "stdio",
94
- "command": "npx",
95
- "args": ["-y", "jiraxmcp", "mcp", "--channels"],
96
- "env": {
97
- "JIRA_HOST": "https://your-domain.atlassian.net",
98
- "JIRA_EMAIL": "you@example.com",
99
- "JIRA_API_TOKEN": "...",
100
- "JIRA_WEBHOOK_HOST": "127.0.0.1",
101
- "JIRA_WEBHOOK_PORT": "6543",
102
- "JIRA_WEBHOOK_SECRET": "..."
103
- }
104
- }
105
- }
106
- ```
107
-
108
- For Jira, either use `JIRA_EMAIL` plus `JIRA_API_TOKEN`, or use `JIRA_ACCESS_TOKEN` instead. `JIRA_WEBHOOK_SECRET` is optional; include it when Jira admin webhooks are configured with a secret.
109
-
110
- ## Setup By Channel
111
-
112
- ### Cron
113
-
114
- - Requirements: Node.js `24+`.
115
- - Start package: `npx cronmcp mcp --channels`.
116
- - Tools include `cron_list_jobs`, `cron_add_job`, `cron_update_job`, and `cron_remove_job`.
117
- - Schedules are local-time 5-field cron expressions: `minute hour day-of-month month day-of-week`.
118
- - Local state is stored under `~/.cronmcp/`; jobs are JSONL records in `~/.cronmcp/crontab`.
119
- - Limits and behavior: at most 50 jobs, next run must be within one year, recurring jobs auto-expire after 7 days, `once: true` jobs are removed after the first successful tick.
120
- - Channel metadata: `meta.source` is `cron`, `meta.user` is `scheduler`, `meta.session` is the cron job ID, and `meta.thread` is omitted.
121
-
122
- Example scheduled prompt request after the server is connected:
123
-
124
- ```text
125
- Use cron_add_job with schedule "*/15 * * * *" and prompt "Check failed builds and report anything urgent".
126
- ```
127
-
128
- ### Slack
129
-
130
- - Requirements: Node.js `24+` and a Slack app with Socket Mode enabled.
131
- - Configure first with `npx slackxmcp configure`; it writes `~/.slackxmcp/config.json`.
132
- - The configure UI manages app token, bot token, user token, allowed users, and allowed channels.
133
- - Minimum Slack app setup: Socket Mode app token with `connections:write`; token scopes for the surfaces used, commonly `channels:read`, `groups:read`, `im:read`, `mpim:read`, history scopes for those surfaces, `chat:write`, `reactions:write`, and `users:read`.
134
- - Add event subscriptions for needed message surfaces, such as `message.channels`, `message.groups`, `message.im`, and `message.mpim`.
135
- - `slack_search_messages` usually requires a user token with `search:read`.
136
- - For permission prompts in Slack, enable Slack app Interactivity so Block Kit button actions are delivered over Socket Mode.
137
- - Channel events obey configured allowlists. If no allowed users or channels are configured, all inbound events are emitted.
138
- - Channel metadata: `meta.source` is `slack`, `meta.user` is the sender user ID, `meta.session` is the conversation ID, and `meta.thread` is the thread timestamp or message timestamp.
139
-
140
- ### Telegram
141
-
142
- - Requirements: Node.js `24+` and a Telegram bot token.
143
- - Configure first with `npx tgfmcp configure`; it writes `~/.tgfmcp/config.json`.
144
- - The configure UI manages bot token, allowed users, and allowed chats.
145
- - To enroll users or chats, use the configure UI's generated short code and send it from the target Telegram user or chat.
146
- - Telegram bots can only interact with chats where the bot has been added, contacted, or otherwise permitted.
147
- - Incoming media is downloaded under `~/.tgfmcp/attachments/` and included as local attachment paths.
148
- - Channel events obey configured allowlists. If no allowed users or chats are configured, all inbound events are emitted.
149
- - Channel metadata: `meta.source` is `telegram`, `meta.user` is the sender identity seed, `meta.session` is the chat identity seed, and `meta.thread` is the Telegram message ID.
150
- - Permission prompts are posted back into the originating chat with inline approval buttons.
151
-
152
- ### WhatsApp
153
-
154
- - Requirements: Node.js `24+` and a local Chrome or Chromium installation that Puppeteer can launch.
155
- - If browser auto-detection fails, set `WAPPMCP_BROWSER_PATH` or `PUPPETEER_EXECUTABLE_PATH`.
156
- - Configure first with `npx wappmcp configure`; it writes `~/.wappmcp/config.json`.
157
- - First login requires scanning a WhatsApp Web QR code. Session data lives under `~/.wappmcp/profile`.
158
- - The configure UI manages connect/disconnect, allowed users, and allowed chats.
159
- - Incoming media and quoted-parent media are downloaded under `~/.wappmcp/attachments/`.
160
- - Channel events obey configured allowlists. If no allowed users or chats are configured, all inbound events are emitted.
161
- - Channel metadata: `meta.source` is `whatsapp`, `meta.user` is the sender identity seed, `meta.session` is the chat identity seed, and `meta.thread` is the WhatsApp message ID.
162
- - Permission prompts are posted back into the originating WhatsApp chat; supported replies are `yes`, `always`, and `no`.
163
-
164
- ### Jira
165
-
166
- - Requirements: Node.js `24+`, Jira Cloud `JIRA_HOST`, and either `JIRA_EMAIL` plus `JIRA_API_TOKEN` or `JIRA_ACCESS_TOKEN`.
167
- - Start package: `npx jiraxmcp mcp --channels`.
168
- - For webhook channels, configure Jira admin webhooks to call `http://your-host:6543/webhook` by default.
169
- - `JIRA_WEBHOOK_PORT` overrides `6543`; `JIRA_WEBHOOK_HOST` defaults to `127.0.0.1`. Use `0.0.0.0` only when the listener must accept traffic from another machine.
170
- - If Jira webhooks use a secret, set `JIRA_WEBHOOK_SECRET`; incoming `X-Hub-Signature` headers are verified before events are emitted.
171
- - Local data is stored under `~/.jiraxmcp/`; downloaded attachments are saved under `~/.jiraxmcp/attachments/`.
172
- - Channel metadata: `meta.source` is `jira`, `meta.user` is the best available Jira actor ID, `meta.session` is usually the issue key, and `meta.thread` is omitted.
173
-
174
37
  ## Verification
175
38
 
176
39
  After setup:
@@ -0,0 +1,117 @@
1
+ # Channel Setup Reference
2
+
3
+ Per-channel `mcp.json` entries, requirements, and setup details. Add requested entries under top-level `mcpServers`.
4
+
5
+ ## Cron
6
+
7
+ ```json
8
+ {
9
+ "cron": {
10
+ "type": "stdio",
11
+ "command": "npx",
12
+ "args": ["-y", "cronmcp", "mcp", "--channels"]
13
+ }
14
+ }
15
+ ```
16
+
17
+ - Requirements: Node.js `24+`.
18
+ - Tools include `cron_list_jobs`, `cron_add_job`, `cron_update_job`, and `cron_remove_job`.
19
+ - Schedules are local-time 5-field cron expressions: `minute hour day-of-month month day-of-week`.
20
+ - Local state is stored under `~/.cronmcp/`; jobs are JSONL records in `~/.cronmcp/crontab`.
21
+ - Limits and behavior: at most 50 jobs, next run must be within one year, recurring jobs auto-expire after 7 days, `once: true` jobs are removed after the first successful tick.
22
+ - Channel metadata: `meta.source` is `cron`, `meta.user` is `scheduler`, `meta.session` is the cron job ID, and `meta.thread` is omitted.
23
+
24
+ Example scheduled prompt request after the server is connected:
25
+
26
+ ```text
27
+ Use cron_add_job with schedule "*/15 * * * *" and prompt "Check failed builds and report anything urgent".
28
+ ```
29
+
30
+ ## Slack
31
+
32
+ ```json
33
+ {
34
+ "slack": {
35
+ "type": "stdio",
36
+ "command": "npx",
37
+ "args": ["-y", "slackxmcp", "mcp", "--channels"]
38
+ }
39
+ }
40
+ ```
41
+
42
+ - Requirements: Node.js `24+` and a Slack app with Socket Mode enabled.
43
+ - Configure first with `npx slackxmcp configure`; it writes `~/.slackxmcp/config.json`. The configure UI manages app token, bot token, user token, allowed users, and allowed channels.
44
+ - Minimum Slack app setup: Socket Mode app token with `connections:write`; token scopes for the surfaces used, commonly `channels:read`, `groups:read`, `im:read`, `mpim:read`, history scopes for those surfaces, `chat:write`, `reactions:write`, and `users:read`.
45
+ - Add event subscriptions for needed message surfaces, such as `message.channels`, `message.groups`, `message.im`, and `message.mpim`.
46
+ - `slack_search_messages` usually requires a user token with `search:read`.
47
+ - For permission prompts in Slack, enable Slack app Interactivity so Block Kit button actions are delivered over Socket Mode.
48
+ - Channel events obey configured allowlists. If no allowed users or channels are configured, all inbound events are emitted.
49
+ - Channel metadata: `meta.source` is `slack`, `meta.user` is the sender user ID, `meta.session` is the conversation ID, and `meta.thread` is the thread timestamp or message timestamp.
50
+
51
+ ## Telegram
52
+
53
+ ```json
54
+ {
55
+ "telegram": {
56
+ "type": "stdio",
57
+ "command": "npx",
58
+ "args": ["-y", "tgfmcp", "mcp", "--channels"]
59
+ }
60
+ }
61
+ ```
62
+
63
+ - Requirements: Node.js `24+` and a Telegram bot token.
64
+ - Configure first with `npx tgfmcp configure`; it writes `~/.tgfmcp/config.json`. The configure UI manages bot token, allowed users, and allowed chats.
65
+ - To enroll users or chats, use the configure UI's generated short code and send it from the target Telegram user or chat.
66
+ - Telegram bots can only interact with chats where the bot has been added, contacted, or otherwise permitted.
67
+ - Incoming media is downloaded under `~/.tgfmcp/attachments/` and included as local attachment paths.
68
+ - Channel events obey configured allowlists. If no allowed users or chats are configured, all inbound events are emitted.
69
+ - Channel metadata: `meta.source` is `telegram`, `meta.user` is the sender identity seed, `meta.session` is the chat identity seed, and `meta.thread` is the Telegram message ID.
70
+ - Permission prompts are posted back into the originating chat with inline approval buttons.
71
+
72
+ ## WhatsApp
73
+
74
+ ```json
75
+ {
76
+ "whatsapp": {
77
+ "type": "stdio",
78
+ "command": "npx",
79
+ "args": ["-y", "wappmcp", "mcp", "--channels"]
80
+ }
81
+ }
82
+ ```
83
+
84
+ - Requirements: Node.js `24+` and a local Chrome or Chromium installation that Puppeteer can launch. If browser auto-detection fails, set `WAPPMCP_BROWSER_PATH` or `PUPPETEER_EXECUTABLE_PATH`.
85
+ - Configure first with `npx wappmcp configure`; it writes `~/.wappmcp/config.json`. The configure UI manages connect/disconnect, allowed users, and allowed chats.
86
+ - First login requires scanning a WhatsApp Web QR code. Session data lives under `~/.wappmcp/profile`.
87
+ - Incoming media and quoted-parent media are downloaded under `~/.wappmcp/attachments/`.
88
+ - Channel events obey configured allowlists. If no allowed users or chats are configured, all inbound events are emitted.
89
+ - Channel metadata: `meta.source` is `whatsapp`, `meta.user` is the sender identity seed, `meta.session` is the chat identity seed, and `meta.thread` is the WhatsApp message ID.
90
+ - Permission prompts are posted back into the originating WhatsApp chat; supported replies are `yes`, `always`, and `no`.
91
+
92
+ ## Jira
93
+
94
+ ```json
95
+ {
96
+ "jira": {
97
+ "type": "stdio",
98
+ "command": "npx",
99
+ "args": ["-y", "jiraxmcp", "mcp", "--channels"],
100
+ "env": {
101
+ "JIRA_HOST": "https://your-domain.atlassian.net",
102
+ "JIRA_EMAIL": "you@example.com",
103
+ "JIRA_API_TOKEN": "...",
104
+ "JIRA_WEBHOOK_HOST": "127.0.0.1",
105
+ "JIRA_WEBHOOK_PORT": "6543",
106
+ "JIRA_WEBHOOK_SECRET": "..."
107
+ }
108
+ }
109
+ }
110
+ ```
111
+
112
+ - Requirements: Node.js `24+`, Jira Cloud `JIRA_HOST`, and either `JIRA_EMAIL` plus `JIRA_API_TOKEN` or `JIRA_ACCESS_TOKEN`.
113
+ - For webhook channels, configure Jira admin webhooks to call `http://your-host:6543/webhook` by default.
114
+ - `JIRA_WEBHOOK_PORT` overrides `6543`; `JIRA_WEBHOOK_HOST` defaults to `127.0.0.1`. Use `0.0.0.0` only when the listener must accept traffic from another machine.
115
+ - If Jira webhooks use a secret, set `JIRA_WEBHOOK_SECRET`; incoming `X-Hub-Signature` headers are verified before events are emitted. Otherwise it is optional.
116
+ - Local data is stored under `~/.jiraxmcp/`; downloaded attachments are saved under `~/.jiraxmcp/attachments/`.
117
+ - Channel metadata: `meta.source` is `jira`, `meta.user` is the best available Jira actor ID, `meta.session` is usually the issue key, and `meta.thread` is omitted.
@@ -1,71 +1,76 @@
1
1
  ---
2
2
  name: hooman-coding
3
- description: Required coding playbook for this workspace—load via filesystem before writing source, adding deps, or running package/build commands. Applies to every programming task, regardless of simplicity or complexity, even one-file scripts or spikes. Covers research, security, tests, lint/format/build verification, and RCA for bugs.
3
+ description: Required playbook for every programming task load before the first implementation tool call whenever you will write or edit code, fix a bug, add or upgrade dependencies, scaffold a project, or run package/build/test commands, even for one-file scripts or spikes. Covers workflow, conventions, tests, verification, security, debugging/RCA, and greenfield setup. Skip only when purely reading or explaining code with no changes planned.
4
4
  ---
5
5
 
6
6
  # Coding / Software Engineering
7
7
 
8
- Act like a senior engineer: ship correct, maintainable changes that match **this** repository. Prefer **local** patterns, tooling, and conventions over generic or invented architecture—then align those choices with current industry practice where it helps.
8
+ Act like a senior engineer: ship correct, maintainable changes that match **this** repository. Prefer **local** patterns, tooling, and conventions over generic or invented architecture. Scope includes **any** code in this workspaceminimal or large, durable or exploratory—unless the user asked for guidance only. Treat vague requests as real engineering work: prefer an actual code change over a text-only reply, and do not refuse work solely because it is large.
9
9
 
10
- Scope includes **any** code or project scaffolding in this workspace—whether minimal or large, durable or exploratory—unless the user explicitly asked for guidance only with no implementation.
10
+ Work through every task in this order: **orient plan implement verify self-review report**. Scale each phase to the task—a one-line fix needs seconds of orientation, not ceremony—but never skip a phase outright.
11
11
 
12
- ## Before you implement
12
+ ## Reference files
13
13
 
14
- - **Research**: Combine what you know with targeted lookup when needed—official docs, release notes, GitHub issues/PRs, Stack Overflow, migration guides, and security advisories. Prefer solutions and APIs that are widely used, documented, and actively maintained.
15
- - **Dependencies**: When adding or upgrading packages, favor **latest stable** releases that are **maintained** (recent publishes, healthy issue/PR activity, clear ownership). Avoid abandoned forks and deprecated APIs unless the project already depends on them or the user directs otherwise.
16
- - **Conventions**: Infer structure, naming, formatting, and architectural boundaries from existing code and project docs (`CONTRIBUTING`, linters, CI). Match the house style; do not impose a different framework or layout without a strong, stated reason.
14
+ Read these siblings (next to this SKILL.md) when they apply:
17
15
 
18
- ## Implementation discipline
16
+ - `debugging.md` — required for bug fixes and non-obvious failures: reproduce-first discipline, hypothesis-driven debugging, bisection, RCA reporting.
17
+ - `new-project.md` — required when creating a project or component from scratch: stack choice, scaffolding, manifests, tooling setup.
19
18
 
20
- - Treat vague requests as **real engineering work** in repo context: prefer an actual code change over a superficial text-only reply.
21
- - Respect the user’s scope; do not refuse work solely because it is large—confirm only when ambiguity would cause harm.
22
- - **Read** surrounding code and **open a file before editing it**. Preserve public behavior unless the user asked for a change or the behavior is clearly wrong.
23
- - Keep edits **narrow**, **coherent**, and easy to review. Prefer **simple** code that fully solves the problem over clever or over-generalized designs.
24
- - Add abstractions only when they remove real duplication, clarify a real concept, or mirror an established local pattern.
25
- - Avoid throwaway compatibility shims, placeholder re-exports, “removed” tombstones, and legacy aliases when old code can be deleted cleanly.
26
- - **Comments**: do not add them by default. Add only for non-obvious constraints, invariants, workarounds, or surprising behavior.
27
- - Avoid drive-by changes: no unrelated types, docstrings, formatting-only edits, new files, features, config knobs, speculative validation, feature flags, or defensive branches for impossible scenarios. Do not invent one-off helpers for hypothetical futures.
19
+ ## Orient
28
20
 
29
- ## Testing
21
+ Build real understanding before editing; this phase determines the quality of everything after it.
30
22
 
31
- - **Default**: add or update **unit tests** and/or **integration tests** that match the project’s existing test stack and locations—unless the user **explicitly** asks to skip tests or the repo genuinely has no test harness for that layer.
32
- - Prefer focused tests that lock in the behavior you changed or fixed; follow existing patterns (fixtures, mocks, snapshots) instead of introducing a parallel style.
23
+ - **Locate the code path**: search for the relevant symbols, then read definitions _and_ call sites—never change a signature or behavior without knowing who depends on it. Read a module's tests to learn its actual contract.
24
+ - **Copy the house pattern**: when adding a feature, find the closest existing sibling feature and use it as the template for structure, naming, and wiring. Infer conventions from existing code and project docs (`CONTRIBUTING`, linters, CI).
25
+ - **Detect the environment**: package manager from the lockfile (npm/pnpm/yarn/bun, pip/uv/poetry, …), runtime pins (`.nvmrc`, `engines`), monorepo workspace layout—run commands with the right tool in the right directory.
26
+ - **Research when needed**: targeted lookup of official docs, release notes, issues/PRs, migration guides, advisories. Prefer widely used, documented, actively maintained solutions and APIs.
33
27
 
34
- ## Verification each turn
28
+ ## Plan
35
29
 
36
- When the project provides the hooks, **after substantive edits** in a turn:
30
+ - Identify the **minimal change set** that fully solves the request, and its blast radius. Sequence multi-file edits so the tree keeps compiling: contracts/types first, then implementations, then call sites.
31
+ - For wide mechanical changes, convert **one instance**, verify it, then replicate the pattern.
32
+ - **Ambiguity protocol**: when a decision is low-risk and reversible, pick the option most consistent with the codebase, **state the assumption in your reply**, and proceed. Ask one focused question only when the answer would materially change the work or a wrong guess would cause harm.
33
+ - If the task reveals a deeper design problem, flag it and stay scoped—do not silently expand into a redesign.
37
34
 
38
- 1. Run **formatter** and **linter** using the repo’s configured commands (or IDE-equivalent rules).
39
- 2. Run **build** (compile/bundle) if applicable.
40
- 3. Run **tests** relevant to the change (full suite when reasonable and fast enough; otherwise the narrowest meaningful subset).
35
+ ## Implement
41
36
 
42
- If a command fails, **diagnose from output** before retrying or changing approach; do not mask failures.
37
+ - **Read before writing**: open a file before editing it. Preserve public behavior unless the user asked for a change or it is clearly wrong.
38
+ - Keep edits **narrow, coherent, and easy to review**. Prefer simple code that fully solves the problem over clever or over-generalized designs. Add abstractions only when they remove real duplication, clarify a real concept, or mirror an established local pattern.
39
+ - **Dependencies**: favor latest stable, maintained releases. Avoid abandoned forks and deprecated APIs unless the project already depends on them or the user directs otherwise.
40
+ - No drive-by changes: no unrelated types, docstrings, formatting-only edits, features, config knobs, feature flags, speculative validation, compatibility shims, or defensive branches for impossible scenarios. Delete old code cleanly instead of aliasing it.
41
+ - **Comments**: none by default; only for non-obvious constraints, invariants, workarounds, or surprising behavior.
42
+ - **Edge-case reflex**: for the paths you touched, consider empties, nulls, unicode, timezones, boundary indices, concurrency, idempotency—handle what is reachable, skip what is impossible.
43
+ - **Performance**: optimize only with evidence, but notice obvious N+1s or quadratic loops on hot paths you touch—fix in scope, otherwise flag.
43
44
 
44
- ## Security and correctness
45
+ ## Verify
45
46
 
46
- - **Credentials**: Keep secrets out of source. Prefer **environment variables**, **per-environment** local files when the stack uses them (e.g. `.env`, `.env.local`, `.env.development`), or **dedicated secrets files** under paths the project already documents (plus provider secret stores in deployed environments). In a **Git** repo, ensure those paths are **`.gitignore`d** (or equivalent) so keys never get committed; wire reads through the stack’s normal config loader. Do not embed API keys, tokens, or passwords in code, fixtures, or checked-in JSON unless the user explicitly demands it—and still prefer env or secret injection.
47
- - Stay alert to injection (command, SQL), XSS, path traversal, unsafe deserialization, authz mistakes, and secret leakage in code, logs, and errors.
48
- - Prefer **structured parsers and APIs** over fragile string parsing for structured data.
49
- - Treat generated artifacts, lockfiles, migrations, and shared config as **contracts**: touch them only when the task requires it, and keep them consistent.
50
- - Do not swallow errors with broad catches, silent fallbacks, disabled hooks, or weakened checks unless the codebase already establishes that pattern for a good reason.
47
+ - **Tests**: add or update unit/integration tests that lock in the behavior you changed, matching the project's existing stack, locations, and patterns—unless the user explicitly skips tests or the repo has no harness for that layer.
48
+ - After substantive edits, when the project provides the hooks: run **formatter**, **linter**, **build**, and tests—**narrowest meaningful check first** (the one test file, the one workspace package), full suite only when blast radius warrants and it is reasonably fast.
49
+ - **Never claim a check passed without running it.** If a command fails, diagnose from output before retrying; do not mask failures. Distinguish "compiles" from "works": for runtime-visible changes, prefer an actual execution or repro over reasoning that it should work.
50
+
51
+ ## Self-review
51
52
 
52
- ## Bug fixes: root cause first
53
+ Before reporting, reread your own diff as a reviewer would:
53
54
 
54
- 1. **Gather evidence**: logs, stack traces, CI output, terminal repro, failing tests, and user steps.
55
- 2. **Trace**: follow the failure from symptom to the responsible code path; form a **root cause hypothesis** (RCA) before editing.
56
- 3. **Fix**: apply the smallest change that addresses the cause, with tests when appropriate.
57
- 4. **Close the loop**: at the end of the turn, give the user a concise **RCA** (what broke and why) and a **fix summary** (what changed and how it resolves the issue). If certainty is limited, say what remains unproven and what would verify it.
55
+ - leftover debug prints, unused imports, dead code, stray TODOs;
56
+ - naming and style inconsistent with the surrounding file;
57
+ - accidentally weakened types, broadened catches, or disabled checks;
58
+ - comments/docs now stale because behavior changed;
59
+ - generated artifacts, lockfiles, migrations, and shared config treated as contracts—touched only when the task required it, kept consistent.
58
60
 
59
- Avoid blind retries; if blocked after investigation, ask **one focused question**.
61
+ ## Security and correctness
62
+
63
+ - **Credentials**: keep secrets out of source. Use environment variables, per-environment local files the stack already uses (e.g. `.env.local`), or documented secrets paths—**`.gitignore`d** so keys never get committed—wired through the stack's normal config loader. Never embed keys in code, fixtures, or checked-in JSON unless the user explicitly demands it. If credentials appear exposed, warn **without repeating** the secret.
64
+ - Stay alert to injection (command, SQL), XSS, path traversal, unsafe deserialization, authz mistakes, and secret leakage in code, logs, and errors.
65
+ - Prefer structured parsers and APIs over fragile string parsing. Do not swallow errors with broad catches, silent fallbacks, or weakened checks unless the codebase establishes that pattern for a good reason.
60
66
 
61
67
  ## Project hygiene
62
68
 
63
- - Work on the **current** working tree; do not revert user changes unless asked.
64
- - If unrelated local changes affect the task, inspect and adapt; ask only when safe progress is impossible.
65
- - Do **not** create commits, push, amend, force-push, or alter remotes unless the user explicitly requests it.
66
- - Never put secrets in commits, patches, or user-facing text; align with **`.gitignore`d** env/secrets files when adding new credential plumbing. If credentials appear exposed, warn **without repeating** the secret.
69
+ - Work on the **current** working tree; do not revert user changes unless asked. If unrelated local changes affect the task, inspect and adapt; ask only when safe progress is impossible.
70
+ - Do **not** commit, push, amend, force-push, or alter remotes unless the user explicitly requests it. Never put secrets in commits, patches, or user-facing text.
67
71
 
68
- ## Communication
72
+ ## Report
69
73
 
70
- - Skip time estimates; describe what you did and what remains.
71
- - When research influenced a decision (e.g., a known framework bug or recommended API), mention it briefly so the user can trace it.
74
+ - State the outcome, what you verified (and how), and any assumption made under the ambiguity protocol.
75
+ - For bug fixes, give a concise RCA and fix summary; if certainty is limited, say what remains unproven and what would verify it.
76
+ - When research influenced a decision, mention it briefly. Skip time estimates; describe what you did and what remains.
@@ -0,0 +1,26 @@
1
+ # Debugging And Bug Fixes
2
+
3
+ Root cause first. Never fix by guesswork or blind retries.
4
+
5
+ ## Reproduce first
6
+
7
+ 1. **Reproduce the failure before touching code.** Gather logs, stack traces, CI output, failing tests, and user steps; turn them into a concrete repro you can run—ideally a **failing test** in the project's existing harness, which later becomes the regression test.
8
+ 2. If you cannot reproduce, say so and instrument instead of guessing: add targeted logging or assertions around the suspected path, run, and read the evidence.
9
+ 3. **Minimize the repro** when the failure is noisy: cut inputs, config, and steps until the smallest case that still fails remains.
10
+
11
+ ## Trace to root cause
12
+
13
+ - Work **hypothesis-driven**: form an explicit hypothesis about the cause, pick the cheapest observation that would confirm or kill it, run it, repeat. Do not shotgun edits.
14
+ - Read stack traces from the **deepest frame you own** upward; the top frame is often a symptom.
15
+ - Follow the failure from symptom to responsible code path; verify assumptions at each hop (actual values, not expected ones).
16
+ - **Bisect** when the cause is not obvious: halve the input, disable half the suspects, or bisect history—`git log`/`git blame` on the failing path, or `git bisect` with the repro when the bug is a regression.
17
+ - Check the boring causes early: stale build artifacts, wrong environment/versions, cached state, unset env vars, timezone/locale, and recent dependency bumps.
18
+
19
+ ## Fix and close the loop
20
+
21
+ 1. Apply the **smallest change that addresses the cause**, not the symptom. If the real fix is out of scope, say so explicitly rather than papering over it.
22
+ 2. Re-run the **exact repro** (and the new regression test) to confirm the fix; then run the surrounding checks per the main skill's Verify phase.
23
+ 3. Remove any temporary instrumentation you added.
24
+ 4. Report a concise **RCA** (what broke and why) and **fix summary** (what changed and how it resolves the issue). If certainty is limited, state what remains unproven and what would verify it.
25
+
26
+ If blocked after genuine investigation, ask **one focused question** with the evidence you gathered—not a list of open-ended possibilities.
@@ -0,0 +1,23 @@
1
+ # Greenfield Projects And Components
2
+
3
+ For creating a project, package, or substantial component from scratch (no existing house pattern to copy).
4
+
5
+ ## Stack and structure
6
+
7
+ - Choose a **boring, standard stack**: widely used, documented, actively maintained tools that match the user's stated constraints and ecosystem. Do not invent architecture or pick niche frameworks without a stated reason.
8
+ - Match the ecosystem's conventional layout (e.g. `src/` + entrypoint, standard config file locations) so future tools and contributors find things where they expect them.
9
+ - Start with the **smallest scaffold that builds and runs**, verify it, then add features incrementally—never a big-bang tree of untested files.
10
+
11
+ ## Manifests and tooling
12
+
13
+ - Create a real dependency manifest (`package.json`, `requirements.txt`/`pyproject.toml`, `go.mod`, …) with **actual current versions**—add dependencies via the package manager rather than guessing version numbers.
14
+ - Pin the runtime where the ecosystem supports it (`.nvmrc`/`engines`, `requires-python`, …).
15
+ - Set up the basics the ecosystem expects: formatter, linter, test runner, and the corresponding scripts/commands—configured minimally, using defaults over bespoke rule sets.
16
+ - Add a `.gitignore` appropriate to the stack before generating build artifacts, and keep env/secrets files ignored from the start.
17
+
18
+ ## Deliverables
19
+
20
+ - A **README** with what the project is, prerequisites, install, run, and test commands—short and accurate beats long and aspirational.
21
+ - A working entrypoint the user can run immediately; verify the documented commands actually work before reporting.
22
+ - For web apps: a clean, modern UI with sensible defaults (layout, spacing, typography, responsive behavior)—polish the default experience rather than shipping unstyled scaffolding.
23
+ - Example configuration (`.env.example` or equivalent) when the project needs credentials, with placeholders instead of real values.