From cai
Use when creating or updating a spec document. Triggers: 'cai-add-spec', 'spec 생성', 'spec 추가', 'spec 업데이트', 'add spec', 'update spec'
How this skill is triggered — by the user, by Claude, or both
Slash command
/cai:cai-add-specThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Creates a new spec or updates an existing spec document, then validates it against source code via the verification agent.
Creates a new spec or updates an existing spec document, then validates it against source code via the verification agent.
Identify the target file(s) or module to document. Resolve to a spec path using convention-based mapping:
context/specs/{module}/_overview.mdcontext/specs/{module}/{component}.mdIf the target, scope, or intent is ambiguous (e.g., the user said "add a spec for auth" but the auth area spans multiple modules, or it is unclear which behaviors should be documented), invoke the cai:cai-interview skill before proceeding. Pass:
Skip the interview when the target is unambiguous.
Does a spec already exist for this target?
├── YES → Update Mode (Step 3a)
└── NO → Create Mode (Step 3b)
spec-writer agent with update instructions:
last_syncedmodule or component)_overview.md)spec-writer agent with creation instructions:
Invoke the verification-agent to cross-validate the new or updated spec against source code.
Verification passed?
├── YES → Step 5
└── NO → Present issues to user. Options:
├── Fix and re-verify
└── Accept with noted discrepancies (mark confidence: draft)
last_synced to today's date (ISO 8601: YYYY-MM-DD)verifiedrevieweddraft_overview.md lists this component in components fieldAgent: spec-writer — Reads source code and writes spec documents
Task("Create a new {level}-level spec for {target_path}. Source files: {file_list}. Write to: {spec_path}. Follow frontmatter schema from interface contract.", agent="agents/spec-writer.md")Task("Update spec at {spec_path}. Current spec: {spec_content}. Changes since last sync: {change_summary}. Update only changed sections.", agent="agents/spec-writer.md")Agent: verification-agent — Validates spec claims against source code
Task("Verify spec at {spec_path} against source code. Check all claims for accuracy.", agent="agents/verification-agent.md")| Artifact | Path | Format |
|---|---|---|
| New/updated spec | context/specs/{module}/_overview.md or context/specs/{module}/{component}.md | Markdown with YAML frontmatter (Interface Contract 0.1) |
Frontmatter example (new spec):
---
type: spec
level: module
tags: [auth, security]
last_synced: 2026-04-06
covers: [src/auth/]
confidence: draft
components: [login, refresh, oauth]
exports: [authenticate, refreshToken]
depends_on: [context/specs/database/_overview.md]
---
| Error | Action |
|---|---|
| spec-writer produces empty or malformed output | Retry once. If still fails, report error and ask user to provide manual input. |
| verification-agent finds critical inaccuracies | Do NOT finalize. Present the inaccuracy report. Ask user to choose: fix or accept as draft. |
| Target module cannot be determined | Ask user to specify the module/component path explicitly. |
| Parent overview does not exist (component spec) | Create a minimal parent _overview.md first, then proceed. |
npx claudepluginhub workingdanny911/cai --plugin caiProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.