AI-native feature documentation and engineering memory system that enables coding agents (like Claude Code, Cursor IDE) to recreate features using a replay protocol. Provides searchable knowledge base for features and integrates into a Dockerized environment.
- Feature Management: CRUD operations with semantic versioning
- Replay Engine: Generate replay protocols to recreate features from documentation
- Knowledge Extraction: Parse code for API routes, DB migrations, imports
- Git Integration: Automatic commits for every feature file change
- Search: Text search across features and file contents
- Agent CLI: Command-line interface for interacting with SchemaWiki
- Docker and Docker Compose
- Python 3.11+ (for local development)
cd docker
docker-compose up -dThe API will be available at http://localhost:8080
# Install dependencies
pip install -r requirements.txt
# Set up environment
cp .env.example .env
# Edit .env with your database URL
# Run the API
uvicorn api.server:app --reload| Endpoint | Method | Description |
|---|---|---|
/features |
POST | Create a new feature |
/features/{name} |
GET | Get feature details |
/features |
GET | List all features |
/features/{name} |
PATCH | Update feature metadata |
/features/{name} |
DELETE | Delete a feature |
/features/{name}/files |
PUT | Update a feature file |
/features/{name}/replay |
GET | Get replay protocol |
/features/{name}/version/bump |
POST | Bump feature version |
/search |
GET | Search features |
/hooks |
POST | Record development events |
# Record a new feature
schemawiki record-feature "feature-name" -d "Description" -t "tag1,tag2"
# Get feature plan
schemawiki get-plan "feature-name"
# Search features
schemawiki search "query" --tags "tag1"
# Recreate feature (get replay protocol)
schemawiki recreate "feature-name"
# List all features
schemawiki list-features
# Update a feature file
schemawiki update-file "feature-name" plan.md "@/path/to/file.md"Each feature is stored in /data/features/{feature_name}/ with:
feature_name/
├── plan.md # Feature plan/specification
├── implementation.md # Implementation details
├── agent_steps.yaml # Step-by-step agent instructions
├── replay_protocol.json # Generated replay protocol
├── architecture.md # Architecture documentation
├── api_contracts.yaml # API contract definitions
├── tests.md # Test coverage information
└── debug_logs/ # Debug logs from failed attempts
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection URL | postgresql+asyncpg://schemawiki:schemawiki@localhost:5433/schemawiki |
FEATURES_DATA_PATH |
Path for feature files | /data/features |
API_HOST |
API host | 0.0.0.0 |
API_PORT |
API port | 8080 |
pytest# Format code
black .
# Sort imports
isort .- FastAPI: REST API server
- PostgreSQL: Metadata storage
- SQLAlchemy: ORM with async support
- GitPython: Git operations
- sentence-transformers: Semantic search (Phase 4)
The MCP server records AI agent activities during software development, capturing the why behind every step.
cd docker
docker-compose up -dpython mcp_server.pyThe server provides these tools for Claude Code:
| Tool | Description |
|---|---|
create_feature |
Create a new feature with name, description, version, tags |
record_step |
Record an implementation step with reasoning and trigger |
record_event |
Record events (lint_error, test_failed, bug_fix, etc.) |
update_implementation |
Update implementation documentation |
add_debug_log |
Log errors with root cause analysis |
get_feature |
Get full feature details |
generate_wiki |
Generate markdown/HTML wiki page |
list_features |
List all recorded features |
search_features |
Search features by query |
Every step and event captures:
why: The reasoning behind the actiontrigger: What initiated this (user_request, error, test_failure, lint_error, missing_code, bug_fix)context: Additional background informationfiles_modified: Which files were changed
Use these event types with record_event:
| Event | Description |
|---|---|
feature_coded |
Feature implementation completed |
service_restarted |
Service was restarted |
change_pushed |
Code pushed to repository |
missing_code |
Discovered missing functionality |
lint_error |
Linting error occurred |
test_passed |
Tests passed |
test_failed |
Tests failed |
bug_fix |
Bug was fixed |
code_review |
Code review performed |
refactor |
Code was refactored |
dependency_added |
New dependency added |
config_changed |
Configuration changed |
api_contract_change |
API contract modified |
db_migration |
Database migration applied |
- Create a feature:
create_feature(
name="user-auth",
description="JWT authentication system",
version="1.0.0",
why="Users need secure authentication"
)- Record implementation steps:
record_step(
feature_name="user-auth",
step="Create User model",
why="Need to store user credentials securely",
trigger="user_request",
command="python -m flask db create",
files_modified=["models/user.py", "schemas/user.yaml"]
)- Record events:
record_event(
feature_name="user-auth",
event_type="lint_error",
why="Discovered unused import in user model",
details="Removed unused 'os' import",
files=["models/user.py"]
)- Add debug logs:
add_debug_log(
feature_name="user-auth",
attempt=2,
error="JWT token expired immediately",
why_failed="Token expiry not set in config",
fix_applied="Added 'expire_minutes': 60 to config"
)- Generate wiki:
generate_wiki(
feature_name="user-auth",
format="markdown" # or "html"
)The generated wiki includes:
- Why the feature exists - Business justification
- Plan and implementation - Technical details
- Development events - Key milestones with reasoning
- Implementation steps - Each step with why/trigger
- Debug logs - Root cause analysis from failures
This gives future developers complete context on why decisions were made.
You can use the CLI to record activities and generate wikis without Claude Code:
# Install
pip install requests pyyaml
# Set API URL
export SCHEMAWIKI_URL=http://localhost:8081
# Create a feature
python cli.py create "user-auth" -w "Users need secure authentication" -d "JWT authentication"
# Record a step
python cli.py step -f user-auth "Create User model" -w "Need user table" -t user_request -c "sqlacodegen" --files models.py
# Record an event
python cli.py event -f user-auth lint_error -w "Code style violation" --files auth.py
# Generate wiki
python cli.py wiki user-auth -o user-auth.md
# Push to GitHub
python cli.py wiki user-auth --pushThe MCP server can automatically generate and push wikis when you record events. Set GITHUB_REPO and GITHUB_TOKEN env vars, then recording these events will auto-generate the wiki:
feature_coded- Feature implementation completechange_pushed- Code pushed to repositoryservice_restarted- Service restarted
# Auto-generates wiki when event is recorded
record_event(
feature_name="user-auth",
event_type="change_pushed",
why="Completed authentication feature",
auto_wiki=True # Triggers wiki generation
)Or just set GITHUB_REPO env var - it will auto-push on those events.
The MCP server also exposes REST endpoints on port 8081:
| Endpoint | Method | Description |
|---|---|---|
/features |
POST | Create feature |
/steps |
POST | Record step |
/events |
POST | Record event |
/features/{name} |
GET | Get feature |
/wiki/{name} |
GET | Generate wiki (saves to disk) |
/wikis |
GET | List all saved wikis |
/wikis/{name} |
GET | Get saved wiki content |
/wikis/{name}/download |
GET | Download wiki file |
Wikis are saved to /data/wikis/ (or WIKI_DATA_PATH env var). Humans can access them via:
-
REST API (http://localhost:8081):
# List all wikis curl http://localhost:8081/wikis # Get wiki content curl http://localhost:8081/wikis/user-auth # Download as file curl http://localhost:8081/wikis/user-auth/download -o user-auth.md
-
Direct File Access (Docker):
# Mounted volume location docker volume ls | grep wikis docker run --rm -it -v schemawiki_wikis_data:/data/wikis alpine cat /data/wikis/user-auth.md
-
Browser (if serving static files):
- Markdown: View raw file at
/wikis/{name} - HTML: Generate with
format=htmlparameter
- Markdown: View raw file at
The wiki path is returned in the response and stored in the feature's wiki_path field.
You can automatically push generated wikis to a GitHub repository:
-
Set environment variables:
GITHUB_REPO=owner/repo # e.g., vkolyvas/SchemaWiki GITHUB_TOKEN=ghp_xxx # GitHub personal access token WIKI_BRANCH=main # Branch to push to (default: main)
-
Generate wiki with push:
generate_wiki( feature_name="user-auth", format="markdown", push_to_github=True )
Or set env vars and it will auto-push:
export GITHUB_REPO=vkolyvas/SchemaWiki export GITHUB_TOKEN=ghp_xxx # Now any generate_wiki call will push to GitHub
-
Wiki files are saved in the repo under
SchemaWiki/{feature-name}.md -
The GitHub URL is stored in
feature["github_wiki_url"]
GitHub Token Setup:
- Go to GitHub Settings > Developer settings > Personal access tokens
- Generate new token (Fine-grained)
- Permissions: Contents: Read/Write
Accessing GitHub Wikis:
- View online:
https://github.com/{owner}/{repo}/blob/{branch}/SchemaWiki/{feature-name}.md - Raw:
https://raw.githubusercontent.com/{owner}/{repo}/{branch}/SchemaWiki/{feature-name}.md
Run .github/workflows/wiki.yml to generate wikis automatically:
-
On Demand - Go to Actions > Wiki Generator > Run workflow
-
On Schedule - Runs hourly by default (edit cron in workflow)
-
After Push - Triggers when files in
SchemaWiki/folder change
Setup:
- Add
SCHEMAWIKI_URLto repository variables - Add
GITHUB_REPOandGITHUB_TOKEN(auto-available) to generate wikis
# Example - trigger manually
workflow_dispatch:
inputs:
feature:
description: 'Feature name'
push_to_github:
default: trueAdd to your Claude Code settings:
{
"mcpServers": {
"schemawiki": {
"command": "python",
"args": ["/path/to/SchemaWiki/mcp_server.py"]
}
}
}MIT