Commit ce918cf
committed
feat(skill): deepen compile pipeline + design-consistency cleanup
Two rounds of review fixes on top of the skill factory.
Design consistency (from PR-level review):
- workspace: restore_iteration now saves the current skill before
overwriting, matching skill new's reversibility invariant — a user who
edits files in chat then rolls back keeps those edits as a new iteration
- generator: validate_skill moved inside Generator.run() so /skill new in
chat gets the same quality gate as openkb skill new (was CLI-only)
- skill/__init__: single-source path helpers (skills_root / skill_dir /
skill_workspace_dir) and frontmatter parser (extract_frontmatter /
extract_description). Removes duplicated path construction across 6+
sites and four divergent frontmatter implementations
- cli/chat: route every "output/skills/<name>" construction through the
helper; add missing "Run openkb init first." hint to skill validate /
skill eval; capitalize /skill autocomplete; fix stale comment
Skills domain quality (the compile pipeline can actually distill now):
- creator/tools: skill agent gets the query agent's deep-retrieval
toolset — get_page_content for page-range source reads on PageIndex
docs, get_image for figures. query_wiki demoted to narrow follow-ups
only; primary traversal is direct file reads
- skill_create.md: rewritten end-to-end. Working method now mirrors
query's 6-step strategy (survey -> summaries -> sources via full_text
pointer -> concepts -> draft -> review-and-revise). Required output
adds a "Core decision rules" section (>=5 if-X-then-Y rules) and a
"Known gaps" section. Description-writing rules optimize for trigger
predicate (situations, keywords, exclusions), not topic accuracy
- evaluator: was a tautology (generator and grader both saw only the
description -> a LOREM IPSUM body could pass 100%). Now the generator
reads body + reference excerpts so prompts reflect actual claims, and
a second grader (grade_coverage) checks whether the body has substance
to support what the description promises. CLI surfaces both Trigger
accuracy and Body coverage
- validator: foreign-wikilink gate. SKILL.md and references/*.md cannot
contain [[concepts/]] / [[summaries/]] / [[sources/]] — those point at
the producer's wiki, which doesn't ship; on the consumer's machine
they are dead links plus wasted context tokens. Only
[[references/<slug>]] (which ships with the skill) is valid
- prompt's source-use rules: paraphrase, short quotes <=40 words, no
bulk copying; provenance audit is the producer's responsibility at
compile time, not something to ship in the artifact
Tests: +9 new (rollback preservation, body-coverage grader, foreign
wikilink detection in body and references). 504 passing.1 parent 1679c8c commit ce918cf
15 files changed
Lines changed: 833 additions & 206 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
| 533 | + | |
| 534 | + | |
534 | 535 | | |
535 | 536 | | |
536 | 537 | | |
| |||
544 | 545 | | |
545 | 546 | | |
546 | 547 | | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
547 | 555 | | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | 556 | | |
556 | 557 | | |
557 | 558 | | |
558 | 559 | | |
559 | 560 | | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
560 | 573 | | |
561 | 574 | | |
562 | 575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
| |||
1465 | 1467 | | |
1466 | 1468 | | |
1467 | 1469 | | |
1468 | | - | |
| 1470 | + | |
| 1471 | + | |
1469 | 1472 | | |
1470 | 1473 | | |
1471 | | - | |
| 1474 | + | |
1472 | 1475 | | |
1473 | 1476 | | |
1474 | 1477 | | |
| |||
1491 | 1494 | | |
1492 | 1495 | | |
1493 | 1496 | | |
1494 | | - | |
| 1497 | + | |
| 1498 | + | |
1495 | 1499 | | |
1496 | 1500 | | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
1497 | 1508 | | |
1498 | | - | |
1499 | | - | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | 1509 | | |
1506 | 1510 | | |
1507 | 1511 | | |
| |||
1517 | 1521 | | |
1518 | 1522 | | |
1519 | 1523 | | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
1526 | 1528 | | |
1527 | 1529 | | |
1528 | 1530 | | |
| |||
1581 | 1583 | | |
1582 | 1584 | | |
1583 | 1585 | | |
1584 | | - | |
| 1586 | + | |
| 1587 | + | |
1585 | 1588 | | |
1586 | 1589 | | |
1587 | 1590 | | |
| |||
1642 | 1645 | | |
1643 | 1646 | | |
1644 | 1647 | | |
1645 | | - | |
| 1648 | + | |
| 1649 | + | |
1646 | 1650 | | |
1647 | 1651 | | |
1648 | 1652 | | |
| |||
1681 | 1685 | | |
1682 | 1686 | | |
1683 | 1687 | | |
| 1688 | + | |
1684 | 1689 | | |
1685 | 1690 | | |
1686 | 1691 | | |
1687 | 1692 | | |
1688 | | - | |
| 1693 | + | |
1689 | 1694 | | |
1690 | 1695 | | |
1691 | | - | |
1692 | | - | |
| 1696 | + | |
| 1697 | + | |
1693 | 1698 | | |
1694 | 1699 | | |
1695 | 1700 | | |
1696 | 1701 | | |
1697 | | - | |
| 1702 | + | |
1698 | 1703 | | |
1699 | 1704 | | |
1700 | 1705 | | |
1701 | 1706 | | |
1702 | 1707 | | |
1703 | 1708 | | |
1704 | | - | |
| 1709 | + | |
1705 | 1710 | | |
1706 | 1711 | | |
1707 | 1712 | | |
| |||
1748 | 1753 | | |
1749 | 1754 | | |
1750 | 1755 | | |
| 1756 | + | |
| 1757 | + | |
1751 | 1758 | | |
1752 | 1759 | | |
1753 | | - | |
| 1760 | + | |
1754 | 1761 | | |
1755 | 1762 | | |
1756 | | - | |
| 1763 | + | |
1757 | 1764 | | |
1758 | 1765 | | |
1759 | 1766 | | |
| |||
1783 | 1790 | | |
1784 | 1791 | | |
1785 | 1792 | | |
1786 | | - | |
1787 | | - | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
1788 | 1801 | | |
1789 | 1802 | | |
1790 | 1803 | | |
1791 | | - | |
| 1804 | + | |
1792 | 1805 | | |
1793 | 1806 | | |
1794 | | - | |
1795 | | - | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
1796 | 1816 | | |
1797 | 1817 | | |
1798 | 1818 | | |
| |||
0 commit comments