singularity-claude 0.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.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: crystallizing
3
+ description: Use when a skill has proven itself with consistently high scores across multiple executions and should be locked as a stable, immutable version via /singularity-crystallize
4
+ ---
5
+
6
+ # Crystallize a Validated Skill
7
+
8
+ Lock a battle-tested skill version as production-grade. Crystallized skills are immutable — further changes require a new version.
9
+
10
+ ## When to Use
11
+
12
+ - Skill average score >= 90 with 5+ executions
13
+ - Skill has handled at least one edge case
14
+ - User confirms the skill is ready
15
+
16
+ ## Workflow
17
+
18
+ ### Step 1: Validate Readiness
19
+
20
+ Read score file and config:
21
+ ```bash
22
+ "${CLAUDE_PLUGIN_ROOT}/scripts/score-manager.sh" trend <skill-name>
23
+ ```
24
+
25
+ Check requirements:
26
+ - [ ] Average score >= `crystallizationThreshold` (default: 90)
27
+ - [ ] Execution count >= `crystallizationMinExecutions` (default: 5)
28
+ - [ ] At least one edge case recorded in score history
29
+ - [ ] Maturity is `hardened` (not `draft` or `tested`)
30
+
31
+ If not ready, explain what's missing:
32
+ *"This skill needs <X more runs / higher scores / edge case coverage> before crystallization."*
33
+
34
+ ### Step 2: Confirm with User
35
+
36
+ Show the skill's full score summary and ask:
37
+ *"Ready to crystallize <skill-name> v<version>? This locks the current version as immutable."*
38
+
39
+ ### Step 3: Create Git Tag
40
+
41
+ If `~/.claude/skills/` is a git repository:
42
+ ```bash
43
+ cd ~/.claude/skills
44
+ git add <skill-name>/
45
+ git commit -m "singularity: crystallize <skill-name> v<version>"
46
+ git tag "singularity/<skill-name>/v<version>"
47
+ ```
48
+
49
+ If not a git repo, create a backup copy:
50
+ ```bash
51
+ mkdir -p ~/.claude/singularity/crystallized/<skill-name>/
52
+ cp -r ~/.claude/skills/<skill-name>/ ~/.claude/singularity/crystallized/<skill-name>/v<version>/
53
+ ```
54
+
55
+ ### Step 4: Update Records
56
+
57
+ Update score file:
58
+ - Set maturity to `"crystallized"` for the current version
59
+
60
+ Update registry:
61
+ - Set `maturity` to `"crystallized"`
62
+
63
+ ### Step 5: Log Telemetry
64
+
65
+ ```bash
66
+ "${CLAUDE_PLUGIN_ROOT}/scripts/telemetry-writer.sh" log <skill-name> \
67
+ --trigger "crystallization" \
68
+ --summary "Crystallized v<version> (avg: <score>/100, <count> runs)"
69
+ ```
70
+
71
+ ## Report
72
+
73
+ ```
74
+ Crystallized: <skill-name> v<version>
75
+ Average score: <avg>/100 over <count> executions
76
+ Edge cases handled: <count>
77
+ Git tag: singularity/<skill-name>/v<version>
78
+ Status: LOCKED — further changes require a new version
79
+ ```
80
+
81
+ ## Rollback
82
+
83
+ To recover a crystallized version later:
84
+ ```bash
85
+ git checkout singularity/<skill-name>/v<version> -- <skill-name>/
86
+ ```
87
+
88
+ Or restore from backup:
89
+ ```bash
90
+ cp -r ~/.claude/singularity/crystallized/<skill-name>/v<version>/ ~/.claude/skills/<skill-name>/
91
+ ```
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: dashboard
3
+ description: Use when wanting an overview of all singularity-managed skills showing their scores, maturity levels, trends, and alerts via /singularity-dashboard
4
+ ---
5
+
6
+ # Singularity Dashboard
7
+
8
+ Display a comprehensive overview of all managed skills with health indicators and actionable alerts.
9
+
10
+ ## Workflow
11
+
12
+ ### Step 1: Load Registry
13
+
14
+ Read `~/.claude/singularity/registry.json` to get the list of all managed skills.
15
+
16
+ If no skills are registered:
17
+ *"No skills tracked yet. Create your first skill with `/singularity-create`."*
18
+
19
+ ### Step 2: Gather Data
20
+
21
+ For each skill in the registry:
22
+ 1. Read the score file from `~/.claude/singularity/scores/<skill-name>.json`
23
+ 2. Compute trend: compare last 2 scores (if available)
24
+ - Score increased by 5+ → `↑`
25
+ - Score decreased by 5+ → `↓`
26
+ - Otherwise → `→`
27
+
28
+ ### Step 3: Display Table
29
+
30
+ ```
31
+ Singularity Dashboard
32
+ ═══════════════════════════════════════════════════════════════════
33
+ | Skill | Version | Maturity | Avg | Runs | Trend | Last Used |
34
+ |--------------------|---------|---------------|------|------|-------|------------|
35
+ | my-api-client | v1.2.0 | hardened | 87 | 12 | ↑ | 2026-03-17 |
36
+ | data-transformer | v1.0.1 | tested | 72 | 5 | ↓ | 2026-03-15 |
37
+ | form-generator | v1.0.0 | draft | 45 | 2 | → | 2026-03-10 |
38
+ ═══════════════════════════════════════════════════════════════════
39
+ ```
40
+
41
+ ### Step 4: Show Alerts
42
+
43
+ Highlight skills needing attention:
44
+
45
+ **Needs Repair** (avg < 50, 2+ runs):
46
+ ```
47
+ ⚠ <skill-name>: avg score <n>/100 — run /singularity-repair
48
+ ```
49
+
50
+ **Ready to Crystallize** (avg >= 90, 5+ runs, hardened):
51
+ ```
52
+ ✦ <skill-name>: avg score <n>/100, <n> runs — run /singularity-crystallize
53
+ ```
54
+
55
+ **Stale** (not used in 30+ days):
56
+ ```
57
+ ⏳ <skill-name>: last used <n> days ago — review relevance
58
+ ```
59
+
60
+ ### Step 5: Summary Stats
61
+
62
+ ```
63
+ Total skills: <n>
64
+ Draft: <n> | Tested: <n> | Hardened: <n> | Crystallized: <n>
65
+ Average health: <overall-avg>/100
66
+ Alerts: <n> needing repair, <n> ready to crystallize
67
+ ```
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: repairing
3
+ description: Use when a singularity-managed skill is failing, scoring below threshold, or producing incorrect outputs that need automated correction via /singularity-repair
4
+ ---
5
+
6
+ # Auto-Repair a Failing Skill
7
+
8
+ Diagnose why a skill is underperforming and rewrite it to fix identified weaknesses. This is the core of the recursive evolution loop.
9
+
10
+ ## When to Use
11
+
12
+ - Skill average score < 50 (auto-repair threshold)
13
+ - Scoring skill suggested repair
14
+ - User noticed skill producing wrong or incomplete output
15
+
16
+ ## Workflow
17
+
18
+ ### Step 1: Diagnose
19
+
20
+ Read the skill's score history:
21
+ ```bash
22
+ "${CLAUDE_PLUGIN_ROOT}/scripts/score-manager.sh" list <skill-name>
23
+ ```
24
+
25
+ Read recent telemetry:
26
+ ```bash
27
+ "${CLAUDE_PLUGIN_ROOT}/scripts/telemetry-writer.sh" list <skill-name> --last 5
28
+ ```
29
+
30
+ Identify patterns:
31
+ - Which rubric dimensions score lowest consistently?
32
+ - What edge cases caused failures?
33
+ - Are errors recurring?
34
+
35
+ ### Step 2: Read Current Skill
36
+
37
+ Load the skill's SKILL.md:
38
+ ```
39
+ ~/.claude/skills/<skill-name>/SKILL.md
40
+ ```
41
+
42
+ Also read any supporting files in `references/`.
43
+
44
+ ### Step 3: Identify Repair Targets
45
+
46
+ Map low-scoring dimensions to specific skill content:
47
+
48
+ | Low Dimension | Likely Cause | Repair Focus |
49
+ |---------------|-------------|--------------|
50
+ | Correctness | Wrong instructions or logic | Rewrite core workflow steps |
51
+ | Completeness | Missing requirements | Add missing steps or checks |
52
+ | Edge Cases | No error handling guidance | Add edge case handling section |
53
+ | Efficiency | Verbose or roundabout | Streamline workflow, remove unnecessary steps |
54
+ | Reusability | Hardcoded or too specific | Parameterize, add flexibility |
55
+
56
+ ### Step 4: Rewrite
57
+
58
+ Edit the SKILL.md to address identified weaknesses. Preserve what works (high-scoring dimensions) and focus changes on the lowest-scoring areas.
59
+
60
+ **Rules:**
61
+ - Don't rewrite from scratch — surgical fixes only
62
+ - Preserve the existing structure and naming
63
+ - Add a "## Repair History" section at the bottom documenting what changed and why
64
+
65
+ ### Step 5: Bump Version
66
+
67
+ The skill is now a new version. Update:
68
+ 1. Score file — add new version entry:
69
+ - Read current version from `~/.claude/singularity/scores/<skill-name>.json`
70
+ - Increment patch: v1.0.0 → v1.0.1 (or minor if significant changes: v1.0.0 → v1.1.0)
71
+ 2. Registry — update `currentVersion`
72
+
73
+ ### Step 6: Test
74
+
75
+ Invoke the repaired skill with a scenario that previously failed or scored low.
76
+
77
+ ### Step 7: Score
78
+
79
+ Run `singularity-claude:scoring` on the test output.
80
+
81
+ ### Step 8: Compare
82
+
83
+ | New > Old avg | Keep new version |
84
+ |---------------|-----------------|
85
+ | New <= Old avg | Revert: restore previous SKILL.md from git history and keep old version as current |
86
+
87
+ If repair failed (new version scores equal or worse):
88
+ - Log the failed repair attempt in telemetry
89
+ - Suggest user intervention: *"Auto-repair didn't improve the skill. Consider manual editing or `/singularity-review` for deeper analysis."*
90
+
91
+ ### Step 9: Log Telemetry
92
+
93
+ ```bash
94
+ "${CLAUDE_PLUGIN_ROOT}/scripts/telemetry-writer.sh" log <skill-name> \
95
+ --trigger "auto-repair" \
96
+ --summary "Repaired: <what changed>. Score: <old-avg> → <new-score>"
97
+ ```
98
+
99
+ ## Report
100
+
101
+ After repair, show:
102
+ ```
103
+ Repair Summary for <skill-name>:
104
+ Previous version: v1.0.0 (avg: 42/100)
105
+ New version: v1.0.1
106
+ Changes: <bullet list of what was fixed>
107
+ Test score: <score>/100
108
+ Status: <Improved ✓ / Failed ✗ — reverted>
109
+ ```
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: reviewing
3
+ description: Use when wanting to assess the health of a singularity-managed skill, check its maturity, decide whether it needs repair or is ready for crystallization via /singularity-review
4
+ ---
5
+
6
+ # Review Skill Health
7
+
8
+ Produce a comprehensive health report for a singularity-managed skill and recommend next actions.
9
+
10
+ ## Workflow
11
+
12
+ ### Step 1: Load Data
13
+
14
+ Read the skill's data from three sources:
15
+
16
+ 1. **Score history:**
17
+ ```bash
18
+ "${CLAUDE_PLUGIN_ROOT}/scripts/score-manager.sh" list <skill-name>
19
+ ```
20
+
21
+ 2. **Registry entry:** Read from `~/.claude/singularity/registry.json`
22
+
23
+ 3. **Recent telemetry:**
24
+ ```bash
25
+ "${CLAUDE_PLUGIN_ROOT}/scripts/telemetry-writer.sh" list <skill-name> --last 10
26
+ ```
27
+
28
+ ### Step 2: Compute Health Metrics
29
+
30
+ | Metric | How to Calculate |
31
+ |--------|-----------------|
32
+ | **Current version** | From score file `currentVersion` |
33
+ | **Maturity** | From score file version entry |
34
+ | **Average score** | From score file version `averageScore` |
35
+ | **Score trend** | Compare last 3 scores: improving (+), declining (-), stable (=) |
36
+ | **Execution count** | From score file version `executionCount` |
37
+ | **Lowest dimension** | Find the rubric dimension with lowest average across scores |
38
+ | **Edge cases handled** | Count unique edge cases from score entries |
39
+ | **Staleness** | Days since `lastExecuted` in registry |
40
+ | **Repair history** | Count telemetry entries with trigger "auto-repair" |
41
+
42
+ ### Step 3: Generate Recommendation
43
+
44
+ | Condition | Recommendation |
45
+ |-----------|---------------|
46
+ | Average declining over last 3 scores | "Skill is degrading. Consider `/singularity-repair`" |
47
+ | Average < 50 with 2+ runs | "Skill needs repair. Run `/singularity-repair`" |
48
+ | Average >= 90, 5+ runs, has edge cases, maturity is `hardened` | "Ready for crystallization. Run `/singularity-crystallize`" |
49
+ | Execution count < 3 | "Needs more usage data. Use the skill more before evaluating." |
50
+ | Not executed in 30+ days | "Stale skill. Review if still relevant." |
51
+ | One dimension consistently low | "Weakest area: <dimension>. Targeted repair recommended." |
52
+ | All metrics healthy | "Skill is healthy. Continue using." |
53
+
54
+ ### Step 4: Present Report
55
+
56
+ ```
57
+ Health Report: <skill-name>
58
+ ═══════════════════════════════════════
59
+ Version: <version>
60
+ Maturity: <level>
61
+ Avg Score: <avg>/100 (<trend>)
62
+ Executions: <count>
63
+ Last Used: <date> (<days> days ago)
64
+ Edge Cases: <count> handled
65
+
66
+ Dimension Breakdown:
67
+ Correctness: <avg>/20
68
+ Completeness: <avg>/20
69
+ Edge Cases: <avg>/20
70
+ Efficiency: <avg>/20
71
+ Reusability: <avg>/20
72
+
73
+ Weakest Area: <dimension> (<avg>/20)
74
+ Repairs: <count> attempted
75
+
76
+ Recommendation: <recommendation>
77
+ ═══════════════════════════════════════
78
+ ```
79
+
80
+ ### Optional: Deep Analysis
81
+
82
+ If the user wants more detail, dispatch the `singularity-claude:gap-detector` agent to analyze whether this skill's weaknesses indicate a need for:
83
+ - Splitting into multiple focused skills
84
+ - Merging with another skill
85
+ - Fundamentally different approach
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: scoring
3
+ description: Use after any singularity-managed skill execution to rate performance 0-100, track quality over time, and trigger repair when scores drop below threshold
4
+ ---
5
+
6
+ # Score a Skill Execution
7
+
8
+ Evaluate skill performance using a structured 5-dimension rubric. Scores drive the evolution loop: low scores trigger repair, high scores enable crystallization.
9
+
10
+ ## Workflow
11
+
12
+ ### Step 1: Identify the Skill
13
+
14
+ Determine which singularity-managed skill was just executed. Check `~/.claude/singularity/registry.json` to confirm it's tracked.
15
+
16
+ If the skill isn't registered, ask: *"This skill isn't tracked by singularity. Want me to register it first?"*
17
+
18
+ ### Step 2: Assess Performance
19
+
20
+ Dispatch the `singularity-claude:skill-assessor` agent (haiku model, fast and cheap) with:
21
+ - **Skill name** and version
22
+ - **What was requested** (the user's original task)
23
+ - **What was produced** (the skill's output/changes)
24
+ - **The scoring rubric** from `references/scoring-rubric.md`
25
+
26
+ The assessor returns a structured JSON score.
27
+
28
+ ### Step 3: Record the Score
29
+
30
+ ```bash
31
+ "${CLAUDE_PLUGIN_ROOT}/scripts/score-manager.sh" add <skill-name> <total-score> \
32
+ --context "<what the skill was used for>" \
33
+ --strengths '["<strength1>", "<strength2>"]' \
34
+ --weaknesses '["<weakness1>"]' \
35
+ --edge-cases '["<edge-case-if-any>"]'
36
+ ```
37
+
38
+ ### Step 4: Check Thresholds
39
+
40
+ Read config from `~/.claude/singularity/config.json`:
41
+
42
+ | Condition | Action |
43
+ |-----------|--------|
44
+ | Average < `autoRepairThreshold` (50) for 2+ runs | Suggest: *"This skill is underperforming. Run `/singularity-repair` to fix it."* |
45
+ | Average >= `crystallizationThreshold` (90) with 5+ runs | Suggest: *"This skill is ready for crystallization. Run `/singularity-crystallize` to lock it."* |
46
+
47
+ ### Step 5: Update Registry
48
+
49
+ Update `~/.claude/singularity/registry.json` with:
50
+ - `lastExecuted`: current timestamp
51
+ - `executionCount`: increment
52
+ - `averageScore`: from score file
53
+
54
+ ### Step 6: Log Telemetry
55
+
56
+ ```bash
57
+ "${CLAUDE_PLUGIN_ROOT}/scripts/telemetry-writer.sh" log <skill-name> \
58
+ --trigger "scoring" \
59
+ --score <total-score> \
60
+ --summary "<brief assessment>"
61
+ ```
62
+
63
+ ### Step 7: Report
64
+
65
+ Show the user:
66
+ ```
67
+ Score: <total>/100 (avg: <average>/100 over <count> runs)
68
+ Correctness: <n>/20
69
+ Completeness: <n>/20
70
+ Edge Cases: <n>/20
71
+ Efficiency: <n>/20
72
+ Reusability: <n>/20
73
+ Maturity: <level> → <new-level-if-changed>
74
+ ```
75
+
76
+ ## Scoring Modes
77
+
78
+ From `config.json`:
79
+ - `"auto"` — Dispatch assessor agent automatically (default)
80
+ - `"manual"` — Ask user for the 0-100 score directly
81
+ - `"hybrid"` — Auto-assess, show result, let user override
@@ -0,0 +1,75 @@
1
+ # Singularity Scoring Rubric
2
+
3
+ Rate each dimension 0-20. Total: 0-100.
4
+
5
+ ## Dimensions
6
+
7
+ ### 1. Correctness (0-20)
8
+ Did the skill achieve the stated goal?
9
+
10
+ | Score | Meaning |
11
+ |-------|---------|
12
+ | 0-5 | Failed completely or produced wrong output |
13
+ | 6-10 | Partially correct, major issues |
14
+ | 11-15 | Mostly correct, minor issues |
15
+ | 16-20 | Fully correct, goal achieved |
16
+
17
+ ### 2. Completeness (0-20)
18
+ Were all requirements addressed?
19
+
20
+ | Score | Meaning |
21
+ |-------|---------|
22
+ | 0-5 | Most requirements missed |
23
+ | 6-10 | Some requirements addressed |
24
+ | 11-15 | Most requirements addressed, minor gaps |
25
+ | 16-20 | All requirements fully addressed |
26
+
27
+ ### 3. Edge Case Handling (0-20)
28
+ Did it handle unusual inputs, errors, and boundary conditions?
29
+
30
+ | Score | Meaning |
31
+ |-------|---------|
32
+ | 0-5 | No edge case handling, fragile |
33
+ | 6-10 | Basic error handling only |
34
+ | 11-15 | Handles common edge cases |
35
+ | 16-20 | Robust against unusual inputs and failures |
36
+
37
+ ### 4. Efficiency (0-20)
38
+ Was the approach direct and token-efficient?
39
+
40
+ | Score | Meaning |
41
+ |-------|---------|
42
+ | 0-5 | Wasteful, unnecessary steps, verbose |
43
+ | 6-10 | Some unnecessary work |
44
+ | 11-15 | Mostly efficient, minor overhead |
45
+ | 16-20 | Direct, minimal, no wasted effort |
46
+
47
+ ### 5. Reusability (0-20)
48
+ Could the output be reused or adapted for similar tasks?
49
+
50
+ | Score | Meaning |
51
+ |-------|---------|
52
+ | 0-5 | One-off, hardcoded, not adaptable |
53
+ | 6-10 | Limited reusability |
54
+ | 11-15 | Reasonably adaptable |
55
+ | 16-20 | Highly reusable, well-parameterized |
56
+
57
+ ## Output Format
58
+
59
+ Return as JSON:
60
+
61
+ ```json
62
+ {
63
+ "totalScore": 75,
64
+ "dimensions": {
65
+ "correctness": { "score": 18, "rationale": "..." },
66
+ "completeness": { "score": 15, "rationale": "..." },
67
+ "edgeCases": { "score": 12, "rationale": "..." },
68
+ "efficiency": { "score": 16, "rationale": "..." },
69
+ "reusability": { "score": 14, "rationale": "..." }
70
+ },
71
+ "strengths": ["...", "..."],
72
+ "weaknesses": ["..."],
73
+ "edgeCasesEncountered": ["..."]
74
+ }
75
+ ```
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: using-singularity
3
+ description: Use when starting any conversation where skills may need to be created, evaluated, repaired, or when a capability gap is detected during task execution
4
+ ---
5
+
6
+ # Singularity — Self-Evolving Skill Engine
7
+
8
+ You have singularity-claude, a system that creates, scores, repairs, and hardens Claude Code skills through recursive improvement cycles.
9
+
10
+ ## Decision Flow
11
+
12
+ When a task arrives:
13
+
14
+ 1. Task arrives → Does a skill exist?
15
+ - **Yes** → Execute it → Score with `/singularity-score` → Maturity auto-updates
16
+ - Avg < 50 (2+ runs) → Suggest `/singularity-repair`
17
+ - Avg ≥ 90, 5+ runs, hardened, edge cases → Suggest `/singularity-crystallize`
18
+ - Otherwise → Keep using and scoring
19
+ - **No** → Is this a recurring need?
20
+ - **Yes** → Create with `/singularity-create`
21
+ - **No** → Do manually
22
+
23
+ ## Available Commands
24
+
25
+ | Command | Skill | Purpose |
26
+ |---------|-------|---------|
27
+ | `/singularity-create` | `singularity-claude:creating-skills` | Build a new skill |
28
+ | `/singularity-score` | `singularity-claude:scoring` | Rate a skill execution 0-100 |
29
+ | `/singularity-review` | `singularity-claude:reviewing` | Health check a skill |
30
+ | `/singularity-repair` | `singularity-claude:repairing` | Auto-fix a failing skill |
31
+ | `/singularity-crystallize` | `singularity-claude:crystallizing` | Lock a validated version |
32
+ | `/singularity-dashboard` | `singularity-claude:dashboard` | Overview of all managed skills |
33
+
34
+ ## Capability Gap Detection
35
+
36
+ Watch for these signals during task execution — they indicate a new skill should be created:
37
+
38
+ 1. **Repetition across sessions** — You're doing the same multi-step procedure you've done before
39
+ 2. **Task failure without skill coverage** — No existing skill addresses this capability
40
+ 3. **Generalizable pattern** — The procedure would apply beyond this specific task
41
+ 4. **Complex workflow** — The task requires 5+ steps that could be encoded
42
+
43
+ When you detect a gap, suggest: *"This looks like a capability gap. Want me to create a skill for this with `/singularity-create`?"*
44
+
45
+ ## Data Locations
46
+
47
+ - **Registry:** `~/.claude/singularity/registry.json`
48
+ - **Scores:** `~/.claude/singularity/scores/<skill-name>.json`
49
+ - **Telemetry:** `~/.claude/singularity/telemetry/<skill-name>/`
50
+ - **Config:** `~/.claude/singularity/config.json`
51
+ - **Created skills:** `~/.claude/skills/<skill-name>/SKILL.md`
52
+
53
+ ## Maturity Levels
54
+
55
+ | Level | Criteria | Meaning |
56
+ |-------|----------|---------|
57
+ | `draft` | < 3 executions | New, unproven |
58
+ | `tested` | 3+ runs, avg >= 60 | Working but not battle-tested |
59
+ | `hardened` | 5+ runs, avg >= 80, edge cases handled | Reliable |
60
+ | `crystallized` | Locked via git tag | Production-grade, immutable |