@codename_inc/spectre 3.7.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 (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +411 -0
  3. package/bin/spectre.js +8 -0
  4. package/package.json +23 -0
  5. package/plugins/spectre/.claude-plugin/plugin.json +5 -0
  6. package/plugins/spectre/agents/analyst.md +122 -0
  7. package/plugins/spectre/agents/dev.md +70 -0
  8. package/plugins/spectre/agents/finder.md +105 -0
  9. package/plugins/spectre/agents/patterns.md +207 -0
  10. package/plugins/spectre/agents/reviewer.md +128 -0
  11. package/plugins/spectre/agents/sync.md +151 -0
  12. package/plugins/spectre/agents/tester.md +209 -0
  13. package/plugins/spectre/agents/web-research.md +109 -0
  14. package/plugins/spectre/commands/architecture_review.md +120 -0
  15. package/plugins/spectre/commands/clean.md +313 -0
  16. package/plugins/spectre/commands/code_review.md +408 -0
  17. package/plugins/spectre/commands/create_plan.md +117 -0
  18. package/plugins/spectre/commands/create_tasks.md +374 -0
  19. package/plugins/spectre/commands/create_test_guide.md +120 -0
  20. package/plugins/spectre/commands/evaluate.md +50 -0
  21. package/plugins/spectre/commands/execute.md +87 -0
  22. package/plugins/spectre/commands/fix.md +61 -0
  23. package/plugins/spectre/commands/forget.md +58 -0
  24. package/plugins/spectre/commands/handoff.md +161 -0
  25. package/plugins/spectre/commands/kickoff.md +115 -0
  26. package/plugins/spectre/commands/learn.md +15 -0
  27. package/plugins/spectre/commands/plan.md +170 -0
  28. package/plugins/spectre/commands/plan_review.md +33 -0
  29. package/plugins/spectre/commands/quick_dev.md +101 -0
  30. package/plugins/spectre/commands/rebase.md +73 -0
  31. package/plugins/spectre/commands/recall.md +5 -0
  32. package/plugins/spectre/commands/research.md +159 -0
  33. package/plugins/spectre/commands/scope.md +119 -0
  34. package/plugins/spectre/commands/ship.md +172 -0
  35. package/plugins/spectre/commands/sweep.md +82 -0
  36. package/plugins/spectre/commands/test.md +380 -0
  37. package/plugins/spectre/commands/ux_spec.md +91 -0
  38. package/plugins/spectre/commands/validate.md +343 -0
  39. package/plugins/spectre/hooks/hooks.json +34 -0
  40. package/plugins/spectre/hooks/scripts/bootstrap.cjs +99 -0
  41. package/plugins/spectre/hooks/scripts/handoff-resume.cjs +410 -0
  42. package/plugins/spectre/hooks/scripts/lib.cjs +83 -0
  43. package/plugins/spectre/hooks/scripts/load-knowledge.cjs +120 -0
  44. package/plugins/spectre/hooks/scripts/precompact-warning.cjs +19 -0
  45. package/plugins/spectre/hooks/scripts/register_learning.cjs +144 -0
  46. package/plugins/spectre/hooks/scripts/test_bootstrap.cjs +84 -0
  47. package/plugins/spectre/hooks/scripts/test_handoff-resume.cjs +858 -0
  48. package/plugins/spectre/hooks/scripts/test_load-knowledge.cjs +285 -0
  49. package/plugins/spectre/hooks/scripts/test_register-learning.cjs +146 -0
  50. package/plugins/spectre/skills/spectre-apply/SKILL.md +189 -0
  51. package/plugins/spectre/skills/spectre-guide/SKILL.md +358 -0
  52. package/plugins/spectre/skills/spectre-learn/SKILL.md +635 -0
  53. package/plugins/spectre/skills/spectre-learn/references/recall-template.md +31 -0
  54. package/plugins/spectre/skills/spectre-tdd/SKILL.md +111 -0
  55. package/src/config.test.js +134 -0
  56. package/src/install.test.js +273 -0
  57. package/src/lib/config.js +516 -0
  58. package/src/lib/constants.js +60 -0
  59. package/src/lib/doctor.js +168 -0
  60. package/src/lib/install.js +482 -0
  61. package/src/lib/knowledge.js +217 -0
  62. package/src/lib/paths.js +98 -0
  63. package/src/lib/project.js +473 -0
  64. package/src/main.js +150 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Joe Fernandez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,411 @@
1
+ # SPECTRE: A Workflow for Product Builders
2
+
3
+ **S**cope → **P**lan → **E**xecute → **C**lean → **T**est → **R**ebase → **E**valuate
4
+
5
+ SPECTRE is a slash command based workflow for Claude Code designed to help you do ONE THING more, faster, and with higher quality.
6
+
7
+ **🚀 Ship Product Features**
8
+
9
+ SPECTRE's workflow covers the complete software development lifecycle - from scoping a feature, finalizing user flows, writing the technical design, generating tasks, executing the tasks, code review, validating the work, cleaning up and testing the work, and finally generating documentation as Skills your agent auto-loads when relevant.
10
+
11
+ It has been tested on brand new codebases and codebases with hundreds of thousands of lines of code. Its been tested building websites, react native apps, native desktop apps, and personal software.
12
+
13
+ **SPECTRE helps you get higher quality and more consistent results from your coding agent, while they work autonomously for much longer, so 10-100x'ing your typical output feels *easy* and more importantly, *repeatable.***
14
+
15
+ ![SPECTRE hero](./assets/images/spectre-hero.png)
16
+
17
+ ## ⚡ Quick Start
18
+
19
+ ### Within Claude Code
20
+
21
+ ```bash
22
+ # Add marketplace and install
23
+ /plugin marketplace add Codename-Inc/spectre
24
+ /plugin install spectre@codename
25
+ ```
26
+
27
+ Then start building:
28
+
29
+ ```plaintext
30
+ /spectre:scope
31
+ ```
32
+
33
+ That's it. You just start with 1 command to build features.
34
+
35
+ ### Within Codex
36
+
37
+ ```bash
38
+ npx spectre install codex
39
+ ```
40
+
41
+ When prompted, choose `project` to install into the current repo's `.codex`, or `user` to install into `~/.codex`.
42
+
43
+ If you choose `project`, run `codex` from that repo.
44
+
45
+ If you choose `user`, restart or open your normal Codex session.
46
+
47
+ Then run a Spectre command such as:
48
+
49
+ ```plaintext
50
+ spectre-scope
51
+ ```
52
+
53
+ Current Codex behavior:
54
+
55
+ - `user` scope installs Spectre workflow skills, runtime, agents, hooks, and shared skills under `~/.codex`
56
+ - `project` scope installs the same Codex home structure inside `./.codex`
57
+ - project installs create `.spectre/manifest.json` and project-local Codex config
58
+ - session continuity uses Codex's official SessionStart hook for the visible status line and keeps the latest handoff in a managed `AGENTS.override.md` block
59
+ - learned project skills still live under `.agents/skills/` and are synced into Codex config
60
+
61
+ Capability matrix: [`docs/codex-capability-matrix.md`](./docs/codex-capability-matrix.md)
62
+ Session continuity deep dive: [`docs/codex-sessionstart-memory.md`](./docs/codex-sessionstart-memory.md)
63
+
64
+ ![SPECTRE scope command](./assets/images/spectre-scope.png)
65
+
66
+ ## 🔁 How It Works
67
+
68
+ - run one of the kickoff prompts in Claude Code - `/spectre:scope` is the main command for building new features, but also `/spectre:kickoff` for high ambiguity new features (includes web research), `/spectre:research` for codebase research "how might we build …” style Qs, or `/spectre:ux_spec` to define user flows, components, and layout for a new feature.
69
+
70
+ - follow the prompts/instructions to create the related canonical document and Claude Code will suggest the next step in the SPECTRE workflow automatically (e.g., going from `scope` to `plan` to `tasks` and so on)
71
+
72
+ - turn off auto-compact in Claude Code settings (`/config`) and run `/spectre:handoff` when the context window is getting full, then run `/clear` to start the next session. (`/spectre:forget` when you are switching gears)
73
+
74
+ - SPECTRE saves canonical docs to a `docs/tasks/{topic}/specs` directory, and status updates from `/spectre:handoff` to `docs/tasks/{topic}/session_logs` directory. We recommend keeping this directory checked into git to be able to reference docs in the future.
75
+
76
+ - thats it. scope features, plan features, build features, clean up/test features, document features, learn from features, repeat.
77
+
78
+ ## 🎯 Core SPECTRE Principles
79
+
80
+ - Great Inputs → Great Outputs
81
+ - Ambiguity is Death
82
+ - One Workflow, Every Feature, Any Size, Any Codebase
83
+ - Obvious > Clever
84
+
85
+ ## 👻 SPECTRE Purpose
86
+
87
+ AI coding is changing product development, but why is it that Claude Code can still go off the rails? Why is it that some developers claim AI has 100x'd their output, while others still complain about the quality of the code it generates?
88
+
89
+ Let me introduce you to a very simple concept that you need to drill into your head. With coding agents:
90
+
91
+ > ### **💀 AMBIGUITY IS DEATH.**
92
+
93
+ When the scope, ux, and plan are ambiguous, you must rely on the LLM to fill in the blanks. And while sometimes you can get lucky - especially for smaller features - for any *real* technology or product work, ambiguity is how you end up with spaghetti code, conflicts, and AI slop.
94
+
95
+ LLMs need specificity. And typically, providing the right level of specificity is a lot of work. Just think about the most detailed spec or technical design you’ve ever written. Takes days and sometimes weeks.
96
+
97
+ BUT --- you can use LLMs to make it EASY to provide that specificity. And that is exactly what SPECTRE does.
98
+
99
+ ### ✅ Workflows = Easy Button
100
+
101
+ Prompt based workflows that generate canonical docs that you and your Agents are aligned on are how you get the best, highest quality, and most consistent results from AI Coding Agents.
102
+
103
+ They provide the necessary context, detail, and structure for the agent to ask the right questions, investigate the right details, and generate the right requirements, plans, tasks, code, tests, and more.
104
+
105
+ The better your prompt based workflows, the lower the ambiguity, the more AI can take on, the longer AI can work autonomously, the more easily you can multi-task, and suddenly you are 100x'ing your output.
106
+
107
+ ## 📄 Canonical Docs
108
+
109
+ As a former PM I've lived the value of [Canonical Docs](https://naomi.com/canonical-everything-c85441a84e70) (shout out Naomi Gleit). The reasons they work for Humans are the same reasons they work with AI Agents (see 💀 Ambiguity is Death)
110
+
111
+ In SPECTRE, the **structured workflows** generate some combination of the following canonical docs stored in `docs/tasks/{topic/feature}/specs`
112
+
113
+ - `scope.md` - what are we building and importantly what are we NOT building
114
+ - `ux.md` - the core user flows and components/layouts/interactions
115
+ - `plan.md` - high level technical design and phasing
116
+ - `tasks.md `- specific parent & sub-tasks to execute
117
+ - `code_review.md` - prioritized code review feedback
118
+ - `gaps.md` - task list of gaps identified from validation
119
+ - `.claude/skills/{feature_name}/skill.md` - a skill for agents to auto-reference the work
120
+
121
+ Not all are required. Sometimes I have scope.md and then use Claude Code's plan mode. Sometimes I have a ux.md and a tasks.md. The key thing to remember is that docs are the context in context engineering.
122
+
123
+ ### 💧 So.... Waterfall?
124
+
125
+ Yeah basically Rapid Waterfall.
126
+
127
+ Specificity up front forces clarity, reduces ambiguity, and leads to better 1st pass results.
128
+
129
+ THEN -- you can iterate on the feature set, ux, architecture, etc. at lightning speed. AI coding agents are 10x better at working around *working* existing code. It's why they are so good at refactors. Because they are working with a working established baseline.
130
+
131
+ **Workflows make it easier and faster to get to working code.**
132
+
133
+ From there, you can iterate and adapt before you ship.
134
+
135
+ ## 📖 Background & Philosophy
136
+
137
+ ## About
138
+
139
+ SPECTRE is the result of over 12 months of daily Claude Code use.
140
+
141
+ These are the *actual* prompts I use and iterate upon non stop every day to build products.
142
+
143
+ With SPECTRE, I built a React Native based AI Agent + GPS Rangefinder for Golfers (New June (in closed Alpha)) and a 250k line Tauri/Rust/React desktop application called Subspace (in open Beta - https://www.subspace.build).
144
+
145
+ ## 💡 Why
146
+
147
+ I created SPECTRE because I wanted:
148
+
149
+ - a repeatable daily driver workflow that works on brand new projects, and large existing codebases.
150
+
151
+ - a single workflow that works on both small & big features without being overwhelmed with process
152
+
153
+ - a workflow that delivers robust engineering plans when needed, or a concise set of tasks if not
154
+
155
+ - hands on planning but hands off execution
156
+
157
+ - higher quality INPUT with LESS WORK so i can ensure the outputs are more aligned with my vision
158
+
159
+ - a workflow that lets Agents learn my codebase, features, patterns, bugs, so I don't have to remember everything
160
+
161
+ - ***stupid. simple. memory.*** agent sessions are aware of the ongoing thread of work (/spectre:handoff)
162
+
163
+ ### My Workflow Iteration Process
164
+
165
+ I improve these prompts daily, and I didn't just prompt Claude Code to generate these prompts. I iterated over many months, adjusting the prompts based on both the user experience of using them, and the quality of results that I got.
166
+
167
+ For example:
168
+
169
+ - I iterated on /spectre:scope until I felt like the types of questions actually help me get clear on what I'm building, without asking questions that it could easily get from codebase research
170
+ - I iterated on the /spectre:execute workflow until it successfully delivered large tasks in a single context window using subagents that deliver completion reports to handoff to the next subagents, use TDD effectively, and autonomously adapt the tasks based on what was discovered DURING development instead of blindly
171
+ - I iterated on the /spectre:clean and /spectre:test workflows until it felt automatic that we were sticking to our linting rules, every new feature was well tested/covered, the commits were grouped logically with the appropriate amount of detail.
172
+ - I iterated on the /spectre:evaluate learning workflow until 1) the agent automatically reached for the skills generated at the start of every conversation, 2) captured the *right* details and insights, and 3) proactively updated relevant skills as we make changes and learn more.
173
+ - I iterated on the /spectre:handoff workflow until the status update had the appropriate detail/context, and worked perfectly if I'm working across MANY sessions or just one.
174
+
175
+ SPECTRE made products like New June and Subspace possible, and it is making it possible for me, an ex-Meta, ex-Amazon Technical Product Manager to build, ship, and iterate on products 100x the complexity of anything I've ever built in the past.
176
+
177
+ ## 🔄 The SPECTRE Workflow
178
+
179
+ If you start with /scope, your agent will guide you through the rest of the steps automatically.
180
+
181
+ | Phase | Command | What It Does |
182
+ | --- | --- | --- |
183
+ | **S**cope | `/spectre:scope` | Define requirements, constraints, success criteria |
184
+ | **P**lan | `/spectre:plan` | Research codebase, create implementation plan |
185
+ | **E**xecute | `/spectre:execute` | Parallel implementation with wave-based delivery |
186
+ | **C**lean | `/spectre:clean` | Remove dead code, lint, format |
187
+ | **T**est | `/spectre:test` | Risk-aware test coverage |
188
+ | **R**ebase | `/spectre:rebase` | Safe merge preparation with conflict handling |
189
+ | **E**valuate | `/spectre:evaluate` | Architecture review + knowledge capture |
190
+
191
+ Each command ends with "Next Steps" suggestions, so you always know what prompt to run next — you don't have to remember what the prompts are, which is one thing that kills me about many other Spec Driven Development workflows.
192
+
193
+ You can use *any* of the commands in any sequence you want - they are good standalone too. More on my typical daily usage below.
194
+
195
+ ## 🧠 SPECTRE Session Memory
196
+
197
+ SPECTRE maintains and accumulates context across sessions when you use the /spectre:handoff command. To get the most from SPECTRE's Session Memory, we recommend that you:
198
+
199
+ 1. turn off auto-compact in Claude Code /config settings, and
200
+
201
+ 2. run /spectre:handoff liberally when you are switching gears or the context window is getting north of 160k tokens.
202
+
203
+ ### How It Works
204
+
205
+ When you run /spectre:handoff, a status report will get generated for that session, and automatically loaded into your context window for the next session. You'll see a nice summary of the status when you run /clear.
206
+
207
+ If you already had previous sessions, a subagent (@spectre:sync) will review the last 3 status updates and merge into a single continuous session memory.
208
+
209
+ Voila -- trailing 3 session memory snapshots.
210
+
211
+ If you want to start fresh — /spectre:forget archives the session_logs.
212
+
213
+ ```plaintext
214
+ /spectre:handoff # Save progress before session ends
215
+ /spectre:forget # Clear memory for fresh start
216
+ ```
217
+
218
+ ## 🧬 SPECTRE Evaluate
219
+
220
+ The more I used SPECTRE and the faster I could build, the more frequently I found myself wanting to reference past work. Debugging sessions, a new architectural pattern, or how a feature works/was built.
221
+
222
+ SPECTRE Evaluate combines **architecture review** with **knowledge capture** — reviewing what you built and learning from it in one step.
223
+
224
+ ### How It Works
225
+
226
+ `/spectre:evaluate` runs two things in parallel:
227
+
228
+ 1. **Architecture review** — dispatches an Opus 4.6 subagent in the background to produce a principal-level architecture review of your completed work
229
+ 2. **Learn** — captures durable project knowledge (patterns, gotchas, decisions) into re-usable skills that **auto-load in future sessions**
230
+
231
+ ### The Hook + Skill Loop
232
+
233
+ What is great about SPECTRE's learning system, is that Claude Code automatically loads skills that are relevant. We do this with a 'coercion' technique I borrowed from Jesse Vincent's great Superpowers skill.
234
+
235
+ 1. **SessionStart hook** — every time you start a conversation, SPECTRE's hook reads your project's knowledge registry and injects it into context. Claude now *knows what it knows* before you type a single word.
236
+
237
+ 2. **Skill auto-loading** — when your task matches a trigger word from the registry (e.g., you mention "auth" and there's a `feature-auth-flows` skill), Claude loads the full skill *before* searching the codebase. No wasted tool calls rediscovering what's already documented.
238
+
239
+ The result: knowledge compounds across sessions instead of resetting to zero. The more you learn, the faster and more accurate every future session becomes.
240
+
241
+ ### What Gets Captured
242
+
243
+ | Category | Example |
244
+ | --- | --- |
245
+ | **Gotchas** | "The websocket reconnect silently fails if..." |
246
+ | **Decisions** | "We chose SQLite over Postgres because..." |
247
+ | **Features** | Architecture dossiers — key files, flows, common tasks |
248
+ | **Patterns** | Reusable solutions established across the codebase |
249
+ | **Procedures** | Multi-step processes like deploy, release, migrate |
250
+
251
+ You can also run these independently:
252
+
253
+ ```plaintext
254
+ /spectre:evaluate # Architecture review + learn (the full evaluate step)
255
+ /spectre:learn # Just capture knowledge from this session
256
+ /spectre:architecture_review # Just run the architecture review
257
+ /spectre:recall auth # Find and load existing knowledge about auth
258
+ ```
259
+
260
+ ## 🤖 Subagents
261
+
262
+ SPECTRE dispatches specialized subagents for different tasks:
263
+
264
+ NOTE: You don't even need to know that these subagents exist. The prompts instruct Claude Code to call them automatically.
265
+
266
+ Although I do sometimes use @spectre:web-research for web research. It's like mini deep-research.
267
+
268
+ | Agent | Purpose |
269
+ | --- | --- |
270
+ | `@spectre:dev` | Implementation with MVP focus |
271
+ | `@spectre:analyst` | Understand how code works |
272
+ | `@spectre:finder` | Find where code lives |
273
+ | `@spectre:patterns` | Find reusable patterns |
274
+ | `@spectre:web-research` | Web research |
275
+ | `@spectre:tester` | Test automation |
276
+ | `@spectre:reviewer` | Independent code review |
277
+
278
+ ## 🛠️ How I Typically use SPECTRE
279
+
280
+ 99.9% of my day is spent using SPECTRE exactly like this.
281
+
282
+ - start /spectre:scope to get crisp on what's in/out. this is non-negotiable unless the feature is a one line ask.
283
+
284
+ - if the feature's ux/user flow is unclear to me, or I want to make sure to really nail it, i run /spectre:ux_spec. Its similar to /spectre:scope but focuses on getting clear on the core user flows.
285
+
286
+ - /spectre:plan to build out a well researched technical design or set of tasks
287
+
288
+ - once i have scope/plan/tasks, I typically run /spectre:handoff to get a fresh context window with awareness of what we're working on.
289
+
290
+ - then run /spectre:execute to use parallel subagents to work through the tasks. Execute is a meta prompt that also calls /spectre:code_review and /spectre:validate.
291
+
292
+ - side note /spectre:validate is a killer prompt. It breaks down the original tasks and dispatches subagents to verify. find stuff missing all the time with this.
293
+
294
+ - when initial execution is complete, i run another /spectre:handoff to get the context window clean for fixes/touch ups.
295
+
296
+ - for low-complexity tasks where I trust the agent end-to-end, I use /spectre:ship. Brain dump what I want, walk away, and review the PR. It autonomously scopes, implements with TDD, sweeps, rebases, and opens a PR — zero confirmation gates.
297
+
298
+ - From here — I do a bunch of manual testing and fixing.
299
+
300
+ - I largely use Claude Code's built in /plan mode for fixes in this phase.
301
+
302
+ - If there is a bug that can't easily be solved, i use the /spectre:fix prompt for a more structured debugging approach.
303
+
304
+ - If something new comes up, or if the scope is not what I'd hoped, I run a new /scope cycle from within the project.
305
+
306
+ - I liberally use /spectre:handoff here to keep context windows clean as I work through issues, and keep the sessions on track with the progress we're making.
307
+
308
+ - During the process of manual testing/fixing, I typically accumulate uncommitted changes. /spectre:sweep will get your changes committed, while
309
+
310
+ - running and addressing lint
311
+ - running tests and related tests on touched files
312
+ - finding obvious dead code/AI slop, and
313
+ - grouping changes logically with descriptive conventional commits
314
+
315
+ - Once wrapping up, /spectre:clean is a much deeper cleanup that dispatches subagents to find dead code, duplicates, verifies, lint, commits any stragglers, etc.
316
+
317
+ - Then /spectre:test does deep analysis and dispatches subagents to write tests based on a risk-adjusted framework focusing on behavior not implementation details.
318
+
319
+ - Once cleaned/tested — /spectre:rebase works great to rebase onto your parent branch, but obviously you do you with your release flow. From here I create PR/merge or directly merge depending on the task.
320
+
321
+ - Finally, I run /spectre:evaluate to get an architecture review and capture any knowledge worth preserving — patterns, gotchas, decisions. This builds institutional memory that loads automatically in future sessions.
322
+
323
+ - From here, merge/PR, address any PR comments, etc. and get the feature checked back in.
324
+
325
+ ## 📋 Slash Command Reference
326
+
327
+ ### Core Workflow
328
+
329
+ | Command | Description |
330
+ | --- | --- |
331
+ | `/spectre:scope` | Interactive feature scoping |
332
+ | `/spectre:plan` | Research codebase, create implementation plan |
333
+ | `/spectre:execute` | Wave-based parallel execution with code review |
334
+ | `/spectre:clean` | Code cleanup and quality gates |
335
+ | `/spectre:test` | Risk-aware test coverage |
336
+ | `/spectre:rebase` | Safe rebase with conflict handling |
337
+ | `/spectre:evaluate` | Architecture review + knowledge capture |
338
+
339
+ ### Quick Start
340
+
341
+ | Command | Description |
342
+ | --- | --- |
343
+ | `/spectre:quick_dev` | Scope + plan for small/medium tasks |
344
+ | `/spectre:ship` | Autonomous end-to-end: brain dump → scope → TDD → rebase → PR |
345
+
346
+ ### Discovery & Research
347
+
348
+ | Command | Description |
349
+ | --- | --- |
350
+ | `/spectre:kickoff` | Deep research for high-ambiguity features |
351
+ | `/spectre:research` | Parallel codebase research |
352
+
353
+ ### Session Memory
354
+
355
+ | Command | Description |
356
+ | --- | --- |
357
+ | `/spectre:handoff` | Save session state snapshot |
358
+ | `/spectre:forget` | Clear memory, archive logs |
359
+
360
+ ### Utilities
361
+
362
+ These are situational commands.
363
+
364
+ I use /spectre:fix for pretty much all bugs I run into.
365
+
366
+ | Command | Description |
367
+ | --- | --- |
368
+ | `/spectre:sweep` | Light cleanup pass — lint, test, descriptive commits |
369
+ | `/spectre:learn` | Capture knowledge for future sessions |
370
+ | `/spectre:ux_spec` | UX specification for UI-heavy features |
371
+ | `/spectre:fix` | Investigate bugs & implement fixes |
372
+
373
+ ## 📁 Repository Structure
374
+
375
+ ```plaintext
376
+ spectre/
377
+ ├── .claude-plugin/
378
+ │ └── marketplace.json # Marketplace registration
379
+ ├── plugins/
380
+ │ └── spectre/
381
+ │ ├── .claude-plugin/
382
+ │ │ └── plugin.json # Plugin manifest
383
+ │ ├── commands/ # Slash commands
384
+ │ ├── agents/ # Subagent definitions
385
+ │ ├── hooks/ # Session memory hooks
386
+ │ └── skills/ # Skills
387
+ ├── scripts/ # Release & utility scripts
388
+ └── CLAUDE.md
389
+ ```
390
+
391
+ ## Updating
392
+
393
+ Skills update automatically when you update the plugin:
394
+
395
+ `/plugin update spectre`
396
+
397
+ ## License
398
+
399
+ MIT License - see LICENSE file for details
400
+
401
+ ## Support and/or Feedback
402
+
403
+ Issues: https://github.com/codename-inc/spectre/issues
404
+
405
+ Email: [joe@bycodename.com](mailto:joe@bycodename.com?subject=Spectre%20Feedback)
406
+
407
+ Socials:
408
+
409
+ - Threads: [@joenandez](https://www.threads.com/joenandez)
410
+ - X: [@joenandez](https://www.x.com/joenandez)
411
+ - LinkedIn: [@joefernandez](https://www.linkedin.com/in/joefernandez/)
package/bin/spectre.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { main } from '../src/main.js';
3
+
4
+ main(process.argv.slice(2)).catch(error => {
5
+ const message = error instanceof Error ? error.message : String(error);
6
+ process.stderr.write(`${message}\n`);
7
+ process.exit(1);
8
+ });
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@codename_inc/spectre",
3
+ "version": "3.7.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "spectre": "./bin/spectre.js"
7
+ },
8
+ "files": [
9
+ "bin",
10
+ "src",
11
+ "plugins",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "scripts": {
16
+ "test": "node --test src/**/*.test.js plugins/spectre/hooks/scripts/test_*.cjs",
17
+ "tokens": "node scripts/count-tokens.js",
18
+ "release": "node scripts/release.js"
19
+ },
20
+ "dependencies": {
21
+ "@anthropic-ai/tokenizer": "^0.0.4"
22
+ }
23
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "spectre",
3
+ "version": "3.7.0",
4
+ "description": "Agentic coding workflow with session memory. spectre guides you through Scope, Plan, Execute, Clean, Test, Rebase, and Extract phases."
5
+ }
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: analyst
3
+ description: Analyzes codebase implementation details. Call the analyst agent when you need to find detailed information about specific components. As always, the more detailed your request prompt, the better! :)
4
+ tools: Read, Grep, Glob, LS
5
+ color: white
6
+ model: claude-sonnet-4-6
7
+ ---
8
+
9
+ You are a specialist at understanding HOW code works. Your job is to analyze implementation details, trace data flow, and explain technical workings with precise file:line references.
10
+
11
+ ## Core Responsibilities
12
+
13
+ 1. **Analyze Implementation Details**
14
+ - Read specific files to understand logic
15
+ - Identify key functions and their purposes
16
+ - Trace method calls and data transformations
17
+ - Note important algorithms or patterns
18
+
19
+ 2. **Trace Data Flow**
20
+ - Follow data from entry to exit points
21
+ - Map transformations and validations
22
+ - Identify state changes and side effects
23
+ - Document API contracts between components
24
+
25
+ 3. **Identify Architectural Patterns**
26
+ - Recognize design patterns in use
27
+ - Note architectural decisions
28
+ - Identify conventions and best practices
29
+ - Find integration points between systems
30
+
31
+ ## Analysis Strategy
32
+
33
+ ### Step 1: Read Entry Points
34
+ - Start with main files mentioned in the request
35
+ - Look for exports, public methods, or route handlers
36
+ - Identify the "surface area" of the component
37
+
38
+ ### Step 2: Follow the Code Path
39
+ - Trace function calls step by step
40
+ - Read each file involved in the flow
41
+ - Note where data is transformed
42
+ - Identify external dependencies
43
+ - Take time to ultrathink about how all these pieces connect and interact
44
+
45
+ ### Step 3: Understand Key Logic
46
+ - Focus on business logic, not boilerplate
47
+ - Identify validation, transformation, error handling
48
+ - Note any complex algorithms or calculations
49
+ - Look for configuration or feature flags
50
+
51
+ ## Output Format
52
+
53
+ Structure your analysis like this:
54
+
55
+ ```
56
+ ## Analysis: [Feature/Component Name]
57
+
58
+ ### Overview
59
+ [2-3 sentence summary of how it works]
60
+
61
+ ### Entry Points
62
+ - `api/routes.js:45` - POST /webhooks endpoint
63
+ - `handlers/webhook.js:12` - handleWebhook() function
64
+
65
+ ### Core Implementation
66
+
67
+ #### 1. Request Validation (`handlers/webhook.js:15-32`)
68
+ - Validates signature using HMAC-SHA256
69
+ - Checks timestamp to prevent replay attacks
70
+ - Returns 401 if validation fails
71
+
72
+ #### 2. Data Processing (`services/webhook-processor.js:8-45`)
73
+ - Parses webhook payload at line 10
74
+ - Transforms data structure at line 23
75
+ - Queues for async processing at line 40
76
+
77
+ #### 3. State Management (`stores/webhook-store.js:55-89`)
78
+ - Stores webhook in database with status 'pending'
79
+ - Updates status after processing
80
+ - Implements retry logic for failures
81
+
82
+ ### Data Flow
83
+ 1. Request arrives at `api/routes.js:45`
84
+ 2. Routed to `handlers/webhook.js:12`
85
+ 3. Validation at `handlers/webhook.js:15-32`
86
+ 4. Processing at `services/webhook-processor.js:8`
87
+ 5. Storage at `stores/webhook-store.js:55`
88
+
89
+ ### Key Patterns
90
+ - **Factory Pattern**: WebhookProcessor created via factory at `factories/processor.js:20`
91
+ - **Repository Pattern**: Data access abstracted in `stores/webhook-store.js`
92
+ - **Middleware Chain**: Validation middleware at `middleware/auth.js:30`
93
+
94
+ ### Configuration
95
+ - Webhook secret from `config/webhooks.js:5`
96
+ - Retry settings at `config/webhooks.js:12-18`
97
+ - Feature flags checked at `utils/features.js:23`
98
+
99
+ ### Error Handling
100
+ - Validation errors return 401 (`handlers/webhook.js:28`)
101
+ - Processing errors trigger retry (`services/webhook-processor.js:52`)
102
+ - Failed webhooks logged to `logs/webhook-errors.log`
103
+ ```
104
+
105
+ ## Important Guidelines
106
+
107
+ - **Always include file:line references** for claims
108
+ - **Read files thoroughly** before making statements
109
+ - **Trace actual code paths** don't assume
110
+ - **Focus on "how"** not "what" or "why"
111
+ - **Be precise** about function names and variables
112
+ - **Note exact transformations** with before/after
113
+
114
+ ## What NOT to Do
115
+
116
+ - Don't guess about implementation
117
+ - Don't skip error handling or edge cases
118
+ - Don't ignore configuration or dependencies
119
+ - Don't make architectural recommendations
120
+ - Don't analyze code quality or suggest improvements
121
+
122
+ Remember: You're explaining HOW the code currently works, with surgical precision and exact references. Help users understand the implementation as it exists today.
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: dev
3
+ description: Implementation specialist for writing and refactoring code. Focuses on simplicity, readability, MVP-first delivery. Use when writing new features, refactoring, or implementing tasks.
4
+ tools: Read, Write, Edit, Bash, Glob, Grep
5
+ model: claude-sonnet-4-6
6
+ color: red
7
+ ---
8
+
9
+ You are an expert software engineer. Your philosophy: **simple, readable, maintainable code that ships**.
10
+
11
+ ## Constraints
12
+
13
+ - **MVP-first**: Implement only what's needed now—no future-proofing
14
+ - **Follow existing patterns**: Study similar code in the codebase first
15
+ - **Simplest solution wins**: When choosing between approaches, pick the simpler one
16
+ - **No enterprise abstractions**: Avoid complex patterns, frameworks, or unnecessary layers
17
+
18
+ ## When Writing Code
19
+
20
+ 1. Find similar implementations in the codebase—match their style
21
+ 2. Build the minimal working version first
22
+ 3. Use descriptive names that eliminate need for comments
23
+ 4. Handle errors gracefully with meaningful messages
24
+ 5. Add comments only for the "why", not the "what"
25
+
26
+ ## When Refactoring
27
+
28
+ 1. Eliminate unnecessary complexity
29
+ 2. Improve naming to enhance readability
30
+ 3. Remove redundant comments
31
+ 4. Simplify control flow and reduce nesting
32
+
33
+ ## Task Execution
34
+
35
+ **Work only on assigned tasks.** Do not:
36
+ - Add features not explicitly requested
37
+ - Optimize or refactor outside assigned scope
38
+ - Implement "nice-to-have" functionality
39
+
40
+ ## Completion Protocol
41
+
42
+ **You MUST deliver a Completion Report when finished.** This report is your primary output—the parent agent and downstream agents depend on it to coordinate work and avoid rework.
43
+
44
+ **You are not a blind executor.** During implementation, you will discover things the plan didn't anticipate. Your job is to surface these learnings.
45
+
46
+ **Before writing your report, assess:**
47
+ - Did implementation reveal constraints the plan missed?
48
+ - Are downstream tasks affected by what you learned?
49
+ - Should the parent agent reconsider any upcoming work?
50
+
51
+ **Scope Signal** (required):
52
+
53
+ | Signal | Meaning |
54
+ |--------|---------|
55
+ | ⚪ None | Proceeded as expected—no impact on future tasks |
56
+ | 🟡 Minor | Small adjustments may be needed to future tasks |
57
+ | 🟠 Significant | Learnings that likely affect the plan |
58
+ | 🔴 Blocking | Stop—future tasks need re-evaluation |
59
+
60
+ **Required Completion Report:**
61
+ ```
62
+ ## Completion Report
63
+
64
+ **Completed:** [Tasks finished - exact titles]
65
+ **Files changed:** [Path + brief description for each]
66
+ **Scope signal:** [⚪/🟡/🟠/🔴] - [Justification]
67
+ **Discoveries:** [What wasn't obvious from the spec?]
68
+ **Guidance:** [What should downstream tasks know?]
69
+ **Scope compliance:** ✅ No unauthorized extras added
70
+ ```