Skip to content

Commit 2da51cf

Browse files
committed
🔀 Merge with main
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
2 parents 0e77b2f + 672063e commit 2da51cf

212 files changed

Lines changed: 11517 additions & 3994 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(git status:*)",
5+
"Bash(git log:*)",
6+
"Bash(git diff:*)",
7+
"Bash(git branch:*)",
8+
"Bash(ls:*)",
9+
"Bash(cat:*)",
10+
"Bash(find:*)",
11+
"Bash(make lint:*)",
12+
"Bash(make fmt:*)",
13+
"Bash(pre-commit run:*)",
14+
"Bash(ruff:*)",
15+
"Bash(uv run:*)"
16+
]
17+
}
18+
}
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
name: orchestrate
3+
description: Enhance any repository with CI, tests, skills, and security through phased PRs - self-replicating
4+
---
5+
6+
```mermaid
7+
flowchart TD
8+
START(["/orchestrate"]) --> HAS_SCAN{Has scan report?}
9+
10+
HAS_SCAN -->|No| SCAN["orchestrate:scan"]:::orch
11+
SCAN --> PLAN["orchestrate:plan"]:::orch
12+
HAS_SCAN -->|Yes| HAS_PLAN{Has plan?}
13+
14+
HAS_PLAN -->|No| PLAN
15+
HAS_PLAN -->|Yes| NEXT_PHASE{Next phase?}
16+
17+
NEXT_PHASE -->|Phase 2| PRECOMMIT["orchestrate:precommit<br/>PR #1"]:::orch
18+
NEXT_PHASE -->|Phase 3| TESTS["orchestrate:tests<br/>PR #2"]:::orch
19+
NEXT_PHASE -->|Phase 4| CI["orchestrate:ci<br/>PR #3"]:::orch
20+
NEXT_PHASE -->|Phase 5| SECURITY["orchestrate:security<br/>PR #4"]:::orch
21+
NEXT_PHASE -->|Phase 6| REPLICATE["orchestrate:replicate<br/>PR #5"]:::orch
22+
NEXT_PHASE -->|Phase 7| REVIEW["orchestrate:review"]:::orch
23+
24+
PRECOMMIT --> TESTS
25+
TESTS --> CI
26+
CI --> SECURITY
27+
SECURITY --> REPLICATE
28+
REPLICATE --> REVIEW
29+
REVIEW --> DONE([All phases complete])
30+
31+
classDef orch fill:#FF9800,stroke:#333,color:white
32+
classDef check fill:#FFC107,stroke:#333,color:black
33+
class HAS_SCAN,HAS_PLAN,NEXT_PHASE check
34+
```
35+
36+
> Follow this diagram as the workflow.
37+
38+
# Orchestrate Skills
39+
40+
Enhance any repository with CI, tests, skills, and security through a series of phased PRs. Each phase produces a focused, reviewable PR of 600-700 lines.
41+
42+
## Entry Point Routing
43+
44+
When `/orchestrate` is invoked, determine the action:
45+
46+
```
47+
What was provided?
48+
|
49+
+-- /orchestrate <repo-path>
50+
| New target. Clone or locate the repo, then start from scan.
51+
| Example: /orchestrate .repos/my-service
52+
|
53+
+-- /orchestrate <phase>
54+
| Jump to a specific phase. Requires scan + plan to already exist.
55+
| Example: /orchestrate ci
56+
|
57+
+-- /orchestrate status
58+
Show current orchestration state for all tracked targets.
59+
```
60+
61+
### Route logic
62+
63+
1. **`/orchestrate <repo-path>`** -- If the path points to a git repository, derive the target name from the directory basename. Check `/tmp/kagenti/orchestrate/<target>/` for existing state. If no scan report exists, invoke `orchestrate:scan`. If scan exists but no plan, invoke `orchestrate:plan`. If both exist, determine the next incomplete phase and invoke it.
64+
65+
2. **`/orchestrate <phase>`** -- Validate that `scan-report.md` and `plan.md` exist for the current target. If missing, instruct the user to run `/orchestrate <repo-path>` first. Otherwise invoke the requested phase skill directly (e.g., `orchestrate:precommit`).
66+
67+
3. **`/orchestrate status`** -- List all directories under `/tmp/kagenti/orchestrate/`, read each target's `phase-status.md`, and display a summary table showing target name, current phase, and completion percentage.
68+
69+
## Phase Status Tracking
70+
71+
All orchestration state is persisted under `/tmp/kagenti/orchestrate/<target>/`:
72+
73+
| File | Purpose |
74+
|------|---------|
75+
| `scan-report.md` | Output of `orchestrate:scan` -- repo structure, tech stack, gaps |
76+
| `plan.md` | Output of `orchestrate:plan` -- enhancement plan with phases and PR scope |
77+
| `phase-status.md` | Tracks which phases are complete, in-progress, or pending |
78+
79+
The `phase-status.md` file uses this format:
80+
81+
```markdown
82+
# Orchestration Status: <target>
83+
84+
| Phase | Status | PR | Updated |
85+
|-------|--------|----|---------|
86+
| scan | complete | -- | 2025-01-15 |
87+
| plan | complete | -- | 2025-01-15 |
88+
| precommit | complete | #42 | 2025-01-16 |
89+
| tests | in-progress | #43 | 2025-01-17 |
90+
| ci | pending | -- | -- |
91+
| security | pending | -- | -- |
92+
| replicate | pending | -- | -- |
93+
| review | pending | -- | -- |
94+
```
95+
96+
Each phase skill is responsible for updating `phase-status.md` when it starts and completes.
97+
98+
## Phase Overview
99+
100+
| Phase | Skill | PR | Description |
101+
|-------|-------|-----|-------------|
102+
| 0 | orchestrate:scan | -- | Assess target repo structure, tech stack, and gaps |
103+
| 1 | orchestrate:plan | -- | Brainstorm enhancements and produce a phased plan |
104+
| 2 | orchestrate:precommit | PR #1 | Pre-commit hooks, linting, and code formatting |
105+
| 3 | orchestrate:tests | PR #2 | Test infrastructure and initial test coverage |
106+
| 4 | orchestrate:ci | PR #3 | Comprehensive CI: lint, test, build, security scanning, dependabot, scorecard |
107+
| 5 | orchestrate:security | PR #4 | Security governance: CODEOWNERS, SECURITY.md, CONTRIBUTING.md, LICENSE |
108+
| 6 | orchestrate:replicate | PR #5 | Bootstrap Claude Code skills into the target repo |
109+
| 7 | orchestrate:review | -- | Review all orchestration PRs before merge |
110+
111+
Phases are sequential. Each PR builds on the previous one. Tests come before CI (so CI can run them) and before security (so code refactoring for security fixes has test coverage as a safety net). The scan and plan phases do not produce PRs -- they produce artifacts that guide all subsequent phases.
112+
113+
## Self-Replication
114+
115+
Phase 6 (`orchestrate:replicate`) is what makes this system fractal. It copies a starter set of Claude Code skills into the target repository, including a tailored version of the orchestrate skill itself. Once replicated, the target repo can orchestrate other repos using the same phased approach.
116+
117+
This means every repository that goes through orchestration gains the ability to orchestrate others. The skills adapt to the target's tech stack (the scan report informs what language-specific linters, test frameworks, and CI patterns to use).
118+
119+
## Quick Start
120+
121+
```bash
122+
# Clone target repo into a working directory
123+
git clone git@github.com:org/repo.git .repos/repo-name
124+
125+
# Run the full orchestration pipeline
126+
# /orchestrate .repos/repo-name
127+
128+
# Or jump to a specific phase (if scan + plan already exist)
129+
# /orchestrate precommit
130+
131+
# Check status across all targets
132+
# /orchestrate status
133+
```
134+
135+
## Related Skills
136+
137+
### Orchestrate sub-skills
138+
139+
| Skill | Description |
140+
|-------|-------------|
141+
| `orchestrate:scan` | Assess target repo structure and identify gaps |
142+
| `orchestrate:plan` | Produce a phased enhancement plan |
143+
| `orchestrate:precommit` | Add pre-commit hooks, linters, formatters |
144+
| `orchestrate:ci` | Comprehensive CI: lint, test, build, security scanning, dependabot, scorecard |
145+
| `orchestrate:tests` | Add test infrastructure and initial test coverage |
146+
| `orchestrate:security` | Security governance: CODEOWNERS, SECURITY.md, CONTRIBUTING.md, LICENSE |
147+
| `orchestrate:replicate` | Bootstrap Claude Code skills into the target |
148+
| `orchestrate:review` | Review all orchestration PRs before merge |
149+

0 commit comments

Comments
 (0)