@hanzlaa/rcode 2.2.0 → 2.3.2

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 (143) hide show
  1. package/CLAUDE.md +15 -0
  2. package/CONTRIBUTING.md +138 -0
  3. package/README.md +74 -15
  4. package/cli/install.js +312 -80
  5. package/cli/postinstall.js +4 -4
  6. package/cli/uninstall.js +8 -0
  7. package/dist/rcode.js +19777 -0
  8. package/package.json +18 -5
  9. package/rihal/DOCS-AUDIT.md +14 -0
  10. package/rihal/agents/rihal-code-reviewer.md +1 -1
  11. package/rihal/agents/rihal-codebase-mapper.md +1 -1
  12. package/rihal/agents/rihal-docs-auditor.md +1 -1
  13. package/rihal/agents/rihal-edge-case-hunter.md +1 -1
  14. package/rihal/agents/rihal-executor.md +2 -1
  15. package/rihal/agents/rihal-hussain-pm.md +1 -0
  16. package/rihal/agents/rihal-nyquist-auditor.md +1 -1
  17. package/rihal/agents/rihal-phase-researcher.md +2 -2
  18. package/rihal/agents/rihal-planner.md +3 -2
  19. package/rihal/agents/rihal-roadmapper.md +1 -0
  20. package/rihal/agents/rihal-security-adversary.md +1 -1
  21. package/rihal/agents/rihal-security-auditor.md +1 -1
  22. package/rihal/agents/rihal-sprint-checker.md +1 -1
  23. package/rihal/agents/rihal-verifier.md +1 -1
  24. package/rihal/bin/lib/roadmap.cjs +2 -3
  25. package/rihal/bin/rihal-tools.cjs +11 -31
  26. package/rihal/brain/best-practices/no-theoretical-suggestions.md +56 -0
  27. package/rihal/commands/add-phase.md +2 -2
  28. package/rihal/commands/audit.md +8 -0
  29. package/rihal/commands/checkpoint-preview.md +13 -0
  30. package/rihal/commands/cleanup.md +2 -2
  31. package/rihal/commands/config.md +4 -4
  32. package/rihal/commands/pr-branch.md +2 -2
  33. package/rihal/commands/prfaq.md +15 -0
  34. package/rihal/commands/remove-phase.md +2 -2
  35. package/rihal/commands/research-phase.md +2 -2
  36. package/rihal/commands/settings.md +2 -2
  37. package/rihal/commands/ship.md +15 -3
  38. package/rihal/commands/validate-phase.md +1 -1
  39. package/rihal/commands/verify-phase.md +2 -2
  40. package/rihal/references/agent-contracts.md +12 -0
  41. package/rihal/references/karpathy-guidelines-full.md +79 -0
  42. package/rihal/references/karpathy-guidelines.md +8 -76
  43. package/rihal/references/model-profile-resolution.md +8 -0
  44. package/rihal/references/phase-argument-parsing.md +11 -0
  45. package/rihal/references/revision-loop.md +11 -0
  46. package/rihal/references/universal-anti-patterns.md +15 -0
  47. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/SKILL.md +11 -0
  48. package/rihal/skills/actions/1-analysis/research/rihal-market-research/SKILL.md +11 -0
  49. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/SKILL.md +13 -0
  50. package/rihal/skills/actions/1-analysis/rihal-document-project/SKILL.md +11 -0
  51. package/rihal/skills/actions/1-analysis/rihal-prfaq/SKILL.md +12 -0
  52. package/rihal/skills/actions/1-analysis/rihal-product-brief/SKILL.md +7 -0
  53. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/SKILL.md +15 -1
  54. package/rihal/skills/actions/2-plan/rihal-create-milestone/SKILL.md +21 -1
  55. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-10-complete.md +1 -1
  56. package/rihal/skills/actions/2-plan/rihal-create-prd/SKILL.md +26 -0
  57. package/rihal/skills/actions/2-plan/rihal-create-story/SKILL.md +16 -2
  58. package/rihal/skills/actions/2-plan/rihal-create-ux-design/SKILL.md +12 -0
  59. package/rihal/skills/actions/2-plan/rihal-edit-prd/SKILL.md +11 -0
  60. package/rihal/skills/actions/2-plan/rihal-frontend-design/SKILL.md +13 -0
  61. package/rihal/skills/actions/2-plan/rihal-validate-prd/SKILL.md +12 -0
  62. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/SKILL.md +12 -0
  63. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/SKILL.md +14 -0
  64. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/SKILL.md +12 -0
  65. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +16 -0
  66. package/rihal/skills/actions/4-implementation/rihal-code-review/SKILL.md +12 -0
  67. package/rihal/skills/actions/4-implementation/rihal-correct-course/SKILL.md +13 -0
  68. package/rihal/skills/actions/4-implementation/rihal-dev-story/SKILL.md +12 -0
  69. package/rihal/skills/actions/4-implementation/rihal-qa-generate-e2e-tests/SKILL.md +12 -0
  70. package/rihal/skills/actions/4-implementation/rihal-retrospective/SKILL.md +11 -0
  71. package/rihal/skills/actions/4-implementation/rihal-scaffold-project/SKILL.md +10 -0
  72. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/SKILL.md +14 -1
  73. package/rihal/skills/actions/4-implementation/rihal-sprint-status/SKILL.md +10 -0
  74. package/rihal/skills/agents/ahmed-hassani-director/SKILL.md +13 -1
  75. package/rihal/skills/agents/fatima-qa/SKILL.md +14 -1
  76. package/rihal/skills/agents/haitham-frontend/SKILL.md +15 -1
  77. package/rihal/skills/agents/hanzla-engineer/SKILL.md +14 -1
  78. package/rihal/skills/agents/hussain-pm/SKILL.md +22 -1
  79. package/rihal/skills/agents/hussain-sm/SKILL.md +22 -1
  80. package/rihal/skills/agents/layla-designer/SKILL.md +15 -1
  81. package/rihal/skills/agents/majlis-council/SKILL.md +14 -1
  82. package/rihal/skills/agents/mariam-marketing/SKILL.md +15 -1
  83. package/rihal/skills/agents/nasser-eng-manager/SKILL.md +14 -1
  84. package/rihal/skills/agents/noor-writer/SKILL.md +14 -1
  85. package/rihal/skills/agents/raees-orchestrator/SKILL.md +13 -1
  86. package/rihal/skills/agents/sadiq-analyst/SKILL.md +15 -1
  87. package/rihal/skills/agents/waleed-architect/SKILL.md +16 -1
  88. package/rihal/skills/agents/yousef-backend/SKILL.md +16 -1
  89. package/rihal/skills/agents/zahra-branding/SKILL.md +15 -1
  90. package/rihal/skills/agents/zayd-ml/SKILL.md +17 -1
  91. package/rihal/skills/core/rihal-advanced-elicitation/SKILL.md +12 -0
  92. package/rihal/skills/core/rihal-brainstorming/SKILL.md +16 -0
  93. package/rihal/skills/core/rihal-clone-website/SKILL.md +21 -0
  94. package/rihal/skills/core/rihal-distillator/SKILL.md +8 -0
  95. package/rihal/skills/core/rihal-editorial-review-prose/SKILL.md +12 -0
  96. package/rihal/skills/core/rihal-editorial-review-structure/SKILL.md +18 -0
  97. package/rihal/skills/core/rihal-help/SKILL.md +12 -0
  98. package/rihal/skills/core/rihal-index-docs/SKILL.md +18 -0
  99. package/rihal/skills/core/rihal-init/SKILL.md +8 -0
  100. package/rihal/skills/core/rihal-party-mode/SKILL.md +14 -0
  101. package/rihal/skills/core/rihal-review-adversarial-general/SKILL.md +12 -0
  102. package/rihal/skills/core/rihal-review-edge-case-hunter/SKILL.md +18 -0
  103. package/rihal/skills/core/rihal-shard-doc/SKILL.md +18 -0
  104. package/rihal/team.yaml +205 -0
  105. package/rihal/templates/UAT.md +29 -0
  106. package/rihal/templates/milestone.md +2 -0
  107. package/rihal/templates/sprint.md +11 -28
  108. package/rihal/templates/summary.md +30 -0
  109. package/rihal/templates/verification-report.md +28 -0
  110. package/rihal/workflows/audit-milestone.md +34 -2
  111. package/rihal/workflows/audit.md +172 -0
  112. package/rihal/workflows/autonomous.md +67 -0
  113. package/rihal/workflows/checkpoint-preview.md +7 -0
  114. package/rihal/workflows/council.md +3 -1
  115. package/rihal/workflows/debug.md +8 -1
  116. package/rihal/workflows/diagnose-issues.md +34 -0
  117. package/rihal/workflows/do.md +47 -3
  118. package/rihal/workflows/document-project.md +1 -1
  119. package/rihal/workflows/execute-sprint.md +11 -4
  120. package/rihal/workflows/execute.md +9 -3
  121. package/rihal/workflows/help.md +1 -1
  122. package/rihal/workflows/karpathy-audit.md +7 -14
  123. package/rihal/workflows/pause-work.md +7 -1
  124. package/rihal/workflows/prfaq.md +7 -0
  125. package/rihal/workflows/profile-user.md +2 -2
  126. package/rihal/workflows/settings.md +116 -117
  127. package/rihal/workflows/ship.md +31 -1
  128. package/rihal/workflows/sprint-planning.md +39 -8
  129. package/rihal/workflows/status.md +5 -0
  130. package/rihal/workflows/ui-phase.md +3 -3
  131. package/rihal/workflows/update.md +80 -22
  132. package/rihal/workflows/validate-phase.md +7 -1
  133. package/server/dashboard.js +34 -575
  134. package/server/lib/api.js +123 -0
  135. package/server/lib/html/client.js +969 -0
  136. package/server/lib/html/css.js +416 -0
  137. package/server/lib/html/shell.js +230 -0
  138. package/server/lib/scanner.js +142 -0
  139. package/rihal/agents/rihal-ui-designer.md +0 -6
  140. package/rihal/skills/core/rihal-advanced-elicitation/rihal-advanced-elicitation/SKILL.md +0 -148
  141. package/rihal/skills/core/rihal-advanced-elicitation/rihal-advanced-elicitation/methods.csv +0 -51
  142. package/rihal/skills/core/rihal-shard-doc/rihal-shard-doc/SKILL.md +0 -122
  143. package/rihal/workflows/config.md +0 -105
@@ -0,0 +1,142 @@
1
+ /**
2
+ * State scanner — reads .rihal/ and .planning/ directories to build dashboard state.
3
+ */
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+
7
+ function safeReadJson(filepath) {
8
+ let raw;
9
+ try { raw = fs.readFileSync(filepath, 'utf8'); } catch { return null; }
10
+ try { return JSON.parse(raw); } catch (err) {
11
+ console.warn(`[dashboard] malformed JSON at ${filepath}: ${err.message}`);
12
+ return { __parseError: err.message };
13
+ }
14
+ }
15
+
16
+ function safeReadText(filepath) {
17
+ try { return fs.readFileSync(filepath, 'utf8'); } catch { return null; }
18
+ }
19
+
20
+ function listDir(dir) {
21
+ try { return fs.readdirSync(dir, { withFileTypes: true }); } catch { return []; }
22
+ }
23
+
24
+ function parseSimpleYaml(text) {
25
+ if (!text) return {};
26
+ const out = {};
27
+ for (const line of text.split('\n')) {
28
+ const m = line.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\s*:\s*(.+)/);
29
+ if (m) out[m[1].trim()] = m[2].trim();
30
+ }
31
+ return out;
32
+ }
33
+
34
+ function scanState(rihalDir) {
35
+ const projectDir = path.dirname(rihalDir);
36
+ const state = {
37
+ exists: fs.existsSync(rihalDir),
38
+ projectName: null,
39
+ raw: null,
40
+ rawParseError: null,
41
+ phases: [],
42
+ decisions: [],
43
+ blockers: [],
44
+ councilSessions: 0,
45
+ milestone: null,
46
+ currentPhase: null,
47
+ currentSprint: null,
48
+ planningFiles: [],
49
+ context: null,
50
+ lastScanned: new Date().toISOString(),
51
+ };
52
+
53
+ if (!state.exists) return state;
54
+
55
+ const rawResult = safeReadJson(path.join(rihalDir, 'state.json'));
56
+ if (rawResult && rawResult.__parseError) {
57
+ state.rawParseError = rawResult.__parseError;
58
+ state.raw = null;
59
+ } else {
60
+ state.raw = rawResult;
61
+ }
62
+
63
+ const cfg = parseSimpleYaml(safeReadText(path.join(rihalDir, 'config.yaml')));
64
+
65
+ // Fix #260: project name shows '.' — derive from directory name as fallback
66
+ const dirName = path.basename(projectDir);
67
+ state.projectName = state.raw?.project_name
68
+ || cfg.project_name
69
+ || state.raw?.project
70
+ || (dirName !== '.' ? dirName : 'Unknown project');
71
+
72
+ state.currentPhase = state.raw?.current_phase || null;
73
+ state.currentSprint = state.raw?.current_sprint || null;
74
+ state.milestone = state.raw?.milestone || null;
75
+ state.councilSessions = (state.raw?.council_sessions || []).length;
76
+
77
+ if (Array.isArray(state.raw?.phases)) {
78
+ const phasesDir = path.join(projectDir, '.planning', 'phases');
79
+ state.phases = state.raw.phases.map(p => {
80
+ const sprints = Array.isArray(p.sprints) ? p.sprints : [];
81
+ const allStories = sprints.flatMap(s => Array.isArray(s.stories) ? s.stories : []);
82
+ const done = allStories.filter(s => s.status === 'done' || s.status === 'completed').length;
83
+ const total = allStories.length;
84
+
85
+ const padded = String(p.id || p.number || '').padStart(2, '0');
86
+ let phaseDir = null, sprintFile = null;
87
+ try {
88
+ const dirs = fs.readdirSync(phasesDir, { withFileTypes: true });
89
+ const match = dirs.find(d => d.isDirectory() && d.name.startsWith(padded + '-'));
90
+ if (match) {
91
+ phaseDir = match.name;
92
+ const allMd = fs.readdirSync(path.join(phasesDir, match.name)).filter(f => f.endsWith('.md'));
93
+ const numbered = allMd.filter(f => /^\d{2}-\d{2}-/.test(f)).sort().reverse();
94
+ const chosen = numbered.length ? numbered[0] : allMd.sort().reverse()[0];
95
+ if (chosen) sprintFile = `.planning/phases/${match.name}/${chosen}`;
96
+ }
97
+ } catch { /* phasesDir missing */ }
98
+
99
+ return {
100
+ id: p.id,
101
+ name: p.name || p.slug || p.id,
102
+ status: p.status || (sprints[0]?.status) || 'planned',
103
+ sprints: sprints.length,
104
+ stories: total,
105
+ storiesDone: done,
106
+ goal: sprints[0]?.goal || null,
107
+ completed_at: p.completed_at || null,
108
+ sprintFile,
109
+ };
110
+ });
111
+ }
112
+
113
+ if (Array.isArray(state.raw?.decisions)) {
114
+ state.decisions = state.raw.decisions;
115
+ }
116
+
117
+ if (Array.isArray(state.raw?.blockers)) {
118
+ state.blockers = state.raw.blockers.filter(b => b && (typeof b === 'string' || b.title));
119
+ }
120
+
121
+ state.context = safeReadText(path.join(rihalDir, 'context', 'active.md'))
122
+ || safeReadText(path.join(projectDir, '.planning', 'CONTEXT.md'));
123
+
124
+ // Walk .planning/ for file tree
125
+ const planningDir = path.join(projectDir, '.planning');
126
+ function walkPlanning(dir, prefix) {
127
+ for (const entry of listDir(dir)) {
128
+ const full = path.join(dir, entry.name);
129
+ const rel = path.join(prefix, entry.name);
130
+ if (entry.isDirectory()) {
131
+ walkPlanning(full, rel);
132
+ } else if (entry.isFile() && entry.name.endsWith('.md')) {
133
+ state.planningFiles.push({ path: rel, name: entry.name });
134
+ }
135
+ }
136
+ }
137
+ if (fs.existsSync(planningDir)) walkPlanning(planningDir, '');
138
+
139
+ return state;
140
+ }
141
+
142
+ module.exports = { scanState, safeReadText, safeReadJson, listDir, parseSimpleYaml };
@@ -1,6 +0,0 @@
1
- ---
2
- name: rihal-ui-designer
3
- description: Alias for rihal-ux-designer. Use that agent type instead.
4
- ---
5
-
6
- This agent is an alias for `rihal-ux-designer`. Spawn `rihal-ux-designer` directly.
@@ -1,148 +0,0 @@
1
- ---
2
- name: rihal-advanced-elicitation
3
- description: 'Push the LLM to reconsider, refine, and improve its recent output. Use when user asks for deeper critique or mentions a known deeper critique method, e.g. socratic, first principles, pre-mortem, red team.'
4
- ---
5
-
6
- # Advanced Elicitation
7
-
8
- **Goal:** Push the LLM to reconsider, refine, and improve its recent output.
9
-
10
- ---
11
-
12
- ## CRITICAL LLM INSTRUCTIONS
13
-
14
- - **MANDATORY:** Execute ALL steps in the flow section IN EXACT ORDER
15
- - DO NOT skip steps or change the sequence
16
- - HALT immediately when halt-conditions are met
17
- - Each action within a step is a REQUIRED action to complete that step
18
- - Sections outside flow (validation, output, critical-context) provide essential context - review and apply throughout execution
19
- - **YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the `communication_language`**
20
-
21
- ---
22
-
23
- ## INTEGRATION (When Invoked Indirectly)
24
-
25
- When invoked from another prompt or process:
26
-
27
- 1. Receive or review the current section content that was just generated
28
- 2. Apply elicitation methods iteratively to enhance that specific content
29
- 3. Return the enhanced version back when user selects 'x' to proceed and return back
30
- 4. The enhanced content replaces the original section content in the output document
31
-
32
- ---
33
-
34
- ## FLOW
35
-
36
- ### Step 1: Method Registry Loading
37
-
38
- **Action:** Load and read `./methods.csv` and '{project-root}/.rihal/_config/agent-manifest.csv'
39
-
40
- #### CSV Structure
41
-
42
- - **category:** Method grouping (core, structural, risk, etc.)
43
- - **method_name:** Display name for the method
44
- - **description:** Rich explanation of what the method does, when to use it, and why it's valuable
45
- - **output_pattern:** Flexible flow guide using arrows (e.g., "analysis -> insights -> action")
46
-
47
- #### Context Analysis
48
-
49
- - Use conversation history
50
- - Analyze: content type, complexity, stakeholder needs, risk level, and creative potential
51
-
52
- #### Smart Selection
53
-
54
- 1. Analyze context: Content type, complexity, stakeholder needs, risk level, creative potential
55
- 2. Parse descriptions: Understand each method's purpose from the rich descriptions in CSV
56
- 3. Select 5 methods: Choose methods that best match the context based on their descriptions
57
- 4. Balance approach: Include mix of foundational and specialized techniques as appropriate
58
-
59
- ---
60
-
61
- ### Step 2: Present Options and Handle Responses
62
-
63
- #### Display Format
64
-
65
- ```
66
- **Advanced Elicitation Options**
67
- _If party mode is active, agents will join in._
68
- Choose a number (1-5), [r] to Reshuffle, [a] List All, or [x] to Proceed:
69
-
70
- 1. [Method Name]
71
- 2. [Method Name]
72
- 3. [Method Name]
73
- 4. [Method Name]
74
- 5. [Method Name]
75
- r. Reshuffle the list with 5 new options
76
- a. List all methods with descriptions
77
- x. Proceed / No Further Actions
78
- ```
79
-
80
- #### Response Handling
81
-
82
- **Case 1-5 (User selects a numbered method):**
83
-
84
- - Execute the selected method using its description from the CSV
85
- - Adapt the method's complexity and output format based on the current context
86
- - Apply the method creatively to the current section content being enhanced
87
- - Display the enhanced version showing what the method revealed or improved
88
- - **CRITICAL:** Ask the user if they would like to apply the changes to the doc (y/n/other) and HALT to await response.
89
- - **CRITICAL:** ONLY if Yes, apply the changes. IF No, discard your memory of the proposed changes. If any other reply, try best to follow the instructions given by the user.
90
- - **CRITICAL:** Re-present the same 1-5,r,x prompt to allow additional elicitations
91
-
92
- **Case r (Reshuffle):**
93
-
94
- - Select 5 random methods from methods.csv, present new list with same prompt format
95
- - When selecting, try to think and pick a diverse set of methods covering different categories and approaches, with 1 and 2 being potentially the most useful for the document or section being discovered
96
-
97
- **Case x (Proceed):**
98
-
99
- - Complete elicitation and proceed
100
- - Return the fully enhanced content back to the invoking skill
101
- - The enhanced content becomes the final version for that section
102
- - Signal completion back to the invoking skill to continue with next section
103
-
104
- **Case a (List All):**
105
-
106
- - List all methods with their descriptions from the CSV in a compact table
107
- - Allow user to select any method by name or number from the full list
108
- - After selection, execute the method as described in the Case 1-5 above
109
-
110
- **Case: Direct Feedback:**
111
-
112
- - Apply changes to current section content and re-present choices
113
-
114
- **Case: Multiple Numbers:**
115
-
116
- - Execute methods in sequence on the content, then re-offer choices
117
-
118
- ---
119
-
120
- ### Step 3: Execution Guidelines
121
-
122
- - **Method execution:** Use the description from CSV to understand and apply each method
123
- - **Output pattern:** Use the pattern as a flexible guide (e.g., "paths -> evaluation -> selection")
124
- - **Dynamic adaptation:** Adjust complexity based on content needs (simple to sophisticated)
125
- - **Creative application:** Interpret methods flexibly based on context while maintaining pattern consistency
126
- - Focus on actionable insights
127
- - **Stay relevant:** Tie elicitation to specific content being analyzed (the current section from the document being created unless user indicates otherwise)
128
- - **Identify personas:** For single or multi-persona methods, clearly identify viewpoints, and use party members if available in memory already
129
- - **Critical loop behavior:** Always re-offer the 1-5,r,a,x choices after each method execution
130
- - Continue until user selects 'x' to proceed with enhanced content, confirm or ask the user what should be accepted from the session
131
- - Each method application builds upon previous enhancements
132
- - **Content preservation:** Track all enhancements made during elicitation
133
- - **Iterative enhancement:** Each selected method (1-5) should:
134
- 1. Apply to the current enhanced version of the content
135
- 2. Show the improvements made
136
- 3. Return to the prompt for additional elicitations or completion
137
-
138
- ## Output Format
139
-
140
- - Method-guided elicitation session (5 Whys, JTBD, pre-mortem, etc. from `methods.csv`)
141
- - Captured answers structured for downstream PRD/roadmap use
142
- - No method imposed without user consent — pick based on question shape
143
-
144
- ## Examples
145
-
146
- ### Happy Path
147
- **Input:** "Help me think through whether to rewrite auth"
148
- **Expected:** Picks pre-mortem + 5 Whys from methods.csv, runs the session, surfaces hidden assumptions.
@@ -1,51 +0,0 @@
1
- num,category,method_name,description,output_pattern
2
- 1,collaboration,Stakeholder Round Table,Convene multiple personas to contribute diverse perspectives - essential for requirements gathering and finding balanced solutions across competing interests,perspectives → synthesis → alignment
3
- 2,collaboration,Expert Panel Review,Assemble domain experts for deep specialized analysis - ideal when technical depth and peer review quality are needed,expert views → consensus → recommendations
4
- 3,collaboration,Debate Club Showdown,Two personas argue opposing positions while a moderator scores points - great for exploring controversial decisions and finding middle ground,thesis → antithesis → synthesis
5
- 4,collaboration,User Persona Focus Group,Gather your product's user personas to react to proposals and share frustrations - essential for validating features and discovering unmet needs,reactions → concerns → priorities
6
- 5,collaboration,Time Traveler Council,Past-you and future-you advise present-you on decisions - powerful for gaining perspective on long-term consequences vs short-term pressures,past wisdom → present choice → future impact
7
- 6,collaboration,Cross-Functional War Room,Product manager + engineer + designer tackle a problem together - reveals trade-offs between feasibility desirability and viability,constraints → trade-offs → balanced solution
8
- 7,collaboration,Mentor and Apprentice,Senior expert teaches junior while junior asks naive questions - surfaces hidden assumptions through teaching,explanation → questions → deeper understanding
9
- 8,collaboration,Good Cop Bad Cop,Supportive persona and critical persona alternate - finds both strengths to build on and weaknesses to address,encouragement → criticism → balanced view
10
- 9,collaboration,Improv Yes-And,Multiple personas build on each other's ideas without blocking - generates unexpected creative directions through collaborative building,idea → build → build → surprising result
11
- 10,collaboration,Customer Support Theater,Angry customer and support rep roleplay to find pain points - reveals real user frustrations and service gaps,complaint → investigation → resolution → prevention
12
- 11,advanced,Tree of Thoughts,Explore multiple reasoning paths simultaneously then evaluate and select the best - perfect for complex problems with multiple valid approaches,paths → evaluation → selection
13
- 12,advanced,Graph of Thoughts,Model reasoning as an interconnected network of ideas to reveal hidden relationships - ideal for systems thinking and discovering emergent patterns,nodes → connections → patterns
14
- 13,advanced,Thread of Thought,Maintain coherent reasoning across long contexts by weaving a continuous narrative thread - essential for RAG systems and maintaining consistency,context → thread → synthesis
15
- 14,advanced,Self-Consistency Validation,Generate multiple independent approaches then compare for consistency - crucial for high-stakes decisions where verification matters,approaches → comparison → consensus
16
- 15,advanced,Meta-Prompting Analysis,Step back to analyze the approach structure and methodology itself - valuable for optimizing prompts and improving problem-solving,current → analysis → optimization
17
- 16,advanced,Reasoning via Planning,Build a reasoning tree guided by world models and goal states - excellent for strategic planning and sequential decision-making,model → planning → strategy
18
- 17,competitive,Red Team vs Blue Team,Adversarial attack-defend analysis to find vulnerabilities - critical for security testing and building robust solutions,defense → attack → hardening
19
- 18,competitive,Shark Tank Pitch,Entrepreneur pitches to skeptical investors who poke holes - stress-tests business viability and forces clarity on value proposition,pitch → challenges → refinement
20
- 19,competitive,Code Review Gauntlet,Senior devs with different philosophies review the same code - surfaces style debates and finds consensus on best practices,reviews → debates → standards
21
- 20,technical,Architecture Decision Records,Multiple architect personas propose and debate architectural choices with explicit trade-offs - ensures decisions are well-reasoned and documented,options → trade-offs → decision → rationale
22
- 21,technical,Rubber Duck Debugging Evolved,Explain your code to progressively more technical ducks until you find the bug - forces clarity at multiple abstraction levels,simple → detailed → technical → aha
23
- 22,technical,Algorithm Olympics,Multiple approaches compete on the same problem with benchmarks - finds optimal solution through direct comparison,implementations → benchmarks → winner
24
- 23,technical,Security Audit Personas,Hacker + defender + auditor examine system from different threat models - comprehensive security review from multiple angles,vulnerabilities → defenses → compliance
25
- 24,technical,Performance Profiler Panel,Database expert + frontend specialist + DevOps engineer diagnose slowness - finds bottlenecks across the full stack,symptoms → analysis → optimizations
26
- 25,creative,SCAMPER Method,Apply seven creativity lenses (Substitute/Combine/Adapt/Modify/Put/Eliminate/Reverse) - systematic ideation for product innovation,S→C→A→M→P→E→R
27
- 26,creative,Reverse Engineering,Work backwards from desired outcome to find implementation path - powerful for goal achievement and understanding endpoints,end state → steps backward → path forward
28
- 27,creative,What If Scenarios,Explore alternative realities to understand possibilities and implications - valuable for contingency planning and exploration,scenarios → implications → insights
29
- 28,creative,Random Input Stimulus,Inject unrelated concepts to spark unexpected connections - breaks creative blocks through forced lateral thinking,random word → associations → novel ideas
30
- 29,creative,Exquisite Corpse Brainstorm,Each persona adds to the idea seeing only the previous contribution - generates surprising combinations through constrained collaboration,contribution → handoff → contribution → surprise
31
- 30,creative,Genre Mashup,Combine two unrelated domains to find fresh approaches - innovation through unexpected cross-pollination,domain A + domain B → hybrid insights
32
- 31,research,Literature Review Personas,Optimist researcher + skeptic researcher + synthesizer review sources - balanced assessment of evidence quality,sources → critiques → synthesis
33
- 32,research,Thesis Defense Simulation,Student defends hypothesis against committee with different concerns - stress-tests research methodology and conclusions,thesis → challenges → defense → refinements
34
- 33,research,Comparative Analysis Matrix,Multiple analysts evaluate options against weighted criteria - structured decision-making with explicit scoring,options → criteria → scores → recommendation
35
- 34,risk,Pre-mortem Analysis,Imagine future failure then work backwards to prevent it - powerful technique for risk mitigation before major launches,failure scenario → causes → prevention
36
- 35,risk,Failure Mode Analysis,Systematically explore how each component could fail - critical for reliability engineering and safety-critical systems,components → failures → prevention
37
- 36,risk,Challenge from Critical Perspective,Play devil's advocate to stress-test ideas and find weaknesses - essential for overcoming groupthink,assumptions → challenges → strengthening
38
- 37,risk,Identify Potential Risks,Brainstorm what could go wrong across all categories - fundamental for project planning and deployment preparation,categories → risks → mitigations
39
- 38,risk,Chaos Monkey Scenarios,Deliberately break things to test resilience and recovery - ensures systems handle failures gracefully,break → observe → harden
40
- 39,core,First Principles Analysis,Strip away assumptions to rebuild from fundamental truths - breakthrough technique for innovation and solving impossible problems,assumptions → truths → new approach
41
- 40,core,5 Whys Deep Dive,Repeatedly ask why to drill down to root causes - simple but powerful for understanding failures,why chain → root cause → solution
42
- 41,core,Socratic Questioning,Use targeted questions to reveal hidden assumptions and guide discovery - excellent for teaching and self-discovery,questions → revelations → understanding
43
- 42,core,Critique and Refine,Systematic review to identify strengths and weaknesses then improve - standard quality check for drafts,strengths/weaknesses → improvements → refined
44
- 43,core,Explain Reasoning,Walk through step-by-step thinking to show how conclusions were reached - crucial for transparency,steps → logic → conclusion
45
- 44,core,Expand or Contract for Audience,Dynamically adjust detail level and technical depth for target audience - matches content to reader capabilities,audience → adjustments → refined content
46
- 45,learning,Feynman Technique,Explain complex concepts simply as if teaching a child - the ultimate test of true understanding,complex → simple → gaps → mastery
47
- 46,learning,Active Recall Testing,Test understanding without references to verify true knowledge - essential for identifying gaps,test → gaps → reinforcement
48
- 47,philosophical,Occam's Razor Application,Find the simplest sufficient explanation by eliminating unnecessary complexity - essential for debugging,options → simplification → selection
49
- 48,philosophical,Trolley Problem Variations,Explore ethical trade-offs through moral dilemmas - valuable for understanding values and difficult decisions,dilemma → analysis → decision
50
- 49,retrospective,Hindsight Reflection,Imagine looking back from the future to gain perspective - powerful for project reviews,future view → insights → application
51
- 50,retrospective,Lessons Learned Extraction,Systematically identify key takeaways and actionable improvements - essential for continuous improvement,experience → lessons → actions
@@ -1,122 +0,0 @@
1
- ---
2
- name: rihal-shard-doc
3
- description: 'Splits large markdown documents into smaller, organized files based on level 2 (default) sections. Use if the user says perform shard document'
4
- ---
5
-
6
- # Shard Document
7
-
8
- **Goal:** Split large markdown documents into smaller, organized files based on level 2 sections using `npx @kayvan/markdown-tree-parser`.
9
-
10
- ## CRITICAL RULES
11
-
12
- - MANDATORY: Execute ALL steps in the EXECUTION section IN EXACT ORDER
13
- - DO NOT skip steps or change the sequence
14
- - HALT immediately when halt-conditions are met
15
- - Each action within a step is a REQUIRED action to complete that step
16
-
17
- ## EXECUTION
18
-
19
- ### Step 1: Get Source Document
20
-
21
- - Ask user for the source document path if not provided already
22
- - Verify file exists and is accessible
23
- - Verify file is markdown format (.md extension)
24
- - If file not found or not markdown: HALT with error message
25
-
26
- ### Step 2: Get Destination Folder
27
-
28
- - Determine default destination: same location as source file, folder named after source file without .md extension
29
- - Example: `/path/to/architecture.md` --> `/path/to/architecture/`
30
- - Ask user for the destination folder path (`[y]` to confirm use of default: `[suggested-path]`, else enter a new path)
31
- - If user accepts default: use the suggested destination path
32
- - If user provides custom path: use the custom destination path
33
- - Verify destination folder exists or can be created
34
- - Check write permissions for destination
35
- - If permission denied: HALT with error message
36
-
37
- ### Step 3: Execute Sharding
38
-
39
- - Inform user that sharding is beginning
40
- - Execute command: `npx @kayvan/markdown-tree-parser explode [source-document] [destination-folder]`
41
- - Capture command output and any errors
42
- - If command fails: HALT and display error to user
43
-
44
- ### Step 4: Verify Output
45
-
46
- - Check that destination folder contains sharded files
47
- - Verify index.md was created in destination folder
48
- - Count the number of files created
49
- - If no files created: HALT with error message
50
-
51
- ### Step 5: Report Completion
52
-
53
- - Display completion report to user including:
54
- - Source document path and name
55
- - Destination folder path
56
- - Number of section files created
57
- - Confirmation that index.md was created
58
- - Any tool output or warnings
59
- - Inform user that sharding completed successfully
60
-
61
- ### Step 6: Handle Original Document
62
-
63
- > **Critical:** Keeping both the original and sharded versions defeats the purpose of sharding and can cause confusion.
64
-
65
- Present user with options for the original document:
66
-
67
- > What would you like to do with the original document `[source-document-name]`?
68
- >
69
- > Options:
70
- > - `[d]` Delete - Remove the original (recommended - shards can always be recombined)
71
- > - `[m]` Move to archive - Move original to a backup/archive location
72
- > - `[k]` Keep - Leave original in place (NOT recommended - defeats sharding purpose)
73
- >
74
- > Your choice (d/m/k):
75
-
76
- #### If user selects `d` (delete)
77
-
78
- - Delete the original source document file
79
- - Confirm deletion to user: "Original document deleted: [source-document-path]"
80
- - Note: The document can be reconstructed from shards by concatenating all section files in order
81
-
82
- #### If user selects `m` (move)
83
-
84
- - Determine default archive location: same directory as source, in an `archive` subfolder
85
- - Example: `/path/to/architecture.md` --> `/path/to/archive/architecture.md`
86
- - Ask: Archive location (`[y]` to use default: `[default-archive-path]`, or provide custom path)
87
- - If user accepts default: use default archive path
88
- - If user provides custom path: use custom archive path
89
- - Create archive directory if it does not exist
90
- - Move original document to archive location
91
- - Confirm move to user: "Original document moved to: [archive-path]"
92
-
93
- #### If user selects `k` (keep)
94
-
95
- - Display warning to user:
96
- - Keeping both original and sharded versions is NOT recommended
97
- - The discover_inputs protocol may load the wrong version
98
- - Updates to one will not reflect in the other
99
- - Duplicate content taking up space
100
- - Consider deleting or archiving the original document
101
- - Confirm user choice: "Original document kept at: [source-document-path]"
102
-
103
- ## HALT CONDITIONS
104
-
105
- - HALT if npx command fails or produces no output files
106
-
107
- ## Output Format
108
-
109
- - Original doc preserved as index (TOC linking to shards)
110
- - Shards at `{doc_stem}/{shard-slug}.md` under the parent's dir
111
- - Each shard stays under 500 lines
112
- - Cross-shard references via relative markdown links
113
-
114
- ## Examples
115
-
116
- ### Happy Path
117
- **Input:** "Shard this 1500-line PRD into sections"
118
- **Expected:** PRD.md becomes index; sections split into PRD/{section-slug}.md files. Links preserved.
119
-
120
- ### Negative Test
121
- **Input:** Shard a document under 500 lines
122
- **Expected:** Refuse — too small to benefit from sharding. Suggest alternative.
@@ -1,105 +0,0 @@
1
- # Workflow: rihal:config
2
-
3
- <purpose>
4
- View or interactively edit Rihal project configuration (language, mode, model profile, branching strategy).
5
- </purpose>
6
-
7
- ## Step 0 — Usage check
8
-
9
- If `$ARGUMENTS` is empty or contains only `--help` or `-h`:
10
-
11
- ```
12
- /rihal:config [show | set <key> <value>]
13
- ```
14
-
15
- **Examples:**
16
- ```
17
- /rihal:config show
18
- /rihal:config set communication_language Arabic
19
- /rihal:config set mode yolo
20
- ```
21
-
22
- If no arguments provided, enter interactive mode (Step 2).
23
-
24
- ## Step 1 — Parse input
25
-
26
- - If first argument is `show` (or no args): proceed to Step 1.5 (display current config)
27
- - If first argument is `set`: proceed to Step 2 (update value)
28
- - Otherwise: treat as interactive mode
29
-
30
- ## Step 1.5 — Display current config
31
-
32
- Read `.rihal/config.yaml` and print in formatted table:
33
-
34
- ```
35
- Current Rihal Configuration:
36
- user_name : {value}
37
- project_name : {value}
38
- communication_language : {value}
39
- mode : {value}
40
- model_profile : {value}
41
- branching_strategy : {value}
42
- ```
43
-
44
- STOP — do not proceed further.
45
-
46
- ## Step 2 — Interactive or set mode
47
-
48
- ### If `set <key> <value>`:
49
-
50
- Validate key is one of: `communication_language`, `mode`, `model_profile`, `branching_strategy`.
51
-
52
- If invalid, print error and STOP:
53
- ```
54
- Unknown config key: {key}
55
- Allowed keys: communication_language, mode, model_profile, branching_strategy
56
- ```
57
-
58
- Call:
59
- ```bash
60
- node .rihal/bin/rihal-tools.cjs config set --key {key} --value {value}
61
- ```
62
-
63
- Print success:
64
- ```
65
- ✓ Updated: {key} = {value}
66
- ```
67
-
68
- STOP.
69
-
70
- ### If no arguments (interactive mode):
71
-
72
- Use AskUserQuestion for each setting:
73
-
74
- 1. Ask: "Communication language?" (show current value)
75
- - Options: English, Arabic, Spanish, French, Chinese, etc.
76
- 2. Ask: "Mode?" (guided or yolo?)
77
- - guided = confirm at gates
78
- - yolo = autonomous execution
79
- 3. Ask: "Model profile?" (balanced, fast, or thorough?)
80
- 4. Ask: "Branching strategy?" (none, auto-branch, feature-branch, trunk-based?)
81
-
82
- After each selection, call the config set command from Step 2.
83
-
84
- Print summary:
85
- ```
86
- ✓ Configuration updated:
87
- communication_language : {value}
88
- mode : {value}
89
- model_profile : {value}
90
- branching_strategy : {value}
91
- ```
92
-
93
- STOP.
94
-
95
- ## Success Criteria
96
-
97
- - [ ] Current config displayed or updated successfully
98
- - [ ] No validation errors
99
- - [ ] .rihal/config.yaml reflects changes
100
-
101
- ## On Error
102
-
103
- - **Invalid key:** print allowed keys and stop.
104
- - **.rihal/config.yaml missing:** print "No config found. Run /rihal:init first."
105
- - **rihal-tools.cjs missing:** tell user to run `rihal-code install-v2`.