<sspec-portable schema="6.0">

<what_is_this>
sspec is a spec-driven working protocol for AI coding agents.
It provides:
- rules: general behavior for clarifying, designing, planning, implementing,
  reviewing, and aligning with the user;
- skills: task-specific instructions loaded only when relevant;
- templates: optional files used by full sspec projects to persist specs,
  tasks, memory, requests, and docs.

You are using sspec in portable mode.
Portable mode means: use sspec rules and skills as behavioral guidance,
but do not initialize or manage sspec project state in the current workspace.
</what_is_this>

<portable_constraints>
Unless the user explicitly asks to install or manage sspec in this project:
- do not run `sspec project init`;
- do not run `sspec change new`, `sspec request new`, `sspec doc new`, or `sspec skill dominate`;
- do not create `.sspec/`, `AGENTS.md`, `spec.md`, `tasks.md`, or `memory.md`
  as sspec-managed files;
- do not treat missing `.sspec/project.md` as an error;
- do not load all SKILLs eagerly.
</portable_constraints>

<required_next_steps>
1. First read the sspec rule:
   sspec portable read rule:sspec

2. Classify the user request using the rule.

3. If the task matches a listed SKILL, read that SKILL before acting:
   sspec portable read skill:<name>

4. If a loaded SKILL references a relative file, read it with:
   sspec portable read skill:<name>/<relative-path>

5. If a loaded rule or SKILL references a HOWTO or template, read it with:
   sspec portable read howto:<name>
   sspec portable read template:<path>
</required_next_steps>

<project_to_portable_behavior_mapping>
- If sspec says to read `.sspec/project.md`:
  If it exists and is relevant, you may read it. If missing, continue using the
  user's request and codebase context.
- If sspec says to run `sspec change new ...`:
  Do not run it. Produce a structured design/spec draft in chat or in a
  user-approved file.
- If sspec says to write `spec.md`:
  Output sections such as Problem Statement, Approach, Key Changes, and Scope Summary.
- If sspec says to write `design.md`:
  Output technical design details: interfaces, diagrams, tables, data shapes, or
  behavior specs.
- If sspec says to write `tasks.md`:
  Output an execution plan/checklist with verification criteria.
- If sspec says to write `memory.md`:
  Keep concise session notes only when needed; do not persist `.sspec` memory unless
  user asks.
- If sspec says to create `revisions/`:
  Write an explicit Revision Note in chat unless user asks for files.
- If sspec uses `@align gate`:
  Stop and ask the user for confirmation before proceeding.
- If sspec uses `@align report`:
  Give a structured progress summary; continue if safe.
- If sspec says to run `sspec howto <name>`:
  Use `sspec portable read howto:<name>` to inspect the built-in HOWTO.
- If a SKILL references `./examples.md`:
  Use `sspec portable read skill:<skill>/<relative-path>`.
</project_to_portable_behavior_mapping>

<rule_index>
  <rule>
    <name>sspec</name>
    <description>Rendered sspec agent protocol from the built-in AGENTS.md template.</description>
    <read>sspec portable read rule:sspec</read>
  </rule>
</rule_index>

<available_skills>
  <skill>
    <name>sspec-align</name>
    <description>Structured, efficient agent-user synchronization at decision points. Formalized exchange over prose.</description>
    <location>builtin:sspec-align</location>
    <read>sspec portable read skill:sspec-align</read>
  </skill>
  <skill>
    <name>sspec-clarify</name>
    <description>Build shared understanding through dialogue and investigation. Produces Problem Statement + direction sketch. Reusable posture, not rigid phase.</description>
    <location>builtin:sspec-clarify</location>
    <read>sspec portable read skill:sspec-clarify</read>
  </skill>
  <skill>
    <name>sspec-design</name>
    <description>Assess scale, create change, fill spec.md + design.md, align with user. Use after clarify when ready to define the solution.</description>
    <location>builtin:sspec-design</location>
    <read>sspec portable read skill:sspec-design</read>
  </skill>
  <skill>
    <name>sspec-implement</name>
    <description>Execute tasks from tasks.md. Implement code changes, update progress. Use after plan approval.</description>
    <location>builtin:sspec-implement</location>
    <read>sspec portable read skill:sspec-implement</read>
  </skill>
  <skill>
    <name>sspec-mdtoc</name>
    <description>Pre-scan Markdown files before reading. Use `sspec tool mdtoc` to get file size + heading structure with line numbers (L&lt;n&gt; format) before reading long docs, SKILLs, or spec-docs. Eliminates blind reads.</description>
    <location>builtin:sspec-mdtoc</location>
    <read>sspec portable read skill:sspec-mdtoc</read>
  </skill>
  <skill>
    <name>sspec-plan</name>
    <description>Break design into concrete tasks. Fill tasks.md with file-level execution plan. Use after design alignment.</description>
    <location>builtin:sspec-plan</location>
    <read>sspec portable read skill:sspec-plan</read>
  </skill>
  <skill>
    <name>sspec-review</name>
    <description>User acceptance and feedback loop. Handle argue-improve cycles until user is satisfied.</description>
    <location>builtin:sspec-review</location>
    <read>sspec portable read skill:sspec-review</read>
  </skill>
  <skill>
    <name>write-patch</name>
    <description>Use patch files + `sspec tool patch` for code modifications instead of direct file edits. Trigger when user requests patch-based workflow, or the Agent system lacks built-in capability for fine-grained file modification.</description>
    <location>builtin:write-patch</location>
    <read>sspec portable read skill:write-patch</read>
  </skill>
  <skill>
    <name>write-spec-doc</name>
    <description>Create and maintain spec-docs — knowledge that code alone cannot adequately convey.</description>
    <location>builtin:write-spec-doc</location>
    <read>sspec portable read skill:write-spec-doc</read>
  </skill>
</available_skills>

</sspec-portable>
