arcane-cli 0.14.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.
- package/LICENSE +21 -0
- package/README.md +253 -0
- package/dist/assets/.arcane/agents/agent-policies-template.md +414 -0
- package/dist/assets/.arcane/governance/agent-approved-paths.md +60 -0
- package/dist/assets/.arcane/governance/agent-policies.md +414 -0
- package/dist/assets/.arcane/governance/agent-work-queue-model.md +61 -0
- package/dist/assets/.arcane/governance/authentication-strategy.md +220 -0
- package/dist/assets/.arcane/governance/cicd-standards.md +227 -0
- package/dist/assets/.arcane/governance/decision-documentation-standard.md +335 -0
- package/dist/assets/.arcane/governance/development-methodology.md +384 -0
- package/dist/assets/.arcane/governance/git-conventions.md +759 -0
- package/dist/assets/.arcane/governance/hardening-checklist.md +117 -0
- package/dist/assets/.arcane/governance/naming-conventions.md +142 -0
- package/dist/assets/.arcane/governance/new-business-setup.md +182 -0
- package/dist/assets/.arcane/governance/poc-management-pattern.md +190 -0
- package/dist/assets/.arcane/governance/portable-bootstrap.md +101 -0
- package/dist/assets/.arcane/governance/product-excellence-standards.md +211 -0
- package/dist/assets/.arcane/governance/rca-process-standard.md +157 -0
- package/dist/assets/.arcane/governance/spell-authoring-standards.md +129 -0
- package/dist/assets/.arcane/governance/testing-standards.md +158 -0
- package/dist/assets/.arcane/governance/threat-model.md +104 -0
- package/dist/assets/.arcane/governance/universal-agent-rules.md +108 -0
- package/dist/assets/.arcane/image-prompts/adelaide-image-prompt.md +140 -0
- package/dist/assets/.arcane/image-prompts/alexander-image-prompt.md +138 -0
- package/dist/assets/.arcane/image-prompts/bess-image-prompt.md +139 -0
- package/dist/assets/.arcane/image-prompts/circe-image-prompt.md +143 -0
- package/dist/assets/.arcane/image-prompts/custodio-image-prompt.md +140 -0
- package/dist/assets/.arcane/image-prompts/iris-image-prompt.md +139 -0
- package/dist/assets/.arcane/image-prompts/kellar-image-prompt.md +141 -0
- package/dist/assets/.arcane/image-prompts/lafayette-image-prompt.md +140 -0
- package/dist/assets/.arcane/image-prompts/lince-image-prompt.md +142 -0
- package/dist/assets/.arcane/image-prompts/mercurio-image-prompt.md +140 -0
- package/dist/assets/.arcane/image-prompts/merlin-image-prompt.md +139 -0
- package/dist/assets/.arcane/image-prompts/prospero-image-prompt.md +141 -0
- package/dist/assets/.arcane/templates/venture-template/overview.md +66 -0
- package/dist/assets/.claude/commands/spell-address-review.md +9 -0
- package/dist/assets/.claude/commands/spell-arcane-version.md +9 -0
- package/dist/assets/.claude/commands/spell-architect.md +9 -0
- package/dist/assets/.claude/commands/spell-bootstrap-business.md +9 -0
- package/dist/assets/.claude/commands/spell-brainstorm.md +9 -0
- package/dist/assets/.claude/commands/spell-bug.md +9 -0
- package/dist/assets/.claude/commands/spell-bump.md +9 -0
- package/dist/assets/.claude/commands/spell-check-drift.md +9 -0
- package/dist/assets/.claude/commands/spell-close-session.md +9 -0
- package/dist/assets/.claude/commands/spell-commit-work.md +9 -0
- package/dist/assets/.claude/commands/spell-create-pull-request.md +9 -0
- package/dist/assets/.claude/commands/spell-document.md +9 -0
- package/dist/assets/.claude/commands/spell-dotnet-expert.md +9 -0
- package/dist/assets/.claude/commands/spell-eas-ios-deploy.md +9 -0
- package/dist/assets/.claude/commands/spell-enchant.md +9 -0
- package/dist/assets/.claude/commands/spell-explain-concept.md +9 -0
- package/dist/assets/.claude/commands/spell-feedback.md +9 -0
- package/dist/assets/.claude/commands/spell-full-cycle.md +9 -0
- package/dist/assets/.claude/commands/spell-generate-bot-icons.md +9 -0
- package/dist/assets/.claude/commands/spell-implement.md +9 -0
- package/dist/assets/.claude/commands/spell-open-session.md +9 -0
- package/dist/assets/.claude/commands/spell-plan.md +9 -0
- package/dist/assets/.claude/commands/spell-present-arcane.md +9 -0
- package/dist/assets/.claude/commands/spell-product-review.md +9 -0
- package/dist/assets/.claude/commands/spell-review-batch.md +9 -0
- package/dist/assets/.claude/commands/spell-review.md +9 -0
- package/dist/assets/.claude/commands/spell-save-idea.md +9 -0
- package/dist/assets/.claude/commands/spell-scope.md +9 -0
- package/dist/assets/.claude/commands/spell-security-review.md +9 -0
- package/dist/assets/.claude/commands/spell-ship.md +9 -0
- package/dist/assets/.claude/commands/spell-status.md +9 -0
- package/dist/assets/.claude/commands/spell-suggest-feature.md +9 -0
- package/dist/assets/.claude/commands/spell-test.md +9 -0
- package/dist/assets/.claude/commands/spell-todo.md +9 -0
- package/dist/assets/.github/agents/adelaide.agent.md +44 -0
- package/dist/assets/.github/agents/alexander.agent.md +43 -0
- package/dist/assets/.github/agents/bess.agent.md +42 -0
- package/dist/assets/.github/agents/circe.agent.md +43 -0
- package/dist/assets/.github/agents/custodio.agent.md +44 -0
- package/dist/assets/.github/agents/iris.agent.md +43 -0
- package/dist/assets/.github/agents/kellar.agent.md +43 -0
- package/dist/assets/.github/agents/lafayette.agent.md +42 -0
- package/dist/assets/.github/agents/lince.agent.md +43 -0
- package/dist/assets/.github/agents/mercurio.agent.md +43 -0
- package/dist/assets/.github/agents/merlin.agent.md +44 -0
- package/dist/assets/.github/agents/prospero.agent.md +43 -0
- package/dist/assets/.github/instructions/agent-output.instructions.md +48 -0
- package/dist/assets/.github/prompts/spell-address-review.prompt.md +114 -0
- package/dist/assets/.github/prompts/spell-arcane-version.prompt.md +82 -0
- package/dist/assets/.github/prompts/spell-architect.prompt.md +116 -0
- package/dist/assets/.github/prompts/spell-bootstrap-business.prompt.md +73 -0
- package/dist/assets/.github/prompts/spell-brainstorm.prompt.md +124 -0
- package/dist/assets/.github/prompts/spell-bug.prompt.md +109 -0
- package/dist/assets/.github/prompts/spell-bump.prompt.md +73 -0
- package/dist/assets/.github/prompts/spell-check-drift.prompt.md +97 -0
- package/dist/assets/.github/prompts/spell-close-session.prompt.md +189 -0
- package/dist/assets/.github/prompts/spell-commit-work.prompt.md +211 -0
- package/dist/assets/.github/prompts/spell-create-pull-request.prompt.md +170 -0
- package/dist/assets/.github/prompts/spell-document.prompt.md +83 -0
- package/dist/assets/.github/prompts/spell-dotnet-expert.prompt.md +117 -0
- package/dist/assets/.github/prompts/spell-eas-ios-deploy.prompt.md +183 -0
- package/dist/assets/.github/prompts/spell-enchant.prompt.md +385 -0
- package/dist/assets/.github/prompts/spell-explain-concept.prompt.md +69 -0
- package/dist/assets/.github/prompts/spell-feedback.prompt.md +113 -0
- package/dist/assets/.github/prompts/spell-full-cycle.prompt.md +201 -0
- package/dist/assets/.github/prompts/spell-generate-bot-icons.prompt.md +84 -0
- package/dist/assets/.github/prompts/spell-implement.prompt.md +101 -0
- package/dist/assets/.github/prompts/spell-open-session.prompt.md +116 -0
- package/dist/assets/.github/prompts/spell-plan.prompt.md +145 -0
- package/dist/assets/.github/prompts/spell-present-arcane.prompt.md +188 -0
- package/dist/assets/.github/prompts/spell-product-review.prompt.md +97 -0
- package/dist/assets/.github/prompts/spell-review-batch.prompt.md +94 -0
- package/dist/assets/.github/prompts/spell-review.prompt.md +131 -0
- package/dist/assets/.github/prompts/spell-save-idea.prompt.md +83 -0
- package/dist/assets/.github/prompts/spell-scope.prompt.md +263 -0
- package/dist/assets/.github/prompts/spell-security-review.prompt.md +129 -0
- package/dist/assets/.github/prompts/spell-ship.prompt.md +104 -0
- package/dist/assets/.github/prompts/spell-status.prompt.md +85 -0
- package/dist/assets/.github/prompts/spell-suggest-feature.prompt.md +110 -0
- package/dist/assets/.github/prompts/spell-test.prompt.md +87 -0
- package/dist/assets/.github/prompts/spell-todo.prompt.md +126 -0
- package/dist/assets/DECISIONS.md +19 -0
- package/dist/assets/TODO.md +7 -0
- package/dist/assets/agents/architecture-lead.yaml +61 -0
- package/dist/assets/agents/collaborator.yaml +59 -0
- package/dist/assets/agents/devops.yaml +60 -0
- package/dist/assets/agents/frontend-dev.yaml +60 -0
- package/dist/assets/agents/fullstack-dev.yaml +59 -0
- package/dist/assets/agents/marketing-strategist.yaml +60 -0
- package/dist/assets/agents/mobile-dev.yaml +59 -0
- package/dist/assets/agents/operations-comms.yaml +58 -0
- package/dist/assets/agents/orchestrator.yaml +60 -0
- package/dist/assets/agents/qa-lead.yaml +60 -0
- package/dist/assets/agents/research-analyst.yaml +59 -0
- package/dist/assets/agents/security-ops.yaml +61 -0
- package/dist/assets/ai-context/system-prompt-context.md +32 -0
- package/dist/assets/journal/.gitkeep +0 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +2313 -0
- package/dist/index.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Spell — Scope
|
|
3
|
+
description: Analyze a large PRD — scope it, split into epics, check architecture and security implications, estimate effort, and produce an execution plan with agent assignments
|
|
4
|
+
argument-hint: "Path to PRD or paste PRD content (e.g., 'Analyze PRD.md for {BUSINESS_NAME} mobile app')"
|
|
5
|
+
agent: agent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Executive Summary
|
|
9
|
+
|
|
10
|
+
- This spell takes a PRD of any size and produces an actionable execution plan.
|
|
11
|
+
- It assesses scope, splits into sprint-sized epics, identifies architecture/security decisions needed, and maps agents to work.
|
|
12
|
+
- Use this before `spell-architect` when the PRD is too large for a single Spell Loop cycle. (Formerly `spell-assess`.)
|
|
13
|
+
- Output: `execution-plan.md` — ordered epics with dependency graph, risk flags, ADR candidates, and agent assignments.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Analyze the provided PRD and produce a scoped execution plan.
|
|
18
|
+
|
|
19
|
+
Use these files for context. Each is optional — if a file is missing, proceed with the stated fallback and note the gap in the output's Open Questions:
|
|
20
|
+
|
|
21
|
+
- [governance/development-methodology.md](../../governance/development-methodology.md) — Spell Loop methodology, story sizing rules, and the canonical **ADO Hierarchy Rules**. *Fallback: if missing, use the default sizing of 4–8 right-sized stories per cycle described below and skip external-tracker hierarchy mapping.*
|
|
22
|
+
- [governance/testing-standards.md](../../governance/testing-standards.md) — Testing frameworks per stack. *Fallback: if missing, flag test strategy as an open question.*
|
|
23
|
+
- [governance/cicd-standards.md](../../governance/cicd-standards.md) — Pipeline requirements. *Fallback: if missing, omit pipeline considerations.*
|
|
24
|
+
- [DECISIONS.md](../../DECISIONS.md) — Existing ADRs to check against. *Fallback: if missing, treat all architecture decisions as new candidates.*
|
|
25
|
+
- [security/threat-model.md](../../security/threat-model.md) — Active threat model. *Fallback: if missing, apply OWASP Top 10 as the baseline.*
|
|
26
|
+
- [agents/agent-policies.md](../../agents/agent-policies.md) — Agent roster, power levels, capabilities. *Fallback: if missing, assign work by role label (architecture, backend, frontend, mobile, QA, DevOps, research) instead of named personas.*
|
|
27
|
+
- [naming-conventions.md](../../naming-conventions.md) — Agent roster and role-to-persona mapping. *Fallback: if missing, refer to roles by their generic label.*
|
|
28
|
+
- [project.md](../../project.md) — Project goals and business context. *Fallback: if missing, derive context from the PRD itself.*
|
|
29
|
+
- [governance/product-excellence-standards.md](../../governance/product-excellence-standards.md) — PRD Quality Scorecard and scoring rubric. *Fallback: if missing, skip the Quality Quick-Check (section 1.5) and note that it was skipped.*
|
|
30
|
+
|
|
31
|
+
> **Roster by reference.** This spell maps work to **roles** (architecture, backend, frontend, mobile, QA, DevOps, research, marketing). Resolve each role to a concrete agent persona via `agents/agent-policies.md` / `naming-conventions.md` at run time — do not assume a fixed set of persona names.
|
|
32
|
+
|
|
33
|
+
> **Placeholder resolution.** `{ADO_ORG}`, `{ADO_PROJECT}`, `{BUSINESS_NAME}`, and any other `{UPPER_SNAKE}` token resolve from `.arcane.json` or the PRD frontmatter; if a value is unset, ask rather than assuming a default.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Workflow
|
|
38
|
+
|
|
39
|
+
### 1. PRD Intake
|
|
40
|
+
|
|
41
|
+
Accept the PRD from one of these input sources:
|
|
42
|
+
|
|
43
|
+
| Source | Format | How to fetch |
|
|
44
|
+
|--------|--------|--------------|
|
|
45
|
+
| **File path** | `PRD.md` or any markdown file | Read the file directly |
|
|
46
|
+
| **Pasted content** | Inline text in the prompt | Use as-is |
|
|
47
|
+
| **External tracker work item ID** (external mode) | `#507` or `507` with org name | Detect the provider (see tracking settings below) and fetch the item's title, description, and acceptance criteria via that provider's CLI/API. For ADO: `az boards work-item show --id {id} --org https://dev.azure.com/{ADO_ORG} --output json` and extract `System.Description`, `Microsoft.VSTS.Common.AcceptanceCriteria`, and `System.Title` |
|
|
48
|
+
|
|
49
|
+
If the input is an external work item ID:
|
|
50
|
+
1. Confirm the org/account: `{ADO_ORG}` — resolve from `.arcane.json` / PRD frontmatter; ask if unset.
|
|
51
|
+
2. Fetch the item via the detected provider (for ADO: `az boards work-item show`).
|
|
52
|
+
3. If the work item has child items, fetch those too — they may contain additional requirements.
|
|
53
|
+
4. Combine all content into a single PRD view before proceeding.
|
|
54
|
+
|
|
55
|
+
Resolve tracking settings from PRD frontmatter (preferred) or ask:
|
|
56
|
+
- `tracking_mode: internal | external`
|
|
57
|
+
- `external_provider: ado | jira | other`
|
|
58
|
+
|
|
59
|
+
If unset and ADO context already exists, default to `external` + `ado` for backward compatibility.
|
|
60
|
+
|
|
61
|
+
If `tracking_mode=external` and `external_provider=ado`, resolve template/type availability before splitting epics (resolve `{ADO_ORG}` / `{ADO_PROJECT}` from `.arcane.json` / PRD frontmatter; ask if unset):
|
|
62
|
+
```bash
|
|
63
|
+
az devops project show --org https://dev.azure.com/{ADO_ORG} --project {ADO_PROJECT} --query "capabilities.processTemplate.templateName" --output tsv
|
|
64
|
+
az boards work-item-type list --org https://dev.azure.com/{ADO_ORG} --project {ADO_PROJECT} --output json --query "[].name"
|
|
65
|
+
```
|
|
66
|
+
For non-ADO providers, detect the provider from `external_provider` and resolve its equivalent item types instead.
|
|
67
|
+
|
|
68
|
+
Read the full PRD. Extract:
|
|
69
|
+
- **Feature name** and business context
|
|
70
|
+
- **Target repo** and tech stack
|
|
71
|
+
- **Total requirement count** (Must Have / Should Have / Won't Have)
|
|
72
|
+
- **Total acceptance criteria count**
|
|
73
|
+
- **Dependencies** on external services, APIs, or decisions
|
|
74
|
+
|
|
75
|
+
### 1.5. Quality Quick-Check
|
|
76
|
+
|
|
77
|
+
Before proceeding to scope assessment, run a quick quality audit against the PRD Quality Scorecard in `governance/product-excellence-standards.md`. Score each dimension (Requirements, UX, Accessibility, Performance, Security, Responsive, Competitive) as Bronze / Silver / Gold.
|
|
78
|
+
|
|
79
|
+
If any dimension scores **Bronze**, recommend:
|
|
80
|
+
> 💡 **Quality recommendation:** This PRD scores Bronze on [dimensions]. Consider running `spell-enchant` to enhance the PRD before continuing with assessment and architecture. `spell-enchant` will conduct competitive research (research role) and marketing review (marketing role), and proactively add missing quality requirements.
|
|
81
|
+
|
|
82
|
+
This is a recommendation, not a gate — the user decides whether to enchant first or proceed directly. Include the scorecard results in the execution plan output regardless.
|
|
83
|
+
|
|
84
|
+
### 2. Scope Assessment
|
|
85
|
+
|
|
86
|
+
Evaluate the PRD against Spell Loop sizing rules:
|
|
87
|
+
- Each Spell Loop cycle = **1-2 weeks of agent work** = **4-8 right-sized stories**
|
|
88
|
+
- A right-sized story: one file change, one endpoint, one component, one migration
|
|
89
|
+
- Flag anything that violates story sizing: "Build the entire dashboard", "Add authentication", "Refactor the API layer"
|
|
90
|
+
|
|
91
|
+
Classify the PRD:
|
|
92
|
+
|
|
93
|
+
| Classification | Criteria | Action |
|
|
94
|
+
|---------------|----------|--------|
|
|
95
|
+
| **Single cycle** | ≤ 8 stories, no cross-cutting concerns | Proceed directly to `spell-architect` |
|
|
96
|
+
| **Multi-cycle** | 9-30 stories, clear epic boundaries | Split into epics, each gets its own Spell Loop run |
|
|
97
|
+
| **Program-scale** | 30+ stories, multiple subsystems, cross-team concerns | Split into phases with milestone gates between them |
|
|
98
|
+
|
|
99
|
+
### 3. Epic Splitting (if multi-cycle or program-scale)
|
|
100
|
+
|
|
101
|
+
Break the PRD into epics. Each epic must be:
|
|
102
|
+
- **Self-contained** — shippable independently (no half-built features)
|
|
103
|
+
- **Sprint-sized** — 4-8 stories per epic
|
|
104
|
+
- **Dependency-ordered** — infrastructure before API before UI before polish
|
|
105
|
+
|
|
106
|
+
For each epic, define:
|
|
107
|
+
```markdown
|
|
108
|
+
### Epic N: [Name]
|
|
109
|
+
**Stories (estimated):** [count]
|
|
110
|
+
**Dependencies:** [prior epics or external]
|
|
111
|
+
**Tech stack:** [frameworks, platforms]
|
|
112
|
+
**Primary role:** [backend / frontend / mobile / full-stack — resolve to a persona via `agent-policies` / `naming-conventions`]
|
|
113
|
+
**Risk level:** Low / Medium / High
|
|
114
|
+
**Sprint estimate:** [1 or 2 cycles]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 3.5. External Tracker Mapping (external mode)
|
|
118
|
+
|
|
119
|
+
Only applies when `tracking_mode=external`. Skip entirely for internal mode.
|
|
120
|
+
|
|
121
|
+
Do **not** inline the work-item-type fallback order or the parent/child linkage rules here — they are the single source of truth in [governance/development-methodology.md](../../governance/development-methodology.md) → **Process-Template-Aware ADO Hierarchy Rules**. Detect the provider from `external_provider`, then apply those rules. *Fallback: if that doc is missing, record the tracker mapping as an Open Question and proceed without item-type assignment.*
|
|
122
|
+
|
|
123
|
+
Scope-specific delta (the only thing this spell adds on top of those rules): each split **epic** maps to the **Epic-level** logical level — use the `Epic` work item type whenever the resolved provider/template offers it, and record the selected type per epic in `execution-plan.md`. All lower-level and linkage decisions defer to the governance rules above.
|
|
124
|
+
|
|
125
|
+
### 4. Architecture Decision Check
|
|
126
|
+
|
|
127
|
+
Scan the PRD for decisions that need ADRs:
|
|
128
|
+
- New frameworks or libraries not already in the stack
|
|
129
|
+
- New external service integrations (APIs, databases, auth providers)
|
|
130
|
+
- Data model changes that affect multiple subsystems
|
|
131
|
+
- Deployment topology changes
|
|
132
|
+
- New communication patterns (sync vs async, REST vs gRPC vs events)
|
|
133
|
+
|
|
134
|
+
For each candidate:
|
|
135
|
+
```markdown
|
|
136
|
+
#### ADR Candidate: [Title]
|
|
137
|
+
**Trigger:** [What in the PRD requires this decision]
|
|
138
|
+
**Options:** [2-3 alternatives]
|
|
139
|
+
**Recommendation:** [If obvious, state it; otherwise flag for the architecture role]
|
|
140
|
+
**Blocking:** [Which epics are blocked until this is decided]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 5. Security Review
|
|
144
|
+
|
|
145
|
+
Check the PRD against the threat model:
|
|
146
|
+
- Does this feature introduce new attack surface? (new endpoints, new auth flows, new data stores)
|
|
147
|
+
- Does it handle PII, payment data, or secrets?
|
|
148
|
+
- Does it change trust boundaries? (new external integrations, new user roles)
|
|
149
|
+
- Are there OWASP Top 10 concerns? (injection points, auth gaps, data exposure)
|
|
150
|
+
|
|
151
|
+
For each concern:
|
|
152
|
+
```markdown
|
|
153
|
+
#### Security Flag: [Title]
|
|
154
|
+
**Threat:** [What could go wrong]
|
|
155
|
+
**Mitigation required:** [What the implementation must include]
|
|
156
|
+
**Blocking:** [yes/no — can the epic proceed without resolving this?]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### 6. Agent Assignment
|
|
160
|
+
|
|
161
|
+
Map each epic to the right **role**, then resolve each role to a concrete agent persona via `agents/agent-policies.md` / `naming-conventions.md` (fallback: keep the generic role label if the roster files are absent):
|
|
162
|
+
|
|
163
|
+
| Role | When |
|
|
164
|
+
|------|------|
|
|
165
|
+
| Architecture | ADR candidates, cross-epic design decisions |
|
|
166
|
+
| Backend / Full-stack | APIs, databases, server-side logic |
|
|
167
|
+
| Frontend / UI | Web UI, component frameworks |
|
|
168
|
+
| Mobile | Native/cross-platform mobile apps |
|
|
169
|
+
| QA | Test strategy, coverage validation |
|
|
170
|
+
| DevOps | Pipeline creation, deployment config |
|
|
171
|
+
| Research | Unknowns, technology evaluation, competitive analysis |
|
|
172
|
+
| Marketing | User-facing copy, landing pages, SEO |
|
|
173
|
+
|
|
174
|
+
Flag any epics that need **multiple roles** (e.g., a full-stack feature = backend + frontend + QA).
|
|
175
|
+
|
|
176
|
+
### 7. Dependency Graph
|
|
177
|
+
|
|
178
|
+
Produce a Mermaid diagram showing epic execution order:
|
|
179
|
+
|
|
180
|
+
```mermaid
|
|
181
|
+
flowchart LR
|
|
182
|
+
E1[Epic 1: Infrastructure] --> E2[Epic 2: API Layer]
|
|
183
|
+
E2 --> E3[Epic 3: Web UI]
|
|
184
|
+
E2 --> E4[Epic 4: Mobile App]
|
|
185
|
+
E3 --> E5[Epic 5: Integration Tests]
|
|
186
|
+
E4 --> E5
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Identify:
|
|
190
|
+
- **Critical path** — the longest dependency chain
|
|
191
|
+
- **Parallelizable epics** — epics that can run simultaneously on different branches
|
|
192
|
+
- **Milestone gates** — points where human review is needed before continuing
|
|
193
|
+
|
|
194
|
+
### 8. Execution Plan Output
|
|
195
|
+
|
|
196
|
+
Produce `execution-plan.md` with this structure:
|
|
197
|
+
|
|
198
|
+
```markdown
|
|
199
|
+
# Execution Plan: [Feature Name]
|
|
200
|
+
|
|
201
|
+
## PRD Summary
|
|
202
|
+
- **Source:** [PRD file or inline]
|
|
203
|
+
- **Business:** [which business]
|
|
204
|
+
- **Target repo:** [org/repo]
|
|
205
|
+
- **Classification:** Single cycle / Multi-cycle / Program-scale
|
|
206
|
+
- **Total epics:** [N]
|
|
207
|
+
- **Total estimated stories:** [N]
|
|
208
|
+
- **ADR candidates:** [N]
|
|
209
|
+
- **Security flags:** [N]
|
|
210
|
+
|
|
211
|
+
## Dependency Graph
|
|
212
|
+
[Mermaid diagram]
|
|
213
|
+
|
|
214
|
+
## Epics
|
|
215
|
+
|
|
216
|
+
### Epic 1: [Name]
|
|
217
|
+
- **Stories:** [estimated count]
|
|
218
|
+
- **Agent:** [primary]
|
|
219
|
+
- **Dependencies:** none
|
|
220
|
+
- **Tracking item:** [internal-only OR external provider + type/id]
|
|
221
|
+
- **Risk:** Low/Medium/High
|
|
222
|
+
- **Notes:** [any special considerations]
|
|
223
|
+
|
|
224
|
+
### Epic 2: [Name]
|
|
225
|
+
...
|
|
226
|
+
|
|
227
|
+
## Architecture Decisions Required
|
|
228
|
+
[List of ADR candidates with recommendations]
|
|
229
|
+
|
|
230
|
+
## Security Flags
|
|
231
|
+
[List of security concerns with mitigations]
|
|
232
|
+
|
|
233
|
+
## Recommended Execution Order
|
|
234
|
+
1. Resolve ADR candidates (architecture role)
|
|
235
|
+
2. Epic 1 — spell-full-cycle or spell-architect → spell-implement → spell-ship
|
|
236
|
+
3. Run spell-commit-work to checkpoint major outputs before starting Epic 2
|
|
237
|
+
4. Epic 2 — ...
|
|
238
|
+
5. [milestone gate if needed]
|
|
239
|
+
6. Epic N — ...
|
|
240
|
+
|
|
241
|
+
## Open Questions
|
|
242
|
+
[Anything that needs human decision before execution can start]
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
If `external_provider=jira` or `external_provider=other`, add explicit TODOs in Open Questions for provider-specific type mapping and linkage automation.
|
|
246
|
+
|
|
247
|
+
### 9. Present and Confirm
|
|
248
|
+
|
|
249
|
+
Present the execution plan to the user. Ask:
|
|
250
|
+
1. Does the epic split make sense?
|
|
251
|
+
2. Are the ADR candidates correct? Should any be decided now?
|
|
252
|
+
3. Are there epics that should be deprioritized or cut?
|
|
253
|
+
4. Ready to start with Epic 1?
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Rules
|
|
258
|
+
|
|
259
|
+
- **Never start implementation from this spell.** This spell produces a plan, not code. The output feeds into `spell-architect` or `spell-full-cycle`.
|
|
260
|
+
- **Be honest about unknowns.** If the PRD references technology or services you don't have context on, flag it as a research item for the research role.
|
|
261
|
+
- **Respect existing ADRs.** If the PRD proposes something that contradicts an existing ADR, flag the conflict — don't silently override.
|
|
262
|
+
- **Conservative estimates.** When in doubt, split smaller. Two small epics are better than one that's too big.
|
|
263
|
+
- **Security is non-negotiable.** If a security flag is blocking, it blocks. No "we'll add auth later."
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Spell — Security Review
|
|
3
|
+
description: OWASP Top 10 and AI/agent (LLM) security audit plus dependency vulnerability check for any project
|
|
4
|
+
argument-hint: Project path, PR, or specific security concern (e.g., "auth flow in the API")
|
|
5
|
+
agent: agent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Executive Summary
|
|
9
|
+
|
|
10
|
+
- This prompt runs a security-focused review against OWASP Top 10 and dependency vulnerabilities.
|
|
11
|
+
- No dedicated security agent needed — any agent loads this spell for security context (ADR-049).
|
|
12
|
+
- Covers code-level vulnerabilities, dependency audit, secrets detection, and infrastructure security.
|
|
13
|
+
- Includes an AI/agent (LLM) security pass — prompt injection, excessive agency, and secrets-in-context — since Arcane drives AI agents.
|
|
14
|
+
- See [[security/threat-model|Threat Model]] for the project's security baseline.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
Perform a security review of the specified code, project, or PR.
|
|
19
|
+
|
|
20
|
+
Use these files for context:
|
|
21
|
+
|
|
22
|
+
- [security/threat-model.md](../../security/threat-model.md) — Project threat model and security controls. If absent, proceed against a generic OWASP Top 10 + AI/agent baseline rather than assuming the file exists.
|
|
23
|
+
- [security/hardening-checklist.md](../../security/hardening-checklist.md) — Infrastructure hardening status
|
|
24
|
+
- [DECISIONS.md](../../DECISIONS.md) — Security-related ADRs
|
|
25
|
+
|
|
26
|
+
Workflow:
|
|
27
|
+
|
|
28
|
+
1. **Scope the review** — determine what's being reviewed:
|
|
29
|
+
- Specific PR or branch diff
|
|
30
|
+
- Full project audit
|
|
31
|
+
- Particular area of concern (auth, payments, data handling)
|
|
32
|
+
|
|
33
|
+
2. **OWASP Top 10 checklist** — check each category:
|
|
34
|
+
|
|
35
|
+
| # | Category | Check |
|
|
36
|
+
| --- | ------------------------- | ------------------------------------------------------------------------------------------- |
|
|
37
|
+
| A01 | Broken Access Control | Role checks, authorization on every endpoint, CORS config |
|
|
38
|
+
| A02 | Cryptographic Failures | TLS enforcement, password hashing (bcrypt/Argon2), no hardcoded keys |
|
|
39
|
+
| A03 | Injection | SQL parameterization, XSS output encoding, command injection prevention |
|
|
40
|
+
| A04 | Insecure Design | Threat modeling, rate limiting, abuse case coverage |
|
|
41
|
+
| A05 | Security Misconfiguration | Default credentials, debug mode off, error messages sanitized |
|
|
42
|
+
| A06 | Vulnerable Components | Dependency audit (`npm audit`, `dotnet list package --vulnerable`) |
|
|
43
|
+
| A07 | Auth Failures | MFA support, session management, credential storage |
|
|
44
|
+
| A08 | Data Integrity Failures | CI/CD pipeline integrity, deserialization safety, update verification |
|
|
45
|
+
| A09 | Logging Failures | Security events logged, no sensitive data in logs, log injection prevention |
|
|
46
|
+
| A10 | SSRF | URL validation, allowlists for external calls, no user-controlled URLs to internal services |
|
|
47
|
+
|
|
48
|
+
3. **AI / Agent security** (OWASP LLM-aligned — critical for agent-driven repos):
|
|
49
|
+
|
|
50
|
+
| Risk | Check |
|
|
51
|
+
| ---- | ----- |
|
|
52
|
+
| Prompt injection (direct & indirect) | Is untrusted content (files, web, tool output, PR/issue text, user data) ever treated as instructions rather than data? Flag anywhere fetched or user-supplied content is concatenated into agent instructions or tool arguments without delimiting or validation. |
|
|
53
|
+
| Insecure output handling | Is model/agent output used to build shell commands, SQL, file paths, or HTML without validation or escaping? Flag any execute-from-model-output path that isn't sandboxed or checked. |
|
|
54
|
+
| Excessive agency / over-broad tools | Do agents or tool profiles grant more capability or autonomy than the task needs? Check power levels and tool scopes against least privilege; verify destructive tools are gated behind approval (see `agents/agent-policies.md`). |
|
|
55
|
+
| Secrets in context | Are secrets, tokens, or credentials placed into prompts, agent memory, journals, or tool arguments? Verify SecretRef-style indirection is used and secrets are never echoed into logs or model context. |
|
|
56
|
+
| Sensitive-data exposure via tools | Could the agent exfiltrate PII or secrets by sending them to external tools, MCP servers, or web endpoints? Check what crosses the trust boundary. |
|
|
57
|
+
| Untrusted tools / MCP supply chain | Are connected tools, MCP servers, and model endpoints trusted and pinned? Flag unverified or arbitrary tool sources. |
|
|
58
|
+
|
|
59
|
+
Align findings with the project threat model and agent policies.
|
|
60
|
+
|
|
61
|
+
4. **Dependency audit**:
|
|
62
|
+
- Run `npm audit` (Node.js) or `dotnet list package --vulnerable` (.NET).
|
|
63
|
+
- Check for known CVEs in direct and transitive dependencies.
|
|
64
|
+
- Flag any dependency more than 2 major versions behind.
|
|
65
|
+
|
|
66
|
+
5. **Secrets detection**:
|
|
67
|
+
- Scan for API keys, tokens, passwords, connection strings in code.
|
|
68
|
+
- Check `.env` files are in `.gitignore`.
|
|
69
|
+
- Verify secrets management approach (environment variables, Key Vault, SecretRef).
|
|
70
|
+
|
|
71
|
+
6. **Infrastructure security** (if applicable):
|
|
72
|
+
- Terraform security (Checkov scan).
|
|
73
|
+
- Network exposure (is anything public that shouldn't be?).
|
|
74
|
+
- IAM/RBAC configuration (least privilege).
|
|
75
|
+
|
|
76
|
+
7. **Generate security report**:
|
|
77
|
+
```markdown
|
|
78
|
+
## Security Review — [Project/Feature]
|
|
79
|
+
|
|
80
|
+
**Reviewer:** [Agent name]
|
|
81
|
+
**Date:** [timestamp]
|
|
82
|
+
**Scope:** [What was reviewed]
|
|
83
|
+
|
|
84
|
+
### OWASP Top 10 Results
|
|
85
|
+
| Category | Status | Findings |
|
|
86
|
+
| ------------------------- | --------- | --------- |
|
|
87
|
+
| A01 Broken Access Control | PASS/FAIL | [details] |
|
|
88
|
+
| ... | ... | ... |
|
|
89
|
+
|
|
90
|
+
### AI/Agent Security Results
|
|
91
|
+
| Risk | Status | Findings |
|
|
92
|
+
| ------------------------ | --------- | --------- |
|
|
93
|
+
| Prompt injection | PASS/FAIL | [details] |
|
|
94
|
+
| Insecure output handling | PASS/FAIL | [details] |
|
|
95
|
+
| Excessive agency | PASS/FAIL | [details] |
|
|
96
|
+
| Secrets in context | PASS/FAIL | [details] |
|
|
97
|
+
|
|
98
|
+
### Dependency Audit
|
|
99
|
+
- Critical vulnerabilities: [N]
|
|
100
|
+
- High vulnerabilities: [N]
|
|
101
|
+
- Action required: [list]
|
|
102
|
+
|
|
103
|
+
### Secrets Scan
|
|
104
|
+
- Hardcoded secrets found: [yes/no]
|
|
105
|
+
- Secrets management: [approach]
|
|
106
|
+
|
|
107
|
+
### Findings (by severity)
|
|
108
|
+
#### CRITICAL
|
|
109
|
+
- [Finding with remediation]
|
|
110
|
+
|
|
111
|
+
#### HIGH
|
|
112
|
+
- [Finding with remediation]
|
|
113
|
+
|
|
114
|
+
#### MEDIUM
|
|
115
|
+
- [Finding with remediation]
|
|
116
|
+
|
|
117
|
+
### Verdict
|
|
118
|
+
- [ ] PASS — no critical or high findings
|
|
119
|
+
- [ ] FAIL — remediation required before deploy
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
8. **Present findings** — show the report with clear remediation steps for each finding.
|
|
123
|
+
|
|
124
|
+
Rules:
|
|
125
|
+
- **Never skip a category.** Every OWASP item must be checked, even if marked N/A with justification.
|
|
126
|
+
- **Provide remediation, not just findings.** Every finding must include how to fix it.
|
|
127
|
+
- **Don't cry wolf.** Only flag real vulnerabilities, not theoretical risks with no attack vector.
|
|
128
|
+
- **Check the threat model.** Findings should align with the project's actual threat landscape.
|
|
129
|
+
- **Treat external content as untrusted.** In agent code, assume any file-, web-, or tool-sourced text could be hostile — flag anywhere it can steer the agent or reach a sink (shell, SQL, eval, file write, outbound HTTP) unchecked.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Spell — Ship
|
|
3
|
+
description: Pre-deploy checklist, merge approval workflow, and deployment gate verification
|
|
4
|
+
argument-hint: Branch name or PR number to ship
|
|
5
|
+
agent: agent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Executive Summary
|
|
9
|
+
|
|
10
|
+
- This prompt runs the pre-deploy checklist and manages the merge/deploy approval workflow.
|
|
11
|
+
- It verifies all Spell Loop phases are complete before allowing a merge.
|
|
12
|
+
- Enforces deployment gates from governance/cicd-standards.md.
|
|
13
|
+
- Final gate is always human approval — agents cannot autonomously ship to production.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Run the ship workflow for the specified branch or PR.
|
|
18
|
+
|
|
19
|
+
Use these files for context:
|
|
20
|
+
|
|
21
|
+
- [governance/development-methodology.md](../../governance/development-methodology.md) — Spell Loop phases
|
|
22
|
+
- [governance/cicd-standards.md](../../governance/cicd-standards.md) — CI/CD pipeline requirements and deployment gates
|
|
23
|
+
- [governance/testing-standards.md](../../governance/testing-standards.md) — Coverage thresholds
|
|
24
|
+
- [governance/git-conventions.md](../../governance/git-conventions.md) — Branch policies and merge strategy
|
|
25
|
+
|
|
26
|
+
Workflow:
|
|
27
|
+
|
|
28
|
+
1. **Verify Spell Loop completion** — check that all prior phases passed:
|
|
29
|
+
- [ ] PRD exists and was approved (or Quick Flow justified skipping it).
|
|
30
|
+
- [ ] Architecture doc exists (or Quick Flow justified skipping it).
|
|
31
|
+
- [ ] All stories in stories.json have `"passes": true`.
|
|
32
|
+
- [ ] Test evidence exists with passing thresholds.
|
|
33
|
+
- [ ] Code review completed with APPROVE verdict.
|
|
34
|
+
|
|
35
|
+
2. **Sync with the target branch** — actually perform the sync, do not just assert it:
|
|
36
|
+
- Run `git fetch origin` to get the latest refs.
|
|
37
|
+
- Merge the target branch into the current branch (e.g. `git merge origin/<target>`).
|
|
38
|
+
- **On merge conflicts:** STOP and ask the user to resolve them. Do not attempt to auto-resolve.
|
|
39
|
+
- After a clean merge (or once the user has resolved conflicts), re-run the full test suite and confirm it passes.
|
|
40
|
+
- Push the synced branch (e.g. `git push`).
|
|
41
|
+
|
|
42
|
+
3. **Run pre-deploy checklist**:
|
|
43
|
+
- [ ] All CI pipeline checks pass (build, test, lint, security scan).
|
|
44
|
+
- [ ] Branch synced with target (fetch + merge completed in step 2, no outstanding conflicts).
|
|
45
|
+
- [ ] No secrets or credentials in the diff.
|
|
46
|
+
- [ ] DECISIONS.md updated if new ADRs were created.
|
|
47
|
+
- [ ] Documentation updated for user-facing changes.
|
|
48
|
+
- [ ] **Package version bumped** (if `package.json` exists): run `npm view <package-name> version` to get the last published version, then confirm `package.json` `version` field is higher. BLOCK the ship if the version has not been incremented — the pipeline will skip publishing an already-published version, so a bump is required to actually release.
|
|
49
|
+
|
|
50
|
+
4. **Ensure a PR exists** — before declaring the branch ready to ship, verify that a pull request exists for it. If none exists, STOP and direct the user to run `spell-create-pull-request` to open one. The ship checklist cannot complete without an open PR.
|
|
51
|
+
|
|
52
|
+
5. **Deployment gate verification** — per cicd-standards.md:
|
|
53
|
+
- **Staging:** CI green + code review approved.
|
|
54
|
+
- **Production:** Staging validated + human approval + rollback plan documented.
|
|
55
|
+
- **Terraform:** Plan output reviewed + human approval for any destroy operations.
|
|
56
|
+
|
|
57
|
+
6. **Generate ship report**:
|
|
58
|
+
```markdown
|
|
59
|
+
## Ship Report — [Feature/Branch]
|
|
60
|
+
|
|
61
|
+
**Date:** [timestamp]
|
|
62
|
+
**Target:** [main / release branch]
|
|
63
|
+
|
|
64
|
+
### Spell Loop Status
|
|
65
|
+
| Phase | Status | Evidence |
|
|
66
|
+
| --------- | --------- | ------------------------------------ |
|
|
67
|
+
| Plan | PASS/SKIP | [PRD link or justification] |
|
|
68
|
+
| Architect | PASS/SKIP | [Architecture link or justification] |
|
|
69
|
+
| Implement | PASS | [N stories complete] |
|
|
70
|
+
| Test | PASS | [Coverage %, test count] |
|
|
71
|
+
| Review | PASS | [Review link, verdict] |
|
|
72
|
+
|
|
73
|
+
### Pre-Deploy Checklist
|
|
74
|
+
- [x/- for each item above]
|
|
75
|
+
|
|
76
|
+
### Deployment Gate
|
|
77
|
+
- Target environment: [staging/production]
|
|
78
|
+
- Gate requirements met: [yes/no]
|
|
79
|
+
- Rollback plan: [documented/not needed]
|
|
80
|
+
|
|
81
|
+
### Recommendation
|
|
82
|
+
- APPROVE for merge and deploy
|
|
83
|
+
- OR: BLOCK — [reason]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
7. **Request human approval** — present the ship report and wait for explicit approval.
|
|
87
|
+
|
|
88
|
+
8. **Execute merge** (after approval):
|
|
89
|
+
- Merge using the project's merge strategy as defined in [governance/git-conventions.md](../../governance/git-conventions.md). **Do NOT squash** — squash merges are prohibited because they collapse per-commit attribution. Prefer rebase and fast-forward.
|
|
90
|
+
- Verify CI passes on the target branch post-merge.
|
|
91
|
+
- Tag release if applicable.
|
|
92
|
+
|
|
93
|
+
9. **Post-merge branch cleanup** (after the PR merges) — the merge was the human gate, so cleanup is automatic:
|
|
94
|
+
- Switch to the main branch (e.g. `git checkout main`).
|
|
95
|
+
- Pull the latest (e.g. `git pull`).
|
|
96
|
+
- Delete the merged topic branch locally (e.g. `git branch -d <branch>`).
|
|
97
|
+
- Delete the merged topic branch on the remote (e.g. `git push origin --delete <branch>`); tolerate an already-deleted remote branch.
|
|
98
|
+
- Prune stale remote-tracking refs (e.g. `git fetch --prune` or `git remote prune origin`).
|
|
99
|
+
|
|
100
|
+
Rules:
|
|
101
|
+
- **Never merge without human approval.** This spell always ends with a human gate.
|
|
102
|
+
- **Never skip the checklist.** Every item must be verified, not assumed.
|
|
103
|
+
- **Block on failures.** If any checklist item fails, the ship is blocked until fixed.
|
|
104
|
+
- **Document what shipped.** The ship report is the audit trail.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Spell — Status
|
|
3
|
+
description: Show a fast, read-only snapshot of the current session — branch, git working state, open TODO count, decision count, and last journal date. Text or JSON.
|
|
4
|
+
argument-hint: Optional flags — e.g., --verbose --format json
|
|
5
|
+
agent: agent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Executive Summary
|
|
9
|
+
|
|
10
|
+
- This spell prints a quick state snapshot for the current repo. It never modifies files.
|
|
11
|
+
- It reads local git state plus arcane session files (`TODO.md`, `DECISIONS.md`, `journal/`).
|
|
12
|
+
- Use it any time mid-session to re-orient without running the full `spell-open-session` pass.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
Show the current session status for this repository. This is a read-only spell.
|
|
17
|
+
|
|
18
|
+
## Inputs
|
|
19
|
+
|
|
20
|
+
- Optional `--verbose` — include changed-file paths and the first few open TODOs.
|
|
21
|
+
- Optional `--format text|json` — default is `text`.
|
|
22
|
+
|
|
23
|
+
If no flags are given, use default text mode.
|
|
24
|
+
|
|
25
|
+
## Steps
|
|
26
|
+
|
|
27
|
+
0. Confirm this is a git repository (e.g., `git rev-parse --is-inside-work-tree`). If it is not, skip the git steps and set `branch`, `unpushedCommits`, `staged`, `unstaged`, and `untracked` to `unknown` (text) / `null` (JSON); still report the file-based counts in steps 4–6 if those files exist. Note `not a git repository` in the output.
|
|
28
|
+
1. Run `git branch --show-current` and capture the branch name. If it returns empty, you are in **detached HEAD** — report the branch as `detached@{short-sha}` (use `git rev-parse --short HEAD`).
|
|
29
|
+
2. Run `git rev-list --count @{upstream}..HEAD` for unpushed commit count. If there is no upstream (no tracking branch, or detached HEAD), set this to `unknown` (text) / `null` (JSON). Do not treat the absence of an upstream as `0`.
|
|
30
|
+
3. Run `git status --short` and compute counts: staged, unstaged, untracked. A clean tree is `0`/`0`/`0`.
|
|
31
|
+
4. Count open TODOs in `TODO.md` (unchecked `- [ ]` items). If the file is missing, count `0`.
|
|
32
|
+
5. Count decision entries in `DECISIONS.md` — count one per decision-record heading (the `ADR-NNN` / `ARC-NNN` entry headings, e.g. `## ARC-012 ...`). Do not count cross-reference table rows or inline mentions, and de-duplicate repeated IDs. If the file is missing, count `0`.
|
|
33
|
+
6. Determine the last session date from the most recent file in `journal/` (filenames follow `YYYY-MM-DD-topic-slug.md`; sort by the leading date, not file mtime). If `journal/` is missing or contains no dated entries, report `none` (text) / `null` (JSON).
|
|
34
|
+
|
|
35
|
+
## Output
|
|
36
|
+
|
|
37
|
+
### Text mode (default)
|
|
38
|
+
|
|
39
|
+
One concise line:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
[{branch}] ↑{unpushed} | {staged}● {unstaged}✎ {untracked}? | {openTodos} TODOs | {decisions} ADRs | last session: {date}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Glyph key: `↑` unpushed commits, `●` staged, `✎` unstaged, `?` untracked. Render `unknown` / `none` literally in the slot when a value cannot be determined (e.g. `↑unknown`, `last session: none`). When not a git repo, prefix the line with `not a git repository — ` and show `unknown` for all git-derived slots.
|
|
46
|
+
|
|
47
|
+
If `--verbose`, also print:
|
|
48
|
+
|
|
49
|
+
- a short bullet list of changed file paths from `git status --short`
|
|
50
|
+
- the first 5 open TODO lines
|
|
51
|
+
|
|
52
|
+
### JSON mode (`--format json`)
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"branch": "main",
|
|
57
|
+
"isGitRepo": true,
|
|
58
|
+
"detachedHead": false,
|
|
59
|
+
"unpushedCommits": 0,
|
|
60
|
+
"staged": 0,
|
|
61
|
+
"unstaged": 0,
|
|
62
|
+
"untracked": 0,
|
|
63
|
+
"openTodos": 0,
|
|
64
|
+
"decisions": 0,
|
|
65
|
+
"lastSessionDate": "YYYY-MM-DD",
|
|
66
|
+
"modifiedFiles": []
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Field conventions (keep JSON consistent with the text shape):
|
|
71
|
+
|
|
72
|
+
- `branch` — string; `detached@{short-sha}` when in detached HEAD; `null` when not a git repo.
|
|
73
|
+
- `isGitRepo` — boolean. When `false`, all git-derived fields (`unpushedCommits`, `staged`, `unstaged`, `untracked`, `branch`) are `null`.
|
|
74
|
+
- `detachedHead` — boolean.
|
|
75
|
+
- `unpushedCommits` — integer, or `null` when there is no upstream / detached HEAD (the JSON analogue of text `unknown`). Never silently `0`.
|
|
76
|
+
- `lastSessionDate` — `YYYY-MM-DD` string, or `null` when no dated journal entry exists (the analogue of text `none`).
|
|
77
|
+
- `modifiedFiles` — populated only when `--verbose` is set; otherwise `[]`.
|
|
78
|
+
|
|
79
|
+
## Rules
|
|
80
|
+
|
|
81
|
+
- Read-only — never edit, create, stage, or commit any file. Use only inspection commands (`git status`, `git rev-list`, `git branch`, file reads).
|
|
82
|
+
- Prefer exact values from local git and files; do not estimate.
|
|
83
|
+
- Never fail the whole snapshot because one source is unavailable. A missing count file is `0`; an undeterminable git value is `unknown` (text) / `null` (JSON); a non-git directory still reports file-based counts.
|
|
84
|
+
- Counts vs. unknowns are distinct: a real `0` (clean tree, empty TODO) is not the same as `unknown`/`null` (could not determine). Do not collapse one into the other.
|
|
85
|
+
- Keep text output to a single line unless `--verbose` is set.
|