@jetrabbits/agentic 0.0.3 → 0.0.5
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.
- package/AGENTS.md +15 -0
- package/Makefile +40 -0
- package/README.md +1 -0
- package/UPGRADE.md +61 -0
- package/agentic +948 -10
- package/areas/devops/ci-cd/prompts/release-pipeline.md +69 -79
- package/areas/devops/ci-cd/rules/supply-chain-security.md +39 -19
- package/areas/devops/ci-cd/skills/github-actions-patterns/SKILL.md +6 -1
- package/areas/devops/ci-cd/skills/pipeline-security/SKILL.md +54 -119
- package/areas/devops/ci-cd/workflows/release-pipeline.md +72 -62
- package/areas/devops/kubernetes/skills/pod-troubleshooting/SKILL.md +1 -1
- package/areas/devops/observability/rules/alerting-standards.md +37 -31
- package/areas/devops/observability/rules/golden-signals.md +29 -20
- package/areas/devops/observability/skills/distributed-tracing/SKILL.md +10 -1
- package/areas/software/backend/rules/security.md +32 -12
- package/areas/software/frontend/skills/component-design/SKILL.md +13 -1
- package/areas/software/full-stack/AGENTS.md +1 -4
- package/areas/software/full-stack/rules/security-guide.md +48 -12
- package/areas/software/full-stack/workflows/debug-issue.md +2 -2
- package/areas/software/security/prompts/security-scan.md +47 -55
- package/areas/software/security/rules/dependency-policy.md +43 -8
- package/areas/software/security/skills/dependency-audit/SKILL.md +46 -25
- package/areas/software/security/skills/threat-modeling/SKILL.md +26 -0
- package/docs/agentic-lifecycle.md +103 -0
- package/docs/agentic-token-minimization/README.md +79 -0
- package/docs/agentic-usage.md +145 -0
- package/docs/catalog.schema.json +203 -0
- package/docs/guidance-updates/2026-04-10-software-devops-best-practices.md +26 -0
- package/docs/opencode_prepare_agents.md +40 -0
- package/docs/opencode_setup.md +45 -0
- package/docs/prompt-format.md +80 -0
- package/docs/site/README.md +44 -0
- package/docs/site/app.js +127 -0
- package/docs/site/catalog.json +5002 -0
- package/docs/site/index.html +52 -0
- package/docs/site/styles.css +177 -0
- package/extensions/codex/agents/developer.toml +1 -1
- package/extensions/codex/agents/devops-engineer.toml +1 -1
- package/extensions/codex/agents/product-owner.toml +1 -1
- package/extensions/codex/agents/team-lead.toml +1 -1
- package/extensions/opencode/plugins/model-checker.json +2 -3
- package/extensions/opencode/plugins/model-checker.ts +23 -0
- package/extensions/opencode/plugins/telegram-notification.ts +33 -5
- package/package.json +6 -2
- package/scripts/assess_area_quality.py +216 -0
- package/scripts/build_docs_catalog.py +283 -0
- package/scripts/lint_prompts.py +113 -0
- package/areas/software/full-stack/skills/bash-pro/SKILL.md +0 -310
- package/areas/software/full-stack/skills/python-pro/SKILL.md +0 -158
- package/areas/software/full-stack/skills/skill-creator/LICENSE.txt +0 -202
- package/areas/software/full-stack/skills/skill-creator/SKILL.md +0 -356
- package/areas/software/full-stack/skills/skill-creator/references/output-patterns.md +0 -82
- package/areas/software/full-stack/skills/skill-creator/references/workflows.md +0 -28
- package/areas/software/full-stack/skills/skill-creator/scripts/init_skill.py +0 -303
- package/areas/software/full-stack/skills/skill-creator/scripts/package_skill.py +0 -110
- package/areas/software/full-stack/skills/skill-creator/scripts/quick_validate.py +0 -95
- package/extensions/codex/skills/babysit-pr/SKILL.md +0 -187
- package/extensions/codex/skills/babysit-pr/agents/openai.yaml +0 -4
- package/extensions/codex/skills/babysit-pr/references/github-api-notes.md +0 -72
- package/extensions/codex/skills/babysit-pr/references/heuristics.md +0 -58
- package/extensions/codex/skills/babysit-pr/scripts/gh_pr_watch.py +0 -806
- package/extensions/codex/skills/babysit-pr/scripts/test_gh_pr_watch.py +0 -155
- package/extensions/opencode/skills/code_review_expert/SKILL.md +0 -144
- package/extensions/opencode/skills/design_expert/SKILL.md +0 -42
- package/extensions/opencode/skills/qa_expert/SKILL.md +0 -116
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agent-guides.local/schemas/catalog.schema.json",
|
|
4
|
+
"title": "Agent Guides Docs Catalog",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"version",
|
|
8
|
+
"generated_from",
|
|
9
|
+
"areas",
|
|
10
|
+
"stats"
|
|
11
|
+
],
|
|
12
|
+
"properties": {
|
|
13
|
+
"version": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"generated_from": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"areas": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"required": [
|
|
24
|
+
"area",
|
|
25
|
+
"workflows"
|
|
26
|
+
],
|
|
27
|
+
"properties": {
|
|
28
|
+
"area": {
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
"workflows": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"required": [
|
|
36
|
+
"trigger",
|
|
37
|
+
"name",
|
|
38
|
+
"description",
|
|
39
|
+
"workflow_path",
|
|
40
|
+
"inputs",
|
|
41
|
+
"outputs",
|
|
42
|
+
"roles",
|
|
43
|
+
"related_rules",
|
|
44
|
+
"uses_skills",
|
|
45
|
+
"quality_gates",
|
|
46
|
+
"examples",
|
|
47
|
+
"skill_refs"
|
|
48
|
+
],
|
|
49
|
+
"properties": {
|
|
50
|
+
"trigger": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
53
|
+
"name": {
|
|
54
|
+
"type": "string"
|
|
55
|
+
},
|
|
56
|
+
"description": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
},
|
|
59
|
+
"workflow_path": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
},
|
|
62
|
+
"prompt_path": {
|
|
63
|
+
"type": [
|
|
64
|
+
"string",
|
|
65
|
+
"null"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
"use_when": {
|
|
69
|
+
"type": "string"
|
|
70
|
+
},
|
|
71
|
+
"inputs": {
|
|
72
|
+
"type": "array",
|
|
73
|
+
"items": {
|
|
74
|
+
"type": "string"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"outputs": {
|
|
78
|
+
"type": "array",
|
|
79
|
+
"items": {
|
|
80
|
+
"type": "string"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"roles": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"items": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"related_rules": {
|
|
90
|
+
"type": "array",
|
|
91
|
+
"items": {
|
|
92
|
+
"type": "string"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"uses_skills": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"type": "string"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"quality_gates": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"items": {
|
|
104
|
+
"type": "string"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"examples": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"required": [
|
|
110
|
+
"both"
|
|
111
|
+
],
|
|
112
|
+
"properties": {
|
|
113
|
+
"both": {
|
|
114
|
+
"type": "array",
|
|
115
|
+
"items": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"required": [
|
|
118
|
+
"number",
|
|
119
|
+
"title",
|
|
120
|
+
"en",
|
|
121
|
+
"ru"
|
|
122
|
+
],
|
|
123
|
+
"properties": {
|
|
124
|
+
"number": {
|
|
125
|
+
"type": "integer",
|
|
126
|
+
"minimum": 1
|
|
127
|
+
},
|
|
128
|
+
"title": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
"en": {
|
|
132
|
+
"type": "string"
|
|
133
|
+
},
|
|
134
|
+
"ru": {
|
|
135
|
+
"type": "string"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"prompt_command_refs": {
|
|
143
|
+
"type": "array",
|
|
144
|
+
"items": {
|
|
145
|
+
"type": "string"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"skill_refs": {
|
|
149
|
+
"type": "array",
|
|
150
|
+
"items": {
|
|
151
|
+
"type": "object",
|
|
152
|
+
"required": [
|
|
153
|
+
"name",
|
|
154
|
+
"path"
|
|
155
|
+
],
|
|
156
|
+
"properties": {
|
|
157
|
+
"name": {
|
|
158
|
+
"type": "string"
|
|
159
|
+
},
|
|
160
|
+
"path": {
|
|
161
|
+
"type": [
|
|
162
|
+
"string",
|
|
163
|
+
"null"
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"stats": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"required": [
|
|
178
|
+
"workflows",
|
|
179
|
+
"prompts",
|
|
180
|
+
"problems",
|
|
181
|
+
"matched_prompts"
|
|
182
|
+
],
|
|
183
|
+
"properties": {
|
|
184
|
+
"workflows": {
|
|
185
|
+
"type": "integer",
|
|
186
|
+
"minimum": 0
|
|
187
|
+
},
|
|
188
|
+
"prompts": {
|
|
189
|
+
"type": "integer",
|
|
190
|
+
"minimum": 0
|
|
191
|
+
},
|
|
192
|
+
"problems": {
|
|
193
|
+
"type": "integer",
|
|
194
|
+
"minimum": 0
|
|
195
|
+
},
|
|
196
|
+
"matched_prompts": {
|
|
197
|
+
"type": "integer",
|
|
198
|
+
"minimum": 0
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Guidance Update — Software & DevOps Best Practices (2026-04-10)
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
This update strengthens repository guidance in five high-impact areas:
|
|
6
|
+
|
|
7
|
+
1. Supply-chain security moved to keyless-first signing, attestations, and admission enforcement.
|
|
8
|
+
2. Release workflow upgraded with database compatibility gates, progressive delivery, and explicit rollback criteria.
|
|
9
|
+
3. Dependency security moved from CVSS-only to exploitability-aware triage with exception governance.
|
|
10
|
+
4. Backend/full-stack security rules expanded for modern cloud-native threats and service identity controls.
|
|
11
|
+
5. Observability and alerting standards aligned to SLO-first operations with burn-rate policy and telemetry cost controls.
|
|
12
|
+
|
|
13
|
+
## Why this update
|
|
14
|
+
|
|
15
|
+
- Reduce production risk from software supply-chain and dependency compromise.
|
|
16
|
+
- Improve release safety for schema and high-risk feature changes.
|
|
17
|
+
- Align operational controls with modern SRE and platform governance practices.
|
|
18
|
+
- Increase actionability and signal quality in observability/alerting.
|
|
19
|
+
|
|
20
|
+
## Impacted areas
|
|
21
|
+
|
|
22
|
+
- `areas/devops/ci-cd/*`
|
|
23
|
+
- `areas/software/security/*`
|
|
24
|
+
- `areas/software/full-stack/rules/security-guide.md`
|
|
25
|
+
- `areas/software/backend/rules/security.md`
|
|
26
|
+
- `areas/devops/observability/rules/*`
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# TASK: Prepare AI Agent Infrastructure
|
|
2
|
+
|
|
3
|
+
Analyze the codebase and create a complete AI-agent setup, including `AGENTS.md` and the `.agent/` directory.
|
|
4
|
+
|
|
5
|
+
## STEP 1: Project analysis
|
|
6
|
+
|
|
7
|
+
Collect the following details:
|
|
8
|
+
|
|
9
|
+
1. **Technology stack**
|
|
10
|
+
- Programming language (Python/Go/Node.js/Java/Rust)
|
|
11
|
+
- Framework (FastAPI/Django/Express/Spring/Gin/Actix)
|
|
12
|
+
- Database (PostgreSQL/MySQL/MongoDB/Redis)
|
|
13
|
+
- Build tools (poetry/npm/cargo/maven/gradle)
|
|
14
|
+
|
|
15
|
+
2. **Commands**
|
|
16
|
+
- Dependency installation
|
|
17
|
+
- Linting and formatting
|
|
18
|
+
- Testing (full suite, single file, single test)
|
|
19
|
+
- Build and run
|
|
20
|
+
|
|
21
|
+
3. **Architecture and domain**
|
|
22
|
+
- Service boundaries/modules
|
|
23
|
+
- Core entities and relationships
|
|
24
|
+
- External integrations and infrastructure
|
|
25
|
+
|
|
26
|
+
## STEP 2: Create guidance artifacts
|
|
27
|
+
|
|
28
|
+
Create:
|
|
29
|
+
|
|
30
|
+
- `AGENTS.md` (high-level operating guidance)
|
|
31
|
+
- `.agent/rules/*` (non-negotiable constraints)
|
|
32
|
+
- `.agent/skills/*/SKILL.md` (focused execution playbooks)
|
|
33
|
+
- `.agent/workflows/*` (repeatable delivery flows)
|
|
34
|
+
- `.agent/prompts/*` (ready-to-use commands/prompts)
|
|
35
|
+
|
|
36
|
+
## STEP 3: Quality checks
|
|
37
|
+
|
|
38
|
+
- Ensure guidance matches the real stack and tooling.
|
|
39
|
+
- Keep instructions actionable and testable.
|
|
40
|
+
- Verify examples are technically accurate and production-oriented.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# OpenCode setup
|
|
2
|
+
|
|
3
|
+
## Configuration
|
|
4
|
+
|
|
5
|
+
The main OpenCode configuration file is located at:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
~/.config/opencode/opencode.json
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Authentication
|
|
12
|
+
|
|
13
|
+
### Auth files
|
|
14
|
+
|
|
15
|
+
OpenCode stores authentication data in two locations:
|
|
16
|
+
|
|
17
|
+
| Path | Description |
|
|
18
|
+
|------|-------------|
|
|
19
|
+
| `~/.config/opencode/` | Plugin-level credentials (for example, `antigravity-accounts.json`) |
|
|
20
|
+
| `~/.local/share/opencode/auth.json` | Primary provider tokens (OpenAI, Google, and others) |
|
|
21
|
+
|
|
22
|
+
## Notes
|
|
23
|
+
|
|
24
|
+
- Back up credentials before machine migration.
|
|
25
|
+
- Keep auth files out of version control.
|
|
26
|
+
- Prefer least-privilege API keys for automation.
|
|
27
|
+
|
|
28
|
+
## Agentic optional plugins
|
|
29
|
+
|
|
30
|
+
When `agentic` installs the OpenCode extension, it configures optional plugins in:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
~/.config/agentic/opencode-plugins.json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Telegram notifications and model checking are opt-in. If the config is absent or a plugin is disabled, the plugin returns no hooks and OpenCode continues without that behavior.
|
|
37
|
+
|
|
38
|
+
Telegram notifications use either the stored config values or these environment variables:
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
OPENCODE_TELEGRAM_BOT_TOKEN
|
|
42
|
+
OPENCODE_TELEGRAM_CHAT_ID
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Non-interactive `agentic install` defaults optional plugins to disabled when no config exists.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Prompt format standard (EN/RU)
|
|
2
|
+
|
|
3
|
+
This repository expects every `areas/**/prompts/*.md` file to follow a strict structure so docs generation can reliably extract examples.
|
|
4
|
+
|
|
5
|
+
## Required structure
|
|
6
|
+
|
|
7
|
+
1. YAML front matter:
|
|
8
|
+
|
|
9
|
+
```md
|
|
10
|
+
---
|
|
11
|
+
workflow: your-workflow-stem
|
|
12
|
+
---
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. Prompt header:
|
|
16
|
+
|
|
17
|
+
```md
|
|
18
|
+
# Prompt: `/your-workflow-stem`
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
3. Use-when line:
|
|
22
|
+
|
|
23
|
+
```md
|
|
24
|
+
Use when: short scenario.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
4. Two or three examples:
|
|
28
|
+
|
|
29
|
+
```md
|
|
30
|
+
## Example 1 — Human-readable title
|
|
31
|
+
|
|
32
|
+
**EN:**
|
|
33
|
+
```
|
|
34
|
+
/prompt-command
|
|
35
|
+
...
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**RU:**
|
|
39
|
+
```
|
|
40
|
+
/prompt-command
|
|
41
|
+
...
|
|
42
|
+
```
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Rules
|
|
46
|
+
|
|
47
|
+
- `workflow:` in front matter is mandatory and must match a sibling file in `workflows/<workflow>.md`.
|
|
48
|
+
- Prompt filename must match the workflow stem, e.g. `prompts/testing-ci-pipeline.md` for `workflows/testing-ci-pipeline.md`.
|
|
49
|
+
- Prompt header and every slash command inside examples must be canonical and match the workflow stem, e.g. `/testing-ci-pipeline`.
|
|
50
|
+
- `Workflow link command:` is deprecated and must not appear.
|
|
51
|
+
- Every example must include **both** EN and RU fenced code blocks.
|
|
52
|
+
- Every prompt must contain **2 or 3** examples.
|
|
53
|
+
- Keep command and input payload realistic and copy-paste ready.
|
|
54
|
+
- Prefer concise titles for examples.
|
|
55
|
+
- Generic scaffold placeholders such as `<project context>` are not allowed.
|
|
56
|
+
|
|
57
|
+
## Validation
|
|
58
|
+
|
|
59
|
+
Run local format checks:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
python3 scripts/lint_prompts.py
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Run full catalog consistency checks:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python3 scripts/build_docs_catalog.py --validate
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## Mapping logic
|
|
73
|
+
|
|
74
|
+
Catalog builder links prompts to workflows using the prompt front matter key:
|
|
75
|
+
|
|
76
|
+
```yaml
|
|
77
|
+
workflow: workflow-file-name
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Validation then requires prompt filename, header command, and example commands to match that same workflow stem.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Markdown docs site (search + menu)
|
|
2
|
+
|
|
3
|
+
This prototype renders a documentation site directly from markdown-derived catalog data.
|
|
4
|
+
|
|
5
|
+
## Why this stack
|
|
6
|
+
|
|
7
|
+
The user requirement was: site from markdown with search and menu. We evaluated popular GitHub projects:
|
|
8
|
+
|
|
9
|
+
- docsify: https://github.com/docsifyjs/docsify
|
|
10
|
+
- MkDocs: https://github.com/mkdocs/mkdocs
|
|
11
|
+
- Docusaurus: https://github.com/facebook/docusaurus
|
|
12
|
+
- markdown-it (parser): https://github.com/markdown-it/markdown-it
|
|
13
|
+
|
|
14
|
+
For this repo we keep it lightweight and dependency-minimal:
|
|
15
|
+
|
|
16
|
+
- catalog is generated offline by Python script from `areas/**/{workflows,prompts}`
|
|
17
|
+
- site is static HTML/CSS/JS
|
|
18
|
+
- markdown rendering via `marked` CDN
|
|
19
|
+
- full-text search via `lunr` CDN
|
|
20
|
+
|
|
21
|
+
## Run locally
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
python3 scripts/build_docs_catalog.py --output docs/site/catalog.json --validate
|
|
25
|
+
python3 -m http.server 8000
|
|
26
|
+
# open http://localhost:8000/docs/site/
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- Left menu grouped by area.
|
|
32
|
+
- Full-text search by trigger/name/description/examples.
|
|
33
|
+
- Language switcher: EN only / RU only / EN+RU.
|
|
34
|
+
- Workflow page with quality gates and source paths.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## GitHub Pages
|
|
38
|
+
|
|
39
|
+
This site can be published from GitHub Pages via Actions workflow (`.github/workflows/docs-site.yml`).
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## Workflow mapping
|
|
43
|
+
|
|
44
|
+
Prompt-to-workflow mapping is command-based: `/workflow-file-name` in prompt text links to `workflows/<workflow-file-name>.md` in the same area.
|
package/docs/site/app.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
let catalog;
|
|
2
|
+
let current = null;
|
|
3
|
+
let idx;
|
|
4
|
+
let docs = [];
|
|
5
|
+
|
|
6
|
+
const menuEl = document.getElementById('menu');
|
|
7
|
+
const contentEl = document.getElementById('content');
|
|
8
|
+
const searchEl = document.getElementById('search');
|
|
9
|
+
const langEl = document.getElementById('language');
|
|
10
|
+
|
|
11
|
+
init();
|
|
12
|
+
|
|
13
|
+
async function init() {
|
|
14
|
+
const res = await fetch('./catalog.json');
|
|
15
|
+
catalog = await res.json();
|
|
16
|
+
buildIndex();
|
|
17
|
+
renderMenu(catalog.areas);
|
|
18
|
+
if (docs[0]) renderWorkflow(docs[0].id);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function buildIndex() {
|
|
22
|
+
docs = [];
|
|
23
|
+
for (const area of catalog.areas) {
|
|
24
|
+
for (const wf of area.workflows) {
|
|
25
|
+
docs.push({
|
|
26
|
+
id: `${area.area}:${wf.trigger}`,
|
|
27
|
+
area: area.area,
|
|
28
|
+
trigger: wf.trigger,
|
|
29
|
+
name: wf.name,
|
|
30
|
+
description: wf.description,
|
|
31
|
+
examples: (wf.examples?.both || []).map((e) => `${e.en}\n${e.ru}`).join('\n'),
|
|
32
|
+
data: wf,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
idx = lunr(function () {
|
|
38
|
+
this.ref('id');
|
|
39
|
+
this.field('area');
|
|
40
|
+
this.field('trigger');
|
|
41
|
+
this.field('name');
|
|
42
|
+
this.field('description');
|
|
43
|
+
this.field('examples');
|
|
44
|
+
docs.forEach((d) => this.add(d));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function renderMenu(areas, filteredIds = null) {
|
|
49
|
+
menuEl.innerHTML = '';
|
|
50
|
+
for (const area of areas) {
|
|
51
|
+
const title = document.createElement('div');
|
|
52
|
+
title.className = 'area-title';
|
|
53
|
+
title.textContent = area.area;
|
|
54
|
+
menuEl.appendChild(title);
|
|
55
|
+
|
|
56
|
+
for (const wf of area.workflows) {
|
|
57
|
+
const id = `${area.area}:${wf.trigger}`;
|
|
58
|
+
if (filteredIds && !filteredIds.has(id)) continue;
|
|
59
|
+
const btn = document.createElement('button');
|
|
60
|
+
btn.className = 'wf-btn';
|
|
61
|
+
btn.textContent = `${wf.trigger} — ${wf.name}`;
|
|
62
|
+
btn.onclick = () => renderWorkflow(id);
|
|
63
|
+
menuEl.appendChild(btn);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function renderWorkflow(id) {
|
|
69
|
+
current = docs.find((d) => d.id === id);
|
|
70
|
+
if (!current) return;
|
|
71
|
+
const wf = current.data;
|
|
72
|
+
const lang = langEl.value;
|
|
73
|
+
|
|
74
|
+
const examples = (wf.examples?.both || []).map((ex) => {
|
|
75
|
+
const blocks = [];
|
|
76
|
+
if (lang === 'both' || lang === 'en') blocks.push(`**EN**\n\n\
|
|
77
|
+
\`\`\`\n${escapeFence(ex.en)}\n\`\`\``);
|
|
78
|
+
if (lang === 'both' || lang === 'ru') blocks.push(`**RU**\n\n\
|
|
79
|
+
\`\`\`\n${escapeFence(ex.ru)}\n\`\`\``);
|
|
80
|
+
return `### Example ${ex.number} — ${ex.title}\n\n${blocks.join('\n\n')}`;
|
|
81
|
+
}).join('\n\n');
|
|
82
|
+
|
|
83
|
+
const md = `
|
|
84
|
+
# ${wf.name}
|
|
85
|
+
\`${wf.trigger}\`
|
|
86
|
+
|
|
87
|
+
${wf.description || ''}
|
|
88
|
+
|
|
89
|
+
**Use when:** ${wf.use_when || '—'}
|
|
90
|
+
|
|
91
|
+
## Roles
|
|
92
|
+
${(wf.roles || []).map((r) => `<span class="chip">${r}</span>`).join(' ')}
|
|
93
|
+
|
|
94
|
+
## Quality gates
|
|
95
|
+
${(wf.quality_gates || []).map((q) => `- ${q}`).join('\n') || '- —'}
|
|
96
|
+
|
|
97
|
+
## Skills
|
|
98
|
+
${(wf.skill_refs || []).map((s) => `- ${s.name} (${s.path || "missing"})`).join('\n') || '- —'}
|
|
99
|
+
|
|
100
|
+
## Examples (${lang.toUpperCase()})
|
|
101
|
+
${examples || '_No examples_'}
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
<div class="meta">Workflow source: <code>${wf.workflow_path}</code><br/>Prompt source: <code>${wf.prompt_path || '—'}</code></div>
|
|
106
|
+
`;
|
|
107
|
+
|
|
108
|
+
contentEl.innerHTML = marked.parse(md);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function escapeFence(s) {
|
|
112
|
+
return (s || '').replace(/```/g, '\\\`\\\`\\\`');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
searchEl.addEventListener('input', () => {
|
|
116
|
+
const q = searchEl.value.trim();
|
|
117
|
+
if (!q) {
|
|
118
|
+
renderMenu(catalog.areas);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const results = idx.search(`${q}*`);
|
|
122
|
+
renderMenu(catalog.areas, new Set(results.map((r) => r.ref)));
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
langEl.addEventListener('change', () => {
|
|
126
|
+
if (current) renderWorkflow(current.id);
|
|
127
|
+
});
|