ziniao-department
Original:🇨🇳 Chinese
Translated
Ziniao Department Management: Query, create, modify, delete, and sort departments. Used when users need to view the organizational structure, create/modify/delete departments, or adjust department sorting.
1installs
Sourceziniao-open/skills
Added on
NPX Install
npx skill4agent add ziniao-open/skills ziniao-departmentTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Department Management
CRITICAL — MUST use the Read tool to read before starting, which contains authentication, error handling, and security rules
CRITICAL — Before executing any Shortcuts, be sure to use the Read tool to read their corresponding references/ documentation. Blindly calling commands directly is prohibited.
../ziniao-shared/SKILL.mdCore Scenarios
View Organizational Structure
When users want to understand the company's department structure, use to display the hierarchical relationship:
--treebash
ziniao-cli department list --treeOutput tree structure:
├── 技术部 (id: 15868464646076)
│ ├── 前端组 (id: 15954943062431)
│ └── 后端组 (id: 15954943062432)
└── 市场部 (id: 15868464646077)Create Department
hierarchybash
# Create a sub-department under an existing department (parentId must be an existing department ID, passing 0 is not supported)
ziniao-cli department create --name "华东区" --parent-id 15868464646076⚠cannot be set to 0; it must be an existing parent department ID. To query available parent department IDs, execute--parent-idfirst.department list --tree
Dangerous Operations
Deleting a department is a operation and requires confirmation. Deleting a parent department will cascade delete all sub-departments, and this operation is irreversible. It is recommended to check for sub-departments or employees before deletion:
high-risk-writebash
ziniao-cli department list --tree # Check sub-departments
ziniao-cli staff list --department-id xxx # Check for employees
ziniao-cli department delete --id xxx # Execute deletion (confirmation required)Shortcuts
| Command | Description | Detailed Documentation |
|---|---|---|
| Query department list | |
| Add new department | |
| Modify department | Only send modified fields: |
| Delete department (sub-departments and employee affiliations will be cleared) | |
| Adjust sorting | |
Universal API Coverage
All department interfaces can also be called via the universal api command:
bash
ziniao-cli api /superbrowser/rest/v1/erp/department/list
ziniao-cli api /superbrowser/rest/v1/erp/department/add --data '{"name":"xxx","parentId":"<父部门ID>","hierarchy":"0"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/update --data '{"id":"xxx","name":"新名"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/delete --data '{"id":"xxx"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/order --data '{"parentId":"xxx","order":["id1","id2"]}'