()
| 124 | |
| 125 | |
| 126 | def main() -> int: |
| 127 | with tempfile.TemporaryDirectory() as tmp_str: |
| 128 | tmp = Path(tmp_str) |
| 129 | _isolate_env(tmp) |
| 130 | |
| 131 | # Reset every cache + register the bundled catalogue. |
| 132 | clear_skill_caches() |
| 133 | clear_dynamic_skills() |
| 134 | clear_skill_registry() |
| 135 | clear_bundled_skills() |
| 136 | init_bundled_skills() |
| 137 | |
| 138 | project = _build_workspace(tmp) |
| 139 | ctx = ToolContext(workspace_root=project) |
| 140 | ctx.session_id = "S-smoke-001" |
| 141 | |
| 142 | _print_listing(project) |
| 143 | |
| 144 | _print_section("Invocations (first 200 chars of each rendered prompt)") |
| 145 | # commit-helper — substitutions + args |
| 146 | _print_invocation("commit-helper", "feat", ctx) |
| 147 | |
| 148 | # frontend:add-component — namespaced + named arg |
| 149 | _print_invocation("frontend:add-component", "Button", ctx) |
| 150 | |
| 151 | # simplify — bundled skill (no base-dir header) |
| 152 | _print_invocation("simplify", "focus on caching", ctx) |
| 153 | |
| 154 | # lint-py — conditional skill: activate it by touching a |
| 155 | # matching path, then invoke. As of bug fix #14, activated |
| 156 | # conditional skills flow through `get_all_skills` → |
| 157 | # `_skill_registry` automatically, so SkillTool resolves them |
| 158 | # naturally on the next call (no manual registry promotion). |
| 159 | _print_section("Activating conditional `lint-py` for src/foo.py") |
| 160 | py_path = project / "src" / "foo.py" |
| 161 | py_path.parent.mkdir(parents=True, exist_ok=True) |
| 162 | py_path.write_text("# placeholder") |
| 163 | activated = activate_conditional_skills_for_paths( |
| 164 | [str(py_path)], str(project) |
| 165 | ) |
| 166 | print(f" activated: {activated}") |
| 167 | _print_invocation("lint-py", "", ctx) |
| 168 | |
| 169 | return 0 |
| 170 | |
| 171 | |
| 172 | if __name__ == "__main__": |
no test coverage detected