claude-code-plugin-ref…
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops; use night-market-operations.
Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled battles; see failure-archaeology.
$ npx -y skills add athola/claude-night-market --skill night-market-collective-memory --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/night-market-collective-memoryContext preview
The summary Claude sees to decide when to auto-load this skill.
Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled battles; see failure-archaeology.
name: night-market-collective-memory description: 'Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled battles; see failure-archaeology.'
This repo treats GitHub Discussions as agent collective memory (ADR-0007, `docs/adr/0007-github-discussions-integration.md`, accepted 2026-02-19). Sessions are amnesiac by default. The memory system fixes that with four layers: Discussions (cross-session, searchable), the decision journal (append-only tradeoff and lesson logs), numbered ADRs (architecture decisions), and dated research syntheses in `docs/research/`. One caveat on the fourth layer: `docs/research/` is gitignored and machine-local, so it exists only on the authoring machine and is empty on fresh clones. A synthesis counts as collective memory only after promotion to a Discussion, ADR, or rule. This skill tells you where each kind of knowledge lives, how to read it, and how to write to it.
One hard fact first: there is NO `gh discussion` subcommand. Discussions are GraphQL-only. Minister playbooks once referenced a CLI that does not exist, and ADR-0007 replaced every reference with `gh api graphql` calls. Never guess a `gh discussion` command.
| You have | Record or read it via | |----------|----------------------| | Settled battle, revert, dead end | `night-market-failure-archaeology` skill (read only, do not relitigate) | | Tradeoff (chose A, sacrificed B) | Decision journal `docs/tradeoffs.md`, TR-NNN entry | | Lesson, failed approach, rework | Decision journal `docs/lessons-learned.md`, LL-NNN entry | | Architecture decision | Numbered ADR in `docs/adr/` (0001-0017 exist today) | | Session insight, skill stats | `[Learning]` Discussion (auto-posted daily, see below) | | Strategy debate, big design | `[War Room]` Discussion (Decisions category) | | Durable synthesis, audit result | `[Knowledge]` Discussion (Knowledge category) | | PR review finding worth keeping | `[PR Finding]` Discussion (Learnings category) | | Multi-source research output | Dated file in `docs/research/` (LOCAL ONLY: gitignored, absent on fresh clones). Promote durable syntheses to a `[Knowledge]` Discussion, ADR, or rule to make them collective memory |
Before investigating any question about this repo's history, design, or past failures, run these searches first. Re-deriving a settled answer wastes a session and risks contradicting an accepted decision.
# 1. Search Discussions by keyword (tested 2026-07-02)
gh api graphql -f query='
query($q: String!) {
search(query: $q, type: DISCUSSION, first: 10) {
nodes { ... on Discussion { number title url category { name } } }
}
}' -f q='repo:athola/claude-night-market YOUR SEARCH TERMS'
# 2. Search local docs of record. Note: docs/research/ is gitignored
# and machine-local, so it is empty on fresh clones and this
# search only helps on the authoring machine.
rg -il "your terms" docs/research/ docs/adr/ CHANGELOG.md
# 3. Check the decision journal (if the files exist yet, see below)
rg -in "your terms" docs/tradeoffs.md docs/lessons-learned.mdAlso check the `night-market-failure-archaeology` sibling for settled battles. A leyline SessionStart hook (`plugins/leyline/hooks/fetch-recent-discussions.sh`) already injects the 5 most recent Decisions discussions at session start, bounded to under 600 tokens with a 3-second timeout.
Repo categories include the four ADR-0007 ones (Decisions, Deliberations, Learnings, Knowledge) plus GitHub defaults. Title prefixes are the working taxonomy:
| Prefix | Category | What it is | Verified examples | |--------|----------|------------|-------------------| | `[Learning]` | Learnings | Daily digest, auto-posted | #601, #602 (2026-07-01/02) | | `[Knowledge]` | Knowledge | Durable syntheses | #448, #449 (April 2026 skill audit synthesis and Wave-3 backlog) | | `[War Room]` | Decisions | Strategy deliberations | #222 (collective memory design), #271 (wiring publishing into workflows) | | `[PR Finding]` | Learnings | Review findings worth keeping | #424, #595 |
Daily digests are auto-posted by abstract's Stop hook, part of the improvement feedback loop (Issue #69). The chain:
1. `plugins/abstract/hooks/skill_execution_logger.py` (PreToolUse/PostToolUse) logs skill executions. 2. `plugins/abstract/scripts/aggregate_skill_logs.py` writes `~/.claude/skills/LEARNINGS.md` with skill-performance stats (skills analyzed, high-impact issues, slow and low-rated skills). 3. `plugins/abstract/hooks/post_learnings_stop.py` (Stop hook, registered in `plugins/abstract/hooks/hooks.json`) posts a `[Learning] YYYY-MM-DD` digest, deduplicated by title. Opt-out: `~/.claude/skills/discussions/config.json`. 4. Promotion: 3 or more fire-emoji reactions on a Learnings discussion promote it to a GitHub Issue via `plugins/abstract/scripts/promote_discussion_to_issue.py` (default threshold 3, configurable via `promotion_threshold`).
List recent discussions, newest first (tested 2026-07-02, returned #602 and siblings):
gh api graphql -f query='
query($owner: String!, $name: String!) {
repository(owner: $owner, name: $name) {
discussions(first: 10,
orderBy: {field: CREATED_AT, direction: DESC}) {
nodes { number title category { name } createdAt url }
}
}
}' -f owner=athola -f name=claude-night-marketFetch one discussion by number. The number is a GraphQL `Int`, so pass it with `-F` (typed), not `-f` (string). Passing `-f` fails with a type error:
gh api graphql -f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
discussion(number: $number) {
title body url catA plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops; use night-market-operations.
States load-bearing decisions, invariants, and weak points. Use when judging a design change. Do not use for gating; use night-market-change-control.
Rebuild the dev environment: uv, Python tiers, pins, traps. Use when onboarding or toolchain breaks. Do not use for daily commands; use night-market-operations.
Classify, gate, and review changes. Use when landing a PR, releasing, or amending rules. Do not use for failure triage; use night-market-debugging-playbook.
Bind loop 'done' to unfakeable gates. Use to harden egregore/herald loops or promote completion_integrity. Not for QA gates; use night-market-validation-and-qa.
Catalog every config axis, its defaults and guards. Use when adding or auditing configuration. Do not use for running gates; use night-market-operations.