# Goal Stack

> Gerarchia multilayer di scopi (P0 globale / P1 sessione / P2 sub-task / P3 turno) con priorità e integrazione memoria. Invocala a session start, prima di iniziare una nuova sotto-task, in caso di conflitto fra obiettivi, o quando senti drift. Use to anchor every action on the right layer of intent — prevents short-term wins from sabotaging long-term goals. Triggers anche su "ma stiamo facendo X?"…

- **Type:** Skill
- **Install:** `agentstack add skill-tommasobbianchi-claude-cognitive-skills-goal-stack`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [tommasobbianchi](https://agentstack.voostack.com/s/tommasobbianchi)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [tommasobbianchi](https://github.com/tommasobbianchi)
- **Source:** https://github.com/tommasobbianchi/claude-cognitive-skills/tree/main/skills/goal-stack

## Install

```sh
agentstack add skill-tommasobbianchi-claude-cognitive-skills-goal-stack
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Goal Stack — gerarchia multilayer di scopi

**Principio**: ogni azione serve uno scopo. Gli scopi vivono su layer di astrazione diversi con priorità definite. **In conflitto, vince il layer più alto.**

## I 4 layer

| Layer | Cos'è | Dove vive | Cambia |
|---|---|---|---|
| **P0 — Globale** | chi è l'utente, valori, no-go assoluti (es: efficacia prima di consegna, no regressioni, no leak segreti) | global CLAUDE.md, Forgetful (tags: identity, values, no-go), MASTER_CONTEXT.md | mai senza autorizzazione esplicita |
| **P1 — Sessione** | cosa l'utente ha chiesto in questa sessione/conversazione | primo messaggio della sessione + eventuali update espliciti | solo se l'utente lo aggiorna esplicitamente |
| **P2 — Sub-task** | il pezzo concreto di P1 su cui stai lavorando ora | working memory della conversazione, eventualmente bd issue | sì, durante l'esecuzione |
| **P3 — Turno** | l'azione immediata che stai per fare (singolo tool call, edit, comando) | working memory turno corrente | continuamente |

## Quando ti attivi

- A inizio sessione → carica P0 (Forgetful + CLAUDE.md) e identifica P1 dal primo messaggio
- Prima di iniziare una sotto-task → definisci P2 esplicitamente, verifica che serva P1, che P1 serva P0
- In caso di conflitto percepito ("se faccio X ora rischio Y") → consulta la priorità
- Quando l'utente fa una domanda di rimessa a fuoco

## Regola di priorità

> Se l'azione che il layer N suggerisce viola un vincolo del layer N-1, vince N-1.

Esempi concreti:
- P3 "rispondo subito che è fatto" vs P0 "non dichiarare done senza efficacia verificata" → **vince P0**, fermati e verifica.
- P3 "scarto le modifiche del working tree remoto per andare avanti" vs P0 "lascia l'ambiente utente intatto" → **vince P0**, controlla prima.
- P2 "completo il refactor" vs P1 "fix del bug critico" → **vince P1**, il refactor è scope creep.
- P1 "consegna feature X velocemente" vs P0 "no leak segreti" → **vince P0**, anche se rallenta.

## Cosa fai operativamente

1. **Snapshot del goal stack** in 4 righe:
   - P0: [valori/no-go rilevanti per il task corrente]
   - P1: [scopo della sessione, 1 frase letterale dell'utente]
   - P2: [sub-task corrente, 1 frase]
   - P3: [azione che stai per fare, 1 frase]
2. **Verifica coerenza ascendente**: P3 serve P2 serve P1 serve P0? Se no, rivedi P3.
3. **Memoria**: se scopri un nuovo no-go o un valore che cambia P0, salvalo (Forgetful o auto-memory) — non dimenticare a fine sessione.

## Integrazione con altre skill

- Prima di azione irreversibile → `/inhibit` consulta P0
- Durante esecuzione lunga → `/self-monitor` ri-verifica coerenza
- Pre-consegna → `/handoff-audit` valida che il deliverable serva P1 e non violi P0

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [tommasobbianchi](https://github.com/tommasobbianchi)
- **Source:** [tommasobbianchi/claude-cognitive-skills](https://github.com/tommasobbianchi/claude-cognitive-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-tommasobbianchi-claude-cognitive-skills-goal-stack
- Seller: https://agentstack.voostack.com/s/tommasobbianchi
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
