kenaz 0.3.18 → 0.3.20
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/core/.claude/commands/agent-worker.md +1 -1
- package/core/.claude/commands/architect.md +1 -2
- package/core/.claude/commands/spec.md +1 -1
- package/core/.claude/commands//347/224/242/345/223/201.md +1 -1
- package/core/.claude/hooks/__tests__/task-1977-dedupe-guard.test.js +8 -8
- package/core/.claude/skills/architect_agent/SKILL.md +11 -92
- package/core/.claude/skills/assessment_agent/SKILL.md +0 -1
- package/core/.claude/skills/backend_engineer/SKILL.md +3 -6
- package/core/.claude/skills/code_reviewer/SKILL.md +1 -1
- package/core/.claude/skills/code_reviewer/patterns.yaml +1 -1
- package/core/.claude/skills/designer/SKILL.md +3 -6
- package/core/.claude/skills/dev_agent/SKILL.md +30 -491
- package/core/.claude/skills/developer/SKILL.md +3 -6
- package/core/.claude/skills/feature_agent/SKILL.md +3 -17
- package/core/.claude/skills/product_manager/SKILL.md +29 -1064
- package/core/.claude/skills/qa_engineer/SKILL.md +12 -17
- package/core/.claude/skills/spec_optimizer/SKILL.md +25 -275
- package/core/.claude/skills/sre_agent/SKILL.md +3 -6
- package/core/.collaboration/README.md +2 -3
- package/core/.collaboration/core/task-api.js +5 -138
- package/core/.collaboration/docs/CLI.md +0 -2
- package/core/.failure/INDEX.yaml +6 -40
- package/core/.failure/agent-execution/FAIL-013-search-cwd-drift-and-case-mismatch.yaml +1 -1
- package/core/.failure/tools/README.md +9 -227
- package/core/.formation/bifrost/launch.js +1 -6
- package/core/.formation/bifrost/launch.test.js +1 -1
- package/core/.formation/bifrost/shared/ansuz-boot-policy.js +3 -3
- package/core/.formation/bifrost/shared/ansuz-boot-policy.test.js +1 -2
- package/core/.formation/tools/__tests__/arms.test.js +41 -0
- package/core/.formation/tools/__tests__/diagnose-bug.test.js +10 -0
- package/core/.formation/tools/__tests__/m1-hmap-convid.test.js +1 -124
- package/core/.formation/tools/arms.js +48 -0
- package/core/.formation/tools/dispatch.js +24 -15
- package/core/.formation/tools/kenaz-stats.js +32 -8
- package/core/.formation/tools/kenaz-stats.test.js +15 -2
- package/core/.formation/tools/loader.js +17 -140
- package/core/.formation/tools/post-complete.js +0 -31
- package/core/.formation/tools/prompt.js +16 -1
- package/core/.formation/tools/prompt.test.js +20 -0
- package/core/.rule/INDEX.yaml +0 -18
- package/core/.rule/general/agent-workflow.yaml +14 -164
- package/core/.rule/general/project-self-containment.yaml +8 -19
- package/core/.rule/general/rust-verify-target.yaml +6 -5
- package/core/.rule/general/synapse-code-intelligence.yaml +3 -3
- package/core/.specialist/Amelia/capability.yaml +12 -12
- package/core/.specialist/Amelia/workflow.yaml +2 -2
- package/core/.specialist/Ansuz/SYSTEM_DOC.md +20 -578
- package/core/.specialist/Ansuz/cognitive_principles.yaml +2 -3
- package/core/.specialist/Ansuz/concepts/boot_rules_summary.yaml +0 -1
- package/core/.specialist/Ansuz/concepts/deep_knowledge_pointers.yaml +1 -2
- package/core/.specialist/Ansuz/core.yaml +6 -108
- package/core/.specialist/Ansuz/guards/lesson_guards.yaml +0 -3
- package/core/.specialist/Ansuz/identity_contract.yaml +0 -1
- package/core/.specialist/Ansuz/knowledge.yaml +0 -4
- package/core/.specialist/Ansuz/rule.yaml +0 -1
- package/core/.specialist/Ansuz/tools/handoff-session-identity.test.js +6 -150
- package/core/.specialist/tests/runtime-discovery/README.md +1 -1
- package/core/.specialist/tools/__tests__/task-2374-usage-counter.test.js +1 -12
- package/core/.specialist/tools/ansuz-boot-fast.js +7 -4
- package/core/.specialist/tools/ansuz-boot-fast.test.js +10 -3
- package/core/.specialist/tools/prompt-files.test.js +1 -0
- package/core/.specialist/tools/task-bridge.js +1 -66
- package/core/.system/README.md +11 -552
- package/core/.system/collaboration/README.md +10 -174
- package/core/CLAUDE.md +1 -6
- package/core/KENAZ_CORE_VERSION +1 -1
- package/core/dev/scripts/js-yaml-resolution.test.js +1 -1
- package/core/dev/scripts/peer-identity-e2e.js +402 -0
- package/core/dev/scripts/peer-identity-e2e.md +47 -0
- package/core/dev/scripts/relay-admin.js +94 -0
- package/core/dev/scripts/relay-admin.test.js +131 -0
- package/core/dev/scripts/run-rust-tests.js +9 -45
- package/core/dev/scripts/rust-verify-worktree.js +4 -4
- package/core/dev/scripts/verify-target-dir.js +6 -6
- package/core/plugins/kenaz/INVENTORY.md +8 -8
- package/core/plugins/kenaz/README.md +10 -0
- package/core/plugins/kenaz/commands/architect.md +1 -2
- package/core/plugins/kenaz/commands/spec.md +1 -1
- package/core/plugins/kenaz/commands//347/224/242/345/223/201.md +1 -1
- package/core/plugins/kenaz/guidance.md +1 -1
- package/core/plugins/kenaz/hooks/kenaz-hook.js +2 -1
- package/core/plugins/kenaz/hooks/sdk-gate.js +9 -0
- package/core/plugins/kenaz/scripts/kenaz.test.js +15 -3
- package/core/plugins/kenaz/scripts/sync.js +1 -1
- package/core/plugins/kenaz/scripts/ygg.js +8 -0
- package/core/plugins/kenaz/scripts/ygg.test.js +72 -0
- package/core/plugins/kenaz/skills/architect_agent/SKILL.md +11 -92
- package/core/plugins/kenaz/skills/assessment_agent/SKILL.md +0 -1
- package/core/plugins/kenaz/skills/backend_engineer/SKILL.md +3 -6
- package/core/plugins/kenaz/skills/code_reviewer/SKILL.md +1 -1
- package/core/plugins/kenaz/skills/code_reviewer/patterns.yaml +1 -1
- package/core/plugins/kenaz/skills/designer/SKILL.md +3 -6
- package/core/plugins/kenaz/skills/dev_agent/SKILL.md +30 -491
- package/core/plugins/kenaz/skills/developer/SKILL.md +3 -6
- package/core/plugins/kenaz/skills/feature_agent/SKILL.md +3 -17
- package/core/plugins/kenaz/skills/product_manager/SKILL.md +29 -1064
- package/core/plugins/kenaz/skills/qa_engineer/SKILL.md +12 -17
- package/core/plugins/kenaz/skills/spec_optimizer/SKILL.md +25 -275
- package/core/plugins/kenaz/skills/sre_agent/SKILL.md +3 -6
- package/core/plugins/kenaz-peer/hooks/register.test.ts +32 -0
- package/core/plugins/kenaz-peer/hooks/register.ts +9 -0
- package/package.json +6 -6
- package/core/.claude/commands/archive.md +0 -24
- package/core/.claude/commands/init.md +0 -112
- package/core/.claude/commands/legacy_dev.md +0 -18
- package/core/.claude/commands/product-review.md +0 -131
- package/core/.claude/commands/strategy.md +0 -141
- package/core/.claude/commands/sunny.md +0 -1
- package/core/.claude/commands//347/224/242/345/223/201/346/252/242/350/246/226.md +0 -129
- package/core/.claude/commands//351/200/262/345/272/246.md +0 -15
- package/core/.claude/hooks/__tests__/substrate.test.js +0 -122
- package/core/.claude/hooks/_substrate-paths.js +0 -95
- package/core/.claude/hooks/context-check.js +0 -51
- package/core/.claude/hooks/fatigue-check.js +0 -52
- package/core/.claude/hooks/handoff-snapshot-on-commit.js +0 -154
- package/core/.claude/hooks/handoff-snapshot-on-question.js +0 -158
- package/core/.claude/hooks/handoff-staleness.js +0 -197
- package/core/.claude/hooks/jev-thalamus-context.js +0 -17
- package/core/.claude/hooks/jev-thalamus-context.test.js +0 -41
- package/core/.claude/hooks/lease-release.js +0 -119
- package/core/.claude/hooks/lease-touch.js +0 -96
- package/core/.claude/hooks/reflex-feedback.js +0 -5
- package/core/.claude/hooks/session-init.ps1 +0 -49
- package/core/.claude/hooks/sound-event.js +0 -70
- package/core/.claude/hooks/sound-event.sh +0 -37
- package/core/.claude/hooks/stream-delta.js +0 -169
- package/core/.claude/no-hooks.settings.json +0 -3
- package/core/.claude/skills/legacy_dev/SKILL.md +0 -202
- package/core/.claude/skills/sunny/SKILL.md +0 -74
- package/core/.collaboration/cli/commands/assign.js +0 -39
- package/core/.collaboration/cli/commands/claim.js +0 -33
- package/core/.collaboration/cli/commands/complete.js +0 -44
- package/core/.collaboration/cli/commands/create.js +0 -110
- package/core/.collaboration/cli/commands/get.js +0 -83
- package/core/.collaboration/cli/commands/index.js +0 -52
- package/core/.collaboration/cli/commands/list.js +0 -51
- package/core/.collaboration/cli/commands/lock.js +0 -45
- package/core/.collaboration/cli/commands/rebuild.js +0 -39
- package/core/.collaboration/cli/commands/search.js +0 -61
- package/core/.collaboration/cli/commands/stats.js +0 -61
- package/core/.collaboration/cli/commands/transfer.js +0 -41
- package/core/.collaboration/cli/commands/unlock.js +0 -48
- package/core/.collaboration/cli/formatters/help-formatter.js +0 -70
- package/core/.collaboration/cli/formatters/index.js +0 -7
- package/core/.collaboration/cli/task-cli.js +0 -46
- package/core/.collaboration/cli/utils/arg-parser.js +0 -74
- package/core/.collaboration/cli/utils/git-user.js +0 -25
- package/core/.collaboration/cli/utils/index.js +0 -9
- package/core/.collaboration/cli/utils/output.js +0 -10
- package/core/.collaboration/config/default.yaml +0 -189
- package/core/.collaboration/core/conflict-resolver.js +0 -461
- package/core/.collaboration/core/conflict-resolver.test.js +0 -389
- package/core/.collaboration/core/migrate-legacy.js +0 -260
- package/core/.collaboration/docs/API.md +0 -787
- package/core/.collaboration/docs/ARCHITECTURE.md +0 -596
- package/core/.collaboration/docs/FAQ.md +0 -695
- package/core/.collaboration/docs/MIGRATION.md +0 -804
- package/core/.collaboration/docs/examples/README.md +0 -320
- package/core/.collaboration/docs/examples/advanced-queries.js +0 -261
- package/core/.collaboration/docs/examples/basic-usage.js +0 -184
- package/core/.collaboration/docs/examples/team-workflow.js +0 -352
- package/core/.failure/agent-execution/FAIL-001-agent-no-output.yaml +0 -391
- package/core/.failure/agent-execution/FAIL-007-pm-lead-wrong-team-invocation.yaml +0 -0
- package/core/.failure/agent-execution/FAIL-010-phase0-poem-format-skipped.yaml +0 -28
- package/core/.failure/agent-execution/FAIL-010-skipping-cognitive-checkpoint-after-verification.yaml +0 -59
- package/core/.failure/agent-execution/FAIL-012-grep-shortcut-during-investigation.yaml +0 -85
- package/core/.failure/architecture/FAIL-006-python-version-compatibility.yaml +0 -445
- package/core/.failure/pipeline/FAIL-003-queue-pollution.yaml +0 -335
- package/core/.failure/pipeline/README.md +0 -95
- package/core/.failure/retired/FAIL-009-skipping-synapse-pulse-before-code-change.yaml +0 -49
- package/core/.failure/tools/USAGE_GUIDE.md +0 -323
- package/core/.failure/tools/check_failures.ps1 +0 -387
- package/core/.failure/tools/log_failure.ps1 +0 -474
- package/core/.formation/.episode-input.json +0 -10
- package/core/.formation/.merge-lock +0 -1
- package/core/.formation/lead.yaml +0 -118
- package/core/.formation/legacy.bak/designer.yaml +0 -57
- package/core/.formation/legacy.bak/pm.yaml +0 -57
- package/core/.formation/legacy.bak/qa.yaml +0 -57
- package/core/.formation/legacy.bak/review.yaml +0 -62
- package/core/.formation/legacy.bak/scheduler.yaml +0 -129
- package/core/.formation/legacy.bak/sre.yaml +0 -57
- package/core/.formation/role-map.yaml +0 -274
- package/core/.formation/roles/_shared/modules/code_review.yaml +0 -98
- package/core/.formation/roles/_shared/modules/security.yaml +0 -103
- package/core/.formation/roles/_shared/modules/testing.yaml +0 -14
- package/core/.formation/roles/backend/role.yaml +0 -93
- package/core/.formation/roles/code_reviewer/role.yaml +0 -102
- package/core/.formation/roles/database_optimizer/role.yaml +0 -107
- package/core/.formation/roles/designer/role.yaml +0 -66
- package/core/.formation/roles/developer/role.yaml +0 -75
- package/core/.formation/roles/frontend/role.yaml +0 -134
- package/core/.formation/roles/incident_response/role.yaml +0 -89
- package/core/.formation/roles/qa/role.yaml +0 -89
- package/core/.formation/roles/security/role.yaml +0 -87
- package/core/.formation/roles/sre/role.yaml +0 -66
- package/core/.formation/skills/coordinator.yaml +0 -52
- package/core/.formation/solo/diagnosis.yaml +0 -78
- package/core/.formation/solo/strategy.yaml +0 -121
- package/core/.formation/tests/hello.txt +0 -2
- package/core/.formation/tools/coordinator.js +0 -350
- package/core/.formation/tools/jev-correction.js +0 -214
- package/core/.formation/tools/jev-correction.test.js +0 -178
- package/core/.formation/tools/log-reader.js +0 -232
- package/core/.formation/tools/revert-daemon-state.js +0 -162
- package/core/.formation/tools/test-drift.js +0 -148
- package/core/.formation/unit/heimdall.yaml +0 -96
- package/core/.formation/unit/plan.yaml +0 -67
- package/core/.formation/unit/think.yaml +0 -58
- package/core/.kenaz/MUNINN_SNAPSHOT9_EPISODE.json +0 -32
- package/core/.kenaz/MUNINN_SNAPSHOT9_RUNE.json +0 -23
- package/core/.kenaz/MUNINN_SNAPSHOT9_SUMMARY.md +0 -89
- package/core/.kenaz/ash_TASK_1428-20260507.json +0 -14
- package/core/.kenaz/muninn_episode_write.ps1 +0 -17
- package/core/.kenaz/muninn_snapshot11_rune_candidates.md +0 -63
- package/core/.kenaz/muninn_snapshot1_rune_candidates.md +0 -49
- package/core/.kenaz/runes_TASK_1428.json +0 -57
- package/core/.kenaz/tmp_heimdall_proposal_8d3e392.json +0 -13
- package/core/.kenaz/tmp_props.json +0 -1
- package/core/.kenaz/tmp_sounddrop_t1_prompt.txt +0 -371
- package/core/.rule/MECHANIZED.md +0 -61
- package/core/.rule/general/cortex-memory-recall.yaml +0 -446
- package/core/.rule/general/pipeline.yaml +0 -246
- package/core/.rule/general/sunny-access-control.yaml +0 -60
- package/core/.rule/general/system-invariants.yaml +0 -231
- package/core/.rule/pipeline/PPL-002-completed-task-archival.yaml +0 -528
- package/core/.rule/pipeline/auto-update.yaml +0 -282
- package/core/.rule/pipeline/task-execution.yaml +0 -365
- package/core/.specialist/Ansuz/concepts/phase_protocol.yaml +0 -65
- package/core/.specialist/Ansuz/experiments/boot_ablation_replay.js +0 -197
- package/core/.specialist/Ansuz/tools/bootstrap-anchors.js +0 -289
- package/core/.specialist/Ansuz/workflow.yaml +0 -1225
- package/core/.specialist/experiments/rg_benchmark.js +0 -523
- package/core/.specialist/experiments/rg_benchmark_results.json +0 -27
- package/core/.specialist/tools/jev-optional-context.js +0 -107
- package/core/.specialist/tools/jev-optional-context.test.js +0 -152
- package/core/.specialist/tools/memory-action-log.js +0 -839
- package/core/.specialist/tools/phase-gate.js +0 -3534
- package/core/.specialist/tools/phase-gate.test.js +0 -85
- package/core/.specialist/tools/precompute-runner.js +0 -444
- package/core/.specialist/tools/rule-engine.js +0 -621
- package/core/.specialist/tools/task-bridge-jev.test.js +0 -170
- package/core/.synapse/memory-shared.json.sync +0 -1
- package/core/.system/agent-skills/README.md +0 -724
- package/core/.system/cli-tools/README.md +0 -724
- package/core/.system/cortex/MODULES.md +0 -1046
- package/core/.system/dashboard/FRONTEND.md +0 -812
- package/core/.system/dashboard/README.md +0 -737
- package/core/.system/failure/README.md +0 -723
- package/core/.system/formation/LEGACY_SKILLS.md +0 -974
- package/core/.system/formation/POST_COMPLETE.md +0 -602
- package/core/.system/formation/README.md +0 -1094
- package/core/.system/formation/TOOLS_REFERENCE.md +0 -1145
- package/core/.system/kenaz/README.md +0 -787
- package/core/.system/memory/README.md +0 -719
- package/core/.system/pipeline/README.md +0 -712
- package/core/.system/rule/README.md +0 -794
- package/core/.system/sunny/README.md +0 -476
- package/core/.system/sunny/RULES.json +0 -89
- package/core/.system/sunny/knowledge/INDEX.md +0 -37
- package/core/.system/sunny/knowledge/agent-teams-api.md +0 -0
- package/core/.system/sunny/knowledge/ansuz-specialist.md +0 -500
- package/core/.system/sunny/knowledge/claude-cli-spawn.md +0 -177
- package/core/.system/sunny/knowledge/collaboration-api.md +0 -925
- package/core/.system/sunny/teammates/README.md +0 -107
- package/core/.system/sunny/teammates/how_to_use.yaml +0 -101
- package/core/.system/sunny/teammates/tools/headless/launcher.js +0 -318
- package/core/.system/sunny/teammates/tools/powershell/launcher.js +0 -241
- package/core/.system/sunny/teammates/tools/powershell/start.bat +0 -50
- package/core/.system/sunny/teammates/tools/utils/env.js +0 -96
- package/core/.system/sunny/teammates/tools/utils/format-output.js +0 -329
- package/core/.system/sunny/tools.json +0 -101
- package/core/dev/scripts/cleanup-queue.js +0 -184
- package/core/dev/scripts/cleanup_queue.js +0 -86
- package/core/dev/scripts/legacy/README.md +0 -39
- package/core/dev/scripts/legacy/dev_agent_scheduler.ps1.bak +0 -536
- package/core/dev/scripts/legacy/multi_agent_scheduler.ps1.bak +0 -1978
- package/core/dev/scripts/matrix/CLI_README.md +0 -214
- package/core/dev/scripts/matrix/README.md +0 -310
- package/core/dev/scripts/matrix/package-lock.json +0 -4266
- package/core/dev/scripts/matrix/package.json +0 -55
- package/core/dev/scripts/matrix/src/abbreviations.ts +0 -295
- package/core/dev/scripts/matrix/src/cli/commands/convert.ts +0 -211
- package/core/dev/scripts/matrix/src/cli/commands/create.ts +0 -95
- package/core/dev/scripts/matrix/src/cli/commands/delete.ts +0 -102
- package/core/dev/scripts/matrix/src/cli/commands/list-tags.ts.wip +0 -140
- package/core/dev/scripts/matrix/src/cli/commands/manage-tags.ts.wip +0 -173
- package/core/dev/scripts/matrix/src/cli/commands/query.ts +0 -261
- package/core/dev/scripts/matrix/src/cli/commands/read.ts +0 -77
- package/core/dev/scripts/matrix/src/cli/commands/stats.ts.wip +0 -168
- package/core/dev/scripts/matrix/src/cli/commands/tokens.ts.wip +0 -126
- package/core/dev/scripts/matrix/src/cli/commands/update.ts +0 -147
- package/core/dev/scripts/matrix/src/cli/commands/validate.ts +0 -275
- package/core/dev/scripts/matrix/src/cli/index.ts +0 -350
- package/core/dev/scripts/matrix/src/cli/utils/file-handler.ts +0 -72
- package/core/dev/scripts/matrix/src/cli/utils/logger.ts +0 -65
- package/core/dev/scripts/matrix/src/index.ts +0 -62
- package/core/dev/scripts/matrix/src/indexer/tag-indexer.ts +0 -165
- package/core/dev/scripts/matrix/src/parser.ts +0 -281
- package/core/dev/scripts/matrix/src/serializer.ts +0 -151
- package/core/dev/scripts/matrix/src/validator.ts +0 -301
- package/core/dev/scripts/matrix/tests/abbreviations.test.ts +0 -122
- package/core/dev/scripts/matrix/tests/cli.test.ts +0 -177
- package/core/dev/scripts/matrix/tests/convert.test.ts +0 -143
- package/core/dev/scripts/matrix/tests/parser.test.ts +0 -203
- package/core/dev/scripts/matrix/tests/query.test.ts +0 -85
- package/core/dev/scripts/matrix/tests/serializer.test.ts +0 -197
- package/core/dev/scripts/matrix/tests/validate.test.ts +0 -141
- package/core/dev/scripts/matrix/tests/validator.test.ts +0 -167
- package/core/dev/scripts/matrix/tsconfig.json +0 -20
- package/core/dev/scripts/matrix/types/index.d.ts +0 -111
- package/core/dev/scripts/matrix/types/index.d.ts.map +0 -1
- package/core/dev/scripts/matrix/types/index.js +0 -8
- package/core/dev/scripts/matrix/types/index.js.map +0 -1
- package/core/dev/scripts/matrix/types/index.ts +0 -124
- package/core/dev/scripts/memory-usage-report.js +0 -152
- package/core/dev/scripts/probe/ansuz-scaffold-ablation.js +0 -579
- package/core/dev/scripts/probe/ansuz-scaffold-ablation.test.js +0 -244
- package/core/dev/scripts/probe/hook-latency-probe.js +0 -315
- package/core/dev/scripts/probe/hook-latency-probe.test.js +0 -105
- package/core/dev/scripts/probe/prediction-signal-auc.js +0 -483
- package/core/dev/scripts/probe/prediction-signal-auc.test.js +0 -200
- package/core/dev/scripts/test-pty-ws-tunnel.js +0 -229
- package/core/dev/scripts/validate_pipeline.js +0 -197
- package/core/dev/spikes/task2145-evidence-20261004/backend-log-excerpt.txt +0 -56
- package/core/dev/spikes/task2145-evidence-20261004/graph.shadow +0 -0
- package/core/dev/spikes/task2145-evidence-20261004/graph.wal +0 -0
- package/core/dev/spikes/task2145-evidence-20261004/graph_corrupt_suspect.marker +0 -1
- package/core/plugins/kenaz/commands/strategy.md +0 -141
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
# matrix CLI - Command Line Tool
|
|
2
|
-
|
|
3
|
-
`matrix` is a command-line tool for managing `.matrix` format files. It provides CRUD operations (Create, Read, Update, Delete) for working with matrix rules.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# Install dependencies
|
|
9
|
-
npm install
|
|
10
|
-
|
|
11
|
-
# Build the CLI
|
|
12
|
-
npm run build
|
|
13
|
-
|
|
14
|
-
# Link CLI globally (optional)
|
|
15
|
-
npm link
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
After installation, you can use the `matrix` command anywhere in your terminal.
|
|
19
|
-
|
|
20
|
-
## Commands
|
|
21
|
-
|
|
22
|
-
### 1. Create - Create a new .matrix file
|
|
23
|
-
|
|
24
|
-
Creates a new `.matrix` file with specified metadata.
|
|
25
|
-
|
|
26
|
-
**Syntax:**
|
|
27
|
-
```bash
|
|
28
|
-
matrix create <file> [options]
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**Options:**
|
|
32
|
-
- `-v, --version <version>` - Version number (e.g., 1.0.0)
|
|
33
|
-
- `-c, --category <category>` - Category (T/M/R/P or custom)
|
|
34
|
-
- `-i, --interactive` - Use interactive mode with prompts
|
|
35
|
-
|
|
36
|
-
**Examples:**
|
|
37
|
-
```bash
|
|
38
|
-
# Create with parameters
|
|
39
|
-
matrix create tasks.matrix -v 1.0.0 -c T
|
|
40
|
-
|
|
41
|
-
# Create with interactive mode
|
|
42
|
-
matrix create memory.matrix -i
|
|
43
|
-
|
|
44
|
-
# Create project status file
|
|
45
|
-
matrix create project_status --version 2.0.0 --category P
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**Output:**
|
|
49
|
-
- Creates a new `.matrix` file with `@meta`, `@index`, and `@data` sections
|
|
50
|
-
- Auto-appends `.matrix` extension if not provided
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
### 2. Read - Read and display .matrix file
|
|
55
|
-
|
|
56
|
-
Reads a `.matrix` file and displays its content with level-based filtering.
|
|
57
|
-
|
|
58
|
-
**Syntax:**
|
|
59
|
-
```bash
|
|
60
|
-
matrix read <file> [options]
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**Options:**
|
|
64
|
-
- `-l, --level <level>` - Display level (default: 3)
|
|
65
|
-
- `1` - Overview only (@meta + @index)
|
|
66
|
-
- `2` - Recent 10 records
|
|
67
|
-
- `3` - All records
|
|
68
|
-
|
|
69
|
-
**Examples:**
|
|
70
|
-
```bash
|
|
71
|
-
# Read all records (default)
|
|
72
|
-
matrix read tasks.matrix
|
|
73
|
-
|
|
74
|
-
# Read overview only
|
|
75
|
-
matrix read tasks.matrix --level 1
|
|
76
|
-
|
|
77
|
-
# Read recent 10 records
|
|
78
|
-
matrix read memory.matrix -l 2
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
**Output:**
|
|
82
|
-
- ✓ Green checkmark for success
|
|
83
|
-
- Formatted display with color-coded fields
|
|
84
|
-
- Statistics and record details
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
### 3. Update - Update a rule
|
|
89
|
-
|
|
90
|
-
Updates a specific rule in a `.matrix` file and auto-updates `@index` statistics.
|
|
91
|
-
|
|
92
|
-
**Syntax:**
|
|
93
|
-
```bash
|
|
94
|
-
matrix update <file> <rule-id> [options]
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
**Options:**
|
|
98
|
-
- `-f, --field <field>` - Field name to update
|
|
99
|
-
- `-v, --value <value>` - New value for the field
|
|
100
|
-
- `-i, --interactive` - Use interactive mode with field selection
|
|
101
|
-
|
|
102
|
-
**Examples:**
|
|
103
|
-
```bash
|
|
104
|
-
# Update with parameters
|
|
105
|
-
matrix update tasks.matrix TASK_001 -f status -v completed
|
|
106
|
-
|
|
107
|
-
# Update with interactive mode
|
|
108
|
-
matrix update tasks.matrix TASK_002 -i
|
|
109
|
-
|
|
110
|
-
# Update priority field
|
|
111
|
-
matrix update memory.matrix MEM_005 --field priority --value high
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
**Features:**
|
|
115
|
-
- Auto-detects value types (boolean, number, array, string)
|
|
116
|
-
- Updates `@index.upd` timestamp automatically
|
|
117
|
-
- Interactive mode shows existing fields for easy selection
|
|
118
|
-
- Supports adding new fields
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
### 4. Delete - Delete a rule
|
|
123
|
-
|
|
124
|
-
Deletes a rule from a `.matrix` file and auto-updates `@index` statistics.
|
|
125
|
-
|
|
126
|
-
**Syntax:**
|
|
127
|
-
```bash
|
|
128
|
-
matrix delete <file> <rule-id> [options]
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
**Options:**
|
|
132
|
-
- `-f, --force` - Skip confirmation prompt
|
|
133
|
-
|
|
134
|
-
**Examples:**
|
|
135
|
-
```bash
|
|
136
|
-
# Delete with confirmation
|
|
137
|
-
matrix delete tasks.matrix TASK_001
|
|
138
|
-
|
|
139
|
-
# Delete without confirmation
|
|
140
|
-
matrix delete tasks.matrix TASK_002 -f
|
|
141
|
-
|
|
142
|
-
# Force delete
|
|
143
|
-
matrix delete memory.matrix MEM_OLD --force
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
**Features:**
|
|
147
|
-
- Confirmation prompt before deletion (unless `--force`)
|
|
148
|
-
- Auto-updates `@index.n` (rule count)
|
|
149
|
-
- Auto-updates `@index.upd` timestamp
|
|
150
|
-
- Shows remaining rule count after deletion
|
|
151
|
-
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
## Error Handling
|
|
155
|
-
|
|
156
|
-
All commands provide friendly error messages:
|
|
157
|
-
|
|
158
|
-
- ✗ **File not found**: Suggests using `matrix create`
|
|
159
|
-
- ✗ **Rule not found**: Suggests using `matrix read` to list rules
|
|
160
|
-
- ✗ **Parse error**: Shows error message with line and column numbers
|
|
161
|
-
- ✗ **Invalid level**: Suggests valid level values (1, 2, 3)
|
|
162
|
-
|
|
163
|
-
## Color Codes
|
|
164
|
-
|
|
165
|
-
- 🟢 **Green ✓** - Success
|
|
166
|
-
- 🔴 **Red ✗** - Error
|
|
167
|
-
- 🔵 **Blue ℹ** - Info
|
|
168
|
-
- 🟡 **Yellow ⚠** - Warning
|
|
169
|
-
- 🔵 **Cyan** - Section headers
|
|
170
|
-
|
|
171
|
-
## Global Help
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
# Show all commands
|
|
175
|
-
matrix --help
|
|
176
|
-
|
|
177
|
-
# Show command-specific help
|
|
178
|
-
matrix create --help
|
|
179
|
-
matrix read --help
|
|
180
|
-
matrix update --help
|
|
181
|
-
matrix delete --help
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
## Development
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
# Run tests
|
|
188
|
-
npm test
|
|
189
|
-
|
|
190
|
-
# Run tests with coverage
|
|
191
|
-
npm run test:coverage
|
|
192
|
-
|
|
193
|
-
# Build TypeScript
|
|
194
|
-
npm run build
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
## File Format
|
|
198
|
-
|
|
199
|
-
All commands work with `.matrix` format files:
|
|
200
|
-
|
|
201
|
-
```
|
|
202
|
-
@meta |v=1.0.0|c=T|
|
|
203
|
-
@index |n=2|upd=2026-02-09 15:21:00|
|
|
204
|
-
@data
|
|
205
|
-
TASK_001|st=P|pr=P0|tl=Implement feature|
|
|
206
|
-
TASK_002|st=C|pr=P1|tl=Fix bug|
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
## Notes
|
|
210
|
-
|
|
211
|
-
- The CLI automatically appends `.matrix` extension if not provided
|
|
212
|
-
- All update/delete operations preserve file structure and formatting
|
|
213
|
-
- Interactive mode provides user-friendly prompts for all inputs
|
|
214
|
-
- Value types are auto-detected (boolean, number, array, string)
|
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
# .matrix Parser & Serializer
|
|
2
|
-
|
|
3
|
-
> Node.js/TypeScript library for parsing and serializing .matrix format files
|
|
4
|
-
|
|
5
|
-
**Version**: 1.0.0
|
|
6
|
-
**Tasks**: TASK_141 (Parser/Serializer), TASK_142 (CLI Tool)
|
|
7
|
-
**Feature**: F-015
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## 📋 Overview
|
|
12
|
-
|
|
13
|
-
This library provides a complete implementation of the .matrix v1.0 format specification, including:
|
|
14
|
-
|
|
15
|
-
- **Parser**: Parse .matrix files into JavaScript objects
|
|
16
|
-
- **Serializer**: Serialize JavaScript objects into .matrix format
|
|
17
|
-
- **Validator**: Validate .matrix file syntax with detailed error messages
|
|
18
|
-
- **CLI Tool**: Command-line interface for CRUD operations (create, read, update, delete)
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## 🚀 Installation
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
cd dev/scripts/matrix
|
|
26
|
-
npm install
|
|
27
|
-
|
|
28
|
-
# Optional: Link CLI globally
|
|
29
|
-
npm link
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## 📖 Usage
|
|
35
|
-
|
|
36
|
-
### CLI Tool
|
|
37
|
-
|
|
38
|
-
For command-line operations, see **[CLI_README.md](./CLI_README.md)** for complete documentation.
|
|
39
|
-
|
|
40
|
-
**Quick Examples**:
|
|
41
|
-
```bash
|
|
42
|
-
# Create a new .matrix file
|
|
43
|
-
matrix create tasks.matrix -v 1.0.0 -c T
|
|
44
|
-
|
|
45
|
-
# Read file content
|
|
46
|
-
matrix read tasks.matrix --level 2
|
|
47
|
-
|
|
48
|
-
# Update a rule
|
|
49
|
-
matrix update tasks.matrix TASK_001 -f status -v completed
|
|
50
|
-
|
|
51
|
-
# Delete a rule
|
|
52
|
-
matrix delete tasks.matrix TASK_002 -f
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Programmatic API
|
|
56
|
-
|
|
57
|
-
### Basic Example
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
import { parse, serialize, validate } from '@kenaz/matrix-parser';
|
|
61
|
-
|
|
62
|
-
// Parse .matrix file
|
|
63
|
-
const content = `# .matrix v1.0
|
|
64
|
-
@meta |v=1.0|c=tasks|t=260207-0530|
|
|
65
|
-
@index |tot=123|c=100|p=15|
|
|
66
|
-
@data
|
|
67
|
-
T121|st=C|p=0|dur=135m|desc=API integration|`;
|
|
68
|
-
|
|
69
|
-
const result = parse(content);
|
|
70
|
-
if (result.success) {
|
|
71
|
-
console.log(result.data);
|
|
72
|
-
// {
|
|
73
|
-
// meta: { v: '1.0', c: 'tasks', t: '260207-0530' },
|
|
74
|
-
// index: { tot: 123, c: 100, p: 15 },
|
|
75
|
-
// data: { records: [...] }
|
|
76
|
-
// }
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Serialize back to .matrix format
|
|
80
|
-
const serialized = serialize(result.data!);
|
|
81
|
-
console.log(serialized);
|
|
82
|
-
|
|
83
|
-
// Validate syntax
|
|
84
|
-
const validation = validate(content);
|
|
85
|
-
if (!validation.valid) {
|
|
86
|
-
console.error(validation.errors);
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Using Classes
|
|
91
|
-
|
|
92
|
-
```typescript
|
|
93
|
-
import { MatrixParser, MatrixSerializer, MatrixValidator } from '@kenaz/matrix-parser';
|
|
94
|
-
|
|
95
|
-
// Parser with options
|
|
96
|
-
const parser = new MatrixParser({
|
|
97
|
-
strict: true, // Throw error on invalid syntax
|
|
98
|
-
autoFix: false, // Automatically fix common errors
|
|
99
|
-
validateFields: true // Validate field names
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
const result = parser.parse(content);
|
|
103
|
-
|
|
104
|
-
// Serializer with options
|
|
105
|
-
const serializer = new MatrixSerializer({
|
|
106
|
-
pretty: false, // Add newlines for readability
|
|
107
|
-
includeComment: true, // Include comment line
|
|
108
|
-
comment: '.matrix v1.0' // Custom comment
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
const output = serializer.serialize(data);
|
|
112
|
-
|
|
113
|
-
// Validator
|
|
114
|
-
const validator = new MatrixValidator();
|
|
115
|
-
const validation = validator.validate(content);
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## 🔤 Abbreviations
|
|
121
|
-
|
|
122
|
-
The library automatically handles field abbreviations and value encoding:
|
|
123
|
-
|
|
124
|
-
### Field Abbreviations (72 fields)
|
|
125
|
-
|
|
126
|
-
```typescript
|
|
127
|
-
status → st
|
|
128
|
-
priority → p
|
|
129
|
-
created_at → ct
|
|
130
|
-
updated_at → ut
|
|
131
|
-
duration → dur
|
|
132
|
-
description → desc
|
|
133
|
-
dependencies → dep
|
|
134
|
-
// ... and 65 more
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Value Codes (66 codes)
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
completed → C
|
|
141
|
-
in_progress → P
|
|
142
|
-
pending → D
|
|
143
|
-
P0 → 0
|
|
144
|
-
P1 → 1
|
|
145
|
-
true → 1
|
|
146
|
-
false → 0
|
|
147
|
-
// ... and 59 more
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### Timestamp Shortening
|
|
151
|
-
|
|
152
|
-
```typescript
|
|
153
|
-
2026-02-07T05:30:00Z → 260207-0530
|
|
154
|
-
2026-12-31T23:59:00Z → 261231-2359
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
## ✅ Features
|
|
160
|
-
|
|
161
|
-
### Parser
|
|
162
|
-
|
|
163
|
-
- ✅ Parse three-layer structure (`@meta`, `@index`, `@data`)
|
|
164
|
-
- ✅ Automatic field name expansion
|
|
165
|
-
- ✅ Automatic value decoding
|
|
166
|
-
- ✅ Support for complex task groups
|
|
167
|
-
- ✅ Type inference (boolean, number, list, etc.)
|
|
168
|
-
- ✅ Friendly error messages with line numbers
|
|
169
|
-
|
|
170
|
-
### Serializer
|
|
171
|
-
|
|
172
|
-
- ✅ Serialize JavaScript objects to .matrix format
|
|
173
|
-
- ✅ Automatic field name abbreviation
|
|
174
|
-
- ✅ Automatic value encoding
|
|
175
|
-
- ✅ Timestamp shortening
|
|
176
|
-
- ✅ Lossless round-trip (parse → serialize → parse)
|
|
177
|
-
|
|
178
|
-
### Validator
|
|
179
|
-
|
|
180
|
-
- ✅ Detect 10+ syntax error types
|
|
181
|
-
- ✅ Line number and column position
|
|
182
|
-
- ✅ Expected vs actual comparison
|
|
183
|
-
- ✅ Warnings for non-critical issues
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
## 🧪 Testing
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
# Run tests
|
|
191
|
-
npm test
|
|
192
|
-
|
|
193
|
-
# Run tests with coverage
|
|
194
|
-
npm run test:coverage
|
|
195
|
-
|
|
196
|
-
# Watch mode
|
|
197
|
-
npm run test:watch
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
**Coverage Target**: > 90%
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
|
-
## 📚 Documentation
|
|
205
|
-
|
|
206
|
-
- **Syntax Specification**: `../../design/matrix_format_SYNTAX_BNF.md`
|
|
207
|
-
- **Abbreviations**: `../../design/matrix_format_ABBREVIATIONS.md`
|
|
208
|
-
- **Examples**: `../../design/matrix_format_EXAMPLE_*.matrix`
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## 📝 API Reference
|
|
213
|
-
|
|
214
|
-
### `parse(content: string, options?: ParseOptions): ParseResult`
|
|
215
|
-
|
|
216
|
-
Parse .matrix file content.
|
|
217
|
-
|
|
218
|
-
**Parameters**:
|
|
219
|
-
- `content`: .matrix file content
|
|
220
|
-
- `options`: Parse options
|
|
221
|
-
- `strict`: Throw error on invalid syntax (default: `true`)
|
|
222
|
-
- `autoFix`: Automatically fix common errors (default: `false`)
|
|
223
|
-
- `validateFields`: Validate field names (default: `true`)
|
|
224
|
-
|
|
225
|
-
**Returns**: `ParseResult`
|
|
226
|
-
```typescript
|
|
227
|
-
{
|
|
228
|
-
success: boolean;
|
|
229
|
-
data?: MatrixFile;
|
|
230
|
-
error?: ParseError;
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### `serialize(data: MatrixFile, options?: SerializeOptions): string`
|
|
235
|
-
|
|
236
|
-
Serialize MatrixFile to .matrix format.
|
|
237
|
-
|
|
238
|
-
**Parameters**:
|
|
239
|
-
- `data`: MatrixFile object
|
|
240
|
-
- `options`: Serialize options
|
|
241
|
-
- `pretty`: Add newlines for readability (default: `false`)
|
|
242
|
-
- `includeComment`: Include comment line (default: `true`)
|
|
243
|
-
- `comment`: Custom comment (default: `".matrix v1.0"`)
|
|
244
|
-
|
|
245
|
-
**Returns**: `.matrix` file content
|
|
246
|
-
|
|
247
|
-
### `validate(content: string): ValidationResult`
|
|
248
|
-
|
|
249
|
-
Validate .matrix file syntax.
|
|
250
|
-
|
|
251
|
-
**Parameters**:
|
|
252
|
-
- `content`: .matrix file content
|
|
253
|
-
|
|
254
|
-
**Returns**: `ValidationResult`
|
|
255
|
-
```typescript
|
|
256
|
-
{
|
|
257
|
-
valid: boolean;
|
|
258
|
-
errors: ParseError[];
|
|
259
|
-
warnings: ParseError[];
|
|
260
|
-
}
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
|
-
## 🔧 Error Codes
|
|
266
|
-
|
|
267
|
-
| Code | Description | Severity |
|
|
268
|
-
|------|-------------|----------|
|
|
269
|
-
| E000 | Empty file | Error |
|
|
270
|
-
| E001 | Missing required section | Error |
|
|
271
|
-
| E002 | Invalid section order | Error |
|
|
272
|
-
| E003 | Missing delimiters | Error |
|
|
273
|
-
| E004 | Invalid field format | Error |
|
|
274
|
-
| E005 | Missing required field | Error |
|
|
275
|
-
| E006 | Invalid timestamp format | Error |
|
|
276
|
-
| E007 | Duplicate record_id | Error |
|
|
277
|
-
| E008 | Unknown field key | Warning |
|
|
278
|
-
| E009 | Invalid value type | Warning |
|
|
279
|
-
| E010 | Invalid version number | Error |
|
|
280
|
-
|
|
281
|
-
---
|
|
282
|
-
|
|
283
|
-
## 🛠️ Build
|
|
284
|
-
|
|
285
|
-
```bash
|
|
286
|
-
# Build TypeScript to JavaScript
|
|
287
|
-
npm run build
|
|
288
|
-
|
|
289
|
-
# Output: dist/
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
---
|
|
293
|
-
|
|
294
|
-
## 📄 License
|
|
295
|
-
|
|
296
|
-
MIT
|
|
297
|
-
|
|
298
|
-
---
|
|
299
|
-
|
|
300
|
-
## 👥 Contributors
|
|
301
|
-
|
|
302
|
-
- Developer Team (TASK_141 - Parser/Serializer)
|
|
303
|
-
- Developer Team (TASK_142 - CLI Tool)
|
|
304
|
-
|
|
305
|
-
---
|
|
306
|
-
|
|
307
|
-
**Task IDs**: TASK_141, TASK_142
|
|
308
|
-
**Feature ID**: F-015
|
|
309
|
-
**Version**: 1.0.0
|
|
310
|
-
**Last Updated**: 2026-02-09
|