Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
26ed5f4
feat: integrate full lens framework with business-only memory filtering
Oct 3, 2025
8eab78d
fix: flatten lens metadata for Pinecone compatibility
Oct 3, 2025
2d949e9
docs: comprehensive research zone README with Pinecone integration guide
Oct 3, 2025
8920c43
feat: improve spec generator with time estimates and tech stack details
Oct 3, 2025
ea9850f
docs: comprehensive session summary for lens framework integration
Oct 3, 2025
ac25fb1
feat: add @visionary agent for business strategy synthesis
Oct 3, 2025
6513e03
docs: comprehensive agent architecture with @visionary synthesis agent
Oct 3, 2025
b9ffa67
docs(auto): daily note 2025-10-04; ensure cross-links
Oct 3, 2025
add6660
feat: add @governor, @marketing, @finance agents with workflow-first …
Oct 4, 2025
bcbc7f0
docs: update agent architecture table in CLAUDE.md
Oct 4, 2025
12680c4
docs: create comprehensive agent command registry
Oct 4, 2025
088f0fb
feat: enhance @governor with workflow-first orchestration patterns
Oct 4, 2025
b985fb0
feat: complete Phase 2 - enhance @seo and @visionary with workflow-first
Oct 4, 2025
c4240bb
docs: Phase 1-2 completion summary
Oct 4, 2025
8e087e3
test: add agent enhancement validation suite
Oct 4, 2025
9d515d9
test: add comprehensive agent workflow testing harness
Oct 4, 2025
c1ef62d
docs: add pre-merge checklist and validation
Oct 4, 2025
0dbc049
docs: final merge preparation summary
Oct 4, 2025
6375ba3
docs: session impact report - 14 tasks completed in one day
Oct 4, 2025
cc06bcd
docs(auto): daily note 2025-10-05; ensure cross-links
Oct 5, 2025
a267334
docs(auto): daily note 2025-10-06; ensure cross-links
Oct 5, 2025
cae601b
docs(auto): weekly note 2025-W41; ensure cross-links
Oct 5, 2025
dcda5b2
docs: MCP integration strategy + Supabase migration plan
Oct 6, 2025
c4baba2
feat(mcp): Raw JSON-RPC client bypasses SDK bug - Ref.tools + Apify w…
Oct 6, 2025
7f0df13
docs(auto): daily note 2025-10-07; ensure cross-links
Oct 6, 2025
079f5b7
feat(agents): add @legal agent for legal analysis and contract review
Oct 7, 2025
b8c6b7b
docs(auto): daily note 2025-10-08; ensure cross-links
Oct 7, 2025
0c3e8a5
feat(agents): add @content agent for technical writing and documentation
Oct 7, 2025
babf4e2
docs(kilocode): update workflow with test timing guidance
Oct 8, 2025
506c94b
feat(agents): add @operations agent for business operations and proce…
Oct 8, 2025
8563811
feat(agents): add @strategy agent for business strategy and market pl…
Oct 8, 2025
70d28e2
docs(agents): comprehensive agent factory session summary
Oct 8, 2025
b6446a7
feat(memory): add Supabase infrastructure to replace Pinecone
Oct 8, 2025
7c72434
feat(mcp): Add Supabase MCP integration for vector memory storage
Oct 8, 2025
4964e85
feat(memory): Add Supabase memory adapter with pgvector support
Oct 8, 2025
c844c69
docs(auto): daily note 2025-10-09; ensure cross-links
Oct 8, 2025
c035398
feat(landing): Add Soulfield Connectors landing page
Oct 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .kilocode/rules/# Soulfield OS - Workspace Rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Soulfield OS - Workspace Rules

**CRITICAL:** These rules apply to ALL work in the Soulfield project.

---

## MANDATORY: 6-Lens Framework Integration

**Every agent MUST integrate with the 6-lens framework. Non-negotiable.**

### Required Pattern:

```javascript
const LensOrchestrator = require('../../lenses/LensOrchestrator.js');
const lensOrchestrator = new LensOrchestrator();

async function handleRequest(prompt, context = {}) {
try {
const response = "Agent response...";

// MANDATORY: Apply lens validation
const lensResult = await lensOrchestrator.applyAll(response, {
agent: 'agentId',
query: prompt,
domain: 'agent domain'
});

return {
response: response,
lensResult: lensResult,
quality_score: lensResult.overall.quality_score
};
} catch (error) {
throw new Error(`Agent error: ${error.message}`);
}
}

module.exports = { handleRequest };
```

---

## File Structure

- Agent handlers: `backend/agents/handlers/{agentId}.cjs`
- Agent config: `backend/data/agents.json`
- Tests: `backend/tests/{agentId}.test.cjs`

---

## Testing Requirements

- ✅ 20+ test cases per agent
- ✅ All tests must pass (20/20)
- ✅ Quality score >0.90
- ✅ All 6 lenses must pass

---

## Reference Files

- `backend/agents/handlers/legal.cjs` - Complete agent with 6-lens integration
- `backend/agents/handlers/seo.cjs` - Example agent with MCP
- `backend/data/agents.json` - System prompt patterns
- `backend/tests/legal.test.cjs` - Comprehensive test structure

## CRITICAL: Pinecone Metadata Constraints

**Pinecone metadata MUST use primitives only** (string, number, boolean, or array of strings)

❌ **WRONG** - Do NOT pass objects:
```javascript
metadata: {
context: context, // ❌ Object not allowed
config: { foo: 'bar' } // ❌ Nested object not allowed
}
```

✅ **CORRECT** - Extract and convert to primitives:
```javascript
metadata: {
jurisdiction: String(context.jurisdiction || 'general'), // ✅
document_type: String(context.document_type || 'general'), // ✅
quality_score: lensResult.aggregated.metrics.overall_quality_score, // ✅ number
timestamp: new Date().toISOString(), // ✅ string
domain: 'agent-domain' // ✅ string
}
```

---

## High-Risk Zones 🔴

DO NOT MODIFY without user permission:
- `backend/jobs.js` (lines 679-711)
- `backend/council.js` (lines 275-342)
- `backend/services/memory/memory-pinecone.cjs`

---

## Do Not Commit Until

- [ ] All tests passing (20/20 minimum)
- [ ] Lens validation working (6/6 lenses)
- [ ] Quality score >0.90
- [ ] Clean git commit message

**Never commit with failing tests. Never skip lens integration.**
125 changes: 125 additions & 0 deletions .kilocode/workflows/# Soulfield Agent Creation Workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Soulfield Agent Creation Workflow

Standardized workflow for creating new Soulfield agents with 6-lens framework.

**Invoke with:** `/workflow create-agent` or just say "Create @agentId agent"

---

## Steps

### 1. Create Handler File

**Location:** `backend/agents/handlers/{agentId}.cjs`

**Template:**
```javascript
const LensOrchestrator = require('../../lenses/LensOrchestrator.js');
const lensOrchestrator = new LensOrchestrator();

async function handleRequest(prompt, context = {}) {
try {
// TODO: Implement agent logic
const response = `Response from @{agentId}`;

// MANDATORY: Apply lens validation
const lensResult = await lensOrchestrator.applyAll(response, {
agent: '{agentId}',
query: prompt,
domain: '{domain}'
});

return {
response: response,
lensResult: lensResult,
quality_score: lensResult.overall.quality_score
};
} catch (error) {
throw new Error(`Agent error: ${error.message}`);
}
}

module.exports = { handleRequest };
```

---

### 2. Add to Agent Config

**File:** `backend/data/agents.json`

Add new entry with:
- `id`: "{agentId}"
- `name`: "{Agent Name}"
- `alias`: "@{agentId}"
- `systemPrompt`: Include all 6 lens instructions

---

### 3. Create Test Suite

**Location:** `backend/tests/{agentId}.test.cjs`

Minimum 20 test cases:
- 3 basic queries
- 7 lens validation tests
- 5 edge cases
- 3 error handling tests
- 2 quality metric tests

---

### 4. Run Tests

**IMPORTANT**: Full test suites take 30-60 seconds because they make real API calls.

**Option A - Quick Validation** (Recommended for initial check):
```bash
node backend/tests/{agentId}-quick.test.cjs
```

**Option B - Full Test Suite**:
```bash
timeout 90 node backend/tests/{agentId}.test.cjs
```

**What to expect:**
- Tests call actual Anthropic API (takes time)
- Some tests may timeout after 60-90 seconds
- Quick test validates structure, exports, and error handling in <10 seconds

**Success criteria:**
- ✅ Quick test passes (structure valid)
- ✅ Handler exports run() and handleRequest()
- ✅ Quality score present in output
- ✅ No critical errors

You do NOT need to wait for all 20+ tests to complete. Quick validation is sufficient.

---

### 5. Commit

```bash
git add backend/agents/handlers/{agentId}.cjs
git add backend/data/agents.json
git add backend/tests/{agentId}.test.cjs
git commit -m "feat(agents): add @{agentId} agent for {domain}"
```

---

## Success Checklist

- [ ] Handler created with LensOrchestrator
- [ ] Entry in agents.json
- [ ] 20+ tests created
- [ ] All tests passing (20/20)
- [ ] Quality score >0.90
- [ ] Git commit created

---

## Reference

Copy pattern from: `backend/agents/handlers/seo.cjs`
Loading
Loading