English | 日本語
Thank you for your interest in contributing to the EpisodicRAG plugin!
For AI Agents: See .claude/CLAUDE.md.
Supported Version: EpisodicRAG Plugin (see version.py)
This document explains how to set up the development environment, test code changes, and create pull requests.
- Development Environment Setup
- Installation Methods
- Manual Script Execution
- Creating Pull Requests
- Coding Standards
- Testing
- Development Tools - Footer Checker, Link Checker (v4.1.0+)
- Persistent Path (v5.2.0+)
- Documentation
- Support
- Python 3.x
- Bash (Git Bash / WSL)
- Claude Code environment
There are two ways to test a plugin under development.
Overview: Install local plugins using Claude Code's /plugin install command. This allows testing with the same flow as actual marketplace distribution.
📖 Detailed Structure: ARCHITECTURE.md
plugins-weave/
├── .claude-plugin/ # Marketplace configuration
│ └── marketplace.json
├── … # Other plugins & root docs omitted
└── EpisodicRAG/ # Plugin main body
├── .claude-plugin/ # Plugin config & templates
├── scripts/ # Clean Architecture (4 layers)
│ ├── README.md # Python implementation reference
│ ├── domain/ # Core business logic
│ ├── infrastructure/ # External concerns (I/O)
│ ├── application/ # Use cases
│ ├── interfaces/ # Entry points
│ ├── tools/ # Development tools (v4.1.0+)
│ └── test/
├── docs/ # Documentation
├── skills/ # Skill definitions
└── ...
marketplace.json is already in place (included in the repository).
Execute the following in Claude Code:
# With relative path
/plugin marketplace add ./plugins-weave
# Or with absolute path
/plugin marketplace add C:\path\to\plugins-weave
Success output:
✅ Marketplace 'plugins-weave' added successfully
/plugin install EpisodicRAG@plugins-weave
Success output:
✅ Plugin 'EpisodicRAG' installed successfully
@digest-setup
Configure interactively.
@digest-auto
Expected output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 EpisodicRAG System Status
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
...
After modifying plugin code, retest with:
# 1. Uninstall
/plugin uninstall EpisodicRAG@plugins-weave
# 2. Reinstall
/plugin install EpisodicRAG@plugins-weave
# 3. Setup (if needed)
@digest-setup
# 4. Verify operation
@digest-auto
Benefits:
- Same test environment as actual marketplace distribution flow
- Easy install/uninstall with
/plugin installcommand - Easy version management
Overview: Traditional method of directly manipulating the plugin directory.
Run the @digest-setup skill in Claude Code, or use the Python CLI manually:
cd plugins-weave/EpisodicRAG/scripts
# Check status
python -m interfaces.digest_setup check
# Execute setup (specify JSON config)
python -m interfaces.digest_setup init --config '{"base_dir": ".", "paths": {"loops_dir": "data/Loops", "digests_dir": "data/Digests", "essences_dir": "data/Essences"}}'python -m interfaces.digest_setup checkExample output:
{
"status": "configured",
"config_exists": true,
"directories_exist": true,
"config_file": "~/.claude/plugins/.episodicrag/config.json",
"message": "Setup already completed"
}(If identity_file_path is configured, "Identity File:" line is also displayed)
Benefits:
- Simple (no marketplace registration required)
- Same as existing workflow
Drawbacks:
- May behave differently from marketplace distribution
- Manual install/uninstall
Recommendation: During development, use Pattern A (Local Marketplace) to develop while verifying marketplace distribution behavior.
Plugin internal scripts can also be executed directly (for debugging).
Manages all path information and ensures Plugin self-containment.
cd plugins-weave/EpisodicRAG/scripts
# Display path information
python -m interfaces.config_cli --show-paths
# Output configuration JSON
python -m interfaces.config_cliSkills can be executed directly as Python scripts (for debugging):
cd plugins-weave/EpisodicRAG/scripts
# Equivalent to @digest-setup
python -m interfaces.digest_setup
# Equivalent to @digest-config
python -m interfaces.digest_config
# Equivalent to @digest-auto
python -m interfaces.digest_autoNote: Usage via skills (
@digest-setup, etc.) is still available.
Since v2.0.0, scripts/ adopts Clean Architecture (4-layer structure).
📖 Detailed Specification: Layer structure, dependency rules, and recommended import paths at ARCHITECTURE.md
📖 Architecture Selection Rationale: DESIGN_DECISIONS.md
v4.0.0 Changes: Configuration management (config) is distributed across subdirectories of each layer:
domain/config/- Configuration constants, validation helpersinfrastructure/config/- Configuration file I/O, path resolutionapplication/config/- DigestConfig (Facade), service classes
| Feature to Add | Location |
|---|---|
| Constants, type definitions, exceptions | domain/ |
| Configuration-related constants/validation | domain/config/ |
| File I/O, logging | infrastructure/ |
| Configuration file loading, path resolution | infrastructure/config/ |
| Business logic | application/ |
| Configuration management service (Facade) | application/config/ |
| External entry points | interfaces/ |
- Fork this repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Create a Pull Request
Use clear and concise commit messages:
feat:New featurefix:Bug fixdocs:Documentation updaterefactor:Refactoringtest:Test addition/modification
- Python: PEP 8 compliant
- Bash: Verified with ShellCheck
- Markdown: Clear and concise writing
📖 Test Details: See scripts/README.md for test directory structure and execution methods.
cd plugins-weave/EpisodicRAG/scripts
# Run all tests
python -m pytest test/ -v
# Layer-specific tests
python -m pytest test/domain_tests/ -v
python -m pytest test/config_tests/ -vAfter making changes, always test the following:
- Basic commands (
/digest,@digest-auto,/dream-defrag) - Skills (
@digest-setup,@digest-config) - Agent (
@DigestAnalyzer) - Hierarchical Digest generation flow
When development environment and installed plugin exist on the same machine, note the following:
Problem: Running @digest-setup etc. may create configuration files in the development folder
Verification method:
cd plugins-weave/EpisodicRAG
git status# Expected: "nothing to commit, working tree clean"
Best Practices:
- Always check git status after installation
- Don't commit configuration files to the development folder
- Edit configuration on the installed plugin side
- Installation location:
~/.claude/plugins/EpisodicRAG/
- Installation location:
For details, see TROUBLESHOOTING.md.
EpisodicRAG configuration files and data are stored in the persistent path. This prevents configuration loss during plugin updates.
~/.claude/plugins/.episodicrag/
├── config.json # Configuration file
├── Loops/ # Loop files (configurable in config.json)
├── Digests/ # Digest files (configurable in config.json)
└── Identities/ # Identity files (configurable in config.json)
To change the persistent path during testing:
export EPISODICRAG_CONFIG_DIR=/tmp/test-episodicrag
python -m pytest test/ -v📖 Details: ARCHITECTURE.md
The scripts/tools/ directory contains quality management tools for documentation.
Bandit is used to scan for security vulnerabilities.
cd plugins-weave/EpisodicRAG
# Run security check
make security
# Or run directly
python -m bandit -r scripts/ --exclude scripts/test --severity-level mediumExample output (when no issues):
Run started...
...
Run completed
Total time: 0.5s
No issues identified.
Verifies that each document's footer matches the format defined in _footer.md.
cd plugins-weave/EpisodicRAG/scripts
# Run check
python -m tools.check_footer
# Auto-fix
python -m tools.check_footer --fix
# Show summary only
python -m tools.check_footer --quietExample output:
Checking files in: docs/
OK (3):
docs/README.md
docs/dev/ARCHITECTURE.md
docs/dev/DESIGN_DECISIONS.md
MISSING (1):
docs/user/NEW_FILE.md
MISMATCH (1):
docs/user/OLD_FILE.md
Summary: 3 OK, 1 MISSING, 1 MISMATCH
Validates relative links, anchor links, and composite links within Markdown files.
cd plugins-weave/EpisodicRAG/scripts
# Run validation
python -m tools.link_checker ../docs
# Verbose output
python -m tools.link_checker ../docs --verbose
# JSON output (for CI/CD)
python -m tools.link_checker ../docs --jsonExample output:
Checking: docs/dev/ARCHITECTURE.md
BROKEN LINKS:
Line 42: [config.md](./config.md)
File not found: docs/dev/config.md
Suggestion: Did you mean docs/dev/api/config.md?
Line 85: [#invalid-anchor](#invalid-anchor)
Anchor not found in document
Summary: 2 broken links in 1 file
Features:
- Relative link validation (
./file.md,../file.md) - Anchor link validation (
#section) - Composite link validation (
file.md#section) - Broken link fix suggestions
- JSON output (for CI/CD integration)
Schema validation tool for config.json and config.template.json.
cd plugins-weave/EpisodicRAG/scripts
# Basic validation
python -m tools.validate_json config.json
# Template conformance check
python -m tools.validate_json config.json --template config.template.json
# Path format validation
python -m tools.validate_json config.json --check-pathsFeatures:
- JSON syntax validation
- Structure conformance check against config.template.json
- Path format validation (relative/absolute paths)
Before committing documentation changes, run the following:
cd plugins-weave/EpisodicRAG/scripts
python -m tools.check_footer --quiet
python -m tools.link_checker ../docs --quietEnsure both tools complete without errors.
Update documentation as needed when making code changes:
- README.md - For general users
- CONTRIBUTING.md - This file
- docs/ - Detailed documentation
SSoT (Single Source of Truth) is the principle of not writing the same information in multiple places, but defining a canonical definition location and referencing it. This reduces maintenance burden during changes and prevents inconsistencies.
| Information | SSoT (Canonical Definition Location) | Reference Method |
|---|---|---|
| Terminology/concept definitions | GLOSSARY.md (Glossary) | > 📖 Details: [Glossary](../../GLOSSARY.md#section-name) |
| Footer | _footer.md |
Unified at the end of each document |
| Configuration specification | api/config.md | Reference via link |
Version information's single source of truth is the version field in .claude-plugin/plugin.json.
// .claude-plugin/plugin.json
{
"name": "EpisodicRAG",
"version": "x.y.z", // ← This is SSoT - see plugin.json for actual value
...
}| File | Field | Sync Method |
|---|---|---|
.claude-plugin/plugin.json |
version |
SSoT (origin) |
pyproject.toml |
version |
Manual sync |
../.claude-plugin/marketplace.json |
plugins[].version |
Manual sync |
CHANGELOG.md |
## [x.x.x] |
Manual sync |
README.md / README.en.md |
Version badge | Automatic (dynamic badge reads the SSoT at display time) |
docs/README.md |
Version badge | Automatic (dynamic badge reads the SSoT at display time) |
scripts/domain/version.py |
__version__ |
Automatic (dynamic loading) |
📊 These syncs are verified by tests in
scripts/test/domain_tests/test_version.py.
Dynamic Loading Mechanism:
scripts/domain/version.py dynamically loads the version from plugin.json:
from domain import __version__
print(__version__) # Displays version from plugin.jsonWhen updating version, update 4 files:
.claude-plugin/plugin.json- Updateversionfield (SSoT)pyproject.toml- Updateversionto same value../.claude-plugin/marketplace.json- Updateplugins[0].versionto same valueCHANGELOG.md- Add new section## [x.x.x] - YYYY-MM-DD(mirror it inCHANGELOG.en.md)
The version badges in the READMEs and docs/README.md are dynamic badges (shields.io reads the SSoT at display time), so they need no update.
# Verification (tests verify sync across all files)
cd scripts
python -m pytest test/domain_tests/test_version.py -vSome documents (ARCHITECTURE.md, API_REFERENCE.md, TROUBLESHOOTING.md) have version headers:
> **Supported Version**: EpisodicRAG Plugin ([version.py](scripts/domain/version.py) reference) / File Format 1.0Recommended: Use dynamic reference format ([version.py](...) reference) to avoid manual updates.
The EpisodicRAG plugin uses Japanese as the primary language and provides English versions of major documents.
- Primary Language: Japanese (日本語)
- Secondary Language: English
Translation Policy: Only major documents (README, CHANGELOG, CONTRIBUTING, QUICKSTART, CHEATSHEET) are maintained in English. Other documents remain Japanese-only to reduce translation maintenance costs.
| Japanese | English | Status |
|---|---|---|
README.md |
README.en.md |
✅ Synced |
CHANGELOG.md |
CHANGELOG.en.md |
✅ Synced |
CONTRIBUTING.md |
CONTRIBUTING.en.md |
✅ Synced |
docs/user/QUICKSTART.md |
docs/user/QUICKSTART.en.md |
✅ Synced |
docs/user/CHEATSHEET.md |
docs/user/CHEATSHEET.en.md |
✅ Synced |
When updating Japanese documentation, also sync the corresponding English documentation.
- Edit Japanese version first - Edit the Japanese version first
- Update English version - Update English version in the same PR
- Add sync header - Add header at the top of English file:
<!-- Last synced: YYYY-MM-DD -->
When adding new English translations:
- Copy structure from Japanese version
- Translate content maintaining formatting
- Add sync header with date
- Update this table
If you have questions or issues, please report them via GitHub Issues.
Thank you for your contribution!
EpisodicRAG by Weave | GitHub