@neikyun/ciel 6.11.3 → 6.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/.claude/agents/ciel-critic.md +71 -12
- package/assets/.claude/agents/ciel-explorer.md +59 -18
- package/assets/.claude/agents/ciel-improver.md +6 -3
- package/assets/.claude/agents/ciel-researcher.md +85 -25
- package/assets/.claude/hooks/block-destructive.sh +2 -2
- package/assets/.claude/hooks/check-test-first.sh +2 -2
- package/assets/.claude/hooks/memory-bootstrap.sh +0 -0
- package/assets/.claude/hooks/memory-engine.py +82 -15
- package/assets/.claude/hooks/post-tool-write.sh +32 -0
- package/assets/.claude/hooks/pre-agent-gate.sh +11 -6
- package/assets/.claude/hooks/pre-compact.sh +18 -0
- package/assets/.claude/hooks/pre-tool-write.sh +56 -31
- package/assets/.claude/hooks/session-start.sh +22 -1
- package/assets/.claude/hooks/session-version-check.sh +1 -1
- package/assets/.claude/hooks/stop.sh +104 -0
- package/assets/.claude/hooks/subagent-stop.sh +54 -0
- package/assets/.claude/hooks/track-file.sh +2 -2
- package/assets/.claude/hooks/user-prompt-submit.sh +11 -15
- package/assets/.claude/settings.json +18 -4
- package/assets/AGENTS.md +1 -1
- package/assets/CLAUDE.md +103 -175
- package/assets/commands/ciel-audit.md +58 -399
- package/assets/commands/ciel-create-skill.md +24 -38
- package/assets/commands/ciel-eval.md +25 -37
- package/assets/commands/ciel-init.md +36 -126
- package/assets/commands/ciel-status.md +22 -19
- package/assets/commands/ciel-update.md +20 -39
- package/assets/platforms/opencode/.opencode/agents/ciel-researcher.md +71 -895
- package/assets/platforms/opencode/.opencode/commands/ciel-audit.md +58 -296
- package/assets/platforms/opencode/.opencode/commands/ciel-create-skill.md +24 -46
- package/assets/platforms/opencode/.opencode/commands/ciel-eval.md +25 -45
- package/assets/platforms/opencode/.opencode/commands/ciel-init.md +36 -131
- package/assets/platforms/opencode/.opencode/commands/ciel-status.md +22 -24
- package/assets/platforms/opencode/.opencode/commands/ciel-update.md +20 -40
- package/assets/platforms/opencode/AGENTS.md +4 -4
- package/assets/rules/security.md +30 -0
- package/assets/rules/testing.md +23 -0
- package/assets/skills/agile/SKILL.md +42 -0
- package/assets/skills/alerting/SKILL.md +55 -0
- package/assets/skills/api-design/SKILL.md +46 -0
- package/assets/skills/appsec/SKILL.md +43 -0
- package/assets/skills/architecture/SKILL.md +74 -0
- package/assets/skills/backend/SKILL.md +41 -0
- package/assets/skills/backup-recovery/SKILL.md +42 -0
- package/assets/skills/caching/SKILL.md +44 -0
- package/assets/skills/cdn/SKILL.md +42 -0
- package/assets/skills/chaos/SKILL.md +41 -0
- package/assets/skills/cicd-pipeline/SKILL.md +56 -0
- package/assets/skills/cloud/SKILL.md +42 -0
- package/assets/skills/code-quality/SKILL.md +42 -0
- package/assets/skills/code-review/SKILL.md +41 -0
- package/assets/skills/communication/SKILL.md +42 -0
- package/assets/skills/containers/SKILL.md +42 -0
- package/assets/skills/cqrs/SKILL.md +41 -0
- package/assets/skills/crypto/SKILL.md +46 -0
- package/assets/skills/data-engineering/SKILL.md +42 -0
- package/assets/skills/database-design/SKILL.md +46 -0
- package/assets/skills/ddd/SKILL.md +45 -0
- package/assets/skills/deployment-strategies/SKILL.md +51 -0
- package/assets/skills/desktop/SKILL.md +42 -0
- package/assets/skills/devsecops/SKILL.md +43 -0
- package/assets/skills/event-driven/SKILL.md +46 -0
- package/assets/skills/frontend/SKILL.md +41 -0
- package/assets/skills/functional/SKILL.md +42 -0
- package/assets/skills/high-availability/SKILL.md +42 -0
- package/assets/skills/iac/SKILL.md +46 -0
- package/assets/skills/logging/SKILL.md +46 -0
- package/assets/skills/meta/ciel-improve/SKILL.md +127 -0
- package/assets/skills/meta/learnings-capture/SKILL.md +105 -0
- package/assets/skills/meta/patch-spec/patch-spec.md +50 -0
- package/assets/skills/meta/skill-creator/SKILL.md +115 -0
- package/assets/skills/meta/skill-freshness-auditor/SKILL.md +164 -0
- package/assets/skills/meta/skill-variant-evaluator/SKILL.md +100 -0
- package/assets/skills/meta/skills-first-design-auditor/SKILL.md +192 -0
- package/assets/skills/ml-engineering/SKILL.md +42 -0
- package/assets/skills/mobile/SKILL.md +42 -0
- package/assets/skills/monitoring/SKILL.md +54 -0
- package/assets/skills/networking/SKILL.md +42 -0
- package/assets/skills/nosql/SKILL.md +41 -0
- package/assets/skills/oop-solid/SKILL.md +42 -0
- package/assets/skills/performance/SKILL.md +41 -0
- package/assets/skills/reactive/SKILL.md +42 -0
- package/assets/skills/release-management/SKILL.md +51 -0
- package/assets/skills/research/fact-check-claims/SKILL.md +98 -0
- package/assets/skills/research/research-forums/SKILL.md +103 -0
- package/assets/skills/research/research-github-issues/SKILL.md +103 -0
- package/assets/skills/research/research-web-sources/SKILL.md +108 -0
- package/assets/skills/research/synthesize-findings/SKILL.md +112 -0
- package/assets/skills/research/validate-source-credibility/SKILL.md +103 -0
- package/assets/skills/resilience/SKILL.md +41 -0
- package/assets/skills/serverless/SKILL.md +42 -0
- package/assets/skills/servers/SKILL.md +41 -0
- package/assets/skills/sql/SKILL.md +45 -0
- package/assets/skills/supply-chain/SKILL.md +41 -0
- package/assets/skills/system-design/SKILL.md +91 -0
- package/assets/skills/tech-leadership/SKILL.md +46 -0
- package/assets/skills/testing/SKILL.md +41 -0
- package/assets/skills/tracing/SKILL.md +36 -0
- package/assets/skills/utility/branch-cleaner/SKILL.md +195 -0
- package/assets/skills/utility/branch-setup/SKILL.md +144 -0
- package/assets/skills/utility/changelog-updater/SKILL.md +125 -0
- package/assets/skills/utility/commit-writer/SKILL.md +154 -0
- package/assets/skills/utility/issue-closer/SKILL.md +106 -0
- package/assets/skills/utility/issue-creator/SKILL.md +200 -0
- package/assets/skills/utility/pr-merger/SKILL.md +189 -0
- package/assets/skills/utility/pr-opener/SKILL.md +180 -0
- package/assets/skills/utility/release-publisher/SKILL.md +224 -0
- package/assets/skills/workflow/ciel-dev-process/SKILL.md +94 -0
- package/assets/skills/workflow/faire-gatekeeper/SKILL.md +3 -1
- package/assets/skills/workflow/prouver-verifier/SKILL.md +11 -2
- package/dist/cli/check.d.ts +1 -0
- package/dist/cli/check.d.ts.map +1 -1
- package/dist/cli/check.js +15 -2
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/claude.d.ts.map +1 -1
- package/dist/cli/claude.js +0 -2
- package/dist/cli/claude.js.map +1 -1
- package/dist/cli/index.js +6 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +11 -2
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/opencode.d.ts.map +1 -1
- package/dist/cli/opencode.js +2 -1
- package/dist/cli/opencode.js.map +1 -1
- package/package.json +1 -1
- package/assets/commands/ciel-migrate.md +0 -35
- package/assets/commands/ciel-refresh.md +0 -91
|
@@ -1,430 +1,89 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Audits the current
|
|
2
|
+
description: Audits the current session for Ciel v7 paradigm violations — dispatch discipline, hook activity, skill coverage, agent quality, memory health. Produces a structured report with Ciel Health Score (0-100). Creates GitHub Issue if score < 90. Hook-independent — works even when Ciel hooks are broken.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# /ciel-audit — Session
|
|
5
|
+
# /ciel-audit — Session Post-Mortem
|
|
6
6
|
|
|
7
|
-
*Generates a structured report of Ciel behavior violations observed in the current session
|
|
7
|
+
*Generates a structured report of Ciel behavior violations observed in the current session with a Ciel Health Score (0-100). If score < 90, creates a GitHub Issue on KaosKyun/Ciel.*
|
|
8
8
|
|
|
9
9
|
Usage: `/ciel-audit`
|
|
10
10
|
|
|
11
|
-
Runs inline
|
|
11
|
+
Runs inline. No agent dispatch. Works without hooks.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## Instructions to the model
|
|
16
|
-
|
|
17
|
-
You are auditing the **current conversation session** — the one you are participating in right now. Jump directly to the analysis. No preamble. No meta-commentary. No "I will now audit…".
|
|
18
|
-
|
|
19
|
-
### What to audit
|
|
20
|
-
|
|
21
|
-
Scan the session's tool-use history (your own prior turns). For each `/ciel <task>` invocation in this session, check the **eight dimensions** below. For each dimension, assign a severity and penalty score to calculate the final Ciel Health Score.
|
|
22
|
-
|
|
23
|
-
#### Dimension 1: Dispatch discipline (critical) — penalty up to -25
|
|
24
|
-
|
|
25
|
-
- Did the assistant emit a `Task(subagent_type="ciel-*")` within the **first 3 tool calls** after the `/ciel` prompt?
|
|
26
|
-
- If NO: count the inline `Bash` / `Read` / `Grep` / `Glob` / `WebSearch` / `WebFetch` calls emitted in the main session before any dispatch. This is the v2.1.5 anti-pattern documented in `skills/ciel/SKILL.md:146-156`.
|
|
27
|
-
- Exception: Trivial tasks (rename, typo, 1-line fix, docs-only) are allowed to run inline.
|
|
28
|
-
- Severity→score:
|
|
29
|
-
- Critical dispatch violation (Standard/Critical task with no Task()): **-25**
|
|
30
|
-
- High (delayed dispatch, >1 inline tool before dispatch): **-15**
|
|
31
|
-
- OK (Task() within first 3 tool calls): **0**
|
|
32
|
-
|
|
33
|
-
#### Dimension 2: Hook activity (critical) — penalty up to -25
|
|
34
|
-
|
|
35
|
-
Search the session transcript for strings that Ciel hooks would have injected:
|
|
36
|
-
|
|
37
|
-
- `"CIEL depth hint:"` — from `hooks/user-prompt-submit.sh:36`, injected via `additionalContext` on every UserPromptSubmit.
|
|
38
|
-
- `"CIEL "` prefix (e.g., `"CIEL [CRITIQUE]"`, `"CIEL src/...` ) — from `hooks/pre-tool-write.sh:34,36`, injected before every Write/Edit.
|
|
39
|
-
- Session banner from `hooks/session-start.sh` (SessionStart context).
|
|
40
|
-
- `"META-CRITIQUER"` or similar end-of-session signal from `hooks/stop.sh`.
|
|
41
|
-
|
|
42
|
-
- None found despite writes/edits: **-25** → hooks broken
|
|
43
|
-
- Partial (some hooks firing but not all): **-10**
|
|
44
|
-
- All present: **0**
|
|
45
|
-
|
|
46
|
-
Most likely root cause: relative paths in `Ciel/settings.json:8,19,31,42,54,65,76`. The `command` field is written as `bash .claude/plugins/ciel/hooks/<file>.sh`, which Claude Code resolves against the current working directory, not the plugin directory.
|
|
47
|
-
|
|
48
|
-
#### Dimension 3: Skill invocation coverage vs depth — penalty up to -15
|
|
49
|
-
|
|
50
|
-
Cross-reference `skills/ciel/SKILL.md:20-64` (Depth Gauge) with what actually happened:
|
|
51
|
-
|
|
52
|
-
- **Standard** task → `researcher` and `explorer` agents must be dispatched in parallel before FAIRE. Missing both: **-15**. Missing one: **-8**.
|
|
53
|
-
- **Critical** task → must additionally invoke `stride-analyzer` and `security-regression-check`. Missing: **-15**.
|
|
54
|
-
- Depth ambiguous and `depth-classifier` not invoked: **-5**.
|
|
55
|
-
|
|
56
|
-
#### Dimension 4: Skill overlap / redundancy — penalty up to -10
|
|
57
|
-
|
|
58
|
-
- Both `relire-critic` AND `critiquer-auditor` on the same diff: **-10**
|
|
59
|
-
- `meta-critiquer` did not fire at end-of-task: **-5**
|
|
60
|
-
- Same skill invoked 3+ times for same scope: **-5**
|
|
61
|
-
|
|
62
|
-
#### Dimension 5: Agent report quality — penalty up to -5
|
|
63
|
-
|
|
64
|
-
- Any `Task(subagent_type="ciel-*")` with returned message under 200 tokens: **-5** per occurrence (max -10)
|
|
65
|
-
|
|
66
|
-
#### Dimension 6: Intent routing hits / misses — penalty up to -10
|
|
67
|
-
|
|
68
|
-
Scan the user's `/ciel` prompt text against the intent signals in `SKILL.md:79-94`. For each matched intent, verify the corresponding skill was invoked. Each miss: **-5** (max -10).
|
|
69
|
-
|
|
70
|
-
#### Dimension 7: npm version staleness — penalty up to -10
|
|
71
|
-
|
|
72
|
-
Check if a newer version of Ciel is available on npm:
|
|
13
|
+
## Audit Dimensions (10)
|
|
73
14
|
|
|
74
|
-
|
|
75
|
-
NPM_VERSION=$(npm view @neikyun/ciel version 2>/dev/null || echo "unknown")
|
|
76
|
-
LOCAL_VERSION=$(cat /path/to/VERSION 2>/dev/null || cat package.json 2>/dev/null | grep '"version"' | head -1 | cut -d'"' -f4 || echo "unknown")
|
|
77
|
-
```
|
|
15
|
+
Score starts at 100. Subtract penalties for each violation found.
|
|
78
16
|
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
17
|
+
### D1: Dispatch discipline (up to -25)
|
|
18
|
+
Did the assistant dispatch `ciel-researcher` + `ciel-explorer` in parallel within the first 3 tool calls after the user prompt on Standard+ tasks?
|
|
19
|
+
- Missing both on Standard/Critical: **-25**
|
|
20
|
+
- Delayed dispatch (>1 inline tool before dispatch): **-15**
|
|
21
|
+
- Exception: Trivial tasks (rename, typo) allowed inline.
|
|
82
22
|
|
|
83
|
-
|
|
84
|
-
|
|
23
|
+
### D2: Hook activity (up to -25)
|
|
24
|
+
Search session transcript for Ciel hook injections:
|
|
25
|
+
- `"CIEL depth hint:"` (UserPromptSubmit)
|
|
26
|
+
- `"CIEL"` prefix on pre-write warnings
|
|
27
|
+
- SessionStart banner
|
|
28
|
+
- None found despite writes/edits: **-25** (hooks broken)
|
|
29
|
+
- Partial (some firing): **-10**
|
|
85
30
|
|
|
86
|
-
|
|
31
|
+
### D3: Skill coverage vs depth (up to -15)
|
|
32
|
+
- Standard task: missing researcher+explorer dispatch: **-15** each
|
|
33
|
+
- Critical task: missing stride-analyzer: **-15**
|
|
34
|
+
- Depth ambiguous + depth-classifier not invoked: **-5**
|
|
87
35
|
|
|
88
|
-
|
|
36
|
+
### D4: Skill overlap / redundancy (up to -10)
|
|
37
|
+
- Both relire-critic AND critiquer-auditor on same diff: **-10**
|
|
38
|
+
- meta-critiquer did not fire at end-of-task: **-5**
|
|
89
39
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
CLAUDE_AGENTS=$(ls .claude/agents/ciel-*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
93
|
-
CLAUDE_HOOK=$(test -f .claude/hooks/session-start.sh && echo "1" || echo "0")
|
|
94
|
-
CLAUDE_SETTINGS=$(test -f .claude/settings.json && echo "1" || echo "0")
|
|
95
|
-
echo "Claude: agents=$CLAUDE_AGENTS hook=$CLAUDE_HOOK settings=$CLAUDE_SETTINGS"
|
|
96
|
-
if [ "$CLAUDE_AGENTS" -ge 3 ] && [ "$CLAUDE_HOOK" = "1" ] && [ "$CLAUDE_SETTINGS" = "1" ]; then
|
|
97
|
-
echo "Claude platform: OK"
|
|
98
|
-
else
|
|
99
|
-
echo "Claude platform: INCOMPLETE"
|
|
100
|
-
fi
|
|
101
|
-
```
|
|
102
|
-
Expected: at least 3 agent files + session-start.sh + settings.json
|
|
40
|
+
### D5: Agent report quality (up to -10)
|
|
41
|
+
- Any agent return under 200 tokens: **-5** per occurrence (max -10)
|
|
103
42
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
# Plugin file may be ciel.ts (legacy) or ciel.js (v6+ runtime); accept either.
|
|
107
|
-
OPENCODE_PLUGIN=$( ( test -f .opencode/plugins/ciel.ts || test -f .opencode/plugins/ciel.js ) && echo "1" || echo "0")
|
|
108
|
-
OPENCODE_AGENTS=$(ls .opencode/agents/ciel-*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
109
|
-
OPENCODE_COMMANDS=$(ls .opencode/commands/ciel*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
110
|
-
echo "OpenCode: plugin=$OPENCODE_PLUGIN agents=$OPENCODE_AGENTS commands=$OPENCODE_COMMANDS"
|
|
111
|
-
if [ "$OPENCODE_PLUGIN" = "1" ] && [ "$OPENCODE_AGENTS" -ge 3 ] && [ "$OPENCODE_COMMANDS" -ge 5 ]; then
|
|
112
|
-
echo "OpenCode platform: OK"
|
|
113
|
-
else
|
|
114
|
-
echo "OpenCode platform: INCOMPLETE"
|
|
115
|
-
fi
|
|
116
|
-
```
|
|
117
|
-
Expected: ciel plugin (ciel.ts or ciel.js) + at least 3 agent files + at least 5 command files
|
|
43
|
+
### D6: Intent routing (up to -10)
|
|
44
|
+
Cross-reference user prompt intent signals with skills invoked. Each miss: **-5** (max -10).
|
|
118
45
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
- One platform missing or incomplete: **-3**
|
|
122
|
-
- Both platforms missing or critically incomplete: **-5**
|
|
46
|
+
### D7: Version staleness (up to -10)
|
|
47
|
+
Check npm for newer `@neikyun/ciel` version. Remote > local: **-10**.
|
|
123
48
|
|
|
124
|
-
|
|
49
|
+
### D8: Platform health (up to -5)
|
|
50
|
+
Verify Claude Code (3+ agents, session-start.sh, settings.json) and OpenCode (plugin, 3+ agents, 5+ commands). Missing platform: **-3** to **-5**.
|
|
125
51
|
|
|
126
|
-
|
|
52
|
+
### D9: Memory health (up to -15)
|
|
53
|
+
- `.ciel/memory/index.json` missing: **-10**
|
|
54
|
+
- Episodes empty: **-5**
|
|
55
|
+
- Auto-memory contamination (MEMORY.md newer than Ciel episodes): **-5**
|
|
127
56
|
|
|
128
|
-
|
|
57
|
+
### D10: Memory insight quality (up to -10)
|
|
58
|
+
Run `python3 .claude/hooks/memory-engine.py analyze`. Check: promotion candidates, dead anchors, recursion drift, tag explosion.
|
|
129
59
|
|
|
130
|
-
|
|
131
|
-
- **index.json exists but episodes/ empty**: `.ciel/memory/episodes/` has no files. Bootstrap ran but no memories were ingested, or the directory structure is incomplete. **-5**
|
|
132
|
-
- **Low trigger ratio**: Count memories with `trigger_count > 0` vs total. If < 30% of memories have ever been triggered, the cue-matching system may be misconfigured or the memories are not relevant to actual usage. **-3**
|
|
133
|
-
- **Stale memories**: Any memory with `stale: true` or with `last_triggered` older than `stale_after_days` (default 90). Stale memories waste index space and should be cleaned up by `memory-engine.py rebuild-index`. **-2**
|
|
134
|
-
- **Auto-memory contamination**: Claude Code's built-in auto-memory (`~/.claude/projects/<slug>/memory/MEMORY.md`) exists for THIS project. This is a DIFFERENT memory store than the Ciel cued-recall corpus. If a user (or the model on their behalf) said "save to memory" and the write landed in `MEMORY.md` instead of `.ciel/memory/episodes/`, that knowledge is invisible to Ciel — not portable across machines, not seen by this audit's cue-matching checks, not replayed when context cues fire. **-5** if `MEMORY.md` is present AND newer than the most recent Ciel episode (suggests recent mis-routed capture).
|
|
135
|
-
|
|
136
|
-
Scoring:
|
|
137
|
-
- index.json missing: **-10** (blocks all other checks)
|
|
138
|
-
- index.json present but no episode files: **-5**
|
|
139
|
-
- Auto-memory contamination detected: **-5** (additive)
|
|
140
|
-
- All checks pass: **0**
|
|
141
|
-
|
|
142
|
-
Run these checks:
|
|
143
|
-
```bash
|
|
144
|
-
# Check index.json exists
|
|
145
|
-
test -f .ciel/memory/index.json && echo "index: OK" || echo "index: MISSING"
|
|
146
|
-
|
|
147
|
-
# Count episodes
|
|
148
|
-
EPISODES=$(ls .ciel/memory/episodes/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
149
|
-
echo "episodes: $EPISODES"
|
|
150
|
-
|
|
151
|
-
# Count triggered vs total (requires python3)
|
|
152
|
-
python3 -c "
|
|
153
|
-
import json
|
|
154
|
-
with open('.ciel/memory/index.json') as f:
|
|
155
|
-
idx = json.load(f)
|
|
156
|
-
mems = idx.get('memories', {})
|
|
157
|
-
total = len(mems)
|
|
158
|
-
triggered = sum(1 for m in mems.values() if m.get('trigger_count', 0) > 0)
|
|
159
|
-
stale = sum(1 for m in mems.values() if m.get('stale'))
|
|
160
|
-
print(f'total: {total}, triggered: {triggered} ({0 if total==0 else triggered*100//total}%), stale: {stale}')
|
|
161
|
-
" 2>/dev/null || echo "memory check failed (no python3?)"
|
|
162
|
-
|
|
163
|
-
# Detect Claude Code auto-memory contamination
|
|
164
|
-
# The auto-memory slug is the cwd with / replaced by -. If this file exists
|
|
165
|
-
# AND is newer than the most recent Ciel episode, a recent capture was
|
|
166
|
-
# mis-routed to Claude Code auto-memory instead of Ciel's cued-recall store.
|
|
167
|
-
PROJECT_SLUG=$(pwd | sed 's|/|-|g')
|
|
168
|
-
AUTO_MEM="$HOME/.claude/projects/${PROJECT_SLUG}/memory/MEMORY.md"
|
|
169
|
-
if [ -f "$AUTO_MEM" ]; then
|
|
170
|
-
echo "auto-memory: present at $AUTO_MEM"
|
|
171
|
-
LATEST_EPISODE=$(ls -t .ciel/memory/episodes/*.md 2>/dev/null | head -1)
|
|
172
|
-
if [ -z "$LATEST_EPISODE" ] || [ "$AUTO_MEM" -nt "$LATEST_EPISODE" ]; then
|
|
173
|
-
echo "auto-memory: CONTAMINATION — auto-memory newer than latest Ciel episode (mis-routed capture suspected)"
|
|
174
|
-
echo " → root cause: 'autoMemoryEnabled' in .claude/settings.json is enabled."
|
|
175
|
-
echo " fix: set it to false, then migrate entries from $AUTO_MEM"
|
|
176
|
-
echo " to .ciel/memory/episodes/ via memory-engine.py capture"
|
|
177
|
-
else
|
|
178
|
-
echo "auto-memory: present but older than Ciel episodes — likely legacy, no penalty"
|
|
179
|
-
fi
|
|
180
|
-
else
|
|
181
|
-
echo "auto-memory: absent (clean)"
|
|
182
|
-
fi
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
#### Dimension 10: Memory insight quality — penalty up to -10
|
|
186
|
-
|
|
187
|
-
Auto-runs the memory pattern analyzer (`python3 .claude/hooks/memory-engine.py analyze`) before scoring. The analyzer is read-only on the corpus — it scans `index.json`, computes pattern clusters and 7 health metrics, and writes `.ciel/memory/insights.json` + `.ciel/memory/INSIGHTS.md`. This dimension scores the *output* of that analysis: untreated promotion candidates, dead anchors, and structural drift in the memory corpus.
|
|
188
|
-
|
|
189
|
-
**Anti-double-counting with Dim 9.** Memories already counted as `stale` in Dim 9 must be excluded from the Dim 10 dead-anchor penalty: compute `dead_anchors_new = insights.dead_anchors - dim9_stale_ids` before scoring. A single rotted memory that is both stale (Dim 9) and a dead anchor (Dim 10) is one defect, not two — never charge -4 for what costs the user one consolidator pass.
|
|
190
|
-
|
|
191
|
-
- **Engine failed to produce insights**: `python3 .claude/hooks/memory-engine.py analyze` exited non-zero, OR `.ciel/memory/insights.json` was not written. The pattern surface is invisible — Dim 10 cannot grade. **-2**
|
|
192
|
-
- **Promotion candidates ignored**: `insights.json.promotion_candidates.length >= 3` AND `insights.json.health.promotion_ratio == 0` — the analyzer flagged hot episodes (>= 5 triggers) but the consolidator skill has never crystallized any of them into concepts. The corpus accumulates without distillation. **-3**
|
|
193
|
-
- **Dead anchors not triaged**: `insights.json.dead_anchors.length > 0` AND `.ciel/memory/review-queue.md` is missing or empty. Memories point to files that no longer exist; cued recall keeps firing on broken anchors until the user reviews. **-2**
|
|
194
|
-
- **Recursion drift starting**: `insights.json.health.max_generation_depth >= 3`. Synthesizer outputs are being re-derived from prior synthesizer outputs beyond depth 2, violating ADR-0001's "no self-feeding loops" principle. **-2**
|
|
195
|
-
- **Tag explosion**: `insights.json.health.tag_specificity > 0.9` AND total memories >= 10. Almost every tag is bespoke — clustering is impossible, recall degrades to per-memory matching. **-1**
|
|
196
|
-
|
|
197
|
-
Run these checks:
|
|
198
|
-
```bash
|
|
199
|
-
# Auto-run analyzer (read-only on memories; writes only insights artifacts)
|
|
200
|
-
python3 .claude/hooks/memory-engine.py analyze 2>&1 || echo "analyze: FAILED"
|
|
201
|
-
|
|
202
|
-
# Read insights.json and emit per-check diagnostics
|
|
203
|
-
python3 -c "
|
|
204
|
-
import json, os, sys
|
|
205
|
-
try:
|
|
206
|
-
with open('.ciel/memory/insights.json') as f:
|
|
207
|
-
ins = json.load(f)
|
|
208
|
-
except FileNotFoundError:
|
|
209
|
-
print('insights: MISSING (engine failed?)')
|
|
210
|
-
sys.exit(0)
|
|
211
|
-
pc = ins.get('promotion_candidates', [])
|
|
212
|
-
da = ins.get('dead_anchors', [])
|
|
213
|
-
h = ins.get('health', {})
|
|
214
|
-
print(f'promotion_candidates: {len(pc)} (promotion_ratio={h.get(\"promotion_ratio\", 0)})')
|
|
215
|
-
print(f'dead_anchors: {len(da)}')
|
|
216
|
-
print(f'max_generation_depth: {h.get(\"max_generation_depth\", 0)}')
|
|
217
|
-
print(f'tag_specificity: {h.get(\"tag_specificity\", 0)}')
|
|
218
|
-
print(f'corpus: {ins.get(\"corpus_size\", {})}')
|
|
219
|
-
review = '.ciel/memory/review-queue.md'
|
|
220
|
-
print(f'review-queue: {\"present\" if os.path.exists(review) else \"absent\"}')
|
|
221
|
-
" 2>/dev/null || echo "memory insights check failed (no python3?)"
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
The analyzer is **idempotent**: every audit run regenerates `insights.json` from the live corpus, so this dimension cannot be gamed by stale artifacts. Patches the audit recommends in this dimension should target either (a) running the consolidator skill to drain the promotion queue, or (b) populating `.ciel/memory/review-queue.md` to clear dead anchors.
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
### Scoring
|
|
60
|
+
## Scoring
|
|
229
61
|
|
|
230
62
|
**Ciel Health Score** = 100 - sum(penalties)
|
|
231
63
|
|
|
232
|
-
| Score
|
|
233
|
-
|
|
64
|
+
| Score | Status | Issue created? |
|
|
65
|
+
|-------|--------|----------------|
|
|
234
66
|
| 90-100 | Excellent | No |
|
|
235
|
-
| 0-89 | Needs improvement |
|
|
236
|
-
|
|
237
|
-
The score is calculated automatically from the detected violations.
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
### Report format
|
|
242
|
-
|
|
243
|
-
Begin the output with the literal line `# Ciel Session Audit Report`. End with the literal line `**End of audit report.**` on its own line.
|
|
244
|
-
|
|
245
|
-
```markdown
|
|
246
|
-
# Ciel Session Audit Report
|
|
247
|
-
|
|
248
|
-
**Date**: <today's date>
|
|
249
|
-
**Ciel Health Score**: <N>/100 — <Excellent|Good|Needs improvement|Critical>
|
|
250
|
-
**npm**: local v<X.Y.Z> | npm v<X.Y.Z> | <up-to-date|update available>
|
|
251
|
-
**Platforms**: claude ✓ opencode ✓ (or ✗ if missing)
|
|
252
|
-
**Session summary**: <N> /ciel invocation(s), <N> total tool calls, <N> Task() dispatches, <N> inline Bash/Read/Grep/WebSearch calls in main session.
|
|
67
|
+
| 0-89 | Needs improvement | Yes |
|
|
253
68
|
|
|
254
|
-
|
|
69
|
+
## Report Format
|
|
255
70
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
## Violations detected
|
|
259
|
-
|
|
260
|
-
### <N>. <Short violation name> — penalty: -<N>
|
|
261
|
-
|
|
262
|
-
**Severity**: <critical | high | medium | low>
|
|
263
|
-
**Evidence from session**
|
|
264
|
-
- User prompt (turn N): `<exact prompt text, truncated to 200 chars>`
|
|
265
|
-
- Assistant's first 3 tool calls after this prompt:
|
|
266
|
-
1. `<tool_name>(<brief args>)`
|
|
267
|
-
2. `<tool_name>(<brief args>)`
|
|
268
|
-
3. `<tool_name>(<brief args>)`
|
|
269
|
-
- Expected: `Task(subagent_type="ciel-<role>", ...)` as first tool call
|
|
270
|
-
- Observed: `<actual behavior>`
|
|
271
|
-
|
|
272
|
-
**Root cause hypothesis**
|
|
273
|
-
<one or two sentences>
|
|
274
|
-
|
|
275
|
-
**Proposed fix**
|
|
276
|
-
- <concrete edit with file:line>
|
|
277
|
-
|
|
278
|
-
...
|
|
279
|
-
|
|
280
|
-
---
|
|
281
|
-
|
|
282
|
-
## Update notification
|
|
283
|
-
|
|
284
|
-
<If npm version > local version, show update notification here. Otherwise omit this section.>
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
## Scoring breakdown
|
|
289
|
-
|
|
290
|
-
| Dimension | Penalty |
|
|
291
|
-
|-----------|---------|
|
|
292
|
-
| D1 — Dispatch discipline | -<N> |
|
|
293
|
-
| D2 — Hook activity | -<N> |
|
|
294
|
-
| D3 — Skill coverage vs depth | -<N> |
|
|
295
|
-
| D4 — Skill overlap | -<N> |
|
|
296
|
-
| D5 — Agent report quality | -<N> |
|
|
297
|
-
| D6 — Intent routing | -<N> |
|
|
298
|
-
| D7 — npm version | -<N> |
|
|
299
|
-
| D8 — Platform health | -<N> |
|
|
300
|
-
| D9 — Memory health | -<N> |
|
|
301
|
-
| D10 — Memory insight quality | -<N> |
|
|
302
|
-
| **Total** | **-<N>** |
|
|
303
|
-
| **Health Score** | **<N>/100** |
|
|
304
|
-
|
|
305
|
-
---
|
|
306
|
-
|
|
307
|
-
## Summary of fixes to apply
|
|
308
|
-
|
|
309
|
-
Apply these in order. Each points to a file:line and a concrete change.
|
|
310
|
-
|
|
311
|
-
1. **<Fix name>** — `<path>:<line>` — <one-line description>
|
|
312
|
-
2. ...
|
|
313
|
-
|
|
314
|
-
After each fix: re-run the scenario that triggered the violation in a fresh Claude session to verify.
|
|
315
|
-
|
|
316
|
-
---
|
|
71
|
+
Output MUST start with `# Ciel Session Audit Report` and end with `**End of audit report.**`.
|
|
317
72
|
|
|
318
|
-
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
### If no violations are found (score = 100)
|
|
322
|
-
|
|
323
|
-
Output a single short section — **no issue is created** for PASS verdicts:
|
|
324
|
-
|
|
325
|
-
```markdown
|
|
326
|
-
# Ciel Session Audit Report
|
|
327
|
-
|
|
328
|
-
**Date**: <today's date>
|
|
329
|
-
**Ciel Health Score**: 100/100 — Excellent
|
|
330
|
-
**npm**: local v<X.Y.Z> | npm v<X.Y.Z> | up-to-date
|
|
331
|
-
**Platforms**: claude ✓ opencode ✓
|
|
332
|
-
**Session summary**: <N> /ciel invocation(s), <N> tool calls, <N> Task() dispatches.
|
|
333
|
-
**Verdict**: PASS
|
|
334
|
-
|
|
335
|
-
**No violations found.** No issue created.
|
|
336
|
-
|
|
337
|
-
**End of audit report.**
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
---
|
|
341
|
-
|
|
342
|
-
### GitHub Issue creation (only if score < 90)
|
|
343
|
-
|
|
344
|
-
If the Ciel Health Score is **below 90**, create a GitHub Issue with the report AND the session timeline.
|
|
345
|
-
|
|
346
|
-
**Important**: Do NOT create an issue if score >= 90. Only create for scores < 90.
|
|
347
|
-
|
|
348
|
-
1. **Check for duplicate issues first**:
|
|
349
|
-
```bash
|
|
350
|
-
EXISTING=$(gh issue list --repo KaosKyun/Ciel --label audit --state open \
|
|
351
|
-
--json title --jq '.[].title' 2>/dev/null | \
|
|
352
|
-
grep -c "^\[CIEL-AUDIT\] $(date +%Y-%m-%d) -" || true)
|
|
353
|
-
if [ "$EXISTING" -gt 0 ]; then
|
|
354
|
-
echo "Warning: today's audit issue already exists. Skipping creation."
|
|
355
|
-
echo "View existing at: https://github.com/KaosKyun/Ciel/issues?q=is%3Aopen+label%3Aaudit"
|
|
356
|
-
exit 0
|
|
357
|
-
fi
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
2. **Save the report to a temp file**: Write the complete report text to a temp file:
|
|
361
|
-
```bash
|
|
362
|
-
REPORT_FILE="/tmp/ciel-audit-report-$(date +%Y%m%d).md"
|
|
363
|
-
cat > "$REPORT_FILE" << 'REPORT_EOF'
|
|
364
|
-
# Ciel Session Audit Report
|
|
365
|
-
...
|
|
366
|
-
**End of audit report.**
|
|
367
|
-
REPORT_EOF
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
3. **Determine the repository**: run `gh repo view --json owner,name` to confirm, or default to `KaosKyun/Ciel`.
|
|
371
|
-
|
|
372
|
-
4. **Create the issue** with `gh issue create`, using Python to avoid shell quoting issues:
|
|
373
|
-
```bash
|
|
374
|
-
python3 -c "
|
|
375
|
-
import subprocess, sys
|
|
376
|
-
ymd, date_str, score, verdict = sys.argv[1:5]
|
|
377
|
-
report_path = f'/tmp/ciel-audit-report-{ymd}.md'
|
|
378
|
-
with open(report_path) as f:
|
|
379
|
-
body = f.read()
|
|
380
|
-
subprocess.run(['gh', 'issue', 'create',
|
|
381
|
-
'--repo', 'KaosKyun/Ciel',
|
|
382
|
-
'--title', f'[CIEL-AUDIT] {date_str} - {verdict} (Score: {score}/100)',
|
|
383
|
-
'--label', 'audit,ciel',
|
|
384
|
-
'--body', body])
|
|
385
|
-
" "$(date +%Y%m%d)" "$(date +%Y-%m-%d)" "<score>" "<verdict>"
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
5. **Include the session timeline** in the issue body. Before the report, add a timeline section listing all `/ciel` invocations in chronological order:
|
|
389
|
-
```markdown
|
|
390
|
-
## Session Timeline
|
|
391
|
-
|
|
392
|
-
| Time | Event |
|
|
393
|
-
|------|-------|
|
|
394
|
-
| T+N | /ciel <prompt excerpt> |
|
|
395
|
-
| T+N | Write/Edit on <file> |
|
|
396
|
-
| T+N | Task() dispatch to <agent> |
|
|
397
|
-
...
|
|
398
|
-
|
|
399
|
-
---
|
|
400
|
-
|
|
401
|
-
<full audit report>
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
6. **Handle errors gracefully**:
|
|
405
|
-
- If `gh` is not available: print a message telling the user to install (`brew install gh`) and print the report to stdout instead.
|
|
406
|
-
- If the repository can't be reached: skip issue creation, print a warning, but still output the report.
|
|
407
|
-
|
|
408
|
-
7. **After creating the issue**: include the issue URL at the end of your response so the user can open it directly.
|
|
409
|
-
|
|
410
|
-
**Title format**: `[CIEL-AUDIT] YYYY-MM-DD - VIOLATIONS FOUND (Score: <N>/100)`
|
|
411
|
-
|
|
412
|
-
**Labels**: `audit`, `ciel`
|
|
413
|
-
|
|
414
|
-
---
|
|
73
|
+
For violations: provide evidence (turn number, tool calls), root cause hypothesis (file:line), and proposed fix (concrete edit). No preamble, no meta-commentary, no emoji.
|
|
415
74
|
|
|
416
|
-
|
|
75
|
+
## GitHub Issue (score < 90 only)
|
|
417
76
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
77
|
+
1. Check for duplicate: `gh issue list --repo KaosKyun/Ciel --label audit --state open`
|
|
78
|
+
2. Create with title: `[CIEL-AUDIT] YYYY-MM-DD - VIOLATIONS FOUND (Score: N/100)`
|
|
79
|
+
3. Labels: `audit`, `ciel`
|
|
80
|
+
4. Body: session timeline + full audit report
|
|
81
|
+
5. Handle gracefully if `gh` unavailable — print report to stdout
|
|
421
82
|
|
|
422
|
-
|
|
83
|
+
## Constraints
|
|
423
84
|
|
|
424
|
-
- Do NOT fix violations in
|
|
425
|
-
- Do NOT
|
|
426
|
-
- Do NOT
|
|
427
|
-
- Do NOT
|
|
428
|
-
-
|
|
429
|
-
- Do NOT create duplicate issues — run the `gh issue list` check before creating.
|
|
430
|
-
- Do NOT restart, rerun, or attempt to fix the session in-flight. The audit report is the deliverable.
|
|
85
|
+
- Do NOT fix violations in-session. Report only.
|
|
86
|
+
- Do NOT dispatch agents. Inline only.
|
|
87
|
+
- Do NOT create issues for score >= 90.
|
|
88
|
+
- Do NOT create duplicate issues.
|
|
89
|
+
- Target length: 200-400 lines for violations, 50 for PASS.
|
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Generates a valid Ciel SKILL.md scaffold
|
|
2
|
+
description: Generates a valid Ciel v7 SKILL.md scaffold — kebab-case name, YAML frontmatter with triggers.path, 3-section body (Checklist / Anti-patterns / Patterns), max 200 lines.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# /ciel-create-skill — Create a new Ciel skill
|
|
5
|
+
# /ciel-create-skill — Create a new Ciel v7 skill
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Generates a valid SKILL.md scaffold following Ciel v7 format: 3 sections (Checklist, Anti-patterns, Patterns), kebab-case name, optional path trigger.
|
|
8
8
|
|
|
9
|
-
Usage: `/ciel-create-skill <name> <
|
|
9
|
+
Usage: `/ciel-create-skill <name> <domain-description>`
|
|
10
10
|
|
|
11
|
-
- `name` — kebab-case, max 64 chars, unique across
|
|
12
|
-
- `
|
|
11
|
+
- `name` — kebab-case, max 64 chars, unique across `.claude/skills/`
|
|
12
|
+
- `domain-description` — one-line description of what domain expertise this skill encodes
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
## What it does
|
|
17
17
|
|
|
18
|
-
1. Dispatches
|
|
19
|
-
2.
|
|
20
|
-
3.
|
|
21
|
-
4. Generates
|
|
22
|
-
5.
|
|
23
|
-
6.
|
|
18
|
+
1. Dispatches `ciel-improver` agent with MODE=CREATE-SKILL
|
|
19
|
+
2. Validates name (kebab-case, uniqueness, no reserved words)
|
|
20
|
+
3. Helps you define the path trigger (if any) and anti-patterns
|
|
21
|
+
4. Generates SKILL.md scaffold in v7 3-section format
|
|
22
|
+
5. On approval, writes to `.claude/skills/<name>/SKILL.md`
|
|
23
|
+
6. Optionally runs `sync-skills.sh` to distribute to mirrors
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
27
|
## Example
|
|
28
28
|
|
|
29
29
|
```
|
|
30
|
-
/ciel-create-skill kotlin-coroutines
|
|
30
|
+
/ciel-create-skill kotlin-coroutines "Kotlin coroutines — structured concurrency, Flow operators, cancellation, testing. Use when working with suspend functions, CoroutineScope, Flow."
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
Expected output:
|
|
34
|
-
1. Validation:
|
|
35
|
-
2.
|
|
36
|
-
3. Preview of `
|
|
37
|
-
4.
|
|
38
|
-
5. Catalog entry: `| kotlin-coroutines-mastery | Kotlin files with suspend/Flow |`
|
|
39
|
-
6. Approve? [y/n/edit]
|
|
34
|
+
1. Validation: name valid and unique
|
|
35
|
+
2. Path trigger suggestion: `**/*.kt,**/*.kts`
|
|
36
|
+
3. Preview of `SKILL.md` scaffold (~100-150 lines)
|
|
37
|
+
4. Approve? [y/n/edit]
|
|
40
38
|
|
|
41
39
|
---
|
|
42
40
|
|
|
@@ -45,33 +43,21 @@ Expected output:
|
|
|
45
43
|
- kebab-case only (no underscores, no camelCase)
|
|
46
44
|
- Max 64 chars
|
|
47
45
|
- No reserved words: `anthropic`, `claude`, `mcp`
|
|
48
|
-
- Must be unique across
|
|
49
|
-
- Warn if starts with category name (e.g. `workflow-foo` in `workflow/` is redundant)
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Category decision
|
|
54
|
-
|
|
55
|
-
- `workflow` — enforces a CRÉER/CRITIQUER/META-CRITIQUER step
|
|
56
|
-
- `research` — finds information outside the codebase
|
|
57
|
-
- `domain` — encodes expertise in a specific tech or pattern family
|
|
58
|
-
- `utility` — wraps a frequent mechanical operation
|
|
59
|
-
- `meta` — modifies Ciel itself
|
|
46
|
+
- Must be unique across `.claude/skills/`
|
|
60
47
|
|
|
61
48
|
---
|
|
62
49
|
|
|
63
50
|
## Guardrails
|
|
64
51
|
|
|
65
52
|
- **Max 1 new skill per invocation** — prevents skill explosion
|
|
66
|
-
- **SKILL.md
|
|
67
|
-
- **
|
|
68
|
-
- **
|
|
69
|
-
- **Never creates**: files in `.claude-plugin/`, agents, hooks, commands — those use different patterns
|
|
53
|
+
- **SKILL.md max 200 lines** — v7 hard cap
|
|
54
|
+
- **Duplication detection**: warns if description overlaps >= 70% with existing skill
|
|
55
|
+
- **Never creates**: agent definitions, hooks, commands — those use different patterns
|
|
70
56
|
|
|
71
57
|
---
|
|
72
58
|
|
|
73
59
|
## After creation
|
|
74
60
|
|
|
75
|
-
1. Test the skill
|
|
76
|
-
2.
|
|
77
|
-
3.
|
|
61
|
+
1. Test the skill on a relevant task — does it load when expected?
|
|
62
|
+
2. Commit with message: `feat(skills): add <name> skill`
|
|
63
|
+
3. Run `bash scripts/sync-skills.sh` to distribute to all mirrors
|