chore(skills): docs + ruff format for skill-management-console
Tests / Test passed: 855

Documents Skill Management in CLOUD_DEPLOYMENT.md (cloud-skill store,
per-host entitlement, incremental sync, local authoring/override,
inventory report, skills:admin scope) and applies ruff check/format to
all touched modules. All tasks complete; full non-integration suite
green (593 passed) and openspec validate --strict passes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 08:10:20 +08:00
co-authored by Claude Opus 4.6
parent fd0ea3a066
commit f8054cb58c
9 changed files with 83 additions and 53 deletions
+6 -14
View File
@@ -8,6 +8,7 @@ synced store's read-only-except-sync contract is preserved: this module never
writes to ``tasks/skills.sqlite3`` and :mod:`storage.skill_catalog` never
writes here.
"""
from __future__ import annotations
import json
@@ -75,9 +76,7 @@ class LocalSkillStore:
).fetchall()
return [_row_to_metadata(row) for row in rows]
def get_local(
self, skill_id: str
) -> KnowledgeSkill | FlowTemplateSkill | None:
def get_local(self, skill_id: str) -> KnowledgeSkill | FlowTemplateSkill | None:
with self._connect() as conn:
row = conn.execute(
"SELECT * FROM local_skills WHERE id = ?",
@@ -109,9 +108,7 @@ class LocalSkillStore:
def delete_local(self, skill_id: str) -> bool:
with self._connect() as conn:
cur = conn.execute(
"DELETE FROM local_skills WHERE id = ?", (skill_id,)
)
cur = conn.execute("DELETE FROM local_skills WHERE id = ?", (skill_id,))
return cur.rowcount > 0
# ------------------------------------------------------------------
@@ -138,9 +135,7 @@ class LocalSkillStore:
def list_override_cloud_ids(self) -> set[str]:
with self._connect() as conn:
rows = conn.execute(
"SELECT cloud_skill_id FROM overrides"
).fetchall()
rows = conn.execute("SELECT cloud_skill_id FROM overrides").fetchall()
return {row["cloud_skill_id"] for row in rows}
def list_overrides(self) -> list[KnowledgeSkill | FlowTemplateSkill]:
@@ -321,8 +316,7 @@ class LocalSkillStore:
"""
)
conn.execute(
"CREATE INDEX IF NOT EXISTS idx_local_skills_name "
"ON local_skills(name)"
"CREATE INDEX IF NOT EXISTS idx_local_skills_name ON local_skills(name)"
)
def _connect(self) -> sqlite3.Connection:
@@ -378,9 +372,7 @@ def _with_metadata(
return FlowTemplateSkill(
metadata=new_meta,
steps=list(skill.steps),
parameters={
name: dict(schema) for name, schema in skill.parameters.items()
},
parameters={name: dict(schema) for name, schema in skill.parameters.items()},
)