@techwavedev/agi-agent-kit 1.1.7 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @techwavedev/agi-agent-kit might be problematic. Click here for more details.

Files changed (111) hide show
  1. package/CHANGELOG.md +82 -1
  2. package/README.md +190 -12
  3. package/bin/init.js +30 -2
  4. package/package.json +6 -3
  5. package/templates/base/AGENTS.md +54 -23
  6. package/templates/base/README.md +325 -0
  7. package/templates/base/directives/memory_integration.md +95 -0
  8. package/templates/base/execution/memory_manager.py +309 -0
  9. package/templates/base/execution/session_boot.py +218 -0
  10. package/templates/base/execution/session_init.py +320 -0
  11. package/templates/base/skill-creator/SKILL_skillcreator.md +23 -36
  12. package/templates/base/skill-creator/scripts/init_skill.py +18 -135
  13. package/templates/skills/ec/README.md +31 -0
  14. package/templates/skills/ec/aws/SKILL.md +1020 -0
  15. package/templates/skills/ec/aws/defaults.yaml +13 -0
  16. package/templates/skills/ec/aws/references/common_patterns.md +80 -0
  17. package/templates/skills/ec/aws/references/mcp_servers.md +98 -0
  18. package/templates/skills/ec/aws-terraform/SKILL.md +349 -0
  19. package/templates/skills/ec/aws-terraform/references/best_practices.md +394 -0
  20. package/templates/skills/ec/aws-terraform/references/checkov_reference.md +337 -0
  21. package/templates/skills/ec/aws-terraform/scripts/configure_mcp.py +150 -0
  22. package/templates/skills/ec/confluent-kafka/SKILL.md +655 -0
  23. package/templates/skills/ec/confluent-kafka/references/ansible_playbooks.md +792 -0
  24. package/templates/skills/ec/confluent-kafka/references/ec_deployment.md +579 -0
  25. package/templates/skills/ec/confluent-kafka/references/kraft_migration.md +490 -0
  26. package/templates/skills/ec/confluent-kafka/references/troubleshooting.md +778 -0
  27. package/templates/skills/ec/confluent-kafka/references/upgrade_7x_to_8x.md +488 -0
  28. package/templates/skills/ec/confluent-kafka/scripts/kafka_health_check.py +435 -0
  29. package/templates/skills/ec/confluent-kafka/scripts/upgrade_preflight.py +568 -0
  30. package/templates/skills/ec/confluent-kafka/scripts/validate_config.py +455 -0
  31. package/templates/skills/ec/consul/SKILL.md +427 -0
  32. package/templates/skills/ec/consul/references/acl_setup.md +168 -0
  33. package/templates/skills/ec/consul/references/ha_config.md +196 -0
  34. package/templates/skills/ec/consul/references/troubleshooting.md +267 -0
  35. package/templates/skills/ec/consul/references/upgrades.md +213 -0
  36. package/templates/skills/ec/consul/scripts/consul_health_report.py +530 -0
  37. package/templates/skills/ec/consul/scripts/consul_status.py +264 -0
  38. package/templates/skills/ec/consul/scripts/generate_values.py +170 -0
  39. package/templates/skills/ec/documentation/SKILL.md +351 -0
  40. package/templates/skills/ec/documentation/references/best_practices.md +201 -0
  41. package/templates/skills/ec/documentation/scripts/analyze_code.py +307 -0
  42. package/templates/skills/ec/documentation/scripts/detect_changes.py +460 -0
  43. package/templates/skills/ec/documentation/scripts/generate_changelog.py +312 -0
  44. package/templates/skills/ec/documentation/scripts/sync_docs.py +272 -0
  45. package/templates/skills/ec/documentation/scripts/update_skill_docs.py +366 -0
  46. package/templates/skills/ec/gitlab/SKILL.md +529 -0
  47. package/templates/skills/ec/gitlab/references/agent_installation.md +416 -0
  48. package/templates/skills/ec/gitlab/references/api_reference.md +508 -0
  49. package/templates/skills/ec/gitlab/references/gitops_flux.md +465 -0
  50. package/templates/skills/ec/gitlab/references/troubleshooting.md +518 -0
  51. package/templates/skills/ec/gitlab/scripts/generate_agent_values.py +329 -0
  52. package/templates/skills/ec/gitlab/scripts/gitlab_agent_status.py +414 -0
  53. package/templates/skills/ec/jira/SKILL.md +484 -0
  54. package/templates/skills/ec/jira/references/jql_reference.md +148 -0
  55. package/templates/skills/ec/jira/scripts/add_comment.py +91 -0
  56. package/templates/skills/ec/jira/scripts/bulk_log_work.py +124 -0
  57. package/templates/skills/ec/jira/scripts/create_ticket.py +162 -0
  58. package/templates/skills/ec/jira/scripts/get_ticket.py +191 -0
  59. package/templates/skills/ec/jira/scripts/jira_client.py +383 -0
  60. package/templates/skills/ec/jira/scripts/log_work.py +154 -0
  61. package/templates/skills/ec/jira/scripts/search_tickets.py +104 -0
  62. package/templates/skills/ec/jira/scripts/update_comment.py +67 -0
  63. package/templates/skills/ec/jira/scripts/update_ticket.py +161 -0
  64. package/templates/skills/ec/karpenter/SKILL.md +301 -0
  65. package/templates/skills/ec/karpenter/references/ec2nodeclasses.md +421 -0
  66. package/templates/skills/ec/karpenter/references/migration.md +396 -0
  67. package/templates/skills/ec/karpenter/references/nodepools.md +400 -0
  68. package/templates/skills/ec/karpenter/references/troubleshooting.md +359 -0
  69. package/templates/skills/ec/karpenter/scripts/generate_ec2nodeclass.py +187 -0
  70. package/templates/skills/ec/karpenter/scripts/generate_nodepool.py +245 -0
  71. package/templates/skills/ec/karpenter/scripts/karpenter_status.py +359 -0
  72. package/templates/skills/ec/opensearch/SKILL.md +720 -0
  73. package/templates/skills/ec/opensearch/references/ml_neural_search.md +576 -0
  74. package/templates/skills/ec/opensearch/references/operator.md +532 -0
  75. package/templates/skills/ec/opensearch/references/query_dsl.md +532 -0
  76. package/templates/skills/ec/opensearch/scripts/configure_mcp.py +148 -0
  77. package/templates/skills/ec/victoriametrics/SKILL.md +598 -0
  78. package/templates/skills/ec/victoriametrics/references/kubernetes.md +531 -0
  79. package/templates/skills/ec/victoriametrics/references/prometheus_migration.md +333 -0
  80. package/templates/skills/ec/victoriametrics/references/troubleshooting.md +442 -0
  81. package/templates/skills/knowledge/SKILLS_CATALOG.md +274 -4
  82. package/templates/skills/knowledge/intelligent-routing/SKILL.md +237 -164
  83. package/templates/skills/knowledge/parallel-agents/SKILL.md +345 -73
  84. package/templates/skills/knowledge/plugin-discovery/SKILL.md +582 -0
  85. package/templates/skills/knowledge/plugin-discovery/scripts/platform_setup.py +1083 -0
  86. package/templates/skills/knowledge/design-md/README.md +0 -34
  87. package/templates/skills/knowledge/design-md/SKILL.md +0 -193
  88. package/templates/skills/knowledge/design-md/examples/DESIGN.md +0 -154
  89. package/templates/skills/knowledge/notebooklm-mcp/SKILL.md +0 -71
  90. package/templates/skills/knowledge/notebooklm-mcp/assets/example_asset.txt +0 -24
  91. package/templates/skills/knowledge/notebooklm-mcp/references/api_reference.md +0 -34
  92. package/templates/skills/knowledge/notebooklm-mcp/scripts/example.py +0 -19
  93. package/templates/skills/knowledge/react-components/README.md +0 -36
  94. package/templates/skills/knowledge/react-components/SKILL.md +0 -53
  95. package/templates/skills/knowledge/react-components/examples/gold-standard-card.tsx +0 -80
  96. package/templates/skills/knowledge/react-components/package-lock.json +0 -231
  97. package/templates/skills/knowledge/react-components/package.json +0 -16
  98. package/templates/skills/knowledge/react-components/resources/architecture-checklist.md +0 -15
  99. package/templates/skills/knowledge/react-components/resources/component-template.tsx +0 -37
  100. package/templates/skills/knowledge/react-components/resources/stitch-api-reference.md +0 -14
  101. package/templates/skills/knowledge/react-components/resources/style-guide.json +0 -27
  102. package/templates/skills/knowledge/react-components/scripts/fetch-stitch.sh +0 -30
  103. package/templates/skills/knowledge/react-components/scripts/validate.js +0 -68
  104. package/templates/skills/knowledge/self-update/SKILL.md +0 -60
  105. package/templates/skills/knowledge/self-update/scripts/update_kit.py +0 -103
  106. package/templates/skills/knowledge/stitch-loop/README.md +0 -54
  107. package/templates/skills/knowledge/stitch-loop/SKILL.md +0 -235
  108. package/templates/skills/knowledge/stitch-loop/examples/SITE.md +0 -73
  109. package/templates/skills/knowledge/stitch-loop/examples/next-prompt.md +0 -25
  110. package/templates/skills/knowledge/stitch-loop/resources/baton-schema.md +0 -61
  111. package/templates/skills/knowledge/stitch-loop/resources/site-template.md +0 -104
@@ -0,0 +1,366 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Skill Documentation Updater
4
+
5
+ Updates documentation for a specific skill based on its current state.
6
+ Extracts information from scripts, references, and updates SKILL.md.
7
+
8
+ Usage:
9
+ python update_skill_docs.py --skill <name> [options]
10
+
11
+ Arguments:
12
+ --skill Skill name to update (required)
13
+ --skills-dir Skills directory (default: skills/)
14
+ --changelog Generate changelog entry (optional)
15
+ --analyze-scripts Analyze script docstrings (default: true)
16
+ --update-references Update references list (default: true)
17
+ --dry-run Preview changes without writing (optional)
18
+
19
+ Exit Codes:
20
+ 0 - Success
21
+ 1 - Invalid arguments
22
+ 2 - Skill not found
23
+ 3 - Parse error
24
+ 4 - Write error
25
+ """
26
+
27
+ import argparse
28
+ import ast
29
+ import re
30
+ import sys
31
+ from datetime import datetime
32
+ from pathlib import Path
33
+ from typing import Dict, List, Optional, Tuple
34
+
35
+
36
+ def parse_skill_md(skill_path: Path) -> Tuple[Dict, str]:
37
+ """
38
+ Parse SKILL.md into frontmatter and body.
39
+
40
+ Returns:
41
+ (frontmatter_dict, body_string)
42
+ """
43
+ content = skill_path.read_text()
44
+
45
+ if not content.startswith('---'):
46
+ return {}, content
47
+
48
+ parts = content.split('---', 2)
49
+ if len(parts) < 3:
50
+ return {}, content
51
+
52
+ frontmatter_raw = parts[1].strip()
53
+ body = parts[2]
54
+
55
+ # Parse simple YAML
56
+ frontmatter = {}
57
+ for line in frontmatter_raw.split('\n'):
58
+ if ':' in line:
59
+ key, value = line.split(':', 1)
60
+ frontmatter[key.strip()] = value.strip().strip('"\'')
61
+
62
+ return frontmatter, body
63
+
64
+
65
+ def extract_script_info(script_path: Path) -> Dict:
66
+ """
67
+ Extract documentation info from a Python script.
68
+
69
+ Returns:
70
+ Dict with: name, docstring, functions, usage
71
+ """
72
+ try:
73
+ content = script_path.read_text()
74
+ tree = ast.parse(content)
75
+ except SyntaxError as e:
76
+ return {
77
+ 'name': script_path.name,
78
+ 'docstring': f'[Parse error: {e}]',
79
+ 'functions': [],
80
+ 'usage': None
81
+ }
82
+
83
+ info = {
84
+ 'name': script_path.name,
85
+ 'docstring': '',
86
+ 'functions': [],
87
+ 'usage': None
88
+ }
89
+
90
+ # Get module docstring
91
+ if tree.body and isinstance(tree.body[0], ast.Expr):
92
+ if isinstance(tree.body[0].value, ast.Constant):
93
+ info['docstring'] = tree.body[0].value.value or ''
94
+
95
+ # Extract usage from docstring
96
+ if 'Usage:' in info['docstring']:
97
+ usage_match = re.search(r'Usage:\s*\n(.*?)(?:\n\n|\nArguments:|\nExit)',
98
+ info['docstring'], re.DOTALL)
99
+ if usage_match:
100
+ info['usage'] = usage_match.group(1).strip()
101
+
102
+ # Get main function definitions
103
+ for node in ast.walk(tree):
104
+ if isinstance(node, ast.FunctionDef):
105
+ func_info = {
106
+ 'name': node.name,
107
+ 'docstring': ast.get_docstring(node) or '',
108
+ 'args': [arg.arg for arg in node.args.args if arg.arg != 'self']
109
+ }
110
+ info['functions'].append(func_info)
111
+
112
+ return info
113
+
114
+
115
+ def get_first_line_description(docstring: str) -> str:
116
+ """Extract the first meaningful line from a docstring."""
117
+ if not docstring:
118
+ return '*[See script for details]*'
119
+
120
+ # Skip empty lines and get first content line
121
+ lines = [l.strip() for l in docstring.split('\n') if l.strip()]
122
+ if lines:
123
+ first_line = lines[0]
124
+ # Truncate if too long
125
+ if len(first_line) > 100:
126
+ return first_line[:97] + '...'
127
+ return first_line
128
+
129
+ return '*[See script for details]*'
130
+
131
+
132
+ def scan_skill_scripts(skill_dir: Path) -> List[Dict]:
133
+ """Scan all Python scripts in a skill's scripts/ directory."""
134
+ scripts_dir = skill_dir / 'scripts'
135
+ if not scripts_dir.exists():
136
+ return []
137
+
138
+ scripts = []
139
+ for script_path in sorted(scripts_dir.glob('*.py')):
140
+ if script_path.name.startswith('__') or script_path.name.startswith('example'):
141
+ continue
142
+
143
+ info = extract_script_info(script_path)
144
+ scripts.append(info)
145
+
146
+ return scripts
147
+
148
+
149
+ def scan_skill_references(skill_dir: Path) -> List[str]:
150
+ """Scan all reference files in a skill's references/ directory."""
151
+ refs_dir = skill_dir / 'references'
152
+ if not refs_dir.exists():
153
+ return []
154
+
155
+ refs = []
156
+ for ref_path in sorted(refs_dir.glob('*.md')):
157
+ if ref_path.name.startswith('example'):
158
+ continue
159
+ refs.append(ref_path.name)
160
+
161
+ return refs
162
+
163
+
164
+ def update_last_updated(body: str) -> str:
165
+ """Update the 'Last Updated' timestamp in the body."""
166
+ today = datetime.now().strftime('%Y-%m-%d')
167
+
168
+ # Pattern: > **Last Updated:** YYYY-MM-DD
169
+ pattern = r'>\s*\*\*Last Updated:\*\*\s*\d{4}-\d{2}-\d{2}'
170
+ replacement = f'> **Last Updated:** {today}'
171
+
172
+ if re.search(pattern, body):
173
+ return re.sub(pattern, replacement, body)
174
+
175
+ # If not found, try to add it after the first heading
176
+ lines = body.split('\n')
177
+ for i, line in enumerate(lines):
178
+ if line.startswith('# ') and i < len(lines) - 1:
179
+ # Insert after heading and any following empty line
180
+ insert_at = i + 1
181
+ while insert_at < len(lines) and not lines[insert_at].strip():
182
+ insert_at += 1
183
+
184
+ lines.insert(insert_at, '')
185
+ lines.insert(insert_at + 1, replacement)
186
+ lines.insert(insert_at + 2, '')
187
+ break
188
+
189
+ return '\n'.join(lines)
190
+
191
+
192
+ def generate_scripts_section(scripts: List[Dict]) -> str:
193
+ """Generate a markdown section for scripts."""
194
+ if not scripts:
195
+ return ""
196
+
197
+ lines = [
198
+ "## Scripts",
199
+ ""
200
+ ]
201
+
202
+ for script in scripts:
203
+ lines.append(f"### `{script['name']}`")
204
+ lines.append("")
205
+
206
+ # First line of docstring as description
207
+ desc = get_first_line_description(script['docstring'])
208
+ if desc and desc != '*[See script for details]*':
209
+ lines.append(desc)
210
+ lines.append("")
211
+
212
+ # Usage example if available
213
+ if script['usage']:
214
+ lines.append("```bash")
215
+ for usage_line in script['usage'].split('\n'):
216
+ lines.append(usage_line)
217
+ lines.append("```")
218
+ lines.append("")
219
+
220
+ return '\n'.join(lines)
221
+
222
+
223
+ def generate_references_section(references: List[str]) -> str:
224
+ """Generate a markdown section for references."""
225
+ if not references:
226
+ return ""
227
+
228
+ lines = [
229
+ "## References",
230
+ ""
231
+ ]
232
+
233
+ for ref in references:
234
+ ref_name = ref.replace('.md', '').replace('_', ' ').title()
235
+ lines.append(f"- [`{ref}`](references/{ref}) — {ref_name}")
236
+
237
+ lines.append("")
238
+ return '\n'.join(lines)
239
+
240
+
241
+ def generate_changelog_entry(skill_name: str, scripts: List[Dict], refs: List[str]) -> str:
242
+ """Generate a changelog entry for the skill update."""
243
+ today = datetime.now().strftime('%Y-%m-%d')
244
+
245
+ lines = [
246
+ f"## [{today}] - {skill_name} Documentation Update",
247
+ "",
248
+ "### Changed",
249
+ f"- Updated documentation for `{skill_name}` skill",
250
+ ]
251
+
252
+ if scripts:
253
+ lines.append(f"- Updated scripts documentation ({len(scripts)} scripts)")
254
+
255
+ if refs:
256
+ lines.append(f"- Updated references listing ({len(refs)} references)")
257
+
258
+ lines.extend(["", ""])
259
+ return '\n'.join(lines)
260
+
261
+
262
+ def update_skill_md(skill_dir: Path, scripts: List[Dict], refs: List[str],
263
+ dry_run: bool = False) -> Tuple[bool, str]:
264
+ """
265
+ Update the SKILL.md file with current script and reference information.
266
+
267
+ Returns:
268
+ (success, message)
269
+ """
270
+ skill_md_path = skill_dir / 'SKILL.md'
271
+
272
+ if not skill_md_path.exists():
273
+ return False, f"SKILL.md not found in {skill_dir}"
274
+
275
+ frontmatter, body = parse_skill_md(skill_md_path)
276
+
277
+ if not frontmatter:
278
+ return False, "Could not parse SKILL.md frontmatter"
279
+
280
+ # Update last updated timestamp
281
+ body = update_last_updated(body)
282
+
283
+ # TODO: More sophisticated body updates could be done here
284
+ # For now, we just update the timestamp and leave content intact
285
+ # A more advanced version could:
286
+ # - Update scripts section with extracted docstrings
287
+ # - Update references section with current files
288
+ # - Add missing sections
289
+
290
+ # Rebuild SKILL.md
291
+ new_content = '---\n'
292
+ for key, value in frontmatter.items():
293
+ if ' ' in value or ':' in value or value.startswith('['):
294
+ new_content += f'{key}: "{value}"\n'
295
+ else:
296
+ new_content += f'{key}: {value}\n'
297
+ new_content += '---\n'
298
+ new_content += body
299
+
300
+ if dry_run:
301
+ return True, "Dry run - no changes written"
302
+
303
+ try:
304
+ skill_md_path.write_text(new_content)
305
+ return True, f"Updated {skill_md_path}"
306
+ except Exception as e:
307
+ return False, f"Write error: {e}"
308
+
309
+
310
+ def main():
311
+ parser = argparse.ArgumentParser(
312
+ description='Update skill documentation',
313
+ formatter_class=argparse.RawDescriptionHelpFormatter,
314
+ epilog=__doc__
315
+ )
316
+ parser.add_argument('--skill', required=True, help='Skill name to update')
317
+ parser.add_argument('--skills-dir', default='skills/', help='Skills directory')
318
+ parser.add_argument('--changelog', action='store_true', help='Generate changelog entry')
319
+ parser.add_argument('--analyze-scripts', type=bool, default=True, help='Analyze scripts')
320
+ parser.add_argument('--update-references', type=bool, default=True, help='Update references')
321
+ parser.add_argument('--dry-run', action='store_true', help='Preview without writing')
322
+ args = parser.parse_args()
323
+
324
+ skills_dir = Path(args.skills_dir).resolve()
325
+ skill_dir = skills_dir / args.skill
326
+
327
+ if not skill_dir.exists():
328
+ print(f"❌ Error: Skill not found: {skill_dir}", file=sys.stderr)
329
+ sys.exit(2)
330
+
331
+ print(f"📝 Updating documentation for: {args.skill}")
332
+
333
+ # Scan scripts
334
+ scripts = scan_skill_scripts(skill_dir) if args.analyze_scripts else []
335
+ print(f" Found {len(scripts)} script(s)")
336
+
337
+ # Scan references
338
+ refs = scan_skill_references(skill_dir) if args.update_references else []
339
+ print(f" Found {len(refs)} reference(s)")
340
+
341
+ # Update SKILL.md
342
+ success, message = update_skill_md(skill_dir, scripts, refs, args.dry_run)
343
+
344
+ if success:
345
+ print(f"✅ {message}")
346
+ else:
347
+ print(f"❌ {message}", file=sys.stderr)
348
+ sys.exit(4)
349
+
350
+ # Generate changelog if requested
351
+ if args.changelog and not args.dry_run:
352
+ changelog_entry = generate_changelog_entry(args.skill, scripts, refs)
353
+ print("\n📋 Changelog Entry:")
354
+ print(changelog_entry)
355
+
356
+ print("\n✅ Documentation update complete!")
357
+
358
+ # Remind to update catalog
359
+ print("\n💡 Remember to update the skills catalog:")
360
+ print(" python skill-creator/scripts/update_catalog.py --skills-dir skills/")
361
+
362
+ sys.exit(0)
363
+
364
+
365
+ if __name__ == '__main__':
366
+ main()