Let the cocomma-square $\require{AMScd}$
\begin{CD}
 A @>T>> Y\\
 @V S V V \Uparrow\_\beta @VV i\_1 V\\
 X @>>i\_0> (S\star T)
\end{CD}


where : 


* $Ob\,(S\star T) :=Ob\,X\sqcup Ob\,Y$


and $\hom\_{(S\star T)}(r,r') $ is given by : 


* $\hom\_{(S\star T)}(r,r'):=\hom\_{X}(x,x')$ if $r=x, r'=x' \in X$,
* $\hom\_{(S\star T)}(r,r'):=\hom\_{Y}(y,y')$ if $r=y, r'=y' \in Y$,
* $\emptyset$ if $r\in Y$ and $r'\in X$,
* for all $a\in A$, a formal arrow : $Sa \overset{\underline{a}}{\longrightarrow} Ta $ such that : $id\_{Ta}\circ \underline{a}=\underline{a}\circ id\_{Sa}=\underline{a}$


all this arrows subject to the relations : 


* if $r=x\in X$ and $r'=y\in Y$, two parallel arrows of $\hom\_{(S\star T)}(x,y)$ :


$$x\overset{f}{\longrightarrow}Sa\overset{\underline{a}}{\longrightarrow}Ta\overset{g}{\longrightarrow}y$$


$$x\overset{f'}{\longrightarrow}Sa'\overset{\underline{a}'}{\longrightarrow}Ta'\overset{g'}{\longrightarrow}y$$


are equal if exists a "zig-zag" in $A$ : 
$$a\overset{q\_{1}}{\longleftarrow}a\_{1}\longrightarrow...\overset{q\_{n}}{\longrightarrow}a' $$
and arrows $f\_{i}:x\longrightarrow Sa\_{i}$ in $X$ and $g\_{i}:Ta\_{i}\longrightarrow y$ in $Y$ making the diagram commutes :
\begin{CD}
x @>f>> Sa @>\underline{a}>> Ta @>g>> y \\
 @| @A Sq\_1 AA @AA Tq\_1 A @| \\
x @>f\_1>> Sa\_1 @>>\underline{a\_1}> Ta\_1 @>g\_1>> y \\
@| @V Sq\_2 VV @VV Tq\_2 V @| \\
\cdots @>>> \cdots @>>> \cdots @>>> \cdots \\
@| @V Sq\_n VV @VV Tq\_n V @| \\
x @>>f'> Sa' @>>\underline{a'}> Ta' @>>g'> y\\
\end{CD}


In this description : $\beta\_a:=\underline{a}$.


Can someone confirm me if it is right or not ? 



An "explicit" description of cocomma-categories ?
Your construction is basically correct. The only slight mistake (probably you had the correct thing in mind and this was just a mistake in phrasing) is that the formal arrows $\underline{a}$ are not sufficient to give the hom-sets $\hom\_{S\star T}(r,r')$ when $r\in X$ and $r'\in Y$; you also need the "formal composites" of these arrows with arrows in $X$ and $Y$ on either side, which then get quotiented by the equivalence relation you describe.


Here is an abstract argument for why this construction is correct.


1. Every comma object is a discrete [two-sided fibration](http://ncatlab.org/nlab/show/two-sided+fibration).
2. Dually, every cocomma object is a [codiscrete two-sided cofibration](https://ncatlab.org/nlab/show/codiscrete+cofibration).
3. In Cat, every discrete two-sided fibration is the comma of its cocomma, and every codiscrete two-sided cofibration is the cocomma of its comma. This sets up an equivalence between discrete two-sided fibrations and codiscrete two-sided cofibrations, both of which represent [profunctors](http://ncatlab.org/nlab/show/profunctor) from $Y$ to $X$.
4. Moreover, the comma of the cocomma is a reflection from arbitrary spans into discrete two-sided fibrations, and dually the cocomma of the comma is a coreflection from arbitrary cospans into codiscrete two-sided cofibrations. Thus, to compute an arbitrary cocomma, it suffices to compute the reflection of a span into discrete two-sided fibrations, regard it as a profunctor, and then take the [collage](http://ncatlab.org/nlab/show/collage) of that profunctor.
5. Every span $X \leftarrow A \to Y$ generates a free two-sided fibration $X \leftarrow X^{\mathbf{2}}\times\_X A \times\_Y Y^{\mathbf{2}} \to Y$, where $X^{\mathbf{2}}$ is the category of arrows in $X$. The objects of this free two-sided fibration are therefore triples $(a,f,g)$ where $a\in A$, $f:x\to S a$, and $g:T a \to y$, which we can regard as the above "formal composites". Now it suffices to take the discrete reflection of this over $X$ and $Y$, which amounts to imposing your zig-zag equivalence relation.


