Agent skill
captive-note
Write content to a Captive note (Today.md, Week.md, etc.) with validation and backup.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/captive-note
SKILL.md
Write Captive Note
This sub-skill writes content to a Captive note in the vault, with validation to prevent accidental data loss.
Input Arguments
Arguments are passed as key-value pairs:
path: Full path to the note (e.g.,{{VAULT}}/00_Brain/Captive/Today.md)content: Markdown content to write
Instructions
1. Validate Path
Verify the path is within the Captive directory:
$VAULT/00_Brain/Captive/
If path is outside Captive, return error:
Error: Path must be within Captive directory. Got: {path}
2. Check Existing Content
If the file already exists:
- Read current content
- If content is non-empty and different from new content:
- Create a backup at
{filename}.backup.mdin the same directory - Log: "Backed up existing content to {backup_path}"
- Create a backup at
3. Write Content
Write the new content to the specified path.
4. Verify Write
Read back the file to confirm write succeeded.
Output
Return structured JSON:
{
"success": true,
"path": "/Users/.../00_Brain/Captive/Today.md",
"backup_created": true,
"backup_path": "/Users/.../00_Brain/Captive/Today.backup.md",
"bytes_written": 2048
}
Or on error:
{
"success": false,
"error": "Description of what went wrong",
"path": "/Users/.../00_Brain/Captive/Today.md"
}
Error Cases
| Condition | Error Message |
|---|---|
| Path outside Captive | "Path must be within Captive directory" |
| Vault not found | "Vault directory does not exist: {vault}" |
| Write failed | "Failed to write file: {system_error}" |
| Verification failed | "Write verification failed: content mismatch" |
Safety
- Always validate path is within Captive before writing
- Always backup existing non-empty content before overwriting
- Never write to Periodic or Semantic directories (use archive sub-skills for those)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?