Skip to content

Commit d4b0b45

Browse files
committed
dev-loop: merge loop-orchestrator + dev-llm-wiki into one plugin
Fork of loop-orchestrator with the plan step FIXED to the bundled wiki-plan methodology (mandatory, wiki-grounded) instead of an optional pluggable role. The rest of the verification loop (TDD / PDCA / Reflexion) is unchanged. - Bundles the dev-llm-wiki semantic-layer wiki (wiki/, INDEX.md, AGENTS.md, templates/, log.md) + its wiki-plan/implement/ingest/query/lint skills. - loop-implement step 2 now hardwires wiki-plan; the `plan` capability role is removed from resolve-tools / tool-profile / examples. - Knowledge-capture loop: SessionStart injects a global ★ Insight instruction; a Stop hook harvests insights to ~/.dev-loop/queue; the on-demand knowledge-flush skill researches + verifies + dedups + routes each into the right semantic layer and opens ONE PR (no auto-merge — owner reviews). - pre-flush-pr-gate.sh (PreToolUse) enforces the research/dedup/routing pipeline by blocking a knowledge-flush `gh pr create` unless an INGEST_REPORT with all three required sections is present. Scoped to flush PRs only; node-independent. - Global install via marketplace; no repo allowlist.
0 parents  commit d4b0b45

181 files changed

Lines changed: 12695 additions & 0 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-plugin/marketplace.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3+
"name": "dev-loop",
4+
"description": "Marketplace for dev-loop — a wiki-grounded implementation loop plugin for Claude Code (loop-orchestrator + dev-llm-wiki, merged).",
5+
"owner": {
6+
"name": "choiyounggi",
7+
"url": "https://github.com/choiyounggi"
8+
},
9+
"plugins": [
10+
{
11+
"name": "dev-loop",
12+
"description": "loop-orchestrator's verification loop with the plan step fixed to a wiki-grounded planning methodology (wiki-plan) over a bundled semantic-layer wiki, plus a knowledge-capture loop that harvests verified insights and opens reviewed wiki PRs via knowledge-flush.",
13+
"category": "development",
14+
"author": {
15+
"name": "choiyounggi",
16+
"url": "https://github.com/choiyounggi"
17+
},
18+
"source": {
19+
"source": "url",
20+
"url": "https://github.com/choiyounggi/dev-loop.git"
21+
},
22+
"homepage": "https://github.com/choiyounggi/dev-loop",
23+
"version": "0.1.0",
24+
"tags": [
25+
"orchestrator",
26+
"verification-loop",
27+
"tdd",
28+
"wiki",
29+
"planning",
30+
"knowledge-base",
31+
"claude-code"
32+
]
33+
}
34+
]
35+
}

.claude-plugin/plugin.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "dev-loop",
3+
"description": "loop-orchestrator's verification loop (TDD / PDCA / Reflexion) with the plan step FIXED to a wiki-grounded planning methodology (wiki-plan): every design decision is routed to a bundled semantic-layer wiki before code is written. Adds a knowledge-capture loop — sessions emit verified insights, and knowledge-flush researches, dedups, routes, and opens a wiki PR for owner review.",
4+
"version": "0.1.0",
5+
"author": {
6+
"name": "choiyounggi",
7+
"url": "https://github.com/choiyounggi"
8+
},
9+
"homepage": "https://github.com/choiyounggi/dev-loop",
10+
"strict": false
11+
}

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Create a GitHub Release (with auto-generated notes) when a version tag is
2+
# pushed. This plugin is installed via the Claude Code marketplace (a git repo),
3+
# not npm, so there is NO npm publish step — the Release is the versioning
4+
# artifact for marketplace users.
5+
#
6+
# Usage: bump .claude-plugin/plugin.json "version", commit, then:
7+
# git tag vX.Y.Z && git push origin vX.Y.Z
8+
9+
name: Release
10+
11+
on:
12+
push:
13+
tags:
14+
- "v*"
15+
16+
permissions:
17+
contents: write # needed to create the Release
18+
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 5
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
# Refuse if the tag and plugin.json version disagree (fail-fast).
28+
- name: Verify tag matches plugin.json version
29+
run: |
30+
PKG_VERSION=$(jq -r .version .claude-plugin/plugin.json)
31+
TAG_VERSION="${GITHUB_REF_NAME#v}"
32+
echo "plugin.json: $PKG_VERSION"
33+
echo "release tag: $TAG_VERSION"
34+
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
35+
echo "::error::Tag '$TAG_VERSION' does not match plugin.json '$PKG_VERSION'. Bump plugin.json or retag."
36+
exit 1
37+
fi
38+
39+
- name: Create GitHub Release
40+
uses: softprops/action-gh-release@v2
41+
with:
42+
generate_release_notes: true

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Run the bats suite on every push to main and every PR, across macOS and Linux
2+
# (the plugin's shell scripts must be portable — design §12). Guards against
3+
# regressions before a release tag is cut.
4+
5+
name: Test
6+
7+
on:
8+
push:
9+
branches: [main]
10+
pull_request:
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: test-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
test:
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ubuntu-latest, macos-latest]
25+
runs-on: ${{ matrix.os }}
26+
timeout-minutes: 10
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Install bats + jq + tmux
32+
run: |
33+
if [ "$RUNNER_OS" = "macOS" ]; then
34+
brew install bats-core jq tmux
35+
else
36+
sudo apt-get update
37+
sudo apt-get install -y bats jq tmux
38+
fi
39+
40+
- name: Run bats suite
41+
run: bats tests/

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.orchestration/
2+
node_modules/
3+
.DS_Store
4+
*.log
5+
.claude/

AGENTS.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# dev-llm-wiki — Agent Schema
2+
3+
You are the maintainer and consumer of this wiki. This file is the schema: it defines
4+
how the wiki is structured, how you route into it, how you write pages, and how you
5+
keep it healthy. Follow it exactly. When this file and your habits disagree, this file wins.
6+
7+
## What this wiki is
8+
9+
A case-routed knowledge base of development best practices and edge cases, written
10+
**for LLM agents to load as working context**. It is not documentation for humans to
11+
browse (humans are welcome, but every formatting rule below exists to make an agent's
12+
context precise and small).
13+
14+
Three layers (Karpathy LLM-wiki pattern):
15+
16+
| Layer | Path | Mutability |
17+
|-------|------|------------|
18+
| Schema | `AGENTS.md` (this file), `templates/` | Change only with repo owner approval |
19+
| Wiki | `wiki/**` , `INDEX.md`, `log.md` | You create and update via the workflows below |
20+
| Workflows | `skills/` | Change only with repo owner approval |
21+
22+
## Directory layout
23+
24+
```
25+
INDEX.md # root map: domain → when to route there
26+
log.md # append-only chronological change log
27+
wiki/<domain>/index.md # domain map: category/page → when to load it
28+
wiki/<domain>/<category>/<page>.md
29+
templates/page.md # canonical page template
30+
skills/ingest|query|lint/ # the three operations
31+
```
32+
33+
## Routing protocol (how to consume)
34+
35+
When working on a task and you need guidance from this wiki:
36+
37+
1. Read `INDEX.md`. Match your task to a domain by its "route here when" line.
38+
- **Several domains match**: route to the domain that owns the artifact you will
39+
change (SQL/schema → databases; application code → backend; a failing system →
40+
debugging). Reading a second domain's index to check is cheap and sanctioned;
41+
bulk-loading pages from both is not.
42+
- **Best match is marked `scaffold`**: it has no pages. Use the cross-pointers in
43+
its index if any, take the next matching seeded domain, and append a `gap`
44+
entry to `log.md`.
45+
2. Read that domain's `wiki/<domain>/index.md`. Select pages by their **"load when"
46+
lines — these are the routing gate**. Load only pages whose line matches your
47+
situation.
48+
3. After loading, the page's "When this applies" should confirm the match. If it
49+
contradicts your situation, drop the page and append a `drift` entry to `log.md`
50+
(index line and page trigger disagree — a lint defect), unless the page content
51+
demonstrably serves your case anyway, in which case keep it and still log the drift.
52+
4. **Sanctioned extra hops**: when a loaded page routes you onward via an inline
53+
`[page-id]` reference or a `related:` id, follow it — the citing directive is the
54+
trigger. This is how constraint/index pages compose.
55+
5. If no page matches anywhere, answer from general knowledge **explicitly labeled
56+
not wiki-backed**, and append a `gap` entry to `log.md`.
57+
6. Apply the page's directives:
58+
- If your situation hits a listed edge case, follow the edge-case row, not the
59+
general rule.
60+
- Within a Do/decision table, when several rows match, apply the **most specific
61+
row** (rows are ordered general → specific); when a general row and a
62+
precondition-bearing row both fit, take the one that preserves the stated
63+
invariant.
64+
65+
Hard rule: never load a whole domain "for background". The index lines exist so you
66+
can decide relevance without opening pages.
67+
68+
## Page format (how to write)
69+
70+
Every page uses `templates/page.md`. Non-negotiable rules:
71+
72+
1. **One case per page.** A page answers one situation. If you are writing "and also…",
73+
split the page and cross-link under `related`.
74+
2. **≤ 120 lines of body.** Precision beats coverage. Link, don't inline.
75+
3. **Positive guidance only.** Every directive is "In situation X, do Y".
76+
Anti-patterns may only appear in the `Instead of` table, where each row MUST pair
77+
the anti-pattern with its replacement action. A "don't" without an "instead" is a
78+
lint failure — a prohibition with no replacement invites the reader to improvise,
79+
which is how hallucinations happen.
80+
4. **No vague qualifiers.** Words like "usually", "consider", "might want to",
81+
"generally", "as appropriate" are banned in directive sentences. State the
82+
condition that decides it: "When X, do A. When Y, do B." If you cannot state the
83+
condition, the knowledge is not ready for a page — file it in the ingest queue.
84+
5. **Sources are mandatory.** Frontmatter `sources:` lists the evidence
85+
(official docs, measured benchmarks, published post-mortems). Claims you cannot
86+
source get `confidence: unverified` and are surfaced by lint until sourced or removed.
87+
6. **Case branches are tables.** When behavior differs by situation, use a
88+
`| Case | Do |` table, not prose. Tables are what agents parse most reliably.
89+
90+
### Frontmatter
91+
92+
```yaml
93+
---
94+
id: <domain>-<category>-<slug> # globally unique
95+
domain: databases
96+
category: indexing
97+
applies_to: [postgresql, mysql] # or [general]
98+
confidence: verified | field-tested | unverified
99+
sources:
100+
- <url or citation>
101+
last_verified: YYYY-MM-DD
102+
related: [<page id>, ...]
103+
---
104+
```
105+
106+
`confidence` meanings — `verified`: backed by cited official docs or reproducible
107+
measurement. `field-tested`: worked in real production use; context described in the
108+
page. `unverified`: candidate knowledge; lint reports it until upgraded or removed.
109+
110+
### Section skeleton
111+
112+
```markdown
113+
# <Title — the situation, stated as a noun phrase>
114+
## When this applies # trigger conditions, 1-4 lines, matchable without reading further
115+
## Do this # directives; decision table if branching
116+
## Edge cases # | Case | Then | table
117+
## Instead of # | If you are about to | Do this instead | Why | (optional section)
118+
## Sources
119+
```
120+
121+
## Operations
122+
123+
Run these via the skill files, which contain the full step-by-step workflows:
124+
125+
- **Ingest** (`skills/wiki-ingest/SKILL.md`) — add new knowledge: route it to domain/category,
126+
merge into existing pages before creating new ones, cite sources, update indexes and `log.md`.
127+
- **Query** (`skills/wiki-query/SKILL.md`) — answer a question from the wiki with citations;
128+
if the answer required synthesis across pages and is re-askable, file it as a new page.
129+
- **Lint** (`skills/wiki-lint/SKILL.md`) — health check: unsourced claims, "don't"s without
130+
"instead"s, banned vague qualifiers, orphan pages, broken links, stale `last_verified`.
131+
132+
Two further skills use the wiki to run development work (rather than maintain the wiki):
133+
134+
- **Plan** (`skills/wiki-plan/SKILL.md`) — for a capable model: make every design decision
135+
(wiki-grounded), then decompose the work into ordered task files sized for a small
136+
model (≤3 files, ≤4 wiki pages, verifiable, self-contained), each mapping the exact
137+
wiki pages that govern it.
138+
- **Implement** (`skills/wiki-implement/SKILL.md`) — for the small model executing one task:
139+
read only the task file + its named wiki pages + named inputs, no improvisation
140+
(missing decisions are reported BLOCKED, never guessed), verify, report in a fixed format.
141+
142+
## Naming
143+
144+
- Domains and categories: lowercase kebab-case nouns (`query-optimization`).
145+
- A domain may nest one subtree level when it splits by stack/environment
146+
(`backend/common/`, `backend/java/`, `backend/node/`, `backend/python/`); page ids
147+
then include the subtree: `backend-java-jpa-<slug>`. The domain `index.md` routes
148+
concern-first (shared subtree) then stack; each stack subtree has its own `index.md`.
149+
- Page files: the situation, not the technology (`composite-index-column-order.md`,
150+
not `postgres-tips.md`).
151+
- Page ids: `<domain>-<category>-<slug>` matching the file path.
152+
153+
## Maintenance invariants
154+
155+
After any wiki change, all of these must hold (lint checks them):
156+
157+
1. Every page is listed in its domain `index.md` with an accurate "load when" line.
158+
The line must enumerate the page's **distinct use cases** (including
159+
constraint/uniqueness/design-time uses), not only its headline framing, and must
160+
not contradict the page's "When this applies". Decision tables inside pages are
161+
ordered general → specific.
162+
2. Every domain appears in `INDEX.md`.
163+
3. `log.md` has an appended entry: `## [YYYY-MM-DD] <ingest|revise|lint> | <summary>`.
164+
4. Every `related:` id and inline link resolves to an existing page.
165+
5. No page exceeds 120 body lines.

INDEX.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Root Index — Domain Map
2+
3+
Route by matching your current task to a "route here when" line, then open that
4+
domain's `index.md`. Load nothing else at this level.
5+
6+
`scaffold` domains have **no pages yet** — do not route into them expecting answers;
7+
follow the cross-pointers in their index or take the next matching seeded domain
8+
(routing protocol step 1, `AGENTS.md`).
9+
10+
| Domain | Status | Route here when |
11+
|--------|--------|-----------------|
12+
| [databases](wiki/databases/index.md) | **seeded** | Designing schemas/tables/keys, choosing or evaluating indexes, writing or optimizing queries, choosing transaction/isolation behavior |
13+
| [backend](wiki/backend/index.md) | **seeded** | Server-side application code — language-agnostic (`common/`: API contracts, idempotency, JWT, timeouts/retries, caching, jobs, transactions in app code, shared state/pools, errors) plus stack subtrees: `java/` (JPA, Spring proxies, JVM threads/memory), `node/` (event loop, promises, runtime validation, shutdown), `python/` (GIL/asyncio, pydantic, WSGI/ASGI workers, language traps) |
14+
| [frontend](wiki/frontend/index.md) | **seeded** | Web UI code: state placement, rendering performance, in-UI data fetching (races, infinite scroll), auth token handling, forms, XSS-safe output, accessibility |
15+
| [infrastructure](wiki/infrastructure/index.md) | **seeded** | CI/CD pipelines, secrets in build/deploy, container image builds, rollout/rollback strategy, observability (logs/metrics/alerting) |
16+
| [testing](wiki/testing/index.md) | **seeded** | Writing or structuring automated tests: level choice, cases/assertions, test data, mock decisions, flaky tests (release-process quality → qa) |
17+
| [qa](wiki/qa/index.md) | **seeded** | Release-quality process: release gates, regression scoping, bug reports, severity/priority triage, exploratory testing (writing automated test code → testing) |
18+
| [debugging](wiki/debugging/index.md) | **seeded** | Diagnosing a failure — finding what is wrong and why: reproducing, bisection, hypothesis testing, traces/logs, intermittent failures (fixing the diagnosed fault → its owning domain) |
19+
| [security](wiki/security/index.md) | **seeded** | Trust-boundary decisions: input validation, session-vs-token auth choice, per-resource authorization (IDOR), secrets hygiene, dependency trust, PII handling (XSS rendering → frontend; CI secrets → infrastructure; JWT implementation → backend/frontend auth) |
20+
| [platforms](wiki/platforms/index.md) | **seeded** | OS-level differences breaking code across macOS/Linux/Windows: shell portability, BSD-vs-GNU CLI, filesystem case/line endings, background services/cron, toolchain version pinning |
21+
| [mobile](wiki/mobile/index.md) | **seeded** | App-side iOS/Android/cross-platform: process death/state survival, offline-first sync, mobile-network calls, store rollout/hotfix strategy, startup time |
22+
23+
All ten domains are seeded. New categories grow via `skills/wiki-ingest/SKILL.md`.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 choiyounggi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)