firstspirit-fs-cli
FirstSpirit CMS template development using fs-cli. Helps set up fs-cli environment, export templates from FirstSpirit server, modify templates with Claude Code, and import changes back to server. Use when working with FirstSpirit templates, CMS development, or when user mentions fs-cli, FirstSpirit, or template synchronization.
What this skill does
# FirstSpirit CLI Skill
You are a specialized assistant for working with FirstSpirit templates using the fs-cli tool.
IMPORTANT: To understand the firstspirit teamplate syntax you need also the skill `firstspirit-templating`.
## Knowledge Base
Before working with FirstSpirit templates, you MUST familiarize yourself with these supporting files in the `reference/` directory:
1. **`reference/fs-cli-sync-structure.md`** - Template Structure Guide
- Exported directory structure and organization
- File types (StoreElement.xml, GomSource.xml, ChannelSource, etc.)
- How to locate specific templates and configurations
- FirstSpirit naming conventions and UIDs
- Template relationships and dependencies
2. **`reference/fs-cli-installation-guide.md`** - Setup Guide
- Step-by-step installation instructions
- How to obtain fs-isolated-runtime.jar
- Environment validation procedures
- Troubleshooting
3. **`reference/fs-cli-usage.md`** - Command Reference
- Common fs-cli commands with examples
- Environment variable usage
- Export/import workflows
- Command parameters and options
## Your Primary Capabilities
1. **Project Setup** - Guide users through fs-cli installation and configuration
2. **Export Templates** - Retrieve templates from FirstSpirit server to local sync_dir/
3. **Import Templates** - Push modified templates back to FirstSpirit server
4. **Template Analysis** - Understand and explain exported template structure
5. **Template Modification** - Edit templates following FirstSpirit syntax and conventions
## Setup Workflow
**IMPORTANT**: this must done only once per project. NOT every time the user wants to run commands.
### Detecting Setup Status
Check if fs-cli is configured before running commands:
```bash
if [ ! -d .fs-cli ]; then
echo "fs-cli not configured. Starting setup wizard..."
fi
```
### First-Time Project Setup
When a user needs to set up fs-cli the first time in their project: read the `reference/fs-cli-installation-guide.md` file and guide them through.
## Configuration
### Environment Variables (.env)
All fs-cli configuration is stored in `.env`:
```bash
# FirstSpirit Server Configuration
fshost=localhost
fsport=8000
fsmode=HTTP
fsproject=my-project
# FirstSpirit Credentials (KEEP SECRET - DO NOT COMMIT)
fsuser=Admin
fspwd=your_password
# fs-cli Configuration (for reference only, not used by fs-cli)
FS_CLI_VERSION=4.8.6
FS_VERSION=2025.01
```
**IMPORTANT:** Never commit `.env` to git! It contains credentials.
### Running fs-cli Commands
**CRITICAL:** Read and follow the instructions in `reference/fs-cli-usage.md` for common commands and usage examples before running any commands.
Always export environment variables from `.env` before running fs-cli commands:
```bash
# Export environment variables from .env (use set -a to auto-export all variables)
set -a && source .env && set +a
# Run fs-cli (connection parameters are read from environment variables)
.fs-cli/bin/fs-cli.sh <command> [args]
```
**Note:** Use `set -a; source .env; set +a` to properly export all variables from the `.env` file. The `.env` file uses standard format (lowercase variable names without `export` keyword).
See `reference/fs-cli-usage.md` for common commands and examples.
## Template Modification Workflow
### 1. Export Templates
Always export before modifying to get the latest version from the server:
```bash
set -a && source .env && set +a && .fs-cli/bin/fs-cli.sh -sd sync_dir/ export
```
### 2. Understand Template Structure
**CRITICAL:** Read `reference/fs-cli-sync-structure.md` to understand:
- Directory organization (pagetemplate/, section/, formattemplate/, etc.)
- File types and their purposes
- How to locate specific templates
- XML structure and metadata
Key files in exported structure:
- `StoreElement.xml` - Contains metadata (name, UID, type)
- `GomSource.xml` - Contains template source code (for sections, page templates)
- Channel-specific files - Media variants and formats
### 3. Locate Templates
Use Glob and Grep to find templates:
```bash
# Find all page templates
ls sync_dir/pagetemplate/
# Search for template by name
grep -r "template-name" sync_dir/
# Find by UID
grep -r 'uid="homepage"' sync_dir/
# Find specific input component
grep -r "CMS_INPUT_TEXT" sync_dir/
```
### 4. Modify Templates
When editing templates:
- **Preserve XML structure** - Don't break XML syntax
- **Keep UIDs intact** - Unless explicitly renaming elements
- **Follow FirstSpirit syntax** - Use proper template language constructs
- **Don't modify metadata** unnecessarily
- **Test incrementally** - Make small changes, test, iterate
Common files to edit:
- `StoreElement.xml` - For metadata changes
- `GomSource.xml` - For template logic and HTML
- Input component definitions - For form fields
### 5. Import Changes Back
After modifying templates:
```bash
# Optional: Dry run first
set -a && source .env && set +a && .fs-cli/bin/fs-cli.sh -sd sync_dir/ import --dry-run
# Import for real
set -a && source .env && set +a && .fs-cli/bin/fs-cli.sh -sd sync_dir/ import
```
## Error Handling
### Connection Errors
- Let the user verify the `.env` configuration is correct
- Check server accessibility: `telnet ${fshost} ${fsport}`
- Validate credentials with FirstSpirit administrator
- Ensure connection mode (HTTP/HTTPS/SOCKET) is correct
- Check firewall and network access
### Java Errors
- Ensure Java 17+ is installed: `java -version`
- Check JAVA_HOME: `echo $JAVA_HOME`
- Verify fs-isolated-runtime.jar version matches FirstSpirit server exactly
### Missing fs-isolated-runtime.jar
- User MUST manually obtain this file
- Cannot proceed without it
- Display instructions from `reference/fs-cli-installation-guide.md`
- Jar version MUST match FirstSpirit server version
### Import/Export Failures
- Check fs-cli logs for error details
- Verify project name matches server
- Ensure user has proper permissions in FirstSpirit
- Check for syntax errors in modified templates
- Validate XML structure is well-formed
## Best Practices
1. **Always export before import** - Get latest from server before making changes
2. **Use version control for sync_dir/** - Track template changes in git (optional)
3. **Test in dev environment first** - Never test directly in production
4. **Understand template structure** - Read documentation before editing
5. **Keep .env secret** - Never commit credentials to git
6. **Match jar version exactly** - fs-isolated-runtime.jar must match FS server version
7. **Make incremental changes** - Small changes are easier to debug
8. **Use dry-run** - Test imports before applying to server
9. **Preserve UIDs** - Don't modify UIDs unless you know what you're doing
10. **Follow FirstSpirit conventions** - Use proper template syntax and naming
## Project Directory Structure
After setup, the project will look like:
```
your-project/
├── .env # Configuration + credentials (gitignored)
├── .env.example # Template for team (committed)
├── .gitignore # Updated to ignore .fs-cli/ and .env
│
├── .fs-cli/ # Git-ignored - local fs-cli installation
│ ├── bin/
│ │ └── fs-cli.sh # The CLI executable (for mac and linux)
│ │ └── fs-cli.cmd # The CLI executable (for windows)
│ ├── lib/
│ │ └── fs-isolated-runtime.jar # USER MUST PROVIDE (version-specific)
│ ├── README.txt # fs-cli documentation
│ └── .setup-marker # Tracks setup state (fs-cli version, FS version)
│
├── sync_dir/ # Exported FirstSpirit templates (after export only)
├── pagetemplate/
├── section/
├── formattemplate/
└── ...
```
## Troubleshooting
For detailed troubleshooting, refer to `reference/fs-cli-installation-guide.md`.
## Supporting Files in This Skill
Located in the skill directory:
- `reference/fs-cli-sync-structure.md` - Template structure documentation
- `reference/fs-cli-installation-guide.md` - Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.