用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill agent-reconciliation命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
基于 SOC 职业分类
正在显示 SKILL.md
| name | agent-reconciliation |
| description | > Use when this capability is needed. |
This skill enables systematic reconciliation between the filesystem agent definitions (AGENTS.md files under docs-paperclip/companies/*/agents/) and the database tables that power the Paperclip control plane (agents, agent_models, agent_api_keys).
When doing a complete sync of all agents from filesystem to database:
Run fresh_reconciliation.py
python3 fresh_reconciliation.py
This will:
fresh_reconciliation.sql (DELETE + INSERT statements)fresh_reconciliation_summary.jsonReview Generated SQL
fresh_reconciliation.sqlExecute Against Database (with user approval)
# Apply the SQL (this DELETES all existing agents first!)
psql $DATABASE_URL -f fresh_reconciliation.sql
Post-Execution Verification
Before generating ANY SQL, you MUST validate the schema:
Run CHECK-column-existence.sql template from docs-paperclip/schema/templates/
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = 'agents'
ORDER BY ordinal_position;
Verify template compatibility - Compare results against expected columns in template header comments
CRITICAL: The agents table has TWO name fields:
name = human-readable name (e.g., "SEO Strategist", "DB Specialist")title = agent identifier/slug (e.g., "contentforge-ai-SEOStrategist")DO NOT confuse name with slug - slug does NOT exist in the schema!
CORRECT MAPPING:
-- ✅ CORRECT:
INSERT INTO agents (name, title, ...) VALUES ('SEO Strategist', 'contentforge-ai-SEOStrategist', ...);
-- ❌ WRONG - name should be human-readable, not the slug:
INSERT INTO agents (name, title, ...) VALUES ('contentforge-ai-SEOStrategist', 'SEO Strategist', ...);
docs-paperclip/companies/{company}/agents/**/AGENTS.mdname, slug, reportsTo, team, skillscompanies table → map name to idagents table → all rows with id, name, title, company_id, role, reports_to, statusagent_models table → active model assignments by agent_id (TEXT type)agent_api_keys table → API keys by agent_id (UUID type)name ↔ nametitle ≥23 characters or invalid characters{company-slug}-{AgentName}ALWAYS use templates from docs-paperclip/schema/templates/ as the source of truth.
| Issue Type | Template to Use |
|---|---|
| Missing agent | REGISTER-agent.sql |
| Fix agent title (human name) | UPDATE-agent-title.sql |
| Add API key | ADD-agent-api-keys.sql |
| Delete agent | DELETE-agent.sql |
| Validate before modify | VALIDATE-agent-exists.sql |
IMPORTANT: For agent title/human name fixes, use title NOT slug:
-- ✅ CORRECT:
UPDATE agents SET title = 'Procurement' WHERE name = 'domainforge-ai-domainforge-ai-procurement';
-- ❌ WRONG - 'slug' column does NOT exist:
UPDATE agents SET slug = 'Procurement' WHERE ...
paperclipforge-ai-database-druidpaperclipforge-ai-atlas-agent-creatorpaperclipforge-ai-model-assignment-specialistreconciliation_fixes.sqlreconciliation_report.jsonAll SQL generation MUST use templates from:
docs-paperclip/schema/templates/
Template files:
README.md - Template registry documentationCHECK-column-existence.sql - Schema validation (run FIRST)VALIDATE-agent-exists.sql - Pre-modification validationREGISTER-agent.sql - Create new agentsUPDATE-agent-title.sql - Fix human names (title field)DELETE-agent.sql - Safe deletion with FK cascadeADD-agent-api-keys.sql - Add API keysThe authoritative schema is in packages/db/src/schema/*.ts. Templates are validated against this source.
If template columns don't match actual schema, run CHECK-column-existence.sql and update template accordingly.
human_name in AGENTS.md YAML frontmattera-z, A-Z, 0-9, spaces, hyphens, underscoresdocs-paperclip/companies/shared/AGENT-NAMING-STANDARD.md{company-slug}-{HumanNameWithoutSpaces}devforge-ai-Nexus, measureforge-ai-CadOrchestratorhuman_name with spaces removedAGENTS.mdWhen user asks to "align folder names with human names" or "rename agent folders":
docs-paperclip/companies/*/agents/**/AGENTS.mdhuman_name from YAML frontmatterFor each agent:
{company-slug}-{human_name_without_spaces}mv "old-folder-name" "expected-folder-name"
After folder rename, update any register-agent.sql files to reference new folder path.
When user asks to "standardize human names" or "fix agent human names":
human_name values| Parameter | Type | Required | Description |
|---|---|---|---|
companies_dir | string | No | Path to companies directory (default: docs-paperclip/companies) |
output_sql_path | string | No | Path for SQL output (default: reconciliation_fixes.sql) |
output_json_path | string | No | Path for JSON report (default: reconciliation_report.json) |
dry_run | boolean | No | If true, only report without generating SQL |
COMPANIES:
- In filesystem: 16
- In database: 16
AGENTS:
- In filesystem: 496
- In database: 548
- Missing in database: 344
- Extra in database: 402
- Without API keys: 84
- Without models: 159
VALIDATION ISSUES:
- Invalid names: 70
- Naming convention issues: 0
{
"companies_in_filesystem": [...],
"companies_in_database": [...],
"missing_companies": [...],
"missing_agents": [{"name": "...", "slug": "...", "company": "..."}],
"extra_agents_in_database": [{"id": "...", "name": "..."}],
"agents_without_api_keys": [{"id": "...", "name": "..."
...
IMPORTANT: All errors MUST be logged to activity_log for LearningForge AI error pattern monitoring.
When any of these errors occur, log to activity_log with proper error categorization:
-- Log SQL validation errors
INSERT INTO activity_log (
id, company_id, actor_type, actor_id, action, entity_type, entity_id, details, created_at
) VALUES (
gen_random_uuid(),
(SELECT id FROM companies WHERE name = 'PaperclipForge AI'),
'agent',
'paperclipforge-ai-agent-reconciler',
'error',
'agent',
NULL,
'{
"error_type": "sql_validation",
"error_message": "Column slug does not exist in agents table",
"context": "reconciliation SQL generation",
"remediation": "Use title field instead of slug"
}'::jsonb,
NOW()
);
| Error Type | details->>'error_type' | Threshold |
|---|---|---|
| Column name mismatch | sql_column_mismatch | 3+ |
| FK constraint violation | fk_violation | 2+ |
| Naming violation | naming_violation | 5+ |
| Template bypass | workflow_bypass | 2+ |
The learningforge-ai-error-pattern-monitor agent monitors activity_log for these error patterns and creates alerts when thresholds are exceeded.
Skill Name: agent-reconciliation Version: 1.0 Owner: paperclipforge-ai-agent-reconciler Created: 2026-04-24
Source: Construct-AI-primary/z-docs-paperclip — distributed by TomeVault.