opencode-skills-collection 4.0.0 → 4.0.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/bundled-skills/.antigravity-install-manifest.json +24 -1
- package/bundled-skills/007/SKILL.md +2 -2
- package/bundled-skills/10-andruia-skill-smith/SKILL.md +1 -1
- package/bundled-skills/agent-squad/SKILL.md +5 -0
- package/bundled-skills/agent-squad/alex/SKILL.md +3 -0
- package/bundled-skills/agent-squad/aria/SKILL.md +3 -0
- package/bundled-skills/agent-squad/dep/SKILL.md +3 -0
- package/bundled-skills/agent-squad/luna/SKILL.md +4 -1
- package/bundled-skills/agent-squad/mason/SKILL.md +3 -0
- package/bundled-skills/agent-squad/max/SKILL.md +3 -0
- package/bundled-skills/agent-squad/quinn/SKILL.md +3 -0
- package/bundled-skills/agent-squad/rex/SKILL.md +3 -0
- package/bundled-skills/angular/metadata.json +1 -1
- package/bundled-skills/angular-best-practices/metadata.json +1 -1
- package/bundled-skills/angular-state-management/metadata.json +1 -1
- package/bundled-skills/angular-ui-patterns/metadata.json +1 -1
- package/bundled-skills/antigravity-skill-orchestrator/SKILL.md +2 -2
- package/bundled-skills/apify-actor-development/SKILL.md +2 -2
- package/bundled-skills/apple-container/SKILL.md +165 -0
- package/bundled-skills/apple-container/references/commands.md +1593 -0
- package/bundled-skills/apple-container/references/concepts.md +294 -0
- package/bundled-skills/apple-container/references/configuration.md +499 -0
- package/bundled-skills/apple-container/references/workflows.md +498 -0
- package/bundled-skills/ask-copilot/SKILL.md +112 -0
- package/bundled-skills/auto-research/SKILL.md +126 -0
- package/bundled-skills/brooks-lint/SKILL.md +1 -1
- package/bundled-skills/browser-harness/references/install.md +3 -1
- package/bundled-skills/chrome-extension-developer/SKILL.md +1 -1
- package/bundled-skills/clean-code-guard/SKILL.md +184 -0
- package/bundled-skills/clean-code-guard/references/ai-failure-modes.md +345 -0
- package/bundled-skills/clean-code-guard/references/comments-and-formatting.md +115 -0
- package/bundled-skills/clean-code-guard/references/dry-kiss-yagni.md +133 -0
- package/bundled-skills/clean-code-guard/references/naming-and-functions.md +187 -0
- package/bundled-skills/clean-code-guard/references/review-checklist.md +150 -0
- package/bundled-skills/clean-code-guard/references/solid.md +280 -0
- package/bundled-skills/clean-code-guard/references/sources.md +47 -0
- package/bundled-skills/cloudflare-security-audit/SKILL.md +137 -0
- package/bundled-skills/cloudflare-security-audit/references/AI-AND-LLM.md +67 -0
- package/bundled-skills/cloudflare-security-audit/references/ATTACK-CLASSES.md +116 -0
- package/bundled-skills/cloudflare-security-audit/references/CLIENT-SIDE.md +67 -0
- package/bundled-skills/cloudflare-security-audit/references/HUNTING.md +110 -0
- package/bundled-skills/cloudflare-security-audit/references/MEMORY-SAFETY-AND-BINARY.md +58 -0
- package/bundled-skills/cloudflare-security-audit/references/RECONNAISSANCE.md +46 -0
- package/bundled-skills/cloudflare-security-audit/references/VALIDATION-AND-REPORTING.md +109 -0
- package/bundled-skills/cloudflare-security-audit/references/WEB-PROTOCOL-AND-AUTH.md +85 -0
- package/bundled-skills/cloudflare-security-audit/resources/report-schema.json +210 -0
- package/bundled-skills/comfyui-gateway/references/troubleshooting.md +1 -1
- package/bundled-skills/commit/SKILL.md +2 -1
- package/bundled-skills/deepapi/SKILL.md +6 -6
- package/bundled-skills/docs/README.md +1 -1
- package/bundled-skills/docs/contributors/quality-bar.md +1 -1
- package/bundled-skills/docs/contributors/security-guardrails.md +1 -1
- package/bundled-skills/docs/integrations/jetski-cortex.md +5 -5
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +3 -3
- package/bundled-skills/docs/maintainers/ci-drift-fix.md +7 -5
- package/bundled-skills/docs/maintainers/merge-batch.md +24 -7
- package/bundled-skills/docs/maintainers/pr-autonomy.md +89 -0
- package/bundled-skills/docs/maintainers/release-notes-7.2.0.md +1 -1
- package/bundled-skills/docs/maintainers/release-process.md +9 -9
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +5 -5
- package/bundled-skills/docs/maintainers/skills-date-tracking.md +1 -1
- package/bundled-skills/docs/maintainers/skills-update-guide.md +2 -2
- package/bundled-skills/docs/users/{antigravity-awesome-skills-vs-awesome-claude-skills.md → agentic-awesome-skills-vs-awesome-claude-skills.md} +5 -5
- package/bundled-skills/docs/users/ai-agent-skills.md +4 -4
- package/bundled-skills/docs/users/best-claude-code-skills-github.md +3 -3
- package/bundled-skills/docs/users/best-cursor-skills-github.md +3 -3
- package/bundled-skills/docs/users/bundles.md +56 -57
- package/bundled-skills/docs/users/claude-code-skills.md +6 -6
- package/bundled-skills/docs/users/codex-cli-skills.md +5 -5
- package/bundled-skills/docs/users/cursor-skills.md +3 -3
- package/bundled-skills/docs/users/faq.md +27 -15
- package/bundled-skills/docs/users/gemini-cli-skills.md +4 -4
- package/bundled-skills/docs/users/getting-started.md +22 -12
- package/bundled-skills/docs/users/kiro-integration.md +7 -7
- package/bundled-skills/docs/users/plugins.md +8 -9
- package/bundled-skills/docs/users/security-skills.md +1 -1
- package/bundled-skills/docs/users/skills-vs-mcp-tools.md +1 -1
- package/bundled-skills/docs/users/specialized-plugin-roadmap.md +3 -4
- package/bundled-skills/docs/users/usage.md +9 -9
- package/bundled-skills/docs/users/visual-guide.md +7 -7
- package/bundled-skills/docs/users/windows-truncation-recovery.md +1 -1
- package/bundled-skills/docs/users/workflows.md +1 -1
- package/bundled-skills/docs/vietnamese/BUNDLES.vi.md +1 -1
- package/bundled-skills/docs/vietnamese/FAQ.vi.md +15 -8
- package/bundled-skills/docs/vietnamese/GETTING_STARTED.vi.md +12 -5
- package/bundled-skills/docs/vietnamese/QUALITY_BAR.vi.md +1 -1
- package/bundled-skills/docs/vietnamese/README.vi.md +21 -17
- package/bundled-skills/docs/vietnamese/SECURITY_GUARDRAILS.vi.md +1 -1
- package/bundled-skills/docs/vietnamese/SKILLS_README.vi.md +2 -2
- package/bundled-skills/docs/vietnamese/TRANSLATION_PLAN.vi.md +1 -1
- package/bundled-skills/docs/vietnamese/VISUAL_GUIDE.vi.md +8 -8
- package/bundled-skills/docs-guard/SKILL.md +109 -0
- package/bundled-skills/docs-guard/references/code-samples.md +46 -0
- package/bundled-skills/docs-guard/references/docstrings.md +60 -0
- package/bundled-skills/docs-guard/references/review-checklist.md +45 -0
- package/bundled-skills/docs-guard/references/sources.md +22 -0
- package/bundled-skills/docs-guard/references/verification.md +51 -0
- package/bundled-skills/efficient-web-research/SKILL.md +4 -0
- package/bundled-skills/electron-development/SKILL.md +1 -1
- package/bundled-skills/event-staffing-compliance/SKILL.md +3 -0
- package/bundled-skills/event-staffing-ordering/SKILL.md +3 -0
- package/bundled-skills/feature-tracking/SKILL.md +222 -0
- package/bundled-skills/flutter-expert/SKILL.md +6 -1
- package/bundled-skills/flutter-expert/resources/implementation-playbook.md +214 -0
- package/bundled-skills/gemini-deep-research/README.md +246 -0
- package/bundled-skills/gemini-deep-research/SKILL.md +136 -0
- package/bundled-skills/gemini-deep-research/requirements.txt +2 -0
- package/bundled-skills/gemini-deep-research/scripts/research.py +692 -0
- package/bundled-skills/git-pushing/SKILL.md +21 -4
- package/bundled-skills/git-pushing/scripts/smart_commit.sh +206 -11
- package/bundled-skills/go-in-depth/scripts/workflow-script.js +4 -1
- package/bundled-skills/grok-build/SKILL.md +167 -0
- package/bundled-skills/grok-build/references/cli.md +99 -0
- package/bundled-skills/huggingface-tool-builder/references/find_models_by_paper.sh +1 -1
- package/bundled-skills/idea-autopsy/SKILL.md +147 -0
- package/bundled-skills/it-manager-hospital/README.md +1 -1
- package/bundled-skills/it-manager-pro/README.md +1 -1
- package/bundled-skills/itil-expert/README.md +1 -1
- package/bundled-skills/langgraph/SKILL.md +1 -1
- package/bundled-skills/linkedin-content-generator/SKILL.md +1 -1
- package/bundled-skills/lint-and-validate/scripts/lint_runner.py +23 -23
- package/bundled-skills/lint-and-validate/scripts/type_coverage.py +30 -30
- package/bundled-skills/logic-lens/SKILL.md +1 -1
- package/bundled-skills/lore/LICENSE +21 -0
- package/bundled-skills/lore/README.md +386 -0
- package/bundled-skills/lore/README.zh-CN.md +386 -0
- package/bundled-skills/lore/SKILL.md +453 -0
- package/bundled-skills/lore/WORKFLOWS.md +216 -0
- package/bundled-skills/lore/WORKFLOWS.zh-CN.md +216 -0
- package/bundled-skills/lore/references/audit-template.md +60 -0
- package/bundled-skills/lore/references/compatibility.md +228 -0
- package/bundled-skills/lore/references/config.md +125 -0
- package/bundled-skills/lore/references/entry-format.md +70 -0
- package/bundled-skills/lore/references/history-command.md +106 -0
- package/bundled-skills/lore/references/monorepo-detection.md +78 -0
- package/bundled-skills/lore/references/platform-mirrors.md +377 -0
- package/bundled-skills/lore/references/stale-new-markers.md +62 -0
- package/bundled-skills/lore/references/summary-template.md +98 -0
- package/bundled-skills/lore/scripts/README.md +54 -0
- package/bundled-skills/lore/scripts/README.zh-CN.md +54 -0
- package/bundled-skills/lore/scripts/find_duplicates.py +211 -0
- package/bundled-skills/lore/scripts/find_stale.py +116 -0
- package/bundled-skills/lore/scripts/history.py +527 -0
- package/bundled-skills/lore/scripts/id_hash.py +32 -0
- package/bundled-skills/lore/scripts/list_entries.py +183 -0
- package/bundled-skills/lovable-cleanup/SKILL.md +3 -3
- package/bundled-skills/makepad-splash/SKILL.md +1 -1
- package/bundled-skills/mmx-cli/SKILL.md +14 -1
- package/bundled-skills/monopoly/SKILL.md +5 -0
- package/bundled-skills/monopoly/patterns/SKILL.md +4 -0
- package/bundled-skills/monopoly/scale-benchmarks/SKILL.md +4 -0
- package/bundled-skills/monopoly/security-checklist/SKILL.md +4 -0
- package/bundled-skills/monopoly/tech-matrix/SKILL.md +4 -0
- package/bundled-skills/mtls-configuration/SKILL.md +1 -1
- package/bundled-skills/network-101/SKILL.md +4 -5
- package/bundled-skills/nika/SKILL.md +270 -0
- package/bundled-skills/not-a-vibe-coder/SKILL.md +4 -0
- package/bundled-skills/ontoly-software-graph/SKILL.md +160 -0
- package/bundled-skills/openclaw-github-repo-commander/SKILL.md +1 -1
- package/bundled-skills/pilot-protocol/SKILL.md +6 -3
- package/bundled-skills/postgres-readonly-queries/README.md +77 -0
- package/bundled-skills/postgres-readonly-queries/SKILL.md +152 -0
- package/bundled-skills/postgres-readonly-queries/connections.example.json +34 -0
- package/bundled-skills/postgres-readonly-queries/requirements.txt +1 -0
- package/bundled-skills/postgres-readonly-queries/scripts/query.py +262 -0
- package/bundled-skills/pptx-deck-creation/SKILL.md +275 -0
- package/bundled-skills/pptx-deck-creation/references/audit-checklist.md +156 -0
- package/bundled-skills/pptx-deck-creation/references/design-profiles.md +96 -0
- package/bundled-skills/pptx-deck-creation/references/python-snippets.md +150 -0
- package/bundled-skills/pptx-deck-creation/references/reference-deck-analysis.md +91 -0
- package/bundled-skills/pptx-deck-creation/references/visual-asset-adapters.md +158 -0
- package/bundled-skills/privilege-escalation-methods/SKILL.md +1 -1
- package/bundled-skills/product-decision-agent/SKILL.md +94 -0
- package/bundled-skills/product-decision-agent/agents/openai.yaml +7 -0
- package/bundled-skills/product-decision-agent/references/methodology-basis.md +232 -0
- package/bundled-skills/product-decision-agent/references/product-playbooks.md +813 -0
- package/bundled-skills/product-decision-agent/references/reasoning-engine.md +289 -0
- package/bundled-skills/product-decision-agent/references/response-examples.md +279 -0
- package/bundled-skills/product-decision-agent/scripts/quality_gate.py +221 -0
- package/bundled-skills/product-decision-agent/scripts/test_quality_gate.py +94 -0
- package/bundled-skills/pytest-skill/reference/playbook.md +358 -0
- package/bundled-skills/quit-sponsor/SKILL.md +96 -0
- package/bundled-skills/rclone-cli/references/providers/s3.md +1 -1
- package/bundled-skills/security-and-hardening/SKILL.md +1 -1
- package/bundled-skills/semgrep-rule-creator/SKILL.md +6 -6
- package/bundled-skills/skill-creator/README.md +3 -3
- package/bundled-skills/skill-creator/SKILL.md +8 -4
- package/bundled-skills/skill-creator/scripts/quick_validate.py +1 -1
- package/bundled-skills/sql-injection-testing/SKILL.md +4 -4
- package/bundled-skills/subagent-orchestrator/README.md +1 -1
- package/bundled-skills/super-code/bash/SKILL.md +3 -0
- package/bundled-skills/super-code/c/SKILL.md +3 -0
- package/bundled-skills/super-code/cpp/SKILL.md +3 -0
- package/bundled-skills/super-code/csharp/SKILL.md +3 -0
- package/bundled-skills/super-code/dart/SKILL.md +3 -0
- package/bundled-skills/super-code/elixir/SKILL.md +3 -0
- package/bundled-skills/super-code/go/SKILL.md +3 -0
- package/bundled-skills/super-code/java/SKILL.md +3 -0
- package/bundled-skills/super-code/kotlin/SKILL.md +3 -0
- package/bundled-skills/super-code/php/SKILL.md +3 -0
- package/bundled-skills/super-code/python/SKILL.md +3 -0
- package/bundled-skills/super-code/ruby/SKILL.md +3 -0
- package/bundled-skills/super-code/rust/SKILL.md +3 -0
- package/bundled-skills/super-code/scala/SKILL.md +3 -0
- package/bundled-skills/super-code/swift/SKILL.md +3 -0
- package/bundled-skills/super-code/typescript/SKILL.md +3 -0
- package/bundled-skills/telegram-bot-messaging/README.md +185 -0
- package/bundled-skills/telegram-bot-messaging/SKILL.md +101 -0
- package/bundled-skills/telegram-bot-messaging/scripts/telegram.sh +420 -0
- package/bundled-skills/test-guard/SKILL.md +132 -0
- package/bundled-skills/test-guard/references/jest.md +50 -0
- package/bundled-skills/test-guard/references/llm-app-testing.md +40 -0
- package/bundled-skills/test-guard/references/phpunit.md +56 -0
- package/bundled-skills/test-guard/references/pytest.md +65 -0
- package/bundled-skills/trading-ledger/SKILL.md +11 -3
- package/bundled-skills/uizze-ui-research/SKILL.md +93 -0
- package/bundled-skills/vibe-code-auditor/SKILL.md +1 -1
- package/bundled-skills/vibecode-production-qa-validator/SKILL.md +1 -1
- package/bundled-skills/videodb/scripts/ws_listener.py +29 -15
- package/bundled-skills/voice-ai-engine-development/README.md +1 -1
- package/bundled-skills/vulnerability-scanner/SKILL.md +1 -1
- package/bundled-skills/warehouse/SKILL.md +154 -0
- package/bundled-skills/woo-guard/SKILL.md +113 -0
- package/bundled-skills/woo-guard/references/checkout-and-money.md +64 -0
- package/bundled-skills/woo-guard/references/hpos-and-crud.md +87 -0
- package/bundled-skills/woo-guard/references/review-checklist.md +44 -0
- package/bundled-skills/woo-guard/references/sources.md +17 -0
- package/bundled-skills/wp-guard/SKILL.md +119 -0
- package/bundled-skills/wp-guard/references/i18n.md +88 -0
- package/bundled-skills/wp-guard/references/performance.md +70 -0
- package/bundled-skills/wp-guard/references/review-checklist.md +57 -0
- package/bundled-skills/wp-guard/references/security.md +100 -0
- package/bundled-skills/wp-guard/references/sources.md +27 -0
- package/bundled-skills/writing-skills/gotchas.md +1 -1
- package/bundled-skills/writing-skills/references/standards/metadata-standard.md +1 -1
- package/bundled-skills/x-twitter-scraper/SKILL.md +14 -32
- package/bundled-skills/xss-html-injection/SKILL.md +3 -3
- package/bundled-skills/youtube-seo-optimizer/SKILL.md +1 -1
- package/bundled-skills/youtube-summarizer/CHANGELOG.md +2 -2
- package/package.json +1 -1
- package/skills_index.json +273 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
# Platform mirrors reference
|
|
2
|
+
|
|
3
|
+
How `.lore/*` content gets mirrored to platform-specific config files. The main `SKILL.md` covers the high-level rules; this file holds the per-platform mapping, the two-section file structure, and the algorithm that resolves which files to generate (auto-detect by default, explicit override available).
|
|
4
|
+
|
|
5
|
+
## Platform → file mapping
|
|
6
|
+
|
|
7
|
+
| Platform | File (default) | Also accepted |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Claude Code | `CLAUDE.md` (root) | `.claude/CLAUDE.md` |
|
|
10
|
+
| Cursor | `.cursorrules` (root) | `.cursor/rules/*.mdc` |
|
|
11
|
+
| Cline | `.clinerules` (root) | — |
|
|
12
|
+
| Aider | `AGENTS.md` (root) | `CONVENTIONS.md` |
|
|
13
|
+
| OpenAI Codex | `AGENTS.md` (root) | — |
|
|
14
|
+
| OpenCode | `AGENTS.md` (root) | — |
|
|
15
|
+
| Windsurf | `.windsurfrules` (root) | — |
|
|
16
|
+
| GitHub Copilot | `.github/copilot-instructions.md` | — |
|
|
17
|
+
| Continue.dev | `.continue/rules/lore.md` | — |
|
|
18
|
+
| LangGraph / DeepAgents | (no file — inject at runtime) | — |
|
|
19
|
+
|
|
20
|
+
For LangGraph and DeepAgents, the skill does not produce a mirror file. Read `.lore/*.md` directly or ingest into the system prompt at runtime — that ingestion is the user's responsibility.
|
|
21
|
+
|
|
22
|
+
## Resolution: how `mirror_targets` is computed
|
|
23
|
+
|
|
24
|
+
When the skill needs to know which platform files to generate (during `init`, `mirror`, and `compress` when `auto_mirror: true`), it runs the following procedure:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
resolve_mirror_targets(config, repo_root):
|
|
28
|
+
|
|
29
|
+
# 1. If config has mirror_targets set, auto-detect is skipped, but validation is not
|
|
30
|
+
if "mirror_targets" in config:
|
|
31
|
+
return validate_mirror_targets(config["mirror_targets"], repo_root)
|
|
32
|
+
|
|
33
|
+
# 2. Scan repo root for existing platform files (see Scan candidates)
|
|
34
|
+
detected = scan_existing_platform_files(repo_root)
|
|
35
|
+
if detected:
|
|
36
|
+
return validate_mirror_targets(detected, repo_root)
|
|
37
|
+
|
|
38
|
+
# 3. Nothing detected → ask user via multi-select, persist to config, return
|
|
39
|
+
selected = ask_user_multi_select(AGENT_CHOICES)
|
|
40
|
+
write_mirror_targets_to_config(selected)
|
|
41
|
+
return validate_mirror_targets(selected, repo_root)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This is the core resolution used by all three commands. `init` extends it with classification and per-file takeover steps — see "Init-time behavior (full procedure)" below.
|
|
45
|
+
|
|
46
|
+
### Mandatory target validation
|
|
47
|
+
|
|
48
|
+
Validation is fail-closed and atomic. Validate the complete target list **before reading,
|
|
49
|
+
creating, classifying, archiving, or writing any target**. If one entry fails, report it and
|
|
50
|
+
abort the mirror operation without touching any target.
|
|
51
|
+
|
|
52
|
+
For each target:
|
|
53
|
+
|
|
54
|
+
1. Require a non-empty string containing no NUL byte. Reject absolute paths on every
|
|
55
|
+
platform (POSIX `/...`, Windows drive paths such as `C:\\...`, and UNC paths).
|
|
56
|
+
2. Parse path components without interpreting the value as a shell pattern. Reject any `..`
|
|
57
|
+
component; normalize `.` and repeated separators only after that rejection.
|
|
58
|
+
3. Require the normalized relative path to match this allowlist exactly:
|
|
59
|
+
`CLAUDE.md`, `.claude/CLAUDE.md`, `.cursorrules`, `.clinerules`, `AGENTS.md`,
|
|
60
|
+
`CONVENTIONS.md`, `.windsurfrules`, `.github/copilot-instructions.md`, or
|
|
61
|
+
`.continue/rules/lore.md`; or match `.cursor/rules/<name>.mdc`, where `<name>` is one
|
|
62
|
+
non-empty filename segment (no nested directory).
|
|
63
|
+
4. Resolve `repo_root` to its canonical path. Walk every existing component of the target
|
|
64
|
+
with symlinks resolved and require it to remain inside that canonical root. For a missing
|
|
65
|
+
target, resolve its nearest existing parent the same way. Reject a target whose file or
|
|
66
|
+
parent symlink escapes the root. Perform this check again immediately before every read or
|
|
67
|
+
write to reduce check/use races.
|
|
68
|
+
|
|
69
|
+
Examples: accept `CLAUDE.md`, `.github/copilot-instructions.md`, and
|
|
70
|
+
`.cursor/rules/lore.mdc`. Reject `/tmp/CLAUDE.md`, `../CLAUDE.md`,
|
|
71
|
+
`.cursor/rules/nested/lore.mdc`, `notes.md`, and an allowlisted-looking path whose existing
|
|
72
|
+
parent or file is a symlink outside the project.
|
|
73
|
+
|
|
74
|
+
### Scan candidates
|
|
75
|
+
|
|
76
|
+
The auto-detect step checks for the following paths at `repo_root`:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
CLAUDE.md
|
|
80
|
+
.claude/CLAUDE.md
|
|
81
|
+
.cursorrules
|
|
82
|
+
.clinerules
|
|
83
|
+
AGENTS.md
|
|
84
|
+
CONVENTIONS.md
|
|
85
|
+
.windsurfrules
|
|
86
|
+
.github/copilot-instructions.md
|
|
87
|
+
.continue/rules/lore.md
|
|
88
|
+
.cursor/rules/*.mdc # glob: any .mdc file under .cursor/rules/
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
These match the platform table above (default + "Also accepted" filenames). The `.cursor/rules/*.mdc` entry is a glob — it's a hit if `.cursor/rules/` exists and contains at least one `.mdc` file.
|
|
92
|
+
|
|
93
|
+
### Multi-select agent choices
|
|
94
|
+
|
|
95
|
+
When Step 3 fires, present this question to the user:
|
|
96
|
+
|
|
97
|
+
| Choice | Primary file written |
|
|
98
|
+
|---|---|
|
|
99
|
+
| Claude Code | `CLAUDE.md` |
|
|
100
|
+
| Cursor | `.cursorrules` |
|
|
101
|
+
| Cline | `.clinerules` |
|
|
102
|
+
| Aider | `AGENTS.md` |
|
|
103
|
+
| Codex | `AGENTS.md` |
|
|
104
|
+
| OpenCode | `AGENTS.md` |
|
|
105
|
+
| Windsurf | `.windsurfrules` |
|
|
106
|
+
| GitHub Copilot | `.github/copilot-instructions.md` |
|
|
107
|
+
| Continue.dev | `.continue/rules/lore.md` |
|
|
108
|
+
|
|
109
|
+
Aider, Codex, and OpenCode all map to `AGENTS.md`. Selecting any combination produces one entry. Selecting nothing is valid — writes `mirror_targets: []` (no mirrors generated).
|
|
110
|
+
|
|
111
|
+
### When this runs
|
|
112
|
+
|
|
113
|
+
- `lore init` — always interactive.
|
|
114
|
+
- `lore mirror` when `mirror_targets` is absent — also interactive (skill is invoked through chat).
|
|
115
|
+
- `lore compress` (when `auto_mirror: true`) — also goes through this resolution if `mirror_targets` is absent.
|
|
116
|
+
|
|
117
|
+
Both paths use the same function. Once `init` has run, `mirror_targets` is set, so subsequent `mirror` calls hit Step 1 and are silent.
|
|
118
|
+
|
|
119
|
+
## Two-section file structure
|
|
120
|
+
|
|
121
|
+
Every mirror file is split into two sections by a `---` separator. The top section is Skill-managed and rewritten on mirror regeneration. The bottom section is user-editable and preserved verbatim.
|
|
122
|
+
|
|
123
|
+
```markdown
|
|
124
|
+
## Lore (auto-managed)
|
|
125
|
+
|
|
126
|
+
# .lore SUMMARY (synced 2026-07-09)
|
|
127
|
+
|
|
128
|
+
> Last compressed: 2026-07-09
|
|
129
|
+
> Total entries: 247 across 3 scopes
|
|
130
|
+
|
|
131
|
+
## Global
|
|
132
|
+
- Monorepo with pnpm workspaces + Turborepo — [_global/ARCHITECTURE.md#ARCH-2026-01-15-d7a3]
|
|
133
|
+
...
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## My notes (free edit)
|
|
138
|
+
|
|
139
|
+
- Keep answers concise
|
|
140
|
+
- Currently refactoring the user auth module
|
|
141
|
+
- Prefer English
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
The `---` separator is a literal Markdown horizontal rule. Both sections are plain Markdown so any agent or editor can render them normally.
|
|
145
|
+
|
|
146
|
+
### Section detection rules
|
|
147
|
+
|
|
148
|
+
When syncing a mirror file:
|
|
149
|
+
|
|
150
|
+
1. If the file contains `---` on its own line, that line is the boundary. Everything above is the Lore section, everything below is My notes.
|
|
151
|
+
2. If the file contains a `## My notes` header, the My notes section starts at that header and goes to EOF.
|
|
152
|
+
3. If neither marker is present, the entire file is treated as the Lore section (i.e. no My notes section). Subsequent sync appends a separator + empty My notes section.
|
|
153
|
+
4. If the file is missing the `## Lore` header but has `## My notes`, the entire file is treated as user notes. Skill does not write to it. User is asked to confirm before sync restructures the file.
|
|
154
|
+
|
|
155
|
+
## Sync-time behavior
|
|
156
|
+
|
|
157
|
+
**`sync` does not regenerate platform mirrors.** This is intentional — see the "Mirror update triggers" section in `SKILL.md`. The skill only writes `.lore/*.md` during `sync`. To update mirrors after `sync`, the user runs `lore mirror` (or `compress`, which calls mirror generation as a side effect).
|
|
158
|
+
|
|
159
|
+
If a project needs the old behavior (mirror updates on every `sync`), set `sync_updates_mirror: true` in `.lore/.config.json`.
|
|
160
|
+
|
|
161
|
+
## Mirror-time behavior (`lore mirror`)
|
|
162
|
+
|
|
163
|
+
This is the actual write step for platform mirrors.
|
|
164
|
+
|
|
165
|
+
1. Validate the complete configured target list using "Mandatory target validation" above.
|
|
166
|
+
Abort without reading or writing any target if validation fails.
|
|
167
|
+
2. Read the current state of `.lore/SUMMARY.md` and the scope-tagged index.
|
|
168
|
+
3. For each validated mirror target, recheck canonical containment immediately before access,
|
|
169
|
+
then read the existing file and detect the section boundary.
|
|
170
|
+
4. Compute the new Lore section content.
|
|
171
|
+
5. **Content-based dedup**: if the new Lore section content is byte-identical to the existing one, skip writing. Report "No changes needed: `<file>`".
|
|
172
|
+
6. If different, replace the Lore section (full rewrite, no merge with previous content). Preserve the My notes section verbatim.
|
|
173
|
+
7. Recheck canonical containment, then write the file back. Report "Mirror updated: `<file>`".
|
|
174
|
+
|
|
175
|
+
The content-based dedup step (4) is the key reason `mirror` can be run frequently without polluting `git log` — most invocations will be no-ops once the mirror is in sync.
|
|
176
|
+
|
|
177
|
+
## Init-time behavior (full procedure)
|
|
178
|
+
|
|
179
|
+
The `init` command extends the resolution algorithm above with classification and per-file takeover steps. The full procedure:
|
|
180
|
+
|
|
181
|
+
1. **Check whether `.lore/` exists.**
|
|
182
|
+
- Absent → create `.lore/` and write an initial empty config.
|
|
183
|
+
- Present → load existing `.lore/.config.json` (use defaults if missing).
|
|
184
|
+
|
|
185
|
+
2. **Scan existing platform files** in repo root using the same candidate list as the resolution algorithm. Result: list of paths that exist.
|
|
186
|
+
|
|
187
|
+
3. **Classify each detected file** into one of three classes:
|
|
188
|
+
- **Class (a)** — already a lore mirror: contains `## Lore` section.
|
|
189
|
+
- **Class (b)** — user-written: contains `## My notes` but no `## Lore`.
|
|
190
|
+
- **Class (c)** — unmarked: neither header present.
|
|
191
|
+
|
|
192
|
+
For class (b) and (c) files, present a per-file choice:
|
|
193
|
+
- **Take over**: file becomes a two-section mirror; existing content is preserved as My notes.
|
|
194
|
+
- **Preserve as-is**: file is left alone; NOT added to `mirror_targets`.
|
|
195
|
+
- **Abort**: exit init entirely. `.lore/` may exist (from Step 1) but no `mirror_targets` is written.
|
|
196
|
+
|
|
197
|
+
Class (a) files are auto-included in `mirror_targets`.
|
|
198
|
+
|
|
199
|
+
4. **Multi-select question.** "Which agents do you use in this project?" Default pre-selection: every agent corresponding to a class (a) file. Empty selection is allowed — but class (a) files still get included via Step 5.
|
|
200
|
+
|
|
201
|
+
5. **Compute final `mirror_targets`** by combining three sources and deduplicating:
|
|
202
|
+
- All class (a) files from Step 3 (always included, regardless of Step 4 selection).
|
|
203
|
+
- Files chosen via "take over" in Step 3.
|
|
204
|
+
- Primary files for additional agents the user selected in Step 4 that aren't already covered.
|
|
205
|
+
|
|
206
|
+
Dedup: Aider and Codex both map to `AGENTS.md` and collapse to one entry.
|
|
207
|
+
|
|
208
|
+
6. **Write `.lore/.config.json`** with `mirror_targets` populated.
|
|
209
|
+
|
|
210
|
+
7. **Generate initial mirror files** for each target:
|
|
211
|
+
- File absent → full template (`## Lore` + `---` + empty `## My notes`).
|
|
212
|
+
- File present with `## Lore` → refresh Lore section, preserve My notes verbatim.
|
|
213
|
+
- File present and "take over" chosen → old content becomes My notes, new `## Lore` above.
|
|
214
|
+
- File present and "preserve" chosen → no write.
|
|
215
|
+
|
|
216
|
+
For each generated mirror file, the section template is:
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
## Lore (auto-managed)
|
|
220
|
+
|
|
221
|
+
<initial or refreshed Lore content>
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## My notes (free edit)
|
|
226
|
+
|
|
227
|
+
<preserved or empty>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## What gets mirrored
|
|
231
|
+
|
|
232
|
+
The mirror's Lore section is an **index** into `.lore/` — not a copy of its content. This keeps per-session token cost flat (~500 B regardless of project size) and aligns with how platform instruction files (`CLAUDE.md`, `.cursorrules`, etc.) are designed to be used: as small pointers that tell the agent where to find detail on demand.
|
|
233
|
+
|
|
234
|
+
The agent generating the mirror walks `.lore/` and emits the structure below. Sections appear only when their content exists (adaptive rendering).
|
|
235
|
+
|
|
236
|
+
### Index template
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
## Lore (auto-managed)
|
|
240
|
+
|
|
241
|
+
Project memory. Read deeper on demand.
|
|
242
|
+
|
|
243
|
+
**Structure**:
|
|
244
|
+
- Digest: `.lore/SUMMARY.md` (top-level overview)
|
|
245
|
+
- Global: `.lore/_global/` (architecture, decisions, conventions)
|
|
246
|
+
- Scopes: `.lore/scopes/`
|
|
247
|
+
- `.lore/scopes/<scope_name>/` (<description>)
|
|
248
|
+
- `.lore/scopes/<scope_name>/`
|
|
249
|
+
...
|
|
250
|
+
|
|
251
|
+
**Query**: `lore query <term>` or `lore query <scope>:<term>`
|
|
252
|
+
**Update**: see the `lore` skill (init / sync / query / audit / compress / mirror)
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
## My notes (free edit)
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
The `## Lore (auto-managed)` opener, `---` separator, and `## My notes (free edit)` closer are **always present** — only the `**Structure**:` body varies with adaptive rendering. Agent preserves the My notes section verbatim across regenerations.
|
|
259
|
+
|
|
260
|
+
### Field sources
|
|
261
|
+
|
|
262
|
+
- `<scope_name>` — directory name under `.lore/scopes/`. Each scope's full path is `.lore/scopes/<scope_name>/`.
|
|
263
|
+
- `<description>` — extracted from `.lore/scopes/<scope_name>/ARCHITECTURE.md` via the HTML comment `<!-- description: ... -->`. See "Scope description extraction" below. If absent, the description is omitted (scope row still appears, just without parenthetical).
|
|
264
|
+
|
|
265
|
+
The index does **not** track the project's source-directory mapping for each scope (e.g. `packages/frontend/` for the `frontend` scope). Source paths are detected by `references/monorepo-detection.md` at init time but not persisted in `.lore/`. If a user needs source paths surfaced in the mirror, that mapping belongs in the project's own docs.
|
|
266
|
+
|
|
267
|
+
### Section visibility rules
|
|
268
|
+
|
|
269
|
+
| Section | Visible when |
|
|
270
|
+
|---|---|
|
|
271
|
+
| `Digest:` line | always |
|
|
272
|
+
| `Global:` line | `.lore/_global/` exists and has any entry |
|
|
273
|
+
| `Scopes:` block | at least one scope directory exists under `.lore/` |
|
|
274
|
+
| `Query:` line | always |
|
|
275
|
+
| `Update:` line | always |
|
|
276
|
+
|
|
277
|
+
### Adaptive renderings
|
|
278
|
+
|
|
279
|
+
Only the `**Structure**:` body varies. The `## Lore (auto-managed)` opener, `---` separator, and `## My notes (free edit)` closer are always present and unchanged.
|
|
280
|
+
|
|
281
|
+
**Empty project** (just initialized, no entries yet):
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
## Lore (auto-managed)
|
|
285
|
+
|
|
286
|
+
Project memory. Read deeper on demand.
|
|
287
|
+
|
|
288
|
+
**Structure**:
|
|
289
|
+
- Digest: `.lore/SUMMARY.md` (top-level overview)
|
|
290
|
+
|
|
291
|
+
**Query**: `lore query <term>`
|
|
292
|
+
**Update**: see the `lore` skill
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
## My notes (free edit)
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
`Global:` and `Scopes:` blocks omitted.
|
|
299
|
+
|
|
300
|
+
**Single-scope project**:
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
**Structure**:
|
|
304
|
+
- Digest: `.lore/SUMMARY.md`
|
|
305
|
+
- Global: `.lore/_global/`
|
|
306
|
+
- Scopes: `.lore/scopes/`
|
|
307
|
+
- `.lore/scopes/frontend/` (React 18 + TypeScript)
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
`Scopes:` block has one entry.
|
|
311
|
+
|
|
312
|
+
**Monorepo with multiple scopes**:
|
|
313
|
+
|
|
314
|
+
```
|
|
315
|
+
**Structure**:
|
|
316
|
+
- Digest: `.lore/SUMMARY.md`
|
|
317
|
+
- Global: `.lore/_global/`
|
|
318
|
+
- Scopes: `.lore/scopes/`
|
|
319
|
+
- `.lore/scopes/frontend/` (React 18 + TypeScript)
|
|
320
|
+
- `.lore/scopes/backend/` (PostgreSQL + Prisma)
|
|
321
|
+
- `.lore/scopes/shared/`
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Scope description extraction
|
|
325
|
+
|
|
326
|
+
The agent scans `.lore/scopes/<scope_name>/ARCHITECTURE.md` for the **first line matching** `<!-- description: <text> -->` (anchored to start of line; `description:` literal). Rules:
|
|
327
|
+
|
|
328
|
+
- **First match wins.** If multiple `<!-- description: ... -->` lines exist, only the first is used.
|
|
329
|
+
- **`<text>` is single-line.** A comment must not contain a newline before `-->`. Multi-line comments are ignored.
|
|
330
|
+
- **Whitespace trimmed.** Leading and trailing whitespace inside `<text>` is stripped.
|
|
331
|
+
- **No match → no description.** The scope row appears without parenthetical; the row is not removed.
|
|
332
|
+
|
|
333
|
+
Example `ARCHITECTURE.md` with description:
|
|
334
|
+
|
|
335
|
+
```
|
|
336
|
+
<!-- description: React 18 + TypeScript frontend -->
|
|
337
|
+
# Frontend Architecture
|
|
338
|
+
|
|
339
|
+
All UI code lives here. ...
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Scope ordering
|
|
343
|
+
|
|
344
|
+
Scope rows in the `Scopes:` block are emitted in **alphabetical order** by `<scope_name>`. Pinning order is important: the content-based dedup step compares byte-for-byte, so any order change between runs causes spurious "Mirror updated" reports.
|
|
345
|
+
|
|
346
|
+
### What does NOT trigger mirror regeneration
|
|
347
|
+
|
|
348
|
+
Index content does not change when:
|
|
349
|
+
- Individual entries are edited
|
|
350
|
+
- `SUMMARY.md` content is updated (the index only points to its path)
|
|
351
|
+
- Entry counts change
|
|
352
|
+
- A scope's `ARCHITECTURE.md` content changes (only the `<!-- description: -->` comment affects the index)
|
|
353
|
+
|
|
354
|
+
Index content changes require regeneration when:
|
|
355
|
+
- A new scope directory is added under `.lore/`
|
|
356
|
+
- A scope is removed
|
|
357
|
+
- A scope's `ARCHITECTURE.md` `<!-- description: -->` line changes
|
|
358
|
+
- `.lore/_global/` gains or loses its first entry (Global section visibility flips)
|
|
359
|
+
|
|
360
|
+
## Manual operations
|
|
361
|
+
|
|
362
|
+
| Command | Effect |
|
|
363
|
+
|---|---|
|
|
364
|
+
| `lore mirror` | Force-regenerate all configured platform mirrors from current `.lore/*` state. Content-based dedup: skips targets whose new Lore section matches the existing one. |
|
|
365
|
+
| `lore mirror reset <file>` | Archive current My notes content to `.lore/.archive/<file>-<date>.md`, then write a clean mirror with only the Lore section. User must confirm. |
|
|
366
|
+
| `lore mirror show <file>` | Print the file with the two sections clearly delimited in the output. Pure read. |
|
|
367
|
+
| `lore mirror check` | For each configured target, verify it has a `---` separator and a `## My notes` section. Report any structural problems. Read-only. |
|
|
368
|
+
|
|
369
|
+
## Trigger rules
|
|
370
|
+
|
|
371
|
+
| Trigger | Behavior |
|
|
372
|
+
|---|---|
|
|
373
|
+
| `init` confirms draft | Auto-generate mirrors for all configured targets using the init-time rules above. |
|
|
374
|
+
| `sync` proposal accepted | Writes to `.lore/*.md` only. Does **not** touch mirrors. User runs `lore mirror` separately to publish. (Override: set `sync_updates_mirror: true` in config to restore old behavior.) |
|
|
375
|
+
| `compress` completes | If `auto_mirror: true`, regenerate mirrors (with content-based dedup). Otherwise ask per target. |
|
|
376
|
+
| `lore mirror` | Force-regenerate all configured targets with content-based dedup. |
|
|
377
|
+
| `query` / `audit` | Never touches mirrors. |
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Stale / New marking convention
|
|
2
|
+
|
|
3
|
+
When `sync` proposes a change, it never silently mutates files. Instead it emits one or more of these markers. The user reads the proposal and accepts/rejects per marker type.
|
|
4
|
+
|
|
5
|
+
## Marker types
|
|
6
|
+
|
|
7
|
+
| Marker | Purpose |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `[NEW]` | Propose adding a new entry |
|
|
10
|
+
| `[STALE]` | Propose marking an existing entry as superseded/contradicted |
|
|
11
|
+
| `[REFINED]` | Propose updating an existing entry's text in place |
|
|
12
|
+
| `[ALERT]` | Conflicting signal detected during sync that needs human resolution |
|
|
13
|
+
| `[COMPRESS NOTICE]` | Threshold tripped; suggest running `compress` after this sync |
|
|
14
|
+
|
|
15
|
+
## Full example
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
## [NEW] Proposed additions
|
|
19
|
+
- [scopes/frontend/ARCHITECTURE.md] [ARCH-2026-07-09-b4d2] Use `react-hook-form` for all forms. #added:2026-07-09
|
|
20
|
+
- [scopes/frontend/CONVENTIONS.md] [CONV-2026-07-09-c5e1] Never use `any` in TypeScript; prefer `unknown` + narrowing. #added:2026-07-09
|
|
21
|
+
|
|
22
|
+
## [STALE] Candidates for archive
|
|
23
|
+
- [scopes/frontend/ARCHITECTURE.md] [ARCH-2026-01-15-d7a3] Use Pages Router (Next.js). #stale:2026-07-09
|
|
24
|
+
Evidence: `frontend/package.json` shows `"next": "^14.0.0"` with `app/` directory present.
|
|
25
|
+
|
|
26
|
+
## [REFINED] Existing entries updated
|
|
27
|
+
- [scopes/frontend/DECISIONS.md] [DEC-2026-02-03-7c19] (was: "use Zustand") → "use Zustand v4+ with slices pattern" #verified:2026-07-09
|
|
28
|
+
|
|
29
|
+
## [ALERT] Conflicting signals detected during sync
|
|
30
|
+
- Sync proposes `[CONV-2026-07-09-c5e1]` (no `any`), but `[CONV-2026-06-01-f0a1]` already says "use `any` sparingly in test mocks". Resolution: refined entry above clarifies the exception.
|
|
31
|
+
|
|
32
|
+
## [COMPRESS NOTICE]
|
|
33
|
+
- Memory bank has 612 entries; last compression 47 days ago. Consider running `lore compress` after this sync.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## User reply semantics
|
|
37
|
+
|
|
38
|
+
The user can reply with:
|
|
39
|
+
|
|
40
|
+
- `"accept all"` — apply every `[NEW]`, `[STALE]`, and `[REFINED]` in the proposal
|
|
41
|
+
- `"accept only NEW"` — add new entries, leave existing untouched
|
|
42
|
+
- `"accept NEW + REFINE"` — add new and refine, do not mark anything stale
|
|
43
|
+
- `"drop STALE #d7a3"` — skip one specific stale entry
|
|
44
|
+
- `"reject all"` — discard the entire proposal
|
|
45
|
+
|
|
46
|
+
For partial acceptance, the user should explicitly list which items to apply.
|
|
47
|
+
|
|
48
|
+
## Marker → file operation mapping
|
|
49
|
+
|
|
50
|
+
| Marker | File action |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `[NEW]` | Append a new bullet to the named file, with `#added:<today>` |
|
|
53
|
+
| `[STALE]` | Append `#stale:<today>` tag to the existing entry; entry stays in the file |
|
|
54
|
+
| `[REFINED]` | Replace the entry text in place, keep the ID, update `#verified:<today>` |
|
|
55
|
+
| `[ALERT]` | No direct file change; only marks the conflict for user resolution |
|
|
56
|
+
| `[COMPRESS NOTICE]` | No file change; advisory only |
|
|
57
|
+
|
|
58
|
+
Note: `[STALE]` does not delete or move anything. The entry remains in its file with a `#stale` tag until the user (or a later sync) explicitly moves it to `archive/`. This keeps the rollback path clean.
|
|
59
|
+
|
|
60
|
+
## When audit uses these markers
|
|
61
|
+
|
|
62
|
+
`audit` does **not** use these markers. It writes its own severity tags (`[CONFLICT]`, `[STALE]`, `[UNVERIFIED]`) into the audit report file under `.lore/audit/`. The naming overlap (`[STALE]` in sync vs `[STALE]` severity in audit) is intentional — both refer to the same concept (entry no longer accurate) but operate in different files with different downstream actions.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# SUMMARY.md template
|
|
2
|
+
|
|
3
|
+
`compress` generates/refreshes `SUMMARY.md` from existing entries. This file holds the schema and worked example.
|
|
4
|
+
|
|
5
|
+
## Skeleton
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
# .lore SUMMARY
|
|
9
|
+
|
|
10
|
+
> Last compressed: <YYYY-MM-DD>
|
|
11
|
+
> Total entries: <N> across <M> scopes
|
|
12
|
+
|
|
13
|
+
## Global (`_global/`)
|
|
14
|
+
|
|
15
|
+
### Architecture
|
|
16
|
+
- <bullet> — [_global/ARCHITECTURE.md#<ID>]
|
|
17
|
+
- ...
|
|
18
|
+
|
|
19
|
+
### Decisions
|
|
20
|
+
- ...
|
|
21
|
+
|
|
22
|
+
### Conventions
|
|
23
|
+
- ...
|
|
24
|
+
|
|
25
|
+
## Scope: <name>
|
|
26
|
+
|
|
27
|
+
### Architecture
|
|
28
|
+
- ...
|
|
29
|
+
|
|
30
|
+
### Decisions
|
|
31
|
+
- ...
|
|
32
|
+
|
|
33
|
+
### Conventions
|
|
34
|
+
- ...
|
|
35
|
+
|
|
36
|
+
## Scope: <name2>
|
|
37
|
+
...
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Selection rule (3–5 entries per scope per layer)
|
|
41
|
+
|
|
42
|
+
For each (scope, layer) tuple, pick entries by this priority:
|
|
43
|
+
|
|
44
|
+
1. Most recent `#verified` date wins
|
|
45
|
+
2. Tiebreaker: most recent `#added` date
|
|
46
|
+
3. Tiebreaker: entries that contain "primary" / "main" / "core" / "use <X>" — these are typically the anchor facts
|
|
47
|
+
|
|
48
|
+
If a (scope, layer) has fewer than 3 entries, include all of them.
|
|
49
|
+
|
|
50
|
+
If a (scope, layer) is empty, omit the subsection entirely.
|
|
51
|
+
|
|
52
|
+
## Worked example
|
|
53
|
+
|
|
54
|
+
```markdown
|
|
55
|
+
# .lore SUMMARY
|
|
56
|
+
|
|
57
|
+
> Last compressed: 2026-07-09
|
|
58
|
+
> Total entries: 247 across 3 scopes
|
|
59
|
+
|
|
60
|
+
## Global (`_global/`)
|
|
61
|
+
|
|
62
|
+
### Architecture
|
|
63
|
+
- Monorepo with pnpm workspaces + Turborepo — [_global/ARCHITECTURE.md#ARCH-2026-01-15-d7a3]
|
|
64
|
+
- Node.js 20 baseline — [_global/ARCHITECTURE.md#ARCH-2026-02-01-9b1c]
|
|
65
|
+
|
|
66
|
+
### Decisions
|
|
67
|
+
- Rejected Nx → chose Turborepo (faster builds, simpler config) — [_global/DECISIONS.md#DEC-2026-02-03-7c19]
|
|
68
|
+
|
|
69
|
+
### Conventions
|
|
70
|
+
- All packages use TypeScript strict mode — [_global/CONVENTIONS.md#CONV-2026-01-20-b1e8]
|
|
71
|
+
|
|
72
|
+
## Scope: frontend
|
|
73
|
+
|
|
74
|
+
### Architecture
|
|
75
|
+
- Next.js 14 App Router — [scopes/frontend/ARCHITECTURE.md#ARCH-2026-03-10-a1b2]
|
|
76
|
+
- TanStack Query for server state — [scopes/frontend/ARCHITECTURE.md#ARCH-2026-03-15-e5f6]
|
|
77
|
+
|
|
78
|
+
### Decisions
|
|
79
|
+
- Zustand over Redux (60% less boilerplate) — [scopes/frontend/DECISIONS.md#DEC-2026-02-03-7c19]
|
|
80
|
+
|
|
81
|
+
### Conventions
|
|
82
|
+
- No default exports — [scopes/frontend/CONVENTIONS.md#CONV-2026-04-12-c3d4]
|
|
83
|
+
|
|
84
|
+
## Scope: backend
|
|
85
|
+
|
|
86
|
+
### Architecture
|
|
87
|
+
- Node.js + Fastify + PostgreSQL — [scopes/backend/ARCHITECTURE.md#ARCH-2026-01-15-e5f6]
|
|
88
|
+
|
|
89
|
+
### Decisions
|
|
90
|
+
- Fastify over Express (3x throughput in our benchmarks) — [scopes/backend/DECISIONS.md#DEC-2026-02-10-a8c9]
|
|
91
|
+
|
|
92
|
+
### Conventions
|
|
93
|
+
- All DB queries go through repository pattern — [scopes/backend/CONVENTIONS.md#CONV-2026-03-01-b1d2]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Idempotency
|
|
97
|
+
|
|
98
|
+
Running `compress` twice without intervening `sync`s produces identical content (modulo the `Last compressed:` date). This is intentional — compress is a pure projection of the underlying entries.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# lore scripts
|
|
2
|
+
|
|
3
|
+
Cross-platform Python 3.6+ helpers that reduce repetitive mechanical work. No third-party dependencies. Called by `init` / `sync` / `audit` / `compress` / `lore mirror`; can also be run standalone for ad-hoc inspection.
|
|
4
|
+
|
|
5
|
+
The script list and quick-reference command examples live in the project root `README.md` "Scripts" section. This file covers the things that don't fit there: design intent, integration points, and limits.
|
|
6
|
+
|
|
7
|
+
## Design notes
|
|
8
|
+
|
|
9
|
+
**Cross-platform first.** Python standard library only. No `bash`, no `jq`, no platform-specific tools. The same invocation works on Windows, Linux, macOS.
|
|
10
|
+
|
|
11
|
+
**JSON-friendly output.** Every script supports `--json` for machine consumption. Agent callers parse the output; humans pipe to `less` or `jq` (if available).
|
|
12
|
+
|
|
13
|
+
**Composition.** `find_duplicates.py` and `find_stale.py` shell out to `list_entries.py --json` rather than re-implementing the parser. One source of truth for entry format — if the format ever changes, only `list_entries.py` needs updating.
|
|
14
|
+
|
|
15
|
+
**Read-only by default.** None of these scripts write to `.lore/`. They observe; the agent decides what to do with findings.
|
|
16
|
+
|
|
17
|
+
**Run from project root.** `list_entries.py` walks up the directory tree looking for `.lore/`. The other scripts depend on it via subprocess, so the same constraint applies transitively.
|
|
18
|
+
|
|
19
|
+
## When each script is called
|
|
20
|
+
|
|
21
|
+
| Script | Call site | Purpose |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `history.py` | lore history | List git commits related to a memory entry / file / scope |
|
|
24
|
+
| `id_hash.py` | Any time a new entry is written (init / sync) | Compute the 4-char content hash for the entry ID |
|
|
25
|
+
| `list_entries.py` | Pre-step of query / audit / compress | Enumerate all entries as JSON for downstream processing |
|
|
26
|
+
| `find_duplicates.py` | sync step 5 (de-duplication) | Identify candidate duplicate entries before writing |
|
|
27
|
+
| `find_stale.py` | audit step 2; compress step 2; lore mirror (optional) | Identify entries past the verified-date threshold or already marked `#stale` |
|
|
28
|
+
|
|
29
|
+
## Output channels
|
|
30
|
+
|
|
31
|
+
**stdout is the data channel; stderr is the warning channel.** All scripts follow this split so `--json` consumers never have to filter noise out of their parsers. Currently `list_entries.py` is the only script that emits a warning:
|
|
32
|
+
|
|
33
|
+
- `[WARN] .lore/.config.json has no schema_version field.` — fires once per invocation when the config file exists but lacks the version field. Add `"schema_version": 1` to silence it.
|
|
34
|
+
- `[WARN] .lore/.config.json#schema_version=N is newer than this lore skill expects (max: 1).` — fires when the config version exceeds what this skill understands. Pull the latest lore from upstream.
|
|
35
|
+
|
|
36
|
+
Both warnings are informational; `list_entries.py` always produces the same stdout regardless of config state. See `references/compatibility.md` for the full schema versioning policy.
|
|
37
|
+
|
|
38
|
+
## Testing
|
|
39
|
+
|
|
40
|
+
Without a real `.lore/`, you can sanity-check that imports and argument parsing work:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
python scripts/id_hash.py "test entry"
|
|
44
|
+
python scripts/list_entries.py # should print "(no entries)" or exit with a clear error
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`list_entries.py`, `find_duplicates.py`, and `find_stale.py` require a populated `.lore/` to produce meaningful output. Set one up via `lore init` first.
|
|
48
|
+
|
|
49
|
+
## Limitations
|
|
50
|
+
|
|
51
|
+
- **Token-overlap dedup, not semantic.** Jaccard similarity catches rewrites with similar words but misses semantic equivalence (e.g. "use TypeScript" vs "TypeScript-only codebase"). Deeper checks still need an LLM pass.
|
|
52
|
+
- **Naive date math.** `find_stale.py` uses wall-clock dates from `#verified` / `#added` tags. If the system's clock is wrong, results will be off.
|
|
53
|
+
- **No automatic archive promotion.** The script reports pending-archive entries but does not move them. Use `lore sync` to actually relocate to `.lore/archive/`.
|
|
54
|
+
- **Hash collisions on identical text are theoretically possible** (4 hex chars = 16 bits = 1 in 65536). In practice a lore project will not hit this. If it does, slightly edit the entry text to bump the hash.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# lore 脚本
|
|
2
|
+
|
|
3
|
+
跨平台 Python 3.6+ 辅助脚本,减少重复的机械工作。无第三方依赖。被 `init` / `sync` / `audit` / `compress` / `lore mirror` 调用,也可独立运行做临时检查。
|
|
4
|
+
|
|
5
|
+
脚本清单和命令速查在仓库根 `README.md` 的"Scripts"章节里。本文件覆盖根 README 不适合放的内容:设计意图、集成点、局限。
|
|
6
|
+
|
|
7
|
+
## 设计要点
|
|
8
|
+
|
|
9
|
+
**优先跨平台。** 仅使用 Python 标准库,不依赖 `bash`、`jq` 或任何平台特定工具。Windows / Linux / macOS 行为完全一致。
|
|
10
|
+
|
|
11
|
+
**JSON 友好输出。** 每个脚本都支持 `--json` 便于机器消费。Agent 调用方解析输出;人类可以直接 `less` 或 `jq`(如果装了)。
|
|
12
|
+
|
|
13
|
+
**组合而非重复。** `find_duplicates.py` 和 `find_stale.py` 通过 `list_entries.py --json` 复用解析器,不重复实现 entry 格式解析。Entry 格式只在一处定义——将来格式变更只需改 `list_entries.py`。
|
|
14
|
+
|
|
15
|
+
**默认只读。** 这些脚本不写 `.lore/`,只观察。Agent 决定如何处理发现的问题。
|
|
16
|
+
|
|
17
|
+
**从项目根目录运行。** `list_entries.py` 向上遍历定位 `.lore/`。其他脚本通过 subprocess 调用它,所以这个约束会传递生效。
|
|
18
|
+
|
|
19
|
+
## 何时调用
|
|
20
|
+
|
|
21
|
+
| 脚本 | 调用点 | 用途 |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `history.py` | lore history | 列出与 memory entry / file / scope 相关的 git commits |
|
|
24
|
+
| `id_hash.py` | 写新 entry 时(init / sync)| 计算 entry ID 的 4 字符内容 hash |
|
|
25
|
+
| `list_entries.py` | query / audit / compress 的预步骤 | 把所有 entry 枚举为 JSON 供后续处理 |
|
|
26
|
+
| `find_duplicates.py` | sync 步骤 5(去重)| 写之前找出可能的重复 entry |
|
|
27
|
+
| `find_stale.py` | audit 步骤 2;compress 步骤 2;lore mirror(可选)| 找出过期 entry 或已标记 `#stale` 的 entry |
|
|
28
|
+
|
|
29
|
+
## 输出通道
|
|
30
|
+
|
|
31
|
+
**stdout 是数据通道;stderr 是警告通道。** 所有脚本遵循这个分离,这样 `--json` 消费者就不必从解析结果里过滤噪音。当前只有 `list_entries.py` 会发警告:
|
|
32
|
+
|
|
33
|
+
- `[WARN] .lore/.config.json has no schema_version field.` —— 配置文件存在但缺 `schema_version` 字段时,每个调用触发一次。加 `"schema_version": 1` 即可消除。
|
|
34
|
+
- `[WARN] .lore/.config.json#schema_version=N is newer than this lore skill expects (max: 1).` —— 配置版本超过本 skill 能理解的范围时触发。从上游 pull 最新 lore。
|
|
35
|
+
|
|
36
|
+
两条警告都是告知性质;`list_entries.py` 不管配置状态如何,stdout 输出始终一致。完整 schema 版本策略见 `references/compatibility.md`。
|
|
37
|
+
|
|
38
|
+
## 测试
|
|
39
|
+
|
|
40
|
+
没有真实 `.lore/` 时,可以快速验证 import 和参数解析是否正常:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
python scripts/id_hash.py "test entry"
|
|
44
|
+
python scripts/list_entries.py # 应输出 "(no entries)" 或清晰报错
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`list_entries.py`、`find_duplicates.py`、`find_stale.py` 需要有内容的 `.lore/` 才能产出有意义的输出。先用 `lore init` 建一个。
|
|
48
|
+
|
|
49
|
+
## 局限
|
|
50
|
+
|
|
51
|
+
- **去重只到词袋重叠程度。** Jaccard 相似度能抓到词汇相似的改写,但抓不到语义等价(如 "use TypeScript" vs "TypeScript-only codebase")。更深的检查仍需 LLM 介入。
|
|
52
|
+
- **日期计算比较朴素。** `find_stale.py` 直接用 `#verified` / `#added` 标签的日期。如果系统时钟不对,结果会偏差。
|
|
53
|
+
- **不自动 archive。** 脚本会报告待 archive 的 entry,但不会移动它们。实际搬迁到 `.lore/archive/` 仍需通过 `lore sync` 完成。
|
|
54
|
+
- **理论上可能有 hash 冲突**(4 个十六进制字符 = 16 位 = 1/65536 概率)。实际项目基本不会遇到。如果遇到了,对 entry 文本做微调以改变 hash。
|