@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
@@ -0,0 +1,101 @@
1
+ ---
2
+ description: 👻 | Quickly scope, research, & plan s/m tasks - primary agent
3
+ ---
4
+
5
+ # quick_dev: Scope → Research → Plan for Small/Medium Tasks
6
+
7
+ ## Description
8
+ - **What** — Lightweight workflow for bug fixes and small features: confirm scope, research via parallel agents, create implementation plan
9
+ - **Outcome** — Validated scope, research synthesis, `quick_task_plan.md` with parent/sub-task structure
10
+
11
+ ## ARGUMENTS Input
12
+
13
+ <ARGUMENTS>
14
+ $ARGUMENTS
15
+ </ARGUMENTS>
16
+
17
+ ## Step 1 - Gather Context
18
+
19
+ - **Action** — ImmediateReply: Respond before running tools
20
+ - **If** ARGUMENTS has task context → proceed to Step 2
21
+ - **Else** → ask: "What are you trying to build or fix? Share any docs or context."
22
+ - **CRITICAL**: No tool calls here. No technical questions — research answers those.
23
+ - **Wait** — Only if ARGUMENTS empty
24
+
25
+ - **Action** — ReadFiles: Read any files mentioned by user completely (no limit/offset)
26
+
27
+ ## Step 2 - Confirm Scope (Functional Only)
28
+
29
+ **Scope is about WHAT we're building, not HOW.** Technical approach comes from research.
30
+
31
+ **DO NOT ask about**: implementation approach or technical decisions — research answers those.
32
+
33
+ - **Action** — PresentScope:
34
+ > **📋 Scope Confirmation**
35
+ >
36
+ > **Objective**: {functional outcome}
37
+ >
38
+ > **✅ In Scope**: {what the feature does — behaviors, not implementation}
39
+ >
40
+ > **❌ Out of Scope**: {what we're NOT building}
41
+ >
42
+ > **UX Assumptions**: {how you imagine the user flow working}
43
+ >
44
+ > **Constraints**: {user-provided only}
45
+ >
46
+ > Any items to move between IN/OUT? Clarify UX flow? Reply with changes or 'Confirmed'.
47
+
48
+ - **Wait** — User confirms or provides changes (apply and proceed)
49
+
50
+ ## Step 3 - Research
51
+
52
+ - **Action** — SpawnAgents: Launch parallel research agents
53
+ - `@finder` — find WHERE files/components live
54
+ - `@analyst` — understand HOW code works
55
+ - `@patterns` — find similar implementations
56
+ - `@web-research` — external docs (only if user asks)
57
+ - **Wait** for ALL agents to complete
58
+
59
+ - **Action** — Synthesize: Compile findings with file paths, patterns, architectural decisions
60
+
61
+ ## Step 4 - Clarify Ambiguities
62
+
63
+ - **Action** — AskClarifyingQuestions: Use AskUserQuestion tool for 2-4 questions
64
+ - **Only ask** what research revealed needs user decision: UX preferences, behavioral trade-offs
65
+ - For multi-option questions: include Pros/Cons/Trade-offs
66
+ - **Never ask** scope questions (settled in Step 2) or technical questions answerable by code
67
+
68
+ ## Step 5 - Create Plan
69
+
70
+ - **Action** — DetermineOutputDir:
71
+ - `OUT_DIR=docs/tasks/{branch_name}` (or user-specified)
72
+ - `mkdir -p "${OUT_DIR}/specs"`
73
+
74
+ - **Action** — GeneratePlan: Create `{OUT_DIR}/specs/quick_task_plan.md` (use scoped name if exists)
75
+
76
+ **Plan Structure**:
77
+ 1. Agreed Scope (Objective, In/Out of Scope, Constraints)
78
+ 2. Research Summary (key codebase findings)
79
+ 3. Approach Summary (strategy, integration points)
80
+ 4. Implementation Tasks (see format below)
81
+ 5. Success Criteria
82
+
83
+ **Task Format**: `## Phase` → `### [1.1] Parent Task` → `- [ ] **1.1.1** Sub-task` → `- [ ] Criterion`
84
+
85
+ **Sub-task guidance**:
86
+ - Start with action verb, use technical terms, name files/components
87
+ - Include: patterns, integration points, constraints
88
+ - Exclude: code snippets, line-by-line steps
89
+ - 2-3 acceptance criteria per sub-task
90
+
91
+ **Bounds**: ~3 phases, ~8 parent tasks max. If exceeds → suggest `/spectre:create_tasks`
92
+
93
+ - **Action** — ValidateCoverage: Verify all in-scope items have tasks; no out-of-scope tasks added
94
+
95
+ ## Step 6 - Document & Handoff
96
+
97
+ - **Action** — PresentSummary:
98
+ > **Task Plan Created**: `{path}`
99
+ > ✅ Scope | ✅ Research | ✅ Plan
100
+
101
+ - **Action** — RenderFooter: Use `@skill-spectre:spectre-guide` skill for Next Steps
@@ -0,0 +1,73 @@
1
+ ---
2
+ description: 👻 | Safe guided rebase w/conflict handling - primary agent
3
+ ---
4
+
5
+ # rebase: Safe Git Rebase with Automatic Conflict Resolution
6
+
7
+ ## Description
8
+ - **What** — Guide rebase with safety refs, automatic conflict resolution, test verification
9
+ - **Outcome** — Successfully rebased branch with resolved conflicts, passing tests, smoketest guide
10
+
11
+ ## ARGUMENTS Input
12
+
13
+ Optional target branch to rebase onto.
14
+
15
+ <ARGUMENTS>
16
+ $ARGUMENTS
17
+ </ARGUMENTS>
18
+
19
+ ## Instructions
20
+ - Auto-commit uncommitted changes (no confirmation)
21
+ - Auto-resolve conflicts favoring target branch conventions (no prompts)
22
+ - Track every resolution decision for summary
23
+ - Actually run tests, don't just suggest
24
+
25
+ ## Step 1 - Confirm Target Branch
26
+
27
+ - **Action** — CheckArguments:
28
+ - **If** ARGUMENTS has branch → proceed
29
+ - **Else** → ask: "What branch to rebase onto? (e.g., `origin/main`)"
30
+ - **Wait** — If needed
31
+
32
+ ## Step 2 - Prepare
33
+
34
+ - **Action** — EnsureCleanTree:
35
+ - **If** uncommitted changes → `git commit -am "chore: snapshot before rebase"`
36
+ - **Action** — FetchLatest: `git fetch origin`
37
+ - **Action** — CreateSafetyRef: `git branch backup/rebase-$(date +%Y%m%d-%H%M%S)`
38
+ - **Action** — AssessComplexity: Light (≤5 commits), Moderate (5-20), Large (>20)
39
+
40
+ ## Step 3 - Execute Rebase
41
+
42
+ - **Action** — StartRebase: `git rebase {target_branch}`
43
+ - **If** no conflicts → skip to Step 4
44
+
45
+ - **Action** — ResolveAllConflicts: For each conflict:
46
+ 1. Read conflict markers
47
+ 2. Resolve (favor target branch patterns)
48
+ 3. Track: `{file}: {decision} — {rationale}`
49
+ 4. `git add {file}`
50
+ 5. `git rebase --continue`
51
+ - Repeat until complete
52
+
53
+ ## Step 4 - Verify
54
+
55
+ - **Action** — RunLint: Fix violations
56
+ - **Action** — RunTestSuite: Detect command (npm test, pytest, cargo test, go test), run full suite
57
+ - **Action** — ValidateRebase: Confirm commit count, no unexpected changes
58
+
59
+ ## Step 5 - Summary
60
+
61
+ - **Action** — GenerateSummary:
62
+ > **Rebase Summary**
63
+ > - Branch: {current} → {target}
64
+ > - Commits: {count} | Conflicts: {count} | Tests: {PASS/FAIL}
65
+ >
66
+ > **Decisions**: | File | Decision | Rationale |
67
+ >
68
+ > **Smoketest Guide** (based on files touched):
69
+ > - {Feature Area}: [ ] {behavior to verify}
70
+ >
71
+ > **Safety**: Backup `{branch}` | Restore: `git reset --hard {backup}`
72
+
73
+ - **Action** — RenderFooter: Use `@skill-spectre:spectre-guide` skill for Next Steps
@@ -0,0 +1,5 @@
1
+ # /recall - Search Project Knowledge
2
+
3
+ Load the `spectre-recall` skill and follow its instructions.
4
+
5
+ **Search query**: $ARGUMENTS
@@ -0,0 +1,159 @@
1
+ ---
2
+ description: 👻 | Research codebase with parallel agents - primary agent
3
+ ---
4
+
5
+ # research_codebase: Parallel Evidence-Based Codebase Analysis
6
+
7
+ ## Description
8
+ - Description — Conduct comprehensive codebase research by spawning parallel specialized sub-agents and synthesizing their findings into structured documentation. Prioritizes direct readings of live code with specific file paths and line numbers. Supports follow-up questions with document updates.
9
+ - Desired Outcome — Complete research document with YAML frontmatter, concrete evidence (file paths/line numbers), architectural insights, GitHub permalinks (when applicable), saved to `TASK_DIR/research/{topic}_{date}.md`, ready for task formalization or planning.
10
+
11
+ ## ARGUMENTS Input
12
+
13
+ Optional user input to seed this workflow.
14
+
15
+ <ARGUMENTS>
16
+ $ARGUMENTS
17
+ </ARGUMENTS>
18
+
19
+ ## Step (1/8) - Immediate Reply & Gather Context
20
+
21
+ - **Action** — ImmediateReply: Respond immediately before running any commands or tools.
22
+ - Check for ARGUMENTS and extract research topic
23
+ - **If** ARGUMENTS exists → acknowledge topic; extract research question
24
+ - **Else** → prompt user: "I'm ready to research the codebase. Please provide your research question or area of interest, and I'll analyze it thoroughly by exploring relevant components and connections."
25
+ - **CRITICAL**: Do NOT run any tool calls in this step
26
+ - **Wait** — User provides research query (if needed)
27
+
28
+ ## Step (2/8) - Read Mentioned Files
29
+
30
+ - **Action** — ReadMentionedFiles: Read any directly mentioned files FULLY before decomposition.
31
+ - **If** user mentions specific files (tickets, docs, JSON) → read them FULLY using Read tool WITHOUT limit/offset
32
+ - **CRITICAL**: Read these files in main context before spawning sub-agents
33
+ - Ensures full context before decomposing research
34
+
35
+ ## Step (3/8) - Decompose & Plan Research
36
+
37
+ - **Action** — AnalyzeQuestion: Break down research query into composable areas.
38
+ - Ultrathink about underlying patterns, connections, architectural implications user seeking
39
+ - Identify specific components, patterns, concepts to investigate
40
+ - Consider relevant directories, files, architectural patterns
41
+ - Create research plan using TodoWrite to track all subtasks
42
+ - **Action** — SpawnSpecializedAgents: Launch parallel sub-agents for comprehensive research.
43
+ - **Codebase Research**:
44
+ - **finder**: Find WHERE files and components live
45
+ - **analyst**: Understand HOW specific code works
46
+ - **patterns**: Find examples of similar implementations
47
+ - **Web Research** (when task requires 3rd party frameworks/platforms/services/libraries/SDKs):
48
+ - **web-research**: External documentation and resources
49
+ - **IMPORTANT**: Instruct to return LINKS with findings; include links in final report
50
+ - **3rd Party Libraries** (only if user explicitly asks):
51
+ - Use Context 7 MCP tool to search external documentation
52
+ - **Linear Tickets** (if relevant):
53
+ - **linear-ticket-reader**: Get full details of specific ticket
54
+ - **linear-searcher**: Find related tickets or historical context
55
+ - **Agent Strategy**: Start with locator → use analyzer on promising findings → run multiple agents in parallel for different searches; each agent knows its job (tell what you're looking for, not how to search)
56
+
57
+ ## Step (4/8) - Synthesize Findings
58
+
59
+ - **Action** — WaitForAgents: Wait for ALL sub-agent tasks to complete before proceeding.
60
+ - **Action** — CompileResults: Synthesize all sub-agent results into coherent findings.
61
+ - Prioritize live codebase findings as primary source of truth
62
+ - Connect findings across different components
63
+ - Include specific file paths and line numbers for reference
64
+ - Highlight patterns, connections, architectural decisions
65
+ - Answer user's specific questions with concrete evidence
66
+ - **Action** — GatherMetadata: Collect document metadata for YAML frontmatter.
67
+ - Current date/time with timezone (ISO format)
68
+ - Current commit hash (`git rev-parse HEAD`)
69
+ - Current branch name (`git rev-parse --abbrev-ref HEAD`)
70
+ - Repository name
71
+
72
+ ## Step (5/8) - Generate Research Document
73
+
74
+ - **Output Location** — DetermineOutputDir: Decide where to save artifacts for this workflow.
75
+ - `branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)`
76
+ - **If** user specifies `target_dir/path` → `OUT_DIR={that value}`
77
+ - **Else** → `OUT_DIR=docs/tasks/{branch_name}`
78
+ - `mkdir -p "OUT_DIR/research"`
79
+ - **Action** — CreateDocument: Structure research document with YAML frontmatter and comprehensive findings.
80
+ - **Frontmatter** (YAML at top):
81
+ - date: [ISO format with timezone]
82
+ - git_commit: [commit hash]
83
+ - branch: [branch name]
84
+ - repository: [repo name]
85
+ - topic: "[User's Question/Topic]"
86
+ - tags: [research, codebase, relevant-component-names]
87
+ - status: complete
88
+ - last_updated: [YYYY-MM-DD]
89
+ - last_updated_by: [Researcher name]
90
+ - **Document Sections** (in order):
91
+ 1. Title: `# Research: [User's Question/Topic]`
92
+ 2. Metadata header (Date, Git Commit, Branch, Repository)
93
+ 3. Research Question (original user query)
94
+ 4. Summary (high-level findings answering question)
95
+ 5. Detailed Findings (by Component/Area with file:line references)
96
+ 6. Code References (path/to/file:line with descriptions)
97
+ 7. Architecture Insights (patterns, conventions, design decisions)
98
+ 8. Related Research (links to other research docs in `docs/` (look for /research directories))
99
+ 9. Open Questions (areas needing further investigation)
100
+
101
+ ## Step (6/8) - Add Permalinks & Save
102
+
103
+ - **Action** — AddGitHubPermalinks: Generate GitHub permalinks if applicable.
104
+ - Check if on main branch or commit pushed: `git branch --show-current` and `git status`
105
+ - **If** on main/master OR pushed → generate permalinks:
106
+ - Get repo info: `gh repo view --json owner,name`
107
+ - Create: `https://github.com/{owner}/{repo}/blob/{commit}/{file}#L{line}`
108
+ - Replace local file references with permalinks in document
109
+ - **Else** → keep local file references
110
+ - **Action** — SaveDocument: Save research document to standardized location under `{OUT_DIR}/research/`.
111
+ - Filename: `{research_topic}_{MMDDYY}.md`
112
+ - Path: `{OUT_DIR}/research/{filename}`
113
+ - **Action** — PresentFindings: Present concise summary to user.
114
+ - Concise summary of key findings
115
+ - Include key file references for easy navigation
116
+ - Ask if they have follow-up questions or need clarification
117
+
118
+ ## Step (7/8) - Handle Follow-ups & Handoff
119
+
120
+ - **Action** — HandleFollowUps: If user has follow-up questions, update same document.
121
+ - **If** follow-up questions asked:
122
+ - Update frontmatter: `last_updated`, `last_updated_by`, add `last_updated_note: "Added follow-up research for [brief description]"`
123
+ - Add new section: `## Follow-up Research [timestamp]`
124
+ - Spawn new sub-agents as needed for additional investigation
125
+ - Continue updating document
126
+ - **Else** → proceed to handoff
127
+ - **Action** — RenderFooter: Render Next Steps footer using `@skill-spectre:spectre-guide` skill (contains format template and spectre command options)
128
+
129
+ ## Next Steps
130
+
131
+ See `@skill-spectre:spectre-guide` skill for footer format and command options.
132
+
133
+ ## Success Criteria
134
+
135
+ - [ ] Immediate reply sent; research topic requested (Step 1 - no tool calls)
136
+ - [ ] User research query received
137
+ - [ ] Output directory determined inline (`OUT_DIR`) using branch name or user-specified path
138
+ - [ ] Directly mentioned files read FULLY in main context before decomposition
139
+ - [ ] Research question decomposed into composable areas with ultra-thinking about patterns/connections
140
+ - [ ] Research plan created using TodoWrite to track subtasks
141
+ - [ ] Specialized sub-agents spawned in parallel (finder, analyst, patterns, web-research as needed, linear agents if relevant)
142
+ - [ ] Agent strategy followed (locator → analyzer → parallel execution)
143
+ - [ ] Web research agents instructed to return LINKS (if used)
144
+ - [ ] ALL sub-agents completed before synthesis
145
+ - [ ] Findings compiled with live codebase prioritized as source of truth
146
+ - [ ] Results include specific file paths and line numbers
147
+ - [ ] Cross-component connections and patterns highlighted
148
+ - [ ] Concrete evidence provided for user's questions
149
+ - [ ] Metadata gathered for frontmatter (date/time ISO, commit hash, branch, repo name)
150
+ - [ ] Research document created with YAML frontmatter at top
151
+ - [ ] Frontmatter fields consistent (snake_case for multi-word: git_commit, last_updated)
152
+ - [ ] Document includes all 9 required sections in order
153
+ - [ ] GitHub permalinks generated if on main/master or pushed commit
154
+ - [ ] Local file references replaced with permalinks (when applicable)
155
+ - [ ] Document saved to `{OUT_DIR}/research/{topic}_{MMDDYY}.md`
156
+ - [ ] Concise findings summary presented to user with key file references
157
+ - [ ] Follow-up questions handled with document updates (frontmatter updated, new section added)
158
+
159
+ - [ ] Next steps guide read and relevant options sourced for footer
@@ -0,0 +1,119 @@
1
+ ---
2
+ description: 👻 | Interactively scope a feature or improvement, generating a complete Scope document that clarifies what's IN and OUT -- primary agent
3
+ ---
4
+ # scope: Interactive Feature Scoping
5
+
6
+ Collaborative workflow for structuring unstructured thoughts into clear scope boundaries through contextual brainstorming and targeted clarifications. Focuses on user value and scope boundaries before technical considerations. Output: comprehensive scope document with clear boundaries, user value, and key decisions saved to `{OUT_DIR}/concepts/scope.md`.
7
+
8
+ ## ARGUMENTS
9
+
10
+ &lt;ARGUMENTS&gt; $ARGUMENTS &lt;/ARGUMENTS&gt;
11
+
12
+ ## Step 1: Immediate Reply & Gather Context
13
+
14
+ - **Action** — ImmediateReply: Respond before any tools.
15
+ - **If** `FROM_KICKOFF=true` → acknowledge kickoff context, read `KICKOFF_DOC`, extract (Core Problem, User Value, Decisions Made, Remaining Ambiguities, Key Code Refs), **SKIP to Step 3**
16
+ - **Else If** ARGUMENTS empty → probe for context enthusiastically
17
+ - **Else** → proceed to Step 2
18
+ - **CRITICAL**: No tool calls except reading kickoff doc when FROM_KICKOFF=true
19
+
20
+ ## Step 2: Interactive Scope Exploration
21
+
22
+ **SKIP IF FROM_KICKOFF=true**
23
+
24
+ - **Action** — ExploreScope: Collaborative dialogue focused on boundaries and user experience.
25
+
26
+ **CRITICAL**: Focus on WHAT, not HOW. Defer all technical/implementation questions until scope boundaries are finalized. Only ask technical questions if the scope itself is inherently technical (e.g., "migrate database from X to Y").
27
+
28
+ **PATTERN**: Lead with a rich initial exploration. In your FIRST response, propose concrete hypotheses AND ask 5-8 questions across multiple dimensions. Give the user a full landscape to react to, not a single thread to follow.
29
+
30
+ **FIRST RESPONSE FORMAT**:
31
+
32
+ > Here's my initial read on this, plus questions to help us explore the bounds:
33
+ >
34
+ > **My hypothesis**: [problem statement, who it affects, proposed IN/OUT]
35
+ >
36
+ > **Questions to explore**:
37
+ > 1. [User problem question]
38
+ > 2. [UX flow question]
39
+ > 3. [Boundary edge question]
40
+ > 4. [Alternative approach question]
41
+ > 5. [Success criteria question]
42
+ > 6. [Edge case question]
43
+ > ...
44
+ >
45
+ > Answer any/all that spark thoughts. Skip what's obvious.
46
+
47
+ **Question types to include** (aim for 5-8 total, mix from these):
48
+
49
+ - **User & Problem**: Who feels this most? What triggers the need? What's the cost of not solving it?
50
+ - **UX & Feel**: Should this feel fast or thorough? Guided or flexible? What's the ideal flow?
51
+ - **Boundaries**: What about [adjacent thing]—IN or OUT? If unlimited time, what else? What's essential for v1?
52
+ - **Alternatives**: I could see this as [A] or [B]. Which direction?
53
+ - **Edge cases**: What happens when [unusual situation]? Should we handle [error state]?
54
+ - **Success**: What makes you say "this shipped well"? What's the one thing we can't get wrong?
55
+
56
+ **DO NOT ask about**: implementation approach, technical trade-offs, architecture, or integration details until boundaries are confirmed.
57
+
58
+ - **Action** — IterateBoundaries: After user responds, refine boundaries and ask targeted follow-ups on gaps.
59
+
60
+ > **Current Boundaries**: ✅ **IN**: \[list\] ❌ **OUT**: \[list\] ⚠️ **Unsure**: \[edge cases\]
61
+ >
62
+ > Any items to move? Add exclusions? Clarify edges? Reply 'looks good' to continue.
63
+
64
+ - **Wait** — User confirms Scope boundaries are accurate
65
+
66
+ ## Step 3: Generate Targeted Clarifications
67
+
68
+ - **Action** — DetermineOutputDir:
69
+
70
+ - **If** FROM_KICKOFF → use same dir as kickoff doc
71
+ - **Else** → `OUT_DIR = user_specified || docs/tasks/{branch_name}`
72
+ - `mkdir -p "$OUT_DIR"`
73
+
74
+ - **Action** — GenerateTargetedQuestions: Create 3-6 questions based ONLY on remaining scope ambiguities from Step 2 (or kickoff's "Remaining Ambiguities").
75
+
76
+ **CRITICAL**: Only ask about unresolved scope ambiguities. Technical questions (architecture, trade-offs, integration) belong in `/spectre:plan`, not here.
77
+
78
+ - **Action** — SaveClarifications: Create `{OUT_DIR}/clarifications/scope_clarifications_{timestamp}.md`:
79
+
80
+ - Header: concept name, confirmed boundaries so far
81
+ - Questions: Each focused on a scope edge case with `<response></response>` block
82
+
83
+ - **Action** — PromptUser: "Saved clarifications to `{path}`. Answer in `<response>` blocks. Reply 'Read it' when ready."
84
+
85
+ - **Wait** — User replies
86
+
87
+ - **Action** — ReadClarifications: Read file, use responses (proceed with assumptions if empty)
88
+
89
+ ## Step 4: Create Scope Document
90
+
91
+ - **Action** — CreateScopeDoc: Generate `{OUT_DIR}/concepts/scope.md` (use scoped filename if exists).
92
+
93
+ **Priority**: User value and boundaries BEFORE technical details.
94
+
95
+ **Sections**: The Problem (pain, impact, current state) → Target Users (primary, secondary, needs) → Success Criteria (outcomes, metrics) → User Experience (journeys, principles, trade-offs) → Scope Boundaries (in/out/maybe/future) → Constraints (platform, perf, a11y, scale) → Integration (touches, avoids, dependencies) → Decisions (from clarifications + rationale) → Risks (UX, scope creep, open questions) → Next Steps (`/spectre:plan` or `/spectre:create_tasks`, complexity S/M/L)
96
+
97
+ ## Step 5: Light Technical Context (Optional)
98
+
99
+ **Only if scope identifies specific technical/architecture integration points.**
100
+
101
+ - **Action** — IdentifyTouchpoints: Identify desired areas of research, and dispatch parallel @analyst subagents to research each area. Surface-level only (component names, NOT implementation). List features this interacts with, constraints worth documenting, areas to avoid.
102
+
103
+ - **Action** — UpdateScopeDoc: Add findings to Integration & Constraints sections if relevant.
104
+
105
+ ## Step 6: Final Review & Next Steps
106
+
107
+ - **Action** — PresentDocForReview: Show final boundaries and next steps together.
108
+
109
+ > **Scope Complete**: `{OUT_DIR}/concepts/scope.md`
110
+ >
111
+ > **Final Boundaries**: ✅ **IN**: \[from doc\] ❌ **OUT**: \[from doc\] ⚠️ **Maybe/Future**: \[from doc\]
112
+ >
113
+ > Docs saved: `{OUT_DIR}/concepts/scope.md`, `{OUT_DIR}/clarifications/scope_clarifications_{timestamp}.md`
114
+ >
115
+ > Reply with any edits, updates, or clarifications — otherwise pick a next step:
116
+
117
+ - **Action** — RenderFooter: Render Next Steps using `@skill-spectre:spectre-guide` skill.
118
+
119
+ > **NOTE**: Do NOT wait for explicit approval. Present next steps immediately inline with the review. User can reply with scope edits OR jump straight into a next step command. If user replies with edits, apply them to the scope doc and re-present.
@@ -0,0 +1,172 @@
1
+ ---
2
+ description: 👻 | Autonomous end-to-end: brain dump -> scope -> TDD -> commit -> rebase -> PR
3
+ ---
4
+ # ship: Autonomous End-to-End Delivery
5
+
6
+ Take a brain dump and autonomously produce a reviewable PR. Zero confirmation gates — scope, implement with TDD, sweep, rebase, and open a PR.
7
+
8
+ **Execution Style**: Fully autonomous. No user approval gates. Parse intent, build it, ship the PR.
9
+
10
+ ## ARGUMENTS
11
+
12
+ &lt;ARGUMENTS&gt; $ARGUMENTS &lt;/ARGUMENTS&gt;
13
+
14
+ ## Step (1/8) - Parse Context
15
+
16
+ - **Action** — ParseBrainDump: Extract from ARGUMENTS:
17
+ - `INTENT_TYPE`: `feat` or `fix` (infer from context — new behavior = feat, broken behavior = fix)
18
+ - `TARGET_BRANCH`: Extract if specified (e.g., "rebase onto develop"), default `origin/main`
19
+ - `SCOPE_SUMMARY`: 1-2 sentence distillation of what to build/fix
20
+ - `RELEVANT_FILES`: Any files, components, or areas mentioned
21
+ - `CONTEXT`: Remaining context, constraints, preferences
22
+ - **Action** — ValidateInput:
23
+ - **If** ARGUMENTS empty → ask user for brain dump, then proceed autonomously
24
+ - **Else** → proceed
25
+
26
+ ## Step (2/8) - Ensure Worktree
27
+
28
+ - **Action** — DetectBranch: `git rev-parse --abbrev-ref HEAD`
29
+ - **If** already in a worktree or on a non-main branch (not `main`, not `master`) → use current context, proceed
30
+ - **If** on `main` or `master` → use `EnterWorktree` to create an isolated worktree
31
+ - **Action** — SetBranchName: Capture current branch name as `BRANCH_NAME` for artifact paths
32
+
33
+ ## Step (3/8) - Quick Scope
34
+
35
+ - **Action** — DispatchResearch: Spawn parallel lightweight agents:
36
+
37
+ - `@spectre:finder` — Locate files related to `RELEVANT_FILES` and `SCOPE_SUMMARY`
38
+ - `@spectre:analyst` — Understand the relevant code area, key interfaces, existing patterns
39
+
40
+ - **Action** — WriteScopeDoc: Create `docs/tasks/{BRANCH_NAME}/concepts/scope.md`:
41
+
42
+ ```markdown
43
+ # Scope: {SCOPE_SUMMARY}
44
+
45
+ ## Objective
46
+ {1-2 sentences from brain dump}
47
+
48
+ ## Type
49
+ {feat or fix}
50
+
51
+ ## In Scope
52
+ - {bullet list of what will be done}
53
+
54
+ ## Out of Scope
55
+ - {what this explicitly won't touch}
56
+
57
+ ## Target Branch
58
+ {TARGET_BRANCH}
59
+
60
+ ## Key Files
61
+ {from research — relevant files and their roles}
62
+ ```
63
+
64
+ Keep it \~20 lines. This is a lightweight scope, not full `/spectre:scope`.
65
+
66
+ ## Step (4/8) - Create Tasks
67
+
68
+ - **Action** — CreateTasks: Use `TaskCreate` to create 3-8 tasks proportional to scope complexity.
69
+ - Each task gets: clear `subject` (imperative), `description` (what to do + acceptance criteria), `activeForm` (present continuous)
70
+ - Order tasks by dependency — foundational work first
71
+ - Tasks are ephemeral and operational — no file artifact needed
72
+
73
+ ## Step (5/8) - Execute with TDD
74
+
75
+ - **Action** — ExecuteLoop: For each task sequentially:
76
+
77
+ 1. `TaskUpdate` → `in_progress`
78
+ 2. Load `@skill-spectre:spectre-tdd` for TDD methodology
79
+ 3. Execute: RED (write failing test) → GREEN (minimal implementation) → REFACTOR (clean up)
80
+ 4. Commit with conventional format: `{INTENT_TYPE}({scope}): {description}`
81
+ 5. `TaskUpdate` → `completed`
82
+
83
+ **Rules**:
84
+
85
+ - One commit per task minimum
86
+ - Conventional commit format always
87
+ - TDD methodology for implementation tasks (skip for config/doc-only tasks)
88
+ - If a task reveals new work, create additional tasks rather than scope-creeping the current one
89
+
90
+ ## Step (6/8) - Sweep
91
+
92
+ Inline sweep — same checklist as `/spectre:sweep`, no subagents:
93
+
94
+ ### 6.1 Diff Sanity Check
95
+
96
+ - Review full diff for unintentional changes (whitespace-only edits, merge artifacts)
97
+ - Verify no accidentally staged files outside the intended scope
98
+ - Confirm no secrets, API keys, credentials, or sensitive data in diff
99
+
100
+ ### 6.2 Logging Audit
101
+
102
+ - Remove temporary/debug logging (console.log, print, debug flags)
103
+ - Preserve intentional logs: errors, critical warnings, key state transitions
104
+ - Verify log levels are appropriate for production context
105
+
106
+ ### 6.3 Code Hygiene
107
+
108
+ - Remove commented-out code (it's in git history if needed)
109
+ - Resolve or document any TODO/FIXME/HACK introduced in this session
110
+ - Remove hardcoded test values that should be config/env
111
+
112
+ ### 6.4 Opportunistic Dead Code Cleanup
113
+
114
+ - Orphaned imports with no usage in the file
115
+ - Unused variables or functions declared but never referenced
116
+ - Debug artifacts (debugger statements, leftover TODO/FIXME from this work)
117
+
118
+ ### 6.5 Lint (Strict)
119
+
120
+ - Run the project linter and **fix all violations** — no skipping, no eslint-disable
121
+ - Address structural lint issues by refactoring, not suppressing
122
+
123
+ ### 6.6 Test
124
+
125
+ - Run affected tests + full test suite
126
+ - Fix any failures caused by the changes
127
+ - Do NOT write new tests here — that was done in Step 5
128
+
129
+ ### 6.7 Commit Sweep Fixes
130
+
131
+ - If sweep produced changes, commit: `chore({scope}): sweep cleanup`
132
+
133
+ ## Step (7/8) - Rebase
134
+
135
+ - **Action** — FetchLatest: `git fetch origin`
136
+ - **Action** — CreateSafetyRef: `git branch backup/ship-$(date +%Y%m%d-%H%M%S)`
137
+ - **Action** — Rebase: `git rebase {TARGET_BRANCH}`
138
+ - **If** conflicts → resolve automatically, favoring target branch conventions
139
+ - Track resolution decisions for PR summary
140
+ - **Action** — VerifyPostRebase:
141
+ - Run linter — fix violations
142
+ - Run full test suite — fix failures
143
+ - Confirm commit count and no unexpected changes
144
+
145
+ ## Step (8/8) - Create PR
146
+
147
+ - **Action** — PushBranch: `git push -u origin {BRANCH_NAME}`
148
+
149
+ - **Action** — CreatePR: `gh pr create` with:
150
+
151
+ **Title**: `{INTENT_TYPE}({scope}): {SCOPE_SUMMARY}` (under 70 chars)
152
+
153
+ **Body**:
154
+
155
+ ```markdown
156
+ ## Summary
157
+ {From scope doc — objective and what was done}
158
+
159
+ ## Changes
160
+ {Bulleted list derived from completed tasks}
161
+
162
+ ## Test Plan
163
+ {Bulleted checklist — what was tested, what to verify manually}
164
+
165
+ Shipped autonomously via `/spectre:ship`
166
+ ```
167
+
168
+ - **Action** — OutputPRUrl: Display the PR URL as the final deliverable
169
+
170
+ ## Next Steps
171
+
172
+ Use `@skill-spectre:spectre-guide` skill to render the Next Steps footer.