OpenSpec-Daem0n Bridge
Overview
This skill creates a bidirectional bridge between:
- OpenSpec: Spec-driven development with formal change proposals
- Daem0n-MCP: AI memory system with semantic search and outcome tracking
The feedback loop:
OpenSpec specs ──────► Daem0n patterns/rules
▲ │
│ ▼
Future specs ◄────── Past outcomes/failures
Auto-Detection
On session start, after get_briefing():
Check if openspec/ directory exists in the project root:
ls openspec/specs/ 2>/dev/null
If OpenSpec detected AND specs not yet imported:
- Announce: "OpenSpec detected. Syncing specs to Daem0n memory..."
- Execute Workflow 1 (Import) automatically
- Report summary of imported specs and rules
How to check if already imported:
recall(topic="openspec", tags=["spec"], limit=1)
If results exist with recent timestamps, skip import.
Workflow 1: Import Specs to Memory
Triggers:
- Auto: OpenSpec directory detected on first session
- Manual: "sync specs to memory", "import openspec", "refresh openspec"
Steps
List all spec directories
ls openspec/specs/
For each spec, read the spec.md file
cat openspec/specs/[name]/spec.md
Parse requirements using these patterns:
| Pattern |
Extract As |
MUST, SHALL, REQUIRED |
rule.must_do |
MUST NOT, SHALL NOT, PROHIBITED |
rule.must_not |
SHOULD, RECOMMENDED |
pattern |
SHOULD NOT, NOT RECOMMENDED |
warning |
## Purpose section |
pattern (overview) |
Create memories via remember_batch
mcp__daem0nmcp__remember_batch(memories=[
{
"category": "pattern",
"content": "[spec-name]: [overview/purpose summary]",
"rationale": "OpenSpec specification - source of truth",
"tags": ["openspec", "spec", "[spec-name]"],
"file_path": "openspec/specs/[spec-name]/spec.md",
"context": {
"openspec_type": "spec",
"imported_at": "[ISO timestamp]"
}
}
// ... one per spec
])
Create rules from MUST/MUST NOT
mcp__daem0nmcp__add_rule(
trigger="implementing [spec-name] feature",
must_do=["[extracted MUST items]"],
must_not=["[extracted MUST NOT items]"],
ask_first=["Does this align with the spec?"]
)
Report summary
Imported [N] specs as patterns
Created [M] rules with [X] must_do and [Y] must_not constraints
Use recall("openspec") to query
Memory Mapping Reference
| OpenSpec Element |
Daem0n Category |
Tags |
| spec.md overview |
pattern |
openspec, spec, [name] |
| MUST requirements |
rule.must_do |
(in rule, not memory) |
| MUST NOT constraints |
rule.must_not |
(in rule, not memory) |
| Known limitations |
warning |
openspec, limitation, [name] |
| Design rationale |
learning |
openspec, rationale, [name] |
Workflow 2: Inform Proposal Creation
Triggers:
- "prepare proposal for [feature]"
- "check before proposing [feature]"
- "what do I need to know before proposing [feature]"
Steps
Recall relevant memories
mcp__daem0nmcp__recall(
topic="[feature description]",
categories=["pattern", "warning", "decision"]
)
Check applicable rules
mcp__daem0nmcp__check_rules(
action="proposing change for [feature]"
)
Recall OpenSpec-specific context
mcp__daem0nmcp__recall(
topic="openspec [feature]",
tags=["openspec"]
)
If specific files are affected, check them
mcp__daem0nmcp__recall_for_file(
file_path="openspec/specs/[affected-spec]/spec.md"
)
Present findings to user in this format:
# Memory Context for Proposal: [feature]
## Relevant Specs
- [spec-name]: [summary]
## Patterns to Follow
- [pattern 1]
- [pattern 2]
## Warnings to Consider
- [warning 1] (from past failure)
## Past Decisions That May Apply
- [decision] - worked: [true/false]
## Rules to Follow
When implementing this:
- MUST: [list]
- MUST NOT: [list]
- ASK FIRST: [list]
If user proceeds, record the intent
mcp__daem0nmcp__remember(
category="decision",
content="Creating OpenSpec proposal for [feature]: [brief description]",
rationale="[user's stated rationale]",
tags=["openspec", "proposal", "pending"],
context={
"openspec_type": "proposal",
"feature": "[feature]",
"change_id": "[generated-id or TBD]"
}
)
SAVE THE MEMORY ID - needed for Workflow 3.
Workflow 3: Archive to Learnings
Triggers:
- After
openspec archive [id] completes
- "record outcome for [change-id]"
- "convert archived change [id] to learnings"
Steps
Read the archived change
cat openspec/changes/archive/[id]/proposal.md
cat openspec/changes/archive/[id]/tasks.md
ls openspec/changes/archive/[id]/specs/
Find the original decision memory
mcp__daem0nmcp__search_memories(
query="OpenSpec proposal [id]"
)
Or search by feature name if ID wasn't recorded.
Record the outcome
mcp__daem0nmcp__record_outcome(
memory_id=[found decision id],
outcome="Completed and archived. [summary of what was implemented]",
worked=true // or false if there were issues
)
Create learnings from the completed work
mcp__daem0nmcp__remember_batch(memories=[
{
"category": "learning",
"content": "[change-id]: [key lesson from implementation]",
"rationale": "Extracted from completed OpenSpec change",
"tags": ["openspec", "completed", "[feature-name]"],
"context": {
"openspec_type": "archived_change",
"change_id": "[id]",
"archived_at": "[timestamp]"
}
}
// ... one learning per significant insight
])
Link the memories to create causal chain
mcp__daem0nmcp__link_memories(
source_id=[proposal decision id],
target_id=[learning id],
relationship="led_to",
description="Proposal implementation led to these learnings"
)
If spec deltas were applied, update spec memories
For each delta in openspec/changes/archive/[id]/specs/:
- ADDED requirements: Create new pattern memories
- MODIFIED requirements: Update or supersede existing
- REMOVED requirements: Create warning memories noting removal
Tags Convention
| Tag |
Meaning |
When Used |
openspec |
Memory from OpenSpec integration |
All OpenSpec memories |
spec |
From spec.md source of truth |
Workflow 1 |
proposal |
From change proposal |
Workflow 2 |
pending |
Proposal not yet archived |
Workflow 2 |
completed |
From archived change |
Workflow 3 |
limitation |
Known constraint |
Workflow 1 |
rationale |
Design reasoning |
Workflow 1 |
Integration with Sacred Covenant
This skill respects the Daem0n's Sacred Covenant:
- COMMUNE -
get_briefing() must be called first (auto-detection happens after)
- SEEK COUNSEL - Workflow 2 IS the counsel-seeking step for proposals
- INSCRIBE -
remember() records proposal decisions
- SEAL -
record_outcome() closes the loop when changes are archived
Enforcement:
- Workflow 1 (Import) requires communion (get_briefing called)
- Workflow 2 (Inform) calls context_check internally
- Workflow 3 (Archive) requires the original decision memory to exist
Parsing OpenSpec Spec Files
Spec Format Reference
# [Spec Title]
## Purpose
[Description - extract as pattern overview]
## Requirements
### Requirement: [Name]
[Text containing MUST/MUST NOT/SHOULD]
#### Scenario: [Description]
- **GIVEN** [condition]
- **WHEN** [action]
- **THEN** [result]
Extraction Regex Patterns
MUST requirements: /(?:MUST|SHALL|REQUIRED):\s*(.+)/gi
MUST NOT constraints: /(?:MUST NOT|SHALL NOT|PROHIBITED):\s*(.+)/gi
SHOULD patterns: /(?:SHOULD|RECOMMENDED):\s*(.+)/gi
SHOULD NOT warnings: /(?:SHOULD NOT|NOT RECOMMENDED):\s*(.+)/gi
Spec Delta Format
## ADDED
### Requirement: [New requirement]
## MODIFIED
### Requirement: [Changed requirement]
## REMOVED
- Requirement: [Removed name]
## RENAMED
FROM: ### Requirement: OldName
TO: ### Requirement: NewName
Example Session
[Session starts]
User: Let's work on the authentication feature
Claude: [Calls get_briefing()]
[Detects openspec/ directory]
OpenSpec detected. Syncing specs to Daem0n memory...
Imported 5 specs as patterns:
- authentication (3 MUST, 2 MUST NOT)
- api-endpoints (5 MUST, 1 MUST NOT)
- error-handling (2 MUST)
- ...
Created 5 rules for spec enforcement.
User: I want to propose adding OAuth support
Claude: [Workflow 2: Inform]
Querying memory before proposal...
# Memory Context for Proposal: OAuth support
## Relevant Specs
- authentication: "All auth must be stateless for scaling"
## Warnings
- Previous session-based auth was rejected (worked=false)
## Rules
MUST: Use JWT tokens, Support token refresh
MUST NOT: Store sessions server-side
Shall I proceed with recording this proposal intent?
User: Yes, proceed
Claude: [Records decision with openspec/proposal/pending tags]
Recorded. Memory ID: 1847
Now create your proposal at openspec/changes/add-oauth-support/
[Later, after implementation]
User: I've archived the OAuth change, record it
Claude: [Workflow 3: Archive]
Reading openspec/changes/archive/add-oauth-support/...
Recording outcome for decision #1847...
- Outcome: Completed successfully with OAuth2 + PKCE
- Worked: true
Created 2 learnings:
- OAuth2 PKCE flow works well for SPAs
- Token refresh needs 5-minute buffer
Linked proposal -> learnings via "led_to"
The Daem0n will remember this for future auth work.
Troubleshooting
"No OpenSpec specs found"
Check that openspec/specs/ directory exists and contains spec directories.
"Already imported" but specs are stale
Use "refresh openspec" to force re-import. Old memories will be superseded.
"Can't find proposal decision"
Search with broader terms:
mcp__daem0nmcp__search_memories(query="[feature keywords]", tags=["openspec"])
Rules not matching
Check rule triggers match your action descriptions:
mcp__daem0nmcp__list_rules()
Source: 9thLevelSoftware/Daem0n-MCP — distributed by TomeVault.
1---2name: openspec-daem0n-bridge3description: Bridges OpenSpec (spec-driven development) with Daem0n-MCP memory - auto-imports specs, informs proposals with past outcomes, converts archived changes to learnings Use when this capability is needed.4---56# OpenSpec-Daem0n Bridge78## Overview910This skill creates a bidirectional bridge between:11- **OpenSpec**: Spec-driven development with formal change proposals12- **Daem0n-MCP**: AI memory system with semantic search and outcome tracking1314**The feedback loop:**15```16OpenSpec specs ──────► Daem0n patterns/rules17 ▲ │18 │ ▼19 Future specs ◄────── Past outcomes/failures20```2122## Auto-Detection2324**On session start, after `get_briefing()`:**2526Check if `openspec/` directory exists in the project root:2728```bash29ls openspec/specs/ 2>/dev/null30```3132**If OpenSpec detected AND specs not yet imported:**331. Announce: "OpenSpec detected. Syncing specs to Daem0n memory..."342. Execute Workflow 1 (Import) automatically353. Report summary of imported specs and rules3637**How to check if already imported:**38```39recall(topic="openspec", tags=["spec"], limit=1)40```41If results exist with recent timestamps, skip import.4243## Workflow 1: Import Specs to Memory4445**Triggers:**46- Auto: OpenSpec directory detected on first session47- Manual: "sync specs to memory", "import openspec", "refresh openspec"4849### Steps50511. **List all spec directories**52 ```bash53 ls openspec/specs/54 ```55562. **For each spec, read the spec.md file**57 ```bash58 cat openspec/specs/[name]/spec.md59 ```60613. **Parse requirements using these patterns:**6263 | Pattern | Extract As |64 |---------|------------|65 | `MUST`, `SHALL`, `REQUIRED` | rule.must_do |66 | `MUST NOT`, `SHALL NOT`, `PROHIBITED` | rule.must_not |67 | `SHOULD`, `RECOMMENDED` | pattern |68 | `SHOULD NOT`, `NOT RECOMMENDED` | warning |69 | `## Purpose` section | pattern (overview) |70714. **Create memories via remember_batch**72 ```73 mcp__daem0nmcp__remember_batch(memories=[74 {75 "category": "pattern",76 "content": "[spec-name]: [overview/purpose summary]",77 "rationale": "OpenSpec specification - source of truth",78 "tags": ["openspec", "spec", "[spec-name]"],79 "file_path": "openspec/specs/[spec-name]/spec.md",80 "context": {81 "openspec_type": "spec",82 "imported_at": "[ISO timestamp]"83 }84 }85 // ... one per spec86 ])87 ```88895. **Create rules from MUST/MUST NOT**90 ```91 mcp__daem0nmcp__add_rule(92 trigger="implementing [spec-name] feature",93 must_do=["[extracted MUST items]"],94 must_not=["[extracted MUST NOT items]"],95 ask_first=["Does this align with the spec?"]96 )97 ```98996. **Report summary**100 ```101 Imported [N] specs as patterns102 Created [M] rules with [X] must_do and [Y] must_not constraints103 Use recall("openspec") to query104 ```105106### Memory Mapping Reference107108| OpenSpec Element | Daem0n Category | Tags |109|-----------------|-----------------|------|110| spec.md overview | pattern | openspec, spec, [name] |111| MUST requirements | rule.must_do | (in rule, not memory) |112| MUST NOT constraints | rule.must_not | (in rule, not memory) |113| Known limitations | warning | openspec, limitation, [name] |114| Design rationale | learning | openspec, rationale, [name] |115116## Workflow 2: Inform Proposal Creation117118**Triggers:**119- "prepare proposal for [feature]"120- "check before proposing [feature]"121- "what do I need to know before proposing [feature]"122123### Steps1241251. **Recall relevant memories**126 ```127 mcp__daem0nmcp__recall(128 topic="[feature description]",129 categories=["pattern", "warning", "decision"]130 )131 ```1321332. **Check applicable rules**134 ```135 mcp__daem0nmcp__check_rules(136 action="proposing change for [feature]"137 )138 ```1391403. **Recall OpenSpec-specific context**141 ```142 mcp__daem0nmcp__recall(143 topic="openspec [feature]",144 tags=["openspec"]145 )146 ```1471484. **If specific files are affected, check them**149 ```150 mcp__daem0nmcp__recall_for_file(151 file_path="openspec/specs/[affected-spec]/spec.md"152 )153 ```1541555. **Present findings to user in this format:**156 ```markdown157 # Memory Context for Proposal: [feature]158159 ## Relevant Specs160 - [spec-name]: [summary]161162 ## Patterns to Follow163 - [pattern 1]164 - [pattern 2]165166 ## Warnings to Consider167 - [warning 1] (from past failure)168169 ## Past Decisions That May Apply170 - [decision] - worked: [true/false]171172 ## Rules to Follow173 When implementing this:174 - MUST: [list]175 - MUST NOT: [list]176 - ASK FIRST: [list]177 ```1781796. **If user proceeds, record the intent**180 ```181 mcp__daem0nmcp__remember(182 category="decision",183 content="Creating OpenSpec proposal for [feature]: [brief description]",184 rationale="[user's stated rationale]",185 tags=["openspec", "proposal", "pending"],186 context={187 "openspec_type": "proposal",188 "feature": "[feature]",189 "change_id": "[generated-id or TBD]"190 }191 )192 ```193 **SAVE THE MEMORY ID** - needed for Workflow 3.194195## Workflow 3: Archive to Learnings196197**Triggers:**198- After `openspec archive [id]` completes199- "record outcome for [change-id]"200- "convert archived change [id] to learnings"201202### Steps2032041. **Read the archived change**205 ```bash206 cat openspec/changes/archive/[id]/proposal.md207 cat openspec/changes/archive/[id]/tasks.md208 ls openspec/changes/archive/[id]/specs/209 ```2102112. **Find the original decision memory**212 ```213 mcp__daem0nmcp__search_memories(214 query="OpenSpec proposal [id]"215 )216 ```217 Or search by feature name if ID wasn't recorded.2182193. **Record the outcome**220 ```221 mcp__daem0nmcp__record_outcome(222 memory_id=[found decision id],223 outcome="Completed and archived. [summary of what was implemented]",224 worked=true // or false if there were issues225 )226 ```2272284. **Create learnings from the completed work**229 ```230 mcp__daem0nmcp__remember_batch(memories=[231 {232 "category": "learning",233 "content": "[change-id]: [key lesson from implementation]",234 "rationale": "Extracted from completed OpenSpec change",235 "tags": ["openspec", "completed", "[feature-name]"],236 "context": {237 "openspec_type": "archived_change",238 "change_id": "[id]",239 "archived_at": "[timestamp]"240 }241 }242 // ... one learning per significant insight243 ])244 ```2452465. **Link the memories to create causal chain**247 ```248 mcp__daem0nmcp__link_memories(249 source_id=[proposal decision id],250 target_id=[learning id],251 relationship="led_to",252 description="Proposal implementation led to these learnings"253 )254 ```2552566. **If spec deltas were applied, update spec memories**257258 For each delta in `openspec/changes/archive/[id]/specs/`:259 - ADDED requirements: Create new pattern memories260 - MODIFIED requirements: Update or supersede existing261 - REMOVED requirements: Create warning memories noting removal262263## Tags Convention264265| Tag | Meaning | When Used |266|-----|---------|-----------|267| `openspec` | Memory from OpenSpec integration | All OpenSpec memories |268| `spec` | From spec.md source of truth | Workflow 1 |269| `proposal` | From change proposal | Workflow 2 |270| `pending` | Proposal not yet archived | Workflow 2 |271| `completed` | From archived change | Workflow 3 |272| `limitation` | Known constraint | Workflow 1 |273| `rationale` | Design reasoning | Workflow 1 |274275## Integration with Sacred Covenant276277This skill respects the Daem0n's Sacred Covenant:2782791. **COMMUNE** - `get_briefing()` must be called first (auto-detection happens after)2802. **SEEK COUNSEL** - Workflow 2 IS the counsel-seeking step for proposals2813. **INSCRIBE** - `remember()` records proposal decisions2824. **SEAL** - `record_outcome()` closes the loop when changes are archived283284**Enforcement:**285- Workflow 1 (Import) requires communion (get_briefing called)286- Workflow 2 (Inform) calls context_check internally287- Workflow 3 (Archive) requires the original decision memory to exist288289## Parsing OpenSpec Spec Files290291### Spec Format Reference292293```markdown294# [Spec Title]295296## Purpose297[Description - extract as pattern overview]298299## Requirements300301### Requirement: [Name]302[Text containing MUST/MUST NOT/SHOULD]303304#### Scenario: [Description]305- **GIVEN** [condition]306- **WHEN** [action]307- **THEN** [result]308```309310### Extraction Regex Patterns311312```313MUST requirements: /(?:MUST|SHALL|REQUIRED):\s*(.+)/gi314MUST NOT constraints: /(?:MUST NOT|SHALL NOT|PROHIBITED):\s*(.+)/gi315SHOULD patterns: /(?:SHOULD|RECOMMENDED):\s*(.+)/gi316SHOULD NOT warnings: /(?:SHOULD NOT|NOT RECOMMENDED):\s*(.+)/gi317```318319### Spec Delta Format320321```markdown322## ADDED323### Requirement: [New requirement]324325## MODIFIED326### Requirement: [Changed requirement]327328## REMOVED329- Requirement: [Removed name]330331## RENAMED332FROM: ### Requirement: OldName333TO: ### Requirement: NewName334```335336## Example Session337338```339[Session starts]340User: Let's work on the authentication feature341342Claude: [Calls get_briefing()]343 [Detects openspec/ directory]344345 OpenSpec detected. Syncing specs to Daem0n memory...346347 Imported 5 specs as patterns:348 - authentication (3 MUST, 2 MUST NOT)349 - api-endpoints (5 MUST, 1 MUST NOT)350 - error-handling (2 MUST)351 - ...352353 Created 5 rules for spec enforcement.354355User: I want to propose adding OAuth support356357Claude: [Workflow 2: Inform]358 Querying memory before proposal...359360 # Memory Context for Proposal: OAuth support361362 ## Relevant Specs363 - authentication: "All auth must be stateless for scaling"364365 ## Warnings366 - Previous session-based auth was rejected (worked=false)367368 ## Rules369 MUST: Use JWT tokens, Support token refresh370 MUST NOT: Store sessions server-side371372 Shall I proceed with recording this proposal intent?373374User: Yes, proceed375376Claude: [Records decision with openspec/proposal/pending tags]377 Recorded. Memory ID: 1847378379 Now create your proposal at openspec/changes/add-oauth-support/380381[Later, after implementation]382383User: I've archived the OAuth change, record it384385Claude: [Workflow 3: Archive]386 Reading openspec/changes/archive/add-oauth-support/...387388 Recording outcome for decision #1847...389 - Outcome: Completed successfully with OAuth2 + PKCE390 - Worked: true391392 Created 2 learnings:393 - OAuth2 PKCE flow works well for SPAs394 - Token refresh needs 5-minute buffer395396 Linked proposal -> learnings via "led_to"397398 The Daem0n will remember this for future auth work.399```400401## Troubleshooting402403### "No OpenSpec specs found"404Check that `openspec/specs/` directory exists and contains spec directories.405406### "Already imported" but specs are stale407Use "refresh openspec" to force re-import. Old memories will be superseded.408409### "Can't find proposal decision"410Search with broader terms:411```412mcp__daem0nmcp__search_memories(query="[feature keywords]", tags=["openspec"])413```414415### Rules not matching416Check rule triggers match your action descriptions:417```418mcp__daem0nmcp__list_rules()419```420421---422> Source: [9thLevelSoftware/Daem0n-MCP](https://github.com/9thLevelSoftware/Daem0n-MCP) — distributed by [TomeVault](https://tomevault.io).423<!-- tomevault:4.0:skill_md:2026-07-01 -->