refactor(marketplace): split cc-architect from ultraplan-local into its own plugin
Extract `/ultra-cc-architect-local` and `/ultra-skill-author-local` plus all 7 supporting agents, the `cc-architect-catalog` skill (13 files), the `ngram-overlap.mjs` IP-hygiene script, and the skill-factory test fixtures from `ultraplan-local` v2.4.0 into a new `ultra-cc-architect` plugin v0.1.0. Why: ultraplan-local had drifted into containing two distinct domains — a universal planning pipeline (brief → research → plan → execute) and a Claude-Code-specific architecture phase. Keeping them together forced users to inherit an unfinished CC-feature catalog (~11 seeds) when they only wanted the planning pipeline, and locked the catalog and the pipeline into the same release cadence. The architect was already optional and decoupled at the code level — only one filesystem touchpoint remained (auto-discovery of `architecture/overview.md`), which already handles absence gracefully. Plugin manifests: - ultraplan-local: 2.4.0 → 3.0.0 (description + keywords updated) - ultra-cc-architect: new at 0.1.0 (pre-release; catalog is thin, Fase 2/3 of skill-factory unbuilt, decision-layer empty, fallback list still needed) What stays in ultraplan-local: brief/research/plan/execute commands, all 19 planning agents, security hooks, plan auto-discovery of `architecture/overview.md` (filesystem-level contract, not code-level). What moved (28 files via git mv, R100 — full history preserved): - 2 commands, 8 agents, 1 skill catalog (13 files), 2 scripts, 8 fixtures Documentation updates: plugin CLAUDE.md and README.md for both plugins, root README.md (added ultra-cc-architect section, updated ultraplan-local section), root CLAUDE.md (added ultra-cc-architect to repo-struktur), marketplace.json (registered ultra-cc-architect), ultraplan-local CHANGELOG.md (v3.0.0 entry with migration guidance). Test verification: ngram-overlap.test.mjs passes 23/23 from new location. Memory updated: feedback_no_architect_until_v3.md now points at the new plugin and reframes the threshold around catalog maturity rather than an ultraplan-local milestone. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
97c5c9d934
commit
ab504bdf8c
48 changed files with 627 additions and 177 deletions
|
|
@ -1,357 +0,0 @@
|
|||
---
|
||||
name: ultra-cc-architect-local
|
||||
description: Match brief+research against available Claude Code features; produce architecture note with explicit gaps
|
||||
argument-hint: "--project <dir> [--fg | --quick | --no-gaps]"
|
||||
model: opus
|
||||
allowed-tools: Agent, Read, Glob, Grep, Write, Edit, Bash, AskUserQuestion
|
||||
---
|
||||
|
||||
# Ultra CC Architect Local v1.0
|
||||
|
||||
Valgfri pipeline-kommando som matcher oppgavens behov (brief +
|
||||
research) mot tilgjengelige Claude Code-features (Hooks, Subagents,
|
||||
Skills, Output Styles, MCP, Plan Mode, Worktrees, Background Agents)
|
||||
og produserer et arkitekturnotat med eksplisitt gap-seksjon.
|
||||
|
||||
Pipelinen er 5-stegs når denne kommandoen er med:
|
||||
|
||||
```
|
||||
/ultrabrief-local → brief.md
|
||||
/ultraresearch-local → research/*.md
|
||||
/ultra-cc-architect-local → architecture/overview.md + gaps.md (this command)
|
||||
/ultraplan-local → plan.md
|
||||
/ultraexecute-local → execution
|
||||
```
|
||||
|
||||
**Designprinsipp — selvlærende, men ikke autonom.** Kommandoen leser
|
||||
en kuratert skill-katalog (`skills/cc-architect-catalog/`) med seed-
|
||||
skills for hver CC-feature. Katalogen utvides over tid av en egen
|
||||
skill-factory (separat utviklingsprosess). Arkitekturnotatet er et
|
||||
forslag — brukeren godkjenner før plan-fasen.
|
||||
|
||||
**Pipeline-integrasjon.** `/ultraplan-local` oppdager automatisk
|
||||
`{project_dir}/architecture/overview.md` og bruker feature-forslagene
|
||||
som priors (ikke mandater) under exploration og planning.
|
||||
|
||||
## Phase 1 — Parse mode and validate input
|
||||
|
||||
Parse `$ARGUMENTS` for flags. Ordered precedence:
|
||||
|
||||
1. **`--project <dir>`** (PÅKREVD) — les `{dir}/brief.md` og
|
||||
auto-oppdag `{dir}/research/*.md`. Skriv til `{dir}/architecture/`.
|
||||
Hvis `{dir}` eller `{dir}/brief.md` mangler:
|
||||
```
|
||||
Error: project directory not initialized. Run /ultrabrief-local first.
|
||||
Missing: {dir}/brief.md
|
||||
```
|
||||
Sett **project_dir = {dir}**, **brief_path = {dir}/brief.md**.
|
||||
Sett **architecture_dir = {dir}/architecture/** — opprettes i
|
||||
Phase 2 hvis den mangler.
|
||||
|
||||
2. **`--fg`** — no-op alias beholdt for bakoverkompatibilitet. Alle faser
|
||||
kjører alltid inline i main-kontekst som av v2.4.0. Sett
|
||||
**execution = foreground** (eneste modus).
|
||||
|
||||
3. **`--quick`** — hopp over Phase 6 (adversarial review). Sett
|
||||
**mode = quick**.
|
||||
|
||||
4. **`--no-gaps`** — utelat `gaps.md` (gap-seksjonen beholdes internt
|
||||
i `overview.md`). Sett **mode_suffix = no-gaps**. (Kan kombineres
|
||||
med `--quick`.)
|
||||
|
||||
5. Hvis `--project` mangler: vis usage og stopp:
|
||||
|
||||
```
|
||||
Usage: /ultra-cc-architect-local --project <dir> [--fg] [--quick] [--no-gaps]
|
||||
|
||||
A project directory is required. Run /ultrabrief-local first to create one.
|
||||
|
||||
Modes:
|
||||
default Foreground pipeline → overview.md + gaps.md
|
||||
--fg No-op alias (foreground is the only mode as of v2.4.0)
|
||||
--quick Skip adversarial review (no architecture-critic pass)
|
||||
--no-gaps Do not write gaps.md (gap-section stays inside overview.md)
|
||||
|
||||
Examples:
|
||||
/ultra-cc-architect-local --project .claude/projects/2026-04-18-jwt-auth
|
||||
/ultra-cc-architect-local --project .claude/projects/2026-04-18-jwt-auth --fg
|
||||
/ultra-cc-architect-local --project .claude/projects/2026-04-18-jwt-auth --fg --quick
|
||||
|
||||
Pipeline position (5-steg):
|
||||
/ultrabrief-local → /ultraresearch-local → /ultra-cc-architect-local
|
||||
→ /ultraplan-local → /ultraexecute-local
|
||||
```
|
||||
|
||||
Ikke fortsett forbi dette steget hvis `--project` mangler.
|
||||
|
||||
### Les briefen
|
||||
|
||||
Les `{brief_path}` og parse frontmatter. Hent:
|
||||
- `task` — one-liner for stats
|
||||
- `slug` — brukes i overview-frontmatter
|
||||
- `project_dir` — hvis satt, kryssjekk mot flag; mismatch → advarsel,
|
||||
men bruk flag-verdien
|
||||
- `brief_quality` — `complete | partial`. Partial briefer er lovlige;
|
||||
noter i overview.md under "Open questions".
|
||||
|
||||
### Scan research/
|
||||
|
||||
Glob `{project_dir}/research/*.md`. Lagre liste som
|
||||
**research_paths**. Zero research er lovlig.
|
||||
|
||||
### Rapporter detektert modus
|
||||
|
||||
```
|
||||
Mode: foreground{, quick}{, no-gaps}
|
||||
Project: {project_dir}
|
||||
Brief: {brief_path} ({brief_quality})
|
||||
Research: {N} files detected
|
||||
```
|
||||
|
||||
## Phase 2 — Forbered output-mappe (foreground)
|
||||
|
||||
Opprett `{architecture_dir}` hvis den ikke eksisterer (`mkdir -p`).
|
||||
|
||||
Rapporter til brukeren:
|
||||
|
||||
```
|
||||
Architecture pipeline running in foreground.
|
||||
|
||||
Project: {project_dir}
|
||||
Brief: {brief_path}
|
||||
Research: {N} briefs
|
||||
Output: {architecture_dir}/overview.md (+ gaps.md)
|
||||
```
|
||||
|
||||
Fortsett deretter inline til neste fase.
|
||||
|
||||
> **Hvorfor foreground?** Som av v2.4.0 spawnes `architect-orchestrator`
|
||||
> ikke lenger som en background-agent. Claude Code-harnessen eksponerer
|
||||
> ikke Agent-tool til sub-agenter, så en orchestrator startet med
|
||||
> `run_in_background: true` kan ikke spawne `feature-matcher` /
|
||||
> `gap-identifier` / `architecture-critic`-swarm og degraderer stille til
|
||||
> enkelt-kontekst-resonnering. Å kjøre fasene inline i main-kontekst holder
|
||||
> swarm-en intakt. Bruk `claude -p` i et separat terminal-vindu for
|
||||
> langvarige headless-kjøringer.
|
||||
|
||||
---
|
||||
|
||||
**Alle resterende faser kjører inline i hovedkommandoens kontekst.**
|
||||
|
||||
---
|
||||
|
||||
## Phase 3 — Read inputs and audit the catalog
|
||||
|
||||
Les briefen i sin helhet. Hent Intent, Goal, Non-Goals, Constraints,
|
||||
Preferences, NFRs, Success Criteria, Research Plan, Open Questions,
|
||||
Prior Attempts.
|
||||
|
||||
Les hver research-brief sitt Executive Summary + Recommendation
|
||||
(2–3 setninger per brief).
|
||||
|
||||
Les `${CLAUDE_PLUGIN_ROOT}/skills/cc-architect-catalog/SKILL.md` for å
|
||||
lære taxonomy og lag-modellen.
|
||||
|
||||
Glob `${CLAUDE_PLUGIN_ROOT}/skills/cc-architect-catalog/*.md`
|
||||
(unntatt `SKILL.md`). Hvis glob returnerer null filer: sett
|
||||
`catalog_empty = true` (ikke feil — `feature-matcher` har fallback).
|
||||
|
||||
Opprett `{architecture_dir}` hvis den ikke eksisterer.
|
||||
|
||||
## Phase 4 — Feature matching (parallel swarm)
|
||||
|
||||
Launch to agents i parallell, i én melding:
|
||||
|
||||
- **feature-matcher** (model: sonnet). Prompt med brief_path,
|
||||
research_paths, catalog_root, project_dir.
|
||||
- **gap-identifier** (model: sonnet). Samme input. Jobber uavhengig
|
||||
av feature-matcher (off briefen og katalogen direkte).
|
||||
|
||||
Pass konkrete filstier, ikke inlined content.
|
||||
|
||||
Etter begge returnerer:
|
||||
|
||||
- `fallback_used = true` hvis `catalog_empty` eller feature-matcher
|
||||
rapporterer det.
|
||||
- Trekk ut feature-liste, rationales, confidences, integration-noter
|
||||
fra feature-matcher.
|
||||
- Trekk ut gaps, out-of-scope, katalog-dekningsstats fra
|
||||
gap-identifier.
|
||||
|
||||
## Phase 5 — Synthesize architecture/overview.md
|
||||
|
||||
Skriv `{architecture_dir}/overview.md`.
|
||||
|
||||
**Frontmatter:**
|
||||
|
||||
```yaml
|
||||
---
|
||||
task: <from brief>
|
||||
slug: <from brief>
|
||||
created: <ISO date>
|
||||
source_brief: <relative path to brief.md>
|
||||
source_research: [<list of relative research paths>]
|
||||
skills_consulted: [<list of skill `name` values>]
|
||||
cc_features_proposed: [<list of feature_id values>]
|
||||
review_status: pending
|
||||
---
|
||||
```
|
||||
|
||||
**Seks seksjoner i denne rekkefølgen:**
|
||||
|
||||
1. **Context** — 3 setninger. Paraphrase brief Intent + Goal.
|
||||
2. **Proposed CC features** — tabell: Feature | Rationale (brief
|
||||
anchor) | Supporting skill | Confidence. Én rad per foreslått
|
||||
feature. Behold primary/secondary/fallback-grupperingen som
|
||||
underseksjoner hvis feature-matcher leverte dem.
|
||||
3. **Feature composition** — hvordan features samspiller. Sekvens,
|
||||
konflikter, delte tilstander, fallbacks. 3–6 bullets.
|
||||
4. **Coverage gaps identified** — **ALLTID tilstede**, også når tom.
|
||||
Hvis tom, skriv "No coverage gaps identified — catalog covers all
|
||||
features this task requires." Hvis ikke-tom, oppsummer hver gap i
|
||||
én linje. Full issue-draft-tekst går til `gaps.md` i Phase 7 (med
|
||||
mindre `--no-gaps`).
|
||||
5. **Alternatives considered** — minst én alternativ feature-
|
||||
kombinasjon med grunn for avvisning. Rationale må referere
|
||||
briefen.
|
||||
6. **Open questions** — hva plan-fasen må avgjøre. Inkluder evt.
|
||||
uløste tradeoffs fra feature-matcher + briefens egne Open
|
||||
Questions.
|
||||
|
||||
## Phase 6 — Adversarial review
|
||||
|
||||
**Hvis mode = quick:** hopp over denne fasen. Sett
|
||||
`critic_verdict = "SKIPPED"` og `guardian_verdict = "SKIPPED"`.
|
||||
Fortsett til Phase 7.
|
||||
|
||||
Launch to reviewere i parallell:
|
||||
|
||||
- **architecture-critic** (model: sonnet). Input: overview.md,
|
||||
brief_path, research_paths, catalog_root.
|
||||
- **scope-guardian** (model: sonnet). Prompt **eksplisitt**: "The
|
||||
artifact under review is an architecture note (not an implementation
|
||||
plan). Verify that the proposed features align with brief
|
||||
requirements. Flag scope creep (features not justified by the brief)
|
||||
and scope gaps (brief requirements no proposed feature addresses)."
|
||||
|
||||
Håndter verdikter:
|
||||
|
||||
- **PASS + ALIGNED** — note ferdig. `review_status: approved`.
|
||||
- **REVISE** fra critic — revidér notatet i plass, adresser hver
|
||||
major finding. Re-launch architecture-critic én gang. Fortsatt
|
||||
REVISE → emit findings som `## Review notes`-seksjon nederst,
|
||||
fortsett. Ikke loop.
|
||||
- **BLOCK** fra critic — revidér for å fjerne blocker (typisk
|
||||
hallucinert feature eller manglende anchor). Re-launch én gang.
|
||||
Fortsatt BLOCK → `review_status: needs_rewrite`, surface findings
|
||||
i Open Questions.
|
||||
- **CREEP / GAP / MIXED** fra guardian — append `## Scope review`-
|
||||
subseksjon med funnene. Ikke re-synthesize med mindre combined med
|
||||
critic REVISE/BLOCK.
|
||||
|
||||
Oppdater `review_status` i frontmatter etter resultatet.
|
||||
|
||||
## Phase 7 — Present, write gaps.md, stats
|
||||
|
||||
**gaps.md** — skrives med mindre `--no-gaps`. Format:
|
||||
|
||||
```markdown
|
||||
# Coverage gaps — <task>
|
||||
|
||||
These are issue-ready drafts. Copy to the project's git host manually
|
||||
when you decide a gap warrants tracking. No auto-creation.
|
||||
|
||||
---
|
||||
|
||||
<gap 1 full draft>
|
||||
|
||||
---
|
||||
|
||||
<gap 2>
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
Zero gaps: skriv en-liner ("No coverage gaps identified.") slik at
|
||||
filstaten er deterministisk.
|
||||
|
||||
**Stats** — append én linje til
|
||||
`${CLAUDE_PLUGIN_DATA}/ultra-cc-architect-local-stats.jsonl`:
|
||||
|
||||
```json
|
||||
{
|
||||
"ts": "<ISO-8601>",
|
||||
"task": "<brief task, first 100 chars>",
|
||||
"mode": "<default|quick|no-gaps|quick+no-gaps|foreground|foreground+quick|...>",
|
||||
"slug": "<from brief>",
|
||||
"project_dir": "<project_dir>",
|
||||
"architecture_path": "<architecture_dir>/overview.md",
|
||||
"gaps_path": "<architecture_dir>/gaps.md | null>",
|
||||
"skills_catalog_size": <N>,
|
||||
"skills_consulted": <N>,
|
||||
"features_proposed": <N>,
|
||||
"gaps_identified": <N>,
|
||||
"critic_verdict": "<PASS|REVISE|BLOCK|SKIPPED>",
|
||||
"guardian_verdict": "<ALIGNED|CREEP|GAP|MIXED|SKIPPED>",
|
||||
"fallback_used": <true|false>
|
||||
}
|
||||
```
|
||||
|
||||
Hvis `${CLAUDE_PLUGIN_DATA}` ikke er satt eller ikke skrivbar, skip
|
||||
stats silently.
|
||||
|
||||
**Summary til brukeren:**
|
||||
|
||||
```
|
||||
## Ultra-CC-Architect Complete
|
||||
|
||||
**Task:** <task>
|
||||
**Project:** <project_dir>
|
||||
**Architecture note:** <architecture_dir>/overview.md
|
||||
**Gaps draft:** <architecture_dir>/gaps.md | skipped (--no-gaps)
|
||||
**Features proposed:** N (primary: N, secondary: N, fallback: N)
|
||||
**Gaps identified:** N
|
||||
**Review:** <critic_verdict> / <guardian_verdict>
|
||||
|
||||
### Primary features
|
||||
- <feature 1>: <one-line rationale>
|
||||
- <feature 2>: ...
|
||||
|
||||
### Top gaps (if any)
|
||||
- <gap 1>
|
||||
- <gap 2>
|
||||
|
||||
Next step: /ultraplan-local --project <project_dir>
|
||||
(the architecture note is auto-discovered as extra context)
|
||||
```
|
||||
|
||||
## Hard rules
|
||||
|
||||
- **Catalog is ground truth.** Hver foreslått feature må komme fra
|
||||
katalogens `cc_feature`-taxonomy eller feature-matcher's dokumenterte
|
||||
fallback-liste. `architecture-critic` blokkerer hallucinated
|
||||
features.
|
||||
- **Brief is anchor.** Hver foreslått feature må sitere en konkret
|
||||
brief-seksjon (Intent/Goal/Constraint/NFR/Success Criterion). Features
|
||||
uten anchor fjernes under review.
|
||||
- **Gap ≠ error.** "Coverage gaps identified"-seksjonen er **alltid**
|
||||
til stede — tom eller full. Brief §4.5 ("Mangel ≠ feil").
|
||||
- **No auto-issue-creation.** Gaps er drafts i `gaps.md`. Brukeren
|
||||
avgjør hva som postes.
|
||||
- **Sonnet for sub-agents.** Opus kun for orchestrator og hoved-
|
||||
kommandoen.
|
||||
- **Privacy.** Aldri logg secrets, tokens, credentials fra brief,
|
||||
research eller katalog.
|
||||
- **Idempotent.** Re-kjøring overskriver `overview.md` og `gaps.md`.
|
||||
Stats-linjene akkumuleres.
|
||||
- **Graceful degradation.** Tom katalog → fallback-liste. Manglende
|
||||
research → jobb kun fra brief. Partial brief → noter i Open
|
||||
Questions.
|
||||
- **Additiv i pipeline.** `/ultraplan-local` oppdager overview.md
|
||||
automatisk men må fungere uendret om filen mangler.
|
||||
- **No third-party content copied** (brief §4.4). Seed-skills er
|
||||
håndskrevet. Fremtidig skill-factory-output håndterer IP-hygiene
|
||||
separat.
|
||||
- **No n-gram computation here.** Feltet `ngram_overlap_score`
|
||||
respekteres (ikke-null > threshold → flagge), men beregnes av
|
||||
skill-factory, ikke denne kommandoen.
|
||||
|
|
@ -1,240 +0,0 @@
|
|||
---
|
||||
name: ultra-skill-author-local
|
||||
description: Skill-factory Fase 1 — generate one cc-architect-catalog draft from a local source with IP-hygiene
|
||||
argument-hint: "<source-file> [--fg | --quick]"
|
||||
model: opus
|
||||
allowed-tools: Agent, Read, Glob, Grep, Bash
|
||||
---
|
||||
|
||||
# Ultra Skill Author Local v1.0
|
||||
|
||||
Manuell, én-skill-om-gangen-generator for `cc-architect-catalog`.
|
||||
Konsumerer EN lokal kildefil (`.md` eller `.txt`), trekker ut konsept,
|
||||
drafter SKILL.md-innhold med 9-felts frontmatter, og kjører IP-hygiene
|
||||
mot kilden. Resultatet legges i `skills/cc-architect-catalog/.drafts/`
|
||||
for manuell review og promotion (`mv` til katalog-rot).
|
||||
|
||||
Dette er Channel 2 av skill-factory-strategien:
|
||||
manuell, ikke automatisk; én skill om gangen, ikke batch; lokal
|
||||
kildefil, ikke URL eller remote.
|
||||
|
||||
```
|
||||
Manual flow:
|
||||
Pick a local source → /ultra-skill-author-local <source> → review .drafts/<slug>.md
|
||||
→ if happy: mv .drafts/<slug>.md to catalog root
|
||||
→ if rejected: pipeline deletes draft; pick another source or rewrite by hand
|
||||
```
|
||||
|
||||
**Designprinsipp — én ansvarlig kjede.** Pipelinen er sekvensiell
|
||||
(ikke parallell). Hvert steg konsumerer forrige stegs output.
|
||||
`concept-extractor` bestemmer feature/layer; `skill-drafter` skriver
|
||||
draft; `ip-hygiene-checker` skårer mot kilden og enten stempler scoren
|
||||
i frontmatter eller sletter draftet.
|
||||
|
||||
## Phase 1 — Parse arguments
|
||||
|
||||
Parse `$ARGUMENTS`:
|
||||
|
||||
1. **Positional argument** (PÅKREVD) — sti til kildefil. Relativ sti
|
||||
tolkes mot CWD.
|
||||
2. **`--fg`** — foreground execution. Currently the only supported mode
|
||||
in fase-1; flag accepted for consistency med pipeline-konvensjonen
|
||||
(`--fg` finnes i alle `/ultra*-local`-kommandoer). Background-modus
|
||||
er out-of-scope for fase-1 MVP.
|
||||
3. **`--quick`** — hopp over Phase 4 (IP-hygiene) i orchestratoren.
|
||||
Emit BIG WARNING: draftet får ikke ngram_overlap_score, og det er
|
||||
IKKE klart for review. Brukes kun til å teste drafting-pipelinen i
|
||||
isolasjon.
|
||||
|
||||
Hvis positional argument mangler, vis usage og stopp:
|
||||
|
||||
```
|
||||
Usage: /ultra-skill-author-local <source-file> [--fg] [--quick]
|
||||
|
||||
A source file is required. The source must be a local .md or .txt file
|
||||
on a Claude Code feature topic (hooks, subagents, skills, output-styles,
|
||||
mcp, plan-mode, worktrees, background-agents).
|
||||
|
||||
Modes:
|
||||
default Run the pipeline foreground (concept → draft → IP-hygiene)
|
||||
--fg Same as default; flag accepted for consistency
|
||||
--quick Skip IP-hygiene scoring (for testing the drafting pipeline)
|
||||
|
||||
Examples:
|
||||
/ultra-skill-author-local ./docs/hooks-recipes.md
|
||||
/ultra-skill-author-local ./docs/mcp-pattern-notes.md --fg
|
||||
/ultra-skill-author-local ./docs/draft-source.md --quick
|
||||
|
||||
Pipeline position (skill-factory Channel 2):
|
||||
curated local source → /ultra-skill-author-local
|
||||
→ skills/cc-architect-catalog/.drafts/<slug>.md
|
||||
→ manual review → mv to catalog root
|
||||
```
|
||||
|
||||
Ikke fortsett forbi dette steget hvis kildefil mangler.
|
||||
|
||||
## Phase 2 — Validate source
|
||||
|
||||
Bash:
|
||||
|
||||
```bash
|
||||
test -f "<source>" && echo "OK"
|
||||
```
|
||||
|
||||
Hvis filen ikke finnes: stopp med tydelig feilmelding.
|
||||
|
||||
Sjekk extension:
|
||||
|
||||
```bash
|
||||
case "<source>" in
|
||||
*.md|*.txt) ;;
|
||||
*) echo "Error: source must be .md or .txt"; exit 1 ;;
|
||||
esac
|
||||
```
|
||||
|
||||
Sjekk størrelse:
|
||||
|
||||
```bash
|
||||
size=$(wc -c < "<source>")
|
||||
if [ "$size" -gt 204800 ]; then
|
||||
echo "Error: source > 200 KB (got $size bytes) — too large for fase-1 MVP"
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
200 KB-grensen kommer fra brief §Non-Goals (ingen multi-fil eller
|
||||
mega-source-håndtering i fase 1).
|
||||
|
||||
Hvis quick-modus: emit BIG WARNING:
|
||||
|
||||
```
|
||||
WARNING: --quick mode active.
|
||||
The draft will NOT be scored against the source.
|
||||
ngram_overlap_score will remain null.
|
||||
DO NOT promote this draft to the catalog root without re-running
|
||||
without --quick or scoring it manually.
|
||||
```
|
||||
|
||||
## Phase 3 — Launch the orchestrator
|
||||
|
||||
Launch `skill-author-orchestrator` (model: opus) via the `Agent` tool
|
||||
med denne prompten:
|
||||
|
||||
```
|
||||
Source file: <absolute path to source>
|
||||
Catalog root: ${CLAUDE_PLUGIN_ROOT}/skills/cc-architect-catalog/
|
||||
Plugin root: ${CLAUDE_PLUGIN_ROOT}
|
||||
Mode: <default | quick>
|
||||
|
||||
Run the full skill-author pipeline:
|
||||
1. Validate source (you re-validate; trust nothing).
|
||||
2. Launch concept-extractor (sonnet) with the source path. Parse JSON.
|
||||
3. If out_of_scope: report and stop.
|
||||
4. Launch skill-drafter (sonnet) with concept JSON + source path.
|
||||
5. If too-technical-to-paraphrase: report and stop.
|
||||
6. If mode != quick: launch ip-hygiene-checker (sonnet) with draft + source.
|
||||
7. Emit completion summary with verdict, draft path, score, next-step.
|
||||
```
|
||||
|
||||
Foreground execution (no `run_in_background`). Wait for the
|
||||
orchestrator to complete before continuing.
|
||||
|
||||
## Phase 4 — Present summary to user
|
||||
|
||||
Når orchestratoren returnerer, presenter et kompakt sammendrag:
|
||||
|
||||
```
|
||||
## Skill-Author Complete
|
||||
|
||||
Source: <source path>
|
||||
Verdict: <accepted | needs-review | rejected | out-of-scope | skipped (--quick) | error>
|
||||
Draft: <.drafts/<slug>.md | deleted | not-written>
|
||||
Score: <ngram_overlap_score | n/a>
|
||||
Longest: <longestRun shingle | n/a>
|
||||
|
||||
### Next step
|
||||
<context-specific next step>
|
||||
```
|
||||
|
||||
Next-step-tekstene matcher orchestratorens guidance:
|
||||
|
||||
- **accepted** →
|
||||
```
|
||||
Review the draft body. If you're happy:
|
||||
mv skills/cc-architect-catalog/.drafts/<slug>.md \
|
||||
skills/cc-architect-catalog/<slug>.md
|
||||
```
|
||||
- **needs-review** →
|
||||
```
|
||||
Score is in the gray zone (between accepted and rejected). Open the
|
||||
draft, compare against the source, decide whether the overlap is
|
||||
unavoidable (technical contract) or fixable (rephrase further).
|
||||
```
|
||||
- **rejected** →
|
||||
```
|
||||
Draft was deleted (containment too high or longest verbatim run too
|
||||
long). Either rephrase the source by hand and re-run, or pick a
|
||||
different source.
|
||||
```
|
||||
- **out-of-scope** →
|
||||
```
|
||||
Source did not map to a fase-1 supported cc_feature/layer combo.
|
||||
Reason: <reason from concept-extractor>
|
||||
Pick a source that explains how a CC feature works (reference layer)
|
||||
or when to reach for it (pattern layer).
|
||||
```
|
||||
- **skipped (--quick)** →
|
||||
```
|
||||
Re-run WITHOUT --quick to score the draft before promotion.
|
||||
```
|
||||
- **error** →
|
||||
```
|
||||
See error above. Common causes: source unreadable, source too large,
|
||||
drafter aborted on too-technical-to-paraphrase.
|
||||
```
|
||||
|
||||
## Phase 5 — Stats
|
||||
|
||||
Append én linje til
|
||||
`${CLAUDE_PLUGIN_DATA}/ultra-skill-author-local-stats.jsonl`:
|
||||
|
||||
```json
|
||||
{
|
||||
"ts": "<ISO-8601>",
|
||||
"source": "<source path>",
|
||||
"source_size_bytes": <N>,
|
||||
"mode": "<default|quick>",
|
||||
"verdict": "<accepted|needs-review|rejected|out-of-scope|skipped|error>",
|
||||
"cc_feature": "<from concept-extractor or null>",
|
||||
"layer": "<reference|pattern|null>",
|
||||
"slug": "<computed slug or null>",
|
||||
"draft_path": "<.drafts/<slug>.md | null>",
|
||||
"ngram_overlap_score": <float | null>,
|
||||
"longest_run": <int | null>,
|
||||
"deleted": <true|false>
|
||||
}
|
||||
```
|
||||
|
||||
Hvis `${CLAUDE_PLUGIN_DATA}` ikke er satt eller ikke skrivbar, skip
|
||||
stats silently.
|
||||
|
||||
## Hard rules
|
||||
|
||||
- **One source per invocation.** Brukeren passer én sti. Pipelinen
|
||||
produserer én draft (eller null på out-of-scope/rejected/error).
|
||||
- **No automation.** Ingen watcher, ingen batch, ingen retry. Brief
|
||||
§Non-Goals er eksplisitt.
|
||||
- **No catalog-root writes.** Drafts lever i `.drafts/` only.
|
||||
Promotion er manuell `mv` av brukeren.
|
||||
- **No source edits.** Kilden er read-only input.
|
||||
- **No URL or remote input.** Kun lokale filstier i fase-1 MVP.
|
||||
- **Foreground only in fase-1.** `--fg` aksepteres som no-op for
|
||||
konvensjon; background-modus kommer i fase 2+.
|
||||
- **Sonnet for sub-agents.** Opus kun for denne kommandoen og
|
||||
orchestratoren.
|
||||
- **Privacy.** Aldri logg kilde-innhold i stats eller summaries.
|
||||
Verdikt, scorer og stier er nok.
|
||||
- **Honesty.** Hvis pipelinen feiler, rapporter eksakt fase og grunn.
|
||||
Ikke later som om det gikk bra.
|
||||
- **--quick warning is mandatory.** Hopper du over IP-hygiene må
|
||||
brukeren vite det tydelig — draftet er IKKE klart for promotion.
|
||||
|
|
@ -64,8 +64,8 @@ Parse `$ARGUMENTS` for mode flags. Order of precedence:
|
|||
- Set **has_research_brief = true** if `{dir}/research/*.md` matches ≥ 1 file.
|
||||
- Set **has_architecture_note = true** if `{dir}/architecture/overview.md` exists.
|
||||
If set, **architecture_note_path = {dir}/architecture/overview.md**. Produced by
|
||||
the optional `/ultra-cc-architect-local` command. Missing file is fine — this is
|
||||
additive discovery, not a requirement.
|
||||
the optional `/ultra-cc-architect-local` command from the separate `ultra-cc-architect`
|
||||
plugin. Missing file is fine — this is additive discovery, not a requirement.
|
||||
|
||||
4. **`--brief <path>`** — extract the brief path. If the file does not exist:
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue