Commit 4f9d966
authored
* Stage 5: Skills, Generic & Option-Driven Integrations (#1924)
Add SkillsIntegration base class and migrate codex, kimi, agy, and
generic to the integration system.
Integrations:
- SkillsIntegration(IntegrationBase) in base.py — creates
speckit-<name>/SKILL.md layout matching release ZIP output byte-for-byte
- CodexIntegration — .agents/skills/, --skills default=True
- KimiIntegration — .kimi/skills/, --skills + --migrate-legacy options,
dotted→hyphenated skill directory migration
- AgyIntegration — .agent/skills/, skills-only (commands deprecated v1.20.5)
- GenericIntegration — user-specified --commands-dir, MarkdownIntegration
- All four have update-context.sh/.ps1 scripts
- All four registered in INTEGRATION_REGISTRY
CLI changes:
- --ai <agent> auto-promotes to integration path for all registered agents
- Interactive agent selection also auto-promotes (bug fix)
- --ai-skills and --ai-commands-dir show deprecation notices on integration path
- Next-steps display shows correct skill invocation syntax for skills integrations
- agy added to CommandRegistrar.AGENT_CONFIGS
Tests:
- test_integration_base_skills.py — reusable mixin with setup, frontmatter,
directory structure, scripts, CLI auto-promote, and complete file inventory
(sh+ps) tests
- Per-agent test files: test_integration_{codex,kimi,agy,generic}.py
- Kimi legacy migration tests, generic --commands-dir validation
- Registry updated with Stage 5 keys
- Removed 9 dead-mock tests, moved 4 integration tests to proper locations
- Fixed all bare project-name tests to use tmp_path
- Fixed 6 pre-existing ANSI escape code test failures in test_extensions.py
and test_presets.py
1524 tests pass, 0 failures.
* fix: remove unused variable flagged by ruff (F841)
* fix: address PR review — integration-type-aware deprecation messages and early generic validation
- --ai-skills deprecation message now distinguishes SkillsIntegration
("skills are the default") from command-based integrations ("has no effect")
- --ai-commands-dir validation for generic runs even when auto-promoted,
giving clear CLI error instead of late ValueError from setup()
- Resolves review comments from #2052
* fix: address PR review round 2
- Remove unused SKILL_DESCRIPTIONS dict from base.py (dead code after
switching to template descriptions for ZIP parity)
- Narrow YAML parse catch from Exception to yaml.YAMLError
- Remove unused shutil import from test_integration_kimi.py
- Remove unused _REGISTRAR_EXEMPT class attr from test_registry.py
- Reword --ai-commands-dir deprecation to be actionable
- Update generic validation error to mention both --ai and --integration
* fix: address PR review round 3
- Clarify parsed_options forwarding is intentional (all options passed,
integrations decide what to use)
- Extract _strip_ansi() helper in test_extensions.py and test_presets.py
- Remove unused pytest import (test_cli.py), unused locals (test_integration_base_skills.py)
- Reword --ai-commands-dir deprecation to be actionable without referencing
the not-yet-implemented --integration-options
* fix: address PR review round 4
- Reorder kimi migration: run super().setup() first so hyphenated
targets exist, then migrate dotted dirs (prevents user content loss)
- Move _strip_ansi() to shared tests/conftest.py, import from there
in test_extensions.py, test_presets.py, test_ai_skills.py
- Remove now-unused re imports from all three test files
* fix: address PR review round 5
- Use write_bytes() for LF-only newlines (no CRLF on Windows)
- Add --integration-options CLI parameter — raw string passed through
to the integration via opts['raw_options']; the integration owns
parsing of its own options
- GenericIntegration.setup() reads --commands-dir from raw_options
when not in parsed_options (supports --integration-options="...")
- Skip early --ai-commands-dir validation when --integration-options
is provided (integration validates in its own setup())
- Remove parse_integration_options from core — integrations parse
their own options
* fix: address PR review round 6
- GenericIntegration is now stateless: removed self._commands_dir
instance state, overrides setup() directly to compute destination
from parsed_options/raw_options on the stack
- commands_dest() raises by design (stateless singleton)
- _quote() in SkillsIntegration now escapes backslashes and double
quotes to produce valid YAML even with special characters
* fix: address PR review round 7
- Support --commands-dir=value form in raw_options parsing (not just
--commands-dir value with space separator)
- Normalize CRLF to LF in write_file_and_record() before encoding
- Persist ai_skills=True in init-options.json when using a
SkillsIntegration, so extensions/presets emit SKILL.md overrides
correctly even without explicit --ai-skills flag
1 parent b44ffc0 commit 4f9d966
File tree
28 files changed
+1777
-414
lines changed- src/specify_cli
- integrations
- agy
- scripts
- codex
- scripts
- generic
- scripts
- kimi
- scripts
- tests
- integrations
28 files changed
+1777
-414
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1907 | 1907 | | |
1908 | 1908 | | |
1909 | 1909 | | |
| 1910 | + | |
1910 | 1911 | | |
1911 | 1912 | | |
1912 | 1913 | | |
| |||
1997 | 1998 | | |
1998 | 1999 | | |
1999 | 2000 | | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
2000 | 2021 | | |
2001 | 2022 | | |
2002 | 2023 | | |
| |||
2062 | 2083 | | |
2063 | 2084 | | |
2064 | 2085 | | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
2065 | 2095 | | |
2066 | | - | |
| 2096 | + | |
| 2097 | + | |
2067 | 2098 | | |
2068 | 2099 | | |
2069 | 2100 | | |
| |||
2073 | 2104 | | |
2074 | 2105 | | |
2075 | 2106 | | |
2076 | | - | |
2077 | | - | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
2078 | 2111 | | |
2079 | | - | |
2080 | | - | |
| 2112 | + | |
| 2113 | + | |
2081 | 2114 | | |
2082 | | - | |
2083 | | - | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
2084 | 2121 | | |
2085 | 2122 | | |
2086 | 2123 | | |
| |||
2210 | 2247 | | |
2211 | 2248 | | |
2212 | 2249 | | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
2213 | 2260 | | |
2214 | 2261 | | |
| 2262 | + | |
2215 | 2263 | | |
| 2264 | + | |
2216 | 2265 | | |
2217 | 2266 | | |
2218 | 2267 | | |
| |||
2268 | 2317 | | |
2269 | 2318 | | |
2270 | 2319 | | |
2271 | | - | |
| 2320 | + | |
2272 | 2321 | | |
2273 | 2322 | | |
2274 | 2323 | | |
| |||
2284 | 2333 | | |
2285 | 2334 | | |
2286 | 2335 | | |
| 2336 | + | |
2287 | 2337 | | |
2288 | 2338 | | |
2289 | 2339 | | |
2290 | | - | |
| 2340 | + | |
2291 | 2341 | | |
2292 | 2342 | | |
2293 | 2343 | | |
2294 | 2344 | | |
2295 | 2345 | | |
2296 | 2346 | | |
2297 | 2347 | | |
2298 | | - | |
| 2348 | + | |
2299 | 2349 | | |
2300 | 2350 | | |
2301 | 2351 | | |
| |||
2383 | 2433 | | |
2384 | 2434 | | |
2385 | 2435 | | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
2386 | 2441 | | |
2387 | 2442 | | |
2388 | 2443 | | |
| |||
2484 | 2539 | | |
2485 | 2540 | | |
2486 | 2541 | | |
2487 | | - | |
2488 | | - | |
2489 | | - | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
2490 | 2549 | | |
2491 | | - | |
| 2550 | + | |
2492 | 2551 | | |
2493 | | - | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
2494 | 2559 | | |
2495 | 2560 | | |
2496 | 2561 | | |
2497 | | - | |
| 2562 | + | |
2498 | 2563 | | |
2499 | 2564 | | |
2500 | 2565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
171 | 177 | | |
172 | 178 | | |
173 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| 77 | + | |
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| 82 | + | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
| 87 | + | |
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
| 91 | + | |
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments