Logotipo de Night Market Architecture Contract

Night Market Architecture Contract

Comunidad
athola
night-market-architecture-contract

States load-bearing decisions, invariants, and weak points. Use when judging a design change. Do not use for gating; use night-market-change-control.

Descripción general

Editorathola
Repositorioclaude-night-market
Nombre de la habilidadnight-market-architecture-contract
Estrellas
343
Forks
37
Archivos incluidos
Solo instrucciones
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por athola en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Night Market Architecture Contract en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/athola/claude-night-market/tree/master/.claude/skills/night-market-architecture-contract
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/athola/claude-night-market.git /tmp/claude-night-market
mkdir -p .claude/skills
cp -r /tmp/claude-night-market/.claude/skills/night-market-architecture-contract .claude/skills/night-market-architecture-contract
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Night Market Architecture Contract en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Night Market Architecture Contract automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Night Market Architecture Contract no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Night Market Architecture Contract

This skill records the design decisions that hold claude-night-market together, the invariants that enforcement code keeps true, and the weak points that are known and accepted. Read it before proposing a change that crosses a plugin boundary, touches a hook, adds a skill, or bumps a version. Every claim cites in-repo evidence: an ADR (Architecture Decision Record, in docs/adr/), a commit hash, or a checked-in enforcement file. Verify a citation before relying on it:

bash
git log --oneline -1 <hash>
rg -n "Status" docs/adr/<file>.md

Load-bearing decisions

1. Plugins are self-contained deployables

Each of the 23 plugins under plugins/ must install and run alone. There is no shared registry and no root-level shared library that plugins import at runtime (ADR-0001, Accepted). Plugins detect each other at runtime via filesystem checks and must degrade gracefully when a sibling is absent.

Cross-plugin DRY is an anti-pattern here, and that is settled by experiment, not taste. Commit 054e2679 consolidated 1164 lines of duplicated tasks_manager.py from attune, sanctum, and spec-kit into a shared root script. It broke plugin self-containment and was reverted in 29961cd2. The durable fix, d89a55c7, made the copies per-plugin and intentionally different. docs/dependency-audit.md records the per-plugin copies as the approved state. Do not re-propose the consolidation.

Practical test before you extract shared code: if a user installs only one plugin from the marketplace, does your change still work? If not, duplicate the code into each plugin instead.

2. Hooks run under host Python from a cache directory

Claude Code copies an installed plugin into a cache directory and runs its hooks under the host system Python, which can be as old as 3.9. The repo itself is Python 3.12 (root pyproject.toml, requires-python >= 3.12). Only hook scripts and their transitive import chains carry the 3.9 constraint. Five contract rules follow, each purchased with an outage:

RuleWhy (evidence)
Hook code and every transitive import must be Python 3.9 compatibledatetime.UTC (a 3.11+ alias) broke the whole hook import chain repeatedly. ruff kept auto-reverting the fix until UP017 was globally ignored (pyproject.toml line 165) and an AST scan test held the line (plugins/leyline/tests/test_python39_compat.py)
Read the hook payload as JSON on stdin, never from CLAUDE_TOOL_* env varsClaude Code does not set those env vars, so env-reading hooks were silent no-ops for months (full record: night-market-failure-archaeology SB9). Canonical reader: read_hook_payload() in plugins/abstract/hooks/shared/hook_io.py
No relative paths in hooksThe cache directory is not the repo checkout. conserve's session-start hook broke on a relative path and now inlines its JSON utilities (CHANGELOG)
Hook entrypoints must import safely under a bare interpreterAn eager import yaml in gauntlet made every git commit emit ModuleNotFoundError. Guarded in 45dd77ef (#518), anthropic deferred in 9bfc0a7a
Subprocess timeouts must sit below the budget registered in hooks.jsonherald's LLM call once outlived its registered Stop-hook budget, so the harness killed the hook with no verdict at all (full record: night-market-failure-archaeology SB7). Guard test: plugins/herald/tests/unit/test_double_shot_latte.py

CI enforcement: .github/workflows/python39-compat.yml runs two gates with uneven coverage. Gate 1 (ruff UP007, flags 3.10+ union syntax) covers 12 plugins' hooks/ dirs. Gate 2 (hook test suites inside a real Python 3.9 venv) covers only 7 plugins: abstract, conserve, egregore, imbue, leyline, memory-palace, sanctum. herald ships a Stop hook yet appears in neither gate.

3. One ecosystem version, fanned out to every manifest

.claude-plugin/marketplace.json is the version source of truth (1.9.15 as of 2026-07-02). Each plugin carries three manifests that must stay in sync with it and with each other:

  • .claude-plugin/plugin.json (name, version, component arrays)
  • .claude-plugin/metadata.json (version plus dependency hints)
  • openpackage.yml (cross-framework manifest)

Plus pyproject.toml and any __init__.py carrying __version__. Never hand-edit versions across files. Use the bumper, which finds and rewrites all of them:

bash
uv run python plugins/sanctum/scripts/update_versions.py <version>

One trap: metadata.json dependencies (for example imbue declaring "abstract": ">=2.0.0") is a separate semver namespace for capability compatibility. It does not track the marketplace version and a 2.0.0 there does not mean marketplace 2.0.0 exists.

4. Skill discovery budget is finite and overflow is silent

Claude Code loads every installed skill's description into context at 2% of the context window, with a 16,000-character fallback (ADR-0004, Accepted, updated 2026-05-21). Descriptions that exceed the budget make skills invisible with no error anywhere. That is why:

  • Each description is capped at 160 characters (docs/skill-description-guide.md), enforced by the validate-description-budget pre-commit hook backed by plugins/abstract/scripts/validate_budget.py.
  • The ecosystem-wide validator ceiling is 90,000 characters (DEFAULT_BUDGET in plugins/abstract/scripts/validate_budget.py, overridable via SLASH_COMMAND_TOOL_CHAR_BUDGET). ADR-0004 and docs/skill-description-guide.md still cite a stale 60,000 figure; the script is the enforcer. Flag the ADR for an update through change control.

When adding a skill, spend the 160 characters on trigger phrases, not on restating the name.

5. Collective memory and trust are external services

Decisions, learnings, and audit syntheses are posted to GitHub Discussions, which act as agent collective memory across sessions (ADR-0007, Accepted). There is no gh discussion subcommand: all Discussions access goes through gh api graphql. Release trust is established by SLSA attestation (Supply-chain Levels for Software Artifacts) of trust-report.json on master pushes (.github/workflows/trust-attestation.yml). The original blockchain design (ERC-8004) was dropped for cost. ADR-0008 is marked Superseded 2026-03-15 and now points at GitHub Attestations. See night-market-collective-memory for the Discussions workflow.

6. Every skill has one of three roles

docs/skill-integration-guide.md defines the role taxonomy used when judging whether a skill is an orphan or a hub:

RoleInbound refsInvoked directlyExample
entrypointlow (0-3)yessanctum:do-issue
libraryhigh (4+)rarelyimbue:proof-of-work
hook-targetvariesnoimbue:vow-enforcement

A skill with zero inbound Skill() references is only a problem if it also has no command path and no hook that loads it. Check the role before archiving anything.

Invariants

Each row names the enforcement that keeps the invariant true. If you weaken the enforcement, you own the failure mode in the third column.

InvariantEnforced byWhat breaks if violated
Hook import chains are Python 3.9 safe.github/workflows/python39-compat.yml (2 gates) plus AST scan test plugins/leyline/tests/test_python39_compat.pyTotal hook outage: one 3.11-only import kills every hook that transitively loads the module
No bare except: and errors propagate by defaultruff E ruleset (root pyproject.toml) plus CONSTITUTION.md rule 10Scanners silently drop files and report success on garbage input, and failures become invisible
All manifests carry the same ecosystem versionplugins/sanctum/scripts/update_versions.py rewrites pyproject/plugin.json/metadata.json/openpackage.yml/__init__.py in one passVersion drift across ~100 files, and marketplace.json stops being the source of truth
book/src/reference/capabilities-reference.md matches plugin registrationsscripts/capabilities-sync-check.sh via make docs-sync-check and .github/workflows/capabilities-sync.ymlPublished docs advertise components that do not exist, or hide ones that do
No new dangling Skill(plugin:name) referencesscripts/check_skill_graph_drift.py ratchet against scripts/skill_graph_baseline.jsonA model tries to load the referenced skill and silently gets nothing
Every SKILL.md has an ## Exit Criteria sectionscripts/check_skill_exit_criteria_drift.py ratchet against scripts/skill_exit_criteria_baseline.jsonSkills the model cannot tell when to stop executing (vague success criteria at scale)
Hook subprocess timeout < registered hook budgetGuard test in plugins/herald/tests/unit/test_double_shot_latte.py asserts LLM_TIMEOUT_SECONDS fits inside the hooks.json timeoutHarness kills the hook mid-flight and no verdict is emitted at all
Hook payloads are read stdin-firstplugins/abstract/hooks/shared/hook_io.py read_hook_payload() shared by hook scriptsHooks become silent no-ops (this happened, and the only symptom was a starved learning digest)

The two ratchet scripts share one mechanic: they fail a commit only when the violation count rises above the committed baseline, and they ask you to lower the baseline when the count drops. Never raise a baseline to get a commit through. That is routing around change control. One documented exception: a brand-new library skill legitimately starts uncalled, and scripts/check_skill_graph_drift.py (plus the _comment in scripts/skill_graph_baseline.json) instructs you to raise max_uncalled_libraries to record the 30-day consumer grace period that .claude/rules/shared-utility-consumer-rule.md grants. See night-market-change-control.

Known weak points

Stated plainly so nobody rediscovers them the hard way. These are open by decision or by neglect, not secrets.

  1. Skill-discovery overflow is silent. If total description overhead exceeds the context budget, skills vanish with no error (ADR-0004). The 160-char cap and validator ceiling are preventive guards. There is no runtime detection of overflow.

  2. The quality-gate federation has one real orchestrator. The gate skills (karpathy-principles, scope-guard, proof-of-work, justify, rigorous-reasoning, vow-enforcement) are designed to compose, but only egregore:quality-gate sequences the full pipeline today (docs/quality-gates.md, "Who currently orchestrates"). Every other consumer picks gates ad hoc.

  3. docs/project-brief.md, docs/specification.md, and docs/implementation-plan.md are overwritten each feature cycle. The current contents describe only the latest cycle (insight-palace bridge as of 2026-07-02). Past cycles survive only in git history. Do not cite these files as a permanent record.

  4. Duplicate module names across plugins force per-plugin mypy. Running mypy plugins/ from the root collides on duplicate module names (comment in .github/workflows/typecheck.yml). The same constraint makes root pytest exclude plugins/* (norecursedirs in root pyproject.toml, and root conftest.py documents the ImportPathMismatchError). Always run plugin tests and typechecks per plugin.

  5. mdbook is unpinned in the deploy workflow. .github/workflows/deploy-book.yml installs mdbook-version: 'latest', so an upstream mdbook release can break the book deploy with no repo change. Candidate fix: pin a version. Not done as of 2026-07-02.

  6. The autonomous loop rides an undocumented harness behavior. Egregore continues across turns because its Stop hook returns {"decision": "block", "reason": ...} and the harness feeds the reason back as the next instruction. Upstream documents Stop hooks as a gate on stopping, not as a continuation primitive, and the sanctioned alternatives (/loop, CronCreate) are session-scoped. ralph-wiggum rides the same behavior, bounded by an iteration count. Egregore's cost is bounded as of 9f31a878 (stall detection, default 3), and the reliance is not. No test can cover the harness end of it. Full record: docs/adr/0022-stop-hook-reinjection-as-continuation.md (2026-08-23).

    The reliance stands. What changed is that its failure is now observable rather than silent. plugins/egregore/scripts/continuation_baton.py has the session record each handoff with the deadline by which the next turn should have started, so reinjection quietly ceasing strands a baton with the process still alive. That is a distinct signal, where before an upstream change and a finished run looked the same from outside. Stranded means stalled rather than old, so a long healthy run never reads as one. The watchdog does not consume the baton yet, which is accepted debt in docs/adr/0023-continuation-baton-makes-a-dropped-turn-observable.md (2026-08-25).

ADR digest

All 23 records live in docs/adr/. Statuses for 0001 to 0017 were read from the files on 2026-07-02, and 0018 to 0022 on 2026-08-23.

ADRTitleStatusOne-line takeaway
0001Plugin Dependency IsolationAcceptedNo shared registry. Runtime filesystem detection with graceful degradation
0002Extract QuotaTracker to LeylineAcceptedQuota tracking moved from conjure into leyline for reuse
0003Command Description RefactoringAcceptedTwo-part descriptions: short display line, rich identification text
0004Skill Description Budget OptimizationAccepted (updated 2026-05-21)160-char cap. Budget is 2% of context, 16k fallback. Its 60k validator ceiling is stale: the enforcing script uses 90k
0005Attune Plugin Discoverability EnhancementAccepted (2026-02-05)Superpowers-style trigger phrasing for attune components
0006Self-Adapting Skill HealthAccepted (2026-02-15)Homeostatic monitoring detects degrading skills
0007GitHub Discussions as Agent Collective MemoryAccepted (2026-02-19)Decisions and learnings posted to Discussions (GraphQL only)
0008Behavioral Contract Verification FrameworkSuperseded (2026-03-15)ERC-8004 blockchain dropped for cost. GitHub Attestations (SLSA) instead
0009Sidecar Service Discovery via Port FilesAcceptedSidecar daemons publish their ports through port files
0010Stacked Diff WorkflowsAcceptedgit --update-refs plus gh pr create --base as zero-dependency stacking
0011Shared Session-Capture EnvelopeAcceptedOne JSON envelope shape for friction and trace payloads, separate files
0012Confidence-Tagged Agent ClaimsSuperseded by 0017VERIFIED/INFERRED/ASSUMPTION tags: no enforcement built
0013Operationalizing Naur Theory-BuildingSuperseded by 0017Theory-building rituals: folded into 0017's lighter form
0014Pensive Review-Skill ConsolidationAccepted (sequencing only)9 review skills, 5 sharing a verdict scaffold. Consolidation sequenced, not done
0015Over-Built Orchestrator Skill SimplificationAccepted (data-collection phase)Collect 30 days of usage data before simplifying over-built skills
0016Wire-or-Archive for Three Orphan SkillsAccepted (decisions recorded)Orphans judged on demand signal, wiring cost, and reference value
0017Decisions on Confidence-Tagging and Theory-BuildingAccepted (2026-06-18)No enforcement mechanisms and voluntary use. Supersedes 0012 and 0013
0018Reuse memory-palace's Graph for the Tome Research EngineAcceptedTome builds on the existing graph instead of a second one
0019Retire docs/superpowers/ and Record Its Shipped Design DecisionsAcceptedThe design folder became ADR text; the folder is gone
0020Detect a Thin Field with Positive Controls, Not Overlap EstimationAcceptedFrontier detection uses positive controls, not overlap math
0021PR Descriptions Carry Six Dimensions in Two RegistersAccepted (2026-08-12)Six dimensions, but only some earn a heading
0022The Autonomous Loop Continues by Riding the Stop HookAccepted, with a named open problem (2026-08-23)Stop-hook re-injection is the loop. Cost bounded by stall detection; the reliance stays open

When NOT to use

You actually needUse instead
How a change is classified, gated, and reviewednight-market-change-control
The full story of a past incident or revertnight-market-failure-archaeology
Commands to run tests, lint, release, publishnight-market-operations
Every config file, default, and env varnight-market-config-catalog
Plugin/skill/hook mechanics in the abstractclaude-code-plugin-reference
Triage for a live failurenight-market-debugging-playbook

Exit Criteria

  • You can state why cross-plugin shared code is rejected, citing ADR-0001 and commits 054e2679 and 29961cd2, and both commits resolve via git log --oneline -1 <hash>.
  • Every enforcement file named in the Invariants table exists: ls each path in the second column from the repo root with zero errors.
  • The ADR digest row count matches ls docs/adr/*.md | wc -l (17 as of 2026-07-02).
  • For a proposed change, you can name which invariant row (if any) it touches and which weak point (if any) it worsens, before writing code.
  • The version printed by rg -m1 '"version"' .claude-plugin/marketplace.json matches the version in every plugin's plugin.json you spot-check.

Provenance and maintenance

Compiled 2026-07-02 against repo v1.9.15 on branch discussions-fix-1.9.14. Skill/plugin counts drift: 198 SKILL.md files under plugins/ and 23 marketplace plugins at compile time.

Re-verify volatile facts:

bash
# ADR count and statuses
rg -m1 -n "Status" docs/adr/*.md

# Ecosystem version source of truth
rg -m1 '"version"' .claude-plugin/marketplace.json

# Discovery budget numbers (2%, 16k fallback; the ADR still says 60k)
rg -n "16,000|60,000" docs/adr/0004-skill-description-budget-optimization.md

# Enforced validator ceiling (90,000 as of 2026-07-03)
rg -n "DEFAULT_BUDGET" plugins/abstract/scripts/validate_budget.py

# Who orchestrates the gate federation today
rg -n "orchestrat" docs/quality-gates.md

# mdbook still unpinned?
rg -n "mdbook-version" .github/workflows/deploy-book.yml

# Ratchet baselines still present
ls scripts/skill_graph_baseline.json scripts/skill_exit_criteria_baseline.json

# Plugin and skill counts
python3 -c "import json;print(len(json.load(open('.claude-plugin/marketplace.json'))['plugins']))"
find plugins -name SKILL.md | wc -l

Preguntas frecuentes

¿Qué hace la habilidad de IA Night Market Architecture Contract?

States load-bearing decisions, invariants, and weak points. Use when judging a design change. Do not use for gating; use night-market-change-control.

¿Por qué usar Night Market Architecture Contract en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Night Market Architecture Contract está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Night Market Architecture Contract en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/athola/claude-night-market/tree/master/.claude/skills/night-market-architecture-contract. TypingMind lee el archivo SKILL.md de esa carpeta e instala su contenido como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Night Market Architecture Contract?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Night Market Architecture Contract?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Night Market Architecture Contract con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Night Market Architecture Contract?

Sí. athola la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇