🔌 Adapters¶
SpecMem adapters parse specifications from various AI coding agent frameworks.
Supported Frameworks¶
Spec-Driven Development Frameworks (Priority)¶
| Framework | Adapter | File Patterns |
|---|---|---|
| Kiro | kiro |
.kiro/specs/**/*.md |
| OpenSpec | openspec |
openspec/specs/**, openspec/changes/**, openspec/config.yaml |
| SpecKit | speckit |
.speckit/**/*.yaml |
| Tessl | tessl |
.tessl/**/*.md |
Commercial Coding Agents¶
| Framework | Adapter | File Patterns |
|---|---|---|
| AGENTS.md (AAIF) | agents.md |
**/AGENTS.md, **/AGENT.md |
| Claude Code | claude |
CLAUDE.md (root or nested), .claude/CLAUDE.md, CLAUDE.local.md, .claude/rules/**/*.md (legacy: claude_project.xml, .claude/**/*.xml, project.claude) |
| Cursor | cursor |
.cursorrules, cursor.rules, .cursor/rules/*.mdc |
Codex, Factory, Warp, Cursor, OpenCode, Amp, and Aider consume AGENTS.md.
SpecMem indexes those files through the AGENTS.md adapter rather than invented
vendor trees (.codex/**/*.md, .factory/**/*.yaml, .warp/**). Gemini CLI's
GEMINI.md is found by the guidelines scanner, not a separate SpecAdapter.
Spec-Driven Development Frameworks¶
These frameworks prioritize formal specifications and structured development workflows.
Kiro Adapter¶
Parses Kiro's spec-driven development format. Kiro is the recommended framework for teams adopting Spec-Driven Development.
Structure¶
Example¶
# Requirements Document
## Introduction
User authentication system for the application.
## Requirements
### Requirement 1
**User Story:** As a user, I want to log in securely.
#### Acceptance Criteria
1. WHEN a user enters valid credentials THEN the system SHALL authenticate
2. WHEN a user enters invalid credentials THEN the system SHALL reject
Configuration¶
OpenSpec Adapter¶
Parses Fission-AI OpenSpec on-disk layout. This adapter is stable (not experimental): the official directory structure and artifact filenames are documented and clear.
Structure¶
openspec/
├── specs/ # Source of truth (often <domain>/spec.md)
│ └── <domain>/
│ └── spec.md
├── changes/ # Active (and archived) change folders
│ └── <change-name>/
│ ├── proposal.md
│ ├── design.md
│ ├── tasks.md
│ └── specs/ # Delta specs
│ └── <domain>/
│ └── spec.md
└── config.yaml # Optional planning context / rules
Type mapping¶
| Path / filename | SpecType |
|---|---|
specs/**/spec.md, change delta specs/** |
requirement |
design.md |
design |
tasks.md |
task |
proposal.md, other markdown |
knowledge |
config.yaml (context, rules, …) |
knowledge |
Markdown is split on # / ## / ### headings (same approach as AGENTS.md /
Cursor). Blocks are tagged openspec plus path-derived slugs. Files under
changes/archive/ are loaded as legacy. Junk directories and
openspec/schemas/ are skipped.
Parser behavior follows the upstream OpenSpec 1.16.x / 2.x fixes:
- Fenced code blocks (backtick or tilde) are tracked per line, so
#lines inside a fence are not headings and inline triple backticks inside a line do not open a fence. ###Requirement:headers without a space after the hashes are recognized.- Closing hash marks are removed from headings (
## Purpose ##becomesPurpose). - Leading YAML frontmatter in spec and delta files (OpenSpec 2.1.1) is parsed into
key:valuetags (lists become one tag per item, capped) and never copied into block text. A frontmatter block needs a---opener on line 1, a closing---, and a first entry that looks like a mapping key. - Symlinked
spec.mdfiles, symlinked spec directories, and a symlinkedopenspec/directory are loaded, with protection against symlink cycles.
OpenSpec 2.x moved agent commands to .agents/skills. The openspec/specs and
openspec/changes layout is unchanged, and those skills are indexed by the
guidelines scanner.
Configuration¶
SpecKit Adapter¶
Parses SpecKit's YAML-based specifications. SpecKit provides structured, machine-readable specs.
Structure¶
Example¶
# .speckit/features/auth.yaml
feature: user-authentication
version: 1.0.0
requirements:
- id: AUTH-001
title: User Login
description: Users can log in with email and password
priority: critical
acceptance_criteria:
- Valid credentials grant access
- Invalid credentials show error
- Account lockout after 5 failures
- id: AUTH-002
title: Password Reset
description: Users can reset forgotten passwords
priority: high
Configuration¶
Tessl Adapter¶
Parses Tessl's markdown specifications. Tessl focuses on test-driven specifications.
Structure¶
Configuration¶
Commercial Coding Agents¶
These adapters support popular commercial AI coding assistants.
Claude Code Adapter¶
Parses Claude Code's project instruction files. This adapter is stable.
Files¶
Primary (current Claude Code layout):
CLAUDE.mdat the repo root, or nested in subdirectories (taggednested).claude/CLAUDE.mdCLAUDE.local.md(personal instructions, taggedlocal).claude/rules/**/*.md- topic rules. Rules with apaths:frontmatter field (YAML list or comma-separated string) are path-scoped: SpecMem tags thempath-scopedandpaths:<globs>, and prefixes the text withApplies to: <globs>. Rules withoutpathsare taggedalways-apply. The frontmatter itself is never copied into the text.
Legacy (secondary, kept for compatibility):
claude_project.xml,.claude/**/*.xml,project.claude
.claude/skills/*/SKILL.md is not indexed by this adapter. The guidelines
scanner owns Agent Skills, so skills are not duplicated. Junk directories
(node_modules, .venv, build, and similar) are skipped, and symlinked
rules directories are followed.
Claude Code and AGENTS.md¶
Claude Code 2.1.277 and later reads AGENTS.md as project instructions when no
CLAUDE.md, .claude/CLAUDE.md, or CLAUDE.local.md exists in the working
directory or above it. The behavior is configurable in /config under
"Project instructions" (claude-md-or-agents-md is the default,
claude-md-and-agents-md loads both). SpecMem does not model that precedence:
it indexes CLAUDE.md files through this adapter and AGENTS.md through the
AGENTS.md adapter, independently, so both are always searchable.
Example¶
# Project Context
## Overview
E-commerce platform built with Python and FastAPI.
## Architecture
- Backend: FastAPI with SQLAlchemy
- Database: PostgreSQL
- Cache: Redis
- Queue: Celery
## Coding Standards
- Type hints required for all functions
- Docstrings in Google format
- 100% test coverage for business logic
## Security Requirements
- All endpoints require authentication
- Input validation on all user data
- SQL injection prevention via ORM
Configuration¶
Cursor Adapter¶
Parses Cursor rules files. This adapter is experimental.
Files¶
.cursor/rules/*.mdc— current Cursor project rules (YAML frontmatter + markdown).cursorrules— legacy single-file rulescursor.rules— legacy alternate filename
Example .cursor/rules/*.mdc¶
---
description: Frontend component standards
globs: src/components/**/*.tsx,src/**/*.ts
alwaysApply: false
---
# Components
Use the design system.
## Validation
Validate API inputs.
Frontmatter fields mapped onto SpecBlocks (without new SpecIR fields):
alwaysApply: true→ tagalways-applydescription→ tagdescribedand text prefixglobs→ truncatedglobs:...tag and aGlobs:text line
Example .cursorrules¶
# Project Rules
## Code Style
- Use 2-space indentation
- Prefer const over let
- Use async/await over promises
## Architecture
- Follow clean architecture principles
- Keep components under 200 lines
- Extract reusable logic to hooks
Configuration¶
AGENTS.md Adapter¶
Parses the AAIF / Linux Foundation AGENTS.md standard. This is a stable
adapter (not experimental). Codex, Factory, Warp, Cursor, OpenCode, Amp, and
Aider all consume these files.
Files¶
AGENTS.mdorAgents.md— official filename (repo root or nested)AGENT.mdorAgent.md— aliases also accepted by the guidelines scanner
Closest-file-wins: a nested AGENTS.md applies to that subtree.
Example¶
# Project Rules
Keep pull requests focused and scoped to one change.
## Testing
Run unit tests before opening a PR.
## Style
Prefer typed Python.
Heading sections become knowledge SpecBlocks tagged agents / agents.md
plus a slug of the heading. A file with no headings becomes one pinned block.
Configuration¶
There are no first-class Codex, Factory, Warp, or Gemini SpecAdapters. Those
tools are covered by AGENTS.md (and, for Gemini CLI, the guidelines scanner's
GEMINI.md support). Do not invent .codex/, .factory/, or .warp/ trees.
Using Multiple Adapters¶
SpecMem can use multiple adapters simultaneously:
[adapters]
# Spec-Driven Development (recommended)
kiro = true
openspec = true
speckit = true
tessl = true
# Commercial agents
claude = true
cursor = true
When scanning, SpecMem merges specs from all enabled adapters:
🔍 Scanning for specifications...
✅ [kiro] Found 12 specs in .kiro/specs/
✅ [speckit] Found 5 specs in .speckit/
✅ [tessl] Found 3 specs in .tessl/
✅ [claude] Found 1 spec in Claude.md
✅ [cursor] Found 3 specs in cursor.json
📊 Total: 24 specifications indexed
Adapter Priority¶
When specs conflict, priority is determined by:
- Explicit priority in the spec
- Framework order (configurable)
- Timestamp (newer wins)
[adapters]
# Framework priority (first = highest)
# Spec-Driven Development frameworks take precedence
priority = ["kiro", "openspec", "speckit", "tessl", "agents.md", "claude", "cursor"]
Custom Adapters¶
See Writing Adapters for creating custom adapters.