@hanzlaa/rcode 2.8.0 → 3.1.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 (120) hide show
  1. package/AGENTS.md +11 -1
  2. package/CONTRIBUTING.md +7 -0
  3. package/README.md +39 -20
  4. package/package.json +2 -2
  5. package/rihal/agents/rihal-advisor-researcher.md +1 -1
  6. package/rihal/agents/rihal-assumptions-analyzer.md +1 -1
  7. package/rihal/agents/rihal-codebase-mapper.md +1 -1
  8. package/rihal/agents/rihal-docs-auditor.md +3 -3
  9. package/rihal/agents/rihal-executor.md +10 -0
  10. package/rihal/agents/rihal-integration-checker.md +1 -1
  11. package/rihal/agents/rihal-noor.md +2 -2
  12. package/rihal/agents/rihal-phase-researcher.md +1 -1
  13. package/rihal/agents/rihal-planner.md +25 -0
  14. package/rihal/agents/rihal-project-researcher.md +1 -1
  15. package/rihal/agents/rihal-research-synthesizer.md +1 -1
  16. package/rihal/agents/rihal-roadmapper.md +1 -1
  17. package/rihal/agents/rihal-sprint-checker.md +19 -1
  18. package/rihal/agents/rihal-verifier.md +1 -1
  19. package/rihal/agents/rihal-waleed.md +1 -2
  20. package/rihal/commands/code-review.md +1 -1
  21. package/rihal/commands/memory-audit.md +10 -0
  22. package/rihal/commands/memory-distill.md +11 -0
  23. package/rihal/commands/memory-init.md +12 -0
  24. package/rihal/commands/memory-update.md +12 -0
  25. package/rihal/config/model-profiles.json +5 -5
  26. package/rihal/references/karpathy-guidelines-full.md +1 -1
  27. package/rihal/references/no-unauthorized-git-ops.md +1 -1
  28. package/rihal/references/verb-dictionary.md +1 -1
  29. package/rihal/skills/actions/2-plan/rihal-frontend-design/SKILL.md +49 -139
  30. package/rihal/skills/actions/2-plan/rihal-frontend-design/references.md +79 -0
  31. package/rihal/skills/actions/4-implementation/rihal-browser-verify/SKILL.md +70 -0
  32. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +1 -1
  33. package/rihal/skills/actions/4-implementation/rihal-ci/SKILL.md +108 -0
  34. package/rihal/skills/actions/4-implementation/rihal-debug/SKILL.md +78 -0
  35. package/rihal/skills/actions/4-implementation/rihal-git-flow/SKILL.md +90 -0
  36. package/rihal/skills/actions/4-implementation/rihal-harden/SKILL.md +91 -0
  37. package/rihal/skills/actions/4-implementation/rihal-incremental/SKILL.md +50 -0
  38. package/rihal/skills/actions/4-implementation/rihal-migrate/SKILL.md +86 -0
  39. package/rihal/skills/actions/4-implementation/rihal-perf/SKILL.md +96 -0
  40. package/rihal/skills/actions/4-implementation/rihal-prove-it/SKILL.md +64 -0
  41. package/rihal/skills/actions/4-implementation/rihal-source-truth/SKILL.md +76 -0
  42. package/rihal/skills/actions/4-implementation/rihal-trim/SKILL.md +73 -0
  43. package/rihal/skills/agents/dalil-scout/SKILL.md +43 -125
  44. package/rihal/skills/agents/dalil-scout/references.md +67 -0
  45. package/rihal/skills/agents/majlis-council/SKILL.md +50 -144
  46. package/rihal/skills/agents/majlis-council/references.md +90 -0
  47. package/rihal/skills/agents/raees-orchestrator/SKILL.md +56 -117
  48. package/rihal/skills/agents/raees-orchestrator/references.md +47 -0
  49. package/rihal/skills/core/rihal-advanced-elicitation/SKILL.md +36 -136
  50. package/rihal/skills/core/rihal-advanced-elicitation/references.md +101 -0
  51. package/rihal/skills/core/rihal-auth-audit/SKILL.md +93 -0
  52. package/rihal/skills/core/rihal-brainstorming/SKILL.md +5 -0
  53. package/rihal/skills/core/rihal-client-gate/SKILL.md +91 -0
  54. package/rihal/skills/core/rihal-clone-website/SKILL.md +30 -371
  55. package/rihal/skills/core/rihal-clone-website/references.md +213 -0
  56. package/rihal/skills/core/rihal-deploy-unify/SKILL.md +87 -0
  57. package/rihal/skills/core/rihal-distillator/SKILL.md +37 -187
  58. package/rihal/skills/core/rihal-distillator/references.md +118 -0
  59. package/rihal/skills/core/rihal-editorial-review-prose/SKILL.md +5 -0
  60. package/rihal/skills/core/rihal-editorial-review-structure/SKILL.md +45 -183
  61. package/rihal/skills/core/rihal-editorial-review-structure/references.md +110 -0
  62. package/rihal/skills/core/rihal-help/SKILL.md +6 -1
  63. package/rihal/skills/core/rihal-incident-record/SKILL.md +161 -0
  64. package/rihal/skills/core/rihal-index-docs/SKILL.md +5 -0
  65. package/rihal/skills/core/rihal-init/SKILL.md +5 -0
  66. package/rihal/skills/core/rihal-memory-audit/SKILL.md +88 -0
  67. package/rihal/skills/core/rihal-memory-distill/SKILL.md +87 -0
  68. package/rihal/skills/core/rihal-memory-init/SKILL.md +77 -0
  69. package/rihal/skills/core/rihal-memory-update/SKILL.md +73 -0
  70. package/rihal/skills/core/rihal-mvp-graduate/SKILL.md +116 -0
  71. package/rihal/skills/core/rihal-ocr-consistency/SKILL.md +106 -0
  72. package/rihal/skills/core/rihal-party-mode/SKILL.md +5 -0
  73. package/rihal/skills/core/rihal-rebrand/SKILL.md +133 -0
  74. package/rihal/skills/core/rihal-review-adversarial-general/SKILL.md +5 -0
  75. package/rihal/skills/core/rihal-review-edge-case-hunter/SKILL.md +5 -0
  76. package/rihal/skills/core/rihal-shard-doc/SKILL.md +5 -0
  77. package/rihal/skills/core/rihal-theme-system/SKILL.md +113 -0
  78. package/rihal/team.yaml +3 -22
  79. package/rihal/templates/memory/INDEX.md +46 -0
  80. package/rihal/templates/memory/change-records/.gitkeep +4 -0
  81. package/rihal/templates/memory/distillates/project.distillate.md +11 -0
  82. package/rihal/templates/memory/distillates/stack.distillate.md +11 -0
  83. package/rihal/templates/memory/incidents/known-issues.md +27 -0
  84. package/rihal/templates/memory/incidents/post-mortems/.gitkeep +3 -0
  85. package/rihal/templates/memory/milestones/archive/.gitkeep +2 -0
  86. package/rihal/templates/memory/milestones/current.md +39 -0
  87. package/rihal/templates/memory/people/stakeholders.md +25 -0
  88. package/rihal/templates/memory/people/team.md +35 -0
  89. package/rihal/templates/memory/project/decisions.md +32 -0
  90. package/rihal/templates/memory/project/glossary.md +16 -0
  91. package/rihal/templates/memory/project/stack.md +46 -0
  92. package/rihal/workflows/audit.md +3 -3
  93. package/rihal/workflows/code-review.md +32 -1
  94. package/rihal/workflows/council.md +1 -1
  95. package/rihal/workflows/discuss-phase-power.md +3 -3
  96. package/rihal/workflows/do.md +1 -1
  97. package/rihal/workflows/docs-update.md +4 -4
  98. package/rihal/workflows/execute.md +61 -5
  99. package/rihal/workflows/help.md +5 -5
  100. package/rihal/workflows/karpathy-audit.md +9 -9
  101. package/rihal/workflows/memory-audit.md +83 -0
  102. package/rihal/workflows/memory-distill.md +103 -0
  103. package/rihal/workflows/memory-init.md +102 -0
  104. package/rihal/workflows/memory-update.md +83 -0
  105. package/rihal/workflows/plan.md +66 -1
  106. package/server/dashboard.js +6 -1
  107. package/server/lib/api.js +8 -2
  108. package/server/lib/html/client.js +63 -0
  109. package/server/lib/html/shell.js +5 -0
  110. package/server/lib/scanner.js +76 -1
  111. package/rihal/agents/rihal-architect.md +0 -79
  112. package/rihal/agents/rihal-tech-writer.md +0 -80
  113. package/rihal/commands/check-implementation-readiness.md +0 -8
  114. package/rihal/commands/discuss-phase-power.md +0 -11
  115. package/rihal/commands/karpathy-audit.md +0 -12
  116. package/rihal/commands/new-project-research.md +0 -11
  117. package/rihal/commands/new-project-roadmap.md +0 -11
  118. package/rihal/commands/report.md +0 -10
  119. package/rihal/commands/review-adversarial.md +0 -8
  120. package/rihal/commands/review-edge-case-hunter.md +0 -8
@@ -118,3 +118,8 @@ Three-column markdown table:
118
118
  ### Negative boundary
119
119
  **User:** "restructure this document"
120
120
  **Result:** Not prose review → route to `rihal-editorial-review-structure`
121
+
122
+ ## Memory Bank Hooks
123
+
124
+ - **Reads:** the document under review; `style_guide` if provided
125
+ - **Writes:** nothing — produces a recommendations report only
@@ -1,211 +1,73 @@
1
1
  ---
2
2
  name: rihal-editorial-review-structure
3
- description: 'Structural editor that proposes cuts, reorganization, and simplification while preserving comprehension. Use when user requests structural review or editorial review of structure'
3
+ description: Structural editor that proposes cuts, reorganization, and consolidation while preserving comprehension. Use when the user requests structural review, "review the structure of this doc", or "tighten this document". Run before copy editing. For prose-level fixes (typos, grammar, word choice) use rihal-editorial-review-prose instead.
4
4
  triggers:
5
5
  - "editorial review structure"
6
+ - "structural review"
7
+ - "tighten this doc"
8
+ - "review document structure"
9
+ - "cut this doc down"
10
+ user-invocable: true
6
11
  ---
7
12
 
8
- # Editorial Review - Structure
13
+ ## Overview
9
14
 
10
- **Goal:** Review document structure and propose substantive changes to improve clarity and flow -- run this BEFORE copy editing.
15
+ Structural editor focused on high-value density. Reviews a document's organisation and proposes substantive changes cut, merge, move, condense — without altering content. Brevity equals clarity; every section must justify its existence. Outputs prioritised recommendations the user accepts or rejects. **Content is sacrosanct** — never challenge ideas, only optimise how they are organised. Detailed principles, structure models, and the recommendation schema live in [`references.md`](references.md).
11
16
 
12
- **Your Role:** You are a structural editor focused on HIGH-VALUE DENSITY. Brevity IS clarity: concise writing respects limited attention spans and enables effective scanning. Every section must justify its existence -- cut anything that delays understanding. True redundancy is failure. Follow ALL steps in the STEPS section IN EXACT ORDER. DO NOT skip steps or change the sequence. HALT immediately when halt-conditions are met. Each action within a step is a REQUIRED action to complete that step.
17
+ ## Inputs
13
18
 
14
- > **STYLE GUIDE OVERRIDE:** If a style_guide input is provided, it overrides ALL generic principles in this task (including human-reader-principles, llm-reader-principles, reader_type-specific priorities, structure-models selection, and the Microsoft Writing Style Guide baseline). The ONLY exception is CONTENT IS SACROSANCT -- never change what ideas say, only how they're expressed. When style guide conflicts with this task, style guide wins.
19
+ - `content` (required) the document
20
+ - `style_guide` (optional) — overrides all generic principles in this skill except "content is sacrosanct"
21
+ - `purpose` (optional) — e.g. "quickstart tutorial", "API reference"
22
+ - `target_audience` (optional) — e.g. "new users", "decision makers"
23
+ - `reader_type` (optional, default `humans`) — `humans` preserves comprehension aids; `llm` optimises for precision and density
24
+ - `length_target` (optional) — e.g. "30% shorter", "no limit"
15
25
 
16
- **Inputs:**
17
- - **content** (required) -- Document to review (markdown, plain text, or structured content)
18
- - **style_guide** (optional) -- Project-specific style guide. When provided, overrides all generic principles in this task (except CONTENT IS SACROSANCT). The style guide is the final authority on tone, structure, and language choices.
19
- - **purpose** (optional) -- Document's intended purpose (e.g., 'quickstart tutorial', 'API reference', 'conceptual overview')
20
- - **target_audience** (optional) -- Who reads this? (e.g., 'new users', 'experienced developers', 'decision makers')
21
- - **reader_type** (optional, default: "humans") -- 'humans' (default) preserves comprehension aids; 'llm' optimizes for precision and density
22
- - **length_target** (optional) -- Target reduction (e.g., '30% shorter', 'half the length', 'no limit')
26
+ ## Process
23
27
 
24
- ## Overview
28
+ 1. **Validate input.** HALT if content is fewer than 3 words or `reader_type` is invalid. Note current word and section counts.
29
+ 2. **Understand purpose.** Use provided `purpose` and `target_audience` or infer them. Pick the structure model that fits (Tutorial / Reference / Explanation / Prompt / Pyramid — see references).
30
+ 3. **Structural analysis.** If `style_guide` provided, consult it first. Map every section's word count. Test against the model's rules (e.g. "does the recommendation come first?" for Pyramid). Identify cuts, merges, moves, splits, true redundancies, scope violations, buried critical information.
31
+ 4. **Flow analysis.** Does the sequence match how readers use the doc? Look for premature detail, missing scaffolding, FAQs that should be inline, appendices that should be cut, summaries that repeat the body verbatim.
32
+ 5. **Generate recommendations.** Categorise each: `CUT`, `MERGE`, `MOVE`, `CONDENSE`, `QUESTION`, `PRESERVE`. One-sentence rationale, estimated word impact. Flag cuts that may hurt comprehension when `reader_type=humans`.
33
+ 6. **Output.** Document summary + prioritised recommendations + total estimated reduction. If nothing to fix: "No substantive changes recommended — document structure is sound." (valid completion, not an error.)
25
34
 
26
- Editorial review structure skill for Rihal Code.
27
-
28
- ## Principles
29
-
30
- - Comprehension through calibration: Optimize for the minimum words needed to maintain understanding
31
- - Front-load value: Critical information comes first; nice-to-know comes last (or goes)
32
- - One source of truth: If information appears identically twice, consolidate
33
- - Scope discipline: Content that belongs in a different document should be cut or linked
34
- - Propose, don't execute: Output recommendations -- user decides what to accept
35
- - **CONTENT IS SACROSANCT: Never challenge ideas -- only optimize how they're organized.**
36
-
37
- ## Human-Reader Principles
38
-
39
- These elements serve human comprehension and engagement -- preserve unless clearly wasteful:
40
-
41
- - Visual aids: Diagrams, images, and flowcharts anchor understanding
42
- - Expectation-setting: "What You'll Learn" helps readers confirm they're in the right place
43
- - Reader's Journey: Organize content biologically (linear progression), not logically (database)
44
- - Mental models: Overview before details prevents cognitive overload
45
- - Warmth: Encouraging tone reduces anxiety for new users
46
- - Whitespace: Admonitions and callouts provide visual breathing room
47
- - Summaries: Recaps help retention; they're reinforcement, not redundancy
48
- - Examples: Concrete illustrations make abstract concepts accessible
49
- - Engagement: "Flow" techniques (transitions, variety) are functional, not "fluff" -- they maintain attention
50
-
51
- ## LLM-Reader Principles
52
-
53
- When reader_type='llm', optimize for PRECISION and UNAMBIGUITY:
54
-
55
- - Dependency-first: Define concepts before usage to minimize hallucination risk
56
- - Cut emotional language, encouragement, and orientation sections
57
- - IF concept is well-known from training (e.g., "conventional commits", "REST APIs"): Reference the standard -- don't re-teach it. ELSE: Be explicit -- don't assume the LLM will infer correctly.
58
- - Use consistent terminology -- same word for same concept throughout
59
- - Eliminate hedging ("might", "could", "generally") -- use direct statements
60
- - Prefer structured formats (tables, lists, YAML) over prose
61
- - Reference known standards ("conventional commits", "Google style guide") to leverage training
62
- - STILL PROVIDE EXAMPLES even for known standards -- grounds the LLM in your specific expectation
63
- - Unambiguous references -- no unclear antecedents ("it", "this", "the above")
64
- - Note: LLM documents may be LONGER than human docs in some areas (more explicit) while shorter in others (no warmth)
65
-
66
- ## Structure Models
67
-
68
- ### Tutorial/Guide (Linear)
69
- **Applicability:** Tutorials, detailed guides, how-to articles, walkthroughs
70
- - Prerequisites: Setup/Context MUST precede action
71
- - Sequence: Steps must follow strict chronological or logical dependency order
72
- - Goal-oriented: clear 'Definition of Done' at the end
73
-
74
- ### Reference/Database
75
- **Applicability:** API docs, glossaries, configuration references, cheat sheets
76
- - Random Access: No narrative flow required; user jumps to specific item
77
- - MECE: Topics are Mutually Exclusive and Collectively Exhaustive
78
- - Consistent Schema: Every item follows identical structure (e.g., Signature to Params to Returns)
79
-
80
- ### Explanation (Conceptual)
81
- **Applicability:** Deep dives, architecture overviews, conceptual guides, whitepapers, project context
82
- - Abstract to Concrete: Definition to Context to Implementation/Example
83
- - Scaffolding: Complex ideas built on established foundations
84
-
85
- ### Prompt/Task Definition (Functional)
86
- **Applicability:** Rihal tasks, prompts, system instructions, XML definitions
87
- - Meta-first: Inputs, usage constraints, and context defined before instructions
88
- - Separation of Concerns: Instructions (logic) separate from Data (content)
89
- - Step-by-step: Execution flow must be explicit and ordered
90
-
91
- ### Strategic/Context (Pyramid)
92
- **Applicability:** PRDs, research reports, proposals, decision records
93
- - Top-down: Conclusion/Status/Recommendation starts the document
94
- - Grouping: Supporting context grouped logically below the headline
95
- - Ordering: Most critical information first
96
- - MECE: Arguments/Groups are Mutually Exclusive and Collectively Exhaustive
97
- - Evidence: Data supports arguments, never leads
98
-
99
- ## STEPS
100
-
101
- ### Step 1: Validate Input
102
-
103
- - Check if content is empty or contains fewer than 3 words
104
- - If empty or fewer than 3 words, HALT with error: "Content too short for substantive review (minimum 3 words required)"
105
- - Validate reader_type is "humans" or "llm" (or not provided, defaulting to "humans")
106
- - If reader_type is invalid, HALT with error: "Invalid reader_type. Must be 'humans' or 'llm'"
107
- - Identify document type and structure (headings, sections, lists, etc.)
108
- - Note the current word count and section count
109
-
110
- ### Step 2: Understand Purpose
111
-
112
- - If purpose was provided, use it; otherwise infer from content
113
- - If target_audience was provided, use it; otherwise infer from content
114
- - Identify the core question the document answers
115
- - State in one sentence: "This document exists to help [audience] accomplish [goal]"
116
- - Select the most appropriate structural model from Structure Models based on purpose/audience
117
- - Note reader_type and which principles apply (Human-Reader Principles or LLM-Reader Principles)
118
-
119
- ### Step 3: Structural Analysis (CRITICAL)
120
-
121
- - If style_guide provided, consult style_guide now and note its key requirements -- these override default principles for this analysis
122
- - Map the document structure: list each major section with its word count
123
- - Evaluate structure against the selected model's primary rules (e.g., 'Does recommendation come first?' for Pyramid)
124
- - For each section, answer: Does this directly serve the stated purpose?
125
- - If reader_type='humans', for each comprehension aid (visual, summary, example, callout), answer: Does this help readers understand or stay engaged?
126
- - Identify sections that could be: cut entirely, merged with another, moved to a different location, or split
127
- - Identify true redundancies: identical information repeated without purpose (not summaries or reinforcement)
128
- - Identify scope violations: content that belongs in a different document
129
- - Identify burying: critical information hidden deep in the document
130
-
131
- ### Step 4: Flow Analysis
132
-
133
- - Assess the reader's journey: Does the sequence match how readers will use this?
134
- - Identify premature detail: explanation given before the reader needs it
135
- - Identify missing scaffolding: complex ideas without adequate setup
136
- - Identify anti-patterns: FAQs that should be inline, appendices that should be cut, overviews that repeat the body verbatim
137
- - If reader_type='humans', assess pacing: Is there enough whitespace and visual variety to maintain attention?
138
-
139
- ### Step 5: Generate Recommendations
140
-
141
- - Compile all findings into prioritized recommendations
142
- - Categorize each recommendation: CUT (remove entirely), MERGE (combine sections), MOVE (reorder), CONDENSE (shorten significantly), QUESTION (needs author decision), PRESERVE (explicitly keep -- for elements that might seem cuttable but serve comprehension)
143
- - For each recommendation, state the rationale in one sentence
144
- - Estimate impact: how many words would this save (or cost, for PRESERVE)?
145
- - If length_target was provided, assess whether recommendations meet it
146
- - If reader_type='humans' and recommendations would cut comprehension aids, flag with warning: "This cut may impact reader comprehension/engagement"
147
-
148
- ### Step 6: Output Results
149
-
150
- - Output document summary (purpose, audience, reader_type, current length)
151
- - Output the recommendation list in priority order
152
- - Output estimated total reduction if all recommendations accepted
153
- - If no recommendations, output: "No substantive changes recommended -- document structure is sound"
154
-
155
- Use the following output format:
35
+ ## Output Format
156
36
 
157
37
  ```markdown
158
38
  ## Document Summary
159
- - **Purpose:** [inferred or provided purpose]
160
- - **Audience:** [inferred or provided audience]
161
- - **Reader type:** [selected reader type]
162
- - **Structure model:** [selected structure model]
163
- - **Current length:** [X] words across [Y] sections
39
+ - Purpose: ...
40
+ - Audience: ...
41
+ - Reader type: humans | llm
42
+ - Structure model: tutorial | reference | explanation | prompt | pyramid
43
+ - Current length: X words across Y sections
164
44
 
165
45
  ## Recommendations
166
-
167
- ### 1. [CUT/MERGE/MOVE/CONDENSE/QUESTION/PRESERVE] - [Section or element name]
168
- **Rationale:** [One sentence explanation]
169
- **Impact:** ~[X] words
170
- **Comprehension note:** [If applicable, note impact on reader understanding]
171
-
172
- ### 2. ...
46
+ ### 1. [CUT|MERGE|MOVE|CONDENSE|QUESTION|PRESERVE] — Section name
47
+ Rationale: ...
48
+ Impact: ~X words
49
+ Comprehension note: (if applicable)
173
50
 
174
51
  ## Summary
175
- - **Total recommendations:** [N]
176
- - **Estimated reduction:** [X] words ([Y]% of original)
177
- - **Meets length target:** [Yes/No/No target specified]
178
- - **Comprehension trade-offs:** [Note any cuts that sacrifice reader engagement for brevity]
52
+ - Total recommendations: N
53
+ - Estimated reduction: X words (Y%)
54
+ - Meets length target: Yes | No | no target specified
55
+ - Comprehension trade-offs: ...
179
56
  ```
180
57
 
181
- ## HALT CONDITIONS
182
-
183
- - HALT with error if content is empty or fewer than 3 words
184
- - HALT with error if reader_type is not "humans" or "llm"
185
- - If no structural issues found, output "No substantive changes recommended" (this is valid completion, not an error)
58
+ ## Examples
186
59
 
187
- ## Workflow
60
+ **Happy path** — `structural review of this tutorial` → 6 recommendations (2 CUT, 1 MERGE, 2 MOVE, 1 CONDENSE) → ~30% reduction estimated.
188
61
 
189
- 1. Read the user request and extract key parameters.
190
- 2. Execute the skill logic as described in the Overview.
191
- 3. Return output in the format specified below.
62
+ **Edge case already tight** Output: "No substantive changes recommended — document structure is sound."
192
63
 
193
- ## Output Format
64
+ **Negative wrong skill** — `fix the typos in this doc` is prose, not structure. Route to `rihal-editorial-review-prose`.
194
65
 
195
- - Structured Markdown response
196
- - Headers for each section
197
- - Concise, actionable content
198
-
199
- ## Examples
66
+ ## Memory Bank Hooks
200
67
 
201
- ### Happy path
202
- **User:** "structural review of this tutorial"
203
- **Result:** Document Summary → 6 recommendations (2 CUT, 1 MERGE, 2 MOVE, 1 CONDENSE) → estimated 30% reduction
68
+ - **Reads:** the document passed in; `style_guide` if referenced
69
+ - **Writes:** nothing produces a recommendations report only
204
70
 
205
- ### Edge case
206
- **User:** "structural review" + well-structured doc
207
- **Result:** "No substantive changes recommended — document structure is sound"
71
+ ## Detailed reference
208
72
 
209
- ### Negative boundary
210
- **User:** "fix the typos in this doc"
211
- **Result:** Not structural → route to `rihal-editorial-review-prose`
73
+ See [`references.md`](references.md) for: the full principle list, human-reader vs LLM-reader principles, the five structure models with applicability rules, and HALT conditions.
@@ -0,0 +1,110 @@
1
+ # Editorial Review (Structure) — Detailed Reference
2
+
3
+ Detailed principles and models for [`SKILL.md`](SKILL.md).
4
+
5
+ ---
6
+
7
+ ## Core principles
8
+
9
+ - **Comprehension through calibration** — minimum words needed to maintain understanding.
10
+ - **Front-load value** — critical information first; nice-to-know last (or cut).
11
+ - **One source of truth** — if information appears identically twice, consolidate.
12
+ - **Scope discipline** — content that belongs in a different document should be cut or linked.
13
+ - **Propose, don't execute** — output recommendations; the user decides what to accept.
14
+ - **Content is sacrosanct** — never challenge ideas, only optimise how they're organised.
15
+
16
+ ---
17
+
18
+ ## Human-reader principles (preserve unless clearly wasteful)
19
+
20
+ When `reader_type=humans`:
21
+
22
+ - **Visual aids** — diagrams, images, flowcharts anchor understanding.
23
+ - **Expectation-setting** — "What you'll learn" helps readers confirm fit.
24
+ - **Reader's journey** — organise biologically (linear progression), not logically (database).
25
+ - **Mental models** — overview before details prevents cognitive overload.
26
+ - **Warmth** — encouraging tone reduces anxiety for new users.
27
+ - **Whitespace** — admonitions and callouts provide visual breathing room.
28
+ - **Summaries** — recaps reinforce; they're not redundancy.
29
+ - **Examples** — concrete illustrations make abstract concepts accessible.
30
+ - **Engagement** — transitions and variety maintain attention; they're functional, not "fluff".
31
+
32
+ ---
33
+
34
+ ## LLM-reader principles (when `reader_type=llm`)
35
+
36
+ Optimise for precision and unambiguity:
37
+
38
+ - **Dependency-first** — define concepts before usage to minimise hallucination risk.
39
+ - **Cut emotional language**, encouragement, orientation sections.
40
+ - **Reference known standards** ("conventional commits", "Google style guide") — leverage training. But still provide examples to ground specific expectations.
41
+ - **Consistent terminology** — same word for same concept throughout.
42
+ - **Eliminate hedging** — no "might", "could", "generally". Direct statements.
43
+ - **Prefer structured formats** — tables, lists, YAML — over prose.
44
+ - **Unambiguous references** — no unclear antecedents like "it", "this", "the above".
45
+
46
+ LLM-targeted documents may be longer than human ones in some areas (more explicit) and shorter in others (no warmth).
47
+
48
+ ---
49
+
50
+ ## Structure models
51
+
52
+ Pick the one matching the document's purpose.
53
+
54
+ ### Tutorial / Guide (Linear)
55
+ **For:** tutorials, how-to articles, walkthroughs.
56
+ - Prerequisites: setup must precede action.
57
+ - Sequence: strict chronological or logical dependency order.
58
+ - Goal-oriented: clear "Definition of Done" at the end.
59
+
60
+ ### Reference / Database
61
+ **For:** API docs, glossaries, configuration references, cheat sheets.
62
+ - Random access — no narrative flow required; users jump to specific items.
63
+ - MECE — topics are Mutually Exclusive and Collectively Exhaustive.
64
+ - Consistent schema — every item follows identical structure (Signature → Params → Returns).
65
+
66
+ ### Explanation (Conceptual)
67
+ **For:** deep dives, architecture overviews, conceptual guides, project context.
68
+ - Abstract → concrete: definition → context → implementation/example.
69
+ - Scaffolding: complex ideas built on established foundations.
70
+
71
+ ### Prompt / Task Definition (Functional)
72
+ **For:** Rihal tasks, prompts, system instructions, XML definitions.
73
+ - Meta-first: inputs, usage constraints, context defined before instructions.
74
+ - Separation of concerns: instructions (logic) separate from data (content).
75
+ - Step-by-step: execution flow explicit and ordered.
76
+
77
+ ### Strategic / Context (Pyramid)
78
+ **For:** PRDs, research reports, proposals, decision records.
79
+ - Top-down: conclusion / status / recommendation starts the document.
80
+ - Grouping: supporting context grouped logically below the headline.
81
+ - Ordering: most critical information first.
82
+ - MECE: arguments are Mutually Exclusive and Collectively Exhaustive.
83
+ - Evidence: data supports arguments, never leads.
84
+
85
+ ---
86
+
87
+ ## Recommendation categories
88
+
89
+ | Category | Use when |
90
+ |---|---|
91
+ | `CUT` | Section adds no value to the stated purpose; remove entirely |
92
+ | `MERGE` | Two sections cover overlapping ground; combine |
93
+ | `MOVE` | Critical information is buried, or details precede their setup |
94
+ | `CONDENSE` | Section is needed but verbose — shorten significantly |
95
+ | `QUESTION` | Decision the author needs to make (not the editor's call) |
96
+ | `PRESERVE` | Element looks cuttable but actually serves comprehension — explicitly keep |
97
+
98
+ ---
99
+
100
+ ## HALT conditions
101
+
102
+ - HALT with error if content is empty or fewer than 3 words.
103
+ - HALT with error if `reader_type` is not `humans` or `llm`.
104
+ - If no structural issues found: output "No substantive changes recommended — document structure is sound." (Valid completion, not an error.)
105
+
106
+ ---
107
+
108
+ ## Style guide override
109
+
110
+ If a `style_guide` is provided, it overrides all generic principles in this skill — including human-reader principles, LLM-reader principles, structure-model selection, and the Microsoft Writing Style Guide baseline. The single exception is **content is sacrosanct**: never change what ideas say, only how they're expressed.
@@ -65,7 +65,7 @@ module,skill,display-name,menu-code,description,action,args,phase,after,before,r
65
65
  For each recommended item, present:
66
66
  - `[menu-code]` **Display name** — e.g., "[CP] Create PRD"
67
67
  - Skill name in backticks — e.g., `rihal-create-prd`
68
- - For multi-action skills: action invocation context — e.g., "tech-writer lets create a mermaid diagram!"
68
+ - For multi-action skills: action invocation context — e.g., "noor lets create a mermaid diagram!"
69
69
  - Description if present in CSV; otherwise your existing knowledge of the skill suffices
70
70
  - Args if available
71
71
 
@@ -101,3 +101,8 @@ Status summary of current workflow position, then ordered list of recommended ne
101
101
  ### Negative boundary
102
102
  **User:** "help me write a React component"
103
103
  **Result:** Not a Rihal workflow question → route to `rihal-dev-story` or answer directly
104
+
105
+ ## Memory Bank Hooks
106
+
107
+ - **Reads:** nothing — `help` is pure reference output
108
+ - **Writes:** nothing — read-only
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: rihal-incident-record
3
+ description: Generate a change record + post-mortem in one flow. Use after resolving any production incident, deploying any non-trivial change, or making any decision that future-you will need to retrace. Implements the verified Rihal change-record format from `template/docs/change_records/`. Pairs with rihal-debug — once the bug is rooted-out, this skill writes the record.
4
+ triggers:
5
+ - "incident record"
6
+ - "post mortem"
7
+ - "change record"
8
+ - "document this incident"
9
+ - "write a postmortem"
10
+ - "record this change"
11
+ - "rca write up"
12
+ - "incident summary"
13
+ user-invocable: true
14
+ ---
15
+
16
+ ## Overview
17
+
18
+ Every production change deserves a record; every incident deserves a post-mortem. This skill produces both in the documented Rihal format, so the team builds an institutional memory rather than repeating the same Slack-message-as-archaeology pattern. Output goes to the Memory Bank automatically — `.rihal/memory/change-records/` for changes, `.rihal/memory/incidents/post-mortems/` for incidents.
19
+
20
+ ## Two formats
21
+
22
+ ### Change record (`change-records/YYYYMMDD-NNN.md`)
23
+
24
+ Mirrors the Rihal template at `template/docs/change_records/20250514-001.md`. Use for any deploy, schema change, infra change, or anything you'd want to find again in 6 months.
25
+
26
+ ```markdown
27
+ ### Change ID
28
+ `YYYYMMDD-NNN`
29
+
30
+ ### Date of Change
31
+ YYYY-MM-DD
32
+
33
+ ### Requester
34
+ <name + role>
35
+
36
+ ### Change Owner
37
+ <name + team>
38
+
39
+ ### Change Category
40
+ Backend (BE) | Frontend (FE) | Infra | Data | Security
41
+
42
+ ### Change Type
43
+ Hotfix | Standard release | Schema migration | Config change
44
+
45
+ ### Change Description
46
+ <one paragraph — what changed, why, what users see>
47
+
48
+ ### Related Tickets / References
49
+ - GitHub PR: #N
50
+ - Issue: #M
51
+ - Related change records: <links>
52
+
53
+ ### Risk Assessment
54
+ Low | Medium | High | Emergency
55
+ - <specific risks identified>
56
+
57
+ ### Deployment Method
58
+ <Helm | Compose | manual | gradual rollout %>
59
+
60
+ ### Approval
61
+ Approved by: <name>
62
+ Approval date: YYYY-MM-DD
63
+
64
+ ### Rollback Plan
65
+ <exact steps to revert; test the rollback in staging first if possible>
66
+
67
+ ### Verification & Outcome
68
+ Successful | Partial | Rolled back
69
+ - <verification steps and outcomes>
70
+
71
+ ### Post-Change Notes
72
+ <anything useful for future-you>
73
+ ```
74
+
75
+ ### Post-mortem (`incidents/post-mortems/YYYYMMDD-<slug>.md`)
76
+
77
+ For resolved incidents. Format below.
78
+
79
+ ```markdown
80
+ # Incident — <one-line headline>
81
+
82
+ **Date:** YYYY-MM-DD
83
+ **Duration:** <X minutes>
84
+ **Severity:** SEV1 (customer-facing data loss) | SEV2 (degraded service) | SEV3 (internal)
85
+ **Detection:** <how we noticed — Sentry alert, customer report, internal monitoring>
86
+ **Resolution:** <one sentence>
87
+
88
+ ## Timeline
89
+
90
+ - HH:MM — <event>
91
+ - HH:MM — <event>
92
+ - HH:MM — <resolution>
93
+
94
+ ## Root cause
95
+
96
+ <one paragraph, mechanism not symptom>
97
+
98
+ ## Contributing factors
99
+
100
+ - <factor 1>
101
+ - <factor 2>
102
+
103
+ ## What worked
104
+
105
+ - <what helped us recover quickly>
106
+
107
+ ## What didn't
108
+
109
+ - <what slowed us down — be honest, not defensive>
110
+
111
+ ## Action items
112
+
113
+ - [ ] <preventive measure> — owner — by when
114
+ - [ ] <detective measure> — owner — by when
115
+ - [ ] <documentation update> — owner — by when
116
+
117
+ ## Memory Bank update
118
+
119
+ - known-issues.md: <removed | updated>
120
+ - decisions.md: <appended new decision if relevant>
121
+ ```
122
+
123
+ ## Workflow
124
+
125
+ 1. **Detect type:** is this a planned change (change record) or a resolved incident (post-mortem)? Both can apply if a change caused an incident.
126
+ 2. **Gather facts.** From Sentry, PRs, deploy logs, Slack threads. Quote verbatim where useful.
127
+ 3. **Generate the document** using the appropriate template.
128
+ 4. **Save to the Memory Bank** at the right path. ID format `YYYYMMDD-NNN` (sequence per day).
129
+ 5. **Update related Memory Bank files:**
130
+ - Remove the issue from `known-issues.md` if a real fix shipped.
131
+ - Append a decision to `decisions.md` if the post-mortem produced one.
132
+ 6. **Schedule a follow-up review** if action items remain — 1 week typical.
133
+
134
+ ## Output Format
135
+
136
+ The skill writes the file directly. Output to the user is a confirmation:
137
+
138
+ ```
139
+ ✓ Change record saved to .rihal/memory/change-records/20260426-001.md
140
+ Type: <type>
141
+ Severity / Risk: <level>
142
+
143
+ Memory Bank updates:
144
+ → known-issues.md: removed entry "<title>"
145
+ → decisions.md: appended decision "<title>"
146
+
147
+ Action items: <count> open, <count> due this week
148
+ ```
149
+
150
+ ## Examples
151
+
152
+ **Happy path — change record** — Deployed Postgres 16 upgrade. Auto-generates change-records/20260426-001.md with risk: medium, rollback: Helm rollback to previous chart version, verification: ground-truth queries pass. Approved by Hanzla, deployed gradually with 24h soak.
153
+
154
+ **Happy path — post-mortem** — Login broke for Arabic usernames for 3h. Root cause: client_encoding mismatch on a new Postgres replica. Timeline + actions + Memory Bank update (remove the bug from known-issues, add a CI check that asserts client_encoding = utf8). One follow-up: add ground-truth tests for non-ASCII auth.
155
+
156
+ **Negative — "we resolved it on Slack, no need for a doc"** — Refuse. Slack threads decay; Memory Bank persists. The 10 minutes spent writing the post-mortem saves an hour the next time the same class of bug appears.
157
+
158
+ ## Memory Bank Hooks
159
+
160
+ - **Reads:** `.rihal/memory/incidents/known-issues.md` (so we know what to clean up)
161
+ - **Writes:** `.rihal/memory/change-records/YYYYMMDD-NNN.md` (changes); `.rihal/memory/incidents/post-mortems/YYYYMMDD-<slug>.md` (incidents); plus updates to `known-issues.md` and `decisions.md` as side-effects
@@ -96,3 +96,8 @@ Index docs skill for Rihal Code.
96
96
  **User:** "document this project"
97
97
  **Result:** Not indexing → route to `rihal-document-project`
98
98
  - Skip hidden files (starting with .) unless specified
99
+
100
+ ## Memory Bank Hooks
101
+
102
+ - **Reads:** every doc in the indexing scope
103
+ - **Writes:** the index file at the configured output path; does NOT modify `.rihal/memory/` (use `rcode-memory-distill` for memory bank index regeneration)
@@ -125,3 +125,8 @@ JSON config vars returned to the calling skill. When init path runs, interactive
125
125
  ### Negative boundary
126
126
  **User:** "initialize my project"
127
127
  **Result:** rihal-init is internal — user should use `rihal-scaffold-project` or `/rihal:install` instead
128
+
129
+ ## Memory Bank Hooks
130
+
131
+ - **Reads:** `package.json`, existing `.rihal/state.json` to detect prior runs
132
+ - **Writes:** `.rihal/config.yaml`, `.rihal/state.json`, `.rihal/context/active.md`, `.rihal/context/project-brief.md`, `.rihal/RIHLA.md`. Bootstraps the project so all subsequent rcode skills have a stable root.