ashlrcode 1.0.0 → 2.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 (104) hide show
  1. package/README.md +73 -16
  2. package/package.json +28 -9
  3. package/prompts/skills/commit.md +36 -0
  4. package/prompts/skills/coordinate.md +21 -0
  5. package/prompts/skills/daily-review.md +65 -0
  6. package/prompts/skills/debug.md +23 -0
  7. package/prompts/skills/deep-work.md +129 -0
  8. package/prompts/skills/explore.md +24 -0
  9. package/prompts/skills/init.md +39 -0
  10. package/prompts/skills/kairos.md +19 -0
  11. package/prompts/skills/plan.md +19 -0
  12. package/prompts/skills/polish.md +94 -0
  13. package/prompts/skills/pr.md +30 -0
  14. package/prompts/skills/refactor.md +26 -0
  15. package/prompts/skills/resume-branch.md +27 -0
  16. package/prompts/skills/review.md +27 -0
  17. package/prompts/skills/ship.md +32 -0
  18. package/prompts/skills/simplify.md +25 -0
  19. package/prompts/skills/test.md +19 -0
  20. package/prompts/skills/verify.md +17 -0
  21. package/prompts/skills/weekly-plan.md +63 -0
  22. package/prompts/system.md +451 -0
  23. package/src/agent/away-summary.ts +138 -0
  24. package/src/agent/context.ts +6 -0
  25. package/src/agent/coordinator.ts +494 -0
  26. package/src/agent/dream.ts +149 -11
  27. package/src/agent/error-handler.ts +51 -35
  28. package/src/agent/kairos.ts +52 -4
  29. package/src/agent/loop.ts +153 -13
  30. package/src/agent/mailbox.ts +151 -0
  31. package/src/agent/model-patches.ts +28 -3
  32. package/src/agent/product-agent.ts +463 -0
  33. package/src/agent/speculation.ts +21 -18
  34. package/src/agent/sub-agent.ts +11 -1
  35. package/src/agent/system-prompt.ts +19 -0
  36. package/src/agent/tool-executor.ts +83 -3
  37. package/src/agent/verification.ts +223 -0
  38. package/src/agent/worktree-manager.ts +50 -1
  39. package/src/cli.ts +228 -36
  40. package/src/config/features.ts +8 -8
  41. package/src/config/keychain.ts +105 -0
  42. package/src/config/permissions.ts +3 -2
  43. package/src/config/settings.ts +73 -5
  44. package/src/config/upgrade-notice.ts +15 -2
  45. package/src/mcp/client.ts +392 -2
  46. package/src/mcp/manager.ts +129 -13
  47. package/src/mcp/types.ts +4 -1
  48. package/src/migrate.ts +228 -0
  49. package/src/persistence/session.ts +209 -5
  50. package/src/providers/anthropic.ts +112 -98
  51. package/src/providers/cost-tracker.ts +71 -2
  52. package/src/providers/retry.ts +2 -4
  53. package/src/providers/types.ts +5 -1
  54. package/src/providers/xai.ts +1 -0
  55. package/src/repl.tsx +514 -127
  56. package/src/setup.ts +37 -1
  57. package/src/tools/coordinate.ts +88 -0
  58. package/src/tools/grep.ts +9 -11
  59. package/src/tools/lsp.ts +44 -32
  60. package/src/tools/registry.ts +75 -9
  61. package/src/tools/send-message.ts +89 -30
  62. package/src/tools/types.ts +2 -0
  63. package/src/tools/verify.ts +88 -0
  64. package/src/tools/web-browser.ts +8 -5
  65. package/src/tools/workflow.ts +34 -10
  66. package/src/ui/AnimatedSpinner.tsx +302 -0
  67. package/src/ui/App.tsx +16 -15
  68. package/src/ui/BuddyPanel.tsx +27 -34
  69. package/src/ui/SlashInput.tsx +99 -0
  70. package/src/ui/banner.ts +10 -0
  71. package/src/ui/buddy.ts +5 -4
  72. package/src/ui/effort.ts +5 -1
  73. package/src/ui/markdown.ts +269 -88
  74. package/src/ui/message-renderer.ts +183 -35
  75. package/src/ui/quips.json +41 -0
  76. package/src/ui/speech-bubble.ts +35 -19
  77. package/src/utils/ring-buffer.ts +101 -0
  78. package/src/voice/voice-mode.ts +13 -2
  79. package/src/__tests__/branded-types.test.ts +0 -47
  80. package/src/__tests__/context.test.ts +0 -163
  81. package/src/__tests__/cost-tracker.test.ts +0 -274
  82. package/src/__tests__/cron.test.ts +0 -197
  83. package/src/__tests__/dream.test.ts +0 -204
  84. package/src/__tests__/error-handler.test.ts +0 -192
  85. package/src/__tests__/features.test.ts +0 -69
  86. package/src/__tests__/file-history.test.ts +0 -177
  87. package/src/__tests__/hooks.test.ts +0 -145
  88. package/src/__tests__/keybindings.test.ts +0 -159
  89. package/src/__tests__/model-patches.test.ts +0 -82
  90. package/src/__tests__/permissions-rules.test.ts +0 -121
  91. package/src/__tests__/permissions.test.ts +0 -108
  92. package/src/__tests__/project-config.test.ts +0 -63
  93. package/src/__tests__/retry.test.ts +0 -321
  94. package/src/__tests__/router.test.ts +0 -158
  95. package/src/__tests__/session-compact.test.ts +0 -191
  96. package/src/__tests__/session.test.ts +0 -145
  97. package/src/__tests__/skill-registry.test.ts +0 -130
  98. package/src/__tests__/speculation.test.ts +0 -196
  99. package/src/__tests__/tasks-v2.test.ts +0 -267
  100. package/src/__tests__/telemetry.test.ts +0 -149
  101. package/src/__tests__/tool-executor.test.ts +0 -141
  102. package/src/__tests__/tool-registry.test.ts +0 -166
  103. package/src/__tests__/undercover.test.ts +0 -93
  104. package/src/__tests__/workflow.test.ts +0 -195
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: polish
3
+ description: Autonomous polish pipeline -- commit, lint, review, security, fix loop until clean
4
+ trigger: /polish
5
+ ---
6
+
7
+ Autonomous loop: commit, lint/type-check, code review, simplify, security audit, fix, re-commit. Runs until clean or max 3 iterations.
8
+
9
+ ## Step 1 -- Initial Commit
10
+
11
+ 1. Run `git status` and `git diff` to understand all changes
12
+ 2. Run `git log -3 --oneline` to match commit message style
13
+ 3. Stage related files in logical groups
14
+ 4. Generate a commit message using these conventions:
15
+ - Format: `<type>: <summary>` (feat/fix/refactor/style/docs/test/chore)
16
+ - Summary: max 50 chars, present tense, no period
17
+ - Body: explain "why" not "what", wrap at 72 chars
18
+ 5. Commit and push to origin
19
+
20
+ ## Step 2 -- Lint + Type-check
21
+
22
+ 1. Check `package.json` for available tooling (eslint, tsc, biome in scripts or devDependencies)
23
+ 2. If ESLint available: run `npx eslint --fix` on the changed files only
24
+ 3. If TypeScript available: run `npx tsc --noEmit` to surface type errors
25
+ 4. If lint/type errors found that couldn't be auto-fixed: fix them manually
26
+ 5. If any fixes were made: commit with message `style: fix lint and type errors`
27
+
28
+ ## Step 3 -- Code Review + Simplify (Parallel)
29
+
30
+ Launch **two agents in parallel**:
31
+
32
+ **Agent 1: Code Review**
33
+ - Review the diff from the latest commit(s) in this session
34
+ - Focus on: bugs, logic errors, missing edge cases, broken patterns, code quality
35
+ - Only report high-confidence issues that truly matter
36
+
37
+ **Agent 2: Simplify**
38
+ - Review changed files for clarity, consistency, and maintainability
39
+ - Focus on: unnecessary complexity, dead code, DRY violations, unclear naming
40
+ - Preserve all existing functionality
41
+
42
+ Collect findings from both agents.
43
+
44
+ ## Step 4 -- Security Audit
45
+
46
+ Review all changed files for security vulnerabilities:
47
+
48
+ - **Injection**: unescaped user input, `innerHTML`, `dangerouslySetInnerHTML`, SQL without parameterized queries
49
+ - **Auth/AuthZ**: missing auth checks on API routes, privilege escalation paths
50
+ - **Secrets**: hardcoded API keys, tokens, passwords, connection strings
51
+ - **Validation**: missing input validation at API boundaries, unchecked array access
52
+ - **XSS**: unsanitized output in templates/JSX
53
+ - **CSRF/CORS**: missing or misconfigured protections
54
+
55
+ ## Step 5 -- Apply All Fixes
56
+
57
+ 1. Apply fixes from code review, simplify, and security audit
58
+ 2. Re-run lint + type-check to ensure fixes don't introduce new issues
59
+ 3. If a build script exists, run `npm run build` to verify compilation
60
+
61
+ ## Step 6 -- Re-commit & Loop
62
+
63
+ 1. If fixes were applied: commit with descriptive message and push
64
+ 2. **Loop decision** (max 3 iterations):
65
+ - If this was iteration 3: stop, report summary
66
+ - If fixes were made: loop back to Step 3 (skip lint since we just ran it)
67
+ - If no issues found: stop, report summary
68
+
69
+ ## Final Summary
70
+
71
+ After the loop completes, output a summary:
72
+
73
+ ```
74
+ ## Polish Complete
75
+
76
+ **Iterations**: X
77
+ **Initial commit**: <hash> -- <message>
78
+ **Review findings fixed**: <count>
79
+ **Simplifications made**: <count>
80
+ **Security issues resolved**: <count>
81
+ **Lint/type fixes**: <count>
82
+ **Final commit**: <hash> -- <message>
83
+ ```
84
+
85
+ ## Important Rules
86
+
87
+ - Do NOT ask for user confirmation between steps -- run autonomously
88
+ - Do NOT skip steps -- every iteration must include review + simplify + security
89
+ - Do NOT make cosmetic-only changes that don't improve the code meaningfully
90
+ - Do NOT touch files outside the current changeset unless fixing a bug found during review
91
+ - If `npm run build` or lint fails after fixes, debug and resolve before re-committing
92
+ - Always push after each commit
93
+
94
+ {{args}}
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: pr
3
+ description: Create a pull request on GitHub
4
+ trigger: /pr
5
+ ---
6
+
7
+ Create a pull request for the current branch. Follow these steps:
8
+
9
+ 1. Run `git status`, `git diff`, and `git log --oneline -10` to understand all changes
10
+ 2. Check if the branch tracks a remote: `git rev-parse --abbrev-ref --symbolic-full-name @{u}`
11
+ 3. If not tracking, push with: `git push -u origin $(git branch --show-current)`
12
+ 4. Analyze ALL commits on this branch (not just the latest)
13
+ 5. Create the PR:
14
+
15
+ ```bash
16
+ gh pr create --title "concise title under 70 chars" --body "$(cat <<'EOF'
17
+ ## Summary
18
+ - bullet point 1
19
+ - bullet point 2
20
+
21
+ ## Test plan
22
+ - [ ] test item 1
23
+ - [ ] test item 2
24
+ EOF
25
+ )"
26
+ ```
27
+
28
+ 6. Return the PR URL when done.
29
+
30
+ {{args}}
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: refactor
3
+ description: Refactor code for clarity without changing behavior
4
+ trigger: /refactor
5
+ ---
6
+
7
+ Refactor the specified code for improved clarity and maintainability.
8
+
9
+ Rules:
10
+ 1. **Never change behavior** — refactoring must be behavior-preserving
11
+ 2. Read all affected code first to understand the full picture
12
+ 3. Make changes incrementally — one improvement at a time
13
+ 4. Verify after each change that nothing is broken
14
+ 5. Common refactoring targets:
15
+ - Extract repeated patterns (only if 3+ occurrences)
16
+ - Simplify complex conditionals
17
+ - Improve naming for clarity
18
+ - Remove dead code
19
+ - Reduce nesting depth
20
+ 6. Do NOT:
21
+ - Add unnecessary abstractions
22
+ - Change public APIs without discussion
23
+ - "Improve" code that's already clear
24
+ - Add comments to self-documenting code
25
+
26
+ {{args}}
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: resume-branch
3
+ description: Switch branches with full context restoration from Entire.io
4
+ trigger: /resume-branch
5
+ ---
6
+
7
+ Switch to an existing branch and restore AI session context from Entire.io.
8
+
9
+ **Branch:** {{args}}
10
+
11
+ ## Steps
12
+
13
+ 1. Run `entire resume {{args}}` to switch to the branch and restore session context
14
+ 2. If the branch doesn't exist locally, Entire will prompt to fetch from origin
15
+ 3. After resume, run `entire explain --short` to show a summary of recent checkpoints on this branch
16
+ 4. Run `git log --oneline -10` to see recent commits
17
+ 5. Summarize the state of work on this branch:
18
+ - What was previously accomplished (from checkpoints)
19
+ - What commits exist
20
+ - What files were recently modified
21
+ - Any unfinished work or next steps visible from context
22
+
23
+ ## Notes
24
+
25
+ - This replaces a plain `git checkout` -- it also restores the Entire session log
26
+ - If no checkpoints exist on the branch, fall back to `git checkout {{args}}` and summarize from git log
27
+ - Works across all Ashlar projects
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: review
3
+ description: Review code for bugs, quality, and security issues
4
+ trigger: /review
5
+ ---
6
+
7
+ Review the code changes for bugs, logic errors, security vulnerabilities, and quality issues. Focus on what actually matters.
8
+
9
+ ## Steps:
10
+ 1. Run `git diff` to see all current changes (or `git diff HEAD~1` for the last commit)
11
+ 2. Read each changed file to understand context
12
+ 3. Review for:
13
+ - **Bugs**: Logic errors, off-by-one, null/undefined handling, race conditions
14
+ - **Security**: Injection risks, credential exposure, unsafe operations
15
+ - **Quality**: Unclear code, missing error handling at boundaries, complexity
16
+ - **Conventions**: Does it match existing patterns in the codebase?
17
+
18
+ ## Output format:
19
+ For each issue found, report:
20
+ - File and line number
21
+ - Severity: critical / warning / suggestion
22
+ - Description of the issue
23
+ - Recommended fix
24
+
25
+ Only report issues you're confident about. Don't flag style preferences or minor nits.
26
+
27
+ {{args}}
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: ship
3
+ description: Start ProductAgent — autonomous product-building mode that finds and fixes issues
4
+ trigger: /ship
5
+ ---
6
+
7
+ Start the **ProductAgent** — an autonomous agent that works toward a product goal.
8
+
9
+ Unlike KAIROS (which does tasks you give it), ProductAgent **finds its own work** by:
10
+ 1. Scanning the codebase against your goal
11
+ 2. Identifying bugs, missing features, quality gaps, security issues
12
+ 3. Prioritizing by user impact (critical → high → medium → low)
13
+ 4. Executing each fix with sub-agents (small items directly, large items via coordinator)
14
+ 5. Verifying every change automatically
15
+ 6. Optionally auto-committing verified changes
16
+
17
+ ## Usage
18
+ ```
19
+ /ship Make ashlrcode production-ready for paying users
20
+ /ship Ensure all tools work correctly and have proper error handling
21
+ /ship Add comprehensive test coverage for all agent modules
22
+ /ship stop
23
+ ```
24
+
25
+ ## Safety
26
+ - Skips complex changes when you're away (terminal unfocused)
27
+ - Respects cost budget (--max-cost)
28
+ - Verifies every change before moving on
29
+ - Max 20 items per session (configurable)
30
+ - You can /ship stop at any time
31
+
32
+ {{args}}
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: simplify
3
+ description: Simplify and refine code for clarity and maintainability
4
+ trigger: /simplify
5
+ ---
6
+
7
+ Review recently changed code and simplify it. Focus on:
8
+
9
+ 1. **Identify changed files**: Run `git diff --name-only` to find recently modified files
10
+ 2. **Read each file** and look for:
11
+ - Unnecessary abstractions that can be inlined
12
+ - Overly complex logic that can be simplified
13
+ - Redundant error handling or validation
14
+ - Dead code or unused imports
15
+ - Repeated patterns that should be extracted (only if 3+ occurrences)
16
+ 3. **Apply simplifications** using Edit tool
17
+ 4. **Verify** the code still compiles/runs after changes
18
+
19
+ Rules:
20
+ - Don't change behavior, only improve clarity
21
+ - Don't add comments to explain simple code
22
+ - Don't introduce new abstractions unless they reduce total code
23
+ - Preserve all existing functionality
24
+
25
+ {{args}}
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: test
3
+ description: Run tests and fix any failures
4
+ trigger: /test
5
+ ---
6
+
7
+ Run the project's test suite and fix any failures.
8
+
9
+ Steps:
10
+ 1. Look for test configuration: package.json scripts, bun test, jest, vitest, pytest, etc.
11
+ 2. Run the test command
12
+ 3. If tests fail:
13
+ - Read the failing test to understand what's expected
14
+ - Read the source code being tested
15
+ - Fix the source code (not the test) unless the test is clearly wrong
16
+ - Re-run tests to verify the fix
17
+ 4. Report results: total tests, passed, failed, skipped
18
+
19
+ {{args}}
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: verify
3
+ description: Run verification agent to validate recent code changes
4
+ trigger: /verify
5
+ ---
6
+
7
+ Run the Verify tool to spawn a verification sub-agent that checks recent code changes for correctness.
8
+
9
+ The verification agent will:
10
+ 1. Read the git diff and all modified files
11
+ 2. Check for syntax errors, logic bugs, missing imports, type mismatches
12
+ 3. Report PASS or FAIL with specific issues (file, line, severity)
13
+
14
+ Use after making non-trivial changes to validate they work correctly.
15
+ This is the feature that "doubles completion rates" — catching bugs before they ship.
16
+
17
+ {{args}}
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: weekly-plan
3
+ description: Weekly progress review and priority setting across projects
4
+ trigger: /weekly-plan
5
+ ---
6
+
7
+ Weekly planning session to review progress and set priorities.
8
+
9
+ ## Steps
10
+
11
+ 1. **Aggregate Last Week's Completions**
12
+ - Find notes with `status: completed` modified in last 7 days
13
+ - Summarize GSD phases completed
14
+ - Count features shipped, bugs fixed per project
15
+
16
+ 2. **Show Carried-Over Items**
17
+ - Find items that were planned but not completed
18
+ - Identify stale inbox items (> 7 days old)
19
+
20
+ 3. **Cross-Project Resource Analysis**
21
+ - Show current allocation between projects
22
+ - Identify conflicts (same person, same week)
23
+
24
+ 4. **This Week's Priorities**
25
+ - Pull from GSD roadmaps
26
+ - Suggest 3-5 key objectives
27
+ - Ask for approval or edits
28
+
29
+ 5. **Update Weekly Review Note**
30
+ - Create/update `07-Dashboards/Weekly-Review.md` with:
31
+ - Week's objectives
32
+ - Key decisions made
33
+ - Metrics (if tracked)
34
+
35
+ ## Output Format
36
+
37
+ ```
38
+ Weekly Planning - Week of [Date]
39
+
40
+ --- LAST WEEK ---
41
+ [completed items per project]
42
+
43
+ --- CARRIED OVER ---
44
+ [unfinished items and stale inbox]
45
+
46
+ --- THIS WEEK ---
47
+ Primary Focus: [project]
48
+ 1. Objective one
49
+ 2. Objective two
50
+ 3. Objective three
51
+
52
+ --- TEAM ---
53
+ [team member]: [Project A] (X%), [Project B] (Y%)
54
+
55
+ Confirm this week's plan? (y/n)
56
+ ```
57
+
58
+ ## Notes
59
+ - Run at start of week (Monday morning)
60
+ - Save decisions to `02-Projects/*/Decisions/`
61
+ - Update GSD STATE.md files if priorities change
62
+
63
+ {{args}}