@totoroyyb/amag 0.1.0

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 (38) hide show
  1. package/README.md +141 -0
  2. package/dist/config.d.ts +28 -0
  3. package/dist/config.js +78 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +112 -0
  6. package/dist/installer.d.ts +12 -0
  7. package/dist/installer.js +268 -0
  8. package/dist/registry.d.ts +8 -0
  9. package/dist/registry.js +141 -0
  10. package/dist/utils.d.ts +14 -0
  11. package/dist/utils.js +110 -0
  12. package/package.json +49 -0
  13. package/templates/GEMINI.md +398 -0
  14. package/templates/resources/debug-escalation-template.md +34 -0
  15. package/templates/resources/plan-template.md +149 -0
  16. package/templates/rules/agentic-rules.md +18 -0
  17. package/templates/rules/code-quality.md +71 -0
  18. package/templates/rules/error-recovery.md +164 -0
  19. package/templates/rules/todo-enforcement.md +47 -0
  20. package/templates/skills/architecture-advisor/SKILL.md +111 -0
  21. package/templates/skills/browser-testing/SKILL.md +66 -0
  22. package/templates/skills/codebase-explorer/SKILL.md +128 -0
  23. package/templates/skills/deep-work/SKILL.md +75 -0
  24. package/templates/skills/external-cli-runner/SKILL.md +202 -0
  25. package/templates/skills/external-researcher/SKILL.md +99 -0
  26. package/templates/skills/frontend-ui-ux/SKILL.md +70 -0
  27. package/templates/skills/git-master/SKILL.md +72 -0
  28. package/templates/skills/plan-consultant/SKILL.md +218 -0
  29. package/templates/skills/plan-critic/SKILL.md +225 -0
  30. package/templates/skills/writing/SKILL.md +68 -0
  31. package/templates/workflows/debug-escalate.md +41 -0
  32. package/templates/workflows/debug.md +208 -0
  33. package/templates/workflows/explore.md +233 -0
  34. package/templates/workflows/init-deep.md +103 -0
  35. package/templates/workflows/plan.md +247 -0
  36. package/templates/workflows/resume.md +69 -0
  37. package/templates/workflows/start-work.md +189 -0
  38. package/templates/workflows/ultrawork.md +127 -0
@@ -0,0 +1,189 @@
1
+ ---
2
+ description: Execute an implementation plan task-by-task with category-aware delegation
3
+ ---
4
+
5
+ # /start-work — Plan Execution
6
+
7
+ Read an existing plan and execute it task-by-task with verification. This is the execution counterpart to `/plan`.
8
+
9
+ **You are a conductor, not a player.** For each task, adopt the right persona (category), load relevant skills, verify completion, then move to the next task.
10
+
11
+ ## Progress Tracking
12
+
13
+ Call `task_boundary` at **every step transition** with:
14
+ - **TaskName**: `"Executing: {plan name}"`
15
+ - **Mode**: `EXECUTION` (switch to `VERIFICATION` at Step 5)
16
+ - **TaskStatus**: Use the directive shown at each step. During Step 3, update per-task: `"Step 3/5: Task [N/total] — {task title}"`
17
+ - **TaskSummary**: Cumulative — tasks completed, issues found, learnings
18
+
19
+ ## Steps
20
+
21
+ ### 1. Find and Read the Plan
22
+ <!-- task_boundary: TaskStatus="Step 1/6: Reading plan" -->
23
+
24
+ **Check both sources and combine:**
25
+
26
+ 1. Read `.amag/active-plan.md` in the project root (cross-session truth for checkbox state)
27
+ 2. Check for an `implementation_plan.md` artifact in this conversation (detailed plan with file references, acceptance criteria)
28
+
29
+ **If `.amag/active-plan.md` exists:**
30
+ - **Self-validate** — parse all `- [ ]` and `- [x]` checkboxes
31
+ - Calculate actual progress: `completed / total`
32
+ - If all tasks checked → inform user: "Plan is complete. Use `/plan` for new work."
33
+ - If some unchecked → proceed with resume
34
+ - If `implementation_plan.md` artifact also exists → use it for detailed context per task
35
+
36
+ **If only `implementation_plan.md` artifact exists (no active-plan.md):**
37
+ - This means the plan was approved but Step 10 of `/plan` wasn't executed, or this is the first `/start-work` in the same conversation
38
+ - Create `.amag/active-plan.md` from the artifact's task list before proceeding
39
+
40
+ **If neither found:**
41
+ - Tell the user: "No active plan found. Use `/plan` to create one."
42
+
43
+ ### 2. Create Task Breakdown
44
+ <!-- task_boundary: TaskStatus="Step 2/6: Creating task breakdown" -->
45
+
46
+ Create a `task.md` artifact with all tasks from the plan. Copy checkbox state from `.amag/active-plan.md` if resuming.
47
+
48
+ Update `task_boundary` to reflect current state.
49
+
50
+ Update `.amag/active-plan.md` YAML header:
51
+ - Set `status: in-progress`
52
+ - Set `last_updated` to current timestamp
53
+
54
+ ### 3. Execute Task-by-Task
55
+ <!-- task_boundary: TaskStatus="Step 3/6: Task [N/total] — {task title}" -->
56
+
57
+ For each uncompleted task:
58
+
59
+ #### a) Classify the Category
60
+
61
+ Before executing, classify what kind of work this task requires:
62
+
63
+ | Category | When to Activate | Persona Shift |
64
+ |---|---|---|
65
+ | **visual** | UI, CSS, frontend, design, animation | Design-first: bold aesthetics, distinctive typography, cohesive palettes |
66
+ | **deep** | Complex logic, architecture, multi-file refactor | Autonomous: explore extensively (5-10 files minimum), build full mental model, act decisively |
67
+ | **quick** | Single file, typo fix, small change | Efficient: fast, no over-engineering, minimal overhead |
68
+ | **writing** | Documentation, README, comments, tech writing | Anti-slop: no "delve"/"leverage", plain words, human tone, varied sentences |
69
+ | **general** | Everything else | Standard execution with full verification |
70
+
71
+ #### b) Load Relevant Skills
72
+
73
+ Check if any installed skills apply (workflow-defined loading — see GEMINI.md Skill Loading Protocol):
74
+ - Frontend/UI work → activate `frontend-ui-ux` skill
75
+ - Git operations → activate `git-master` skill
76
+ - Browser testing needed → activate `browser-testing` skill
77
+ - Deep exploration → activate `deep-work` skill
78
+ - Writing/docs → activate `writing` skill
79
+
80
+ #### c) Execute with Category Persona
81
+
82
+ Adopt the category's mindset for the duration of this task. Match existing codebase patterns. Implement exactly what the plan specifies.
83
+
84
+ #### d) Static Analysis — Per Task (MANDATORY, before marking done)
85
+
86
+ After editing any files for this task, run targeted static analysis on those specific files — do not wait for the final verification wave:
87
+
88
+ 1. **Detect toolchain** from config files: `tsconfig.json` → `tsc --noEmit`, `mypy.ini`/`pyproject.toml` → `mypy <file>`, `Cargo.toml` → `cargo check`, `.eslintrc`/`biome.json` → `eslint <file>`.
89
+ 2. **Run targeted check** on only the files you changed in this task. This is fast — not a full project build.
90
+ 3. **Zero new errors required** — if errors appear, fix them before proceeding to `e)`.
91
+
92
+ This is the AMAG equivalent of OMO's `lsp_diagnostics` — run it once per task, not once per plan.
93
+
94
+ **Anti-pattern**: Do NOT defer this to the final verification wave. By then, errors from earlier tasks compound and are harder to trace.
95
+
96
+ #### e) Verify Against Acceptance Criteria
97
+
98
+ Check the plan's acceptance criteria for this task:
99
+ - Run build/test commands if the plan specifies them for this task
100
+ - Verify with `grep_search` for expected patterns
101
+ - Use `browser_subagent` for visual verification if needed
102
+
103
+ Mark task as completed only AFTER both `d)` (static analysis clean) and `e)` (acceptance criteria) pass.
104
+
105
+ #### f) Dual-Write Progress (MANDATORY after each task)
106
+
107
+ All three updates must happen together:
108
+
109
+ 1. **`.amag/active-plan.md`** — mark `[x]` on the completed task, update `last_updated` in YAML header
110
+ 2. **`task.md` artifact** — mark `[x]` on the completed task
111
+ 3. **`task_boundary`** — update TaskStatus and TaskSummary
112
+
113
+ **Never update one without the others.**
114
+
115
+ #### g) Accumulate Learnings
116
+
117
+ After each task, write key findings to `.amag/notepads/{plan-name}.md`. Append — never overwrite.
118
+
119
+ ```markdown
120
+ ## [Task N: title]
121
+ - Convention: [naming pattern, style convention discovered]
122
+ - Gotcha: [edge case, unexpected behavior encountered]
123
+ - Decision: [trade-off made, alternative considered and rejected]
124
+ ```
125
+
126
+ **Before starting each subsequent task**: re-read this file and apply accumulated knowledge. This prevents repeating mistakes and ensures consistency across tasks.
127
+
128
+ ### 4. Final Verification (NON-NEGOTIABLE — after ALL tasks)
129
+ <!-- task_boundary: Mode=VERIFICATION, TaskStatus="Step 4/5: Running final verification" -->
130
+
131
+ Mandatory catch-all — runs GEMINI.md Verification Protocol (Steps 1-6) across ALL files modified during the entire plan, PLUS these plan-specific checks:
132
+
133
+ #### a) Scope Fidelity — Plan vs Reality
134
+
135
+ Self-verify each plan task against actual changes (you already know the plan):
136
+
137
+ - For each task in the plan: verify it was implemented completely
138
+ - Check: nothing was built that the plan didn't specify (scope creep)
139
+ - Check: nothing was skipped or simplified ("basic version")
140
+ - Check: "Must NOT Have" guardrails from the plan were respected
141
+ - Output: `Tasks [N/N compliant] | VERDICT: APPROVE/REVISE/REJECT`
142
+
143
+ If REVISE or REJECT: fix all flagged blocking issues before proceeding to step `b)`. If REVISE, re-run scope fidelity check after fixes. If REJECT, surface to user via `notify_user`.
144
+
145
+ #### b) Acceptance Criteria
146
+
147
+ - Verify EVERY acceptance criterion from the plan with tool-produced evidence
148
+ - Run QA scenarios from the plan: follow exact steps, capture evidence
149
+ - No criterion passes on assertion alone — run the command, show the output
150
+ - Output: `Criteria [N/N pass] | QA Scenarios [N/N pass] | Evidence [CAPTURED]`
151
+
152
+ #### c) Code Quality
153
+
154
+ Activate `architecture-advisor` skill for review. Check all changed files for: `as any`/`@ts-ignore`, empty catches, `console.log` in production code, commented-out code, unused imports. Check AI slop per `code-quality.md` Section 6.
155
+
156
+ #### d) Report
157
+ - Summarize what was implemented, verified, and any issues encountered
158
+ - Re-read the original plan one final time — did you miss anything?
159
+
160
+ #### e) Stuck During Verification
161
+
162
+ If a build or test command hangs, follow `error-recovery.md` Long-Running Command Protocol:
163
+
164
+ 1. **Poll at 30s intervals**. Zero output growth for 2 polls = hung.
165
+ 2. **Kill it** — `send_command_input(CommandId, Terminate=true)`.
166
+ 3. **Mark the task blocked** — annotate as `[blocked]` in `task.md` and `.amag/active-plan.md`.
167
+ 4. **Notify the user** via `notify_user` with hung command details and partial output.
168
+ 5. **Do NOT mark the plan complete** while any task remains unverified.
169
+
170
+ ### 5. Mark Plan Complete
171
+ <!-- task_boundary: TaskStatus="Step 5/5: Marking plan complete" -->
172
+
173
+ 1. Update `.amag/active-plan.md` YAML header: `status: completed`, `last_updated`
174
+ 2. Create `walkthrough.md` artifact summarizing what was implemented and verified
175
+ 3. Do NOT delete `active-plan.md` — leave it as a completed record
176
+
177
+ ## Resume Support
178
+
179
+ If the session is interrupted mid-work:
180
+
181
+ - `.amag/active-plan.md` checkboxes reflect exactly which tasks are done
182
+ - A new session can read this file, self-validate, and resume at the first unchecked task
183
+ - No external state files or session IDs needed — the checkboxes are the truth
184
+
185
+ ## When to Use
186
+
187
+ - After `/plan` generates and user approves an implementation plan
188
+ - User says "start work", "execute the plan", or "start-work"
189
+ - When there's an existing plan to execute (in conversation or `.amag/active-plan.md`)
@@ -0,0 +1,127 @@
1
+ ---
2
+ description: Maximum effort deep work mode — 100% certainty before acting, zero compromises
3
+ ---
4
+
5
+ # /ultrawork — Deep Work Mode
6
+
7
+ Activate maximum-effort autonomous execution. You MUST achieve 100% certainty before implementing. Zero scope reduction, zero shortcuts, zero compromises.
8
+
9
+ **MANDATORY**: Announce to the user:
10
+
11
+ > **🚀 ULTRAWORK MODE ACTIVATED**
12
+
13
+ ## Progress Tracking
14
+
15
+ Call `task_boundary` at **every major phase** with:
16
+ - **TaskName**: `"Ultrawork: {goal}"`
17
+ - **Mode**: Transition through `PLANNING` → `EXECUTION` → `VERIFICATION`
18
+ - **TaskStatus**: Phase-based updates:
19
+ - `"Certainty check: exploring codebase"` → `"Certainty check: [N] files read, [status]"`
20
+ - `"Executing: task [N/total] — {title}"` → `"Verifying: running full verification protocol"`
21
+ - **TaskSummary**: Cumulative — certainty level, tasks done, evidence collected
22
+
23
+ ## Certainty Protocol (NON-NEGOTIABLE)
24
+
25
+ **YOU MUST NOT START IMPLEMENTATION UNTIL YOU ARE 100% CERTAIN.**
26
+
27
+ | Before writing a single line of code, you MUST: |
28
+ |---|
29
+ | **FULLY UNDERSTAND** what the user ACTUALLY wants (not what you assume) |
30
+ | **EXPLORE** the codebase to understand existing patterns and architecture |
31
+ | **HAVE A CRYSTAL CLEAR PLAN** — if your plan is vague, your work WILL fail |
32
+ | **RESOLVE ALL AMBIGUITY** — if anything is unclear, investigate or ask |
33
+
34
+ ### Signs You Are NOT Ready
35
+
36
+ - You're making assumptions about requirements
37
+ - You're unsure which files to modify
38
+ - You don't understand how existing code works
39
+ - Your plan has "probably" or "maybe" in it
40
+ - You can't explain the exact steps you'll take
41
+
42
+ ### When Not Ready
43
+
44
+ 1. **THINK DEEPLY** — What is the user's TRUE intent?
45
+ 2. **EXPLORE THOROUGHLY** — Fire 3+ parallel searches from different angles
46
+ 3. **READ EXTENSIVELY** — Read 5-10 related files minimum before acting
47
+ 4. **ASK THE USER** — If ambiguity remains after exploration, ask. Don't guess.
48
+
49
+ ## Execution Rules
50
+
51
+ ### Deliver EXACTLY What Was Asked
52
+
53
+ | Violation | Response |
54
+ |---|---|
55
+ | "I couldn't because..." | **UNACCEPTABLE.** Find a way or ask for help. |
56
+ | "This is a simplified version..." | **UNACCEPTABLE.** Deliver the FULL implementation. |
57
+ | "You can extend this later..." | **UNACCEPTABLE.** Finish it NOW. |
58
+ | "I made some assumptions..." | **UNACCEPTABLE.** You should have asked FIRST. |
59
+
60
+ ### Category-Aware Execution
61
+
62
+ For each sub-task, classify and adopt the right mindset. Load skills per GEMINI.md Task Categories: visual → `frontend-ui-ux`, deep → `deep-work`, writing → `writing`, git → `git-master`.
63
+
64
+ | Category | Mindset |
65
+ |---|---|
66
+ | **Visual/UI** | Design-first — bold aesthetics, cohesive palettes, micro-animations |
67
+ | **Deep logic** | Strategic — simplicity bias, one clear path, effort estimate |
68
+ | **Quick fix** | Efficient — fast, minimal, no over-engineering |
69
+ | **Writing** | Anti-slop — no "delve", plain words, human tone |
70
+ | **General** | Standard — match existing patterns, verify with evidence |
71
+
72
+ ### Parallel Execution
73
+
74
+ Fire all independent tool calls simultaneously:
75
+ - Read all target files in parallel
76
+ - Run searches from multiple angles simultaneously
77
+ - Background long operations (`run_command` with `WaitMsBeforeAsync: 500`)
78
+ - Continue work while waiting for background results
79
+
80
+ ### Verification Guarantee
81
+
82
+ **NOTHING is "done" without PROOF it works.**
83
+
84
+ Follow the full Verification Protocol from `GEMINI.md` (Steps 1-6), PLUS these ultrawork-specific additions:
85
+
86
+ | Additional Check | Required Evidence |
87
+ |---|---|
88
+ | Manual demonstration | Show the feature actually works (not just "tests pass") |
89
+ | Regression | Existing tests still pass — not just new ones |
90
+ | Scope completeness | Re-read original request, verify 100% delivery — no "simplified version" |
91
+
92
+ ### State Tracking
93
+
94
+ Even in ultrawork mode, track your work:
95
+ 1. Create `task.md` artifact immediately with task breakdown
96
+ 2. Update `task_boundary` at each major phase transition
97
+ 3. If working from a plan: dual-write progress to `task.md`, `.amag/active-plan.md`, and `task_boundary`
98
+ 4. On completion: mark all items done, update `last_updated` timestamps
99
+
100
+ ### Completion Self-Check
101
+
102
+ Follow the Completion Self-Check from `GEMINI.md`, PLUS verify:
103
+ - [ ] Manual demonstration evidence provided (not just automated checks)
104
+ - [ ] Every task item in `task.md` marked completed
105
+ - [ ] No scope reduction — full delivery, not "basic version"
106
+
107
+ **If ANY check fails: keep working. Don't stop.**
108
+
109
+ ### Failure Recovery
110
+
111
+ Follow the full Error Recovery Protocol from `error-recovery.md`. Key rules that apply in ultrawork:
112
+ - **Command wait loops**: If a command hangs/fails twice → STOP and diagnose, don't increase wait time
113
+ - **3-failure escalation**: After 3 failed attempts → STOP → REVERT → try a fundamentally different approach → if still failing, ASK USER
114
+ - **Self-count retries**: Before every retry, ask "Is this the same action I already tried?"
115
+
116
+ ## When to Use
117
+
118
+ - User says "ultrawork", "ulw", or "go deep"
119
+ - Complex tasks where you want 1000% effort
120
+ - Tasks where partial delivery is unacceptable
121
+ - When thorough exploration before acting is critical
122
+
123
+ ## When NOT to Use
124
+
125
+ - Simple, well-scoped tasks (just do them directly)
126
+ - Plan execution (use `/start-work` instead — ultrawork rigor auto-applies there)
127
+ - Exploratory questions ("how does X work?")