@runecraft/grimoire 1.0.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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -0
  3. package/catalog.json +9 -0
  4. package/dist/grimoire.js +1758 -0
  5. package/package.json +54 -0
  6. package/references/definition-of-done.md +67 -0
  7. package/references/testing-patterns.md +260 -0
  8. package/skills/code-review-and-quality/README.md +13 -0
  9. package/skills/code-review-and-quality/SKILL.md +389 -0
  10. package/skills/code-simplification/README.md +13 -0
  11. package/skills/code-simplification/SKILL.md +338 -0
  12. package/skills/debugging-and-error-recovery/README.md +13 -0
  13. package/skills/debugging-and-error-recovery/SKILL.md +343 -0
  14. package/skills/debugging-and-error-recovery/scripts/__pycache__/triage_state.cpython-314.pyc +0 -0
  15. package/skills/debugging-and-error-recovery/scripts/triage_state.py +206 -0
  16. package/skills/deprecation-and-migration/README.md +13 -0
  17. package/skills/deprecation-and-migration/SKILL.md +248 -0
  18. package/skills/deprecation-and-migration/scripts/__pycache__/migration_tracker.cpython-314.pyc +0 -0
  19. package/skills/deprecation-and-migration/scripts/migration_tracker.py +237 -0
  20. package/skills/doubt-driven-development/README.md +13 -0
  21. package/skills/doubt-driven-development/SKILL.md +251 -0
  22. package/skills/git-commit-learning/.skill-meta.json +14 -0
  23. package/skills/git-commit-learning/README.md +205 -0
  24. package/skills/git-commit-learning/SKILL.md +435 -0
  25. package/skills/git-commit-learning/references/commit-patterns.md +595 -0
  26. package/skills/git-worktree/README.md +13 -0
  27. package/skills/git-worktree/SKILL.md +220 -0
  28. package/skills/idea-refine/README.md +13 -0
  29. package/skills/idea-refine/SKILL.md +186 -0
  30. package/skills/interview-me/README.md +13 -0
  31. package/skills/interview-me/SKILL.md +233 -0
  32. package/skills/linkedin-audit/SKILL.md +98 -0
  33. package/skills/linkedin-audit/references/dashboard-spec.md +43 -0
  34. package/skills/memory-management/README.md +13 -0
  35. package/skills/memory-management/SKILL.md +198 -0
  36. package/skills/security-and-hardening/README.md +13 -0
  37. package/skills/security-and-hardening/SKILL.md +472 -0
  38. package/skills/shipping-and-launch/README.md +13 -0
  39. package/skills/shipping-and-launch/SKILL.md +317 -0
  40. package/skills/skill-forge/README.md +153 -0
  41. package/skills/skill-forge/SKILL.md +291 -0
  42. package/skills/skill-forge/assets/SKILL.template.md +73 -0
  43. package/skills/skill-forge/references/authoring-patterns.md +249 -0
  44. package/skills/skill-forge/references/description-optimization.md +171 -0
  45. package/skills/skill-forge/references/output-evaluation.md +276 -0
  46. package/skills/skill-forge/references/scripts-guide.md +232 -0
  47. package/skills/skill-forge/references/spec.md +175 -0
  48. package/skills/skill-forge/scripts/validate.py +536 -0
  49. package/skills/spec-driven/.skill-meta.json +14 -0
  50. package/skills/spec-driven/README.md +335 -0
  51. package/skills/spec-driven/SKILL.md +174 -0
  52. package/skills/spec-driven/references/code-analysis.md +98 -0
  53. package/skills/spec-driven/references/coding-principles.md +56 -0
  54. package/skills/spec-driven/references/context-limits.md +31 -0
  55. package/skills/spec-driven/references/design.md +199 -0
  56. package/skills/spec-driven/references/discuss.md +136 -0
  57. package/skills/spec-driven/references/implement.md +425 -0
  58. package/skills/spec-driven/references/lessons.md +113 -0
  59. package/skills/spec-driven/references/memory.md +126 -0
  60. package/skills/spec-driven/references/specify.md +210 -0
  61. package/skills/spec-driven/references/sub-agents.md +96 -0
  62. package/skills/spec-driven/references/tasks.md +484 -0
  63. package/skills/spec-driven/references/validate.md +350 -0
  64. package/skills/spec-driven/scripts/__pycache__/lessons.cpython-314.pyc +0 -0
  65. package/skills/spec-driven/scripts/lessons.py +370 -0
  66. package/skills/spec-loop/README.md +36 -0
  67. package/skills/spec-loop/SKILL.md +61 -0
  68. package/skills/test-driven-development/README.md +13 -0
  69. package/skills/test-driven-development/SKILL.md +388 -0
  70. package/skills/typescript-patterns/README.md +13 -0
  71. package/skills/typescript-patterns/SKILL.md +346 -0
  72. package/skills/using-agent-skills/README.md +13 -0
  73. package/skills/using-agent-skills/SKILL.md +187 -0
@@ -0,0 +1,31 @@
1
+ # Context Limits
2
+
3
+ ## File Size Limits
4
+
5
+ | File | Max Tokens | ~Words | Warning At |
6
+ | --------- | ---------- | ------ | ---------- |
7
+ | spec.md | 5,000 | 3,000 | 4,000 |
8
+ | design.md | 8,000 | 4,800 | 6,400 |
9
+ | tasks.md | 10,000 | 6,000 | 8,000 |
10
+
11
+ ## Context Zones
12
+
13
+ 🟢 **Healthy** (<40k total): Silent
14
+ 🟡 **Moderate** (40-60k): Discrete footer note
15
+ 🔴 **Critical** (>60k): Active warning, suggest optimization
16
+
17
+ ## Monitoring
18
+
19
+ Display context status in footer when >40k:
20
+
21
+ ```
22
+ 📊 Context: 52k tokens (moderate)
23
+ - tasks.md: 11k (ok)
24
+ - design.md: 6k (ok)
25
+ - Total: 52k / 200k (26%)
26
+ ```
27
+
28
+ ## Principles
29
+
30
+ **Target:** <40k tokens loaded (20% of window)
31
+ **Reserve:** 160k+ tokens for work, reasoning, outputs
@@ -0,0 +1,199 @@
1
+ # Design
2
+
3
+ **Goal**: Define HOW to build it. Architecture, components, what to reuse.
4
+
5
+ **Skip this phase when:** The change is straightforward — no architectural decisions, no new patterns, no component interactions to plan. For simple features, design happens inline during Execute.
6
+
7
+ ## Process
8
+
9
+ ### 1. Load Context
10
+
11
+ Read `.specs/features/[feature]/spec.md` before designing. If `.specs/features/[feature]/context.md` exists, load it too — it contains implementation decisions that constrain the design (layout choices, behavior preferences, interaction patterns). Decisions marked as "Agent's Discretion" are yours to decide.
12
+
13
+ **Mandatory: read `.specs/STATE.md` `## Decisions` now.** This MUST happen before any architectural choices are made. Every `active` `AD-NNN` entry is a project-level constraint this design must conform to. If a decision from a prior feature conflicts with what is best for this feature, you have two options — both require an explicit choice:
14
+
15
+ 1. **Conform** — Design within the active constraint.
16
+ 2. **Supersede** — Append a new `AD-NNN` entry to `.specs/STATE.md` `## Decisions` that supersedes the old one (set the old entry's `status` to `superseded by AD-NNN`) and document the reason. The new decision becomes the project standard going forward.
17
+
18
+ Silently ignoring an active decision is not an option — it creates invisible inconsistency across features.
19
+
20
+ **Also load confirmed lessons** relevant to this feature: `python3 scripts/lessons.py list --status confirmed` (filter with `--scope`/`--query`). These are past verification failures distilled into guidance — apply them while designing. Load only `confirmed`. Skip silently if no store or no code tool. See [lessons.md](lessons.md).
21
+
22
+ ### 1.5. Research (Optional but Recommended)
23
+
24
+ If the feature involves unfamiliar technology, patterns, or integrations, research before designing. Document findings briefly in the design doc or as inline notes. This prevents incorrect assumptions from propagating into tasks.
25
+
26
+ Follow the **Knowledge Verification Chain** (see SKILL.md) in strict order:
27
+
28
+ ```
29
+ Codebase → Project docs → Context7 MCP → Web search → Flag as uncertain
30
+ ```
31
+
32
+ **CRITICAL: NEVER assume or fabricate information.** If you cannot find an answer through the chain, explicitly say "I don't know" or "I couldn't find documentation for this". Inventing an API, a pattern, or a behavior that doesn't exist is far worse than admitting uncertainty. Wrong assumptions propagate through design → tasks → implementation and cause cascading failures.
33
+
34
+ Good triggers for research: new libraries, unfamiliar APIs, performance-sensitive features, security-sensitive features, patterns you haven't used in this codebase before.
35
+
36
+ **Concern flagging (MUST do while reading code):** While walking the codebase via the Knowledge Verification Chain, flag any concerns you encounter in the areas this feature touches. Capture each finding in the `## Risks & Concerns` section of `design.md`:
37
+
38
+ - **Fragile code** — tight coupling, large functions, implicit state
39
+ - **Tech debt** — hacks, workarounds, deprecated APIs
40
+ - **Security risks** — unvalidated input, auth gaps, exposed secrets
41
+ - **Performance bottlenecks** — N+1 queries, unbounded loops, missing indexes
42
+ - **Test coverage gaps** — untested paths the feature depends on
43
+
44
+ Every flagged concern MUST include a mitigation — how the design (or a follow-up task) addresses it.
45
+
46
+ ### 2. Define Architecture
47
+
48
+ **Large/Complex only — approach exploration:** Before committing to a single architecture, present 2–3 viable approaches with trade-offs and a recommendation. Lead with the recommendation to avoid analysis paralysis. All approaches must deliver the same scoped thing (no alternative scopes). Confirm the chosen approach with the user before detailing components. Medium features: skip — design inline.
49
+
50
+ Overview of how components interact. Use mermaid diagrams when helpful.
51
+
52
+ ### 3. Identify Code Reuse
53
+
54
+ **CRITICAL**: What existing code can we leverage? This saves tokens and reduces errors.
55
+
56
+ Flag any concerns found here per step 1.5 into `## Risks & Concerns`.
57
+
58
+ ### 4. Define Components and Interfaces
59
+
60
+ Each component: Purpose, Location, Interfaces, Dependencies, What it reuses.
61
+
62
+ ### 5. Define Data Models
63
+
64
+ If the feature involves data, define models before implementation.
65
+
66
+ ---
67
+
68
+ ## Template: `.specs/features/[feature]/design.md`
69
+
70
+ ````markdown
71
+ # [Feature] Design
72
+
73
+ **Spec**: `.specs/features/[feature]/spec.md`
74
+ **Status**: Draft | Approved
75
+
76
+ ---
77
+
78
+ ## Architecture Overview
79
+
80
+ [Brief description of the architecture approach]
81
+
82
+ ```mermaid
83
+ graph TD
84
+ A[User Action] --> B[Component A]
85
+ B --> C[Service Layer]
86
+ C --> D[Data Store]
87
+ B --> E[Component B]
88
+ ```
89
+ ````
90
+
91
+ ---
92
+
93
+ ## Code Reuse Analysis
94
+
95
+ ### Existing Components to Leverage
96
+
97
+ | Component | Location | How to Use |
98
+ | -------------------- | ------------------- | ------------------------- |
99
+ | [Existing Component] | `src/path/to/file` | [Extend/Import/Reference] |
100
+ | [Existing Utility] | `src/utils/file` | [How it helps] |
101
+ | [Existing Pattern] | `src/patterns/file` | [Apply same pattern] |
102
+
103
+ ### Integration Points
104
+
105
+ | System | Integration Method |
106
+ | -------------- | --------------------------------------- |
107
+ | [Existing API] | [How new feature connects] |
108
+ | [Database] | [How data connects to existing schemas] |
109
+
110
+ ---
111
+
112
+ ## Components
113
+
114
+ ### [Component Name]
115
+
116
+ - **Purpose**: [What this component does - one sentence]
117
+ - **Location**: `src/path/to/component/`
118
+ - **Interfaces**:
119
+ - `methodName(param: Type): ReturnType` - [description]
120
+ - `methodName(param: Type): ReturnType` - [description]
121
+ - **Dependencies**: [What it needs to function]
122
+ - **Reuses**: [Existing code this builds upon]
123
+
124
+ ### [Component Name]
125
+
126
+ - **Purpose**: [What this component does]
127
+ - **Location**: `src/path/to/component/`
128
+ - **Interfaces**:
129
+ - `methodName(param: Type): ReturnType`
130
+ - **Dependencies**: [Dependencies]
131
+ - **Reuses**: [Existing code]
132
+
133
+ ---
134
+
135
+ ## Data Models (if applicable)
136
+
137
+ ### [Model Name]
138
+
139
+ ```typescript
140
+ interface ModelName {
141
+ id: string
142
+ field1: string
143
+ field2: number
144
+ createdAt: Date
145
+ }
146
+ ```
147
+
148
+ **Relationships**: [How this relates to other models]
149
+
150
+ ### [Model Name]
151
+
152
+ ```typescript
153
+ interface AnotherModel {
154
+ id: string
155
+ // ...
156
+ }
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Error Handling Strategy
162
+
163
+ | Error Scenario | Handling | User Impact |
164
+ | -------------- | ------------- | ---------------- |
165
+ | [Scenario 1] | [How handled] | [What user sees] |
166
+ | [Scenario 2] | [How handled] | [What user sees] |
167
+
168
+ ---
169
+
170
+ ## Risks & Concerns
171
+
172
+ | Concern | Location (file:line) | Impact | Mitigation |
173
+ | ------- | -------------------- | ------ | ---------- |
174
+ | [Fragile code / tech debt / security / perf / test gap] | `src/path/file.ts:42` | [What breaks or degrades] | [How the design or a follow-up task addresses it] |
175
+
176
+ > None found — is a valid entry.
177
+
178
+ ---
179
+
180
+ ## Tech Decisions (only non-obvious ones)
181
+
182
+ | Decision | Choice | Rationale |
183
+ | ----------------- | --------------- | ------------- |
184
+ | [What we decided] | [What we chose] | [Why - brief] |
185
+
186
+ > **Project-level decisions:** If a decision here sets a convention, pattern, or constraint that future features must follow, append it to `.specs/STATE.md` `## Decisions` as the next `AD-NNN` entry (see [memory.md](memory.md)). Feature-local decisions stay only in this table.
187
+
188
+ ---
189
+
190
+ ## Tips
191
+
192
+ - **Load context first** — If context.md exists, decisions there are locked
193
+ - **Research when uncertain** — 5 minutes of research prevents hours of rework
194
+ - **Reuse is king** — Every component should reference existing patterns
195
+ - **Interfaces first** — Define contracts before implementation
196
+ - **Keep it visual** — Diagrams save 1000 words
197
+ - **Small components** — If component does 3+ things, split it
198
+ - **Flag concerns inline** — Risks found during research go in Risks & Concerns with a mitigation
199
+ - **Confirm before Tasks** — User approves design before breaking into tasks
@@ -0,0 +1,136 @@
1
+ # Specify: Discuss Gray Areas
2
+
3
+ **Goal:** Capture HOW the user envisions the feature when the spec has ambiguous areas. This is NOT a separate phase — it's triggered within Specify when the agent detects gray areas that need user input.
4
+
5
+ **Trigger:** Automatically when gray areas are detected during spec creation, or explicitly via "discuss feature", "how should this work?", "capture context"
6
+
7
+ **When to trigger (auto-detect):** The spec contains user-facing behavior that could go multiple ways AND the user hasn't expressed a preference. If the spec is clear and unambiguous, skip this entirely.
8
+
9
+ **When NOT to trigger:** Genuinely trivial features — a pure read endpoint, a config tweak, features with no [implicit-requirement dimensions](specify.md#implicit-requirement-dimensions) present (no persistence/state, external calls, auth, payments, concurrency, or state transitions). When any dimension is present, trigger discuss.
10
+
11
+ ## Why This Phase Exists
12
+
13
+ Specifications capture WHAT to build. Design captures the architecture. But neither captures the user's vision for ambiguous areas — layout preferences, interaction patterns, error handling style, content tone. Without this, the agent guesses. With this, the agent builds what the user actually imagined.
14
+
15
+ The output — `context.md` — feeds directly into Design and Tasks:
16
+
17
+ - **Design reads it** to know what decisions are locked vs. flexible
18
+ - **Tasks reads it** to include specific behaviors in task definitions
19
+
20
+ ## Process
21
+
22
+ ### 1. Analyze the Feature
23
+
24
+ Read `.specs/features/[feature]/spec.md` and identify the domain:
25
+
26
+ | Domain | Gray areas to explore |
27
+ | ------------------------------ | ------------------------------------------------------------- |
28
+ | Something users **SEE** | Layout, density, interactions, empty states, visual hierarchy |
29
+ | Something users **CALL** (API) | Response format, errors, auth, versioning, rate limiting |
30
+ | Something users **RUN** (CLI) | Output format, flags, modes, error handling, verbosity |
31
+ | Something users **READ** | Structure, tone, depth, flow, navigation |
32
+ | Something being **ORGANIZED** | Grouping criteria, naming, duplicates, exceptions |
33
+ | Something with **backend / state / contract** | Failure & partial-failure states, idempotency/retry/dedup, auth boundaries & rate limits, data lifecycle/expiry, concurrency/ordering — see [implicit-requirement dimensions](specify.md#implicit-requirement-dimensions) |
34
+
35
+ Generate 3-4 **feature-specific** gray areas. Not generic categories, but concrete decisions for THIS feature.
36
+
37
+ ### 2. Present Gray Areas
38
+
39
+ Present the feature boundary (from spec.md) and the gray areas to the user. Let them choose which to discuss. Do NOT include a "skip all" option — the user invoked this phase to discuss.
40
+
41
+ Any gray area the user **declines** to discuss, or that goes undiscussed, is written to the spec's **Assumptions & Open Questions** section (agent's chosen default + rationale) — never silently dropped. This ensures the spec's closure gate can pass: every gray area is either resolved through discussion or recorded as a signed-off assumption.
42
+
43
+ ### 3. Deep-Dive Each Area
44
+
45
+ For each selected area:
46
+
47
+ 1. Ask 3-4 concrete questions with specific options (not vague categories)
48
+ 2. After the questions, check: "More about [area], or move on?"
49
+ 3. If more → ask 3-4 more, check again
50
+ 4. After all areas → "Ready to create context?"
51
+
52
+ **Question design:**
53
+
54
+ - Options should be concrete ("Card layout" not "Option A")
55
+ - Each answer should inform the next question
56
+ - Include "You decide" as an option when reasonable — captures agent discretion
57
+
58
+ ### 4. Scope Guardrail (CRITICAL)
59
+
60
+ The feature boundary from spec.md is **fixed**. Discussion clarifies HOW to implement, never WHETHER to add new capabilities.
61
+
62
+ **Allowed:** "How should posts be displayed?" (clarifying ambiguity)
63
+ **Not allowed:** "Should we also add comments?" (new capability)
64
+
65
+ When user suggests scope creep: "That sounds like a separate feature. I'll note it in Deferred Ideas. Back to [current area]."
66
+
67
+ ### 5. Write context.md
68
+
69
+ ---
70
+
71
+ ## Template: `.specs/features/[feature]/context.md`
72
+
73
+ ```markdown
74
+ # [Feature] Context
75
+
76
+ **Gathered:** [date]
77
+ **Spec:** `.specs/features/[feature]/spec.md`
78
+ **Status:** Ready for design
79
+
80
+ ---
81
+
82
+ ## Feature Boundary
83
+
84
+ [Clear statement of what this feature delivers — the scope anchor from spec.md]
85
+
86
+ ---
87
+
88
+ ## Implementation Decisions
89
+
90
+ ### [Area 1 that was discussed]
91
+
92
+ - [Specific decision made]
93
+ - [Another decision if applicable]
94
+
95
+ ### [Area 2 that was discussed]
96
+
97
+ - [Specific decision made]
98
+
99
+ ### [Area 3 that was discussed]
100
+
101
+ - [Specific decision made]
102
+
103
+ ### Agent's Discretion
104
+
105
+ [Areas where user explicitly said "you decide" — agent has flexibility here during design/implementation]
106
+
107
+ ### Declined / Undiscussed Gray Areas → Assumptions
108
+
109
+ [Gray areas the user declined to discuss or that were not covered. Each entry is written to the spec's Assumptions & Open Questions section with the agent's chosen default and rationale — not left silently unresolved.]
110
+
111
+ ---
112
+
113
+ ## Specific References
114
+
115
+ [Any "I want it like X" moments, product references, specific behaviors, interaction patterns mentioned during discussion]
116
+
117
+ [If none: "No specific requirements — open to standard approaches"]
118
+
119
+ ---
120
+
121
+ ## Deferred Ideas
122
+
123
+ [Ideas that came up during discussion but belong in other features/phases. Captured here so they're not lost, but explicitly out of scope]
124
+
125
+ [If none: "None — discussion stayed within feature scope"]
126
+ ```
127
+
128
+ ---
129
+
130
+ ## Tips
131
+
132
+ - **Decisions, not vision** — "Card-based layout with subtle shadows" is a decision. "Should feel modern" is not.
133
+ - **Scope is sacred** — Deferred Ideas captures scope creep without losing ideas
134
+ - **User = visionary, Agent = builder** — Ask about how they imagine it, not about technical implementation
135
+ - **Don't ask about:** Technical architecture, performance, implementation details — that's Design's job
136
+ - **Confirm before Design** — User approves context.md before moving to design phase