writing-to-logseq

Expert in writing data to Logseq DB graphs via HTTP API. Auto-invokes when users want to create pages, add blocks, update content, set properties, or sync conversation notes to their Logseq graph. Provides CRUD operations with safety guidelines.

242 stars

Best use case

writing-to-logseq is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Expert in writing data to Logseq DB graphs via HTTP API. Auto-invokes when users want to create pages, add blocks, update content, set properties, or sync conversation notes to their Logseq graph. Provides CRUD operations with safety guidelines.

Expert in writing data to Logseq DB graphs via HTTP API. Auto-invokes when users want to create pages, add blocks, update content, set properties, or sync conversation notes to their Logseq graph. Provides CRUD operations with safety guidelines.

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "writing-to-logseq" skill to help with this workflow task. Context: Expert in writing data to Logseq DB graphs via HTTP API. Auto-invokes when users want to create pages, add blocks, update content, set properties, or sync conversation notes to their Logseq graph. Provides CRUD operations with safety guidelines.

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/writing-to-logseq/SKILL.md --create-dirs "https://raw.githubusercontent.com/aiskillstore/marketplace/main/skills/c0ntr0lledcha0s/writing-to-logseq/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/writing-to-logseq/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How writing-to-logseq Compares

Feature / Agentwriting-to-logseqStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Expert in writing data to Logseq DB graphs via HTTP API. Auto-invokes when users want to create pages, add blocks, update content, set properties, or sync conversation notes to their Logseq graph. Provides CRUD operations with safety guidelines.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Writing to Logseq

## When to Use This Skill

This skill auto-invokes when:
- User wants to create new pages or blocks in Logseq
- Updating existing content in the graph
- Setting or modifying properties on entities
- Adding tags/classes to blocks
- Syncing conversation notes to Logseq
- User mentions "add to logseq", "create page", "update block"

**Write Operations**: See `{baseDir}/scripts/write-operations.py` for the API.

## Available Operations

| Operation | Description |
|-----------|-------------|
| `create_page(title, content)` | Create new page |
| `create_block(parent, content)` | Add block under parent |
| `update_block(uuid, content)` | Modify block content |
| `delete_block(uuid)` | Remove block |
| `set_property(uuid, key, value)` | Set property value |
| `add_tag(uuid, tag)` | Add tag/class to block |
| `append_to_page(title, content)` | Add content to existing page |

## Quick Examples

### Create a Page

```python
from write_operations import LogseqWriter

writer = LogseqWriter()

# Create simple page
page = writer.create_page("Meeting Notes 2024-01-15")

# Create page with initial content
page = writer.create_page(
    "Project Alpha",
    content="Project overview and tasks",
    properties={"status": "Active", "priority": "High"}
)
```

### Add Blocks

```python
# Add block to a page
block = writer.create_block(
    parent="page-uuid-or-title",
    content="New task item"
)

# Add nested block
child = writer.create_block(
    parent=block["uuid"],
    content="Sub-task details"
)
```

### Update Content

```python
# Update block content
writer.update_block(
    uuid="block-uuid",
    content="Updated content here"
)

# Append to existing page
writer.append_to_page(
    title="Daily Notes",
    content="- New item added via API"
)
```

### Set Properties

```python
# Set single property
writer.set_property(
    uuid="block-uuid",
    key="status",
    value="Complete"
)

# Set typed property
writer.set_property(
    uuid="block-uuid",
    key="rating",
    value=5,
    type="number"
)

# Set multiple properties
writer.set_properties(
    uuid="block-uuid",
    properties={
        "author": "John Doe",
        "rating": 5,
        "published": "2024-01-15"
    }
)
```

### Add Tags

```python
# Add tag to block
writer.add_tag(uuid="block-uuid", tag="Book")

# Add multiple tags
writer.add_tags(uuid="block-uuid", tags=["Important", "Review"])
```

## HTTP API Methods

### Create Page

```json
{
  "method": "logseq.Editor.createPage",
  "args": ["PageTitle", {"property": "value"}, {"createFirstBlock": true}]
}
```

### Insert Block

```json
{
  "method": "logseq.Editor.insertBlock",
  "args": ["parent-uuid", "Block content", {"sibling": false}]
}
```

### Update Block

```json
{
  "method": "logseq.Editor.updateBlock",
  "args": ["block-uuid", "New content"]
}
```

### Set Property

```json
{
  "method": "logseq.Editor.upsertBlockProperty",
  "args": ["block-uuid", "property-name", "value"]
}
```

### Delete Block

```json
{
  "method": "logseq.Editor.removeBlock",
  "args": ["block-uuid"]
}
```

## Safety Guidelines

### Best Practices

1. **Verify before delete** - Always confirm block exists before removal
2. **Use unique titles** - Avoid creating duplicate pages
3. **Validate properties** - Ensure property types match schema
4. **Handle errors** - Catch and handle API failures gracefully

### Common Pitfalls

- **Duplicate pages**: Check if page exists before creating
- **Invalid UUIDs**: Verify UUID format before operations
- **Property types**: Number properties need numeric values
- **Rate limiting**: Don't spam API with rapid requests

## Content Formatting

### Markdown Support

```python
# Logseq supports markdown in blocks
writer.create_block(
    parent=page_uuid,
    content="""
## Section Header

- Bullet point
- Another point
  - Nested item

**Bold** and *italic* work too.

[[Link to Page]] and #tags
"""
)
```

### Property Syntax

```python
# Properties can be set in content
writer.create_block(
    parent=page_uuid,
    content="""
- Task item
  status:: In Progress
  priority:: High
  due:: [[2024-01-20]]
"""
)

# Or via API (preferred for typed values)
writer.set_property(uuid, "rating", 5)  # number
writer.set_property(uuid, "done", True)  # checkbox
```

## Sync Conversation to Logseq

### Pattern for Saving Notes

```python
def sync_conversation_to_logseq(title, notes):
    """Sync conversation notes to Logseq page."""
    writer = LogseqWriter()

    # Create or get page
    page = writer.get_or_create_page(f"Claude Notes/{title}")

    # Add timestamp header
    from datetime import datetime
    timestamp = datetime.now().strftime("%Y-%m-%d %H:%M")

    writer.append_to_page(
        title=f"Claude Notes/{title}",
        content=f"""
## {timestamp}

{notes}

---
"""
    )

    return page
```

## Error Handling

```python
try:
    page = writer.create_page("My Page")
except writer.ConnectionError:
    print("Cannot connect to Logseq")
except writer.DuplicateError:
    print("Page already exists")
except writer.ValidationError as e:
    print(f"Invalid data: {e}")
```

## Reference Materials

- See `{baseDir}/references/write-operations.md` for all operations
- See `{baseDir}/references/safety-guidelines.md` for safety practices
- See `{baseDir}/templates/page-template.md` for page templates

Related Skills

user-guide-writing

242
from aiskillstore/marketplace

Write clear and helpful user guides and tutorials for end users. Use when creating onboarding docs, how-to guides, or FAQ pages. Handles user-focused documentation, screenshots, step-by-step instructions.

technical-writing

242
from aiskillstore/marketplace

Write clear, comprehensive technical documentation. Use when creating specs, architecture docs, runbooks, or API documentation. Handles technical specifications, system design docs, operational guides, and developer documentation with industry best practices.

postmortem-writing

242
from aiskillstore/marketplace

Write effective blameless postmortems with root cause analysis, timelines, and action items. Use when conducting incident reviews, writing postmortem documents, or improving incident response processes.

plan-writing

242
from aiskillstore/marketplace

Structured task planning with clear breakdowns, dependencies, and verification criteria. Use when implementing features, refactoring, or any multi-step work.

technical-blog-writing

242
from aiskillstore/marketplace

Technical blog post writing with structure, code examples, and developer audience conventions. Covers post types, code formatting, explanation depth, and developer-specific engagement patterns. Use for: engineering blogs, dev tutorials, technical writing, developer content, documentation posts. Triggers: technical blog, dev blog, engineering blog, technical writing, developer tutorial, tech post, code tutorial, programming blog, developer content, technical article, engineering post, coding tutorial, technical content

writing-page-layout

242
from aiskillstore/marketplace

Use this skill when you need to write code for a page layout in the Next.js

writing-lib-functions

242
from aiskillstore/marketplace

Use this skill when you need to write lib functions in `srs/lib` for the Next.js app

writing-data

242
from aiskillstore/marketplace

Use this skill when you need to structure data in `srs/data` for the Next.js app

writing-config-files

242
from aiskillstore/marketplace

Use this skill when you need to write configuration files in `src/config` for the Next.js app

report-writing

242
from aiskillstore/marketplace

작업 완료 후 상세 리포트 문서를 작성. 변경 이력, 영향도 분석, 검증 결과를 문서화할 때 사용. 파일명 규칙 YYYY-MM-DD-<제목>-report.md

testing-test-writing

242
from aiskillstore/marketplace

Write focused tests for core user flows and critical paths using Pest framework, with minimal tests during development and strategic coverage at completion points. Use this skill when creating or editing test files in tests/Feature/ or tests/Unit/ directories, when writing Pest tests with descriptive names, when testing critical user workflows and business logic, when mocking external dependencies, when implementing fast unit tests, when testing behavior rather than implementation details, or when deciding what needs test coverage at feature completion.

scientific-writing

242
from aiskillstore/marketplace

Core skill for the deep research and writing tool. Write scientific manuscripts in full paragraphs (never bullet points). Use two-stage process: (1) create section outlines with key points using research-lookup, (2) convert to flowing prose. IMRAD structure, citations (APA/AMA/Vancouver), figures/tables, reporting guidelines (CONSORT/STROBE/PRISMA), for research papers and journal submissions.